Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
Loading...
Searching...
No Matches
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 "cascoda-bm/cascoda_evbme.h"
#include "cascoda-util/cascoda_tasklet.h"
#include "cascoda-util/cascoda_time.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)

Functions

struct ca821x_dev * PlatformGetDeviceRef ()
 Following Initialisation, this can be used to obtain the pDeviceRef that openthread is using.
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.
void initIeeeEui64 ()
int PlatformRadioInitWithDev (struct ca821x_dev *apDeviceRef)
 Initialise the openthread platform layer with apDeviceRef as the device.
int PlatformRadioInitWithDevEui64 (struct ca821x_dev *apDeviceRef, uint8_t *pEui64)
 Initialise the openthread platform layer with pDeviceRef as the device, and pEui64 as the EUI64.
int PlatformRadioInit (void)
 Initialise the openthread platform layer with the internal device struct.
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.
otError otPlatRadioGetCcaEnergyDetectThreshold (otInstance *aInstance, int8_t *aThreshold)
otError otPlatRadioSetCcaEnergyDetectThreshold (otInstance *aInstance, int8_t aThreshold)
otError otPlatGetSFR (otInstance *aInstance, uint8_t aPage, uint8_t aAddr, uint8_t *aVal)
otError otPlatSetSFR (otInstance *aInstance, uint8_t aPage, uint8_t aAddr, uint8_t aVal)
otError otPlatHwmeGet (otInstance *aInstance, uint8_t aAttr, uint8_t *aLen, uint8_t *aBuf)
otError otPlatHwmeSet (otInstance *aInstance, uint8_t aAttr, uint8_t aLen, uint8_t *aBuf)
otError otPlatPowerUpRadio (otInstance *aInstance)

Detailed Description

This file implements the OpenThread platform abstraction for radio communication.

Macro Definition Documentation

◆ ARRAY_LENGTH

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

Function Documentation

◆ initIeeeEui64()

void initIeeeEui64 ( )

◆ otPlatGetSFR()

otError otPlatGetSFR ( otInstance * aInstance,
uint8_t aPage,
uint8_t aAddr,
uint8_t * aVal )

◆ otPlatHwmeGet()

otError otPlatHwmeGet ( otInstance * aInstance,
uint8_t aAttr,
uint8_t * aLen,
uint8_t * aBuf )

◆ otPlatHwmeSet()

otError otPlatHwmeSet ( otInstance * aInstance,
uint8_t aAttr,
uint8_t aLen,
uint8_t * aBuf )

◆ 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 )

◆ otPlatPowerUpRadio()

otError otPlatPowerUpRadio ( otInstance * aInstance)

◆ 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 )

◆ otPlatSetSFR()

otError otPlatSetSFR ( otInstance * aInstance,
uint8_t aPage,
uint8_t aAddr,
uint8_t aVal )