SNICInterface for ThingPlug Example
Dependents: ThingPlug_WiFi_Example ThingPlug_WiFi_Example_2
Fork of SNICInterface by
Diff: Socket/Socket.cpp
- Revision:
- 32:ae95309643aa
- Parent:
- 31:15c22824cc46
- Child:
- 33:33f1bc919486
diff -r 15c22824cc46 -r ae95309643aa Socket/Socket.cpp --- a/Socket/Socket.cpp Thu May 29 03:23:21 2014 +0000 +++ b/Socket/Socket.cpp Fri May 30 08:30:40 2014 +0000 @@ -132,12 +132,15 @@ req_len++; if( bind != 0 ) { -/* - req.local_addr = local_addr; - req_len++; - req.local_port = port; - req_len++; -*/ + // set ip addr ( byte order ) + req.local_addr[0] = ( (local_addr & 0xFF000000) >> 24 ); + req.local_addr[1] = ( (local_addr & 0xFF0000) >> 16 ); + req.local_addr[2] = ( (local_addr & 0xFF00) >> 8 ); + req.local_addr[3] = (local_addr & 0xFF); + req.local_port[0] = ( (port & 0xFF00) >> 8 ); + req.local_port[1] = (port & 0xFF); + + req_len = sizeof(C_SNIC_Core::tagSNIC_TCP_CREATE_SOCKET_REQ_T); } unsigned char *command_array = snic_core_p->getCommandBuf();