custom UDP messages [message #1818556] |
Thu, 19 December 2019 09:35  |
Eclipse User |
|
|
|
Hello everybody,
I am trying to create a block, which sends out a custom UDP message.
I already have a block using the "sendDataOnUDP" function and in debug messages in the console I can see that it is sending out the right amount of bits.
But still the message seems to get stuck somewhere as I cannot see anything while watching the network via wireshark.
The code for execute function looks like this:
void FORTE_WriteProp::executeEvent(int pa_nEIID){
paket_t WP;
char* acIPAddr = "xxx.xxx.xxx.xxx"; /
unsigned short Port;
Port = xxxxx;
CBSDSocketInterface::TUDPDestAddr DestAddr;
const char* IP = "xxx.xxx.xxx.xxx";
DestAddr.sin_family = AF_INET;
DestAddr.sin_port = htons(Port);
DestAddr.sin_addr.s_addr = inet_addr(IP);
CBSDSocketInterface::TSocketDescriptor Socket;
char* packet;
packet = (char*)℘
switch(pa_nEIID){
case scm_nEventINITID:
break;
case scm_nEventREQID:
int test;
Socket = CIPComSocketHandler::openUDPSendPort(acIPAddr, Port, &DestAddr);
test =CIPComSocketHandler::sendDataOnUDP(Socket, &DestAddr, packet, sizeof(WP));
break;
}
}
Compiling works without problems and I get return values from the functions. But probably there is something in the forte code which I didnt consider.
Does anybody have an idea?
best regards
[Updated on: Thu, 19 December 2019 11:24] by Moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07786 seconds