Skip to content

Commit 7e78433

Browse files
committed
BLE - replace some usages of Gap::Handle_t by ble::connection_handle_t
1 parent bc098d0 commit 7e78433

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

features/FEATURE_BLE/ble/DiscoveredCharacteristic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ class DiscoveredCharacteristic {
537537
* @return Connection handle to the GattServer, which contains this
538538
* characteristic.
539539
*/
540-
Gap::Handle_t getConnectionHandle() const
540+
ble::connection_handle_t getConnectionHandle() const
541541
{
542542
return connHandle;
543543
}
@@ -625,7 +625,7 @@ class DiscoveredCharacteristic {
625625
/**
626626
* Handle of the connection where the characteristic was discovered.
627627
*/
628-
Gap::Handle_t connHandle;
628+
ble::connection_handle_t connHandle;
629629
};
630630

631631
/**

features/FEATURE_BLE/ble/DiscoveredCharacteristicDescriptor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class DiscoveredCharacteristicDescriptor {
7373
*/
7474
DiscoveredCharacteristicDescriptor(
7575
GattClient *client,
76-
Gap::Handle_t connectionHandle,
76+
ble::connection_handle_t connectionHandle,
7777
GattAttribute::Handle_t attributeHandle,
7878
const UUID &uuid
7979
) : _client(client),
@@ -109,7 +109,7 @@ class DiscoveredCharacteristicDescriptor {
109109
* @return the connection handle to the GattServer containing this
110110
* descriptor.
111111
*/
112-
Gap::Handle_t getConnectionHandle() const
112+
ble::connection_handle_t getConnectionHandle() const
113113
{
114114
return _connectionHandle;
115115
}
@@ -139,7 +139,7 @@ class DiscoveredCharacteristicDescriptor {
139139

140140
private:
141141
GattClient *_client;
142-
Gap::Handle_t _connectionHandle;
142+
ble::connection_handle_t _connectionHandle;
143143
UUID _uuid;
144144
GattAttribute::Handle_t _gattHandle;
145145
};

features/FEATURE_BLE/ble/GattCallbackParamTypes.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ struct GattWriteCallbackParams {
8383
/**
8484
* Handle of the connection that triggered the event.
8585
*/
86-
Gap::Handle_t connHandle;
86+
ble::connection_handle_t connHandle;
8787

8888
/**
8989
* Handle of the attribute to which the write operation applies.
@@ -152,7 +152,7 @@ struct GattReadCallbackParams {
152152
/**
153153
* Handle of the connection that triggered the event.
154154
*/
155-
Gap::Handle_t connHandle;
155+
ble::connection_handle_t connHandle;
156156

157157
/**
158158
* Attribute Handle to which the read operation applies.
@@ -274,7 +274,7 @@ struct GattWriteAuthCallbackParams {
274274
/**
275275
* Handle of the connection that triggered the event.
276276
*/
277-
Gap::Handle_t connHandle;
277+
ble::connection_handle_t connHandle;
278278

279279
/**
280280
* Attribute Handle to which the write operation applies.
@@ -313,7 +313,7 @@ struct GattReadAuthCallbackParams {
313313
/**
314314
* The handle of the connection that triggered the event.
315315
*/
316-
Gap::Handle_t connHandle;
316+
ble::connection_handle_t connHandle;
317317

318318
/**
319319
* Attribute Handle to which the read operation applies.
@@ -357,7 +357,7 @@ struct GattHVXCallbackParams {
357357
/**
358358
* The handle of the connection that triggered the event.
359359
*/
360-
Gap::Handle_t connHandle;
360+
ble::connection_handle_t connHandle;
361361

362362
/**
363363
* Attribute Handle to which the HVx operation applies.

features/FEATURE_BLE/ble/ServiceDiscovery.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class ServiceDiscovery {
7878
* parameter is used to identify on which connection the service discovery
7979
* process ended.
8080
*/
81-
typedef FunctionPointerWithContext<Gap::Handle_t> TerminationCallback_t;
81+
typedef FunctionPointerWithContext<ble::connection_handle_t> TerminationCallback_t;
8282

8383
public:
8484
/**
@@ -135,7 +135,7 @@ class ServiceDiscovery {
135135
* @return
136136
* BLE_ERROR_NONE if service discovery is launched successfully; else an appropriate error.
137137
*/
138-
virtual ble_error_t launch(Gap::Handle_t connectionHandle,
138+
virtual ble_error_t launch(ble::connection_handle_t connectionHandle,
139139
ServiceCallback_t sc = NULL,
140140
CharacteristicCallback_t cc = NULL,
141141
const UUID &matchingServiceUUID = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN),
@@ -182,7 +182,7 @@ class ServiceDiscovery {
182182
/**
183183
* Connection handle as provided by the SoftDevice.
184184
*/
185-
Gap::Handle_t connHandle;
185+
ble::connection_handle_t connHandle;
186186
/**
187187
* UUID-based filter that specifies the service that the application is
188188
* interested in.

features/FEATURE_BLE/source/DiscoveredCharacteristic.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ DiscoveredCharacteristic::read(uint16_t offset) const
3232
}
3333

3434
struct OneShotReadCallback {
35-
static void launch(GattClient* client, Gap::Handle_t connHandle,
35+
static void launch(GattClient* client, ble::connection_handle_t connHandle,
3636
GattAttribute::Handle_t handle, const GattClient::ReadCallback_t& cb) {
3737
OneShotReadCallback* oneShot = new OneShotReadCallback(client, connHandle, handle, cb);
3838
oneShot->attach();
3939
// delete will be made when this callback is called
4040
}
4141

4242
private:
43-
OneShotReadCallback(GattClient* client, Gap::Handle_t connHandle,
43+
OneShotReadCallback(GattClient* client, ble::connection_handle_t connHandle,
4444
GattAttribute::Handle_t handle, const GattClient::ReadCallback_t& cb) :
4545
_client(client),
4646
_connHandle(connHandle),
@@ -61,7 +61,7 @@ struct OneShotReadCallback {
6161
}
6262

6363
GattClient* _client;
64-
Gap::Handle_t _connHandle;
64+
ble::connection_handle_t _connHandle;
6565
GattAttribute::Handle_t _handle;
6666
GattClient::ReadCallback_t _callback;
6767
};
@@ -106,15 +106,15 @@ DiscoveredCharacteristic::writeWoResponse(uint16_t length, const uint8_t *value)
106106
}
107107

108108
struct OneShotWriteCallback {
109-
static void launch(GattClient* client, Gap::Handle_t connHandle,
109+
static void launch(GattClient* client, ble::connection_handle_t connHandle,
110110
GattAttribute::Handle_t handle, const GattClient::WriteCallback_t& cb) {
111111
OneShotWriteCallback* oneShot = new OneShotWriteCallback(client, connHandle, handle, cb);
112112
oneShot->attach();
113113
// delete will be made when this callback is called
114114
}
115115

116116
private:
117-
OneShotWriteCallback(GattClient* client, Gap::Handle_t connHandle,
117+
OneShotWriteCallback(GattClient* client, ble::connection_handle_t connHandle,
118118
GattAttribute::Handle_t handle, const GattClient::WriteCallback_t& cb) :
119119
_client(client),
120120
_connHandle(connHandle),
@@ -135,7 +135,7 @@ struct OneShotWriteCallback {
135135
}
136136

137137
GattClient* _client;
138-
Gap::Handle_t _connHandle;
138+
ble::connection_handle_t _connHandle;
139139
GattAttribute::Handle_t _handle;
140140
GattClient::WriteCallback_t _callback;
141141
};

0 commit comments

Comments
 (0)