Code Monkey home page Code Monkey logo

mbed-client-c's Introduction

Deprecation note!

Please note: this repository is deprecated and is no longer actively maintained.

However, this library is part of Arm's Mbed Cloud offering and as such the code is available via Mbed Cloud Client under mbed-client-c folder. That repository is actively maintained.

The mbed Device C Client Library provides a simple and efficient way to create mbed Device Client in C.

Applications not using mbed-coap via mbedOS should add mbed-coap library either via mbed-coap.lib or via other applicable means.

mbed-client-c's People

Contributors

kjbracey avatar mbed-test-account avatar peksaa01 avatar simosillankorva avatar teetak01 avatar terhei avatar terojaasko avatar yogpan01 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mbed-client-c's Issues

CoAP block transfer invalid payload bytes

We use the LWM2M client with a registration size of >1800 bytes. The CoAP block transfer size is defined on "coap_max_blockwise_payload_size": 512. In the 1st block the last 2 payload bytes are invalid. Probability these bytes are forgotten to write? We have also tried other block sizes, but also here the same result is seen.

A Wireshark dump of the last payload bytes of the 1st block:

0260   6f 62 73 2c 3c 2f 36 30 30 33 2f 33 2f 32 30 37  obs,</6003/3/207
0270   3e 3b 6f 62 73 2c 3c 2f 36 30 30 33 2f 33 2f 32  >;obs,</6003/3/2
0280   32 32 3e 3b 6f 62 73 2c 3c 2f 36 30 30 33 2f 33  22>;obs,</6003/3
0290   2f 31 30 35 3e 2c 3c 2f 36 30 23 00              /105>,</60#.

The 2nd block payload:

0090                           2f 33 2f 31 30 34 3e 2c          /3/104>,
00a0   3c 2f 36 30 30 33 2f 33 2f 31 30 33 3e 2c 3c 2f  </6003/3/103>,</
00b0   36 30 30 33 2f 33 2f 31 30 32 3e 2c 3c 2f 36 30  6003/3/102>,</60
00c0   30 33 2f 33 2f 31 30 31 3e 2c 3c 2f 36 30 30 33  03/3/101>,</6003

So the last bytes of the 1st block seem to be invalid.
This is the byte stream we expect:
</6003/3/104>,
and this is what the merged result is:
</60#./3/104>,

Message ID duplication not detected

It seems that duplicated message ID are also processed. In our case the LWM2M client callback is executed for all duplicated POST messages.

Copied from The Constrained Application Protocol (CoAP) June 2014:

A recipient might receive the same Confirmable message (as indicated
by the Message ID and source endpoint) multiple times within the
EXCHANGE_LIFETIME (Section 4.8.2), for example, when its
Acknowledgement went missing or didn’t reach the original sender
before the first timeout. The recipient SHOULD acknowledge each
duplicate copy of a Confirmable message using the same
Acknowledgement or Reset message but SHOULD process any request or
response in the message only once. This rule MAY be relaxed in case
the Confirmable message transports a request that is idempotent (see
Section 5.1) or can be handled in an idempotent fashion.

openais-mbed-philips 0.1.0
|_ mbed-client 1.12.2
| |_ mbed-client-c 2.6.0 yotta_modules\mbed-client-c
| | _ nanostack-libservice 3.5.1 yotta_modules\nanostack-libservice
| |_ mbed-trace 1.1.3 yotta_modules\mbed-trace
| |_ mbed-client-mbed-os 3.0.0 yotta_modules\mbed-client-mbed-os

Use updated module version definitions

sn_nsdl_get_version should use YOTTA_MBED_CLIENT_C_VERSION_STRING instead of the deprecated YOTTA_COMPONENT_VERSION

The YOTTA_COMPONENT_VERSION definition has been deprecated in favour of a more granular set of version definitions:

https://github.com/autopulated/yotta/blob/remove-deprecated-version-def/docs/tutorial/release.md#embedded-version-numbers

I'd like to remove YOTTA_COMPONENT_VERSION from the next yotta release (before we release publicly), as it is can be quite visible in compiler command lines, but should not be used.

I think this module is the only one still using it.

sn_grs.c interface unused param with wrong description

In sn_grs.c the function sn_grs_list_resource(struct grs_s *handle, const char *path) does not use the path parameter. With one exception, a NULL pointer check that is in conflict with header prototype description:

\param *path A pointer to an array containing the path or a NULL pointer.

if( handle == NULL || path == NULL){
    return NULL;
}

Enhanced 'alloc' and 'free' function

The 'malloc' and 'free' are defined as follows:

struct nsdl_s {
    ...
    void *(*sn_nsdl_alloc)(uint16_t);
    void (*sn_nsdl_free)(void *);
    ...
};

But it can't fit the following function prototype:

    void *my_malloc(void *ctx, size_t size);
    void my_free(void *ctx, void *ptr);

Therefore, I suggest that the structure is defined as follows:

struct nsdl_s {
    ...
    void *sn_nsdl_mem_ctx;
    void *(*sn_nsdl_alloc)(void *, uint16_t);
    void (*sn_nsdl_free)(void *, void *);
    ...
};

After sn_nsdl_init, you can call the 'malloc' and 'free' with the wrapper as follows:

void *sn_nsdl_malloc(struct nsdl_s *ctx, size_t size)
{
    return (ctx && ctx->sn_nsdl_alloc) ? (ctx->sn_nsdl_alloc(ctx->sn_nsdl_mem_ctx, size)) : NULL;
}
void sn_nsdl_free(struct nsdl_s *ctx, void *ptr)
{
    if (ctx && ctx->sn_nsdl_free)
    {
        ctx->sn_nsdl_free(ctx->sn_nsdl_mem_ctx, ptr);
    }
}

Confirmable messages sending

Hi there,

I observed that if I try to send more confirmable CoAP messages that "linked_list_resent_msgs" is able to hold (by default is set to 2 in the following using this define) The messages obviously do not get stored into the list, but are send out anyway.

Which means that if the delivery fails the device will not retry to send those packages anymore.

Is that the intended behaviour?

Error in passing external memory block to application

When receiving a block-wise message that has the flag external_memory_block set sn_nsdl_get_resource fails because it requires a char * instead of a length delimeted uint8_t * in sn_nsdl.c. The result is that the block is not passed to the application.

#if SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE
     // Pass block to application if external_memory_block is set
     if(coap_packet_ptr->coap_status == COAP_STATUS_PARSER_BLOCKWISE_MSG_RECEIVING) {
        resource = sn_nsdl_get_resource(handle, coap_packet_ptr->uri_path_ptr); // Returns Null because coap_packet_ptr->uri_path_ptr is not zero delimeted
         if(resource && resource->static_resource_parameters->external_memory_block) {
             sn_coap_protocol_block_remove(handle->grs->coap,
                                           src_ptr,
                                           coap_packet_ptr->payload_len,
                                           coap_packet_ptr->payload_ptr);
         } else {
             resource = NULL;
         }
     }
 #endif

I suggest using a zero delimeted copy of uri_path_pointer as parameter for sn_nsdl_get_resource.

stuck in while loop

When I passing in the following get request for 10245/0/101:
40 01 00 00 b5 31 30 32 34 35 01 30 03 31 30 31 00 00 00 00 00 00 00 00 00 00 00 00

I get stuck in sn_coap_parser_options_parse() because of the trailing zeros.

If the message was with out the trailing zeros:
40 01 00 00 b5 31 30 32 34 35 01 30 03 31 30 31

it works fine.

blockwise transfer for payloads bigger than RAM size

At the moment, it seems blockwise transfer in mbed-client-c only allows for transfer of payloads which in total fit into RAM since all chunks are put into a linked list ( https://github.com/ARMmbed/mbed-client-c/blob/master/source/libCoap/src/include/sn_coap_protocol_internal.h#L151 ). Firmware images are likely to be bigger than RAM. What is the mechanism to inform the application about individual chunks, so that the application could put the chunks into internal or external flash one by one?
`

mbed-client-c porting

Hi i was not able to find any example or porting guide for mbed -client-c like we have for mbed-client which are written in c++.
Can you please provide any porting guide link or example using mbed-client-c libraries as well as link to the api documentation.

Regards

Feature request: Multicast message resend to improve reliability

I have a feature request. It would be nice to have a 'always re-send multicast message' to improve reliability with cabled connection, with a configurable number of re-sends and time interval. The resend message should be an exact copy of the initial message. Hereby receiver(s) can detect duplication of messages by checking the message ID and avoid reprocessing of POST messages.

Most of this implementation is already available to resend messages in case of missing acknowledges:
o Timing/scheduled based execution to perform re-sends.
o CoAP implementation caches elementary messages that must be repeated.
o Application can already configure number of re-sends and time interval of the CoAP resends (sn_nsdl_set_retransmission_parameters)

  1. I propose to add an API function to enable/disable the proposed resend for multicast messages.
  2. Proposed: change the function sn_coap_protocol_build to cache also the a multicast CoAP message (sn_coap_protocol_linked_list_send_msg_store(..)):
if( (src_coap_msg_ptr->msg_type == COAP_MSG_TYPE_CONFIRMABLE) || multicast_resend_duplicate )
{
    /* Store message to Linked list for resending purposes */
    sn_coap_protocol_linked_list_send_msg_store(handle, dst_addr_ptr, byte_count_built, dst_packet_data_ptr,
           handle->system_time + (uint32_t)(handle->sn_coap_resending_intervall * RESPONSE_RANDOM_FACTOR),
           param, src_coap_msg_ptr->uri_path_ptr, src_coap_msg_ptr->uri_path_len);
}

Please let me know if this feature request can implemented. Thanks in advance.

module not able to build with armcc 5.06

This breaks the mbed-thread-minimal example where the 30% code size reduction using armcc vs gcc is important.

(workspace) C:\mbedos\programs\mbed-thread-minimal>yt target
frdm-k64f-armcc 0.1.3
mbed-armcc 0.1.1

(workspace) C:\mbedos\programs\mbed-thread-minimal>yt ls
mbed-thread-example 0.0.18
|_ sal-stack-nanostack 3.0.0
| \_ nanostack-randlib 0.0.5 yotta_modules\nanostack-randlib
|_ sal-stack-nanostack-eventloop 0.0.21
| |_ mbed-6lowpan-eventloop-adaptor 0.0.24 yotta_modules\mbed-6lowpan-eventloop-
adaptor
| \_ minar 0.9.0 yotta_modules\minar
|   |_ compiler-polyfill 1.1.0 yotta_modules\compiler-polyfill
|   |_ minar-platform 0.4.0 yotta_modules\minar-platform
|   | |_ minar-platform-mbed 0.2.2 yotta_modules\minar-platform-mbed
|   | | \_ mbed-hal 0.8.1 yotta_modules\mbed-hal
|   | |   \_ mbed-hal-freescale 0.6.0 yotta_modules\mbed-hal-freescale
|   | |     \_ mbed-hal-ksdk-mcu 0.6.4 yotta_modules\mbed-hal-ksdk-mcu
|   | |       |_ uvisor-lib 0.8.4 yotta_modules\uvisor-lib
|   | |       \_ mbed-hal-k64f 0.4.3 yotta_modules\mbed-hal-k64f
|   | |         \_ mbed-hal-frdm-k64f 0.5.1 yotta_modules\mbed-hal-frdm-k64f
|   | \_ cmsis-core 0.4.2 yotta_modules\cmsis-core
|   |   \_ cmsis-core-freescale 0.2.0 yotta_modules\cmsis-core-freescale
|   |     \_ cmsis-core-k64f 0.2.0 yotta_modules\cmsis-core-k64f
|   \_ core-util 0.3.1 yotta_modules\core-util
|     \_ ualloc 0.2.0 yotta_modules\ualloc
|       \_ dlmalloc 0.0.6 yotta_modules\dlmalloc
|_ nanostack-libservice 3.0.4
|_ atmel-rf-driver 0.0.25
|_ mbed-drivers 0.10.2
\_ mbed-client-c 1.0.4


(workspace) C:\mbedos\programs\mbed-thread-minimal>yt build
info: generate for target: frdm-k64f-armcc 0.1.3 at C:\mbedos\programs\mbed-thre
ad-minimal\yotta_targets\frdm-k64f-armcc
WARNING: preprocessing of .S files is not supported by ARMCC on windows.
CMake Warning at C:/mbedos/programs/mbed-thread-minimal/yotta_modules/uvisor-lib
/source/CMakeLists.txt:43 (message):


           *******************************************************************
           * WARNING (uvisor-lib): unsupported platform; your code will still
           *                       work but no security feature is provided;
           *                       UVISOR_DISABLED is set by default
           *******************************************************************


-- Configuring done
-- Generating done
-- Build files have been written to: C:/mbedos/programs/mbed-thread-minimal/buil
d/frdm-k64f-armcc
[9/153] Building C object ym/mbed-clie...client-c/source/libNsdl/src/sn_grs.c.o
FAILED: C:\Keil_v5\ARM\ARMCC\bin\armcc.exe   --gnu -c --c99 --split_sections --a
pcs=interwork --restrict --no_rtti --multibyte-chars --CPU=Cortex-M4 -D__thumb2_
_ -Ospace -g -DNDEBUG -Igenerated/include -IC:/mbedos/programs/mbed-thread-minim
al -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/sal-stack-nanostack -I
C:/mbedos/programs/mbed-thread-minimal/yotta_modules/sal-stack-nanostack-eventlo
op -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/nanostack-libservice -
IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/atmel-rf-driver -IC:/mbedo
s/programs/mbed-thread-minimal/yotta_modules/mbed-drivers -IC:/mbedos/programs/m
bed-thread-minimal/yotta_modules/mbed-client-c -IC:/mbedos/programs/mbed-thread-
minimal/yotta_modules/nanostack-randlib -IC:/mbedos/programs/mbed-thread-minimal
/yotta_modules/mbed-6lowpan-eventloop-adaptor -IC:/mbedos/programs/mbed-thread-m
inimal/yotta_modules/minar -IC:/mbedos/programs/mbed-thread-minimal/yotta_module
s/mbed-hal -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/cmsis-core -IC
:/mbedos/programs/mbed-thread-minimal/yotta_modules/ualloc -IC:/mbedos/programs/
mbed-thread-minimal/yotta_modules/core-util -IC:/mbedos/programs/mbed-thread-min
imal/yotta_modules/compiler-polyfill -IC:/mbedos/programs/mbed-thread-minimal/yo
tta_modules/mbed-hal-freescale -IC:/mbedos/programs/mbed-thread-minimal/yotta_mo
dules/mbed-hal-ksdk-mcu -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/u
visor-lib -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-hal-k64f -
IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/cmsis-core-freescale -IC:/
mbedos/programs/mbed-thread-minimal/yotta_modules/cmsis-core-k64f -IC:/mbedos/pr
ograms/mbed-thread-minimal/yotta_modules/mbed-hal-frdm-k64f -IC:/mbedos/programs
/mbed-thread-minimal/yotta_modules/dlmalloc -IC:/mbedos/programs/mbed-thread-min
imal/yotta_modules/minar-platform -IC:/mbedos/programs/mbed-thread-minimal/yotta
_modules/minar-platform-mbed -IC:/mbedos/programs/mbed-thread-minimal/yotta_modu
les/mbed-client-c/nsdl-c -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/
mbed-client-c/source/libNsdl/src/include -IC:/mbedos/programs/mbed-thread-minima
l/yotta_modules/mbed-client-c/source/libCoap/src/include -IC:/mbedos/programs/mb
ed-thread-minimal/yotta_modules/nanostack-libservice/mbed-client-libservice -IC:
/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source    -DTOO
LCHAIN_ARM -DTOOLCHAIN_ARM_STD -DMBED_OPERATORS -DCPU_MK64FN1M0VMD12 -DTARGET_K6
4F --preinclude "C:/mbedos/programs/mbed-thread-minimal/build/frdm-k64f-armcc/yo
tta_config.h" -o ym/mbed-client-c/source/CMakeFiles/mbed-client-c.dir/C_/mbedos/
programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNsdl/src/sn_g
rs.c.o C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source
/libNsdl/src/sn_grs.c
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNs
dl/src/include/sn_grs.h", line 49: Error:  #79: expected a type specifier
  typedef
S_LIST_HEAD(sn_nsdl_resource_info_s, link) resource_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNs
dl/src/include/sn_grs.h", line 49: Error:  #79: expected a type specifier
  typedef
S_LIST_HEAD(sn_nsdl_resource_info_s, link) resource_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNs
dl/src/include/sn_grs.h", line 49: Warning:  #77-D: this declaration has no stor
age class or type specifier
  typedef
S_LIST_HEAD(sn_nsdl_resource_info_s, link) resource_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNs
dl/src/include/sn_grs.h", line 49: Error:  #168: a function type is not allowed
here
  typedef
S_LIST_HEAD(sn_nsdl_resource_info_s, link) resource_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNs
dl/src/sn_grs.c", line 61: Warning:  #223-D: function "_Static_assert" declared
implicitly

s_list_foreach_safe(sn_nsdl_resource_info_s, tmp, &handle->resource_root_list) {

      ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNs
dl/src/sn_grs.c", line 62: Warning:  #223-D: function "_Static_assert" declared
implicitly

s_list_remove(&handle->resource_root_list, tmp);
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNs
dl/src/sn_grs.c", line 184: Warning:  #223-D: function "_Static_assert" declared
 implicitly

s_list_foreach(sn_nsdl_resource_info_s, grs_resource_ptr, &handle->resource_root
_list) {
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNs
dl/src/sn_grs.c", line 240: Warning:  #223-D: function "_Static_assert" declared
 implicitly
      return
s_list_get_next(&handle->resource_root_list, sn_grs_current_resource);
             ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNs
dl/src/sn_grs.c", line 259: Warning:  #223-D: function "_Static_assert" declared
 implicitly

s_list_remove(&handle->resource_root_list, resource_temp);
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNs
dl/src/sn_grs.c", line 752: Warning:  #223-D: function "_Static_assert" declared
 implicitly

s_list_foreach(sn_nsdl_resource_info_s, resource_search_temp, &handle->resource_
root_list) {
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNs
dl/src/sn_grs.c", line 765: Warning:  #223-D: function "_Static_assert" declared
 implicitly

s_list_foreach(sn_nsdl_resource_info_s, resource_search_temp, &handle->resource_
root_list) {
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNs
dl/src/sn_grs.c", line 901: Warning:  #223-D: function "_Static_assert" declared
 implicitly

s_list_add_to_start(&handle->resource_root_list, resource_copy_ptr);
      ^
C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libNsd
l/src/sn_grs.c: 9 warnings, 3 errors
[9/153] Building C object ym/mbed-clie...source/libCoap/src/sn_coap_builder.c.o
FAILED: C:\Keil_v5\ARM\ARMCC\bin\armcc.exe   --gnu -c --c99 --split_sections --a
pcs=interwork --restrict --no_rtti --multibyte-chars --CPU=Cortex-M4 -D__thumb2_
_ -Ospace -g -DNDEBUG -Igenerated/include -IC:/mbedos/programs/mbed-thread-minim
al -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/sal-stack-nanostack -I
C:/mbedos/programs/mbed-thread-minimal/yotta_modules/sal-stack-nanostack-eventlo
op -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/nanostack-libservice -
IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/atmel-rf-driver -IC:/mbedo
s/programs/mbed-thread-minimal/yotta_modules/mbed-drivers -IC:/mbedos/programs/m
bed-thread-minimal/yotta_modules/mbed-client-c -IC:/mbedos/programs/mbed-thread-
minimal/yotta_modules/nanostack-randlib -IC:/mbedos/programs/mbed-thread-minimal
/yotta_modules/mbed-6lowpan-eventloop-adaptor -IC:/mbedos/programs/mbed-thread-m
inimal/yotta_modules/minar -IC:/mbedos/programs/mbed-thread-minimal/yotta_module
s/mbed-hal -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/cmsis-core -IC
:/mbedos/programs/mbed-thread-minimal/yotta_modules/ualloc -IC:/mbedos/programs/
mbed-thread-minimal/yotta_modules/core-util -IC:/mbedos/programs/mbed-thread-min
imal/yotta_modules/compiler-polyfill -IC:/mbedos/programs/mbed-thread-minimal/yo
tta_modules/mbed-hal-freescale -IC:/mbedos/programs/mbed-thread-minimal/yotta_mo
dules/mbed-hal-ksdk-mcu -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/u
visor-lib -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-hal-k64f -
IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/cmsis-core-freescale -IC:/
mbedos/programs/mbed-thread-minimal/yotta_modules/cmsis-core-k64f -IC:/mbedos/pr
ograms/mbed-thread-minimal/yotta_modules/mbed-hal-frdm-k64f -IC:/mbedos/programs
/mbed-thread-minimal/yotta_modules/dlmalloc -IC:/mbedos/programs/mbed-thread-min
imal/yotta_modules/minar-platform -IC:/mbedos/programs/mbed-thread-minimal/yotta
_modules/minar-platform-mbed -IC:/mbedos/programs/mbed-thread-minimal/yotta_modu
les/mbed-client-c/nsdl-c -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/
mbed-client-c/source/libNsdl/src/include -IC:/mbedos/programs/mbed-thread-minima
l/yotta_modules/mbed-client-c/source/libCoap/src/include -IC:/mbedos/programs/mb
ed-thread-minimal/yotta_modules/nanostack-libservice/mbed-client-libservice -IC:
/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source    -DTOO
LCHAIN_ARM -DTOOLCHAIN_ARM_STD -DMBED_OPERATORS -DCPU_MK64FN1M0VMD12 -DTARGET_K6
4F --preinclude "C:/mbedos/programs/mbed-thread-minimal/build/frdm-k64f-armcc/yo
tta_config.h" -o ym/mbed-client-c/source/CMakeFiles/mbed-client-c.dir/C_/mbedos/
programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCoap/src/sn_c
oap_builder.c.o C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client
-c/source/libCoap/src/sn_coap_builder.c
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 112: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_send_msg_s, link) coap_send_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 112: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_send_msg_s, link) coap_send_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 112: Warning:  #77-D: this dec
laration has no storage class or type specifier
  typedef
S_LIST_HEAD(coap_send_msg_s, link) coap_send_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 112: Error:  #168: a function
type is not allowed here
  typedef
S_LIST_HEAD(coap_send_msg_s, link) coap_send_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 129: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_duplication_info_s, link) coap_duplication_info_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 129: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_duplication_info_s, link) coap_duplication_info_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 129: Warning:  #77-D: this dec
laration has no storage class or type specifier
  typedef
S_LIST_HEAD(coap_duplication_info_s, link) coap_duplication_info_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 129: Error:  #168: a function
type is not allowed here
  typedef
S_LIST_HEAD(coap_duplication_info_s, link) coap_duplication_info_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 141: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_blockwise_msg_s, link) coap_blockwise_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 141: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_blockwise_msg_s, link) coap_blockwise_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 141: Warning:  #77-D: this dec
laration has no storage class or type specifier
  typedef
S_LIST_HEAD(coap_blockwise_msg_s, link) coap_blockwise_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 141: Error:  #168: a function
type is not allowed here
  typedef
S_LIST_HEAD(coap_blockwise_msg_s, link) coap_blockwise_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 158: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_blockwise_payload_s, link) coap_blockwise_payload_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 158: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_blockwise_payload_s, link) coap_blockwise_payload_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 158: Warning:  #77-D: this dec
laration has no storage class or type specifier
  typedef
S_LIST_HEAD(coap_blockwise_payload_s, link) coap_blockwise_payload_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 158: Error:  #168: a function
type is not allowed here
  typedef
S_LIST_HEAD(coap_blockwise_payload_s, link) coap_blockwise_payload_list_t;
          ^
C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCoa
p/src/sn_coap_builder.c: 4 warnings, 12 errors
[9/153] Building C object ym/mbed-clie...e/libCoap/src/sn_coap_header_check.c.o
FAILED: C:\Keil_v5\ARM\ARMCC\bin\armcc.exe   --gnu -c --c99 --split_sections --a
pcs=interwork --restrict --no_rtti --multibyte-chars --CPU=Cortex-M4 -D__thumb2_
_ -Ospace -g -DNDEBUG -Igenerated/include -IC:/mbedos/programs/mbed-thread-minim
al -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/sal-stack-nanostack -I
C:/mbedos/programs/mbed-thread-minimal/yotta_modules/sal-stack-nanostack-eventlo
op -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/nanostack-libservice -
IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/atmel-rf-driver -IC:/mbedo
s/programs/mbed-thread-minimal/yotta_modules/mbed-drivers -IC:/mbedos/programs/m
bed-thread-minimal/yotta_modules/mbed-client-c -IC:/mbedos/programs/mbed-thread-
minimal/yotta_modules/nanostack-randlib -IC:/mbedos/programs/mbed-thread-minimal
/yotta_modules/mbed-6lowpan-eventloop-adaptor -IC:/mbedos/programs/mbed-thread-m
inimal/yotta_modules/minar -IC:/mbedos/programs/mbed-thread-minimal/yotta_module
s/mbed-hal -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/cmsis-core -IC
:/mbedos/programs/mbed-thread-minimal/yotta_modules/ualloc -IC:/mbedos/programs/
mbed-thread-minimal/yotta_modules/core-util -IC:/mbedos/programs/mbed-thread-min
imal/yotta_modules/compiler-polyfill -IC:/mbedos/programs/mbed-thread-minimal/yo
tta_modules/mbed-hal-freescale -IC:/mbedos/programs/mbed-thread-minimal/yotta_mo
dules/mbed-hal-ksdk-mcu -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/u
visor-lib -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-hal-k64f -
IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/cmsis-core-freescale -IC:/
mbedos/programs/mbed-thread-minimal/yotta_modules/cmsis-core-k64f -IC:/mbedos/pr
ograms/mbed-thread-minimal/yotta_modules/mbed-hal-frdm-k64f -IC:/mbedos/programs
/mbed-thread-minimal/yotta_modules/dlmalloc -IC:/mbedos/programs/mbed-thread-min
imal/yotta_modules/minar-platform -IC:/mbedos/programs/mbed-thread-minimal/yotta
_modules/minar-platform-mbed -IC:/mbedos/programs/mbed-thread-minimal/yotta_modu
les/mbed-client-c/nsdl-c -IC:/mbedos/programs/mbed-thread-minimal/yotta_modules/
mbed-client-c/source/libNsdl/src/include -IC:/mbedos/programs/mbed-thread-minima
l/yotta_modules/mbed-client-c/source/libCoap/src/include -IC:/mbedos/programs/mb
ed-thread-minimal/yotta_modules/nanostack-libservice/mbed-client-libservice -IC:
/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source    -DTOO
LCHAIN_ARM -DTOOLCHAIN_ARM_STD -DMBED_OPERATORS -DCPU_MK64FN1M0VMD12 -DTARGET_K6
4F --preinclude "C:/mbedos/programs/mbed-thread-minimal/build/frdm-k64f-armcc/yo
tta_config.h" -o ym/mbed-client-c/source/CMakeFiles/mbed-client-c.dir/C_/mbedos/
programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCoap/src/sn_c
oap_header_check.c.o C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-c
lient-c/source/libCoap/src/sn_coap_header_check.c
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 112: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_send_msg_s, link) coap_send_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 112: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_send_msg_s, link) coap_send_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 112: Warning:  #77-D: this dec
laration has no storage class or type specifier
  typedef
S_LIST_HEAD(coap_send_msg_s, link) coap_send_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 112: Error:  #168: a function
type is not allowed here
  typedef
S_LIST_HEAD(coap_send_msg_s, link) coap_send_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 129: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_duplication_info_s, link) coap_duplication_info_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 129: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_duplication_info_s, link) coap_duplication_info_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 129: Warning:  #77-D: this dec
laration has no storage class or type specifier
  typedef
S_LIST_HEAD(coap_duplication_info_s, link) coap_duplication_info_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 129: Error:  #168: a function
type is not allowed here
  typedef
S_LIST_HEAD(coap_duplication_info_s, link) coap_duplication_info_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 141: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_blockwise_msg_s, link) coap_blockwise_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 141: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_blockwise_msg_s, link) coap_blockwise_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 141: Warning:  #77-D: this dec
laration has no storage class or type specifier
  typedef
S_LIST_HEAD(coap_blockwise_msg_s, link) coap_blockwise_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 141: Error:  #168: a function
type is not allowed here
  typedef
S_LIST_HEAD(coap_blockwise_msg_s, link) coap_blockwise_msg_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 158: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_blockwise_payload_s, link) coap_blockwise_payload_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 158: Error:  #79: expected a t
ype specifier
  typedef
S_LIST_HEAD(coap_blockwise_payload_s, link) coap_blockwise_payload_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 158: Warning:  #77-D: this dec
laration has no storage class or type specifier
  typedef
S_LIST_HEAD(coap_blockwise_payload_s, link) coap_blockwise_payload_list_t;
          ^
"C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCo
ap/src/include/sn_coap_protocol_internal.h", line 158: Error:  #168: a function
type is not allowed here
  typedef
S_LIST_HEAD(coap_blockwise_payload_s, link) coap_blockwise_payload_list_t;
          ^
C:/mbedos/programs/mbed-thread-minimal/yotta_modules/mbed-client-c/source/libCoa
p/src/sn_coap_header_check.c: 4 warnings, 12 errors
[9/153] Building C object ym/cmsis-cor...dules/cmsis-core/source/cmsis_nvic.c.o
ninja: build stopped: subcommand failed.
error: command ['ninja'] failed

(workspace) C:\mbedos\programs\mbed-thread-minimal>armcc
Product: MDK Professional 5.16
Component: ARM Compiler 5.06 (build 20)
Tool: armcc [4d35a4]
For support see http://www.arm.com/support
Software supplied by: ARM Limited

Usage:         armcc [options] file1 file2 ... filen
Main options:

--arm          Generate ARM code
--thumb        Generate Thumb code
--c90          Switch to C mode (default for .c files)
--cpp          Switch to C++ mode (default for .cpp files)
-O0            Minimum optimization
-O1            Restricted optimization for debugging
-O2            High optimization
-O3            Maximum optimization
-Ospace        Optimize for codesize
-Otime         Optimize for maximum performance
--cpu <cpu>    Select CPU to generate code for
--cpu list     Output a list of all the selectable CPUs
-o <file>      Name the final output file of the compilation
-c             Compile only, do not link
--asm          Output assembly code as well as object code
-S             Output assembly code instead of object code
--interleave   Interleave source with disassembly (use with --asm or -S)
-E             Preprocess the C source code only
-D<symbol>     Define <symbol> on entry to the compiler
-g             Generate tables for high-level debugging
-I<directory>  Include <directory> on the #include search path

(workspace) C:\mbedos\programs\mbed-thread-minimal>

obs not compatible with Leshan

It is also mentioned directly in code:

            /* ;obs */
             // This needs to be re-visited and may be need an API for maganging obs value for different server implementation
#ifndef COAP_DISABLE_OBS_FEATURE
            if (resource_temp_ptr->observable) {
                *temp_ptr++ = ';';
                memcpy(temp_ptr, obs_parameter, OBS_PARAMETER_LEN);
                temp_ptr += OBS_PARAMETER_LEN;
            }
#endif

Changing obs to obs=1 solves the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.