mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
pkg/openthread: adapt CLI guards to new format
This commit is contained in:
parent
c42af783c5
commit
86942279a2
@ -73,7 +73,8 @@ static void *_openthread_event_loop(void *arg) {
|
|||||||
netdev_t *dev;
|
netdev_t *dev;
|
||||||
msg_t msg, reply;
|
msg_t msg, reply;
|
||||||
|
|
||||||
#if defined(MODULE_OPENTHREAD_CLI_FTD) || defined(MODULE_OPENTHREAD_CLI_MTD)
|
#if defined(MODULE_OPENTHREAD_CLI)
|
||||||
|
serial_msg_t* serialBuffer;
|
||||||
otCliUartInit(sInstance);
|
otCliUartInit(sInstance);
|
||||||
/* Init default parameters */
|
/* Init default parameters */
|
||||||
otPanId panid = OPENTHREAD_PANID;
|
otPanId panid = OPENTHREAD_PANID;
|
||||||
@ -91,7 +92,6 @@ static void *_openthread_event_loop(void *arg) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
ot_job_t *job;
|
ot_job_t *job;
|
||||||
serial_msg_t* serialBuffer;
|
|
||||||
while (1) {
|
while (1) {
|
||||||
otTaskletsProcess(sInstance);
|
otTaskletsProcess(sInstance);
|
||||||
if (otTaskletsArePending(sInstance) == false) {
|
if (otTaskletsArePending(sInstance) == false) {
|
||||||
@ -106,12 +106,14 @@ static void *_openthread_event_loop(void *arg) {
|
|||||||
dev = msg.content.ptr;
|
dev = msg.content.ptr;
|
||||||
dev->driver->isr(dev);
|
dev->driver->isr(dev);
|
||||||
break;
|
break;
|
||||||
|
#ifdef MODULE_OPENTHREAD_CLI
|
||||||
case OPENTHREAD_SERIAL_MSG_TYPE_EVENT:
|
case OPENTHREAD_SERIAL_MSG_TYPE_EVENT:
|
||||||
/* Tell OpenThread about the reception of a CLI command */
|
/* Tell OpenThread about the reception of a CLI command */
|
||||||
serialBuffer = (serial_msg_t*)msg.content.ptr;
|
serialBuffer = (serial_msg_t*)msg.content.ptr;
|
||||||
otPlatUartReceived((uint8_t*) serialBuffer->buf,serialBuffer->length);
|
otPlatUartReceived((uint8_t*) serialBuffer->buf,serialBuffer->length);
|
||||||
serialBuffer->serial_buffer_status = OPENTHREAD_SERIAL_BUFFER_STATUS_FREE;
|
serialBuffer->serial_buffer_status = OPENTHREAD_SERIAL_BUFFER_STATUS_FREE;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case OPENTHREAD_JOB_MSG_TYPE_EVENT:
|
case OPENTHREAD_JOB_MSG_TYPE_EVENT:
|
||||||
job = msg.content.ptr;
|
job = msg.content.ptr;
|
||||||
reply.content.value = ot_exec_command(sInstance, job->command, job->arg, job->answer);
|
reply.content.value = ot_exec_command(sInstance, job->command, job->arg, job->answer);
|
||||||
|
Loading…
Reference in New Issue
Block a user