An open source implementation of Thread stack.  
More...
An open source implementation of Thread stack. 
- See also
 - https://github.com/openthread/openthread
 
Thread is a mesh oriented network stack running for IEEE802.15.4 networks.
The RIOT port allows to directly call OpenThread API functions using Event Queue. For example:
#include "openthread/thread.h"
 
    .handler = _panid_handler
};
 
{
    do_something_with_panid(panid);
}
 
int main(void)
{
    return 0;
}
otInstance * openthread_get_instance(void)
Get pointer to the OpenThread instance.
 
event_queue_t * openthread_get_evq(void)
Get OpenThread event queue.
 
void event_post(event_queue_t *queue, event_t *event)
Queue an event.
 
struct event event_t
event structure forward declaration
 
 - See also
 - https://openthread.io/releases/thread-reference-20180619 
 
◆ IEEE802154_MAX_LENGTH
      
        
          | #define IEEE802154_MAX_LENGTH   (127U) | 
        
      
 
Max length for IEEE802154 frame. 
Definition at line 88 of file ot.h.
 
 
◆ OPENTHREAD_ERROR_NO_EMPTY_SERIAL_BUFFER
      
        
          | #define OPENTHREAD_ERROR_NO_EMPTY_SERIAL_BUFFER   -1 | 
        
      
 
error when no more buffer available 
Definition at line 80 of file ot.h.
 
 
◆ OPENTHREAD_NETDEV_BUFLEN
Max length for a netdev buffer. 
Definition at line 90 of file ot.h.
 
 
◆ OPENTHREAD_NUMBER_OF_SERIAL_BUFFER
      
        
          | #define OPENTHREAD_NUMBER_OF_SERIAL_BUFFER   (1U) | 
        
      
 
number of serial reception buffer 
Definition at line 72 of file ot.h.
 
 
◆ OPENTHREAD_SERIAL_BUFFER__PAYLOAD_SIZE
sizeof the spinel payload data 
Definition at line 78 of file ot.h.
 
 
◆ OPENTHREAD_SERIAL_BUFFER_SIZE
sizeof the serial buffer 
Definition at line 76 of file ot.h.
 
 
◆ OPENTHREAD_SERIAL_BUFFER_STATUS_FREE
      
        
          | #define OPENTHREAD_SERIAL_BUFFER_STATUS_FREE   (0x0001) | 
        
      
 
serial buffer ready to use 
Definition at line 82 of file ot.h.
 
 
◆ OPENTHREAD_SERIAL_BUFFER_STATUS_FULL
      
        
          | #define OPENTHREAD_SERIAL_BUFFER_STATUS_FULL   (0x0004) | 
        
      
 
serial buffer payload full 
Definition at line 86 of file ot.h.
 
 
◆ OPENTHREAD_SERIAL_BUFFER_STATUS_READY_TO_PROCESS
      
        
          | #define OPENTHREAD_SERIAL_BUFFER_STATUS_READY_TO_PROCESS   (0x0002) | 
        
      
 
serial buffer ready for processing 
Definition at line 84 of file ot.h.
 
 
◆ OPENTHREAD_SIZEOF_LENGTH_AND_FREEBUFF
      
        
          | #define OPENTHREAD_SIZEOF_LENGTH_AND_FREEBUFF   (4U) | 
        
      
 
sizeof in bytes the two first members of she serial structure 
Definition at line 74 of file ot.h.
 
 
◆ openthread_get_evq()
Get OpenThread event queue. 
- Returns
 - pointer to the event queue 
 
 
 
◆ openthread_get_instance()
      
        
          | otInstance * openthread_get_instance  | 
          ( | 
          void |            | ) | 
           | 
        
      
 
Get pointer to the OpenThread instance. 
- Returns
 - pointer to the OpenThread instance 
 
 
 
◆ openthread_netdev_init()
      
        
          | int openthread_netdev_init  | 
          ( | 
          char * |           stack,  | 
        
        
           | 
           | 
          int |           stacksize,  | 
        
        
           | 
           | 
          char |           priority,  | 
        
        
           | 
           | 
          const char * |           name,  | 
        
        
           | 
           | 
          netdev_t * |           netdev ) | 
        
      
 
Starts OpenThread thread. 
- Parameters
 - 
  
    | [in] | stack | pointer to the stack designed for OpenThread  | 
    | [in] | stacksize | size of the stack  | 
    | [in] | priority | priority of the OpenThread stack  | 
    | [in] | name | name of the OpenThread stack  | 
    | [in] | netdev | pointer to the netdev interface | 
  
   
- Returns
 - PID of OpenThread thread 
 
- 
-EINVAL if there was an error creating the thread 
 
 
 
◆ openthread_radio_init()
      
        
          | void openthread_radio_init  | 
          ( | 
          netdev_t * |           dev,  | 
        
        
           | 
           | 
          uint8_t * |           tb,  | 
        
        
           | 
           | 
          uint8_t * |           rb ) | 
        
      
 
Init OpenThread radio. 
- Parameters
 - 
  
    | [in] | dev | pointer to a netdev interface  | 
    | [in] | tb | pointer to the TX buffer designed for OpenThread  | 
    | [in] | rb | pointer to the RX buffer designed for Open_Thread  | 
  
   
 
 
◆ recv_pkt()
      
        
          | void recv_pkt  | 
          ( | 
          otInstance * |           aInstance,  | 
        
        
           | 
           | 
          netdev_t * |           dev ) | 
        
      
 
Gets packet from driver and tells OpenThread about the reception. 
- Parameters
 - 
  
    | [in] | aInstance | pointer to an OpenThread instance  | 
    | [in] | dev | pointer to a netdev instance  | 
  
   
 
 
◆ send_pkt()
Inform OpenThread when tx is finished. 
- Parameters
 - 
  
    | [in] | aInstance | pointer to an OpenThread instance  | 
    | [in] | dev | pointer to a netdev interface  | 
    | [in] | event | just occurred netdev event  |