Skip to content
Snippets Groups Projects
commandstable.h 8.38 KiB
// Auto-generated file: commandstable.h
// Generation timestamp: 2021-06-21 19:42:34.864200

#ifndef _AUTOGENERATED_COMMANDSTABLE_H
#define _AUTOGENERATED_COMMANDSTABLE_H

# include "../../typedefs.h"

// number of defined commands
#define COMMANDS_COUNT 34

// make command table available to anyone including this file
extern command_info_t commands_info_table[COMMANDS_COUNT];

// Command codes
#define CMDCODE_SWITCH_CONTROL_REQ 64
#define CMDCODE_SWITCH_CONTROL_RESP 65
#define CMDCODE_ALARM_ENABLE_REQ 66
#define CMDCODE_ALARM_ENABLE_RESP 67
#define CMDCODE_ALARM_TIMEOUT_SET_REQ 68
#define CMDCODE_ALARM_TIMEOUT_SET_RESP 69
#define CMDCODE_ALARM_TIMEOUT_GET_REQ 70
#define CMDCODE_ALARM_TIMEOUT_GET_RESP 71
#define CMDCODE_ALARM_MAXCOUNT_GET_REQ 72
#define CMDCODE_ALARM_MAXCOUNT_GET_RESP 73
#define CMDCODE_ALARM_MAXCOUNT_RESET_REQ 74
#define CMDCODE_ALARM_MAXCOUNT_RESET_RESP 75
#define CMDCODE_ALARM_THRESHOLD_SET_REQ 76
#define CMDCODE_ALARM_THRESHOLD_SET_RESP 77
#define CMDCODE_ALARM_THRESHOLD_GET_REQ 78
#define CMDCODE_ALARM_THRESHOLD_GET_RESP 79
#define CMDCODE_ALARM_FIRED_GET_REQ 80
#define CMDCODE_ALARM_FIRED_GET_RESP 81
#define CMDCODE_ALARM_FIRED_RESET_REQ 82
#define CMDCODE_ALARM_FIRED_RESET_RESP 83
#define CMDCODE_ALARM_FIRECOUNT_GET_REQ 84
#define CMDCODE_ALARM_FIRECOUNT_GET_RESP 85
#define CMDCODE_SENSOR_GET_SINGLE_REQ 86
#define CMDCODE_SENSOR_GET_SINGLE_RESP 87
#define CMDCODE_SENSOR_MAXVALUE_RESET_REQ 88
#define CMDCODE_SENSOR_MAXVALUE_RESET_RESP 89
#define CMDCODE_SENSOR_VALUES_GETALL_REQ 90
#define CMDCODE_SENSOR_VALUES_GETALL_RESP 91
#define CMDCODE_SENSOR_AVERAGE_GETALL_REQ 92
#define CMDCODE_SENSOR_AVERAGE_GETALL_RESP 93
#define CMDCODE_SENSOR_OFFSETS_GETALL_REQ 94
#define CMDCODE_SENSOR_OFFSETS_GETALL_RESP 95
#define CMDCODE_SENSOR_MAXVALUES_GETALL_REQ 96
#define CMDCODE_SENSOR_MAXVALUES_GETALL_RESP 97
#define CMDCODE_SENSOR_AVERAGING_PRESCALER_SET_REQ 98
#define CMDCODE_SENSOR_AVERAGING_PRESCALER_SET_RESP 99
#define CMDCODE_SENSOR_AVERAGING_PRESCALER_GET_REQ 100
#define CMDCODE_SENSOR_AVERAGING_PRESCALER_GET_RESP 101
#define CMDCODE_BOARDTIME_REQ 102
#define CMDCODE_BOARDTIME_RESP 103
#define CMDCODE_LASTCOMMANDTIME_REQ 104
#define CMDCODE_LASTCOMMANDTIME_RESP 105
#define CMDCODE_VERSION_REQ 106
#define CMDCODE_VERSION_RESP 107
#define CMDCODE_LASTERROR_REQ 108
#define CMDCODE_LASTERROR_RESP 109
#define CMDCODE_RESCUE_ENABLE_REQ 110
#define CMDCODE_RESCUE_ENABLE_RESP 111
#define CMDCODE_RESCUE_STATUS_GET_REQ 112
#define CMDCODE_RESCUE_STATUS_GET_RESP 113
#define CMDCODE_RESCUE_STATUS_RESET_REQ 114
#define CMDCODE_RESCUE_STATUS_RESET_RESP 115
#define CMDCODE_RESCUE_TIMEOUT_SET_REQ 116
#define CMDCODE_RESCUE_TIMEOUT_SET_RESP 117
#define CMDCODE_RESCUE_TIMEOUT_GET_REQ 118
#define CMDCODE_RESCUE_TIMEOUT_GET_RESP 119
#define CMDCODE_USER_PIN_CONTROL_REQ 120
#define CMDCODE_USER_PIN_CONTROL_RESP 121
#define CMDCODE_ECHO1_REQ 122
#define CMDCODE_ECHO1_RESP 123
#define CMDCODE_ECHO4_REQ 124
#define CMDCODE_ECHO4_RESP 125
#define CMDCODE_ECHO32_REQ 126
#define CMDCODE_ECHO32_RESP 127
#define CMDCODE_VALCHECK_REQ 128
#define CMDCODE_VALCHECK_RESP 129
#define CMDCODE_INVALID_REQ 254
#define CMDCODE_INVALID_RESP 255

// Callback functions

// Callback for command SWITCH_CONTROL (request code: 64), Control one of the switches or enable lines of the board. Can be used to get the current switch status without changing it (see request payload field status)
err_t command_SWITCH_CONTROL(void);

// Callback for command ALARM_ENABLE (request code: 66), Enable or disable one of the alarms. Can be used to get the current enable status without changing it (see request payload field)
err_t command_ALARM_ENABLE(void);

// Callback for command ALARM_TIMEOUT_SET (request code: 68), Set the timeout of one alarm
err_t command_ALARM_TIMEOUT_SET(void);

// Callback for command ALARM_TIMEOUT_GET (request code: 70), Get the timeout value of one alarm
err_t command_ALARM_TIMEOUT_GET(void);

// Callback for command ALARM_MAXCOUNT_GET (request code: 72), Get the maximum counter value reached by one of the alarms (use command ALARM_MAXCOUNT_RESET to reset it to zero)
err_t command_ALARM_MAXCOUNT_GET(void);

// Callback for command ALARM_MAXCOUNT_RESET (request code: 74), Reset the maximum counter value of one alarm (or all alarms)
err_t command_ALARM_MAXCOUNT_RESET(void);

// Callback for command ALARM_THRESHOLD_SET (request code: 76), Set the threshold value of one analog alarm
err_t command_ALARM_THRESHOLD_SET(void);

// Callback for command ALARM_THRESHOLD_GET (request code: 78), Get the threshold value of one analog alarm
err_t command_ALARM_THRESHOLD_GET(void);

// Callback for command ALARM_FIRED_GET (request code: 80), Get the has-fired flag of one alarm (or all alarms OR-ed)
err_t command_ALARM_FIRED_GET(void);

// Callback for command ALARM_FIRED_RESET (request code: 82), Reset the has-fired flag of one alarm (or all alarms)
err_t command_ALARM_FIRED_RESET(void);

// Callback for command ALARM_FIRECOUNT_GET (request code: 84), Get the current fire counter of one alarm
err_t command_ALARM_FIRECOUNT_GET(void);

// Callback for command SENSOR_GET_SINGLE (request code: 86), Get one sensor's current value, offset value, max value, and mean value
err_t command_SENSOR_GET_SINGLE(void);

// Callback for command SENSOR_MAXVALUE_RESET (request code: 88), Reset the max value of one sensor (or all sensors)
err_t command_SENSOR_MAXVALUE_RESET(void);

// Callback for command SENSOR_VALUES_GETALL (request code: 90), Get all sensors' values
err_t command_SENSOR_VALUES_GETALL(void);

// Callback for command SENSOR_AVERAGE_GETALL (request code: 92), Get all sensors' mean values
err_t command_SENSOR_AVERAGE_GETALL(void);

// Callback for command SENSOR_OFFSETS_GETALL (request code: 94), Get all sensors' offsets
err_t command_SENSOR_OFFSETS_GETALL(void);

// Callback for command SENSOR_MAXVALUES_GETALL (request code: 96), Get all sensors' max values
err_t command_SENSOR_MAXVALUES_GETALL(void);

// Callback for command SENSOR_AVERAGING_PRESCALER_SET (request code: 98), Set the value of the prescaler used to compute sensors' averages
err_t command_SENSOR_AVERAGING_PRESCALER_SET(void);
// Callback for command SENSOR_AVERAGING_PRESCALER_GET (request code: 100), Get the value of the prescaler used to compute sensors' averages
err_t command_SENSOR_AVERAGING_PRESCALER_GET(void);

// Callback for command BOARDTIME (request code: 102), Time since last reset
err_t command_BOARDTIME(void);

// Callback for command LASTCOMMANDTIME (request code: 104), Time since last command
err_t command_LASTCOMMANDTIME(void);

// Callback for command VERSION (request code: 106), Report embedded code versioning information
err_t command_VERSION(void);

// Callback for command LASTERROR (request code: 108), Return the last occurred error, and reset it to NOERR value
err_t command_LASTERROR(void);

// Callback for command RESCUE_ENABLE (request code: 110), Enable or disable auto-rescue (or read enable status)
err_t command_RESCUE_ENABLE(void);

// Callback for command RESCUE_STATUS_GET (request code: 112), Get the auto-rescue current status (fired or not)
err_t command_RESCUE_STATUS_GET(void);

// Callback for command RESCUE_STATUS_RESET (request code: 114), Reset the auto-rescue current status
err_t command_RESCUE_STATUS_RESET(void);

// Callback for command RESCUE_TIMEOUT_SET (request code: 116), Set the auto-rescue timeout value
err_t command_RESCUE_TIMEOUT_SET(void);

// Callback for command RESCUE_TIMEOUT_GET (request code: 118), Get the auto-rescue timeout value
err_t command_RESCUE_TIMEOUT_GET(void);

// Callback for command USER_PIN_CONTROL (request code: 120), Control one user pin
err_t command_USER_PIN_CONTROL(void);

// Callback for command ECHO1 (request code: 122), Echo (1 byte)
err_t command_ECHO1(void);

// Callback for command ECHO4 (request code: 124), Echo (4 bytes)
err_t command_ECHO4(void);

// Callback for command ECHO32 (request code: 126), Echo (32 bytes)
err_t command_ECHO32(void);

// Callback for command VALCHECK (request code: 128), Return a some data to check endianness
err_t command_VALCHECK(void);

// Callback for command INVALID (request code: 254), Invalid command (used in firmware, not implemented)
err_t command_INVALID(void);

// Versioning data
#define COMMAND_TABLE_VERSION_NUM 34
#define TEMPLATE_GENERATION_YEAR 2021
#define TEMPLATE_GENERATION_MONTH 6
#define TEMPLATE_GENERATION_DAY 21
#define TEMPLATE_GENERATION_HOUR 19
#define TEMPLATE_GENERATION_MINUTE 42
#define TEMPLATE_GENERATION_SECOND 34


#endif // _AUTOGENERATED_COMMANDSTABLE_H