Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
radio.c File Reference

This file implements the OpenThread platform abstraction for radio communication. More...

#include <assert.h>
#include <fcntl.h>
#include <math.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include "openthread/platform/logging.h"
#include "openthread/platform/radio-mac.h"
#include "openthread/random_noncrypto.h"
#include "openthread/thread.h"
#include "ca821x-posix-thread/posix-platform.h"
#include "ca821x-posix/ca821x-posix-settings.h"
#include "ca821x-posix/ca821x-posix.h"
#include "cascoda-util/cascoda_rand.h"
#include "ca821x_api.h"
#include "code_utils.h"
#include "ieee_802_15_4.h"
#include "mac_messages.h"
#include "selfpipe.h"
Include dependency graph for radio.c:

Classes

struct  M_KeyDescriptor_thread
 

Macros

#define ARRAY_LENGTH(array)   (sizeof((array)) / sizeof((array)[0]))
 

Enumerations

enum  barrier_waiting { NOT_WAITING , WAITING , GREENLIGHT , DONE }
 

Functions

otError otPlatMlmeGet (otInstance *aInstance, otPibAttr aAttr, uint8_t aIndex, uint8_t *aLen, uint8_t *aBuf)
 
otError otPlatMlmeSet (otInstance *aInstance, otPibAttr aAttr, uint8_t aIndex, uint8_t aLen, const uint8_t *aBuf)
 
otError otPlatMlmeReset (otInstance *aInstance, bool setDefaultPib)
 
otError otPlatMlmeStart (otInstance *aInstance, otStartRequest *aStartReq)
 
otError otPlatMlmeScan (otInstance *aInstance, otScanRequest *aScanRequest)
 
otError otPlatMlmePollRequest (otInstance *aInstance, otPollRequest *aPollRequest)
 
otError otPlatMcpsDataRequest (otInstance *aInstance, otDataRequest *aDataRequest)
 
otError otPlatMcpsPurge (otInstance *aInstance, uint8_t aMsduHandle)
 
void otPlatRadioGetIeeeEui64 (otInstance *aInstance, uint8_t *aIeeeEui64)
 
int8_t otPlatRadioGetReceiveSensitivity (otInstance *aInstance)
 
void PlatformRadioStop (void)
 Stop and reset the CA-821x. More...
 
void initIeeeEui64 ()
 
int PlatformRadioInitWithDev (struct ca821x_dev *apDeviceRef)
 Initialise the openthread platform layer with apDeviceRef as the device. More...
 
int PlatformRadioInit (void)
 Initialise the openthread platform layer with the internal device struct. More...
 
struct ca821x_devPlatformGetDeviceRef ()
 Following Initialisation, this can be used to obtain the pDeviceRef that openthread is using. More...
 
int8_t otPlatRadioGetRssi (otInstance *aInstance)
 
otError otPlatRadioEnable (otInstance *aInstance)
 
bool otPlatRadioIsEnabled (otInstance *aInstance)
 
int PlatformRadioProcess (void)
 This method performs radio driver processing. More...
 
otError otPlatRadioGetCcaEnergyDetectThreshold (otInstance *aInstance, int8_t *aThreshold)
 
otError otPlatRadioSetCcaEnergyDetectThreshold (otInstance *aInstance, int8_t aThreshold)
 

Detailed Description

This file implements the OpenThread platform abstraction for radio communication.

Macro Definition Documentation

◆ ARRAY_LENGTH

#define ARRAY_LENGTH (   array)    (sizeof((array)) / sizeof((array)[0]))

Enumeration Type Documentation

◆ barrier_waiting

Enumerator
NOT_WAITING 
WAITING 
GREENLIGHT 
DONE 

Function Documentation

◆ initIeeeEui64()

void initIeeeEui64 ( )

◆ otPlatMcpsDataRequest()

otError otPlatMcpsDataRequest ( otInstance *  aInstance,
otDataRequest *  aDataRequest 
)

◆ otPlatMcpsPurge()

otError otPlatMcpsPurge ( otInstance *  aInstance,
uint8_t  aMsduHandle 
)

◆ otPlatMlmeGet()

otError otPlatMlmeGet ( otInstance *  aInstance,
otPibAttr  aAttr,
uint8_t  aIndex,
uint8_t *  aLen,
uint8_t *  aBuf 
)

◆ otPlatMlmePollRequest()

otError otPlatMlmePollRequest ( otInstance *  aInstance,
otPollRequest *  aPollRequest 
)

◆ otPlatMlmeReset()

otError otPlatMlmeReset ( otInstance *  aInstance,
bool  setDefaultPib 
)

◆ otPlatMlmeScan()

otError otPlatMlmeScan ( otInstance *  aInstance,
otScanRequest *  aScanRequest 
)

◆ otPlatMlmeSet()

otError otPlatMlmeSet ( otInstance *  aInstance,
otPibAttr  aAttr,
uint8_t  aIndex,
uint8_t  aLen,
const uint8_t *  aBuf 
)

◆ otPlatMlmeStart()

otError otPlatMlmeStart ( otInstance *  aInstance,
otStartRequest *  aStartReq 
)

◆ otPlatRadioEnable()

otError otPlatRadioEnable ( otInstance *  aInstance)

◆ otPlatRadioGetCcaEnergyDetectThreshold()

otError otPlatRadioGetCcaEnergyDetectThreshold ( otInstance *  aInstance,
int8_t *  aThreshold 
)

◆ otPlatRadioGetIeeeEui64()

void otPlatRadioGetIeeeEui64 ( otInstance *  aInstance,
uint8_t *  aIeeeEui64 
)

◆ otPlatRadioGetReceiveSensitivity()

int8_t otPlatRadioGetReceiveSensitivity ( otInstance *  aInstance)

◆ otPlatRadioGetRssi()

int8_t otPlatRadioGetRssi ( otInstance *  aInstance)

◆ otPlatRadioIsEnabled()

bool otPlatRadioIsEnabled ( otInstance *  aInstance)

◆ otPlatRadioSetCcaEnergyDetectThreshold()

otError otPlatRadioSetCcaEnergyDetectThreshold ( otInstance *  aInstance,
int8_t  aThreshold 
)

◆ PlatformRadioProcess()

int PlatformRadioProcess ( void  )

This method performs radio driver processing.