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 <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.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 "cascoda-bm/cascoda_interface.h"
#include "ca821x_api.h"
#include "code_utils.h"
#include "ieee_802_15_4.h"
#include "mac_messages.h"
#include "platform.h"
Include dependency graph for radio.c:

Classes

struct  M_KeyDescriptor_thread
 

Macros

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

Functions

struct ca821x_devPlatformGetDeviceRef ()
 Following Initialisation, this can be used to obtain the pDeviceRef that openthread is using. More...
 
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 PlatformRadioInitWithDevEui64 (struct ca821x_dev *apDeviceRef, uint8_t *pEui64)
 Initialise the openthread platform layer with pDeviceRef as the device, and pEui64 as the EUI64. More...
 
int PlatformRadioInit (void)
 Initialise the openthread platform layer with the internal device struct. More...
 
int8_t otPlatRadioGetRssi (otInstance *aInstance)
 
otError otPlatRadioEnable (otInstance *aInstance)
 
bool otPlatRadioIsEnabled (otInstance *aInstance)
 
int PlatformIsExpectingIndication ()
 Determines whether or not an MCPS-DATA-INDICATION is currently expected, based on the result of the previous poll. 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]))

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 
)