BLE - replace some usages of Gap::Handle_t by ble::connection_handle_t

pull/9727/head
Vincent Coubard 2019-02-25 18:49:53 +00:00
parent bc098d0272
commit 7e78433cec
5 changed files with 19 additions and 19 deletions

View File

@ -537,7 +537,7 @@ public:
* @return Connection handle to the GattServer, which contains this * @return Connection handle to the GattServer, which contains this
* characteristic. * characteristic.
*/ */
Gap::Handle_t getConnectionHandle() const ble::connection_handle_t getConnectionHandle() const
{ {
return connHandle; return connHandle;
} }
@ -625,7 +625,7 @@ protected:
/** /**
* Handle of the connection where the characteristic was discovered. * Handle of the connection where the characteristic was discovered.
*/ */
Gap::Handle_t connHandle; ble::connection_handle_t connHandle;
}; };
/** /**

View File

@ -73,7 +73,7 @@ public:
*/ */
DiscoveredCharacteristicDescriptor( DiscoveredCharacteristicDescriptor(
GattClient *client, GattClient *client,
Gap::Handle_t connectionHandle, ble::connection_handle_t connectionHandle,
GattAttribute::Handle_t attributeHandle, GattAttribute::Handle_t attributeHandle,
const UUID &uuid const UUID &uuid
) : _client(client), ) : _client(client),
@ -109,7 +109,7 @@ public:
* @return the connection handle to the GattServer containing this * @return the connection handle to the GattServer containing this
* descriptor. * descriptor.
*/ */
Gap::Handle_t getConnectionHandle() const ble::connection_handle_t getConnectionHandle() const
{ {
return _connectionHandle; return _connectionHandle;
} }
@ -139,7 +139,7 @@ public:
private: private:
GattClient *_client; GattClient *_client;
Gap::Handle_t _connectionHandle; ble::connection_handle_t _connectionHandle;
UUID _uuid; UUID _uuid;
GattAttribute::Handle_t _gattHandle; GattAttribute::Handle_t _gattHandle;
}; };

View File

@ -83,7 +83,7 @@ struct GattWriteCallbackParams {
/** /**
* Handle of the connection that triggered the event. * Handle of the connection that triggered the event.
*/ */
Gap::Handle_t connHandle; ble::connection_handle_t connHandle;
/** /**
* Handle of the attribute to which the write operation applies. * Handle of the attribute to which the write operation applies.
@ -152,7 +152,7 @@ struct GattReadCallbackParams {
/** /**
* Handle of the connection that triggered the event. * Handle of the connection that triggered the event.
*/ */
Gap::Handle_t connHandle; ble::connection_handle_t connHandle;
/** /**
* Attribute Handle to which the read operation applies. * Attribute Handle to which the read operation applies.
@ -274,7 +274,7 @@ struct GattWriteAuthCallbackParams {
/** /**
* Handle of the connection that triggered the event. * Handle of the connection that triggered the event.
*/ */
Gap::Handle_t connHandle; ble::connection_handle_t connHandle;
/** /**
* Attribute Handle to which the write operation applies. * Attribute Handle to which the write operation applies.
@ -313,7 +313,7 @@ struct GattReadAuthCallbackParams {
/** /**
* The handle of the connection that triggered the event. * The handle of the connection that triggered the event.
*/ */
Gap::Handle_t connHandle; ble::connection_handle_t connHandle;
/** /**
* Attribute Handle to which the read operation applies. * Attribute Handle to which the read operation applies.
@ -357,7 +357,7 @@ struct GattHVXCallbackParams {
/** /**
* The handle of the connection that triggered the event. * The handle of the connection that triggered the event.
*/ */
Gap::Handle_t connHandle; ble::connection_handle_t connHandle;
/** /**
* Attribute Handle to which the HVx operation applies. * Attribute Handle to which the HVx operation applies.

View File

@ -78,7 +78,7 @@ public:
* parameter is used to identify on which connection the service discovery * parameter is used to identify on which connection the service discovery
* process ended. * process ended.
*/ */
typedef FunctionPointerWithContext<Gap::Handle_t> TerminationCallback_t; typedef FunctionPointerWithContext<ble::connection_handle_t> TerminationCallback_t;
public: public:
/** /**
@ -135,7 +135,7 @@ public:
* @return * @return
* BLE_ERROR_NONE if service discovery is launched successfully; else an appropriate error. * BLE_ERROR_NONE if service discovery is launched successfully; else an appropriate error.
*/ */
virtual ble_error_t launch(Gap::Handle_t connectionHandle, virtual ble_error_t launch(ble::connection_handle_t connectionHandle,
ServiceCallback_t sc = NULL, ServiceCallback_t sc = NULL,
CharacteristicCallback_t cc = NULL, CharacteristicCallback_t cc = NULL,
const UUID &matchingServiceUUID = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN), const UUID &matchingServiceUUID = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN),
@ -182,7 +182,7 @@ protected:
/** /**
* Connection handle as provided by the SoftDevice. * Connection handle as provided by the SoftDevice.
*/ */
Gap::Handle_t connHandle; ble::connection_handle_t connHandle;
/** /**
* UUID-based filter that specifies the service that the application is * UUID-based filter that specifies the service that the application is
* interested in. * interested in.

View File

@ -32,7 +32,7 @@ DiscoveredCharacteristic::read(uint16_t offset) const
} }
struct OneShotReadCallback { struct OneShotReadCallback {
static void launch(GattClient* client, Gap::Handle_t connHandle, static void launch(GattClient* client, ble::connection_handle_t connHandle,
GattAttribute::Handle_t handle, const GattClient::ReadCallback_t& cb) { GattAttribute::Handle_t handle, const GattClient::ReadCallback_t& cb) {
OneShotReadCallback* oneShot = new OneShotReadCallback(client, connHandle, handle, cb); OneShotReadCallback* oneShot = new OneShotReadCallback(client, connHandle, handle, cb);
oneShot->attach(); oneShot->attach();
@ -40,7 +40,7 @@ struct OneShotReadCallback {
} }
private: private:
OneShotReadCallback(GattClient* client, Gap::Handle_t connHandle, OneShotReadCallback(GattClient* client, ble::connection_handle_t connHandle,
GattAttribute::Handle_t handle, const GattClient::ReadCallback_t& cb) : GattAttribute::Handle_t handle, const GattClient::ReadCallback_t& cb) :
_client(client), _client(client),
_connHandle(connHandle), _connHandle(connHandle),
@ -61,7 +61,7 @@ private:
} }
GattClient* _client; GattClient* _client;
Gap::Handle_t _connHandle; ble::connection_handle_t _connHandle;
GattAttribute::Handle_t _handle; GattAttribute::Handle_t _handle;
GattClient::ReadCallback_t _callback; GattClient::ReadCallback_t _callback;
}; };
@ -106,7 +106,7 @@ DiscoveredCharacteristic::writeWoResponse(uint16_t length, const uint8_t *value)
} }
struct OneShotWriteCallback { struct OneShotWriteCallback {
static void launch(GattClient* client, Gap::Handle_t connHandle, static void launch(GattClient* client, ble::connection_handle_t connHandle,
GattAttribute::Handle_t handle, const GattClient::WriteCallback_t& cb) { GattAttribute::Handle_t handle, const GattClient::WriteCallback_t& cb) {
OneShotWriteCallback* oneShot = new OneShotWriteCallback(client, connHandle, handle, cb); OneShotWriteCallback* oneShot = new OneShotWriteCallback(client, connHandle, handle, cb);
oneShot->attach(); oneShot->attach();
@ -114,7 +114,7 @@ struct OneShotWriteCallback {
} }
private: private:
OneShotWriteCallback(GattClient* client, Gap::Handle_t connHandle, OneShotWriteCallback(GattClient* client, ble::connection_handle_t connHandle,
GattAttribute::Handle_t handle, const GattClient::WriteCallback_t& cb) : GattAttribute::Handle_t handle, const GattClient::WriteCallback_t& cb) :
_client(client), _client(client),
_connHandle(connHandle), _connHandle(connHandle),
@ -135,7 +135,7 @@ private:
} }
GattClient* _client; GattClient* _client;
Gap::Handle_t _connHandle; ble::connection_handle_t _connHandle;
GattAttribute::Handle_t _handle; GattAttribute::Handle_t _handle;
GattClient::WriteCallback_t _callback; GattClient::WriteCallback_t _callback;
}; };