This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC2340R5:如何使用基本 BLE 示例发送定期通知。

Guru**** 2595805 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1351301/cc2340r5-how-to-send-periodic-notification-using-basic-ble-example

器件型号:CC2340R5

您好专家。

我的客户希望 使用 LGPTimer 回调函数通过 SIMPLEGATTPROFILE_CHAR4发送基本示例通知数据。

LGPTimer 如下所示。

/
//! L52 Timer_Init
//*****
void L5.200(Lvoid) Timer_Init
{
LGPTimerLPF3_Params 参数;
uint32_t counterTarget;

//初始化参数并分配要使用的回调函数
LGPTimerLPF3_PARAMS_init (&params);
params.hwiCallbackFxn = timerCallback;
params.prescalerDiv = 255;

//打开驱动器
G_lgptHandle = LGPTimerLPF3_open (CONFIG_LGPTIME_0、&params);
//设置计数器目标
CounterTarget = LGPTimer_period;//48000 - 1;// 48 MHz 系统时钟为1ms
LGPTimerLPF3_setInitialCounterTarget (g_lgptHandle、counterTarget、true);
//启用计数器目标中断
LGPTimerLPF3_enableInterrupt (g_lgptHandle、LGPTimerLPF3_INT_TGT);

然后、他们尝试通过以下回调函数定期发送通知数据、但程序在1字节传输后停止。

空 timerCallback (LGPTimerLPF3_Handle lgptHandle、LGPTimerLPF3_IntMask interruptMask)
{
GPIO_TOGGLE (CONFIG_GPIO_LED_1);
BT_COUNT++;
SimpleGattProfile_SetParameter (SIMPLEGATTPROFILE_CHAR4、sizeof (uint8_t)、&bt_count);

请指导我如何在基本示例中发送定期通知数据。

谢谢