Delta / Mbed OS Delta_CLI

Fork of NNN40_CLI by Delta

Revision:
21:72d7a6e85d7f
Parent:
20:bd1760975052
Child:
23:620896909655
--- a/CLI_Source/ble_cli.cpp	Wed Oct 19 10:34:28 2016 +0000
+++ b/CLI_Source/ble_cli.cpp	Thu Oct 20 03:14:33 2016 +0000
@@ -377,15 +377,25 @@
     uint32_t err_code;
     uint8_t txLen=0;
     uint8_t *arg = cyntecGetCommandArgument(0,&txLen);
-    const uint8_t NUM_TXPOW = 9;
+
     bool inputSwitch = false; // if find matched case in TxPow, assign true
 
+#if defined(TARGET_DELTA_DFBM_NQ620)
+    const uint8_t NUM_TXPOW = 7;
+    int8_t validTxPow[NUM_TXPOW] = {-20, -16, -12, -8, -4, 0, 4};
+#else if defined(TARGET_DELTA_DFCM_NNN40)
+    const uint8_t NUM_TXPOW = 9;
     int8_t validTxPow[NUM_TXPOW] = {-40, -30, -20, -16, -12, -8, -4, 0, 4};
+#endif    
     uint8_t i;
     int8_t setValue;
 
     if ( arg != NULL ) {
+#if defined(TARGET_DELTA_DFBM_NQ620)        
         setValue = atoi((const char *)arg);
+#else if defined(TARGET_DELTA_DFCM_NNN40)        
+        setValue = cyntecAtoInt(arg);//work around for NNN40 since somehow atoi doesn't work properly 
+#endif          
         for (i = 0; i < NUM_TXPOW; i++) {
             if (setValue == validTxPow[i]) {
                 err_code = sd_ble_gap_tx_power_set(setValue);