Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cascoda-bm/cascoda_evbme.h"
#include "cascoda-bm/cascoda_interface.h"
#include "cascoda-bm/cascoda_serial.h"
#include "cascoda-bm/cascoda_types.h"
#include "cascoda-util/cascoda_time.h"
#include "M2351.h"
#include "ca821x_api.h"
#include "cascoda_chili.h"
#include "cascoda_chili_gpio.h"
#include "cascoda_secure.h"
#include "gpio.h"
#include "openthread/cli.h"
#include "openthread/coap.h"
#include "openthread/instance.h"
#include "openthread/link.h"
#include "openthread/platform/settings.h"
#include "openthread/tasklet.h"
#include "openthread/thread.h"
#include "platform.h"
#include "cbor.h"
Classes | |
struct | actuator_details |
Macros | |
#define | ACTUATOR_BY_DEFAULT |
#define | MAX_ACTUATORS 6 |
#define | ACTUATOR_UART_BAUDRATE 115200 |
Enumerations | |
enum | actuatordemo_state { ACTUATORDEMO_STOPPED = 0 , ACTUATORDEMO_ACTUATOR = 1 , ACTUATORDEMO_CONTROLLER = 2 } |
enum | value_to_send { ACTUATOR_INFO = 0 , ACTUATOR_BRIGHTNESS = 1 , ACTUATOR_COLOUR_MIX = 2 , ACTUATOR_BOTH = 3 } |
Functions | |
void | handle_cli_actuatordemo (void *aContext, uint8_t aArgsLength, char *aArgs[]) |
Process a CLI command to change the state of the actuator demo. More... | |
ca_error | init_actuatordemo (otInstance *aInstance, struct ca821x_dev *pDeviceRef) |
Initialise the actuator demo. More... | |
ca_error | handle_actuatordemo (struct ca821x_dev *pDeviceRef) |
Handle all actuatordemo functionality. More... | |
Variables | |
const char * | uriCascodaDiscover = "ca/di" |
const char * | uriCascodaActuatorDiscoverQuery = "t=act" |
const char * | uriCascodaActuator = "ca/ac" |
const char * | uriCascodaKeepAlive = "ca/ka" |
enum actuatordemo_state | actuatordemo_state = ACTUATORDEMO_STOPPED |
struct actuator_details | actuators [MAX_ACTUATORS] |
int64_t | brightness = 0 |
int64_t | colour_mix = 0 |
#define ACTUATOR_BY_DEFAULT |
#define ACTUATOR_UART_BAUDRATE 115200 |
#define MAX_ACTUATORS 6 |
enum actuatordemo_state |
enum value_to_send |
ca_error handle_actuatordemo | ( | struct ca821x_dev * | pDeviceRef | ) |
Handle all actuatordemo functionality.
Should be called regularly by the program main loop.
pDeviceRef | - Pointer to initialised ca821x_device_ref struct. |
void handle_cli_actuatordemo | ( | void * | aContext, |
uint8_t | aArgsLength, | ||
char * | aArgs[] | ||
) |
Process a CLI command to change the state of the actuator demo.
Should be linked to the openthread CLI using otCliSetUserCommands.
ca_error init_actuatordemo | ( | otInstance * | aInstance, |
struct ca821x_dev * | pDeviceRef | ||
) |
Initialise the actuator demo.
Should be called once at program startup.
aInstance | - Pointer to an OpenThread instance. |
pDeviceRef | - Pointer to initialised ca821x_device_ref struct. |
struct actuator_details actuators[MAX_ACTUATORS] |
int64_t brightness = 0 |
int64_t colour_mix = 0 |
const char* uriCascodaActuator = "ca/ac" |
const char* uriCascodaActuatorDiscoverQuery = "t=act" |
const char* uriCascodaDiscover = "ca/di" |
const char* uriCascodaKeepAlive = "ca/ka" |