40 #ifndef CA821X_OPENTHREAD_PLATFORM_PLATFORM_H_
41 #define CA821X_OPENTHREAD_PLATFORM_PLATFORM_H_
44 #include "openthread/instance.h"
45 #include "openthread/platform/radio.h"
52 #define SuccessOrExit(aCondition) \
55 if ((aCondition) != 0) \
68 static const uint16_t joiner_credential_key = 0xCA50;
70 static const uint16_t autostart_key = 0xCA51;
72 static const uint16_t sensordemo_key = 0xCA5C;
74 static const uint16_t actuatordemo_key = 0xCA5D;
76 static const uint16_t stack_profiler_key = 0xCA5E;
78 static const uint16_t OC_SETTINGS_KEY = 0xe107;
80 static const uint16_t OC_ENCRYPTION_KEY_KEY = 0xe108;
239 otInstance *aInstance,
241 void (*poll_func)(
void));
271 otInstance *aInstance,
The main ca821x-api include file.
This file includes platform abstraction for non-volatile storage of settings.
openthread_message_codes
Definition: platform.h:62
otError PlatformGetQRString(char *aBufOut, size_t bufferSize, otInstance *aInstance)
Get the QR text string format to be read as a Thread Connect QR Code, enabling external commissioning...
Definition: misc.c:396
int PlatformIsExpectingIndication(void)
Determines whether or not an MCPS-DATA-INDICATION is currently expected, based on the result of the p...
Definition: radio.c:704
int PlatformRadioInitWithDev(struct ca821x_dev *pDeviceRef)
Initialise the openthread platform layer with apDeviceRef as the device.
Definition: radio.c:652
otError PlatformTryJoinWithPskdWithCustomPoll(struct ca821x_dev *pDeviceRef, otInstance *aInstance, const char *aPskd, void(*poll_func)(void))
Identiacl to PlatformTryJoinWithPsdk(), except that an additional poll function can be provided,...
Definition: misc.c:261
otError PlatformEraseJoinerCredentials(otInstance *aInstance)
Helper function to erase the joiner credentials of this device.
Definition: misc.c:345
otError PlatformUartReceive(const uint8_t *aBuf, uint16_t aBufLength)
Handle received serial data.
Definition: serial.c:72
bool PlatformCanSleep(otInstance *aInstance)
Check whether the platform is able to sleep.
Definition: misc.c:86
otError PlatformSleep(uint32_t aSleepTime)
Sends the platform and cax to sleep for the given number of milliseconds.
Definition: misc.c:79
otInstance * OT_INSTANCE
Definition: thread_dev_main.c:34
otError otPlatSettingsGetAddress(uint16_t aKey, int aIndex, void **aValue, uint16_t *aValueLength)
Get the address at which a setting is stored, so that it can be read without copying it,...
Definition: settings.c:118
otError otPlatSettingsAddVector(otInstance *aInstance, uint16_t aKey, struct settingBuffer *aVector, size_t aCount)
This function adds the value to a setting identified by aKey, without replacing any existing values.
Definition: settings.c:141
otError PlatformTryJoin(struct ca821x_dev *pDeviceRef, otInstance *aInstance)
Helper function to attempt the Thread joining process.
Definition: misc.c:328
int PlatformRadioInit(void)
Initialise the openthread platform layer with the internal device struct.
Definition: radio.c:668
void PlatformAlarmInit(void)
Initialise the platform alarm subsystem.
Definition: alarm.c:65
struct ca821x_dev * PlatformGetDeviceRef(void)
Following Initialisation, this can be used to obtain the pDeviceRef that openthread is using.
Definition: radio.c:78
otError PlatformTryJoinWithPskd(struct ca821x_dev *pDeviceRef, otInstance *aInstance, const char *aPskd)
Helper function to attempt the Thread joining process, with an explicit passcode.
Definition: misc.c:225
int PlatformRadioInitWithDevEui64(struct ca821x_dev *apDeviceRef, uint8_t *pEui64)
Initialise the openthread platform layer with pDeviceRef as the device, and pEui64 as the EUI64.
Definition: radio.c:660
const char * PlatformGetJoinerCredential(otInstance *aInstance)
Helper function to get the joiner credential of this device.
Definition: misc.c:176
otError PlatformPrintJoinerCredentials(struct ca821x_dev *pDeviceRef, otInstance *aInstance, uint32_t aMaxWaitMs)
Helper function to print the Thread Joiner credentials (for instance, upon boot).
Definition: misc.c:339
otError PlatformTryJoinWithCustomPoll(struct ca821x_dev *pDeviceRef, otInstance *aInstance, void(*poll_func)(void))
Identical to PlatformTryJoin(), except that an additional poll function can be provided,...
Definition: misc.c:333
void PlatformRadioStop(void)
Stop and reset the CA-821x.
Definition: radio.c:599
otError PlatformPrintJoinerCredentialsWithPskd(struct ca821x_dev *pDeviceRef, otInstance *aInstance, uint32_t aMaxWaitMs, const char *aPskd)
Helper function to print the Thread Joiner credentials, with an explicit passcode (for instance,...
Definition: misc.c:302
@ OT_SERIAL_DOWNLINK
Definition: platform.h:63
@ OT_SERIAL_UPLINK
Definition: platform.h:64
CA-821x Device reference struct.
Definition: ca821x_api.h:123
Data structure for vectored I/O using caUtilSettingsAddVector.
Definition: cascoda_settings.h:56