Skip to content

Commit f9ee4e8

Browse files
authored
Merge pull request #6579 from ARMmbed/release-candidate
Release candidate for mbed-os-5.8.2
2 parents addec7b + 153b137 commit f9ee4e8

File tree

306 files changed

+35760
-3563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+35760
-3563
lines changed

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,9 @@ matrix:
205205
STATUSM="$STATUSM ($(python -c "print '%+.2f' % (100*($CURR-$PREV)/$PREV.0)")%)"
206206
fi
207207
- bash -c "$STATUS" success "$STATUSM"
208+
209+
- env:
210+
- NAME=gitattributestest
211+
script:
212+
# Check that no changes after clone. This check that .gitattributes is used right way.
213+
- git diff --exit-code

TESTS/mbed_drivers/crc/main.cpp

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
2+
/* mbed Microcontroller Library
3+
* Copyright (c) 2018 ARM Limited
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include "utest/utest.h"
19+
#include "unity/unity.h"
20+
#include "greentea-client/test_env.h"
21+
22+
#include "mbed.h"
23+
24+
using namespace utest::v1;
25+
26+
void test_supported_polynomials()
27+
{
28+
char test[] = "123456789";
29+
uint32_t crc;
30+
31+
{
32+
MbedCRC<POLY_7BIT_SD, 7> ct;
33+
TEST_ASSERT_EQUAL(0, ct.compute((void *)test, strlen((const char*)test), &crc));
34+
TEST_ASSERT_EQUAL(0xEA, crc);
35+
}
36+
{
37+
MbedCRC<POLY_8BIT_CCITT, 8> ct;
38+
TEST_ASSERT_EQUAL(0, ct.compute((void *)test, strlen((const char*)test), &crc));
39+
TEST_ASSERT_EQUAL(0xF4, crc);
40+
}
41+
{
42+
MbedCRC<POLY_16BIT_CCITT, 16> ct;
43+
TEST_ASSERT_EQUAL(0, ct.compute((void *)test, strlen((const char*)test), &crc));
44+
TEST_ASSERT_EQUAL(0x29B1, crc);
45+
}
46+
{
47+
MbedCRC<POLY_16BIT_IBM, 16> ct;
48+
TEST_ASSERT_EQUAL(0, ct.compute((void *)test, strlen((const char*)test), &crc));
49+
TEST_ASSERT_EQUAL(0xBB3D, crc);
50+
}
51+
{
52+
MbedCRC<POLY_32BIT_ANSI, 32> ct;
53+
TEST_ASSERT_EQUAL(0, ct.compute((void *)test, strlen((const char*)test), &crc));
54+
TEST_ASSERT_EQUAL(0xCBF43926, crc);
55+
}
56+
}
57+
58+
void test_partial_crc()
59+
{
60+
char test[] = "123456789";
61+
uint32_t crc;
62+
{
63+
MbedCRC<POLY_16BIT_CCITT, 16> ct;
64+
TEST_ASSERT_EQUAL(0, ct.compute_partial_start(&crc));
65+
TEST_ASSERT_EQUAL(0, ct.compute_partial((void *)&test, 4, &crc));
66+
TEST_ASSERT_EQUAL(0, ct.compute_partial((void *)&test[4], 5, &crc));
67+
TEST_ASSERT_EQUAL(0, ct.compute_partial_stop(&crc));
68+
69+
TEST_ASSERT_EQUAL(0x29B1, crc);
70+
}
71+
}
72+
73+
void test_sd_crc()
74+
{
75+
MbedCRC<POLY_7BIT_SD, 7> crc7;
76+
uint32_t crc;
77+
char test[512];
78+
79+
test[0] = 0x40;
80+
test[1] = 0x00;
81+
test[2] = 0x00;
82+
test[3] = 0x00;
83+
test[4] = 0x00;
84+
TEST_ASSERT_EQUAL(0, crc7.compute((void *)test, 5, &crc));
85+
crc = (crc | 0x1 ) & 0xFF;
86+
TEST_ASSERT_EQUAL(0x95, crc);
87+
88+
test[0] = 0x48;
89+
test[1] = 0x00;
90+
test[2] = 0x00;
91+
test[3] = 0x01;
92+
test[4] = 0xAA;
93+
TEST_ASSERT_EQUAL(0, crc7.compute((void *)test, 5, &crc));
94+
crc = (crc | 0x1 ) & 0xFF;
95+
TEST_ASSERT_EQUAL(0x87, crc);
96+
97+
test[0] = 0x51;
98+
test[1] = 0x00;
99+
test[2] = 0x00;
100+
test[3] = 0x00;
101+
test[4] = 0x00;
102+
TEST_ASSERT_EQUAL(0, crc7.compute((void *)test, 5, &crc));
103+
crc = (crc | 0x1 ) & 0xFF;
104+
TEST_ASSERT_EQUAL(0x55, crc);
105+
106+
MbedCRC<POLY_16BIT_CCITT, 16> crc16(0, 0, false, false);
107+
memset(test, 0xFF, 512);
108+
TEST_ASSERT_EQUAL(0, crc16.compute((void *)test, 512, &crc));
109+
TEST_ASSERT_EQUAL(0x7FA1, crc);
110+
}
111+
112+
void test_any_polynomial()
113+
{
114+
char test[] = "123456789";
115+
uint32_t crc;
116+
{
117+
MbedCRC<0x3D65, 16> ct(0x0, 0xFFFF, 0, 0);
118+
TEST_ASSERT_EQUAL(0, ct.compute((void *)test, strlen((const char*)test), &crc));
119+
TEST_ASSERT_EQUAL(0xC2B7, crc);
120+
}
121+
{
122+
MbedCRC<0x1EDC6F41, 32> ct(0xFFFFFFFF, 0xFFFFFFFF, 1, 1);
123+
TEST_ASSERT_EQUAL(0, ct.compute((void *)test, strlen((const char*)test), &crc));
124+
TEST_ASSERT_EQUAL(0xE3069283, crc);
125+
}
126+
}
127+
128+
Case cases[] = {
129+
Case("Test supported polynomials", test_supported_polynomials),
130+
Case("Test partial CRC", test_partial_crc),
131+
Case("Test SD CRC polynomials", test_sd_crc),
132+
Case("Test not supported polynomials", test_any_polynomial)
133+
};
134+
135+
utest::v1::status_t greentea_test_setup(const size_t number_of_cases) {
136+
GREENTEA_SETUP(15, "default_auto");
137+
return greentea_test_setup_handler(number_of_cases);
138+
}
139+
140+
Specification specification(greentea_test_setup, cases, greentea_test_teardown_handler);
141+
142+
int main() {
143+
Harness::run(specification);
144+
}

doxyfile_options

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,8 @@ EXCLUDE_PATTERNS = */tools/* \
847847
*/features/FEATURE_COMMON_PAL/* \
848848
*/features/FEATURE_LWIP/* \
849849
*/features/FEATURE_UVISOR/* \
850-
*/features/nanostack/* \
850+
*/features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack/* \
851+
*/features/nanostack/FEATURE_NANOSTACK/coap-service/* \
851852
*/ble/generic/* \
852853
*/ble/pal/*
853854

doxygen_options.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"PREDEFINED": "DOXYGEN_ONLY DEVICE_ANALOGIN DEVICE_ANALOGOUT DEVICE_CAN DEVICE_ETHERNET DEVICE_EMAC DEVICE_FLASH DEVICE_I2C DEVICE_I2CSLAVE DEVICE_I2C_ASYNCH DEVICE_INTERRUPTIN DEVICE_ITM DEVICE_LOWPOWERTIMER DEVICE_PORTIN DEVICE_PORTINOUT DEVICE_PORTOUT DEVICE_PWMOUT DEVICE_RTC DEVICE_TRNG DEVICE_SERIAL DEVICE_SERIAL_ASYNCH DEVICE_SERIAL_FC DEVICE_SLEEP DEVICE_SPI DEVICE_SPI_ASYNCH DEVICE_SPISLAVE DEVICE_STORAGE \"MBED_DEPRECATED_SINCE(f, g)=\" \"MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, M)=\" \"MBED_DEPRECATED(s)=\"",
1010
"EXPAND_AS_DEFINED": "",
1111
"SKIP_FUNCTION_MACROS": "NO",
12-
"EXCLUDE_PATTERNS": "*/tools/* */targets/* */features/mbedtls/* */features/storage/* */features/unsupported/* */BUILD/* */rtos/TARGET_CORTEX/rtx*/* */cmsis/* */features/FEATURE_COMMON_PAL/* */features/FEATURE_LWIP/* */features/FEATURE_UVISOR/* */features/nanostack/* */ble/generic/* */ble/pal/*"
12+
"EXCLUDE_PATTERNS": "*/tools/* */targets/* */features/mbedtls/* */features/storage/* */features/unsupported/* */BUILD/* */rtos/TARGET_CORTEX/rtx*/* */cmsis/* */features/FEATURE_COMMON_PAL/* */features/FEATURE_LWIP/* */features/FEATURE_UVISOR/* */features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack/* */features/nanostack/FEATURE_NANOSTACK/coap-service/* */ble/generic/* */ble/pal/*"
1313
}

drivers/InterruptManager.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ namespace mbed {
2626
/** \addtogroup drivers */
2727

2828
/** Use this singleton if you need to chain interrupt handlers.
29+
* @deprecated Do not use this class. This class is not part of the public API of mbed-os and is being removed in the future.
2930
*
3031
* @note Synchronization level: Thread safe
3132
*
@@ -57,6 +58,8 @@ namespace mbed {
5758
class InterruptManager : private NonCopyable<InterruptManager> {
5859
public:
5960
/** Get the instance of InterruptManager Class
61+
* @deprecated
62+
* Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
6063
*
6164
* @return the only instance of this class
6265
*/
@@ -65,12 +68,17 @@ class InterruptManager : private NonCopyable<InterruptManager> {
6568
static InterruptManager* get();
6669

6770
/** Destroy the current instance of the interrupt manager
71+
* @deprecated
72+
* Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
73+
*
6874
*/
6975
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
7076
"public API of mbed-os and is being removed in the future.")
7177
static void destroy();
7278

7379
/** Add a handler for an interrupt at the end of the handler list
80+
* @deprecated
81+
* Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
7482
*
7583
* @param function the handler to add
7684
* @param irq interrupt number
@@ -86,6 +94,8 @@ class InterruptManager : private NonCopyable<InterruptManager> {
8694
}
8795

8896
/** Add a handler for an interrupt at the beginning of the handler list
97+
* @deprecated
98+
* Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
8999
*
90100
* @param function the handler to add
91101
* @param irq interrupt number
@@ -101,6 +111,8 @@ class InterruptManager : private NonCopyable<InterruptManager> {
101111
}
102112

103113
/** Add a handler for an interrupt at the end of the handler list
114+
* @deprecated
115+
* Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
104116
*
105117
* @param tptr pointer to the object that has the handler function
106118
* @param mptr pointer to the actual handler function
@@ -118,6 +130,8 @@ class InterruptManager : private NonCopyable<InterruptManager> {
118130
}
119131

120132
/** Add a handler for an interrupt at the beginning of the handler list
133+
* @deprecated
134+
* Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
121135
*
122136
* @param tptr pointer to the object that has the handler function
123137
* @param mptr pointer to the actual handler function
@@ -135,6 +149,8 @@ class InterruptManager : private NonCopyable<InterruptManager> {
135149
}
136150

137151
/** Remove a handler from an interrupt
152+
* @deprecated
153+
* Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
138154
*
139155
* @param handler the function object for the handler to remove
140156
* @param irq the interrupt number

drivers/MbedCRC.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ namespace mbed {
2424

2525
/* Default values for different types of polynomials
2626
*/
27-
template <uint32_t polynomial, uint8_t width>
28-
MbedCRC<polynomial, width>::MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder):
29-
_initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder), _crc_table(NULL)
30-
{
31-
mbed_crc_ctor();
32-
}
33-
3427
template<>
3528
MbedCRC<POLY_32BIT_ANSI, 32>::MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder):
3629
_initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder),

drivers/MbedCRC.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@ class MbedCRC
124124
* polynomials with different intial/final/reflect values
125125
*
126126
*/
127-
MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder);
127+
MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder) :
128+
_initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data),
129+
_reflect_remainder(reflect_remainder), _crc_table(NULL)
130+
{
131+
mbed_crc_ctor();
132+
}
128133
MbedCRC();
129134
virtual ~MbedCRC()
130135
{

drivers/Timeout.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
namespace mbed {
1919

2020
void Timeout::handler() {
21-
_function.call();
21+
Callback<void()> local = _function;
22+
detach();
23+
local.call();
2224
}
2325

2426
} // namespace mbed

features/FEATURE_BLE/ble/pal/MemorySecurityDB.h renamed to features/FEATURE_BLE/ble/pal/MemorySecurityDb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef PAL_MEMORY_SECURITY_DB_H_
1818
#define PAL_MEMORY_SECURITY_DB_H_
1919

20-
#include "SecurityDB.h"
20+
#include "SecurityDb.h"
2121

2222
namespace ble {
2323
namespace pal {

features/FEATURE_BLE/ble/pal/SecurityDb.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ struct SecurityEntryIdentity_t {
8484
};
8585

8686
/**
87-
* SecurityDB holds the state for active connections and bonded devices.
87+
* SecurityDb holds the state for active connections and bonded devices.
8888
* Keys can be stored in NVM and are returned via callbacks.
89-
* SecurityDB is responsible for serialising any requests and keeping
89+
* SecurityDb is responsible for serialising any requests and keeping
9090
* the store in a consistent state.
9191
* Active connections state must be returned immediately.
9292
*/

features/FEATURE_BLE/targets/TARGET_CORDIO/CordioBLE.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "CordioPalGenericAccessService.h"
3131
#include "ble/generic/GenericGap.h"
3232
#include "ble/generic/GenericSecurityManager.h"
33-
#include "ble/pal/MemorySecurityDB.h"
33+
#include "ble/pal/MemorySecurityDb.h"
3434
#include "ble/pal/SimpleEventQueue.h"
3535

3636
namespace ble {

features/FEATURE_COMMON_PAL/mbed-coap/CHANGELOG.md

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

3+
## [v4.4.1](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.4.1)
4+
**Closed issues:**
5+
- IOTCLT-2539 Block wise messaging call-backs not working logically
6+
7+
Improve TCP+TLS transport layer to allow send larger messages without blockwising.
8+
9+
-[Full Changelog](https://github.com/ARMmbed/mbed-coap/compare/v4.4.0...v4.4.1)
10+
311
## [v4.4.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.4.0)
412
**New feature:**
513
- Make sn_coap_protocol_send_rst as public needed for CoAP ping sending

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,21 @@
9292
*/
9393
#undef SN_COAP_MAX_INCOMING_MESSAGE_SIZE /* UINT16_MAX */
9494

95+
/**
96+
* \def SN_COAP_MAX_NONBLOCKWISE_PAYLOAD_SIZE
97+
* \brief Sets the maximum payload size allowed before blockwising the message.
98+
* This option should only be used when using TCP and TLS as transport
99+
* with known maximum fragment size. This optimizes the number of messages
100+
* if it is possible to send larger than 1kB messages without blockwise transfer.
101+
* If payload length is larger than SN_COAP_MAX_NONBLOCKWISE_PAYLOAD_SIZE
102+
* it will be sent using blockwise transfer.
103+
* By default, this feature is disabled, 0 disables the feature, set to positive
104+
* value larger than SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE to enable.
105+
* Note that value should be less than transport layer maximum fragment size.
106+
* Note that value has no effect if blockwise transfer is disabled.
107+
*/
108+
#undef SN_COAP_MAX_NONBLOCKWISE_PAYLOAD_SIZE /* 0 */
109+
95110
#ifdef MBED_CLIENT_USER_CONFIG_FILE
96111
#include MBED_CLIENT_USER_CONFIG_FILE
97112
#endif

features/FEATURE_COMMON_PAL/mbed-coap/module.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mbed-coap",
3-
"version": "4.4.0",
3+
"version": "4.4.1",
44
"description": "COAP library",
55
"keywords": [
66
"coap",

features/FEATURE_COMMON_PAL/mbed-coap/source/include/sn_coap_protocol_internal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ struct sn_coap_hdr_;
117117
#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 */
118118
#endif
119119

120+
#ifndef SN_COAP_MAX_NONBLOCKWISE_PAYLOAD_SIZE
121+
#define SN_COAP_MAX_NONBLOCKWISE_PAYLOAD_SIZE 0
122+
#endif
123+
120124
#ifdef MBED_CONF_MBED_CLIENT_SN_COAP_BLOCKWISE_MAX_TIME_DATA_STORED
121125
#define SN_COAP_BLOCKWISE_MAX_TIME_DATA_STORED MBED_CONF_MBED_CLIENT_SN_COAP_BLOCKWISE_MAX_TIME_DATA_STORED
122126
#endif

features/FEATURE_COMMON_PAL/mbed-coap/source/sn_coap_builder.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,9 @@ uint16_t sn_coap_builder_calc_needed_packet_data_size_2(sn_coap_hdr_s *src_coap_
341341
}
342342
}
343343
#if SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE
344-
if ((src_coap_msg_ptr->payload_len > blockwise_payload_size) && (blockwise_payload_size > 0)) {
344+
if ((src_coap_msg_ptr->payload_len > SN_COAP_MAX_NONBLOCKWISE_PAYLOAD_SIZE) &&
345+
(src_coap_msg_ptr->payload_len > blockwise_payload_size) &&
346+
(blockwise_payload_size > 0)) {
345347
returned_byte_count += blockwise_payload_size;
346348
} else {
347349
returned_byte_count += src_coap_msg_ptr->payload_len;

0 commit comments

Comments
 (0)