Hi team,
SDK version :7.40.00.64
Version REV B chip
The customer uses the service to modify the power after Bluetooth connection, and also directly uses the function HCI_EXT_SetTxPowerDbmCmd to set it. It was found that when the program ran this function, it ran away (Bluetooth disconnected and there was no broadcast). So it can't be modified after Bluetooth connection?
case ADVERTISING_POWER_CHAR_UUID: if ( offset == 0 ) { if ( len != 1 ) { status = ATT_ERR_INVALID_VALUE_SIZE; } } else { status = ATT_ERR_ATTR_NOT_LONG; } if ( status == SUCCESS ) { uint8 *pCurValue = (uint8 *)pAttr->pValue; if(pValue[0]<= ADVERTISING_POWER_8dB) { *pCurValue = pValue[0]; switch (*pCurValue) { case ADVERTISING_POWER_0dB: Advertising_Power=0; HCI_EXT_SetTxPowerDbmCmd(0,0); break; case ADVERTISING_POWER_1dB: Advertising_Power=1; HCI_EXT_SetTxPowerDbmCmd(1,0); break; case ADVERTISING_POWER_2dB: Advertising_Power=2; HCI_EXT_SetTxPowerDbmCmd(2,0); break; case ADVERTISING_POWER_3dB: Advertising_Power=3; HCI_EXT_SetTxPowerDbmCmd(3,0); break; case ADVERTISING_POWER_4dB: Advertising_Power=4; HCI_EXT_SetTxPowerDbmCmd(4,0); break; case ADVERTISING_POWER_5dB: Advertising_Power=5; HCI_EXT_SetTxPowerDbmCmd(5,0); break; case ADVERTISING_POWER_6dB: Advertising_Power=6; HCI_EXT_SetTxPowerDbmCmd(6,0); break; case ADVERTISING_POWER_7dB: Advertising_Power=7; HCI_EXT_SetTxPowerDbmCmd(7,0); break; case ADVERTISING_POWER_8dB: Advertising_Power=8; HCI_EXT_SetTxPowerDbmCmd(8,0); break; default: Advertising_Power=0; HCI_EXT_SetTxPowerDbmCmd(0,0); break; } if(Last_Advertising_Power!=Advertising_Power) { Last_Advertising_Power=Advertising_Power; sysParas.advertisementPower=Advertising_Power; BLEAppUtil_invokeFunction(do_para_save,NULL); } } }
And I also reappear the customer's problem.
I added HCI_EXT_SetTxPowerDbmCmd(8,0); here, and found that the connection between the board and the mobile phone was disconnected, and the mobile phone could not scan the device.
In addition, I would like to know where this function is generally used. Is there any relevant routine description?
Thanks & Best regards,
Yolande