Skip to content

Commit 49f7fc0

Browse files
authored
Merge branch 'master' into FLASH_API
2 parents 7266ead + ac45aac commit 49f7fc0

File tree

601 files changed

+191417
-146868
lines changed

Some content is hidden

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

601 files changed

+191417
-146868
lines changed

.mergify.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pull_request_rules:
3838
- name: "label needs: work when travis-ci failed"
3939
conditions:
4040
# Travis failing
41-
- status-failure~=continuous-integration/travis-ci/pr
41+
- status-failure~=Travis CI - Pull Request
4242
- "label!=mergify skip"
4343
actions:
4444
label:
@@ -81,7 +81,7 @@ pull_request_rules:
8181
- -conflict
8282

8383
# CI green policy, at least Travis should be green
84-
- status-success~=continuous-integration/travis-ci/pr
84+
- status-success~=Travis CI - Pull Request
8585
# new CI needs to be done (neutral does not work, lets check if it failed or passed, if none, we need to run again)
8686
- -status-success~=continuous-integration/jenkins/pr-head
8787
- -status-failure~=continuous-integration/jenkins/pr-head
@@ -132,7 +132,7 @@ pull_request_rules:
132132
- "#changes-requested-reviews-by=0"
133133

134134
# CI green policy
135-
- status-success~=continuous-integration/travis-ci/pr
135+
- status-success~=Travis CI - Pull Request
136136
# Internal Jenkins - we rely on PR head to provide status
137137
- status-success~=continuous-integration/jenkins/pr-head
138138
# any of the jenkins pipeline needs to be green. We rely on not failure means all good (if skipped or executed)

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55

66
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
77

8-
# Using relative paths behavior
9-
if(POLICY CMP0076)
10-
cmake_policy(SET CMP0076 NEW)
11-
endif()
12-
138
include(${MBED_CONFIG_PATH}/mbed_config.cmake)
149
include(${MBED_PATH}/tools/cmake/core.cmake)
1510

TESTS/configs/baremetal.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"events",
3232
"sd",
3333
"qspif",
34+
"ospif",
3435
"spif-driver",
3536
"cryptocell310",
3637
"drivers-usb"

connectivity/FEATURE_BLE/include/ble/gap/ChainableGapEventHandler.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ class ChainableGapEventHandler : public ble::Gap::EventHandler,
4141
execute_on_all(&ble::Gap::EventHandler::onScanRequestReceived, event);
4242
}
4343

44+
void onAdvertisingStart(const ble::AdvertisingStartEvent &event) override {
45+
execute_on_all(&ble::Gap::EventHandler::onAdvertisingStart, event);
46+
}
47+
4448
void onAdvertisingEnd(const ble::AdvertisingEndEvent &event) override {
4549
execute_on_all(&ble::Gap::EventHandler::onAdvertisingEnd, event);
4650
}
@@ -112,6 +116,10 @@ class ChainableGapEventHandler : public ble::Gap::EventHandler,
112116
connectionHandle, txSize, rxSize);
113117
}
114118

119+
void onPrivacyEnabled() override {
120+
execute_on_all(&ble::Gap::EventHandler::onPrivacyEnabled);
121+
}
122+
115123
};
116124

117125
#endif /* MBED_CHAINABLEGAPEVENTHANDLER_H_ */

connectivity/cellular/CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ add_subdirectory(source/framework)
55

66
target_include_directories(mbed-cellular
77
INTERFACE
8-
${CMAKE_CURRENT_SOURCE_DIR}
9-
${CMAKE_CURRENT_SOURCE_DIR}/include
10-
${CMAKE_CURRENT_SOURCE_DIR}/include/cellular
11-
${CMAKE_CURRENT_SOURCE_DIR}/include/cellular/framework
12-
${CMAKE_CURRENT_SOURCE_DIR}/include/cellular/framework/API
13-
${CMAKE_CURRENT_SOURCE_DIR}/include/cellular/framework/AT
14-
${CMAKE_CURRENT_SOURCE_DIR}/include/cellular/framework/common
15-
${CMAKE_CURRENT_SOURCE_DIR}/include/cellular/framework/device
8+
.
9+
./include
10+
./include/cellular
11+
./include/cellular/framework
12+
./include/cellular/framework/API
13+
./include/cellular/framework/AT
14+
./include/cellular/framework/common
15+
./include/cellular/framework/device
1616
)
1717

1818
target_compile_definitions(mbed-cellular

connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/TARGET_SL_RAIL/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
target_include_directories(mbed-802.15.4-rf
55
INTERFACE
6-
${CMAKE_CURRENT_SOURCE_DIR}
6+
.
77
)
88

99
target_sources(mbed-802.15.4-rf

connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAT86RF215.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ static const phy_device_channel_page_s phy_channel_pages[] = {
164164
{ CHANNEL_PAGE_0, NULL}
165165
};
166166

167+
using namespace std::chrono_literals;
168+
167169
using namespace mbed;
168170
using namespace rtos;
169171

@@ -196,7 +198,7 @@ static Se2435Pins *se2435_pa_pins = NULL;
196198

197199
static uint32_t rf_get_timestamp(void)
198200
{
199-
return (uint32_t)rf->tx_timer.read_us();
201+
return (uint32_t)rf->tx_timer.elapsed_time().count();
200202
}
201203

202204
static void rf_lock(void)
@@ -564,17 +566,17 @@ static int8_t rf_start_csma_ca(uint8_t *data_ptr, uint16_t data_length, uint8_t
564566
mac_tx_handle = tx_handle;
565567

566568
if (tx_time) {
567-
uint32_t backoff_time = tx_time - rf_get_timestamp();
569+
std::chrono::microseconds backoff_time(tx_time - rf_get_timestamp());
568570
// Max. time to TX can be 65ms, otherwise time has passed already -> send immediately
569-
if (backoff_time <= 65000) {
570-
rf->cca_timer.attach_us(rf_csma_ca_timer_signal, backoff_time);
571+
if (backoff_time <= 65ms) {
572+
rf->cca_timer.attach(rf_csma_ca_timer_signal, backoff_time);
571573
TEST_CSMA_STARTED
572574
rf_unlock();
573575
return 0;
574576
}
575577
}
576578
// Short timeout to start CCA immediately.
577-
rf->cca_timer.attach_us(rf_csma_ca_timer_signal, 1);
579+
rf->cca_timer.attach(rf_csma_ca_timer_signal, 1us);
578580
TEST_CSMA_STARTED
579581
rf_unlock();
580582
return 0;
@@ -607,12 +609,12 @@ static void rf_handle_cca_ed_done(void)
607609
if (cca_prepare_status == PHY_RESTART_CSMA) {
608610
device_driver.phy_tx_done_cb(rf_radio_driver_id, mac_tx_handle, PHY_LINK_CCA_OK, 0, 0);
609611
if (tx_time) {
610-
uint32_t backoff_time = tx_time - rf_get_timestamp();
612+
std::chrono::microseconds backoff_time(tx_time - rf_get_timestamp());
611613
// Max. time to TX can be 65ms, otherwise time has passed already -> send immediately
612-
if (backoff_time > 65000) {
613-
backoff_time = 1;
614+
if (backoff_time > 65ms) {
615+
backoff_time = 1us;
614616
}
615-
rf->cca_timer.attach_us(rf_csma_ca_timer_signal, backoff_time);
617+
rf->cca_timer.attach(rf_csma_ca_timer_signal, backoff_time);
616618
TEST_CSMA_STARTED
617619
}
618620
return;
@@ -994,7 +996,7 @@ static uint32_t rf_backup_timer_start(uint16_t bytes, uint32_t time_us)
994996
time_us = (uint32_t)(8000000 / phy_current_config.datarate) * bytes + PACKET_PROCESSING_TIME;
995997
}
996998
// Using cal_timer as backup timer
997-
rf->cal_timer.attach_us(rf_backup_timer_signal, time_us);
999+
rf->cal_timer.attach(rf_backup_timer_signal, std::chrono::microseconds(time_us));
9981000

9991001
return (rf_get_timestamp() + time_us);
10001002
}

connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
target_include_directories(mbed-cellular
55
INTERFACE
6-
${CMAKE_CURRENT_SOURCE_DIR}
6+
.
77
)
88

99
target_sources(mbed-cellular

connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
target_include_directories(mbed-cellular
55
INTERFACE
6-
${CMAKE_CURRENT_SOURCE_DIR}
6+
.
77
)
88

99
target_sources(mbed-cellular

connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
target_include_directories(mbed-cellular
55
INTERFACE
6-
${CMAKE_CURRENT_SOURCE_DIR}
6+
.
77
)
88

99
target_sources(mbed-cellular

connectivity/drivers/emac/TARGET_GD_EMAC/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ endif()
99

1010
target_include_directories(mbed-emac
1111
INTERFACE
12-
${CMAKE_CURRENT_SOURCE_DIR}
12+
.
1313
)
1414

1515
target_sources(mbed-emac

connectivity/drivers/emac/TARGET_RDA_EMAC/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ add_subdirectory(lwip-wifi)
55

66
target_include_directories(mbed-emac
77
INTERFACE
8-
${CMAKE_CURRENT_SOURCE_DIR}
8+
.
99
)
1010

1111
target_sources(mbed-emac

connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/binaries/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function(_mbed_get_libcc_310_core)
1111
endif()
1212
target_link_libraries(mbed-mbedtls-cryptocell310
1313
INTERFACE
14-
${CMAKE_CURRENT_SOURCE_DIR}/${LIBCC_310_CORE}
14+
./${LIBCC_310_CORE}
1515
)
1616
endfunction()
1717

connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
target_include_directories(mbed-mbedtls
55
INTERFACE
6-
${CMAKE_CURRENT_SOURCE_DIR}
6+
.
77
)

connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F437xG/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
target_include_directories(mbed-mbedtls-stm
55
INTERFACE
6-
${CMAKE_CURRENT_SOURCE_DIR}
6+
.
77
)

connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F756xG/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
target_include_directories(mbed-mbedtls-stm
55
INTERFACE
6-
${CMAKE_CURRENT_SOURCE_DIR}
6+
.
77
)

connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L443xC/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
target_include_directories(mbed-mbedtls-stm
55
INTERFACE
6-
${CMAKE_CURRENT_SOURCE_DIR}
6+
.
77
)

connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L486xG/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
target_include_directories(mbed-mbedtls-stm
55
INTERFACE
6-
${CMAKE_CURRENT_SOURCE_DIR}
6+
.
77
)

connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L562xx/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
target_include_directories(mbed-mbedtls-stm
55
INTERFACE
6-
${CMAKE_CURRENT_SOURCE_DIR}
6+
.
77
)

connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32WB55xx/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
target_include_directories(mbed-mbedtls-stm
55
INTERFACE
6-
${CMAKE_CURRENT_SOURCE_DIR}
6+
.
77
)

connectivity/drivers/nfc/PN512/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
target_include_directories(mbed-nfc
55
INTERFACE
6-
${CMAKE_CURRENT_SOURCE_DIR}/include
7-
${CMAKE_CURRENT_SOURCE_DIR}/include/nfc
8-
${CMAKE_CURRENT_SOURCE_DIR}/include/nfc/controllers
9-
${CMAKE_CURRENT_SOURCE_DIR}/source
10-
${CMAKE_CURRENT_SOURCE_DIR}/source/transceiver
6+
./include
7+
./include/nfc
8+
./include/nfc/controllers
9+
./source
10+
./source/transceiver
1111
)
1212

1313
target_sources(mbed-nfc

connectivity/lorawan/lorastack/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
target_include_directories(mbed-lorawan
55
INTERFACE
6-
${CMAKE_CURRENT_SOURCE_DIR}
7-
${CMAKE_CURRENT_SOURCE_DIR}/mac
8-
${CMAKE_CURRENT_SOURCE_DIR}/phy
6+
.
7+
./mac
8+
./phy
99
)
1010

1111
target_sources(mbed-lorawan

connectivity/nanostack/coap-service/source/coap_connection_handler.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,13 @@ typedef struct secure_session {
102102
} secure_session_t;
103103

104104
static NS_LIST_DEFINE(secure_session_list, secure_session_t, link);
105+
106+
#ifdef COAP_SECURITY_AVAILABLE
105107
static int secure_session_sendto(int8_t socket_id, void *handle, const void *buf, size_t len);
106108
static int secure_session_recvfrom(int8_t socket_id, unsigned char *buf, size_t len);
107109
static void start_timer(int8_t timer_id, uint32_t int_ms, uint32_t fin_ms);
108110
static int timer_status(int8_t timer_id);
111+
#endif //COAP_SECURITY_AVAILABLE
109112

110113
static secure_session_t *secure_session_find_by_timer_id(int8_t timer_id)
111114
{
@@ -237,7 +240,9 @@ static void clear_secure_sessions(internal_socket_t *this)
237240
if (this) {
238241
ns_list_foreach_safe(secure_session_t, cur_ptr, &secure_session_list) {
239242
if (cur_ptr->parent == this) {
243+
#ifdef COAP_SECURITY_AVAILABLE
240244
coap_security_send_close_alert(cur_ptr->sec_handler);
245+
#endif //COAP_SECURITY_AVAILABLE
241246
secure_session_delete(cur_ptr);
242247
}
243248
}
@@ -430,6 +435,7 @@ static int send_to_real_socket(int8_t socket_id, const ns_address_t *address, co
430435
return socket_sendmsg(socket_id, &msghdr, 0);
431436
}
432437

438+
#ifdef COAP_SECURITY_AVAILABLE
433439
static int secure_session_sendto(int8_t socket_id, void *handle, const void *buf, size_t len)
434440
{
435441
secure_session_t *session = handle;
@@ -462,7 +468,9 @@ static int secure_session_sendto(int8_t socket_id, void *handle, const void *buf
462468
}
463469
return len;
464470
}
471+
#endif //COAP_SECURITY_AVAILABLE
465472

473+
#ifdef COAP_SECURITY_AVAILABLE
466474
static int secure_session_recvfrom(int8_t socket_id, unsigned char *buf, size_t len)
467475
{
468476
(void)len;
@@ -477,6 +485,7 @@ static int secure_session_recvfrom(int8_t socket_id, unsigned char *buf, size_t
477485
}
478486
return MBEDTLS_ERR_SSL_WANT_READ;
479487
}
488+
#endif //COAP_SECURITY_AVAILABLE
480489

481490
/**
482491
* Callback timer. Maybe called in interrupt context
@@ -516,6 +525,7 @@ static void timer_cb(void *param)
516525
}
517526
}
518527

528+
#ifdef COAP_SECURITY_AVAILABLE
519529
static void start_timer(int8_t timer_id, uint32_t int_ms, uint32_t fin_ms)
520530
{
521531
secure_session_t *sec = secure_session_find_by_timer_id(timer_id);
@@ -538,7 +548,9 @@ static void start_timer(int8_t timer_id, uint32_t int_ms, uint32_t fin_ms)
538548
}
539549
}
540550
}
551+
#endif //COAP_SECURITY_AVAILABLE
541552

553+
#ifdef COAP_SECURITY_AVAILABLE
542554
static int timer_status(int8_t timer_id)
543555
{
544556
secure_session_t *sec = secure_session_find_by_timer_id(timer_id);
@@ -547,6 +559,7 @@ static int timer_status(int8_t timer_id)
547559
}
548560
return TIMER_STATE_CANCELLED;
549561
}
562+
#endif //COAP_SECURITY_AVAILABLE
550563

551564
static int read_data(socket_callback_t *sckt_data, internal_socket_t *sock, ns_address_t *src_address, uint8_t dst_address[static 16])
552565
{
@@ -872,7 +885,9 @@ void connection_handler_close_secure_connection(coap_conn_handler_t *handler, ui
872885
if (handler->socket && handler->socket->is_secure) {
873886
secure_session_t *session = secure_session_find(handler->socket, destination_addr_ptr, port);
874887
if (session) {
888+
#ifdef COAP_SECURITY_AVAILABLE
875889
coap_security_send_close_alert(session->sec_handler);
890+
#endif //COAP_SECURITY_AVAILABLE
876891
session->session_state = SECURE_SESSION_CLOSED;
877892
session->last_contact_time = coap_service_get_internal_timer_ticks();
878893
}

connectivity/nanostack/sal-stack-nanostack/mbed_lib.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"configuration": {
66
"help": "Build time configuration. Refer to Handbook for valid values. Default: full stack",
77
"value": "nanostack_full"
8+
},
9+
"trace_max_level": {
10+
"help": "One of mbed-trace level defines: TRACE_LEVEL_DEBUG, TRACE_LEVEL_INFO, TRACE_LEVEL_WARN or TRACE_LEVEL_ERROR",
11+
"value": null
812
}
913
},
1014
"macros": ["NS_USE_EXTERNAL_MBED_TLS"],

0 commit comments

Comments
 (0)