rename nRF* to nRF51*

This commit is contained in:
Rohit Grover 2015-06-05 15:25:25 +01:00
parent 3f88e3e384
commit d3889dfb7e
6 changed files with 25 additions and 26 deletions

View file

@ -14,12 +14,12 @@
* limitations under the License.
*/
#include "nRFServiceDiscovery.h"
#include "nRF51ServiceDiscovery.h"
#include "nRF51GattClient.h"
void bleGattcEventHandler(const ble_evt_t *p_ble_evt)
{
nRFServiceDiscovery &sdSingleton = nRF51GattClient::getInstance().discovery;
nRF51ServiceDiscovery &sdSingleton = nRF51GattClient::getInstance().discovery;
switch (p_ble_evt->header.evt_id) {
case BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP:

View file

@ -14,12 +14,12 @@
* limitations under the License.
*/
#include "nRFDiscoveredCharacteristic.h"
#include "nRF51DiscoveredCharacteristic.h"
#include "nRF51GattClient.h"
#include "ble_gatt.h"
void
nRFDiscoveredCharacteristic::setup(nRF51GattClient *gattcIn,
nRF51DiscoveredCharacteristic::setup(nRF51GattClient *gattcIn,
Gap::Handle_t connectionHandleIn,
ble_gatt_char_props_t propsIn,
GattAttribute::Handle_t declHandleIn,
@ -40,7 +40,7 @@ nRFDiscoveredCharacteristic::setup(nRF51GattClient *gattcIn,
}
void
nRFDiscoveredCharacteristic::setup(nRF51GattClient *gattcIn,
nRF51DiscoveredCharacteristic::setup(nRF51GattClient *gattcIn,
Gap::Handle_t connectionHandleIn,
UUID::ShortUUIDBytes_t uuidIn,
ble_gatt_char_props_t propsIn,

View file

@ -22,7 +22,7 @@
class nRF51GattClient; /* forward declaration */
class nRFDiscoveredCharacteristic : public DiscoveredCharacteristic {
class nRF51DiscoveredCharacteristic : public DiscoveredCharacteristic {
public:
void setup(nRF51GattClient *gattcIn,
Gap::Handle_t connectionHandleIn,

View file

@ -18,7 +18,7 @@
#define __NRF51822_GATT_CLIENT_H__
#include "GattClient.h"
#include "nRFServiceDiscovery.h"
#include "nRF51ServiceDiscovery.h"
class nRF51GattClient : public GattClient
{
@ -154,7 +154,7 @@ private:
const nRF51GattClient& operator=(const nRF51GattClient &);
private:
nRFServiceDiscovery discovery;
nRF51ServiceDiscovery discovery;
};
#endif // ifndef __NRF51822_GATT_CLIENT_H__

View file

@ -14,11 +14,10 @@
* limitations under the License.
*/
#include "nRFServiceDiscovery.h"
#include "nRF51ServiceDiscovery.h"
ble_error_t
nRFServiceDiscovery::launchCharacteristicDiscovery(Gap::Handle_t connectionHandle,
nRF51ServiceDiscovery::launchCharacteristicDiscovery(Gap::Handle_t connectionHandle,
Gap::Handle_t startHandle,
Gap::Handle_t endHandle)
{
@ -47,7 +46,7 @@ nRFServiceDiscovery::launchCharacteristicDiscovery(Gap::Handle_t connectionHandl
}
void
nRFServiceDiscovery::setupDiscoveredServices(const ble_gattc_evt_prim_srvc_disc_rsp_t *response)
nRF51ServiceDiscovery::setupDiscoveredServices(const ble_gattc_evt_prim_srvc_disc_rsp_t *response)
{
serviceIndex = 0;
numServices = response->count;
@ -77,7 +76,7 @@ nRFServiceDiscovery::setupDiscoveredServices(const ble_gattc_evt_prim_srvc_disc_
}
void
nRFServiceDiscovery::setupDiscoveredCharacteristics(const ble_gattc_evt_char_disc_rsp_t *response)
nRF51ServiceDiscovery::setupDiscoveredCharacteristics(const ble_gattc_evt_char_disc_rsp_t *response)
{
characteristicIndex = 0;
numCharacteristics = response->count;
@ -113,7 +112,7 @@ nRFServiceDiscovery::setupDiscoveredCharacteristics(const ble_gattc_evt_char_dis
}
void
nRFServiceDiscovery::progressCharacteristicDiscovery(void)
nRF51ServiceDiscovery::progressCharacteristicDiscovery(void)
{
/* Iterate through the previously discovered characteristics cached in characteristics[]. */
while ((state == CHARACTERISTIC_DISCOVERY_ACTIVE) && (characteristicIndex < numCharacteristics)) {
@ -150,7 +149,7 @@ nRFServiceDiscovery::progressCharacteristicDiscovery(void)
}
void
nRFServiceDiscovery::progressServiceDiscovery(void)
nRF51ServiceDiscovery::progressServiceDiscovery(void)
{
/* Iterate through the previously discovered services cached in services[]. */
while ((state == SERVICE_DISCOVERY_ACTIVE) && (serviceIndex < numServices)) {
@ -188,7 +187,7 @@ nRFServiceDiscovery::progressServiceDiscovery(void)
}
void
nRFServiceDiscovery::ServiceUUIDDiscoveryQueue::triggerFirst(void)
nRF51ServiceDiscovery::ServiceUUIDDiscoveryQueue::triggerFirst(void)
{
while (numIndices) { /* loop until a call to char_value_by_uuid_read() succeeds or we run out of pending indices. */
parentDiscoveryObject->state = DISCOVER_SERVICE_UUIDS;
@ -218,7 +217,7 @@ nRFServiceDiscovery::ServiceUUIDDiscoveryQueue::triggerFirst(void)
}
void
nRFServiceDiscovery::CharUUIDDiscoveryQueue::triggerFirst(void)
nRF51ServiceDiscovery::CharUUIDDiscoveryQueue::triggerFirst(void)
{
while (numIndices) { /* loop until a call to char_value_by_uuid_read() succeeds or we run out of pending indices. */
parentDiscoveryObject->state = DISCOVER_CHARACTERISTIC_UUIDS;
@ -248,7 +247,7 @@ nRFServiceDiscovery::CharUUIDDiscoveryQueue::triggerFirst(void)
}
void
nRFServiceDiscovery::processDiscoverUUIDResponse(const ble_gattc_evt_char_val_by_uuid_read_rsp_t *response)
nRF51ServiceDiscovery::processDiscoverUUIDResponse(const ble_gattc_evt_char_val_by_uuid_read_rsp_t *response)
{
if (state == DISCOVER_SERVICE_UUIDS) {
if ((response->count == 1) && (response->value_len == UUID::LENGTH_OF_LONG_UUID)) {

View file

@ -19,14 +19,14 @@
#include "ServiceDiscovery.h"
#include "DiscoveredService.h"
#include "nRFDiscoveredCharacteristic.h"
#include "nRF51DiscoveredCharacteristic.h"
#include "ble.h"
#include "ble_gattc.h"
class nRF51GattClient; /* forward declaration */
class nRFServiceDiscovery : public ServiceDiscovery
class nRF51ServiceDiscovery : public ServiceDiscovery
{
public:
static const uint16_t SRV_DISC_START_HANDLE = 0x0001; /**< The start handle value used during service discovery. */
@ -37,7 +37,7 @@ public:
static const unsigned BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV = 4; /**< Maximum number of characteristics per service we can retain information for. */
public:
nRFServiceDiscovery(nRF51GattClient *gattcIn) :
nRF51ServiceDiscovery(nRF51GattClient *gattcIn) :
gattc(gattcIn),
serviceIndex(0),
numServices(0),
@ -158,7 +158,7 @@ private:
*/
class ServiceUUIDDiscoveryQueue {
public:
ServiceUUIDDiscoveryQueue(nRFServiceDiscovery *parent) :
ServiceUUIDDiscoveryQueue(nRF51ServiceDiscovery *parent) :
numIndices(0),
serviceIndices(),
parentDiscoveryObject(parent) {
@ -207,7 +207,7 @@ private:
size_t numIndices;
int serviceIndices[BLE_DB_DISCOVERY_MAX_SRV];
nRFServiceDiscovery *parentDiscoveryObject;
nRF51ServiceDiscovery *parentDiscoveryObject;
};
friend class ServiceUUIDDiscoveryQueue;
@ -217,7 +217,7 @@ private:
*/
class CharUUIDDiscoveryQueue {
public:
CharUUIDDiscoveryQueue(nRFServiceDiscovery *parent) :
CharUUIDDiscoveryQueue(nRF51ServiceDiscovery *parent) :
numIndices(0),
charIndices(),
parentDiscoveryObject(parent) {
@ -266,7 +266,7 @@ private:
size_t numIndices;
int charIndices[BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV];
nRFServiceDiscovery *parentDiscoveryObject;
nRF51ServiceDiscovery *parentDiscoveryObject;
};
friend class CharUUIDDiscoveryQueue;
@ -294,7 +294,7 @@ private:
DiscoveredService services[BLE_DB_DISCOVERY_MAX_SRV]; /**< Information related to the current service being discovered.
* This is intended for internal use during service discovery. */
nRFDiscoveredCharacteristic characteristics[BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV];
nRF51DiscoveredCharacteristic characteristics[BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV];
ServiceUUIDDiscoveryQueue serviceUUIDDiscoveryQueue;
CharUUIDDiscoveryQueue charUUIDDiscoveryQueue;