Hello,
I've tried to make udp socket between the C6678 and my laptop using the utp cable.
The dsp is on the channel card and uses mgmt0 ethernet card to connect directly with my labtop.
The connection has no problem with 'ping' test, but in my code, sendto() function returns 'EHOSTUNREACH(No route to host)'.
My code is as below, please let me know what I have to check.
.cfg
..
var Global = xdc.useModule('ti.ndk.config.Global');
var GateTask = xdc.useModule('ti.sysbios.gates.GateTask');
Global.networkIPAddrHook = '&myIPAddrHook';
..
.c
static int sock = INVALID_SOCKET;
static struct sockaddr_in ipaddr;
fdOpenSession( TaskSelf() );
sock = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
bzero( &ipaddr, sizeof(struct sockaddr_in) );
ipaddr.sin_family = AF_INET;
ipaddr.sin_addr.s_addr = inet_addr("***.***.***.***");
//inet_aton("***.***.***.***", &ipaddr.sin_addr);
ipaddr.sin_port = htons(3000);
if( sock == INVALID_SOCKET )
MACPHYConsolePrintf("INVALID SOCKET@@\n");
bind(sock, (PSA)&ipaddr, sizeof(ipaddr)); // return 65(EHOSTUNREACH)
MACPHYConsolePrintf("bind() return value : %d\n", fdError());
TaskSleep(1);
sendto( sock, "test", 8, 0, (PSA)&ipaddr, sizeof(ipaddr) ); // return EHOSTUNREACH(65)
MACPHYConsolePrintf("sendto() return value : %d\n", fdError());
fdClose(socket);
TaskBlock(TaskSelf());