Goran Mahovlic / nRF51822_BLE_MIDI

Dependents:   BLE_MIDI

Fork of nRF51822 by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Mon Mar 02 11:34:45 2015 +0000
Parent:
95:7f0d80ab964b
Child:
97:e95e35845e1c
Commit message:
Synchronized with git rev 3b74d9dc
Author: Rohit Grover
add code to support getPermittedTxValues()

Changed in this revision

nRF51822n.cpp Show annotated file Show diff for this revision Revisions of this file
nRF51822n.h Show annotated file Show diff for this revision Revisions of this file
--- a/nRF51822n.cpp	Mon Mar 02 11:34:45 2015 +0000
+++ b/nRF51822n.cpp	Mon Mar 02 11:34:45 2015 +0000
@@ -81,6 +81,16 @@
     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	Mon Mar 02 11:34:45 2015 +0000
+++ b/nRF51822n.h	Mon Mar 02 11:34:45 2015 +0000
@@ -44,6 +44,7 @@
     };
 
     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);