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:
- 13:fbb719dc3ec4
- Parent:
- 12:d86931458473
- Child:
- 14:63c1fd3c95a6
--- a/main.cpp Wed Feb 19 22:55:09 2014 +0000
+++ b/main.cpp Fri Mar 28 03:55:03 2014 +0000
@@ -20,11 +20,12 @@
Cellular* cellular;
Endpoint nsp;
-static const char* NSP_ADDRESS = "208.111.39.209"; /* demo NSP, web interface at http://nanoservice-demo.mbed.org*/
+static const char* NSP_ADDRESS = "176.58.89.233"; // Motivation demo server
static const int NSP_PORT = 5683;
-char endpoint_name[] = {"mbed-cellular-mwc1"};
+char endpoint_name[] = {"mbed-cellular-mts1"};
uint8_t ep_type[] = {"mbed_kl64z_multitech"};
uint8_t lifetime_ptr[] = {"86400"};
+static const char* FIRMWARE_VER = "12"; // Committed revision number
typedef uint8_t (*sn_grs_dyn_res_callback_t)(sn_coap_hdr_s *, sn_nsdl_addr_s *, sn_proto_info_s *);
@@ -217,11 +218,16 @@
memset(resource_ptr->resource_parameters_ptr, 0, sizeof(sn_nsdl_resource_parameters_s));
// Static resources
- nsdl_create_static_resource(resource_ptr, sizeof("1/0/1")-1, (uint8_t*) "1/0/1", 0, 0, (uint8_t*) "86400", sizeof("86400")-1);
+ nsdl_create_static_resource(resource_ptr, sizeof("1/0/1")-1, (uint8_t*) "1/0/1", 0, 0, (uint8_t*) lifetime_ptr, sizeof(lifetime_ptr)-1);
nsdl_create_static_resource(resource_ptr, sizeof("3/0/0")-1, (uint8_t*) "3/0/0", 0, 0, (uint8_t*) "Freescale/Multitech", sizeof("Freescale/Multitech")-1);
nsdl_create_static_resource(resource_ptr, sizeof("3/0/1")-1, (uint8_t*) "3/0/1", 0, 0, (uint8_t*) "KL64Z with Multitech Cellular", sizeof("KL64Z with Multitech Cellular")-1);
nsdl_create_static_resource(resource_ptr, sizeof("3/0/16")-1, (uint8_t*) "3/0/16", 0, 0, (uint8_t*) "TCP", sizeof("TCP")-1);
- //nsdl_create_static_resource(resource_ptr, sizeof("gps/loc")-1, (uint8_t*) "gps/loc", 0, 0, (uint8_t*) "41.3575130, 2.1249660", sizeof("41.3575130, 2.1249660")-1);
+ nsdl_create_static_resource(resource_ptr, sizeof("3/0/3")-1, (uint8_t*) "3/0/3", 0, 0, (uint8_t*) FIRMWARE_VER, strlen(FIRMWARE_VER));
+ nsdl_create_static_resource(resource_ptr, sizeof("4/0/0")-1, (uint8_t*) "4/0/0", 0, 0, (uint8_t*) "GPRS", sizeof("GPRS")-1);
+ nsdl_create_static_resource(resource_ptr, sizeof("4/0/1")-1, (uint8_t*) "4/0/1", 0, 0, (uint8_t*) "GPRS", sizeof("GPRS")-1);
+ nsdl_create_static_resource(resource_ptr, sizeof("6/0/0")-1, (uint8_t*) "6/0/0", 0, 0, (uint8_t*) "37.959611", sizeof("37.959611")-1);
+ nsdl_create_static_resource(resource_ptr, sizeof("6/0/1")-1, (uint8_t*) "6/0/1", 0, 0, (uint8_t*) "23.721136", sizeof("23.721136")-1);
+ // nsdl_create_static_resource(resource_ptr, sizeof("gps/loc")-1, (uint8_t*) "gps/loc", 0, 0, (uint8_t*) "37.959611,23.721136", sizeof("37.959611,23.721136")-1);
// Broken: This cause the modem driver to crash when the request is received.
// Dynamic resources
