hi Ti engineers,
I creat a udp server, and broadcast a message, but alway send failed, from the debug, i can see CC3200 connected the AP and the udp socket creating is OK(UDP BC Server socketid is 3 and port:2415):
INFO SimpleLinkWlanEventHandler STA UP!
[NETAPP EVENT] IP Acquired: IP=192.168.1.104 , Gateway=192.168.1.1
but when i send, the debug error message is:
[SOCK ERROR] - TX FAILED : socket 3 , reason (-9)
below is my code snippet, pls help to check what is the problem?
// Initialize AP security params
SecurityParams.Key = (signed char*)SECURITY_KEY;
SecurityParams.KeyLen = strlen(SECURITY_KEY);
SecurityParams.Type = SECURITY_TYPE;
//
// Connect to the Access Point
//
lRetVal = Network_IF_ConnectAP(SSID_NAME, SecurityParams);
if(lRetVal < 0)
{
UART_PRINT("Connection to AP failed\n\r",lRetVal);
LOOP_FOREVER();
}
//
// Disable the LED blinking Timer as Device is connected to AP
//
LedTimerDeinitStop();
//
// Switch ON RED LED to indicate that Device acquired an IP
//
GPIO_IF_LedOn(MCU_IP_ALLOC_IND);
//
// Create UDP socket
//
iSocketDesc = sl_Socket(AF_INET, SOCK_DGRAM, 0);
if(iSocketDesc < 0)
{
DBG_PRINT("HIB: Socket create failed\n\r");
goto end;
}
DBG_PRINT("HIB: Socket created\n\r");
//
// Assign socket structure values for a braodcast message
//
sBroadcastAddr.sin_family = AF_INET;
sBroadcastAddr.sin_addr.s_addr= sl_Htonl(0xFFFFFFFF);
sBroadcastAddr.sin_port= sl_Htons(APP_UDP_PORT);
//
// Broadcast message
//
lRetVal = sl_SendTo(iSocketDesc, (char *)&pcBroadcastMessage[0],
sizeof(pcBroadcastMessage), 0,
(struct sockaddr *)&sBroadcastAddr,sizeof(sBroadcastAddr));
if(lRetVal < 0)
{
ERR_PRINT(lRetVal);
LOOP_FOREVER();
}