Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
Hi all,
I am testing basic BLE project using simplelink_lowpower_f3_sdk_8_40_00_61 on the cc2745 Launchpad.
I am attempting to modify the TX power during runtime by utilizing the HCI_EXT_SetTxPowerDbmCmd()
function.
I have updated the TX power settings in SysConfig as shown below:
Additionally, I am using characteristic 1 of the Simple GATT Service in the Basic BLE project to send commands to change the TX power value during runtime. Below are my code snippets:
/********* changes in app_simple_gatt.c file*******************/ static void SimpleGatt_changeCB( uint8_t paramId ) { int8_t newValue = 0; switch( paramId ) { case SIMPLEGATTPROFILE_CHAR1: { SimpleGattProfile_getParameter( SIMPLEGATTPROFILE_CHAR1, &newValue ); // Print the new value of char 1 MenuModule_printf(APP_MENU_PROFILE_STATUS_LINE, 0, "Profile status: Simple profile - " "Char 1 value = " MENU_MODULE_COLOR_YELLOW "%d " MENU_MODULE_COLOR_RESET, newValue); if((newValue<=10) & (newValue>=-10)) { set_txpower=1; txpower_value=newValue; } } break; //.................// } /*************** app_simple_gatt.c*************/ /*************** custom task created to change tx power value*************/ void *SystemThread(void *arg0) { /* 1 second delay */ uint32_t time = 1; // so that the application can send and receive messages. ICall_registerApp(&selfEntityloc_sys, &syncEventloc_sys); /* Call driver init functions */ GPIO_init(); // I2C_init(); // SPI_init(); // Watchdog_init(); while (1) { sleep(time); GPIO_toggle(CONFIG_GPIO_LED_RED); if(set_txpower) { set_txpower=0;//clear tx power flag GAP_TerminateLinkReq(0, HCI_DISCONNECT_REMOTE_USER_TERM); //terminate connection usleep(100000); stop_adv(); //stop adv usleep(100000); HCI_EXT_SetTxPowerDbmCmd(txpower_value,0); //change tx power MenuModule_printf(9, 0,"tx power changed to %d",txpower_value); start_adv(); //start adv } } }
But I am not able change the TX power using above code.
Please provide me the solution to resolve this issue.
Regards,
Aslam