Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Beep C027_Support C12832 LM75B MMA7660 mbed-rtos mbed nsdl_lib
This is a port of the NSDL HelloWorld for cellular.
To run the example you need a C027 and the ARM mbed application shield. The example uses cellular instead of ethernet and takes the true position from the GPS instead of using a fixed position.
Diff: nsdl_support.cpp
- Revision:
- 3:52c1b649eb04
- Parent:
- 2:7e489126fe7a
- Child:
- 7:6b068978be9a
--- 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");