![]() |
![]() |
|
TI-OpenThread
1.07.00.21
|
#include <openthread/config.h>#include <OPENTHREAD_PROJECT_CORE_CONFIG_FILE>#include <assert.h>#include <stddef.h>#include <string.h>#include <mqueue.h>#include <pthread.h>#include <sched.h>#include <openthread/coap.h>#include <openthread/dataset.h>#include <openthread/diag.h>#include <openthread/joiner.h>#include <openthread/platform/settings.h>#include <openthread/tasklet.h>#include <openthread/thread.h>#include "otsupport/otinstance.h"#include "otsupport/otrtosapi.h"#include "platform/system.h"#include "ti_drivers_config.h"#include "otstack.h"#include "task_config.h"#include "utils/code_utils.h"#include "tiop_config.h"
Include dependency graph for CC26X2R1_LAUNCHXL/thread/ncp_ftd/otstack.c:Macros | |
| #define | OTSTACK_PROC_QUEUE_MAX_MSG (16) |
Size of the message queue for OtStack_procQueue More... | |
Functions | |
| void | handleNetifStateChanged (uint32_t aFlags, void *aContext) |
| Callback function registered with the netif. More... | |
| void | joinerCallback (otError aError, void *aContext) |
| callback function registered with the OpenThread to get the joining network status. More... | |
| otInstance * | OtInstance_get (void) |
| void | OtStack_joinConfiguredNetwork (void) |
| Allows the application to start the network join process via the commissioner using the pre-configured PSKd. More... | |
| void | OtStack_joinNetwork (const char *pskd) |
| Allows the application to start the network join process via the commissioner. More... | |
| uint8_t | OtStack_joinState (void) |
| Returns the current network join event of the OpenThread stack. More... | |
| void | OtStack_registerCallback (OtStack_EventsCallback_t appCB) |
| Allows the application to register callback for ot stack events. More... | |
| bool | OtStack_setupInterfaceAndNetwork (void) |
| Allows the application to attempt to bring up the interface and setup the thread network (thread protocol operation) using the current device dataset. More... | |
| bool | OtStack_setupNetwork (void) |
| Allows the application to setup the thread network(thread protocol operation) after the device has successfully joined the network. More... | |
| void * | OtStack_task (void *arg0) |
| void | OtStack_taskCreate (void) |
| void | otTaskletsSignalPending (otInstance *aInstance) |
| void | platformAlarmMicroSignal () |
| void | platformAlarmSignal () |
| void | platformRadioSignal (uintptr_t arg) |
| void | platformRandomSignal (void) |
| void | platformSpiSignal () |
| void | platformUartSignal (uintptr_t arg) |
Variables | |
| static OtStack_EventsCallback_t | appEventHandler = NULL |
| static otInstance * | OtStack_instance = NULL |
| static mqd_t | OtStack_procQueueDesc |
| const char | OtStack_procQueueName [] = "/tiop_process" |
| static char | OtStack_stack [TASK_CONFIG_OT_TASK_STACK_SIZE] |
| static volatile uint8_t | otStackEvents = OT_STACK_EVENT_NWK_NOT_JOINED |
| #define OTSTACK_PROC_QUEUE_MAX_MSG (16) |
Size of the message queue for OtStack_procQueue
Size determined by: 7 main processing loop commands 6 radio process requests 2 UART process requests
16 queue slots
Referenced by OtStack_task().
| enum OtStack_procQueueCmd |
| void* OtStack_task | ( | void * | arg0 | ) |
Main processing thread for OpenThread Stack.
References OtInstance_get(), OtRtosApi_lock(), OtRtosApi_unlock(), OtStack_instance, OTSTACK_PROC_QUEUE_MAX_MSG, OtStack_procQueueCmd_alarm, OtStack_procQueueCmd_alarmu, OtStack_procQueueCmd_radio, OtStack_procQueueCmd_random, OtStack_procQueueCmd_spi, OtStack_procQueueCmd_tasklets, OtStack_procQueueCmd_uart, OtStack_procQueueDesc, OtStack_procQueueName, otSysInit(), platformAlarmMicroProcess(), platformAlarmProcess(), platformRadioProcess(), platformRandomProcess(), platformSpiProcess(), and platformUartProcess().
Referenced by OtStack_taskCreate().
| void joinerCallback | ( | otError | aError, |
| void * | aContext | ||
| ) |
callback function registered with the OpenThread to get the joining network status.
| aError | error value returned during the joining process. |
| aContext | context if any (ignored). |
References appEventHandler, OT_STACK_EVENT_NWK_JOINED, OT_STACK_EVENT_NWK_JOINED_FAILURE, and otStackEvents.
Referenced by OtStack_joinConfiguredNetwork(), and OtStack_joinNetwork().
| void handleNetifStateChanged | ( | uint32_t | aFlags, |
| void * | aContext | ||
| ) |
Callback function registered with the netif.
| aFlags | A bit-field indicating specific state that has changed. |
| aContext | A pointer to application-specific context. |
References appEventHandler, OT_STACK_EVENT_DEV_ROLE_CHANGED, OT_STACK_EVENT_NWK_DATA_CHANGED, and otStackEvents.
Referenced by OtStack_setupInterfaceAndNetwork(), and OtStack_setupNetwork().
| void OtStack_registerCallback | ( | OtStack_EventsCallback_t | appCB | ) |
Allows the application to register callback for ot stack events.
| appCB | application callback function. |
References appEventHandler.
| uint8_t OtStack_joinState | ( | void | ) |
Returns the current network join event of the OpenThread stack.
References otStackEvents.
| void OtStack_joinNetwork | ( | const char * | pskd | ) |
Allows the application to start the network join process via the commissioner.
| pskd | Pre-shared key of the device. |
References joinerCallback(), OT_STACK_EVENT_NWK_JOIN_IN_PROGRESS, OtInstance_get(), OtRtosApi_lock(), OtRtosApi_unlock(), and otStackEvents.
| void OtStack_joinConfiguredNetwork | ( | void | ) |
Allows the application to start the network join process via the commissioner using the pre-configured PSKd.
References joinerCallback(), OT_STACK_EVENT_NWK_JOIN_IN_PROGRESS, OtInstance_get(), OtRtosApi_lock(), OtRtosApi_unlock(), and otStackEvents.
| bool OtStack_setupNetwork | ( | void | ) |
Allows the application to setup the thread network(thread protocol operation) after the device has successfully joined the network.
References handleNetifStateChanged(), OtInstance_get(), OtRtosApi_lock(), and OtRtosApi_unlock().
| bool OtStack_setupInterfaceAndNetwork | ( | void | ) |
Allows the application to attempt to bring up the interface and setup the thread network (thread protocol operation) using the current device dataset.
References handleNetifStateChanged(), OtInstance_get(), OtRtosApi_lock(), and OtRtosApi_unlock().
| void OtStack_taskCreate | ( | void | ) |
Documented in task_config.h.
References OtRtosApi_init(), OtStack_stack, OtStack_task(), TASK_CONFIG_OT_TASK_PRIORITY, and TASK_CONFIG_OT_TASK_STACK_SIZE.
| void otTaskletsSignalPending | ( | otInstance * | aInstance | ) |
Callback from OpenThread stack to indicate tasklets are pending processing.
References OtStack_procQueueCmd_tasklets, and OtStack_procQueueDesc.
| void platformAlarmSignal | ( | void | ) |
Callback from the alarm module indicating need for processing.
References OtStack_procQueueCmd_alarm, and OtStack_procQueueDesc.
| void platformAlarmMicroSignal | ( | void | ) |
Callback from the alarm module indicating need for processing.
References OtStack_procQueueCmd_alarmu, and OtStack_procQueueDesc.
| void platformUartSignal | ( | uintptr_t | arg | ) |
Callback from the alarm module indicating need for processing.
References OtStack_procQueueCmd_uart, and OtStack_procQueueDesc.
| void platformSpiSignal | ( | void | ) |
Callback from the spi module indicating need for processing.
References OtStack_procQueueCmd_spi, and OtStack_procQueueDesc.
| void platformRadioSignal | ( | uintptr_t | arg | ) |
Callback from the radio module indicating need for processing.
References OtStack_procQueueCmd_radio, and OtStack_procQueueDesc.
| void platformRandomSignal | ( | void | ) |
Callback from the random generator module indicating need for processing.
References OtStack_procQueueCmd_random, and OtStack_procQueueDesc.
| otInstance* OtInstance_get | ( | void | ) |
Documented in otsupport/otinstance.h.
References OtRtosApi_lock(), OtRtosApi_unlock(), and OtStack_instance.
Referenced by OtStack_joinConfiguredNetwork(), OtStack_joinNetwork(), OtStack_setupInterfaceAndNetwork(), OtStack_setupNetwork(), and OtStack_task().
|
static |
Referenced by OtInstance_get(), and OtStack_task().
| const char OtStack_procQueueName[] = "/tiop_process" |
Referenced by OtStack_task().
|
static |
|
static |
Referenced by OtStack_taskCreate().
|
static |
Referenced by handleNetifStateChanged(), joinerCallback(), and OtStack_registerCallback().
|
static |