Certification Protocol Commands implementation.
Copyright (c) 2020 Microchip Technology Inc. and its subsidiaries.
#include "asf.h"
#include "lorawan.h"
#include "radio_interface.h"
#include "radio_driver_hal.h"
#include "enddevice_cpc.h"
#include "enddevice_cert.h"
#include "conf_certification.h"
#include "sio2host.h"
#include "sw_timer.h"
#include "pds_interface.h"
Functions | |
void | enddevice_cpc_execute_command (uint8_t *buffer, uint8_t buflen) |
static void | enddevice_cpc_fresh_join (void) |
bool | enddevice_cpc_is_payload_valid (uint8_t *buffer, uint8_t len) |
static void | enddevice_txcw_callback (void) |
Variables | |
uint8_t | appKey [16] |
uint8_t | bandTable [] |
bool | bTxCnf |
uint32_t | certAppTimeout |
uint8_t | certAppTimerId |
bool | clear_linkcheck |
IsmBand_t | current_band |
uint8_t | devEui [8] |
uint16_t | downlinkCtr |
uint8_t | joinEui [8] |
LorawanSendReq_t | lorawanSendReq |
bool | pktRxd |
uint8_t | sendData [100] |
uint16_t | sendDataLen |
uint8_t | sendFport |
uint8_t | testMode |
uint8_t | tx_cw_timer |
TransmissionType_t | txType |
uint8_t | uplinkTestNoResp |
void enddevice_cpc_execute_command | ( | uint8_t * | buffer, |
uint8_t | buflen | ||
) |
References ADR, bTxCnf, CERT_APP_TIMEOUT, cert_app_timer_callback(), CERT_PROTOCOL_PACKAGE_IDENTIFIER, CERT_PROTOCOL_PACKAGE_VERSION, certAppTimeout, certAppTimerId, CHANNEL_FREQUENCY, CPC_ADR_BIT_CHANGE_REQ, CPC_DEVICE_TIME_REQ, CPC_DUT_FPORT224_DISABLE_REQ, CPC_DUT_JOIN_REQ, CPC_DUT_RESET_REQ, CPC_DUT_VERSIONS_ANS, CPC_DUT_VERSIONS_REQ, CPC_ECHO_INC_PAYLOAD_ANS, CPC_ECHO_INC_PAYLOAD_REQ, CPC_LINK_CHECK_REQ, CPC_PACKAGE_VERSION_ANS, CPC_PACKAGE_VERSION_REQ, CPC_PING_SLOT_INFO_REQ, CPC_REGIONAL_DUTYCYCLE_CTRL_REQ, CPC_RX_APP_CNT_ANS, CPC_RX_APP_CNT_REQ, CPC_RX_APP_CNT_RESET_REQ, CPC_SWITCH_CLASS_REQ, CPC_TX_CW_REQ, CPC_TX_FRAMES_CTRL_REQ, CPC_TX_PERIODICITY_CHANGE_REQ, delay_ms, downlinkCtr, EDCLASS, enddevice_cpc_fresh_join(), enddevice_txcw_callback(), ERR_NONE, i, LORAWAN_GetAttr(), LORAWAN_SetAttr(), LORAWAN_SUCCESS, MS_TO_US, NEXT_PAYLOAD_SIZE, NULL, OUTPUT_POWER, PDS_DeleteAll(), RADIO_SetAttr(), RADIO_TransmitCW(), REGIONAL_DUTY_CYCLE, SEND_DEVICE_TIME_CMD, SEND_LINK_CHECK_CMD, sendData, sendDataLen, sendFport, SW_TIMEOUT_RELATIVE, SwTimerIsRunning(), SwTimerStart(), SwTimerStop(), TEST_MODE_ENABLE, TEST_PORT_NB, and tx_cw_timer.
Referenced by cert_handle_cert_rx_data().
|
static |
References ADR, APP_KEY, appKey, bandTable, certAppTimerId, CRYPTODEVICE_ENABLED, current_band, DEV_EUI, devEui, JOIN_EUI, joinEui, LORAWAN_Join(), LORAWAN_OTAA, LORAWAN_Reset(), LORAWAN_SetAttr(), PDS_RestoreAll(), SwTimerStop(), and TEST_MODE_ENABLE.
Referenced by enddevice_cpc_execute_command().
bool enddevice_cpc_is_payload_valid | ( | uint8_t * | buffer, |
uint8_t | len | ||
) |
References CPC_ADR_BIT_CHANGE_REQ, CPC_DEVICE_TIME_REQ, CPC_DUT_FPORT224_DISABLE_REQ, CPC_DUT_JOIN_REQ, CPC_DUT_RESET_REQ, CPC_DUT_VERSIONS_REQ, CPC_ECHO_INC_PAYLOAD_REQ, CPC_LINK_CHECK_REQ, CPC_PACKAGE_VERSION_REQ, CPC_PING_SLOT_INFO_REQ, CPC_REGIONAL_DUTYCYCLE_CTRL_REQ, CPC_RX_APP_CNT_REQ, CPC_RX_APP_CNT_RESET_REQ, CPC_SWITCH_CLASS_REQ, CPC_TX_CW_REQ, CPC_TX_FRAMES_CTRL_REQ, and CPC_TX_PERIODICITY_CHANGE_REQ.
Referenced by cert_handle_cert_rx_data().
|
static |
References ERR_NONE, and RADIO_StopCW().
Referenced by enddevice_cpc_execute_command().
uint8_t appKey[16] |
Referenced by cert_set_join_parameters(), and enddevice_cpc_fresh_join().
uint8_t bandTable[] |
bool bTxCnf |
Referenced by cert_app_timer_callback(), cert_handle_cert_rx_data(), and enddevice_cpc_execute_command().
uint32_t certAppTimeout |
Referenced by cert_app_timer_callback(), cert_joindata_callback(), and enddevice_cpc_execute_command().
uint8_t certAppTimerId |
bool clear_linkcheck |
Referenced by cert_app_timer_callback().
IsmBand_t current_band |
Referenced by cert_select_band(), cert_set_join_parameters(), and enddevice_cpc_fresh_join().
uint8_t devEui[8] |
Referenced by cert_set_join_parameters(), and enddevice_cpc_fresh_join().
uint16_t downlinkCtr |
uint8_t joinEui[8] |
Referenced by cert_set_join_parameters(), and enddevice_cpc_fresh_join().
LorawanSendReq_t lorawanSendReq |
bool pktRxd |
Referenced by cert_app_timer_callback(), and cert_appdata_callback().
uint8_t sendData[100] |
uint16_t sendDataLen |
uint8_t sendFport |
Referenced by cert_app_timer_callback(), and enddevice_cpc_execute_command().
uint8_t testMode |
Referenced by cert_enter_test_mode(), and cert_handle_cert_rx_data().
uint8_t tx_cw_timer |
Referenced by cert_app_init(), and enddevice_cpc_execute_command().
TransmissionType_t txType |
uint8_t uplinkTestNoResp |
Referenced by cert_appdata_callback(), cert_enter_test_mode(), and cert_handle_cert_rx_data().