Part Number: TMS320C6678
Other Parts Discussed in Thread: SYSBIOS
Tool/software: TI-RTOS
Hi,
I'm trying to create an UDP client socket for port 2 in an existing project which is already running for raw socket. The project is using TIRTOS. I've included NDK in my project and enabled IP block in network layer. I've used "Ip.ifIdx = 2;" to configure it for port 2 in .cfg file. Below is my tool configuration.
xcdtool version : 3.25.5.94
IPC : 3.21.0.07
NDK : 2.24.3.35
SYS/Bios : 6.37.2.27
I've provided hook function for network open hook and that hook function is getting called. Inside the hook function I've created a task and from the task i'm trying to send some data. I'm not receiving the data in opposite side (opposite side PC is used to capture the data using wireshark). The code snippet is given below. Kindly point me what other things need to be consider.
SOCKET udpsockfd;
void nw_open_hook()
{
Task_Start(&oUDPTsk);
}
void nw_close_hook()
{
}
//UDP Client
void Ethernet_UDP_Task(void)
{
struct sockaddr_in servaddr;
char *hello = "Hello from client";
uart_write("UDP task created\n");
if ((udpsockfd = socket (AF_INET, SOCK_DGRAM, 0)) == 0){
uart_write("UDP socket failed\n");
return;
}
memset(&servaddr, 0, sizeof(servaddr));
// Filling server information
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(PORT);
servaddr.sin_addr.s_addr = INADDR_ANY;
while (1){
sendto(udpsockfd, (char *)hello, strlen(hello),
0/*MSG_CONFIRM*/, (struct sockaddr *) &servaddr,
sizeof(servaddr));
Task_sleep(1000);
}
}
Along with that how to read back the information about the IP and MAC address configured.
thanks
Thirumoorthy S

