Skip to content

Commit 8073ce2

Browse files
author
Antti Yli-Tokola
committed
Update mbed-coap to version 4.7.4
- Remove dependency to yotta tool - Do not remove stored (GET) blockwise message when EMPTY ACK received. When non piggybacked response mode is used original GET request must not be removed from the stored message list.Message is needed for building the next (GET) blockwise message. - Move definitions to sn_config.h
1 parent 3252530 commit 8073ce2

File tree

7 files changed

+122
-136
lines changed

7 files changed

+122
-136
lines changed

features/frameworks/mbed-coap/.yotta_ignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

features/frameworks/mbed-coap/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change Log
22

3+
## [v4.7.4](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.7.4)
4+
5+
- Remove dependency to yotta tool
6+
- Do not remove stored (GET) blockwise message when EMPTY ACK received
7+
When non piggybacked response mode is used original GET request must not be removed from the stored message list.
8+
Message is needed for building the next (GET) blockwise message.
9+
- Move definitions to sn_config.h
10+
11+
-[Full Changelog](https://github.com/ARMmbed/mbed-coap/compare/v4.7.3...v4.7.4)
12+
313
## [v4.7.3](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.7.3)
414

515
- Do not store EMPTY response to blockwise list

features/frameworks/mbed-coap/Makefile.test

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,28 @@ TESTDIRS := $(UNITTESTS:%=build-%)
1111
CLEANTESTDIRS := $(UNITTESTS:%=clean-%)
1212
COVERAGEFILE := ./lcov/coverage.info
1313

14+
TEST_MODULES = ./test_modules
15+
TEST_MODULE_MBED_TRACE = $(TEST_MODULES)/mbed-trace
16+
TEST_MODULE_NANOSTACK = $(TEST_MODULES)/nanostack-libservice
17+
TEST_MODULE_RANDLIB = $(TEST_MODULES)/mbed-client-randlib
18+
19+
.PHONY: clone
20+
clone:
21+
if [ ! -d $(TEST_MODULES) ]; \
22+
then mkdir $(TEST_MODULES); \
23+
fi;
24+
25+
if [ ! -d $(TEST_MODULE_MBED_TRACE) ]; \
26+
then git clone --depth 1 [email protected]:ARMmbed/mbed-trace.git $(TEST_MODULE_MBED_TRACE); \
27+
fi;
28+
29+
if [ ! -d $(TEST_MODULE_NANOSTACK) ]; \
30+
then git clone --depth 1 [email protected]:ARMmbed/nanostack-libservice.git $(TEST_MODULE_NANOSTACK); \
31+
fi;
32+
33+
if [ ! -d $(TEST_MODULE_RANDLIB) ]; \
34+
then git clone --depth 1 [email protected]:ARMmbed/mbed-client-randlib.git $(TEST_MODULE_RANDLIB); \
35+
fi;
1436
.PHONY: test
1537
test: $(TESTDIRS)
1638
@rm -rf ./lcov
@@ -27,7 +49,7 @@ test: $(TESTDIRS)
2749
@rm -f lcov/index.xml
2850
@find ./ -name '*.gcno' | xargs cp --backup=numbered -t ./coverage/
2951
@find ./ -name '*.gcda' | xargs cp --backup=numbered -t ./coverage/
30-
@gcovr --object-directory ./coverage --exclude-unreachable-branches -e '.*/builds/.*' -e '.*/test/.*' -e '.*/yotta_modules/.*' -e '.*/stubs/.*' -e '.*/mbed-coap/.*' -x -o ./lcov/gcovr.xml
52+
@gcovr --object-directory ./coverage --exclude-unreachable-branches -e '.*/builds/.*' -e '.*/test/.*' -e '.*/stubs/.*' -e '.*/mbed-coap/.*' -x -o ./lcov/gcovr.xml
3153
@lcov -d test/. -c -o $(COVERAGEFILE)
3254
@lcov -q -r $(COVERAGEFILE) "/usr*" -o $(COVERAGEFILE)
3355
@lcov -q -r $(COVERAGEFILE) "/test*" -o $(COVERAGEFILE)

features/frameworks/mbed-coap/mbed-coap/sn_config.h

Lines changed: 83 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#ifndef SN_CONFIG_H
1818
#define SN_CONFIG_H
1919

20+
#ifdef MBED_CLIENT_USER_CONFIG_FILE
21+
#include MBED_CLIENT_USER_CONFIG_FILE
22+
#endif
23+
2024
/**
2125
* \brief Configuration options (set of defines and values)
2226
*
@@ -30,9 +34,15 @@
3034
* \brief For Message duplication detection
3135
* Init value for the maximum count of messages to be stored for duplication detection
3236
* Setting of this value to 0 will disable duplication check, also reduce use of ROM memory
33-
* Default is set to 1.
37+
* Default is set to 0.
3438
*/
35-
#undef SN_COAP_DUPLICATION_MAX_MSGS_COUNT /* 1 */
39+
#ifdef MBED_CONF_MBED_CLIENT_SN_COAP_DUPLICATION_MAX_MSGS_COUNT
40+
#define SN_COAP_DUPLICATION_MAX_MSGS_COUNT MBED_CONF_MBED_CLIENT_SN_COAP_DUPLICATION_MAX_MSGS_COUNT
41+
#endif
42+
43+
#ifndef SN_COAP_DUPLICATION_MAX_MSGS_COUNT
44+
#define SN_COAP_DUPLICATION_MAX_MSGS_COUNT 0
45+
#endif
3646

3747
/**
3848
* \def SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE
@@ -42,37 +52,61 @@
4252
* also reduce use of ROM memory.
4353
* Note: This define is common for both received and sent Blockwise messages
4454
*/
45-
#undef SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE /* 0 */ // < Must be 2^x and x is at least 4. Suitable values: 0, 16, 32, 64, 128, 256, 512 and 1024
55+
#ifdef MBED_CONF_MBED_CLIENT_SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE
56+
#define SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE MBED_CONF_MBED_CLIENT_SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE
57+
#endif
58+
59+
#ifndef SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE
60+
#define SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE 0 /**< Must be 2^x and x is at least 4. Suitable values: 0, 16, 32, 64, 128, 256, 512 and 1024 */
61+
#endif
4662

4763
/**
4864
* \def SN_COAP_DISABLE_RESENDINGS
4965
* \brief Disables resending feature. Resending feature should not be needed
5066
* when using CoAP with TCP transport for example. By default resendings are
5167
* enabled. Set to 1 to disable.
5268
*/
53-
#undef SN_COAP_DISABLE_RESENDINGS /* 0 */ // < Default re-sending are not disabled. Set to 1 to disable re-sendings
69+
#ifdef SN_COAP_DISABLE_RESENDINGS
70+
#define ENABLE_RESENDINGS 0 /** Disable resendings **/
71+
#else
72+
#define ENABLE_RESENDINGS 1 /**< Enable / Disable resending from library in building */
73+
#endif
5474

5575
/**
5676
* \def SN_COAP_RESENDING_QUEUE_SIZE_MSGS
5777
* \brief Sets the number of messages stored
5878
* in the resending queue. Default is 2
5979
*/
60-
#undef SN_COAP_RESENDING_QUEUE_SIZE_MSGS /* 2 */ // < Default re-sending queue size - defines how many messages can be stored. Setting this to 0 disables feature
80+
#ifdef MBED_CONF_MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
81+
#define SN_COAP_RESENDING_QUEUE_SIZE_MSGS MBED_CONF_MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
82+
#endif
83+
84+
#ifndef SN_COAP_RESENDING_QUEUE_SIZE_MSGS
85+
#define SN_COAP_RESENDING_QUEUE_SIZE_MSGS 2 /**< Default re-sending queue size - defines how many messages can be stored. Setting this to 0 disables feature */
86+
#endif
6187

6288
/**
6389
* \def DEFAULT_RESPONSE_TIMEOUT
6490
* \brief Sets the CoAP re-send interval in seconds.
6591
* By default is 10 seconds.
6692
*/
67-
#undef DEFAULT_RESPONSE_TIMEOUT
93+
#ifndef DEFAULT_RESPONSE_TIMEOUT
94+
#define DEFAULT_RESPONSE_TIMEOUT 10 /**< Default re-sending timeout as seconds */
95+
#endif
6896

6997
/**
7098
* \def SN_COAP_RESENDING_QUEUE_SIZE_BYTES
7199
* \brief Sets the size of the re-sending buffer.
72100
* Setting this to 0 disables this feature.
73101
* By default, this feature is disabled.
74102
*/
75-
#undef SN_COAP_RESENDING_QUEUE_SIZE_BYTES /* 0 */ // Default re-sending queue size - defines size of the re-sending buffer. Setting this to 0 disables feature
103+
#ifdef MBED_CONF_MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_BYTES
104+
#define SN_COAP_RESENDING_QUEUE_SIZE_BYTES MBED_CONF_MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_BYTES
105+
#endif
106+
107+
#ifndef SN_COAP_RESENDING_QUEUE_SIZE_BYTES
108+
#define SN_COAP_RESENDING_QUEUE_SIZE_BYTES 0 /**< Default re-sending queue size - defines size of the re-sending buffer. Setting this to 0 disables feature */
109+
#endif
76110

77111
/**
78112
* \def SN_COAP_MAX_INCOMING_MESSAGE_SIZE
@@ -83,7 +117,9 @@
83117
* available storage capability.
84118
* By default, maximum size is UINT16_MAX, 65535 bytes.
85119
*/
86-
#undef SN_COAP_MAX_INCOMING_MESSAGE_SIZE /* UINT16_MAX */
120+
#ifndef SN_COAP_MAX_INCOMING_MESSAGE_SIZE
121+
#define SN_COAP_MAX_INCOMING_MESSAGE_SIZE UINT16_MAX
122+
#endif
87123

88124
/**
89125
* \def SN_COAP_MAX_NONBLOCKWISE_PAYLOAD_SIZE
@@ -98,86 +134,112 @@
98134
* Note that value should be less than transport layer maximum fragment size.
99135
* Note that value has no effect if blockwise transfer is disabled.
100136
*/
101-
#undef SN_COAP_MAX_NONBLOCKWISE_PAYLOAD_SIZE /* 0 */
137+
#ifndef SN_COAP_MAX_NONBLOCKWISE_PAYLOAD_SIZE
138+
#define SN_COAP_MAX_NONBLOCKWISE_PAYLOAD_SIZE 0
139+
#endif
102140

103141
/**
104142
* \def SN_COAP_BLOCKWISE_ENABLED
105143
* \brief Enables the blockwise functionality in CoAP library also when blockwise payload
106144
* size is set to '0' in SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE.
107145
*/
108-
#undef SN_COAP_BLOCKWISE_ENABLED /* 0 */
146+
#ifndef SN_COAP_BLOCKWISE_ENABLED
147+
#define SN_COAP_BLOCKWISE_ENABLED 0 /**< Enable blockwise */
148+
#endif
109149

110150
/**
111151
* \def SN_COAP_RESENDING_MAX_COUNT
112152
* \brief Defines how many times CoAP library tries to re-send the CoAP packet.
113153
* By default value is 3.
114154
*/
115-
#undef SN_COAP_RESENDING_MAX_COUNT /* 3 */
155+
#ifndef SN_COAP_RESENDING_MAX_COUNT
156+
#define SN_COAP_RESENDING_MAX_COUNT 3
157+
#endif
116158

117159
/**
118160
* \def SN_COAP_MAX_ALLOWED_RESENDING_COUNT
119161
* \brief Maximum allowed count of re-sending that can be set at runtime via
120162
* 'sn_coap_protocol_set_retransmission_parameters()' API.
121163
* By default value is 6.
122164
*/
123-
#undef SN_COAP_MAX_ALLOWED_RESENDING_COUNT /* 6 */
165+
#ifndef SN_COAP_MAX_ALLOWED_RESENDING_COUNT
166+
#define SN_COAP_MAX_ALLOWED_RESENDING_COUNT 6 /**< Maximum allowed count of re-sending */
167+
#endif
124168

125169
/**
126170
* \def SN_COAP_MAX_ALLOWED_RESPONSE_TIMEOUT
127171
* \brief Maximum allowed re-send interval in seconds that can be set at runtime via
128172
* 'sn_coap_protocol_set_retransmission_parameters()' API.
129173
* By default value is 40.
130174
*/
131-
#undef SN_COAP_MAX_ALLOWED_RESPONSE_TIMEOUT /* 40 */
175+
#ifndef SN_COAP_MAX_ALLOWED_RESPONSE_TIMEOUT
176+
#define SN_COAP_MAX_ALLOWED_RESPONSE_TIMEOUT 40 /**< Maximum allowed re-sending timeout */
177+
#endif
132178

133179
/**
134180
* \def SN_COAP_MAX_ALLOWED_RESENDING_BUFF_SIZE_MSGS
135181
* \brief Maximum allowed count of messages that can be stored into resend buffer at runtime via
136182
* 'sn_coap_protocol_set_retransmission_buffer()' API.
137183
* By default value is 6.
138184
*/
139-
#undef SN_COAP_MAX_ALLOWED_RESENDING_BUFF_SIZE_MSGS /* 6 */
185+
#ifndef SN_COAP_MAX_ALLOWED_RESENDING_BUFF_SIZE_MSGS
186+
#define SN_COAP_MAX_ALLOWED_RESENDING_BUFF_SIZE_MSGS 6 /**< Maximum allowed number of saved re-sending messages */
187+
#endif
140188

141189
/**
142190
* \def SN_COAP_MAX_ALLOWED_RESENDING_BUFF_SIZE_BYTES
143191
* \brief Maximum size of messages in bytes that can be stored into resend buffer at runtime via
144192
* 'sn_coap_protocol_set_retransmission_buffer()' API.
145193
* By default value is 512.
146194
*/
147-
#undef SN_COAP_MAX_ALLOWED_RESENDING_BUFF_SIZE_BYTES /* 512 */
195+
#ifndef SN_COAP_MAX_ALLOWED_RESENDING_BUFF_SIZE_BYTES
196+
#define SN_COAP_MAX_ALLOWED_RESENDING_BUFF_SIZE_BYTES 512 /**< Maximum allowed size of re-sending buffer */
197+
#endif
148198

149199
/**
150200
* \def SN_COAP_MAX_ALLOWED_DUPLICATION_MESSAGE_COUNT
151201
* \brief Maximum allowed number of saved messages for message duplicate searching
152202
* that can be set via 'sn_coap_protocol_set_duplicate_buffer_size' API.
153203
* By default value is 6.
154204
*/
155-
#undef SN_COAP_MAX_ALLOWED_DUPLICATION_MESSAGE_COUNT
205+
#ifndef SN_COAP_MAX_ALLOWED_DUPLICATION_MESSAGE_COUNT
206+
#define SN_COAP_MAX_ALLOWED_DUPLICATION_MESSAGE_COUNT 6
207+
#endif
156208

157209
/**
158210
* \def SN_COAP_DUPLICATION_MAX_TIME_MSGS_STORED
159211
* \brief Maximum time in seconds howe long message is kept for duplicate detection.
160212
* By default 60 seconds.
161213
*/
162-
#undef SN_COAP_DUPLICATION_MAX_TIME_MSGS_STORED
214+
#ifndef SN_COAP_DUPLICATION_MAX_TIME_MSGS_STORED
215+
#define SN_COAP_DUPLICATION_MAX_TIME_MSGS_STORED 60 /** RESPONSE_TIMEOUT * RESPONSE_RANDOM_FACTOR * (2 ^ MAX_RETRANSMIT - 1) + the expected maximum round trip time **/
216+
#endif
163217

164218
/**
165219
* \def SN_COAP_BLOCKWISE_MAX_TIME_DATA_STORED
166220
* \brief Maximum time in seconds how long (messages and payload) are be stored for blockwising.
167221
* Longer time will increase the memory consumption in lossy networks.
168222
* By default 60 seconds.
169223
*/
170-
#undef SN_COAP_BLOCKWISE_MAX_TIME_DATA_STORED
224+
#ifdef MBED_CONF_MBED_CLIENT_SN_COAP_BLOCKWISE_MAX_TIME_DATA_STORED
225+
#define SN_COAP_BLOCKWISE_MAX_TIME_DATA_STORED MBED_CONF_MBED_CLIENT_SN_COAP_BLOCKWISE_MAX_TIME_DATA_STORED
226+
#endif
227+
228+
#ifndef SN_COAP_BLOCKWISE_MAX_TIME_DATA_STORED
229+
#define SN_COAP_BLOCKWISE_MAX_TIME_DATA_STORED 60 /**< Maximum time in seconds of data (messages and payload) to be stored for blockwising */
230+
#endif
171231

172232
/**
173233
* \def SN_COAP_MAX_INCOMING_BLOCK_MESSAGE_SIZE
174234
* \brief Maximum size of blockwise message that can be received.
175235
* By default 65535 bytes.
176236
*/
177-
#undef SN_COAP_MAX_INCOMING_BLOCK_MESSAGE_SIZE
237+
#ifdef MBED_CONF_MBED_CLIENT_SN_COAP_MAX_INCOMING_MESSAGE_SIZE
238+
#define SN_COAP_MAX_INCOMING_BLOCK_MESSAGE_SIZE MBED_CONF_MBED_CLIENT_SN_COAP_MAX_INCOMING_MESSAGE_SIZE
239+
#endif
178240

179-
#ifdef MBED_CLIENT_USER_CONFIG_FILE
180-
#include MBED_CLIENT_USER_CONFIG_FILE
241+
#ifndef SN_COAP_MAX_INCOMING_BLOCK_MESSAGE_SIZE
242+
#define SN_COAP_MAX_INCOMING_BLOCK_MESSAGE_SIZE UINT16_MAX
181243
#endif
182244

183245
#endif // SN_CONFIG_H

features/frameworks/mbed-coap/run_unit_tests.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ echo
1717
echo "Build mbed-coap C unit tests"
1818
echo
1919

20-
yt target x86-linux-native
21-
yt up
20+
make -f Makefile.test clone
2221
make -f Makefile.test test
2322
#make -f Makefile.test test clean

0 commit comments

Comments
 (0)