Skip to content

Commit 7e64019

Browse files
move pal to cordio, remove cordio mentions from API
1 parent 55efdb3 commit 7e64019

Some content is hidden

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

53 files changed

+568
-533
lines changed

components/BLE/COMPONENT_BlueNRG_MS/BlueNrgMsHCIDriver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "platform/mbed_wait_api.h"
2828

2929
// FEATURE_BLE/targets/TARGET_CORDIO
30-
#include "CordioBLEInstanceBase.h"
30+
#include "BLEInstanceBase.h"
3131
#include "CordioHCIDriver.h"
3232
#include "CordioHCITransportDriver.h"
3333
#include "hci_api.h"

connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCIDriver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <stddef.h>
1818
#include <string.h>
1919

20-
#include "ble/internal/cordio/CordioBLEInstanceBase.h"
20+
#include "ble/internal/BLEInstanceBase.h"
2121
#include "ble/BLE.h"
2222
#include "ble/Gap.h"
2323
#include "CordioHCIDriver.h"
@@ -98,7 +98,7 @@ buf_pool_desc_t CordioHCIDriver::get_default_buffer_pool_description()
9898

9999
void CordioHCIDriver::set_random_static_address(const ble::address_t& address)
100100
{
101-
ble_error_t err = CordioBLEInstanceBase::deviceInstance().getGap().setRandomStaticAddress(address);
101+
ble_error_t err = BLEInstanceBase::deviceInstance().getGap().setRandomStaticAddress(address);
102102
MBED_ASSERT(err == BLE_ERROR_NONE);
103103
}
104104

connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCIDriver.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
#ifndef CORDIO_HCI_DRIVER_H_
18-
#define CORDIO_HCI_DRIVER_H_
17+
#ifndef IMPL_HCI_DRIVER_H_
18+
#define IMPL_HCI_DRIVER_H_
1919

2020
#include <stddef.h>
2121
#include <stdint.h>
@@ -229,4 +229,4 @@ class CordioHCIDriver {
229229

230230
} // namespace ble
231231

232-
#endif /* CORDIO_HCI_DRIVER_H_ */
232+
#endif /* IMPL_HCI_DRIVER_H_ */

connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCITransportDriver.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
#ifndef CORDIO_HCI_TRANSPORT_DRIVER_H_
18-
#define CORDIO_HCI_TRANSPORT_DRIVER_H_
17+
#ifndef IMPL_HCI_TRANSPORT_DRIVER_H_
18+
#define IMPL_HCI_TRANSPORT_DRIVER_H_
1919

2020
#include <stdint.h>
2121

@@ -78,4 +78,4 @@ class CordioHCITransportDriver {
7878

7979
} // namespace ble
8080

81-
#endif /* CORDIO_HCI_TRANSPORT_DRIVER_H_ */
81+
#endif /* IMPL_HCI_TRANSPORT_DRIVER_H_ */

connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/H4TransportDriver.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
#ifndef CORDIO_H4_TRANSPORT_DRIVER_H_
18-
#define CORDIO_H4_TRANSPORT_DRIVER_H_
17+
#ifndef IMPL_H4_TRANSPORT_DRIVER_H_
18+
#define IMPL_H4_TRANSPORT_DRIVER_H_
1919

2020
#if (DEVICE_SERIAL && DEVICE_SERIAL_FC) || defined(DOXYGEN_ONLY)
2121

@@ -78,4 +78,4 @@ class H4TransportDriver : public CordioHCITransportDriver {
7878

7979
#endif
8080

81-
#endif /* CORDIO_H4_TRANSPORT_DRIVER_H_ */
81+
#endif /* IMPL_H4_TRANSPORT_DRIVER_H_ */

connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioBLEInstanceBase.h renamed to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/include/ble/internal/BLEInstanceBaseImpl.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@
1616
* limitations under the License.
1717
*/
1818

19-
#ifndef CORDIO_BLE_H_
20-
#define CORDIO_BLE_H_
19+
#ifndef IMPL_BLE_INSTANCE_BASE_H_
20+
#define IMPL_BLE_INSTANCE_BASE_H_
2121

2222
#include "ble/BLE.h"
2323
#include "ble/types/blecommon.h"
2424
#include "ble/internal/BLEInstanceBase.h"
2525

2626
#include "CordioHCIDriver.h"
2727
#include "ble/GattServer.h"
28-
#include "CordioPalAttClient.h"
29-
#include "CordioPalGattClient.h"
28+
#include "PalAttClient.h"
29+
#include "PalGattClient.h"
3030
#include "ble/GattClient.h"
31-
#include "ble/internal/pal/PalGap.h"
31+
#include "ble/internal/PalGap.h"
3232
#include "ble/Gap.h"
33-
#include "CordioPalGenericAccessService.h"
33+
#include "PalGenericAccessService.h"
3434
#include "ble/SecurityManager.h"
35-
#include "CordioPalEventQueue.h"
35+
#include "PalEventQueue.h"
3636
#include "drivers/LowPowerTimer.h"
37-
#include "ble/internal/pal/PalSecurityManager.h"
37+
#include "ble/internal/PalSecurityManager.h"
3838

3939
namespace ble {
4040

@@ -43,25 +43,25 @@ class PalSigningMonitor;
4343
/**
4444
* @see BLEInstanceBase
4545
*/
46-
class CordioBLEInstanceBase : public BLEInstanceBase {
46+
class BLEInstanceBase : public interface::BLEInstanceBase {
4747
friend PalSigningMonitor;
4848
/**
4949
* Construction with an HCI driver.
5050
*/
51-
CordioBLEInstanceBase(CordioHCIDriver& hci_driver);
51+
BLEInstanceBase(CordioHCIDriver& hci_driver);
5252

5353
/**
5454
* Destructor
5555
*/
56-
virtual ~CordioBLEInstanceBase();
56+
virtual ~BLEInstanceBase();
5757

5858
public:
5959

6060
/**
6161
* Access to the singleton containing the implementation of BLEInstanceBase
6262
* for the Cordio stack.
6363
*/
64-
static CordioBLEInstanceBase& deviceInstance();
64+
static BLEInstanceBase& deviceInstance();
6565

6666
/**
6767
* @see BLEInstanceBase::init
@@ -171,4 +171,4 @@ class CordioBLEInstanceBase : public BLEInstanceBase {
171171
} // namespace ble
172172

173173

174-
#endif /* CORDIO_BLE_H_ */
174+
#endif /* IMPL_BLE_INSTANCE_BASE_H_ */

connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalAttClient.h renamed to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/include/ble/internal/PalAttClientImpl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
* limitations under the License.
1717
*/
1818

19-
#ifndef CORDIO_PAL_ATT_CLIENT_
20-
#define CORDIO_PAL_ATT_CLIENT_
19+
#ifndef IMPL_PAL_ATT_CLIENT_
20+
#define IMPL_PAL_ATT_CLIENT_
2121

2222
#include "PalSimpleAttServerMessage.h"
2323
#include "att_api.h"
24-
#include "ble/internal/pal/PalAttClient.h"
24+
#include "ble/internal/PalAttClient.h"
2525

2626
namespace ble {
2727

@@ -475,4 +475,4 @@ class PalAttClient : public interface::PalAttClient {
475475

476476
} // ble
477477

478-
#endif /* CORDIO_PAL_ATT_CLIENT_ */
478+
#endif /* IMPL_PAL_ATT_CLIENT_ */

connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalEventQueue.h renamed to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/include/ble/internal/PalEventQueueImpl.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
#define BLE_PAL_SIMPLE_EVENT_QUEUE_H_
2121

2222
#include <new>
23-
#include "pal/PalEventQueue.h"
24-
#include "ble/internal/BLEInstanceBase.h"
25-
#include "ble/BLE.h"
23+
#include "ble/internal/PalEventQueue.h"
2624

2725
#include "wsf_buf.h"
2826

2927
namespace ble {
3028

29+
class BLEInstanceBase;
30+
3131
/**
3232
* Simple implementation of the EventQueue.
3333
*/
34-
struct PalEventQueue : interface::PalEventQueue {
35-
34+
class PalEventQueue : interface::PalEventQueue {
35+
public:
3636
typedef mbed::Callback<void()> event_t;
3737

3838
/**
@@ -130,10 +130,7 @@ struct PalEventQueue : interface::PalEventQueue {
130130
EventNode* next;
131131
};
132132

133-
void signal_event()
134-
{
135-
_ble_base->signalEventsToProcess();
136-
}
133+
void signal_event();
137134

138135
BLEInstanceBase* _ble_base;
139136
EventNode* _events;

connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalGap.h renamed to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/include/ble/internal/PalGapImpl.h

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
* limitations under the License.
1717
*/
1818

19-
#ifndef CORDIO_PAL_GAP_
20-
#define CORDIO_PAL_GAP_
19+
#ifndef IMPL_PAL_GAP_
20+
#define IMPL_PAL_GAP_
2121

22-
#include "ble/internal/pal/PalGap.h"
22+
#include "ble/internal/PalGap.h"
2323
#include "dm_api.h"
2424

2525
namespace ble {
@@ -144,7 +144,7 @@ class PalGap : public interface::PalGap {
144144
);
145145

146146
bool is_privacy_supported();
147-
147+
148148
ble_error_t set_address_resolution(
149149
bool enable
150150
);
@@ -328,7 +328,12 @@ class PalGap : public interface::PalGap {
328328
PalGapEventHandler *get_event_handler();
329329

330330
private:
331-
331+
/**
332+
* Called this function whenever the LE subsystem
333+
* generate a PalGap event.
334+
*
335+
* @param gap_event The event to emit to higher layer.
336+
*/
332337
void emit_gap_event(const GapEvent &gap_event)
333338
{
334339
if (_gap_event_cb) {
@@ -496,6 +501,27 @@ class PalGap : public interface::PalGap {
496501
advertising_peer_address_type_t peer_address_type
497502
);
498503

504+
/**
505+
* Create an ALL_PHYS parameter used in LE Set PHY Command
506+
* and LE Set Default PHY Command.
507+
* @see BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E - 7.8.49
508+
*/
509+
static uint8_t create_all_phys_value(
510+
const phy_set_t &tx_phys,
511+
const phy_set_t &rx_phys
512+
)
513+
{
514+
/* if phy set is empty set corresponding all_phys bit to 1 */
515+
uint8_t all_phys = 0;
516+
if (tx_phys.value() == 0) {
517+
all_phys |= 0x01;
518+
}
519+
if (rx_phys.value() == 0) {
520+
all_phys |= 0x02;
521+
}
522+
return all_phys;
523+
}
524+
499525
private:
500526
PalGapEventHandler* _pal_event_handler;
501527
address_t device_random_address;
@@ -512,4 +538,4 @@ class PalGap : public interface::PalGap {
512538

513539
} // ble
514540

515-
#endif /* CORDIO_PAL_GAP_ */
541+
#endif /* IMPL_PAL_GAP_ */

connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalGattClient.h renamed to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/include/ble/internal/PalGattClientImpl.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#ifndef BLE_PAL_ATTCLIENTTOGATTCLIENTADAPTER_H_
2020
#define BLE_PAL_ATTCLIENTTOGATTCLIENTADAPTER_H_
2121

22-
#include "ble/internal/pal/PalGattClient.h"
22+
#include "ble/internal/PalGattClient.h"
2323

2424
namespace ble {
2525

@@ -223,7 +223,11 @@ class PalGattClient : public interface::PalGattClient {
223223

224224
private:
225225
/**
226-
* @see ble::PalGattClient::on_server_event
226+
* Upon server message reception an implementation shall call this function.
227+
*
228+
* @param connection_handle The handle of the connection which has received
229+
* the server message.
230+
* @param server_message The message received from the server.
227231
*/
228232
void on_server_event(
229233
connection_handle_t connection_handle,
@@ -235,7 +239,13 @@ class PalGattClient : public interface::PalGattClient {
235239
}
236240

237241
/**
238-
* @see ble::PalGattClient::on_transaction_timeout
242+
* Upon transaction timeout an implementation shall call this function.
243+
*
244+
* @param connection_handle The handle of the connection of the transaction
245+
* which has times out.
246+
*
247+
* @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.3.3
248+
* @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part G Section 4.4.14
239249
*/
240250
void on_transaction_timeout(
241251
connection_handle_t connection_handle

0 commit comments

Comments
 (0)