Hello,
It is possible to hear more than one UDP port.
By default the demo will create and bind a socket to the port 1234 you will need to create and bind to another port (available in the range) as it is done with the first one.
To do so you will need to open the app_socket_utils.c file and add the next modifications
static int32_t mSockfd = -1;
static int32_t mSockfdNewCustom = -1;
sockaddrIn6_t mSsRx = {0};
sockaddrIn6_t mSsRxNewCustom = {0};
mSsRx.sin6_family = AF_INET6;
mSsRx.sin6_port = UDP_PORT;
IP_AddrCopy(&mSsRx.sin6_addr, &in6addr_any);
mSockfd = socket(mSsRx.sin6_family, SOCK_DGRAM, IPPROTO_UDP);
bind(mSockfd, (sockaddrStorage_t*)&mSsRx, sizeof(sockaddrStorage_t));
mSsRxNewCustom.sin6_family = AF_INET6;
mSsRxNewCustom.sin6_port = 8080;
IP_AddrCopy(&mSsRxNewCustom.sin6_addr, &in6addr_any);
mSockfdNewCustom = socket(mSsRxNewCustom.sin6_family, SOCK_DGRAM, IPPROTO_UDP);
bind(mSockfdNewCustom, (sockaddrStorage_t*)&mSsRxNewCustom, sizeof(sockaddrStorage_t));
Also you will need to check the following functions:
- void APP_InitUserSockets
- static void APP_InitSocketServer
Best Regards,
Estephania