Skip to content

Commit 2f6f3c6

Browse files
authored
Merge pull request #3500 from kuggenhoffen/update-mbed-client-c-3.0.4
Update mbed-client-c version 3.0.4
2 parents 518b072 + d80f863 commit 2f6f3c6

File tree

30 files changed

+4439
-96
lines changed

30 files changed

+4439
-96
lines changed

features/FEATURE_COMMON_PAL/mbed-client-c/CHANGELOG.md

Lines changed: 288 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# Makefile for combined NSDL+COAP library
3+
#
4+
5+
# Define compiler toolchain with CC or PLATFORM variables
6+
# Example (GCC toolchains, default $CC and $AR are used)
7+
# make
8+
#
9+
# OR (Cross-compile GCC toolchain)
10+
# make PLATFORM=arm-linux-gnueabi-
11+
#
12+
# OR (armcc/Keil)
13+
# make CC=armcc AR=ArmAR
14+
#
15+
# OR (IAR-ARM)
16+
# make CC=iccarm
17+
18+
LIB = libnsdl.a
19+
SRCS := \
20+
source/libNsdl/src/sn_grs.c \
21+
source/libNsdl/src/sn_nsdl.c \
22+
source/libCoap/src/sn_coap_protocol.c \
23+
source/libCoap/src/sn_coap_parser.c \
24+
source/libCoap/src/sn_coap_header_check.c \
25+
source/libCoap/src/sn_coap_builder.c \
26+
27+
override CFLAGS += -DVERSION='"$(VERSION)"'
28+
29+
override CFLAGS += -Isource/libNsdl/src/include/
30+
override CFLAGS += -Isource/libCoap/src/include/
31+
SERVLIB_DIR := ../libService
32+
override CFLAGS += -I$(SERVLIB_DIR)/libService
33+
override CFLAGS += -Insdl-c/
34+
35+
include ../libService/toolchain_rules.mk
36+
37+
$(eval $(call generate_rules,$(LIB),$(SRCS)))
38+
39+
.PHONY: release
40+
release:
41+
7z a nsdl-c_$(VERSION).zip *.a *.lib include
42+
43+
.PHONY: deploy_to
44+
deploy_to: all
45+
tar --transform 's,^,nsdl-c/,' --append -f $(TO) *.a nsdl-c

features/FEATURE_COMMON_PAL/mbed-client-c/module.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mbed-client-c",
3-
"version": "3.0.2",
3+
"version": "3.0.4",
44
"description": "Nanostack NSDL and COAP library",
55
"keywords": [
66
"coap",
@@ -14,7 +14,8 @@
1414
],
1515
"dependencies": {
1616
"nanostack-libservice": "^3.0.0",
17-
"mbed-trace": ">=0.2.0,<2.0.0"
17+
"mbed-trace": ">=0.2.0,<2.0.0",
18+
"nanostack-randlib": "^1.2.0"
1819
},
1920
"targetDependencies": {}
2021
}

features/FEATURE_COMMON_PAL/mbed-client-c/nsdl-c/sn_nsdl_lib.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
#ifndef SN_NSDL_LIB_H_
2626
#define SN_NSDL_LIB_H_
2727

28+
#ifdef MBED_CLIENT_C_NEW_API
29+
30+
#include "nsdl-c/sn_nsdl_lib2.h"
31+
32+
#else
33+
2834
#include "ns_list.h"
2935

3036
#ifdef __cplusplus
@@ -723,8 +729,40 @@ extern int8_t sn_nsdl_set_block_size(struct nsdl_s *handle, uint16_t block_size)
723729
*/
724730
extern int8_t sn_nsdl_set_duplicate_buffer_size(struct nsdl_s *handle, uint8_t message_count);
725731

732+
/**
733+
* \fn void *sn_nsdl_set_context(const struct nsdl_s *handle, void *context)
734+
*
735+
* \brief Set the application defined context parameter for given handle.
736+
* This is useful for example when interfacing with c++ objects where a
737+
* pointer to object is set as the context, and in the callback functions
738+
* the context pointer can be used to call methods for the correct instance
739+
* of the c++ object.
740+
*
741+
* \param *handle Pointer to library handle
742+
* \param *context Pointer to the application defined context
743+
* \return 0 = success, -1 = failure
744+
*/
745+
extern int8_t sn_nsdl_set_context(struct nsdl_s * const handle, void * const context);
746+
747+
/**
748+
* \fn void *sn_nsdl_get_context(const struct nsdl_s *handle)
749+
*
750+
* \brief Get the application defined context parameter for given handle.
751+
* This is useful for example when interfacing with c++ objects where a
752+
* pointer to object is set as the context, and in the callback functions
753+
* the context pointer can be used to call methods for the correct instance
754+
* of the c++ object.
755+
*
756+
* \param *handle Pointer to library handle
757+
* \return Pointer to the application defined context
758+
*/
759+
extern void *sn_nsdl_get_context(const struct nsdl_s * const handle);
760+
726761
#ifdef __cplusplus
727762
}
728763
#endif
729764

765+
#endif /* MBED_CLIENT_C_NEW_API */
766+
767+
730768
#endif /* SN_NSDL_LIB_H_ */

0 commit comments

Comments
 (0)