Skip to content

Commit b32828b

Browse files
authored
Merge pull request #5739 from pan-/nordic-new-client
BLE: Nordic pal client implementation
2 parents c0c501c + 3105327 commit b32828b

20 files changed

+2087
-1919
lines changed

features/FEATURE_BLE/ble/UUID.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#ifndef MBED_UUID_H__
1818
#define MBED_UUID_H__
1919

20+
#include <stddef.h>
2021
#include <stdint.h>
2122
#include <string.h>
2223
#include <algorithm>

features/FEATURE_BLE/ble/generic/GenericGattClient.h

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,12 @@
2626
namespace ble {
2727
namespace generic {
2828

29-
// forward declarations
30-
struct procedure_control_block_t;
31-
struct discovery_control_block_t;
32-
struct read_control_block_t;
33-
struct write_control_block_t;
34-
struct descriptor_discovery_control_block_t;
35-
3629
/**
3730
* Generic implementation of the GattClient.
3831
* It requires a pal::GattClient injected at construction site.
3932
* @attention: Not part of the public interface of BLE API.
4033
*/
4134
class GenericGattClient : public GattClient {
42-
43-
// give access to control block classes
44-
friend struct procedure_control_block_t;
45-
friend struct discovery_control_block_t;
46-
friend struct read_control_block_t;
47-
friend struct write_control_block_t;
48-
friend struct descriptor_discovery_control_block_t;
49-
5035
public:
5136
/**
5237
* Create a GenericGattClient from a pal::GattClient
@@ -130,10 +115,16 @@ class GenericGattClient : public GattClient {
130115
virtual ble_error_t reset(void);
131116

132117
private:
133-
procedure_control_block_t* get_control_block(Gap::Handle_t connection);
134-
const procedure_control_block_t* get_control_block(Gap::Handle_t connection) const;
135-
void insert_control_block(procedure_control_block_t* cb) const;
136-
void remove_control_block(procedure_control_block_t* cb) const;
118+
struct ProcedureControlBlock;
119+
struct DiscoveryControlBlock;
120+
struct ReadControlBlock;
121+
struct WriteControlBlock;
122+
struct DescriptorDiscoveryControlBlock;
123+
124+
ProcedureControlBlock* get_control_block(Gap::Handle_t connection);
125+
const ProcedureControlBlock* get_control_block(Gap::Handle_t connection) const;
126+
void insert_control_block(ProcedureControlBlock* cb) const;
127+
void remove_control_block(ProcedureControlBlock* cb) const;
137128

138129
void on_termination(Gap::Handle_t connection_handle);
139130
void on_server_message_received(connection_handle_t, const pal::AttServerMessage&);
@@ -145,7 +136,8 @@ class GenericGattClient : public GattClient {
145136

146137
pal::GattClient* const _pal_client;
147138
ServiceDiscovery::TerminationCallback_t _termination_callback;
148-
mutable procedure_control_block_t* control_blocks;
139+
mutable ProcedureControlBlock* control_blocks;
140+
bool _is_reseting;
149141
};
150142

151143
}

0 commit comments

Comments
 (0)