据我所知,调用ble相关的接口吗,需要在此线程注册ICall_registerApp(&selfEntity, &syncEvent)接口;
目前我的项目中有两个线程会调用BLE相关接口,所以我在两个线程的前面都调用了ICall_registerApp(&selfEntity, &syncEvent);,然后出现崩溃了;
如果只有一个线程调用ICall_registerApp(&selfEntity, &syncEvent);则运行正常
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.
据我所知,调用ble相关的接口吗,需要在此线程注册ICall_registerApp(&selfEntity, &syncEvent)接口;
目前我的项目中有两个线程会调用BLE相关接口,所以我在两个线程的前面都调用了ICall_registerApp(&selfEntity, &syncEvent);,然后出现崩溃了;
如果只有一个线程调用ICall_registerApp(&selfEntity, &syncEvent);则运行正常
这是我的代码,帮忙看下是什么原因
}
// Entity ID globally used to check for source and/or destination of messages
static ICall_EntityID selfEntity1;
// Event globally used to post local events and pend on system and
// local events.
static ICall_SyncHandle syncEvent1;
// Entity ID globally used to check for source and/or destination of messages
static ICall_EntityID selfEntity2;
// Event globally used to post local events and pend on system and
// local events.
static ICall_SyncHandle syncEvent2;
void protocol_os_send_proc(void *arg)
{
ICall_registerApp(&selfEntity1, &syncEvent1);
while (1)
{
protocol_send_process();
}
}
void protocol_os_send_proc(void *arg)
{
ICall_registerApp(&selfEntity2, &syncEvent2);
while (1)
{
protocol_send_process();
}
}
您好,我这边为您这边提供了注册任务的例程讲解,希望可以帮助到您。
https://dev.ti.com/tirex/explore/content/simplelink_lowpower_f3_sdk_7_20_01_10/docs/ble5stack/ble_user_guide/html/ble-stack-5.x/the-application-cc23xx.html?highlight=icall_registerapp#icall-stack|-protocol-service