Remove unneeded configurations "CanoeTest" & "erster test"
This commit is contained in:
parent
844910bdfd
commit
c181aa857b
14 changed files with 0 additions and 20310 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,79 +0,0 @@
|
|||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BS_:
|
||||
|
||||
BU_: BBB AAA
|
||||
VAL_TABLE_ switch_positions 1 "ON" 0 "OFF" ;
|
||||
|
||||
|
||||
BO_ 443 bbbMsg: 2 BBB
|
||||
SG_ switch_2B : 4|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ switch_1B : 0|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ Indicator_B : 8|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
|
||||
BO_ 426 aaaMsg: 2 AAA
|
||||
SG_ Indicator_A : 8|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ switch_2A : 4|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ switch_1A : 0|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
|
||||
|
||||
|
||||
EV_ bbbIndicator_B: 0 [0|1] "" 0 1 DUMMY_NODE_VECTOR2 BBB;
|
||||
|
||||
EV_ aaaIndicator_A: 0 [0|1] "" 0 2 DUMMY_NODE_VECTOR2 AAA;
|
||||
|
||||
EV_ bbbSwitch_2A: 0 [0|1] "" 0 3 DUMMY_NODE_VECTOR1 BBB;
|
||||
|
||||
EV_ aaaSwitch_2A: 0 [0|1] "" 0 4 DUMMY_NODE_VECTOR1 AAA;
|
||||
|
||||
EV_ bbbSwitch_1A: 0 [0|1] "" 0 5 DUMMY_NODE_VECTOR1 BBB;
|
||||
|
||||
EV_ aaaSwitch_1A: 0 [0|1] "" 0 6 DUMMY_NODE_VECTOR1 AAA;
|
||||
|
||||
BA_DEF_ "BusType" STRING ;
|
||||
BA_DEF_DEF_ "BusType" "";
|
||||
BA_ "BusType" "CAN";
|
||||
VAL_ 443 switch_2B 1 "ON" 0 "OFF" ;
|
||||
VAL_ 443 switch_1B 1 "ON" 0 "OFF" ;
|
||||
VAL_ 443 Indicator_B 1 "ON" 0 "OFF" ;
|
||||
VAL_ 426 Indicator_A 1 "ON" 0 "OFF" ;
|
||||
VAL_ 426 switch_2A 1 "ON" 0 "OFF" ;
|
||||
VAL_ 426 switch_1A 1 "ON" 0 "OFF" ;
|
||||
VAL_ bbbIndicator_B 1 "ON" 0 "OFF" ;
|
||||
VAL_ aaaIndicator_A 1 "ON" 0 "OFF" ;
|
||||
VAL_ bbbSwitch_2A 1 "ON" 0 "OFF" ;
|
||||
VAL_ aaaSwitch_2A 1 "ON" 0 "OFF" ;
|
||||
VAL_ bbbSwitch_1A 1 "ON" 0 "OFF" ;
|
||||
VAL_ aaaSwitch_1A 1 "ON" 0 "OFF" ;
|
||||
|
165
CanoeTest/DB.ini
165
CanoeTest/DB.ini
|
@ -1,165 +0,0 @@
|
|||
[View_Vehicles]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,150,
|
||||
[View_Vehicle]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,
|
||||
[View_VehicleNetworks]
|
||||
HIDDEN=3,
|
||||
ORDER=0,1,2,3,4,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,125,100,100,150,100,
|
||||
[View_VehicleNetwork]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,125,150,
|
||||
[View_VehicleNetworkTxMessages]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,55,100,50,100,100,100,150,
|
||||
[View_VehicleNetworkSignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,100,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_VehicleControlUnit]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,125,150,
|
||||
[View_VehicleGateways]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,
|
||||
[View_VehicleGatewaySignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,125,125,125,125,125,
|
||||
[View_Networks]
|
||||
HIDDEN=2,
|
||||
ORDER=0,1,2,3,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,100,100,150,100,
|
||||
[View_Network]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,150,
|
||||
[View_NetworkTxMessages]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,55,100,50,100,100,100,150,
|
||||
[View_NetworkTxSignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,100,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NetworkNodeGroup]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,100,150,
|
||||
[View_Ecus]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,150,
|
||||
[View_Ecu]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,150,
|
||||
[View_EnvVars]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,100,100,50,50,50,50,100,100,150,
|
||||
[View_EnvVar]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeGroups]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,150,
|
||||
[View_NodeGroup]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,55,150,
|
||||
[View_Nodes]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,100,150,
|
||||
[View_Node]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeTxMessages]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,55,100,50,100,100,150,
|
||||
[View_NodeTxMsg]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeTxSignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeRxSignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeTxSigs]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeRxSigs]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_Messages]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,55,100,50,100,100,100,150,
|
||||
[View_Message]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_Signals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_ValueTables]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,150,
|
||||
[View_AttrDefs]
|
||||
HIDDEN=6,
|
||||
ORDER=0,1,2,3,4,5,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,100,100,50,50,100,150,
|
|
@ -1,21 +0,0 @@
|
|||
/*@!Encoding:1252*/
|
||||
includes
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
variables
|
||||
{
|
||||
}
|
||||
|
||||
on message aaaMsg
|
||||
{
|
||||
putValue(aaaIndicator_A, this.switch_1A | this.switch_2A);
|
||||
write("1A = %d, 2A = %d, A = %d", this.switch_1A, this.switch_2A, this.switch_1A | this.switch_2A);
|
||||
}
|
||||
|
||||
on message bbbMsg
|
||||
{
|
||||
putValue(bbbIndicator_B, this.switch_1B | this.switch_2B);
|
||||
write("1B = %d, 2B = %d, B = %d", this.switch_1B, this.switch_2B, this.switch_1B | this.switch_2B);
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
/*@!Encoding:1252*/
|
||||
includes
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
variables
|
||||
{
|
||||
message aaaMsg aMsg;
|
||||
}
|
||||
|
||||
on envVar aaaSwitch_1A
|
||||
{
|
||||
aMsg.switch_1A = getValue(this);
|
||||
output(aMsg);
|
||||
}
|
||||
|
||||
on envVar aaaSwitch_2A
|
||||
{
|
||||
aMsg.switch_2A = getValue(this);
|
||||
output(aMsg);
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Panel Type="Vector.CANalyzer.Panels.PanelSerializer, Vector.CANalyzer.Panels.Serializer, Version=8.1.92.0, Culture=neutral, PublicKeyToken=null">
|
||||
<Object Type="Vector.CANalyzer.Panels.Runtime.Panel, Vector.CANalyzer.Panels.Common, Version=8.1.92.0, Culture=neutral, PublicKeyToken=null" Name="Panel" Children="Controls" ControlName="aaa">
|
||||
<Object Type="Vector.CANalyzer.Panels.Design.SwitchControl, Vector.CANalyzer.Panels.CommonControls, Version=8.1.92.0, Culture=neutral, PublicKeyToken=null" Name="SwitchControl3" ControlName="aaaIndicator_A">
|
||||
<Property Name="Name">SwitchControl3</Property>
|
||||
<Property Name="Size">23, 30</Property>
|
||||
<Property Name="Location">63, 3</Property>
|
||||
<Property Name="StateCnt">2</Property>
|
||||
<Property Name="SwitchValues">1;2;0;1</Property>
|
||||
<Property Name="SymbolConfiguration">4;1;DB;;;aaaIndicator_A;1;;;-1</Property>
|
||||
<Property Name="TabIndex">2</Property>
|
||||
<Property Name="ReadOnlyControl">True</Property>
|
||||
</Object>
|
||||
<Object Type="Vector.CANalyzer.Panels.Design.SwitchControl, Vector.CANalyzer.Panels.CommonControls, Version=8.1.92.0, Culture=neutral, PublicKeyToken=null" Name="SwitchControl2" ControlName="aaa_2A">
|
||||
<Property Name="Name">SwitchControl2</Property>
|
||||
<Property Name="Size">23, 30</Property>
|
||||
<Property Name="Location">33, 4</Property>
|
||||
<Property Name="StateCnt">2</Property>
|
||||
<Property Name="SwitchValues">1;2;0;1</Property>
|
||||
<Property Name="SymbolConfiguration">4;1;DB;;;aaaSwitch_2A;1;;;-1</Property>
|
||||
<Property Name="TabIndex">1</Property>
|
||||
</Object>
|
||||
<Object Type="Vector.CANalyzer.Panels.Design.SwitchControl, Vector.CANalyzer.Panels.CommonControls, Version=8.1.92.0, Culture=neutral, PublicKeyToken=null" Name="SwitchControl1" ControlName="aaa_1A">
|
||||
<Property Name="Name">SwitchControl1</Property>
|
||||
<Property Name="Size">23, 30</Property>
|
||||
<Property Name="Location">3, 3</Property>
|
||||
<Property Name="StateCnt">2</Property>
|
||||
<Property Name="Activation">Left</Property>
|
||||
<Property Name="SwitchValues">1;2;0;1</Property>
|
||||
<Property Name="SymbolConfiguration">4;1;DB;;;aaaSwitch_1A;1;;;-1</Property>
|
||||
<Property Name="TabIndex">0</Property>
|
||||
</Object>
|
||||
<Property Name="Name">Panel</Property>
|
||||
<Property Name="Size">144, 41</Property>
|
||||
</Object>
|
||||
</Panel>
|
|
@ -1,22 +0,0 @@
|
|||
/*@!Encoding:1252*/
|
||||
includes
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
variables
|
||||
{
|
||||
message bbbMsg bMsg;
|
||||
}
|
||||
|
||||
on envVar bbbSwitch_1A
|
||||
{
|
||||
bMsg.switch_1B = getValue(this);
|
||||
output(bMsg);
|
||||
}
|
||||
|
||||
on envVar bbbSwitch_2A
|
||||
{
|
||||
bMsg.switch_2B = getValue(this);
|
||||
output(bMsg);
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Panel Type="Vector.CANalyzer.Panels.PanelSerializer, Vector.CANalyzer.Panels.Serializer, Version=8.1.92.0, Culture=neutral, PublicKeyToken=null">
|
||||
<Object Type="Vector.CANalyzer.Panels.Runtime.Panel, Vector.CANalyzer.Panels.Common, Version=8.1.92.0, Culture=neutral, PublicKeyToken=null" Name="Panel" Children="Controls" ControlName="bbb">
|
||||
<Object Type="Vector.CANalyzer.Panels.Design.SwitchControl, Vector.CANalyzer.Panels.CommonControls, Version=8.1.92.0, Culture=neutral, PublicKeyToken=null" Name="SwitchControl3" ControlName="bbbIndicator_B">
|
||||
<Property Name="Name">SwitchControl3</Property>
|
||||
<Property Name="Size">23, 30</Property>
|
||||
<Property Name="Location">63, 3</Property>
|
||||
<Property Name="StateCnt">2</Property>
|
||||
<Property Name="SwitchValues">1;2;0;1</Property>
|
||||
<Property Name="SymbolConfiguration">4;1;DB;;;bbbIndicator_B;1;;;-1</Property>
|
||||
<Property Name="TabIndex">2</Property>
|
||||
<Property Name="ReadOnlyControl">True</Property>
|
||||
</Object>
|
||||
<Object Type="Vector.CANalyzer.Panels.Design.SwitchControl, Vector.CANalyzer.Panels.CommonControls, Version=8.1.92.0, Culture=neutral, PublicKeyToken=null" Name="SwitchControl2" ControlName="bbb_2A">
|
||||
<Property Name="Name">SwitchControl2</Property>
|
||||
<Property Name="Size">23, 30</Property>
|
||||
<Property Name="Location">33, 4</Property>
|
||||
<Property Name="StateCnt">2</Property>
|
||||
<Property Name="SwitchValues">1;2;0;1</Property>
|
||||
<Property Name="SymbolConfiguration">4;1;DB;;;bbbSwitch_2A;1;;;-1</Property>
|
||||
<Property Name="TabIndex">1</Property>
|
||||
</Object>
|
||||
<Object Type="Vector.CANalyzer.Panels.Design.SwitchControl, Vector.CANalyzer.Panels.CommonControls, Version=8.1.92.0, Culture=neutral, PublicKeyToken=null" Name="SwitchControl1" ControlName="bbb_1A">
|
||||
<Property Name="Name">SwitchControl1</Property>
|
||||
<Property Name="Size">23, 30</Property>
|
||||
<Property Name="Location">3, 3</Property>
|
||||
<Property Name="StateCnt">2</Property>
|
||||
<Property Name="Activation">Left</Property>
|
||||
<Property Name="SwitchValues">1;2;0;1</Property>
|
||||
<Property Name="SymbolConfiguration">4;1;DB;;;bbbSwitch_1A;1;;;-1</Property>
|
||||
<Property Name="TabIndex">0</Property>
|
||||
</Object>
|
||||
<Property Name="Name">Panel</Property>
|
||||
<Property Name="Size">144, 41</Property>
|
||||
</Object>
|
||||
</Panel>
|
|
@ -1,74 +0,0 @@
|
|||
/*@@var:*/
|
||||
variables
|
||||
{
|
||||
const long INVALID_SOCKET = ~0;
|
||||
const long WSA_IO_PENDING = 997;
|
||||
const long WSAEWOULDBLOCK = 10035;
|
||||
const dword INVALID_IP = 0xffffffff;
|
||||
|
||||
dword gIpAddress = INVALID_IP;
|
||||
char gIpLastErrStr[1024] = "";
|
||||
char gIpAddressStr[32] = "";
|
||||
int gIpLastErr = 0;
|
||||
|
||||
dword gUdpPort = 0;
|
||||
long gUdpSocket = INVALID_SOCKET;
|
||||
char gUdpRxBuffer[4096];
|
||||
|
||||
dword gTcpPort = 0;
|
||||
long gTcpSocket = INVALID_SOCKET;
|
||||
long gTcpDataSocket = INVALID_SOCKET;
|
||||
char gTcpRxBuffer[8192];
|
||||
|
||||
// status
|
||||
int gStatus = 0;
|
||||
const int gkSTATUS_UNINITIALISED = 0;
|
||||
const int gkSTATUS_INITIALISED = 1;
|
||||
}
|
||||
/*@@end*/
|
||||
|
||||
/*@@caplFunc:UdpReceive(dword):*///function
|
||||
long UdpRecv( dword socket)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
result = UdpReceiveFrom( socket, gUdpRxBuffer, elcount( gUdpRxBuffer));
|
||||
|
||||
if ( 0 != result)
|
||||
{
|
||||
gIpLastErr = IpGetLastSocketError( socket);
|
||||
|
||||
if ( WSA_IO_PENDING != gIpLastErr)
|
||||
{
|
||||
IpGetLastSocketErrorAsString( socket, gIpLastErrStr, elcount( gIpLastErrStr));
|
||||
|
||||
writelineex( 0, 2, "UdpReceive error (%d): %s", gIpLastErr, gIpLastErrStr);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
/*@@end*/
|
||||
|
||||
/*@@caplFunc:<newFunction>:*///function
|
||||
long TcpRecv( dword socket)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
result = TcpReceive( socket, gTcpRxBuffer, elcount( gTcpRxBuffer));
|
||||
|
||||
if ( 0 != result)
|
||||
{
|
||||
gIpLastErr = IpGetLastSocketError( socket);
|
||||
|
||||
if ( WSA_IO_PENDING != gIpLastErr)
|
||||
{
|
||||
IpGetLastSocketErrorAsString( socket, gIpLastErrStr, elcount( gIpLastErrStr));
|
||||
|
||||
writelineex( 0, 2, "TcpReceive error (%d): %s", gIpLastErr, gIpLastErrStr);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
/*@@end*/
|
|
@ -1,276 +0,0 @@
|
|||
includes
|
||||
{
|
||||
#include "IPCommon.can"
|
||||
}
|
||||
|
||||
variables
|
||||
{
|
||||
int adapterIndex = 1;
|
||||
char Server_IP[16]="";
|
||||
}
|
||||
|
||||
void SetupIp()
|
||||
{
|
||||
|
||||
char text[512] = "";
|
||||
char info[512] = "";
|
||||
int size = 512;
|
||||
long result = 0;
|
||||
dword addresses[1];
|
||||
|
||||
writeClear(0);
|
||||
|
||||
if (1 > IpGetAdapterCount())
|
||||
{
|
||||
writelineex(0, 3, "Error: There is no network interface available!");
|
||||
|
||||
stop();
|
||||
}
|
||||
|
||||
//
|
||||
// while (adapterIndex<=IpGetAdapterCount())
|
||||
// {
|
||||
// IpGetAdapterDescription(adapterIndex, text, size);
|
||||
// write("Info: Interface %d von %d: %s", adapterIndex, IpGetAdapterCount(), text);
|
||||
// adapterIndex++;
|
||||
// };
|
||||
//
|
||||
|
||||
if (0 != IpGetAdapterAddress(adapterIndex, addresses, 1))
|
||||
{
|
||||
writelineex(0, 3, "Error: Could not retrieve Ip address!");
|
||||
|
||||
stop();
|
||||
}
|
||||
|
||||
gIpAddress = addresses[0]; // the interface used
|
||||
|
||||
if (INVALID_IP == gIpAddress)
|
||||
{
|
||||
writelineex(0, 3, "Error: Ip address to be used is invalid!");
|
||||
|
||||
stop();
|
||||
}
|
||||
|
||||
IpGetAdapterDescription(adapterIndex, text, size);
|
||||
snprintf(info, size, "Interface: %s", text);
|
||||
writelineex(0, 1, info);
|
||||
|
||||
IpGetAdapterAddressAsString(adapterIndex, text, size);
|
||||
snprintf(info, size, "Ip address: %s", text);
|
||||
writelineex(0, 1, info);
|
||||
|
||||
strncpy(Server_IP, text,16);
|
||||
sysSetVariableString(sysvar::TCPIP::TcpServerIp, text);
|
||||
|
||||
IpGetAdapterMaskAsString(adapterIndex, text, size);
|
||||
snprintf(info, size, "Subnet mask: %s", text);
|
||||
writelineex(0, 1, info);
|
||||
|
||||
IpGetAdapterGatewayAsString(adapterIndex, text, size);
|
||||
snprintf(info, size, "Gateway address: %s", text);
|
||||
writelineex(0, 1, info);
|
||||
|
||||
gStatus = gkSTATUS_INITIALISED;
|
||||
}
|
||||
|
||||
on start
|
||||
{
|
||||
SetupIp();
|
||||
StartListenTcp();
|
||||
}
|
||||
|
||||
on stopMeasurement
|
||||
{
|
||||
ResetIp();
|
||||
}
|
||||
|
||||
void OnTcpListen( dword socket, long result)
|
||||
{
|
||||
if (gTcpSocket != socket)
|
||||
{
|
||||
writelineex( 0, 2, "OnTcpListen called for unexpected socket (%d).", socket);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( 0 != result)
|
||||
{
|
||||
IpGetLastSocketErrorAsString( socket, gIpLastErrStr, elcount( gIpLastErrStr));
|
||||
|
||||
writelineex( 0, 2, "OnTcpListen error (%d, %s).",
|
||||
IpGetLastSocketError( socket), gIpLastErrStr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (gTcpDataSocket != INVALID_SOCKET)
|
||||
{
|
||||
TcpClose(gTcpDataSocket);
|
||||
}
|
||||
|
||||
gTcpDataSocket = TcpAccept( socket);
|
||||
|
||||
if ( INVALID_SOCKET == gTcpDataSocket)
|
||||
{
|
||||
IpGetLastSocketErrorAsString( socket, gIpLastErrStr, elcount( gIpLastErrStr));
|
||||
|
||||
writelineex( 0, 2, "Error: TcpAccept (%d): %s",
|
||||
IpGetLastSocketError( socket), gIpLastErrStr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
TcpRecv( gTcpDataSocket);
|
||||
|
||||
writelineex( 0, 1, "Status: Tcp connection established.");
|
||||
}
|
||||
|
||||
long OnTcpReceive( dword socket, long result, dword address, dword port, char buffer[], dword size)
|
||||
{
|
||||
char addressString[64] = "";
|
||||
|
||||
if ( gTcpDataSocket != socket)
|
||||
{
|
||||
writelineex(0, 2, "OnTcpReceive called for unknown socket 0x%X", socket);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (0 != result)
|
||||
{
|
||||
IpGetLastSocketErrorAsString( socket, gIpLastErrStr, elcount( gIpLastErrStr));
|
||||
|
||||
writelineex( 0, 2, "OnTcpReceive error (%d): %s", IpGetLastSocketError( socket), gIpLastErrStr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
IpGetAddressAsString(address, addressString, elcount(addressString));
|
||||
|
||||
strncat (buffer, " Received", elcount(buffer)+10);
|
||||
SysSetVariableString(sysvar::TCPIP::TcpData, buffer);
|
||||
SysSetVariableString(sysvar::TCPIP::Connect_IP, addressString);
|
||||
|
||||
@sysvar::TCPIP::Connect_Port = port;
|
||||
SendTcpData();
|
||||
TcpRecv( socket);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OnTcpSend( dword socket, long result, char buffer[], dword size)
|
||||
{
|
||||
if ( gTcpDataSocket != socket)
|
||||
{
|
||||
writelineex(0, 2, "OnTcpSend called for unknown socket 0x%X", socket);
|
||||
}
|
||||
|
||||
if (0 != result)
|
||||
{
|
||||
IpGetLastSocketErrorAsString( socket, gIpLastErrStr, elcount( gIpLastErrStr));
|
||||
|
||||
writelineex( 0, 2, "OnTcpSend error (%d): %s", IpGetLastSocketError( socket), gIpLastErrStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
writelineex( 0, 1, "Tcp data sent successfully!");
|
||||
}
|
||||
}
|
||||
|
||||
void StartListenTcp()
|
||||
{
|
||||
gTcpPort = @sysvar::TCPIP::TcpServerPort;
|
||||
|
||||
gTcpSocket = TcpOpen(gIpAddress, gTcpPort);
|
||||
|
||||
if ( INVALID_SOCKET == gTcpSocket)
|
||||
{
|
||||
writelineex(0, 1, "Error: could not create Tcp socket!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
writelineex(0, 1, "Successfully created Tcp socket.");
|
||||
|
||||
TcpListen(gTcpSocket);
|
||||
|
||||
writelineex( 0, 1, "Listening for incoming Tcp connections on port %d", gTcpPort);
|
||||
}
|
||||
|
||||
void StopListenTcp()
|
||||
{
|
||||
if (INVALID_SOCKET != gTcpDataSocket)
|
||||
{
|
||||
TcpClose(gTcpDataSocket);
|
||||
|
||||
gTcpDataSocket = INVALID_SOCKET;
|
||||
}
|
||||
|
||||
if (INVALID_SOCKET != gTcpSocket)
|
||||
{
|
||||
TcpClose(gTcpSocket);
|
||||
|
||||
gTcpSocket = INVALID_SOCKET;
|
||||
}
|
||||
|
||||
writelineex(0, 1, "Tcp socket is closed.");
|
||||
}
|
||||
|
||||
void SendTcpData()
|
||||
{
|
||||
char buffer[560];
|
||||
|
||||
SysGetVariableString(sysvar::TCPIP::TcpData, buffer, elcount(buffer));
|
||||
|
||||
if (INVALID_SOCKET != gTcpDataSocket)
|
||||
|
||||
if (0 != TcpSend( gTcpDataSocket, buffer, strlen(buffer)))
|
||||
{
|
||||
gIpLastErr = IpGetLastSocketError( gTcpDataSocket);
|
||||
|
||||
if ( WSA_IO_PENDING != gIpLastErr)
|
||||
{
|
||||
IpGetLastSocketErrorAsString( gTcpDataSocket, gIpLastErrStr, elcount( gIpLastErrStr));
|
||||
|
||||
writelineex( 0, 2, "TcpSend error (%d): %s", gIpLastErr, gIpLastErrStr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
writelineex( 0, 1, "Tcp data sent successfully!");
|
||||
}
|
||||
}
|
||||
|
||||
void ResetIp()
|
||||
{
|
||||
if (INVALID_SOCKET != gTcpDataSocket)
|
||||
{
|
||||
TcpClose(gTcpDataSocket);
|
||||
|
||||
gTcpDataSocket = INVALID_SOCKET;
|
||||
}
|
||||
|
||||
if (INVALID_SOCKET != gTcpSocket)
|
||||
{
|
||||
TcpClose(gTcpSocket);
|
||||
|
||||
gTcpSocket = INVALID_SOCKET;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
on key 'a'
|
||||
{
|
||||
SendTcpData();
|
||||
}
|
||||
|
||||
on key 's'
|
||||
{
|
||||
StartListenTcp();
|
||||
}
|
||||
|
||||
|
||||
on key 'S'
|
||||
{
|
||||
StopListenTcp();
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,18 +0,0 @@
|
|||
includes
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
variables
|
||||
{
|
||||
int gedrueckt=0;
|
||||
}
|
||||
|
||||
on sysvar senden
|
||||
{
|
||||
if (gedrueckt==1) {return;};
|
||||
if (@senden==0) {gedrueckt=0;}; // Rücksetzen wenn Button losgelassen
|
||||
|
||||
write ("Gedrueckt");
|
||||
|
||||
}
|
|
@ -1,191 +0,0 @@
|
|||
includes
|
||||
{
|
||||
#include "IPCommon.can"
|
||||
}
|
||||
|
||||
variables
|
||||
{
|
||||
char Local_IP[15];
|
||||
// char Server_IP[15]="192.168.178.49";
|
||||
}
|
||||
|
||||
void SetupIp()
|
||||
{
|
||||
int adapterIndex = 1;
|
||||
char text[512] = "";
|
||||
char info[512] = "";
|
||||
int size = 512;
|
||||
long result = 0;
|
||||
dword addresses[1];
|
||||
|
||||
writeClear(0);
|
||||
|
||||
if (1 > IpGetAdapterCount())
|
||||
{
|
||||
writelineex(0, 3, "Error: There is no network interface available!");
|
||||
|
||||
stop();
|
||||
}
|
||||
|
||||
if (0 != IpGetAdapterAddress(adapterIndex, addresses, 1))
|
||||
{
|
||||
writelineex(0, 3, "Error: Could not retrieve ip address!");
|
||||
|
||||
stop();
|
||||
}
|
||||
|
||||
gIpAddress = addresses[0]; // the interface used
|
||||
|
||||
if (INVALID_IP == gIpAddress)
|
||||
{
|
||||
writelineex(0, 3, "Error: ip address to be used is invalid!");
|
||||
|
||||
stop();
|
||||
}
|
||||
|
||||
IpGetAdapterDescription(adapterIndex, text, size);
|
||||
snprintf(info, size, "Interface: %s", text);
|
||||
writelineex(0, 1, info);
|
||||
|
||||
IpGetAdapterAddressAsString(adapterIndex, text, size);
|
||||
snprintf(info, size, "Ip address: %s", text);
|
||||
strncpy(Local_IP, text,16);
|
||||
sysSetVariableString(sysvar::TCPIP::TcpClientIp, text);
|
||||
|
||||
writelineex(0, 1, info);
|
||||
|
||||
// SysSetVariableString(sysvar::TCPIP::TcpClientIp, text);
|
||||
|
||||
IpGetAdapterMaskAsString(adapterIndex, text, size);
|
||||
snprintf(info, size, "Subnet mask: %s", text);
|
||||
writelineex(0, 1, info);
|
||||
|
||||
IpGetAdapterGatewayAsString(adapterIndex, text, size);
|
||||
snprintf(info, size, "Gateway address: %s", text);
|
||||
writelineex(0, 1, info);
|
||||
|
||||
gStatus = gkSTATUS_INITIALISED;
|
||||
}
|
||||
|
||||
on preStart
|
||||
{
|
||||
setStartdelay(1000);
|
||||
}
|
||||
|
||||
on start
|
||||
{
|
||||
SetupIp();
|
||||
ConnectTcp();
|
||||
}
|
||||
|
||||
on key 'd'
|
||||
{
|
||||
SendTcpData();
|
||||
}
|
||||
|
||||
void ConnectTcp()
|
||||
{
|
||||
char buffer[64];
|
||||
dword serverIp;
|
||||
long fehler;
|
||||
|
||||
SysGetVariableString(sysvar::TCPIP::TcpServerIp, buffer, elcount(buffer));
|
||||
// strncpy(buffer, Server_IP,16);
|
||||
|
||||
serverIp = IpGetAddressAsNumber(buffer);
|
||||
|
||||
if (INVALID_IP == serverIp)
|
||||
{
|
||||
writelineex(0, 1, "Error: invalid server Ip address!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// gTcpPort = @sysvar::TCPIP::TcpClientPort;
|
||||
gTcpPort = 12345;
|
||||
|
||||
gTcpDataSocket = TcpOpen(gIpAddress, gTcpPort);
|
||||
|
||||
if ( INVALID_SOCKET == gTcpDataSocket)
|
||||
{
|
||||
writelineex(0, 1, "Error: could not open Tcp socket!");
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
writelineex(0, 1, "Tcp socket opened.");
|
||||
}
|
||||
|
||||
if (0 == TcpConnect(gTcpDataSocket, serverIp, @sysvar::TCPIP::TcpServerPort))
|
||||
{
|
||||
writelineex(0, 1, "Successfully connected to server %s:%d", buffer, @sysvar::TCPIP::TcpServerPort);
|
||||
|
||||
TcpRecv( gTcpDataSocket);
|
||||
}
|
||||
else
|
||||
{
|
||||
fehler=IpGetLastSocketError(gTcpDataSocket);
|
||||
|
||||
write ("No Port-Connection %d", fehler);
|
||||
}
|
||||
}
|
||||
|
||||
void SendTcpData()
|
||||
{
|
||||
char buffer[512];
|
||||
|
||||
strncpy (buffer, "TestData2", 12);
|
||||
|
||||
// SysGetVariableString(sysvar::TCPIP::TcpClientData, buffer, elcount(buffer));
|
||||
|
||||
if (INVALID_SOCKET == gTcpDataSocket)
|
||||
{
|
||||
writelineex( 0, 2, "Tcp socket is invalid!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
write ("Sende Länge %d", strlen(buffer));
|
||||
|
||||
if (0 != TcpSend( gTcpDataSocket, buffer, strlen(buffer)))
|
||||
{
|
||||
gIpLastErr = IpGetLastSocketError( gTcpDataSocket);
|
||||
|
||||
if ( WSA_IO_PENDING != gIpLastErr)
|
||||
{
|
||||
IpGetLastSocketErrorAsString( gTcpDataSocket, gIpLastErrStr, elcount( gIpLastErrStr));
|
||||
|
||||
writelineex( 0, 2, "Tcp send error (%d): %s", gIpLastErr, gIpLastErrStr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
writelineex( 0, 1, "Tcp data sent successfully!");
|
||||
}
|
||||
}
|
||||
|
||||
void OnTcpConnect( dword socket, long result)
|
||||
{
|
||||
if ( gTcpDataSocket != socket)
|
||||
{
|
||||
writelineex(0, 2, "OnTcpConnect called for unknown socket 0x%X", socket);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (0 != result)
|
||||
{
|
||||
IpGetLastSocketErrorAsString( socket, gIpLastErrStr, elcount( gIpLastErrStr));
|
||||
|
||||
writelineex( 0, 2, "OnTcpConnect error (%d): %s", IpGetLastSocketError( socket), gIpLastErrStr);
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
writelineex(0, 1, "Successfully connected to server via Tcp");
|
||||
|
||||
TcpRecv( socket);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue