工具/软件:
大家好、TI 团队。
我们想基于“Basic_ble"软件“软件使用 HCI 命令输出载波频率。
参考下面的链接、我们尝试执行 HCI_EXT_ModemTestTxCmd ()、但没有发生传输。
我们还粘贴了代码、因此如果有任何必要的程序或错误、请告知我们。
SDK 版本:9.11.
角色:外围设备
void App_StackInitDoneHandler(gapDeviceInitDoneEvent_t *deviceInitDoneData)
{
bStatus_t status = SUCCESS;
// Menu
Menu_start();
// 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 | CENTRAL_CFG ) )
status = DevInfo_start();
if(status != SUCCESS)
{
// TODO: Call Error Handler
}
status = SimpleGatt_start();
if(status != SUCCESS)
{
// TODO: Call Error Handler
}
#endif
#if defined( HOST_CONFIG ) && ( HOST_CONFIG & ( PERIPHERAL_CFG | CENTRAL_CFG )) && defined(OAD_CFG)
status = OAD_start();
if(status != SUCCESS)
{
// TODO: Call Error Handler
}
#endif
#if defined( HOST_CONFIG ) && ( HOST_CONFIG & ( PERIPHERAL_CFG ) )
// 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 ) )
// 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 ) )
// 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
}
#if defined (BLE_V41_FEATURES) && (BLE_V41_FEATURES & L2CAP_COC_CFG)
/* L2CAP COC Init */
status = L2CAPCOC_start();
if ( status != SUCCESS )
{
// TODO: Call Error Handler
}
#endif //(BLE_V41_FEATURES) && (BLE_V41_FEATURES & L2CAP_COC_CFG)
GPIO_setCallback(CONFIG_GPIO_DIO9, button_dio9_callback); /* Add */
GPIO_enableInt(CONFIG_GPIO_DIO9); /* Add */
#endif
}
void button_dio9_callback(uint_least8_t index) /* Add */
{
BLEAppUtil_invokeFunctionNoData(hci_rf_cw_start);
}
extern uint8 peripheralAdvHandle_1; /* Add */
void hci_rf_cw_start(char *dummy) /* Add */
{
GPIO_disableInt(CONFIG_GPIO_DIO9);
GAP_TerminateLinkReq(Connection_getConnhandle(0), HCI_DISCONNECT_REMOTE_USER_TERM);
GapAdv_disable(peripheralAdvHandle_1);
HCI_EXT_SetTxPowerDbmCmd(0,1);
HCI_EXT_ModemTestTxCmd(1,19);
}
/*********************************************************************
* @fn appMain
*
* @brief Application main function
*
* @return none
*/
void appMain(void)
{
// Call the BLEAppUtil module init function
BLEAppUtil_init(&criticalErrorHandler, &App_StackInitDoneHandler,
&appMainParams, &appMainPeriCentParams);
}
此致。