GattClient now reuses GattCharacteristicReadCBParams

This commit is contained in:
Rohit Grover 2015-06-05 10:45:43 +01:00
parent c9d1588dea
commit 06deb96559
2 changed files with 5 additions and 17 deletions

View file

@ -22,7 +22,6 @@
#include "GattAttribute.h"
#include "GattClient.h"
/**
* Structure for holding information about the service and the characteristics
* found during the discovery process.
@ -154,7 +153,7 @@ protected:
Gap::Handle_t connHandle;
public:
static ReadCallback_t onDataReadCallback;
static GattClient::ReadCallback_t onDataReadCallback;
};
#endif /*__DISCOVERED_CHARACTERISTIC_H__*/

View file

@ -21,15 +21,11 @@
#include "GattAttribute.h"
#include "ServiceDiscovery.h"
#include "GattCharacteristicCallbackParams.h"
class GattClient {
public:
struct ReadResponse_t {
GattAttribute::Handle_t handle; /**< Attribute Handle. */
uint16_t offset; /**< Offset of the attribute data. */
uint16_t len; /**< Attribute data length. */
const uint8_t *data; /**< Attribute data, variable length. */
};
typedef void (*ReadCallback_t)(const ReadResponse_t *params);
typedef void (*ReadCallback_t)(const GattCharacteristicReadCBParams *params);
enum WriteOp_t {
GATT_OP_INVALID = 0x00, /**< Invalid Operation. */
@ -40,14 +36,7 @@ public:
GATT_OP_EXEC_WRITE_REQ = 0x05, /**< Execute Write Request. */
};
struct WriteResponse_t {
GattAttribute::Handle_t handle; /**< Attribute Handle. */
WriteOp_t writeOp;
uint16_t offset; /**< Offset of the attribute data. */
uint16_t len; /**< Attribute data length. */
const uint8_t *data; /**< Attribute data, variable length. */
};
typedef void (*WriteCallback_t)(const WriteResponse_t *params);
typedef void (*WriteCallback_t)(const GattCharacteristicWriteCBParams *params);
public:
/**