ReadCallback_t moves into GattClient.

This commit is contained in:
Rohit Grover 2015-06-05 09:20:41 +01:00
parent 037ea9c6a7
commit 1a9e68e197
5 changed files with 14 additions and 12 deletions

View file

@ -17,7 +17,7 @@
#include "DiscoveredCharacteristic.h"
#include "GattClient.h"
DiscoveredCharacteristic::ReadCallback_t DiscoveredCharacteristic::onDataReadCallback;
GattClient::ReadCallback_t DiscoveredCharacteristic::onDataReadCallback;
ble_error_t
DiscoveredCharacteristic::read(uint16_t offset) const

View file

@ -20,6 +20,7 @@
#include "blecommon.h"
#include "Gap.h"
#include "GattServer.h"
#include "GattClient.h"
#include "BLEDeviceInstanceBase.h"
#include "GapAdvertisingData.h"

View file

@ -20,8 +20,8 @@
#include "UUID.h"
#include "Gap.h"
#include "GattAttribute.h"
#include "GattClient.h"
class GattClient; /* forward declaration */
/**
* Structure for holding information about the service and the characteristics
@ -52,14 +52,6 @@ public:
operator unsigned() const; /* disallow implicit conversion into an integer */
};
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);
/**
* Initiate (or continue) a read for the value attribute, optionally at a
* given offset. If the Characteristic or Descriptor to be read is longer

View file

@ -28,6 +28,14 @@ public:
OP_WRITE_CMD
};
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);
public:
/**
* Launch service discovery. Once launched, service discovery will remain

View file

@ -20,8 +20,9 @@
#include "UUID.h"
#include "Gap.h"
#include "GattAttribute.h"
#include "DiscoveredService.h"
#include "DiscoveredCharacteristic.h"
class DiscoveredService;
class DiscoveredCharacteristic;
class ServiceDiscovery {
public: