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.
Diff: share/object_device.c
- Revision:
- 16:31c387e94b6d
- Parent:
- 15:d0f20339c1ad
--- a/share/object_device.c Sun May 07 03:00:16 2017 +0000 +++ b/share/object_device.c Thu May 11 12:40:25 2017 +0000 @@ -127,6 +127,8 @@ { int min_index; + printf("### TERENCE:%s:%d\n",__FUNCTION__,__LINE__); + if (length != 3 && length != 5 && length != 6) return 0; if (buffer[0] != '-' && buffer[0] != '+') return 0; switch (buffer[1]) @@ -164,6 +166,7 @@ static uint8_t prv_set_value(lwm2m_data_t * dataP, device_data_t * devDataP) { + printf("### TERENCE:%s:%d\n",__FUNCTION__,__LINE__); // a simple switch structure is used to respond at the specified resource asked switch (dataP->id) { @@ -289,13 +292,14 @@ { uint8_t result; int i; + printf("### TERENCE:%s:%d\n",__FUNCTION__,__LINE__); printf(" TERENCE:%s, %d,instanceId = %d\n",__FUNCTION__, __LINE__,instanceId); // this is a single instance object if (instanceId != 0) { return COAP_404_NOT_FOUND; } - printf(" TERENCE:%s, %d: numDataP = %d\n",__FUNCTION__, __LINE__, *numDataP); + // is the server asking for the full object ? if (*numDataP == 0) { @@ -331,7 +335,7 @@ } } - printf(" TERENCE:%s, %d: \n",__FUNCTION__, __LINE__); + i = 0; do { @@ -350,6 +354,7 @@ uint8_t result; int i; + printf("### TERENCE:%s:%d\n",__FUNCTION__,__LINE__); // this is a single instance object if (instanceId != 0) { @@ -357,7 +362,7 @@ } result = COAP_205_CONTENT; - + printf("### TERENCE:%s:%d\n",__FUNCTION__,__LINE__); // is the server asking for the full object ? if (*numDataP == 0) { @@ -430,7 +435,7 @@ { int i; uint8_t result; - + printf("### TERENCE:%s:%d\n",__FUNCTION__,__LINE__); // this is a single instance object if (instanceId != 0) { @@ -489,6 +494,7 @@ int length, lwm2m_object_t * objectP) { + printf("### TERENCE:%s:%d\n",__FUNCTION__,__LINE__); // this is a single instance object if (instanceId != 0) { @@ -517,6 +523,7 @@ void display_device_object(lwm2m_object_t * object) { + printf("### TERENCE:%s:%d\n",__FUNCTION__,__LINE__); #ifdef WITH_LOGS device_data_t * data = (device_data_t *)object->userData; fprintf(stdout, " /%u: Device object:\r\n", object->objID); @@ -535,6 +542,7 @@ */ lwm2m_object_t * deviceObj; + printf("### TERENCE:%s:%d\n",__FUNCTION__,__LINE__); deviceObj = (lwm2m_object_t *)lwm2m_malloc(sizeof(lwm2m_object_t)); if (NULL != deviceObj) @@ -597,6 +605,7 @@ void free_object_device(lwm2m_object_t * objectP) { + printf("### TERENCE:%s:%d\n",__FUNCTION__,__LINE__); if (NULL != objectP->userData) { lwm2m_free(objectP->userData); @@ -616,6 +625,9 @@ { uint8_t result; + + printf("### TERENCE:%s:%d\n",__FUNCTION__,__LINE__); + switch (dataArray->id) { case RES_O_BATTERY_LEVEL: