Release 0.2.3

=============

Features
~~~~~~~~

* add API for getAddress() to fetch the MAC address.

Bugfixes
~~~~~~~~

* DFUService object needs to remain alive after ble.init(); declaring as static.

Compatibility
~~~~~~~~~~~~~

One new API has been added between 0.2.0 and this release. Applications should be updated.
This commit is contained in:
Rohit Grover 2014-11-05 14:08:42 +00:00
parent e1a52af1d0
commit 039fd060ad
3 changed files with 21 additions and 8 deletions

View File

@ -41,9 +41,15 @@ public:
public:
/**
* Set the BTLE MAC address and type.
* @return
* @return BLE_ERROR_NONE on success.
*/
ble_error_t setAddress(Gap::addr_type_t type, const uint8_t address[6]);
ble_error_t setAddress(Gap::addr_type_t type, const uint8_t address[Gap::ADDR_LEN]);
/**
* Fetch the BTLE MAC address and type.
* @return BLE_ERROR_NONE on success.
*/
ble_error_t getAddress(Gap::addr_type_t *typeP, uint8_t address[Gap::ADDR_LEN]);
/**
* @param[in] advType
@ -360,11 +366,17 @@ BLEDevice::reset(void)
}
inline ble_error_t
BLEDevice::setAddress(Gap::addr_type_t type, const uint8_t address[6])
BLEDevice::setAddress(Gap::addr_type_t type, const uint8_t address[Gap::ADDR_LEN])
{
return transport->getGap().setAddress(type, address);
}
inline ble_error_t
BLEDevice::getAddress(Gap::addr_type_t *typeP, uint8_t address[Gap::ADDR_LEN])
{
return transport->getGap().getAddress(typeP, address);
}
inline void
BLEDevice::setAdvertisingType(GapAdvertisingParams::AdvertisingType advType)
{

View File

@ -40,6 +40,8 @@ public:
ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE
} addr_type_t;
static const unsigned ADDR_LEN = 6;
/**
* enumeration for disconnection reasons. The values for these reasons are
* derived from Nordic's implementation; but the reasons are meant to be
@ -70,7 +72,8 @@ public:
public:
/* These functions must be defined in the sub-class */
virtual ble_error_t setAddress(addr_type_t type, const uint8_t address[6]) = 0;
virtual ble_error_t setAddress(addr_type_t type, const uint8_t address[ADDR_LEN]) = 0;
virtual ble_error_t getAddress(addr_type_t *typeP, uint8_t address[ADDR_LEN]) = 0;
virtual ble_error_t setAdvertisingData(const GapAdvertisingData &, const GapAdvertisingData &) = 0;
virtual ble_error_t startAdvertising(const GapAdvertisingParams &) = 0;
virtual ble_error_t stopAdvertising(void) = 0;

View File

@ -92,10 +92,8 @@ public:
}
/**
* This callback allows the UART service to receive updates to the
* txCharacteristic. The application should forward the call to this
* function from the global onDataWritten() callback handler; or if that's
* not used, this method can be used as a callback directly.
* This callback allows the HeartRateService to receive updates to the
* controlPoint Characteristic.
*/
virtual void onDataWritten(const GattCharacteristicWriteCBParams *params) {
if (params->charHandle == controlPoint.getValueAttribute().getHandle()) {