Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_API by
Revision 734:4872b70437ce, committed 2015-07-06
- Comitter:
- rgrover1
- Date:
- Mon Jul 06 10:10:35 2015 +0100
- Parent:
- 733:718a3566b4ce
- Child:
- 735:15bfcec377d5
- Commit message:
- Synchronized with git rev 163f9e01
Author: Rohit Grover
add empty (void) declarations for unused variables. This avoids warnings.
I could have used the compiler-polyfill module, but I wanted to avoid creating that dependency.
Changed in this revision
--- a/ble/Gap.h Mon Jul 06 10:10:35 2015 +0100
+++ b/ble/Gap.h Mon Jul 06 10:10:35 2015 +0100
@@ -154,6 +154,10 @@
* @return BLE_ERROR_NONE on success.
*/
virtual ble_error_t setAddress(AddressType_t type, const Address_t address) {
+ /* avoid compiler warnings about unused variables */
+ (void)type;
+ (void)address;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -163,6 +167,10 @@
* @return BLE_ERROR_NONE on success.
*/
virtual ble_error_t getAddress(AddressType_t *typeP, Address_t address) {
+ /* avoid compiler warnings about unused variables */
+ (void)typeP;
+ (void)address;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -219,6 +227,12 @@
Gap::AddressType_t peerAddrType,
const ConnectionParams_t *connectionParams,
const GapScanningParams *scanParams) {
+ /* avoid compiler warnings about unused variables */
+ (void)peerAddr;
+ (void)peerAddrType;
+ (void)connectionParams;
+ (void)scanParams;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -231,6 +245,10 @@
* The reason for disconnection to be sent back to the peer.
*/
virtual ble_error_t disconnect(Handle_t connectionHandle, DisconnectionReason_t reason) {
+ /* avoid compiler warnings about unused variables */
+ (void)connectionHandle;
+ (void)reason;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -248,6 +266,9 @@
* altertive which takes a connection handle. It will be dropped in the future.
*/
virtual ble_error_t disconnect(DisconnectionReason_t reason) {
+ /* avoid compiler warnings about unused variables */
+ (void)reason;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -264,6 +285,9 @@
* the given structure pointed to by params.
*/
virtual ble_error_t getPreferredConnectionParams(ConnectionParams_t *params) {
+ /* avoid compiler warnings about unused variables */
+ (void)params;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -276,6 +300,9 @@
* The structure containing the desired parameters.
*/
virtual ble_error_t setPreferredConnectionParams(const ConnectionParams_t *params) {
+ /* avoid compiler warnings about unused variables */
+ (void)params;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -290,6 +317,10 @@
* the parameters in the PPCP characteristic of the GAP service will be used instead.
*/
virtual ble_error_t updateConnectionParams(Handle_t handle, const ConnectionParams_t *params) {
+ /* avoid compiler warnings about unused variables */
+ (void)handle;
+ (void)params;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -299,6 +330,9 @@
* The new value for the device-name. This is a UTF-8 encoded, <b>NULL-terminated</b> string.
*/
virtual ble_error_t setDeviceName(const uint8_t *deviceName) {
+ /* avoid compiler warnings about unused variables */
+ (void)deviceName;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -321,6 +355,10 @@
* use this information to retry with a suitable buffer size.
*/
virtual ble_error_t getDeviceName(uint8_t *deviceName, unsigned *lengthP) {
+ /* avoid compiler warnings about unused variables */
+ (void)deviceName;
+ (void)lengthP;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -330,6 +368,9 @@
* The new value for the device-appearance.
*/
virtual ble_error_t setAppearance(GapAdvertisingData::Appearance appearance) {
+ /* avoid compiler warnings about unused variables */
+ (void)appearance;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -339,6 +380,9 @@
* The new value for the device-appearance.
*/
virtual ble_error_t getAppearance(GapAdvertisingData::Appearance *appearanceP) {
+ /* avoid compiler warnings about unused variables */
+ (void)appearanceP;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -347,6 +391,9 @@
* @param[in] txPower Radio transmit power in dBm.
*/
virtual ble_error_t setTxPower(int8_t txPower) {
+ /* avoid compiler warnings about unused variables */
+ (void)txPower;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -359,6 +406,10 @@
* Out parameter to receive the array's size.
*/
virtual void getPermittedTxPowerValues(const int8_t **valueArrayPP, size_t *countP) {
+ /* avoid compiler warnings about unused variables */
+ (void)valueArrayPP;
+ (void)countP;
+
*countP = 0; /* default implementation; override this API if this capability is supported. */
}
--- a/ble/GattClient.h Mon Jul 06 10:10:35 2015 +0100
+++ b/ble/GattClient.h Mon Jul 06 10:10:35 2015 +0100
@@ -97,6 +97,13 @@
ServiceDiscovery::CharacteristicCallback_t cc = NULL,
const UUID &matchingServiceUUID = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN),
const UUID &matchingCharacteristicUUIDIn = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN)) {
+ /* avoid compiler warnings about unused variables */
+ (void)connectionHandle;
+ (void)sc;
+ (void)cc;
+ (void)matchingServiceUUID;
+ (void)matchingCharacteristicUUIDIn;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -129,6 +136,11 @@
virtual ble_error_t discoverServices(Gap::Handle_t connectionHandle,
ServiceDiscovery::ServiceCallback_t callback,
const UUID &matchingServiceUUID = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN)) {
+ /* avoid compiler warnings about unused variables */
+ (void)connectionHandle;
+ (void)callback;
+ (void)matchingServiceUUID;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -160,6 +172,12 @@
ServiceDiscovery::ServiceCallback_t callback,
GattAttribute::Handle_t startHandle,
GattAttribute::Handle_t endHandle) {
+ /* avoid compiler warnings about unused variables */
+ (void)connectionHandle;
+ (void)callback;
+ (void)startHandle;
+ (void)endHandle;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -180,6 +198,11 @@
/* Initiate a Gatt Client read procedure by attribute-handle. */
virtual ble_error_t read(Gap::Handle_t connHandle, GattAttribute::Handle_t attributeHandle, uint16_t offset) const {
+ /* avoid compiler warnings about unused variables */
+ (void)connHandle;
+ (void)attributeHandle;
+ (void)offset;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -204,6 +227,13 @@
GattAttribute::Handle_t attributeHandle,
size_t length,
const uint8_t *value) const {
+ /* avoid compiler warnings about unused variables */
+ (void)cmd;
+ (void)connHandle;
+ (void)attributeHandle;
+ (void)length;
+ (void)value;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -228,6 +258,8 @@
* Setup callback for when serviceDiscovery terminates.
*/
virtual void onServiceDiscoveryTermination(ServiceDiscovery::TerminationCallback_t callback) {
+ (void)callback; /* avoid compiler warnings about ununsed variables */
+
/* default implementation; override this API if this capability is supported. */
}
--- a/ble/GattServer.h Mon Jul 06 10:10:35 2015 +0100
+++ b/ble/GattServer.h Mon Jul 06 10:10:35 2015 +0100
@@ -52,7 +52,10 @@
* Add a service declaration to the local server ATT table. Also add the
* characteristics contained within.
*/
- virtual ble_error_t addService(GattService &) {
+ virtual ble_error_t addService(GattService &service) {
+ /* avoid compiler warnings about unused variables */
+ (void)service;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -72,6 +75,11 @@
* @return BLE_ERROR_NONE if a value was read successfully into the buffer.
*/
virtual ble_error_t read(GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP) {
+ /* avoid compiler warnings about unused variables */
+ (void)attributeHandle;
+ (void)buffer;
+ (void)lengthP;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -97,6 +105,12 @@
* attributes (such as the CCCDs).
*/
virtual ble_error_t read(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, uint8_t *buffer, uint16_t *lengthP) {
+ /* avoid compiler warnings about unused variables */
+ (void)connectionHandle;
+ (void)attributeHandle;
+ (void)buffer;
+ (void)lengthP;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -118,7 +132,13 @@
*
* @return BLE_ERROR_NONE if we have successfully set the value of the attribute.
*/
- virtual ble_error_t write(GattAttribute::Handle_t, const uint8_t *, uint16_t, bool localOnly = false) {
+ virtual ble_error_t write(GattAttribute::Handle_t attributeHandle, const uint8_t *value, uint16_t size, bool localOnly = false) {
+ /* avoid compiler warnings about unused variables */
+ (void)attributeHandle;
+ (void)value;
+ (void)size;
+ (void)localOnly;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -144,7 +164,14 @@
*
* @return BLE_ERROR_NONE if we have successfully set the value of the attribute.
*/
- virtual ble_error_t write(Gap::Handle_t connectionHandle, GattAttribute::Handle_t, const uint8_t *, uint16_t, bool localOnly = false) {
+ virtual ble_error_t write(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, const uint8_t *value, uint16_t size, bool localOnly = false) {
+ /* avoid compiler warnings about unused variables */
+ (void)connectionHandle;
+ (void)attributeHandle;
+ (void)value;
+ (void)size;
+ (void)localOnly;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -159,6 +186,10 @@
* @return BLE_ERROR_NONE if the connection and handle are found. false otherwise.
*/
virtual ble_error_t areUpdatesEnabled(const GattCharacteristic &characteristic, bool *enabledP) {
+ /* avoid compiler warnings about unused variables */
+ (void)characteristic;
+ (void)enabledP;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
@@ -176,6 +207,11 @@
* @return BLE_ERROR_NONE if the connection and handle are found. false otherwise.
*/
virtual ble_error_t areUpdatesEnabled(Gap::Handle_t connectionHandle, const GattCharacteristic &characteristic, bool *enabledP) {
+ /* avoid compiler warnings about unused variables */
+ (void)connectionHandle;
+ (void)characteristic;
+ (void)enabledP;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
--- a/ble/SecurityManager.h Mon Jul 06 10:10:35 2015 +0100
+++ b/ble/SecurityManager.h Mon Jul 06 10:10:35 2015 +0100
@@ -105,6 +105,12 @@
bool requireMITM = true,
SecurityIOCapabilities_t iocaps = IO_CAPS_NONE,
const Passkey_t passkey = NULL) {
+ /* avoid compiler warnings about unused variables */
+ (void)enableBonding;
+ (void)requireMITM;
+ (void)iocaps;
+ (void)passkey;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* default implementation; override this if security is supported. */
}
@@ -117,6 +123,10 @@
* @return BLE_SUCCESS Or appropriate error code indicating reason for failure.
*/
virtual ble_error_t getLinkSecurity(Gap::Handle_t connectionHandle, LinkSecurityStatus_t *securityStatusP) {
+ /* avoid compiler warnings about unused variables */
+ (void)connectionHandle;
+ (void)securityStatusP;
+
return BLE_ERROR_NOT_IMPLEMENTED; /* default implementation; override this if security is supported. */
}
