adding resources firmware and 1/0/8
Dependencies: Beep C12832_lcd EthernetInterface EthernetNetIf HTTPClient LM75B MMA7660 mbed-rtos mbed nsdl_lib
Fork of LWM2M_NanoService_Ethernet by
Diff: nsdl_support.cpp
- Revision:
- 3:52c1b649eb04
- Parent:
- 2:7e489126fe7a
- Child:
- 7:6b068978be9a
diff -r 7e489126fe7a -r 52c1b649eb04 nsdl_support.cpp --- a/nsdl_support.cpp Tue Oct 15 12:45:46 2013 +0000 +++ b/nsdl_support.cpp Tue Oct 15 15:48:23 2013 +0000 @@ -10,7 +10,7 @@ extern EthernetInterface eth; extern Endpoint nsp; extern UDPSocket server; -extern char endpoint_name[15]; +extern char endpoint_name[16]; extern uint8_t ep_type[]; extern uint8_t lifetime_ptr[]; @@ -71,9 +71,9 @@ endpoint_structure->endpoint_name_ptr = name; endpoint_structure->endpoint_name_len = 15; endpoint_structure->type_ptr = typename_ptr; - endpoint_structure->type_len = sizeof(typename_ptr)-1; + endpoint_structure->type_len = strlen((char*)typename_ptr); endpoint_structure->lifetime_ptr = lifetime_ptr; - endpoint_structure->lifetime_len = sizeof(lifetime_ptr)-1; + endpoint_structure->lifetime_len = strlen((char*)lifetime_ptr); } return endpoint_structure; } @@ -89,7 +89,7 @@ static uint8_t tx_cb(sn_nsdl_capab_e protocol, uint8_t *data_ptr, uint16_t data_len, sn_nsdl_addr_s *address_ptr) { - pc.printf("TX callback!\n\rSending %d bytes:\r\n", data_len); + pc.printf("TX callback!\n\rSending %d bytes\r\n", data_len); if(server.sendTo(nsp, (char*)data_ptr, data_len) != data_len) pc.printf("sending failed\n\r");