26
26
namespace ble {
27
27
namespace generic {
28
28
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
-
36
29
/* *
37
30
* Generic implementation of the GattClient.
38
31
* It requires a pal::GattClient injected at construction site.
39
32
* @attention: Not part of the public interface of BLE API.
40
33
*/
41
34
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
-
50
35
public:
51
36
/* *
52
37
* Create a GenericGattClient from a pal::GattClient
@@ -130,10 +115,16 @@ class GenericGattClient : public GattClient {
130
115
virtual ble_error_t reset (void );
131
116
132
117
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 ;
137
128
138
129
void on_termination (Gap::Handle_t connection_handle);
139
130
void on_server_message_received (connection_handle_t , const pal::AttServerMessage&);
@@ -145,7 +136,8 @@ class GenericGattClient : public GattClient {
145
136
146
137
pal::GattClient* const _pal_client;
147
138
ServiceDiscovery::TerminationCallback_t _termination_callback;
148
- mutable procedure_control_block_t * control_blocks;
139
+ mutable ProcedureControlBlock* control_blocks;
140
+ bool _is_reseting;
149
141
};
150
142
151
143
}
0 commit comments