Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
|
Simple test program for ca821x api. More...
Classes | |
struct | dispatch_flags |
Flags for ensuring correct dispatch has been called for each message. More... | |
struct | test_context |
Private data for test application. More... | |
Macros | |
#define | TEST_DSTADDR 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 |
#define | TEST_CHANNEL (13) |
#define | TEST_PANID 0x5C, 0xCA |
#define | TEST_MSDULENGTH (4) |
#define | TEST_MSDUHANDLE (0xAA) |
#define | TEST_MSDU 0xDE, 0xAD, 0xBE, 0xEF |
#define | TEST_SECURITYLEVEL (7) |
#define | TEST_KEYIDMODE (3) |
#define | TEST_KEYSOURCE 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00 |
#define | TEST_KEYINDEX (0x01) |
#define | TEST_PIBATTRIBUTE (phyCurrentChannel) |
#define | TEST_PIBATTRIBUTEVALUE (TEST_CHANNEL) |
#define | TEST_HWATTRIBUTE (HWME_EDTHRESHOLD) |
#define | TEST_HWATTRIBUTEVALUE (100) |
#define | TEST_TDMEATTRIBUTE (TDME_CHANNEL) |
#define | TEST_TDMEATTRIBUTEVALUE (TEST_CHANNEL) |
#define | TEST_HAESMODE (HAES_MODE_ENCRYPT) |
#define | TEST_HAESDATA 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff |
#define | TEST_SFRPAGE (1) |
#define | TEST_SFRADDRESS (0xBF) |
#define | TEST_SFRVALUE (0xAE) |
#define | TEST_TESTMODE (TDME_TEST_IDLE) |
#define | TEST_SEQUENCENUM (0) |
#define | ANSI_COLOR_RED "\x1b[31m" |
#define | ANSI_COLOR_GREEN "\x1b[32m" |
#define | ANSI_COLOR_YELLOW "\x1b[33m" |
#define | ANSI_COLOR_BLUE "\x1b[34m" |
#define | ANSI_COLOR_MAGENTA "\x1b[35m" |
#define | ANSI_COLOR_CYAN "\x1b[36m" |
#define | ANSI_COLOR_RESET "\x1b[0m" |
Functions | |
void | ca_log (ca_loglevel loglevel, const char *format, va_list argp) |
Function to process logs depending on platform. More... | |
ca_error | verify_command (const uint8_t *buf, size_t len, uint8_t *response, struct ca821x_dev *pDeviceRef) |
Verifies the command frame produced by an API function. More... | |
ca_error | ca821x_api_downstream (const uint8_t *buf, uint8_t *response, struct ca821x_dev *pDeviceRef) |
Function for downstream api interface. More... | |
void | print_result (uint8_t result) |
Prints the result of an API function call. More... | |
int | api_functions_test (void) |
API functions test. More... | |
ca_error | test_MCPS_DATA_indication (struct MCPS_DATA_indication_pset *params, struct ca821x_dev *pDeviceRef) |
MCPS-DATA.indication callback function. More... | |
ca_error | test_MCPS_DATA_confirm (struct MCPS_DATA_confirm_pset *params, struct ca821x_dev *pDeviceRef) |
MCPS-DATA.confirm callback function. More... | |
ca_error | test_MLME_ASSOCIATE_indication (struct MLME_ASSOCIATE_indication_pset *params, struct ca821x_dev *pDeviceRef) |
MLME-ASSOCIATE.indication callback function. More... | |
ca_error | test_MLME_ASSOCIATE_confirm (struct MLME_ASSOCIATE_confirm_pset *params, struct ca821x_dev *pDeviceRef) |
MLME-ASSOCIATE.confirm callback function. More... | |
ca_error | test_MLME_DISASSOCIATE_indication (struct MLME_DISASSOCIATE_indication_pset *params, struct ca821x_dev *pDeviceRef) |
MLME-DISASSOCIATE.indication callback function. More... | |
ca_error | test_MLME_DISASSOCIATE_confirm (struct MLME_DISASSOCIATE_confirm_pset *params, struct ca821x_dev *pDeviceRef) |
MLME-DISASSOCIATE.confirm callback function. More... | |
ca_error | test_MLME_BEACON_NOTIFY_indication (struct MLME_BEACON_NOTIFY_indication_pset *params, struct ca821x_dev *pDeviceRef) |
MLME-BEACON-NOTIFY.indication callback function. More... | |
ca_error | test_MLME_ORPHAN_indication (struct MLME_ORPHAN_indication_pset *params, struct ca821x_dev *pDeviceRef) |
MLME-ORPHAN.indication callback function. More... | |
ca_error | test_MLME_SCAN_confirm (struct MLME_SCAN_confirm_pset *params, struct ca821x_dev *pDeviceRef) |
MLME-SCAN.confirm callback function. More... | |
ca_error | test_MLME_COMM_STATUS_indication (struct MLME_COMM_STATUS_indication_pset *params, struct ca821x_dev *pDeviceRef) |
MLME-COMM-STATUS.indication callback function. More... | |
ca_error | test_MLME_SYNC_LOSS_indication (struct MLME_SYNC_LOSS_indication_pset *params, struct ca821x_dev *pDeviceRef) |
MLME-SYNC-LOSS.indication callback function. More... | |
ca_error | test_HWME_WAKEUP_indication (struct HWME_WAKEUP_indication_pset *params, struct ca821x_dev *pDeviceRef) |
HWME-WAKEUP.indication callback function. More... | |
ca_error | test_TDME_RXPKT_indication (struct TDME_RXPKT_indication_pset *params, struct ca821x_dev *pDeviceRef) |
TDME-RXPKT.indication callback function. More... | |
ca_error | test_TDME_EDDET_indication (struct TDME_EDDET_indication_pset *params, struct ca821x_dev *pDeviceRef) |
TDME-EDDET.indication callback function. More... | |
ca_error | test_TDME_ERROR_indication (struct TDME_ERROR_indication_pset *params, struct ca821x_dev *pDeviceRef) |
TDME-ERROR.indication callback function. More... | |
ca_error | test_generic_dispatch (const struct MAC_Message *msg, struct ca821x_dev *pDeviceRef) |
Generic callback function. More... | |
void | call_dispatch (struct MAC_Message *msg, struct ca821x_dev *pDeviceRef) |
Wrapper for ca821x_upstream_dispatch. More... | |
int | api_callbacks_test (void) |
Callbacks test. More... | |
int | main (void) |
Variables | |
uint8_t | ref_mcps_data_req [] |
MCPS-DATA.request reference buffer. More... | |
uint8_t | ref_mcps_purge_req [] |
MCPS-PURGE.request reference buffer. More... | |
uint8_t | ref_mcps_purge_cnf [] |
MCPS-PURGE.confirm reference buffer. More... | |
uint8_t | ref_mlme_associate_req [] |
MLME-ASSOCIATE.request reference buffer. More... | |
uint8_t | ref_mlme_associate_resp [] |
MLME-ASSOCIATE.response reference buffer. More... | |
uint8_t | ref_mlme_disassociate_req [] |
MLME-DISASSOCIATE.request reference buffer. More... | |
uint8_t | ref_mlme_get_req [] |
MLME-GET.request reference buffer. More... | |
uint8_t | ref_mlme_get_cnf [] |
MLME-GET.confirm reference buffer. More... | |
uint8_t | ref_mlme_orphan_resp [] |
MLME-ORPHAN.response reference buffer. More... | |
uint8_t | ref_mlme_reset_req [] |
MLME-RESET.request reference buffer. More... | |
uint8_t | ref_mlme_reset_cnf [] |
MLME-RESET.confirm reference buffer. More... | |
uint8_t | ref_mlme_rx_enable_req [] |
MLME-RX-ENABLE.request reference buffer. More... | |
uint8_t | ref_mlme_rx_enable_cnf [] |
MLME-RX-ENABLE.confirm reference buffer. More... | |
uint8_t | ref_mlme_scan_req [] |
MLME-SCAN.request reference buffer. More... | |
uint8_t | ref_mlme_set_req [] |
MLME-SET.request reference buffer. More... | |
uint8_t | ref_mlme_set_cnf [] |
MLME-SET.confirm reference buffer. More... | |
uint8_t | ref_mlme_start_req [] |
MLME-START.request reference buffer. More... | |
uint8_t | ref_mlme_start_cnf [] |
MLME-START.confirm reference buffer. More... | |
uint8_t | ref_mlme_poll_req [] |
MLME-POLL.request reference buffer. More... | |
uint8_t | ref_mlme_poll_cnf [] |
MLME-POLL.confirm reference buffer. More... | |
uint8_t | ref_hwme_set_req [] |
HWME-SET.request reference buffer. More... | |
uint8_t | ref_hwme_set_cnf [] |
HWME-SET.confirm reference buffer. More... | |
uint8_t | ref_hwme_get_req [] |
HWME-GET.request reference buffer. More... | |
uint8_t | ref_hwme_get_cnf [] |
HWME-GET.confirm reference buffer. More... | |
uint8_t | ref_hwme_haes_req [] |
HWME-HAES.request reference buffer. More... | |
uint8_t | ref_hwme_haes_cnf [] |
HWME-HAES.confirm reference buffer. More... | |
uint8_t | ref_tdme_setsfr_req [] |
TDME-SETSFR.request reference buffer. More... | |
uint8_t | ref_tdme_setsfr_cnf [] |
TDME-SETSFR.confirm reference buffer. More... | |
uint8_t | ref_tdme_getsfr_req [] |
TDME-GETSFR.request reference buffer. More... | |
uint8_t | ref_tdme_getsfr_cnf [] |
TDME-GETSFR.confirm reference buffer. More... | |
uint8_t | ref_tdme_testmode_req [] |
TDME-TESTMODE.request reference buffer. More... | |
uint8_t | ref_tdme_testmode_cnf [] |
TDME-TESTMODE.confirm reference buffer. More... | |
uint8_t | ref_tdme_set_req [] |
TDME-SET.request reference buffer. More... | |
uint8_t | ref_tdme_set_cnf [] |
TDME-SET.confirm reference buffer. More... | |
uint8_t | ref_tdme_txpkt_req [] |
TDME-TXPKT.request reference buffer. More... | |
uint8_t | ref_tdme_txpkt_cnf [] |
TDME-TXPKT.confirm reference buffer. More... | |
uint8_t | ref_tdme_lotlk_req [] |
TDME-LOTLK.request reference buffer. More... | |
uint8_t | ref_tdme_lotlk_cnf [] |
TDME-LOTLK.confirm reference buffer. More... | |
Simple test program for ca821x api.
#define ANSI_COLOR_BLUE "\x1b[34m" |
#define ANSI_COLOR_CYAN "\x1b[36m" |
#define ANSI_COLOR_GREEN "\x1b[32m" |
#define ANSI_COLOR_MAGENTA "\x1b[35m" |
#define ANSI_COLOR_RED "\x1b[31m" |
#define ANSI_COLOR_RESET "\x1b[0m" |
#define ANSI_COLOR_YELLOW "\x1b[33m" |
#define TEST_CHANNEL (13) |
#define TEST_DSTADDR 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 |
#define TEST_HAESDATA 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff |
#define TEST_HAESMODE (HAES_MODE_ENCRYPT) |
#define TEST_HWATTRIBUTE (HWME_EDTHRESHOLD) |
#define TEST_HWATTRIBUTEVALUE (100) |
#define TEST_KEYIDMODE (3) |
#define TEST_KEYINDEX (0x01) |
#define TEST_KEYSOURCE 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00 |
#define TEST_MSDU 0xDE, 0xAD, 0xBE, 0xEF |
#define TEST_MSDUHANDLE (0xAA) |
#define TEST_MSDULENGTH (4) |
#define TEST_PANID 0x5C, 0xCA |
#define TEST_PIBATTRIBUTE (phyCurrentChannel) |
#define TEST_PIBATTRIBUTEVALUE (TEST_CHANNEL) |
#define TEST_SECURITYLEVEL (7) |
#define TEST_SEQUENCENUM (0) |
#define TEST_SFRADDRESS (0xBF) |
#define TEST_SFRPAGE (1) |
#define TEST_SFRVALUE (0xAE) |
#define TEST_TDMEATTRIBUTE (TDME_CHANNEL) |
#define TEST_TDMEATTRIBUTEVALUE (TEST_CHANNEL) |
#define TEST_TESTMODE (TDME_TEST_IDLE) |
int api_callbacks_test | ( | void | ) |
Callbacks test.
int api_functions_test | ( | void | ) |
API functions test.
Tests the cascoda_api command functions to ensure that they produce valid command frames for the transceiver.
void call_dispatch | ( | struct MAC_Message * | msg, |
struct ca821x_dev * | pDeviceRef | ||
) |
Wrapper for ca821x_upstream_dispatch.
Calls ca821x_upstream_dispatch and prints the result
msg | - Message buffer |
pDeviceRef | - Device reference |
int main | ( | void | ) |
void print_result | ( | uint8_t | result | ) |
Prints the result of an API function call.
result | - The function's return code |
ca_error test_generic_dispatch | ( | const struct MAC_Message * | msg, |
struct ca821x_dev * | pDeviceRef | ||
) |
Generic callback function.
msg | - Message buffer |
pDeviceRef | - Device reference |
ca_error test_HWME_WAKEUP_indication | ( | struct HWME_WAKEUP_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
HWME-WAKEUP.indication callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_MCPS_DATA_confirm | ( | struct MCPS_DATA_confirm_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
MCPS-DATA.confirm callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_MCPS_DATA_indication | ( | struct MCPS_DATA_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
MCPS-DATA.indication callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_MLME_ASSOCIATE_confirm | ( | struct MLME_ASSOCIATE_confirm_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
MLME-ASSOCIATE.confirm callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_MLME_ASSOCIATE_indication | ( | struct MLME_ASSOCIATE_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
MLME-ASSOCIATE.indication callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_MLME_BEACON_NOTIFY_indication | ( | struct MLME_BEACON_NOTIFY_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
MLME-BEACON-NOTIFY.indication callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_MLME_COMM_STATUS_indication | ( | struct MLME_COMM_STATUS_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
MLME-COMM-STATUS.indication callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_MLME_DISASSOCIATE_confirm | ( | struct MLME_DISASSOCIATE_confirm_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
MLME-DISASSOCIATE.confirm callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_MLME_DISASSOCIATE_indication | ( | struct MLME_DISASSOCIATE_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
MLME-DISASSOCIATE.indication callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_MLME_ORPHAN_indication | ( | struct MLME_ORPHAN_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
MLME-ORPHAN.indication callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_MLME_SCAN_confirm | ( | struct MLME_SCAN_confirm_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
MLME-SCAN.confirm callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_MLME_SYNC_LOSS_indication | ( | struct MLME_SYNC_LOSS_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
MLME-SYNC-LOSS.indication callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_TDME_EDDET_indication | ( | struct TDME_EDDET_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
TDME-EDDET.indication callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_TDME_ERROR_indication | ( | struct TDME_ERROR_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
TDME-ERROR.indication callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error test_TDME_RXPKT_indication | ( | struct TDME_RXPKT_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
TDME-RXPKT.indication callback function.
params | - Primitive parameters |
pDeviceRef | - Device reference |
ca_error verify_command | ( | const uint8_t * | buf, |
size_t | len, | ||
uint8_t * | response, | ||
struct ca821x_dev * | pDeviceRef | ||
) |
Verifies the command frame produced by an API function.
This function is called by the API functions with their constructed frame. This frame is then compared to an expected reference.
buf | - Constructed command frame |
len | - Length of frame |
response | - Buffer to populate with synchronous response |
pDeviceRef | - Device reference |
uint8_t ref_hwme_get_cnf[] |
HWME-GET.confirm reference buffer.
uint8_t ref_hwme_get_req[] |
HWME-GET.request reference buffer.
uint8_t ref_hwme_haes_cnf[] |
HWME-HAES.confirm reference buffer.
uint8_t ref_hwme_haes_req[] |
HWME-HAES.request reference buffer.
uint8_t ref_hwme_set_cnf[] |
HWME-SET.confirm reference buffer.
uint8_t ref_hwme_set_req[] |
HWME-SET.request reference buffer.
uint8_t ref_mcps_data_req[] |
MCPS-DATA.request reference buffer.
uint8_t ref_mcps_purge_cnf[] |
MCPS-PURGE.confirm reference buffer.
uint8_t ref_mcps_purge_req[] |
MCPS-PURGE.request reference buffer.
uint8_t ref_mlme_associate_req[] |
MLME-ASSOCIATE.request reference buffer.
uint8_t ref_mlme_associate_resp[] |
MLME-ASSOCIATE.response reference buffer.
uint8_t ref_mlme_disassociate_req[] |
MLME-DISASSOCIATE.request reference buffer.
uint8_t ref_mlme_get_cnf[] |
MLME-GET.confirm reference buffer.
uint8_t ref_mlme_get_req[] |
MLME-GET.request reference buffer.
uint8_t ref_mlme_orphan_resp[] |
MLME-ORPHAN.response reference buffer.
uint8_t ref_mlme_poll_cnf[] |
MLME-POLL.confirm reference buffer.
uint8_t ref_mlme_poll_req[] |
MLME-POLL.request reference buffer.
uint8_t ref_mlme_reset_cnf[] |
MLME-RESET.confirm reference buffer.
uint8_t ref_mlme_reset_req[] |
MLME-RESET.request reference buffer.
uint8_t ref_mlme_rx_enable_cnf[] |
MLME-RX-ENABLE.confirm reference buffer.
uint8_t ref_mlme_rx_enable_req[] |
MLME-RX-ENABLE.request reference buffer.
uint8_t ref_mlme_scan_req[] |
MLME-SCAN.request reference buffer.
uint8_t ref_mlme_set_cnf[] |
MLME-SET.confirm reference buffer.
uint8_t ref_mlme_set_req[] |
MLME-SET.request reference buffer.
uint8_t ref_mlme_start_cnf[] |
MLME-START.confirm reference buffer.
uint8_t ref_mlme_start_req[] |
MLME-START.request reference buffer.
uint8_t ref_tdme_getsfr_cnf[] |
TDME-GETSFR.confirm reference buffer.
uint8_t ref_tdme_getsfr_req[] |
TDME-GETSFR.request reference buffer.
uint8_t ref_tdme_lotlk_cnf[] |
TDME-LOTLK.confirm reference buffer.
uint8_t ref_tdme_lotlk_req[] |
TDME-LOTLK.request reference buffer.
uint8_t ref_tdme_set_cnf[] |
TDME-SET.confirm reference buffer.
uint8_t ref_tdme_set_req[] |
TDME-SET.request reference buffer.
uint8_t ref_tdme_setsfr_cnf[] |
TDME-SETSFR.confirm reference buffer.
uint8_t ref_tdme_setsfr_req[] |
TDME-SETSFR.request reference buffer.
uint8_t ref_tdme_testmode_cnf[] |
TDME-TESTMODE.confirm reference buffer.
uint8_t ref_tdme_testmode_req[] |
TDME-TESTMODE.request reference buffer.
uint8_t ref_tdme_txpkt_cnf[] |
TDME-TXPKT.confirm reference buffer.
uint8_t ref_tdme_txpkt_req[] |
TDME-TXPKT.request reference buffer.