Skip to content

Commit 3a2a248

Browse files
committed
Rebuild on mbed 6.10
1 parent 1b90ad7 commit 3a2a248

File tree

95 files changed

+1984
-1172
lines changed

Some content is hidden

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

95 files changed

+1984
-1172
lines changed

cores/arduino/mbed/connectivity/FEATURE_BLE/include/ble/gatt/GattCallbackParamTypes.h

+27-3
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,33 @@ struct GattDataSentCallbackParams {
443443

444444
};
445445

446-
using GattUpdatesEnabledCallbackParams = GattDataSentCallbackParams;
447-
using GattUpdatesDisabledCallbackParams = GattDataSentCallbackParams;
448-
using GattConfirmationReceivedCallbackParams = GattDataSentCallbackParams;
446+
/**
447+
* Gatt Updates Changed Attribute related events
448+
*
449+
* Used by `onUpdatesEnabled` and 'onUpdatesDisabled'
450+
*/
451+
struct GattUpdatesChangedCallbackParams {
452+
453+
/**
454+
* The handle of the connection that triggered the event.
455+
*/
456+
ble::connection_handle_t connHandle;
457+
458+
/**
459+
* The handle of the CCCD producing the event
460+
*/
461+
GattAttribute::Handle_t attHandle;
462+
463+
/**
464+
* The value handle of the characteristic containing the CCCD
465+
*/
466+
GattAttribute::Handle_t charHandle;
467+
468+
};
469+
470+
using GattUpdatesEnabledCallbackParams = GattUpdatesChangedCallbackParams;
471+
using GattUpdatesDisabledCallbackParams = GattUpdatesChangedCallbackParams;
472+
using GattConfirmationReceivedCallbackParams = GattDataSentCallbackParams;
449473

450474
namespace ble {
451475

cores/arduino/mbed/connectivity/FEATURE_BLE/include/ble/services/BatteryService.h

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* limitations under the License.
1717
*/
1818

19+
/* MBED_DEPRECATED */
20+
#warning "These services are deprecated and will be removed. Please see services.md for details about replacement services."
21+
1922
#ifndef MBED_BLE_BATTERY_SERVICE_H__
2023
#define MBED_BLE_BATTERY_SERVICE_H__
2124

cores/arduino/mbed/connectivity/FEATURE_BLE/include/ble/services/DeviceInformationService.h

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* limitations under the License.
1717
*/
1818

19+
/* MBED_DEPRECATED */
20+
#warning "These services are deprecated and will be removed. Please see services.md for details about replacement services."
21+
1922
#ifndef __BLE_DEVICE_INFORMATION_SERVICE_H__
2023
#define __BLE_DEVICE_INFORMATION_SERVICE_H__
2124

cores/arduino/mbed/connectivity/FEATURE_BLE/include/ble/services/EnvironmentalService.h

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* limitations under the License.
1717
*/
1818

19+
/* MBED_DEPRECATED */
20+
#warning "These services are deprecated and will be removed. Please see services.md for details about replacement services."
21+
1922
#ifndef __BLE_ENVIRONMENTAL_SERVICE_H__
2023
#define __BLE_ENVIRONMENTAL_SERVICE_H__
2124

cores/arduino/mbed/connectivity/FEATURE_BLE/include/ble/services/HealthThermometerService.h

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* limitations under the License.
1717
*/
1818

19+
/* MBED_DEPRECATED */
20+
#warning "These services are deprecated and will be removed. Please see services.md for details about replacement services."
21+
1922
#ifndef __BLE_HEALTH_THERMOMETER_SERVICE_H__
2023
#define __BLE_HEALTH_THERMOMETER_SERVICE_H__
2124

cores/arduino/mbed/connectivity/FEATURE_BLE/include/ble/services/HeartRateService.h

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* limitations under the License.
1717
*/
1818

19+
/* MBED_DEPRECATED */
20+
#warning "These services are deprecated and will be removed. Please see services.md for details about replacement services."
21+
1922
#ifndef MBED_BLE_HEART_RATE_SERVICE_H__
2023
#define MBED_BLE_HEART_RATE_SERVICE_H__
2124

cores/arduino/mbed/connectivity/FEATURE_BLE/include/ble/services/LinkLossService.h

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* limitations under the License.
1717
*/
1818

19+
/* MBED_DEPRECATED */
20+
#warning "These services are deprecated and will be removed. Please see services.md for details about replacement services."
21+
1922
#ifndef __BLE_LINK_LOSS_SERVICE_H__
2023
#define __BLE_LINK_LOSS_SERVICE_H__
2124

cores/arduino/mbed/connectivity/FEATURE_BLE/libraries/cordio_stack/wsf/include/wsf_trace.h

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626

2727
#include <stdarg.h>
2828

29+
#if MBED_CONF_CORDIO_TRACE_HCI_PACKETS
30+
#include "mbed_wsf_trace.h"
31+
#endif
32+
2933
#ifdef __cplusplus
3034
extern "C" {
3135
#endif
@@ -289,6 +293,7 @@ bool_t WsfTokenService(void);
289293
/*! \brief 3 argument HCI error trace. */
290294
#define HCI_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("HCI", "ERR", msg, var1, var2, var3)
291295

296+
#if !MBED_CONF_CORDIO_TRACE_HCI_PACKETS
292297
/*! \brief HCI PDUMP on command. */
293298
#define HCI_PDUMP_CMD(len, pBuf)
294299
/*! \brief HCI PDUMP on event. */
@@ -301,6 +306,7 @@ bool_t WsfTokenService(void);
301306
#define HCI_PDUMP_TX_ISO(len, pBuf)
302307
/*! \brief HCI PDUMP on Received ISO message. */
303308
#define HCI_PDUMP_RX_ISO(len, pBuf)
309+
#endif // !MBED_CONF_CORDIO_TRACE_HCI_PACKETS
304310

305311
/*! \brief 0 argument DM info trace. */
306312
#define DM_TRACE_INFO0(msg) WSF_TRACE0("DM", "INFO", msg)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2021 ARM Limited
3+
* SPDX-License-Identifier: Apache-2.0
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+
#ifndef BLE_CLIAPP_BLE_TRACE_HELPERS_H
19+
#define BLE_CLIAPP_BLE_TRACE_HELPERS_H
20+
21+
#include "ble/BLE.h"
22+
#include "ble/SecurityManager.h"
23+
#include "mbed-trace/mbed_trace.h"
24+
#include "pal/GapTypes.h"
25+
#include "pal/GapEvents.h"
26+
#include "dm_api.h"
27+
#include "common/UUID.h"
28+
29+
namespace ble {
30+
#if MBED_CONF_MBED_TRACE_ENABLE
31+
void trace_le_supported_features(uint64_t feat);
32+
33+
const char* dm_callback_event_to_string(uint8_t event);
34+
const char* hci_opcode_to_string(uint16_t opcode);
35+
const char* attribute_error_code_to_string(uint8_t error);
36+
const char* attribute_opcode_to_string(uint8_t error);
37+
const char* ble_error_to_string(ble_error_t error);
38+
const char* att_client_callback_event_to_string(uint8_t code);
39+
const char* att_error_code_to_string(uint8_t code);
40+
#endif //MBED_CONF_MBED_TRACE_ENABLE
41+
42+
template<size_t size>
43+
const char* to_string(const ble::byte_array_t<size> &array)
44+
{
45+
return (mbed_trace_array)(array.data(), array.size());
46+
}
47+
48+
const char* to_string(const UUID& uuid);
49+
50+
const char *to_string(bool v);
51+
52+
const char *to_string(ble::SecurityManager::SecurityIOCapabilities_t capabilities);
53+
54+
const char *to_string(ble::io_capability_t capabilities);
55+
56+
const char *to_string(ble::SecurityManager::SecurityMode_t security_mode);
57+
58+
const char *passkey_str(const uint8_t* passkey);
59+
60+
const char *to_string(const ble::address_t& address);
61+
62+
const char *to_string(const ble::link_encryption_t encryption);
63+
64+
const char *to_string(Keypress_t keypress);
65+
66+
const char *to_string(ble::pairing_failure_t reason);
67+
68+
const char *to_string(target_peer_address_type_t type);
69+
70+
const char *to_string(privacy_mode_t mode);
71+
72+
const char *to_string(ble::advertising_type_t advType);
73+
74+
const char *to_string(ble::own_address_type_t addressType);
75+
76+
const char *to_string(ble::advertising_filter_policy_t policy);
77+
78+
const char *to_string(ble::phy_t phy);
79+
80+
const char *to_string(ble::scanning_filter_policy_t policy);
81+
82+
const char *to_string(ble::duplicates_filter_t filtering);
83+
84+
const char *to_string(ble::peer_address_type_t addressType);
85+
86+
const char *to_string(ble::initiator_filter_policy_t policy);
87+
88+
const char *to_string(ble::coded_symbol_per_bit_t sym);
89+
90+
const char *to_string(ble::local_disconnection_reason_t reason);
91+
92+
const char *to_string(ble::advertising_channel_map_t map);
93+
94+
const char *to_string(ble::connection_peer_address_type_t connection_peer_address_type);
95+
96+
const char *to_string(ble::whitelist_address_type_t whitelist_address_type);
97+
98+
const char *to_string(ble::hci_error_code_t error);
99+
100+
const char *to_string(ble::advertising_fragment_description_t fragment_description);
101+
102+
const char *to_string(ble::peripheral_privacy_configuration_t::resolution_strategy_t resolution_strategy);
103+
104+
const char *to_string(ble::GapEventType event_type);
105+
106+
const char *to_string(ble::received_advertising_type_t type);
107+
108+
const char *to_string(ble::connection_role_t role);
109+
110+
const char *to_string(ble::direct_address_type_t direct_address_type);
111+
112+
const char *to_string(ble::advertising_data_status_t data_status);
113+
114+
const char *to_string(ble::att_security_requirement_t security_requirement);
115+
116+
const char *to_string(GattAuthCallbackReply_t authorization_reply);
117+
118+
} // namespace ble
119+
120+
#endif //BLE_CLIAPP_BLE_TRACE_HELPERS_H

cores/arduino/mbed/connectivity/FEATURE_BLE/source/cordio/source/GattServerImpl.h

+2
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ class GattServer : public PalSigningMonitor {
293293

294294
bool get_cccd_index_by_value_handle(GattAttribute::Handle_t char_handle, uint8_t &idx) const;
295295

296+
bool get_value_handle_by_cccd_handle(GattAttribute::Handle_t cccd_handle, GattAttribute::Handle_t &char_handle) const;
297+
296298
bool is_update_authorized(connection_handle_t connection, GattAttribute::Handle_t value_handle);
297299

298300
struct alloc_block_t {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2021 ARM Limited
3+
* SPDX-License-Identifier: Apache-2.0
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+
#ifndef MBED_WSF_TRACE_H_
19+
#define MBED_WSF_TRACE_H_
20+
21+
#if MBED_CONF_MBED_TRACE_ENABLE
22+
void wsf_mbed_trace_init();
23+
24+
#if MBED_CONF_CORDIO_TRACE_HCI_PACKETS
25+
void wsf_mbed_trace_hci(const uint8_t *pBuf, uint32_t len, const uint8_t *prefix);
26+
27+
#define HCI_PDUMP_CMD(len, pBuf) wsf_mbed_trace_hci(len, pBuf, "CMD")
28+
#define HCI_PDUMP_EVT(len, pBuf) wsf_mbed_trace_hci(len, pBuf, "EVT")
29+
#define HCI_PDUMP_TX_ACL(len, pBuf) wsf_mbed_trace_hci(len, pBuf, "ACL_TX")
30+
#define HCI_PDUMP_RX_ACL(len, pBuf) wsf_mbed_trace_hci(len, pBuf, "ACL_RX")
31+
#define HCI_PDUMP_TX_ISO(len, pBuf) wsf_mbed_trace_hci(len, pBuf, "ISO_TX")
32+
#define HCI_PDUMP_RX_ISO(len, pBuf) wsf_mbed_trace_hci(len, pBuf, "ISO_RX")
33+
#endif // MBED_CONF_CORDIO_TRACE_HCI_PACKETS
34+
35+
#endif // MBED_CONF_MBED_TRACE_ENABLE
36+
37+
#endif // MBED_WSF_TRACE_H_

cores/arduino/mbed/connectivity/FEATURE_BLE/source/generic/FileSecurityDb.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ class FileSecurityDb : public SecurityDb {
3737
size_t file_offset;
3838
};
3939

40-
static entry_t* as_entry(entry_handle_t db_handle) {
41-
return reinterpret_cast<entry_t*>(db_handle);
42-
}
40+
static entry_t* as_entry(entry_handle_t db_handle);
4341

4442
template<class T>
4543
void db_read(T *value, long int offset) {
@@ -161,6 +159,11 @@ class FileSecurityDb : public SecurityDb {
161159
*/
162160
static FILE* erase_db_file(FILE* db_file);
163161

162+
uint8_t get_index(const entry_handle_t db_handle) const
163+
{
164+
return reinterpret_cast<entry_t*>(db_handle) - _entries;
165+
}
166+
164167
private:
165168
entry_t _entries[BLE_SECURITY_DATABASE_MAX_ENTRIES];
166169
FILE *_db_file;

cores/arduino/mbed/connectivity/FEATURE_BLE/source/generic/GapImpl.h

+6
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,8 @@ class Gap :
907907

908908
ScanState _scan_state = ScanState::idle;
909909

910+
void set_scan_state(ScanState state);
911+
910912
scan_duration_t _scan_requested_duration = scan_duration_t::forever();
911913
duplicates_filter_t _scan_requested_filtering = duplicates_filter_t::DISABLE;
912914
scan_period_t _scan_requested_period = scan_period_t(0);
@@ -989,6 +991,10 @@ class Gap :
989991

990992

991993
bool _user_manage_connection_parameter_requests : 1;
994+
#if BLE_ROLE_OBSERVER
995+
bool _scan_parameters_set : 1 = false;
996+
#endif // BLE_ROLE_OBSERVER
997+
992998
};
993999

9941000
} // namespace impl

cores/arduino/mbed/connectivity/FEATURE_BLE/source/generic/KVStoreSecurityDb.h

-4
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ class KVStoreSecurityDb : public SecurityDb {
6363
static constexpr char DB_VERSION[DB_KEY_SIZE] = { 'v','e','r' };
6464
static constexpr char DB_RESTORE[DB_KEY_SIZE] = { 'r','e','s' };
6565

66-
static entry_t* as_entry(entry_handle_t db_handle) {
67-
return reinterpret_cast<entry_t*>(db_handle);
68-
}
69-
7066
template<class T>
7167
static void db_read(T *value, const char* key) {
7268
char db_key[DB_FULL_KEY_SIZE];

0 commit comments

Comments
 (0)