Hi,
Now I have a problem with UDP:
static USOCKET UDP_data_socket = -1;
static int fnUDPListner(USOCKET SocketNr, unsigned char ucEvent, unsigned char *ucIP, unsigned short usPortNr, unsigned char *data, unsigned short usLength);
void StartListen(void) {
if (((UDP_data_socket = fnGetUDP_socket(TOS_MINIMISE_DELAY, fnUDPListner, (UDP_OPT_SEND_CS | UDP_OPT_CHECK_CS))) >= 0)) {
fnBindSocket(UDP_data_socket, RECEIVE_DATA_PORT_NUMBER); // Bind socket
}
else {
return;
}
}
static int fnUDPListner(USOCKET SocketNr, unsigned char ucEvent, unsigned char *ucIP, unsigned short usPortNr, unsigned char *data, unsigned short usLength) {
...
}
When I comment
fnBindSocket(UDP_data_socket, RECEIVE_DATA_PORT_NUMBER); // Bind socket
it works.
But if it is uncommented, the mcu crashes and resets.
Strange things is, that this worked before.
I have enough udp sockets reserved (10).
Help
Tino