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 nRF51822 by
Revision 342:dec88052ffee, committed 2015-06-19
- Comitter:
- rgrover1
- Date:
- Fri Jun 19 15:55:34 2015 +0100
- Parent:
- 341:bfca7a82c3c7
- Child:
- 343:6675661fa600
- Commit message:
- Synchronized with git rev efcb88a1
Author: Rohit Grover
move setTxPower() and getTxPowerLevels() into Gap.h
Changed in this revision
--- a/nRF51822n.cpp Fri Jun 19 15:55:33 2015 +0100
+++ b/nRF51822n.cpp Fri Jun 19 15:55:34 2015 +0100
@@ -71,33 +71,6 @@
return versionString;
}
-/* (Valid values are -40, -20, -16, -12, -8, -4, 0, 4) */
-ble_error_t nRF51822n::setTxPower(int8_t txPower)
-{
- unsigned rc;
- if ((rc = sd_ble_gap_tx_power_set(txPower)) != NRF_SUCCESS) {
- switch (rc) {
- case NRF_ERROR_BUSY:
- return BLE_STACK_BUSY;
- case NRF_ERROR_INVALID_PARAM:
- default:
- return BLE_ERROR_PARAM_OUT_OF_RANGE;
- }
- }
-
- return BLE_ERROR_NONE;
-}
-
-void nRF51822n::getPermittedTxPowerValues(const int8_t **valueArrayPP, size_t *countP)
-{
- static const int8_t permittedTxValues[] = {
- -40, -30, -20, -16, -12, -8, -4, 0, 4
- };
-
- *valueArrayPP = permittedTxValues;
- *countP = sizeof(permittedTxValues) / sizeof(int8_t);
-}
-
ble_error_t nRF51822n::init(void)
{
/* ToDo: Clear memory contents, reset the SD, etc. */
--- a/nRF51822n.h Fri Jun 19 15:55:33 2015 +0100
+++ b/nRF51822n.h Fri Jun 19 15:55:34 2015 +0100
@@ -40,9 +40,6 @@
return nRF51GattServer::getInstance();
};
- virtual ble_error_t setTxPower(int8_t txPower);
- virtual void getPermittedTxPowerValues(const int8_t **valueArrayPP, size_t *countP);
-
virtual ble_error_t init(void);
virtual ble_error_t shutdown(void);
virtual ble_error_t reset(void);
--- a/nRF51Gap.cpp Fri Jun 19 15:55:33 2015 +0100
+++ b/nRF51Gap.cpp Fri Jun 19 15:55:34 2015 +0100
@@ -377,4 +377,31 @@
} else {
return BLE_ERROR_PARAM_OUT_OF_RANGE;
}
+}
+
+/* (Valid values are -40, -20, -16, -12, -8, -4, 0, 4) */
+ble_error_t nRF51Gap::setTxPower(int8_t txPower)
+{
+ unsigned rc;
+ if ((rc = sd_ble_gap_tx_power_set(txPower)) != NRF_SUCCESS) {
+ switch (rc) {
+ case NRF_ERROR_BUSY:
+ return BLE_STACK_BUSY;
+ case NRF_ERROR_INVALID_PARAM:
+ default:
+ return BLE_ERROR_PARAM_OUT_OF_RANGE;
+ }
+ }
+
+ return BLE_ERROR_NONE;
+}
+
+void nRF51Gap::getPermittedTxPowerValues(const int8_t **valueArrayPP, size_t *countP)
+{
+ static const int8_t permittedTxValues[] = {
+ -40, -30, -20, -16, -12, -8, -4, 0, 4
+ };
+
+ *valueArrayPP = permittedTxValues;
+ *countP = sizeof(permittedTxValues) / sizeof(int8_t);
}
\ No newline at end of file
--- a/nRF51Gap.h Fri Jun 19 15:55:33 2015 +0100
+++ b/nRF51Gap.h Fri Jun 19 15:55:34 2015 +0100
@@ -63,6 +63,9 @@
virtual ble_error_t setAppearance(uint16_t appearance);
virtual ble_error_t getAppearance(uint16_t *appearanceP);
+ virtual ble_error_t setTxPower(int8_t txPower);
+ virtual void getPermittedTxPowerValues(const int8_t **valueArrayPP, size_t *countP);
+
void setConnectionHandle(uint16_t con_handle);
uint16_t getConnectionHandle(void);
