Skip to content
Snippets Groups Projects
Commit 8216257c authored by Carlo Alessandro Nicolau's avatar Carlo Alessandro Nicolau
Browse files

Under development (backup commit)

parent 2d75620b
No related branches found
No related tags found
No related merge requests found
Showing
with 1175 additions and 200 deletions
......@@ -25,199 +25,142 @@ def voltage2channel_ADC(_voltage):
return adc_channel
DA FARE: definisci una f.ne per invertire (in modo da scrivere meno codice)
convert_chn2meas_DUL_BOARDTEMP
convert_meas2chn_DUL_BOARDTEMP
convert_chn2meas_TEMP2
convert_meas2chn_TEMP2
convert_chn2meas_TEMP1
convert_meas2chn_TEMP1
convert_chn2meas_VEOC_RTN_I
convert_meas2chn_VEOC_RTN_I
convert_chn2meas_VEOC_FWR_I
convert_meas2chn_VEOC_FWR_I
convert_chn2meas_HYDRO_I
convert_meas2chn_HYDRO_I
convert_chn2meas_INPUT_V
convert_meas2chn_INPUT_V
convert_chn2meas_LBL_I
convert_meas2chn_LBL_I
convert_chn2meas_GLRA_I
convert_meas2chn_GLRA_I
convert_chn2meas_GLRB_I
convert_meas2chn_GLRB_I
convert_chn2meas_PWB_I
convert_meas2chn_PWB_I
#
# def channel2current_MON_DU_I(_channel):
# """
# Converter from ADC channel to current for an ACS724 sensor
# According to formula in schematics:
# DU_I_MON Voltage Range:
# @ Ta=25C to 150C & VCC=4.5V ... 4.9V
# Vout=1.21V ... 1.36V @ 0A
# Vout=1.78V ... 1.99V @ 600mA
# Vout=4.03V ... 4.51V @ 3A
# DU_I_Mon(A)=[#ch @ (I_Actual) - #ch @ (0A)]/K
# @ Ta=25C K(max)=215.2; K(min)=194.7
# Recalculating using nominal component values (and ACS datasheet formula) @ VCC = 5V :
# Vadc = (89/33) * (0.5 + 0.4 * I)
# Thus:
# I = ((33/89) * Vadc - 0.5) / 0.4
# """
# return ((33. / 89.) * channel2voltage_ADC(_channel) - 0.5) / 0.4
#
#
# def current2channel_MON_DU_I(_current):
# """
# Converter from current to ADC channel for an ACS724 sensor
# see channel2current_MON_DU_I for comments
# """
# return voltage2channel_ADC((89. / 33.) * (0.5 + 0.4 * _current))
#
#
# def channel2voltage_MON_BPS_V(_channel):
# """
# Converter from ADC channel to voltage read on the BPS_V_MON (as defined in schematic, or MON_BPS_V, as defined in code)
# According to formulas in schematics:
# BPS_V_MON Voltage Range:
# ~ 3.05V @ 300V
# ~ 3.63V @ 360V
# ~ 3.73V @ 375V
# ~ 3.83V @ 380V
# """
# x0, y0 = voltage2channel_ADC(3.05), 300.
# x1, y1 = voltage2channel_ADC(3.83), 380.
# return linear_regression(x0, y0, x1, y1, _channel)
#
#
# def voltage2channel_MON_BPS_V(_voltage):
# """
# Converter from voltage read on the BPS_V_MON (as defined in schematic, or MON_BPS_V, as defined in code) to ADC channel
# see channel2voltage_MON_BPS_V for comments
# """
# x0, y0 = 300., voltage2channel_ADC(3.05)
# x1, y1 = 380., voltage2channel_ADC(3.83)
# return linear_regression(x0, y0, x1, y1, _voltage)
#
#
# def channel2current_MON_5V_I(_channel):
# """
# Converter from ADC channel to current on the 5V
# According to formulas in schematics:
# 5V_I_Mon Vout Range:
# ~ 0mV @ 0mA
# ~ 1.8V @ 3A
# ~ 5.0V @ 8.3A (Full Scale)
# Sens=8.13mA/count
# """
# x0, y0 = voltage2channel_ADC(0.), 0.
# x1, y1 = voltage2channel_ADC(0.5*5.), 0.5*8.3
# return linear_regression(x0, y0, x1, y1, _channel)
#
#
# def current2channel_MON_5V_I(_current):
# """
# Converter from current on the 5V to ADC channel
# see channel2current_MON_5V_I for comments
# """
# x0, y0 = 0., voltage2channel_ADC(0.)
# x1, y1 = 0.5* 8.3, voltage2channel_ADC(0.5 * 5.)
# return linear_regression(x0, y0, x1, y1, _current)
#
#
# def channel2current_12V(_channel):
# """
# Converter from ADC channel to current on one of the 12V lines
# LBL_I_Mon/HYDRO_I_Mon Vout Range:
# 1) @ Ta=-40C to 85C & VCC 3.2V ... 3.4V
# Vout=38mV ... 610mV @ 0mA
# Vout=3.23V ... 4.08V @ 800mA
# 2) @ Ta=25C & VCC 3.29V ... 3.31V
# Vout=206mV ... 370mV @ 0mA
# Vout=496mV ... 670mV @ 70mA
# Vout=3.52V ... 3.79V @ 800mA
# LBL_I_Mon(mA)=[#ch @ (I_Actual) - #ch @ (0mA)]*K
# @ Ta=25C K(max)=1.37; K(min)=1.15
# We assume data for T=25C
# """
# x0 = voltage2channel_ADC((0.206 + 0.370) / 2.)
# y0 = 0.
# x1 = voltage2channel_ADC((3.52 + 3.79) / 2.)
# y1 = 0.8
# return linear_regression(x0, y0, x1, y1, _channel)
#
#
# def current2channel_12V(_current):
# """
# Converter from current on one of the 12V lines to ADC channel
# see channel2current_12V for comments
# """
# x0 = 0.
# y0 = voltage2channel_ADC((0.206 + 0.370) / 2.)
# x1 = 0.8
# y1 = voltage2channel_ADC((3.52 + 3.79) / 2.)
# return linear_regression(x0, y0, x1, y1, _current)
#
#
# def channel2temperature_THEATSINK(_channel):
# """
# Converter from ADC channel to heatsink temperature
# To be done. For now just use ADC voltage conversion
# """
# return channel2voltage_ADC(_channel)
#
#
# def temperature2channel_THEATSINK(_temperature):
# """
# Converter from heatsink temperature to ADC channel
# To be done. For now just use ADC voltage conversion
# """
# return voltage2channel_ADC(_temperature)
#
#
# def channel2temperature_TBOARD(_channel):
# """
# Converter from ADC channel to heatsink temperature
# From schematics:
# DUL Board Temperature
# Sensor Voltage Range:
# ~ 1.0V @ 0C
# ~ 1.5V @ 25C
# ~ 3.0V @ 100C
# """
# x0 = voltage2channel_ADC(1.)
# y0 = 0.
# x1 = voltage2channel_ADC(3.)
# y1 = 100.
# return linear_regression(x0, y0, x1, y1, _channel)
#
#
# def temperature2channel_TBOARD(_temperature):
# """
# Converter from ADC channel to heatsink temperature
# see channel2temperature_TBOARD for comments
# """
# x0 = 0.
# y0 = voltage2channel_ADC(1.)
# x1 = 100.
# y1 = voltage2channel_ADC(3.)
# return linear_regression(x0, y0, x1, y1, _temperature)
def convert_chn2meas_DUL_BOARDTEMP(_chn):
# from Rocco's "mapping" doc (vers. 15.02.2021):
# ~ 1.5V @ 25C
# ~ 3.0V @ 100C
v = channel2voltage_ADC(_chn)
v0 = 1.5; meas0 = 25.; v1 = 3.0; meas1 = 100.
return linear_regression(v0, meas0, v1, meas1, v)
def convert_chn2meas_TEMP2(_chn):
# from Rocco's "mapping" doc (vers. 15.02.2021):
# ~ 0.7V@30C
# ~ 3.2V@100C
v = channel2voltage_ADC(_chn)
v0 = 0.7; meas0 = 30.; v1 = 3.2; meas1 = 100.
return linear_regression(v0, meas0, v1, meas1, v)
def convert_chn2meas_TEMP1(_chn):
# from Rocco's "mapping" doc (vers. 15.02.2021):
# same as TEMP2
return convert_chn2meas_TEMP2(_chn)
def convert_chn2meas_VEOC_RTN_I(_chn):
# from Rocco's "mapping" doc (vers. 15.02.2021):
# ~ 1.36V@0A
# ~ 4.51V@3A
v = channel2voltage_ADC(_chn)
v0 = 1.36; meas0 = 0.; v1 = 4.51; meas1 = 3.
return linear_regression(v0, meas0, v1, meas1, v)
def convert_chn2meas_VEOC_FWR_I(_chn):
# from Rocco's "mapping" doc (vers. 15.02.2021):
# same as VEOC_RTN_I
return convert_chn2meas_VEOC_RTN_I(_chn)
def convert_chn2meas_HYDRO_I(_chn):
# from Rocco's "mapping" doc (vers. 15.02.2021):
# ~ 0.45V@40mA
# ~ 4.5V@400mA
v = channel2voltage_ADC(_chn)
v0 = 0.45; meas0 = 0.040; v1 = 4.5; meas1 = 0.4
return linear_regression(v0, meas0, v1, meas1, v)
def convert_chn2meas_INPUT_V(_chn):
# from Rocco's "mapping" doc (vers. 15.02.2021):
# ~ 1,3V@260V
# ~ 2.0V@400V
v = channel2voltage_ADC(_chn)
v0 = 1.3; meas0 = 260.; v1 = 2.; meas1 = 400.
return linear_regression(v0, meas0, v1, meas1, v)
def convert_chn2meas_LBL_I(_chn):
# from Rocco's "mapping" doc (vers. 15.02.2021):
# ~ 0.45V@70mA
# ~ 4.5V@700mA
v = channel2voltage_ADC(_chn)
v0 = 0.45; meas0 = 0.070; v1 = 4.5; meas1 = 0.7
return linear_regression(v0, meas0, v1, meas1, v)
def convert_chn2meas_GLRA_I(_chn):
# from Rocco's "mapping" doc (vers. 15.02.2021):
# ~ 3.6V@5.3A
v = channel2voltage_ADC(_chn)
v0 = 0.; meas0 = 0.; v1 = 3.6; meas1 = 5.3
return linear_regression(v0, meas0, v1, meas1, v)
def convert_chn2meas_GLRB_I(_chn):
# from Rocco's "mapping" doc (vers. 15.02.2021):
# same as GLRA_I
return convert_chn2meas_GLRA_I(_chn)
def convert_chn2meas_PWB_I(_chn):
# from Rocco's "mapping" doc (vers. 15.02.2021):
# ~ 3.6V@2.6A
v = channel2voltage_ADC(_chn)
v0 = 0.; meas0 = 0.; v1 = 3.6; meas1 = 2.6
return linear_regression(v0, meas0, v1, meas1, v)
def __convert_maes2chn_invert_relation(_chn2meas, _meas):
meas0 = _chn2meas(100)
meas1 = _chn2meas(5000)
return linear_regression(meas0, 100, meas1, 5000, _meas)
def convert_meas2chn_DUL_BOARDTEMP(_meas):
return __convert_maes2chn_invert_relation(convert_chn2meas_DUL_BOARDTEMP, _meas)
def convert_meas2chn_TEMP2(_meas):
return __convert_maes2chn_invert_relation(convert_chn2meas_TEMP2, _meas)
def convert_meas2chn_TEMP1(_meas):
return __convert_maes2chn_invert_relation(convert_chn2meas_TEMP1, _meas)
def convert_meas2chn_VEOC_RTN_I(_meas):
return __convert_maes2chn_invert_relation(convert_chn2meas_VEOC_RTN_I, _meas)
def convert_meas2chn_VEOC_FWR_I(_meas):
return __convert_maes2chn_invert_relation(convert_chn2meas_VEOC_FWR_I, _meas)
def convert_meas2chn_HYDRO_I(_meas):
return __convert_maes2chn_invert_relation(convert_chn2meas_HYDRO_I, _meas)
def convert_meas2chn_INPUT_V(_meas):
return __convert_maes2chn_invert_relation(convert_chn2meas_INPUT_V, _meas)
def convert_meas2chn_LBL_I(_meas):
return __convert_maes2chn_invert_relation(convert_chn2meas_LBL_I, _meas)
def convert_meas2chn_GLRA_I(_meas):
return __convert_maes2chn_invert_relation(convert_chn2meas_GLRA_I, _meas)
def convert_meas2chn_GLRB_I(_meas):
return __convert_maes2chn_invert_relation(convert_chn2meas_GLRB_I, _meas)
def convert_meas2chn_PWB_I(_meas):
return __convert_maes2chn_invert_relation(convert_chn2meas_PWB_I, _meas)
class AnalogVariableList:
......@@ -396,7 +339,7 @@ class AnalogVariableList:
alarm_fast=AnalogAlarmDescriptor(
enum_index=alarm_enum_index+1,
enable_default=False,
threshold_default=0.80, # TODO
threshold_default=0.35, # TODO
timeout_default_ms=50. # TODO
)
)
......@@ -444,13 +387,13 @@ class AnalogVariableList:
alarm_slow=AnalogAlarmDescriptor(
enum_index=alarm_enum_index,
enable_default=False,
threshold_default=0.60, # TODO
threshold_default=0.50, # TODO
timeout_default_ms=100. # TODO
),
alarm_fast=AnalogAlarmDescriptor(
enum_index=alarm_enum_index+1,
enable_default=False,
threshold_default=0.90, # TODO
threshold_default=0.60, # TODO
timeout_default_ms=50. # TODO
)
)
......@@ -471,13 +414,13 @@ class AnalogVariableList:
alarm_slow=AnalogAlarmDescriptor(
enum_index=alarm_enum_index,
enable_default=False,
threshold_default=12.0, # TODO
threshold_default=6.0, # TODO
timeout_default_ms=100. # TODO
),
alarm_fast=AnalogAlarmDescriptor(
enum_index=alarm_enum_index+1,
enable_default=False,
threshold_default=12.0, # TODO
threshold_default=6.0, # TODO
timeout_default_ms=100. # TODO
)
)
......@@ -498,13 +441,13 @@ class AnalogVariableList:
alarm_slow=AnalogAlarmDescriptor(
enum_index=alarm_enum_index,
enable_default=False,
threshold_default=12.0, # TODO
threshold_default=6.0, # TODO
timeout_default_ms=100. # TODO
),
alarm_fast=AnalogAlarmDescriptor(
enum_index=alarm_enum_index+1,
enable_default=False,
threshold_default=12.0, # TODO
threshold_default=6.0, # TODO
timeout_default_ms=100. # TODO
)
)
......
// Auto-generated template file: alarm_callbacks.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "generated/sources/variables.h"
// Callback function for alarm on analog variable MON_DUL_BOARDTEMP (DUL board temperature sensor)
void alarm_MON_DUL_BOARDTEMP() {
// TODO implement auto-generated callback function alarm_MON_DUL_BOARDTEMP
}
// Callback function for alarm on analog variable MON_TEMP2 (VICOR2 Heatsink (connector J12) temperature sensor signal acquisition)
void alarm_MON_TEMP2() {
// TODO implement auto-generated callback function alarm_MON_TEMP2
}
// Callback function for alarm on analog variable MON_TEMP1 (VICOR1 Heatsink (connector J1) temperature sensor signal acquisition )
void alarm_MON_TEMP1() {
// TODO implement auto-generated callback function alarm_MON_TEMP1
}
// Callback function for alarm on analog variable MON_VEOC_RTN_I (DU backbone return current sensor signal acquisition )
void alarm_MON_VEOC_RTN_I() {
// TODO implement auto-generated callback function alarm_MON_VEOC_RTN_I
}
// Callback function for alarm on analog variable MON_VEOC_FWR_I (DU backbone forward current sensor signal acquisition )
void alarm_MON_VEOC_FWR_I() {
// TODO implement auto-generated callback function alarm_MON_VEOC_FWR_I
}
// Callback function for alarm on analog variable MON_HYDRO_I (HYDRO current sensor signal acquisition )
void alarm_MON_HYDRO_I() {
// TODO implement auto-generated callback function alarm_MON_HYDRO_I
}
// Callback function for alarm on analog variable MON_INPUT_V (Main Input Line voltage sensor signal acquisition )
void alarm_MON_INPUT_V() {
// TODO implement auto-generated callback function alarm_MON_INPUT_V
}
// Callback function for alarm on analog variable MON_LBL_I (LBL current sensor signal acquisition )
void alarm_MON_LBL_I() {
// TODO implement auto-generated callback function alarm_MON_LBL_I
}
// Callback function for alarm on analog variable MON_GLRA_I (GLENAIR-A current sensor signal acquisition)
void alarm_MON_GLRA_I() {
// TODO implement auto-generated callback function alarm_MON_GLRA_I
}
// Callback function for alarm on analog variable MON_GLRB_I (GLENAIR-B current sensor signal acquisition)
void alarm_MON_GLRB_I() {
// TODO implement auto-generated callback function alarm_MON_GLRB_I
}
// Callback function for alarm on analog variable MON_PWB_I (POWER BOARD current sensor signal acquisition)
void alarm_MON_PWB_I() {
// TODO implement auto-generated callback function alarm_MON_PWB_I
}
// Callback function for alarm on analog variable FLAG_DUL_ALARMPOS1 (DUL current limiting on VEOC direct alarm 1)
void alarm_FLAG_DUL_ALARMPOS1() {
// TODO implement auto-generated callback function alarm_FLAG_DUL_ALARMPOS1
}
// Callback function for alarm on analog variable FLAG_DUL_ALARMPOS2 (DUL current limiting on VEOC direct alarm 2)
void alarm_FLAG_DUL_ALARMPOS2() {
// TODO implement auto-generated callback function alarm_FLAG_DUL_ALARMPOS2
}
// Callback function for alarm on analog variable FLAG_DUL_ALARMNEG1 (DUL current limiting on VEOC return alarm 1)
void alarm_FLAG_DUL_ALARMNEG1() {
// TODO implement auto-generated callback function alarm_FLAG_DUL_ALARMNEG1
}
// Callback function for alarm on analog variable FLAG_DUL_ALARMNEG2 (DUL current limiting on VEOC return alarm 2)
void alarm_FLAG_DUL_ALARMNEG2() {
// TODO implement auto-generated callback function alarm_FLAG_DUL_ALARMNEG2
}
// Callback function for alarm on analog variable FLAG_HYDRO_PWR_FAULT (Fault status acquisition of 12V ISO HYDRO power line)
void alarm_FLAG_HYDRO_PWR_FAULT() {
// TODO implement auto-generated callback function alarm_FLAG_HYDRO_PWR_FAULT
}
// Callback function for alarm on analog variable FLAG_LBL_PWR_FAULT (Fault status acquisition of 12V ISO LBL power line)
void alarm_FLAG_LBL_PWR_FAULT() {
// TODO implement auto-generated callback function alarm_FLAG_LBL_PWR_FAULT
}
// Callback function for alarm on analog variable FLAG_GLRA_FAULT (Fault status acquisition of 12V GLENAIR-A power line)
void alarm_FLAG_GLRA_FAULT() {
// TODO implement auto-generated callback function alarm_FLAG_GLRA_FAULT
}
// Callback function for alarm on analog variable FLAG_GLRB_FAULT (Fault status acquisition of 12V GLENAIR-B power line)
void alarm_FLAG_GLRB_FAULT() {
// TODO implement auto-generated callback function alarm_FLAG_GLRB_FAULT
}
// Callback function for alarm on analog variable FLAG_POWERBOARD_FAULT (Fault status acquisition of 12V POWER BOARD power line)
void alarm_FLAG_POWERBOARD_FAULT() {
// TODO implement auto-generated callback function alarm_FLAG_POWERBOARD_FAULT
}
// Callback function for alarm on analog variable FLAG_GLRA_GOOD (Power good status acquisition of 12V GLENAIR-A power line)
void alarm_FLAG_GLRA_GOOD() {
// TODO implement auto-generated callback function alarm_FLAG_GLRA_GOOD
}
// Callback function for alarm on analog variable FLAG_GLRB_GOOD (Power good status acquisition of 12V GLENAIR-B power line)
void alarm_FLAG_GLRB_GOOD() {
// TODO implement auto-generated callback function alarm_FLAG_GLRB_GOOD
}
// Callback function for alarm on analog variable FLAG_POWERBOARD_GOOD (Power good status acquisition of 12V POWER BOARD power line)
void alarm_FLAG_POWERBOARD_GOOD() {
// TODO implement auto-generated callback function alarm_FLAG_POWERBOARD_GOOD
}
// Auto-generated template file: command_ALARM_ENABLE.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_ALARM_ENABLE(void) {
// Command: ALARM_ENABLE
// Description: Enable or disable one of the alarms. Can be used to get the current enable status without changing it (see request payload field)
//
// Request code: CMDCODE_ALARM_ENABLE_REQ
// Response code: CMDCODE_ALARM_ENABLE_REQ
// Request payload (length in bytes is 2):
// field #0 (1 byte) [type: enum_alarm_number_t] : ALARM_NUMBER (Alarm number)
// field #1 (1 byte) [type: enum_enablestate_nc_t] : ENABLESTATE_NC (Enable state)
// Response payload (length in bytes is 2):
// field #0 (1 byte) [type: enum_alarm_number_t] : ALARM_NUMBER (Alarm number)
// field #1 (1 byte) [type: enum_enablestate_t] : ENABLESTATE (Enable state)
// Auto-generated section: request payload fields reading
enum_alarm_number_t req_alarm_number = (enum_alarm_number_t)communication_request_payload_retrieve_uint8_t();
enum_enablestate_nc_t req_enablestate_nc = (enum_enablestate_nc_t)communication_request_payload_retrieve_uint8_t();
// checking range for enum field req_alarm_number
if((uint8_t)req_alarm_number < (uint8_t)enum_alarm_number_t_min) return ERR_RANGE;
if((uint8_t)req_alarm_number > (uint8_t)enum_alarm_number_t_max) return ERR_RANGE;
// checking range for enum field req_enablestate_nc
if((uint8_t)req_enablestate_nc < (uint8_t)enum_enablestate_nc_t_min) return ERR_RANGE;
if((uint8_t)req_enablestate_nc > (uint8_t)enum_enablestate_nc_t_max) return ERR_RANGE;
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_ALARM_ENABLE
// TODO: assign response field ALARM_NUMBER in command ALARM_ENABLE callback
enum_alarm_number_t resp_alarm_number = -1;
// TODO: assign response field ENABLESTATE in command ALARM_ENABLE callback
enum_enablestate_t resp_enablestate = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint8_t((uint8_t)resp_alarm_number);
communication_response_payload_append_uint8_t((uint8_t)resp_enablestate);
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_ALARM_FIRECOUNT_GET.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_ALARM_FIRECOUNT_GET(void) {
// Command: ALARM_FIRECOUNT_GET
// Description: Get the current fire counter of one alarm
//
// Request code: CMDCODE_ALARM_FIRECOUNT_GET_REQ
// Response code: CMDCODE_ALARM_FIRECOUNT_GET_REQ
// Request payload (length in bytes is 1):
// field #0 (1 byte) [type: enum_alarm_number_t] : ALARM_NUMBER (Alarm number)
// Response payload (length in bytes is 3):
// field #0 (1 byte) [type: enum_alarm_number_t] : ALARM_NUMBER (Alarm number)
// field #1 (2 bytes) [type: uint16_t ] : FIRECOUNT (Fire count value)
// Auto-generated section: request payload fields reading
enum_alarm_number_t req_alarm_number = (enum_alarm_number_t)communication_request_payload_retrieve_uint8_t();
// checking range for enum field req_alarm_number
if((uint8_t)req_alarm_number < (uint8_t)enum_alarm_number_t_min) return ERR_RANGE;
if((uint8_t)req_alarm_number > (uint8_t)enum_alarm_number_t_max) return ERR_RANGE;
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_ALARM_FIRECOUNT_GET
// TODO: assign response field ALARM_NUMBER in command ALARM_FIRECOUNT_GET callback
enum_alarm_number_t resp_alarm_number = -1;
// TODO: assign response field FIRECOUNT in command ALARM_FIRECOUNT_GET callback
uint16_t resp_firecount = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint8_t((uint8_t)resp_alarm_number);
communication_response_payload_append_uint16_t((uint16_t)resp_firecount);
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_ALARM_FIRED_GET.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_ALARM_FIRED_GET(void) {
// Command: ALARM_FIRED_GET
// Description: Get the has-fired flag of one alarm (or all alarms OR-ed)
//
// Request code: CMDCODE_ALARM_FIRED_GET_REQ
// Response code: CMDCODE_ALARM_FIRED_GET_REQ
// Request payload (length in bytes is 1):
// field #0 (1 byte) [type: enum_alarm_number_ext_t] : ALARM_NUMBER_EXT (Alarm number)
// Response payload (length in bytes is 2):
// field #0 (1 byte) [type: enum_alarm_number_ext_t] : ALARM_NUMBER_EXT (Alarm number)
// field #1 (1 byte) [type: enum_firedstate_t] : FIREDSTATE (Fired state)
// Auto-generated section: request payload fields reading
enum_alarm_number_ext_t req_alarm_number_ext = (enum_alarm_number_ext_t)communication_request_payload_retrieve_uint8_t();
// checking range for enum field req_alarm_number_ext
if((uint8_t)req_alarm_number_ext < (uint8_t)enum_alarm_number_ext_t_min) return ERR_RANGE;
if((uint8_t)req_alarm_number_ext > (uint8_t)enum_alarm_number_ext_t_max) return ERR_RANGE;
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_ALARM_FIRED_GET
// TODO: assign response field ALARM_NUMBER_EXT in command ALARM_FIRED_GET callback
enum_alarm_number_ext_t resp_alarm_number_ext = -1;
// TODO: assign response field FIREDSTATE in command ALARM_FIRED_GET callback
enum_firedstate_t resp_firedstate = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint8_t((uint8_t)resp_alarm_number_ext);
communication_response_payload_append_uint8_t((uint8_t)resp_firedstate);
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_ALARM_FIRED_RESET.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_ALARM_FIRED_RESET(void) {
// Command: ALARM_FIRED_RESET
// Description: Reset the has-fired flag of one alarm (or all alarms)
//
// Request code: CMDCODE_ALARM_FIRED_RESET_REQ
// Response code: CMDCODE_ALARM_FIRED_RESET_REQ
// Request payload (length in bytes is 1):
// field #0 (1 byte) [type: enum_alarm_number_all_t] : ALARM_NUMBER_ALL (Alarm number)
// Response payload (length in bytes is 0):
// Auto-generated section: request payload fields reading
enum_alarm_number_all_t req_alarm_number_all = (enum_alarm_number_all_t)communication_request_payload_retrieve_uint8_t();
// checking range for enum field req_alarm_number_all
if((uint8_t)req_alarm_number_all < (uint8_t)enum_alarm_number_all_t_min) return ERR_RANGE;
if((uint8_t)req_alarm_number_all > (uint8_t)enum_alarm_number_all_t_max) return ERR_RANGE;
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_ALARM_FIRED_RESET
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_ALARM_MAXCOUNT_GET.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_ALARM_MAXCOUNT_GET(void) {
// Command: ALARM_MAXCOUNT_GET
// Description: Get the maximum counter value reached by one of the alarms (use command ALARM_MAXCOUNT_RESET to reset it to zero)
//
// Request code: CMDCODE_ALARM_MAXCOUNT_GET_REQ
// Response code: CMDCODE_ALARM_MAXCOUNT_GET_REQ
// Request payload (length in bytes is 1):
// field #0 (1 byte) [type: enum_alarm_number_t] : ALARM_NUMBER (Alarm number)
// Response payload (length in bytes is 3):
// field #0 (1 byte) [type: enum_alarm_number_t] : ALARM_NUMBER (Alarm number)
// field #1 (2 bytes) [type: uint16_t ] : MAXCOUNT (Max count value)
// Auto-generated section: request payload fields reading
enum_alarm_number_t req_alarm_number = (enum_alarm_number_t)communication_request_payload_retrieve_uint8_t();
// checking range for enum field req_alarm_number
if((uint8_t)req_alarm_number < (uint8_t)enum_alarm_number_t_min) return ERR_RANGE;
if((uint8_t)req_alarm_number > (uint8_t)enum_alarm_number_t_max) return ERR_RANGE;
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_ALARM_MAXCOUNT_GET
// TODO: assign response field ALARM_NUMBER in command ALARM_MAXCOUNT_GET callback
enum_alarm_number_t resp_alarm_number = -1;
// TODO: assign response field MAXCOUNT in command ALARM_MAXCOUNT_GET callback
uint16_t resp_maxcount = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint8_t((uint8_t)resp_alarm_number);
communication_response_payload_append_uint16_t((uint16_t)resp_maxcount);
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_ALARM_MAXCOUNT_RESET.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_ALARM_MAXCOUNT_RESET(void) {
// Command: ALARM_MAXCOUNT_RESET
// Description: Reset the maximum counter value of one alarm (or all alarms)
//
// Request code: CMDCODE_ALARM_MAXCOUNT_RESET_REQ
// Response code: CMDCODE_ALARM_MAXCOUNT_RESET_REQ
// Request payload (length in bytes is 1):
// field #0 (1 byte) [type: enum_alarm_number_all_t] : ALARM_NUMBER_ALL (Alarm number)
// Response payload (length in bytes is 0):
// Auto-generated section: request payload fields reading
enum_alarm_number_all_t req_alarm_number_all = (enum_alarm_number_all_t)communication_request_payload_retrieve_uint8_t();
// checking range for enum field req_alarm_number_all
if((uint8_t)req_alarm_number_all < (uint8_t)enum_alarm_number_all_t_min) return ERR_RANGE;
if((uint8_t)req_alarm_number_all > (uint8_t)enum_alarm_number_all_t_max) return ERR_RANGE;
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_ALARM_MAXCOUNT_RESET
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_ALARM_THRESHOLD_GET.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_ALARM_THRESHOLD_GET(void) {
// Command: ALARM_THRESHOLD_GET
// Description: Get the threshold value of one analog alarm
//
// Request code: CMDCODE_ALARM_THRESHOLD_GET_REQ
// Response code: CMDCODE_ALARM_THRESHOLD_GET_REQ
// Request payload (length in bytes is 1):
// field #0 (1 byte) [type: enum_alarm_number_analog_t] : ALARM_NUMBER_ANALOG (Alarm number)
// Response payload (length in bytes is 3):
// field #0 (1 byte) [type: enum_alarm_number_analog_t] : ALARM_NUMBER_ANALOG (Alarm number)
// field #1 (2 bytes) [type: uint16_t ] : THRESHOLD (Threshold value)
// Auto-generated section: request payload fields reading
enum_alarm_number_analog_t req_alarm_number_analog = (enum_alarm_number_analog_t)communication_request_payload_retrieve_uint8_t();
// checking range for enum field req_alarm_number_analog
if((uint8_t)req_alarm_number_analog < (uint8_t)enum_alarm_number_analog_t_min) return ERR_RANGE;
if((uint8_t)req_alarm_number_analog > (uint8_t)enum_alarm_number_analog_t_max) return ERR_RANGE;
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_ALARM_THRESHOLD_GET
// TODO: assign response field ALARM_NUMBER_ANALOG in command ALARM_THRESHOLD_GET callback
enum_alarm_number_analog_t resp_alarm_number_analog = -1;
// TODO: assign response field THRESHOLD in command ALARM_THRESHOLD_GET callback
uint16_t resp_threshold = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint8_t((uint8_t)resp_alarm_number_analog);
communication_response_payload_append_uint16_t((uint16_t)resp_threshold);
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_ALARM_THRESHOLD_SET.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_ALARM_THRESHOLD_SET(void) {
// Command: ALARM_THRESHOLD_SET
// Description: Set the threshold value of one analog alarm
//
// Request code: CMDCODE_ALARM_THRESHOLD_SET_REQ
// Response code: CMDCODE_ALARM_THRESHOLD_SET_REQ
// Request payload (length in bytes is 3):
// field #0 (1 byte) [type: enum_alarm_number_analog_t] : ALARM_NUMBER_ANALOG (Alarm number)
// field #1 (2 bytes) [type: uint16_t ] : THRESHOLD (Threshold value)
// Response payload (length in bytes is 0):
// Auto-generated section: request payload fields reading
enum_alarm_number_analog_t req_alarm_number_analog = (enum_alarm_number_analog_t)communication_request_payload_retrieve_uint8_t();
uint16_t req_threshold = (uint16_t)communication_request_payload_retrieve_uint16_t();
// checking range for enum field req_alarm_number_analog
if((uint8_t)req_alarm_number_analog < (uint8_t)enum_alarm_number_analog_t_min) return ERR_RANGE;
if((uint8_t)req_alarm_number_analog > (uint8_t)enum_alarm_number_analog_t_max) return ERR_RANGE;
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_ALARM_THRESHOLD_SET
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_ALARM_TIMEOUT_GET.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_ALARM_TIMEOUT_GET(void) {
// Command: ALARM_TIMEOUT_GET
// Description: Get the timeout value of one alarm
//
// Request code: CMDCODE_ALARM_TIMEOUT_GET_REQ
// Response code: CMDCODE_ALARM_TIMEOUT_GET_REQ
// Request payload (length in bytes is 1):
// field #0 (1 byte) [type: enum_alarm_number_t] : ALARM_NUMBER (Alarm number)
// Response payload (length in bytes is 3):
// field #0 (1 byte) [type: enum_alarm_number_t] : ALARM_NUMBER (Alarm number)
// field #1 (2 bytes) [type: uint16_t ] : TIMEOUT (Timeout value)
// Auto-generated section: request payload fields reading
enum_alarm_number_t req_alarm_number = (enum_alarm_number_t)communication_request_payload_retrieve_uint8_t();
// checking range for enum field req_alarm_number
if((uint8_t)req_alarm_number < (uint8_t)enum_alarm_number_t_min) return ERR_RANGE;
if((uint8_t)req_alarm_number > (uint8_t)enum_alarm_number_t_max) return ERR_RANGE;
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_ALARM_TIMEOUT_GET
// TODO: assign response field ALARM_NUMBER in command ALARM_TIMEOUT_GET callback
enum_alarm_number_t resp_alarm_number = -1;
// TODO: assign response field TIMEOUT in command ALARM_TIMEOUT_GET callback
uint16_t resp_timeout = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint8_t((uint8_t)resp_alarm_number);
communication_response_payload_append_uint16_t((uint16_t)resp_timeout);
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_ALARM_TIMEOUT_SET.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_ALARM_TIMEOUT_SET(void) {
// Command: ALARM_TIMEOUT_SET
// Description: Set the timeout of one alarm
//
// Request code: CMDCODE_ALARM_TIMEOUT_SET_REQ
// Response code: CMDCODE_ALARM_TIMEOUT_SET_REQ
// Request payload (length in bytes is 3):
// field #0 (1 byte) [type: enum_alarm_number_t] : ALARM_NUMBER (Alarm number)
// field #1 (2 bytes) [type: uint16_t ] : TIMEOUT (Timeout value)
// Response payload (length in bytes is 0):
// Auto-generated section: request payload fields reading
enum_alarm_number_t req_alarm_number = (enum_alarm_number_t)communication_request_payload_retrieve_uint8_t();
uint16_t req_timeout = (uint16_t)communication_request_payload_retrieve_uint16_t();
// checking range for enum field req_alarm_number
if((uint8_t)req_alarm_number < (uint8_t)enum_alarm_number_t_min) return ERR_RANGE;
if((uint8_t)req_alarm_number > (uint8_t)enum_alarm_number_t_max) return ERR_RANGE;
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_ALARM_TIMEOUT_SET
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_BOARDTIME.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_BOARDTIME(void) {
// Command: BOARDTIME
// Description: Time since last reset
//
// Request code: CMDCODE_BOARDTIME_REQ
// Response code: CMDCODE_BOARDTIME_REQ
// Request payload (length in bytes is 0):
// Response payload (length in bytes is 4):
// field #0 (4 bytes) [type: uint32_t ] : SECONDS (Seconds since reset)
// Auto-generated section: request payload fields reading
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_BOARDTIME
// TODO: assign response field SECONDS in command BOARDTIME callback
uint32_t resp_seconds = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint32_t((uint32_t)resp_seconds);
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_ECHO1.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_ECHO1(void) {
// Command: ECHO1
// Description: Echo (1 byte)
//
// Request code: CMDCODE_ECHO1_REQ
// Response code: CMDCODE_ECHO1_REQ
// Request payload (length in bytes is 1):
// field #0 (1 byte) [type: uint8_t ] : VALUE (Echoed byte)
// Response payload (length in bytes is 1):
// field #0 (1 byte) [type: uint8_t ] : VALUE (Echoed byte)
// Auto-generated section: request payload fields reading
uint8_t req_value = (uint8_t)communication_request_payload_retrieve_uint8_t();
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_ECHO1
// TODO: assign response field VALUE in command ECHO1 callback
uint8_t resp_value = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint8_t((uint8_t)resp_value);
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_ECHO32.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_ECHO32(void) {
// Command: ECHO32
// Description: Echo (32 bytes)
//
// Request code: CMDCODE_ECHO32_REQ
// Response code: CMDCODE_ECHO32_REQ
// Request payload (length in bytes is 32):
// field #0 (1 byte) [type: uint8_t ] : VALUE_0 (Echoed byte)
// field #1 (1 byte) [type: uint8_t ] : VALUE_1 (Echoed byte)
// field #2 (1 byte) [type: uint8_t ] : VALUE_2 (Echoed byte)
// field #3 (1 byte) [type: uint8_t ] : VALUE_3 (Echoed byte)
// field #4 (1 byte) [type: uint8_t ] : VALUE_4 (Echoed byte)
// field #5 (1 byte) [type: uint8_t ] : VALUE_5 (Echoed byte)
// field #6 (1 byte) [type: uint8_t ] : VALUE_6 (Echoed byte)
// field #7 (1 byte) [type: uint8_t ] : VALUE_7 (Echoed byte)
// field #8 (1 byte) [type: uint8_t ] : VALUE_8 (Echoed byte)
// field #9 (1 byte) [type: uint8_t ] : VALUE_9 (Echoed byte)
// field #10 (1 byte) [type: uint8_t ] : VALUE_10 (Echoed byte)
// field #11 (1 byte) [type: uint8_t ] : VALUE_11 (Echoed byte)
// field #12 (1 byte) [type: uint8_t ] : VALUE_12 (Echoed byte)
// field #13 (1 byte) [type: uint8_t ] : VALUE_13 (Echoed byte)
// field #14 (1 byte) [type: uint8_t ] : VALUE_14 (Echoed byte)
// field #15 (1 byte) [type: uint8_t ] : VALUE_15 (Echoed byte)
// field #16 (1 byte) [type: uint8_t ] : VALUE_16 (Echoed byte)
// field #17 (1 byte) [type: uint8_t ] : VALUE_17 (Echoed byte)
// field #18 (1 byte) [type: uint8_t ] : VALUE_18 (Echoed byte)
// field #19 (1 byte) [type: uint8_t ] : VALUE_19 (Echoed byte)
// field #20 (1 byte) [type: uint8_t ] : VALUE_20 (Echoed byte)
// field #21 (1 byte) [type: uint8_t ] : VALUE_21 (Echoed byte)
// field #22 (1 byte) [type: uint8_t ] : VALUE_22 (Echoed byte)
// field #23 (1 byte) [type: uint8_t ] : VALUE_23 (Echoed byte)
// field #24 (1 byte) [type: uint8_t ] : VALUE_24 (Echoed byte)
// field #25 (1 byte) [type: uint8_t ] : VALUE_25 (Echoed byte)
// field #26 (1 byte) [type: uint8_t ] : VALUE_26 (Echoed byte)
// field #27 (1 byte) [type: uint8_t ] : VALUE_27 (Echoed byte)
// field #28 (1 byte) [type: uint8_t ] : VALUE_28 (Echoed byte)
// field #29 (1 byte) [type: uint8_t ] : VALUE_29 (Echoed byte)
// field #30 (1 byte) [type: uint8_t ] : VALUE_30 (Echoed byte)
// field #31 (1 byte) [type: uint8_t ] : VALUE_31 (Echoed byte)
// Response payload (length in bytes is 32):
// field #0 (1 byte) [type: uint8_t ] : VALUE_0 (Echoed byte)
// field #1 (1 byte) [type: uint8_t ] : VALUE_1 (Echoed byte)
// field #2 (1 byte) [type: uint8_t ] : VALUE_2 (Echoed byte)
// field #3 (1 byte) [type: uint8_t ] : VALUE_3 (Echoed byte)
// field #4 (1 byte) [type: uint8_t ] : VALUE_4 (Echoed byte)
// field #5 (1 byte) [type: uint8_t ] : VALUE_5 (Echoed byte)
// field #6 (1 byte) [type: uint8_t ] : VALUE_6 (Echoed byte)
// field #7 (1 byte) [type: uint8_t ] : VALUE_7 (Echoed byte)
// field #8 (1 byte) [type: uint8_t ] : VALUE_8 (Echoed byte)
// field #9 (1 byte) [type: uint8_t ] : VALUE_9 (Echoed byte)
// field #10 (1 byte) [type: uint8_t ] : VALUE_10 (Echoed byte)
// field #11 (1 byte) [type: uint8_t ] : VALUE_11 (Echoed byte)
// field #12 (1 byte) [type: uint8_t ] : VALUE_12 (Echoed byte)
// field #13 (1 byte) [type: uint8_t ] : VALUE_13 (Echoed byte)
// field #14 (1 byte) [type: uint8_t ] : VALUE_14 (Echoed byte)
// field #15 (1 byte) [type: uint8_t ] : VALUE_15 (Echoed byte)
// field #16 (1 byte) [type: uint8_t ] : VALUE_16 (Echoed byte)
// field #17 (1 byte) [type: uint8_t ] : VALUE_17 (Echoed byte)
// field #18 (1 byte) [type: uint8_t ] : VALUE_18 (Echoed byte)
// field #19 (1 byte) [type: uint8_t ] : VALUE_19 (Echoed byte)
// field #20 (1 byte) [type: uint8_t ] : VALUE_20 (Echoed byte)
// field #21 (1 byte) [type: uint8_t ] : VALUE_21 (Echoed byte)
// field #22 (1 byte) [type: uint8_t ] : VALUE_22 (Echoed byte)
// field #23 (1 byte) [type: uint8_t ] : VALUE_23 (Echoed byte)
// field #24 (1 byte) [type: uint8_t ] : VALUE_24 (Echoed byte)
// field #25 (1 byte) [type: uint8_t ] : VALUE_25 (Echoed byte)
// field #26 (1 byte) [type: uint8_t ] : VALUE_26 (Echoed byte)
// field #27 (1 byte) [type: uint8_t ] : VALUE_27 (Echoed byte)
// field #28 (1 byte) [type: uint8_t ] : VALUE_28 (Echoed byte)
// field #29 (1 byte) [type: uint8_t ] : VALUE_29 (Echoed byte)
// field #30 (1 byte) [type: uint8_t ] : VALUE_30 (Echoed byte)
// field #31 (1 byte) [type: uint8_t ] : VALUE_31 (Echoed byte)
// Auto-generated section: request payload fields reading
uint8_t req_value_0 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_1 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_2 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_3 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_4 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_5 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_6 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_7 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_8 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_9 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_10 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_11 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_12 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_13 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_14 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_15 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_16 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_17 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_18 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_19 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_20 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_21 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_22 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_23 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_24 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_25 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_26 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_27 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_28 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_29 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_30 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_31 = (uint8_t)communication_request_payload_retrieve_uint8_t();
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_ECHO32
// TODO: assign response field VALUE_0 in command ECHO32 callback
uint8_t resp_value_0 = -1;
// TODO: assign response field VALUE_1 in command ECHO32 callback
uint8_t resp_value_1 = -1;
// TODO: assign response field VALUE_2 in command ECHO32 callback
uint8_t resp_value_2 = -1;
// TODO: assign response field VALUE_3 in command ECHO32 callback
uint8_t resp_value_3 = -1;
// TODO: assign response field VALUE_4 in command ECHO32 callback
uint8_t resp_value_4 = -1;
// TODO: assign response field VALUE_5 in command ECHO32 callback
uint8_t resp_value_5 = -1;
// TODO: assign response field VALUE_6 in command ECHO32 callback
uint8_t resp_value_6 = -1;
// TODO: assign response field VALUE_7 in command ECHO32 callback
uint8_t resp_value_7 = -1;
// TODO: assign response field VALUE_8 in command ECHO32 callback
uint8_t resp_value_8 = -1;
// TODO: assign response field VALUE_9 in command ECHO32 callback
uint8_t resp_value_9 = -1;
// TODO: assign response field VALUE_10 in command ECHO32 callback
uint8_t resp_value_10 = -1;
// TODO: assign response field VALUE_11 in command ECHO32 callback
uint8_t resp_value_11 = -1;
// TODO: assign response field VALUE_12 in command ECHO32 callback
uint8_t resp_value_12 = -1;
// TODO: assign response field VALUE_13 in command ECHO32 callback
uint8_t resp_value_13 = -1;
// TODO: assign response field VALUE_14 in command ECHO32 callback
uint8_t resp_value_14 = -1;
// TODO: assign response field VALUE_15 in command ECHO32 callback
uint8_t resp_value_15 = -1;
// TODO: assign response field VALUE_16 in command ECHO32 callback
uint8_t resp_value_16 = -1;
// TODO: assign response field VALUE_17 in command ECHO32 callback
uint8_t resp_value_17 = -1;
// TODO: assign response field VALUE_18 in command ECHO32 callback
uint8_t resp_value_18 = -1;
// TODO: assign response field VALUE_19 in command ECHO32 callback
uint8_t resp_value_19 = -1;
// TODO: assign response field VALUE_20 in command ECHO32 callback
uint8_t resp_value_20 = -1;
// TODO: assign response field VALUE_21 in command ECHO32 callback
uint8_t resp_value_21 = -1;
// TODO: assign response field VALUE_22 in command ECHO32 callback
uint8_t resp_value_22 = -1;
// TODO: assign response field VALUE_23 in command ECHO32 callback
uint8_t resp_value_23 = -1;
// TODO: assign response field VALUE_24 in command ECHO32 callback
uint8_t resp_value_24 = -1;
// TODO: assign response field VALUE_25 in command ECHO32 callback
uint8_t resp_value_25 = -1;
// TODO: assign response field VALUE_26 in command ECHO32 callback
uint8_t resp_value_26 = -1;
// TODO: assign response field VALUE_27 in command ECHO32 callback
uint8_t resp_value_27 = -1;
// TODO: assign response field VALUE_28 in command ECHO32 callback
uint8_t resp_value_28 = -1;
// TODO: assign response field VALUE_29 in command ECHO32 callback
uint8_t resp_value_29 = -1;
// TODO: assign response field VALUE_30 in command ECHO32 callback
uint8_t resp_value_30 = -1;
// TODO: assign response field VALUE_31 in command ECHO32 callback
uint8_t resp_value_31 = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint8_t((uint8_t)resp_value_0);
communication_response_payload_append_uint8_t((uint8_t)resp_value_1);
communication_response_payload_append_uint8_t((uint8_t)resp_value_2);
communication_response_payload_append_uint8_t((uint8_t)resp_value_3);
communication_response_payload_append_uint8_t((uint8_t)resp_value_4);
communication_response_payload_append_uint8_t((uint8_t)resp_value_5);
communication_response_payload_append_uint8_t((uint8_t)resp_value_6);
communication_response_payload_append_uint8_t((uint8_t)resp_value_7);
communication_response_payload_append_uint8_t((uint8_t)resp_value_8);
communication_response_payload_append_uint8_t((uint8_t)resp_value_9);
communication_response_payload_append_uint8_t((uint8_t)resp_value_10);
communication_response_payload_append_uint8_t((uint8_t)resp_value_11);
communication_response_payload_append_uint8_t((uint8_t)resp_value_12);
communication_response_payload_append_uint8_t((uint8_t)resp_value_13);
communication_response_payload_append_uint8_t((uint8_t)resp_value_14);
communication_response_payload_append_uint8_t((uint8_t)resp_value_15);
communication_response_payload_append_uint8_t((uint8_t)resp_value_16);
communication_response_payload_append_uint8_t((uint8_t)resp_value_17);
communication_response_payload_append_uint8_t((uint8_t)resp_value_18);
communication_response_payload_append_uint8_t((uint8_t)resp_value_19);
communication_response_payload_append_uint8_t((uint8_t)resp_value_20);
communication_response_payload_append_uint8_t((uint8_t)resp_value_21);
communication_response_payload_append_uint8_t((uint8_t)resp_value_22);
communication_response_payload_append_uint8_t((uint8_t)resp_value_23);
communication_response_payload_append_uint8_t((uint8_t)resp_value_24);
communication_response_payload_append_uint8_t((uint8_t)resp_value_25);
communication_response_payload_append_uint8_t((uint8_t)resp_value_26);
communication_response_payload_append_uint8_t((uint8_t)resp_value_27);
communication_response_payload_append_uint8_t((uint8_t)resp_value_28);
communication_response_payload_append_uint8_t((uint8_t)resp_value_29);
communication_response_payload_append_uint8_t((uint8_t)resp_value_30);
communication_response_payload_append_uint8_t((uint8_t)resp_value_31);
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_ECHO4.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_ECHO4(void) {
// Command: ECHO4
// Description: Echo (4 bytes)
//
// Request code: CMDCODE_ECHO4_REQ
// Response code: CMDCODE_ECHO4_REQ
// Request payload (length in bytes is 4):
// field #0 (1 byte) [type: uint8_t ] : VALUE_0 (Echoed byte)
// field #1 (1 byte) [type: uint8_t ] : VALUE_1 (Echoed byte)
// field #2 (1 byte) [type: uint8_t ] : VALUE_2 (Echoed byte)
// field #3 (1 byte) [type: uint8_t ] : VALUE_3 (Echoed byte)
// Response payload (length in bytes is 4):
// field #0 (1 byte) [type: uint8_t ] : VALUE_0 (Echoed byte)
// field #1 (1 byte) [type: uint8_t ] : VALUE_1 (Echoed byte)
// field #2 (1 byte) [type: uint8_t ] : VALUE_2 (Echoed byte)
// field #3 (1 byte) [type: uint8_t ] : VALUE_3 (Echoed byte)
// Auto-generated section: request payload fields reading
uint8_t req_value_0 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_1 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_2 = (uint8_t)communication_request_payload_retrieve_uint8_t();
uint8_t req_value_3 = (uint8_t)communication_request_payload_retrieve_uint8_t();
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_ECHO4
// TODO: assign response field VALUE_0 in command ECHO4 callback
uint8_t resp_value_0 = -1;
// TODO: assign response field VALUE_1 in command ECHO4 callback
uint8_t resp_value_1 = -1;
// TODO: assign response field VALUE_2 in command ECHO4 callback
uint8_t resp_value_2 = -1;
// TODO: assign response field VALUE_3 in command ECHO4 callback
uint8_t resp_value_3 = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint8_t((uint8_t)resp_value_0);
communication_response_payload_append_uint8_t((uint8_t)resp_value_1);
communication_response_payload_append_uint8_t((uint8_t)resp_value_2);
communication_response_payload_append_uint8_t((uint8_t)resp_value_3);
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_LASTCOMMANDTIME.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_LASTCOMMANDTIME(void) {
// Command: LASTCOMMANDTIME
// Description: Time since last command
//
// Request code: CMDCODE_LASTCOMMANDTIME_REQ
// Response code: CMDCODE_LASTCOMMANDTIME_REQ
// Request payload (length in bytes is 0):
// Response payload (length in bytes is 4):
// field #0 (4 bytes) [type: uint32_t ] : SECONDS (Seconds since last command)
// Auto-generated section: request payload fields reading
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_LASTCOMMANDTIME
// TODO: assign response field SECONDS in command LASTCOMMANDTIME callback
uint32_t resp_seconds = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint32_t((uint32_t)resp_seconds);
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_LASTERROR.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_LASTERROR(void) {
// Command: LASTERROR
// Description: Return the last occurred error, and reset it to NOERR value
//
// Request code: CMDCODE_LASTERROR_REQ
// Response code: CMDCODE_LASTERROR_REQ
// Request payload (length in bytes is 0):
// Response payload (length in bytes is 1):
// field #0 (1 byte) [type: uint8_t ] : ERRCODE (Error code)
// Auto-generated section: request payload fields reading
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_LASTERROR
// TODO: assign response field ERRCODE in command LASTERROR callback
uint8_t resp_errcode = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint8_t((uint8_t)resp_errcode);
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_RESCUE_ENABLE.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_RESCUE_ENABLE(void) {
// Command: RESCUE_ENABLE
// Description: Enable or disable auto-rescue (or read enable status)
//
// Request code: CMDCODE_RESCUE_ENABLE_REQ
// Response code: CMDCODE_RESCUE_ENABLE_REQ
// Request payload (length in bytes is 1):
// field #0 (1 byte) [type: enum_enablestate_nc_t] : ENABLESTATE_NC (Enable state)
// Response payload (length in bytes is 1):
// field #0 (1 byte) [type: enum_enablestate_t] : ENABLESTATE (Enable state)
// Auto-generated section: request payload fields reading
enum_enablestate_nc_t req_enablestate_nc = (enum_enablestate_nc_t)communication_request_payload_retrieve_uint8_t();
// checking range for enum field req_enablestate_nc
if((uint8_t)req_enablestate_nc < (uint8_t)enum_enablestate_nc_t_min) return ERR_RANGE;
if((uint8_t)req_enablestate_nc > (uint8_t)enum_enablestate_nc_t_max) return ERR_RANGE;
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_RESCUE_ENABLE
// TODO: assign response field ENABLESTATE in command RESCUE_ENABLE callback
enum_enablestate_t resp_enablestate = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint8_t((uint8_t)resp_enablestate);
return NOERR;
// End of auto-generated section
}
// Auto-generated template file: command_RESCUE_STATUS_GET.tpl.c
// Generation timestamp: 2021-05-28 16:22:48.444169
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
err_t command_RESCUE_STATUS_GET(void) {
// Command: RESCUE_STATUS_GET
// Description: Get the auto-rescue current status (fired or not)
//
// Request code: CMDCODE_RESCUE_STATUS_GET_REQ
// Response code: CMDCODE_RESCUE_STATUS_GET_REQ
// Request payload (length in bytes is 0):
// Response payload (length in bytes is 1):
// field #0 (1 byte) [type: enum_firedstate_t] : FIREDSTATE (Fired state)
// Auto-generated section: request payload fields reading
// End of auto-generated section
// USER CODE HERE
// TODO implement command callback function command_RESCUE_STATUS_GET
// TODO: assign response field FIREDSTATE in command RESCUE_STATUS_GET callback
enum_firedstate_t resp_firedstate = -1;
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint8_t((uint8_t)resp_firedstate);
return NOERR;
// End of auto-generated section
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment