# AF62 disable BT RF
```c=
void App_StackInitDoneHandler(gapDeviceInitDoneEvent_t *deviceInitDoneData)
{
bStatus_t status = SUCCESS;
// Print the device ID address
/*MenuModule_printf(APP_MENU_DEVICE_ADDRESS, 0, "BLE ID Address: "
MENU_MODULE_COLOR_BOLD MENU_MODULE_COLOR_GREEN "%s" MENU_MODULE_COLOR_RESET,
BLEAppUtil_convertBdAddr2Str(deviceInitDoneData->devAddr));*/
if ( appMainParams.addressMode > ADDRMODE_RANDOM)
{
// Print the RP address
/* MenuModule_printf(APP_MENU_DEVICE_RP_ADDRESS, 0,
"BLE RP Address: "
MENU_MODULE_COLOR_BOLD MENU_MODULE_COLOR_GREEN "%s" MENU_MODULE_COLOR_RESET,
BLEAppUtil_convertBdAddr2Str(GAP_GetDevAddress(FALSE)));*/
}
#if defined( HOST_CONFIG ) && ( HOST_CONFIG & ( PERIPHERAL_CFG ) ) && (DEFAULT_RF_OPEN)
// Any device that accepts the establishment of a link using
// any of the connection establishment procedures referred to
// as being in the Peripheral role.
// A device operating in the Peripheral role will be in the
// Peripheral role in the Link Layer Connection state.
status = Peripheral_start();
if(status != SUCCESS)
{
// TODO: Call Error Handler
}
#endif
#if defined( HOST_CONFIG ) && ( HOST_CONFIG & ( BROADCASTER_CFG ) ) && (DEFAULT_RF_OPEN)
// A device operating in the Broadcaster role is a device that
// sends advertising events or periodic advertising events
status = Broadcaster_start();
if(status != SUCCESS)
{
// TODO: Call Error Handler
}
#endif
#if defined( HOST_CONFIG ) && ( HOST_CONFIG & ( CENTRAL_CFG ) )
// A device that supports the Central role initiates the establishment
// of an active physical link. A device operating in the Central role will
// be in the Central role in the Link Layer Connection state.
// A device operating in the Central role is referred to as a Central.
status = Central_start();
if(status != SUCCESS)
{
// TODO: Call Error Handler
}
#endif
#if defined( HOST_CONFIG ) && ( HOST_CONFIG & ( OBSERVER_CFG ) ) && (DEFAULT_RF_OPEN)
// A device operating in the Observer role is a device that
// receives advertising events or periodic advertising events
status = Observer_start();
if(status != SUCCESS)
{
// TODO: Call Error Handler
}
#endif
#if defined( HOST_CONFIG ) && ( HOST_CONFIG & ( PERIPHERAL_CFG | CENTRAL_CFG ) )
status = Connection_start();
if ( status != SUCCESS )
{
// TODO: Call Error Handler
}
status = Pairing_start();
if ( status != SUCCESS )
{
// TODO: Call Error Handler
}
status = Data_start();
if ( status != SUCCESS )
{
// TODO: Call Error Handler
}
status = DevInfo_start();
if ( status != SUCCESS )
{
// TODO: Call Error Handler
}
status = DataStream_start();
if ( status != SUCCESS )
{
// TODO: Call Error Handler
}
#endif
}
```
> 目前看起來是 `Peripheral_start()`, `Broadcaster_start()`,
`Observer_start()` 會影響。可以用條件編譯的方式擋掉
> 但是剛剛測試我是直接註解掉上述 application 的啟用,所以上面的作法會比較好一點,後續客戶想要在開機時預設打開 RF 的話,只要在 opt 檔案中添加 define (`-DXXX`) 就可以了
# To-Dos
- [x] diable RF feature
- [ ] implement JSON Command for toggling BT RF feature