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: mbed SocketModem nanoservice_client_1_12
Diff: main.cpp
- Revision:
- 8:f7d1fb34d71b
- Parent:
- 7:d2c5894dcd5e
- Child:
- 9:5b116d75f41a
--- a/main.cpp Tue Feb 18 01:50:19 2014 +0000
+++ b/main.cpp Tue Feb 18 02:03:19 2014 +0000
@@ -24,7 +24,7 @@
static const int NSP_PORT = 5683;
char endpoint_name[] = {"mbed-multitech"};
uint8_t ep_type[] = {"mbed_lpc1768_appboard"};
-uint8_t lifetime_ptr[] = {"60"};
+uint8_t lifetime_ptr[] = {"86400"};
typedef uint8_t (*sn_grs_dyn_res_callback_t)(sn_coap_hdr_s *, sn_nsdl_addr_s *, sn_proto_info_s *);
@@ -106,7 +106,12 @@
static uint8_t tx_cb(sn_nsdl_capab_e protocol, uint8_t *data_ptr, uint16_t data_len, sn_nsdl_addr_s *address_ptr)
{
DEBUG("TX callback! Sending %d bytes", data_len);
-
+ char coap_len[2];
+ coap_len[0] = data_len >> 8;
+ coap_len[1] = data_len & 0xFF;
+
+ if(cellular->write((char*)&coap_len, 2, -1) != 2)
+ DEBUG("length sending failed");
if(cellular->write((char*)data_ptr, (int)data_len, -1) != data_len)
DEBUG("sending failed");
