Stima V4 Slave RAIN
4.2
|
CAN TASK cpp_freertos class. More...
#include <can_task.h>
Public Member Functions | |
CanTask (const char *taskName, uint16_t stackSize, uint8_t priority, CanParam_t canParam) | |
Construct the Can Task::CanTask object Main TASK && INIT TASK — UAVCAN. More... | |
Protected Member Functions | |
virtual void | Run () |
RUN Task. More... | |
Private Types | |
enum | State_t { CAN_STATE_CREATE , CAN_STATE_INIT , CAN_STATE_SETUP , CAN_STATE_CHECK } |
Enum for state switch of running method. More... | |
Private Member Functions | |
void | TaskWatchDog (uint32_t millis_standby) |
local watchDog and Sleep flag Task (optional) More... | |
void | TaskState (uint8_t state_position, uint8_t state_subposition, task_flag state_operation) |
local suspend flag and positor running state Task (optional) More... | |
Static Private Member Functions | |
static void | HW_CAN_Power (CAN_ModePower ModeCan) |
Enable Power CAN_Circuit TJA1443. More... | |
static void | getUniqueID (uint8_t out[uavcan_node_GetInfo_Response_1_0_unique_id_ARRAY_CAPACITY_], uint64_t serNumb) |
Ritorna unique-ID 128-bit del nodo locale. E' utilizzato in uavcan.node.GetInfo.Response e durante plug-and-play node-ID allocation da uavcan.pnp.NodeIDAllocationData. SerialNumber, Produttore.. Dovrebbe essere verificato in uavcan.node.GetInfo.Response per la verifica non sia cambiato Nodo. Al momento vengono inseriti 2 BYTE fissi, altri eventuali, che Identificano il Tipo Modulo. More... | |
static CanardPortID | getModeAccessID (uint8_t modeAccessID, const char *const port_name, const char *const type_name) |
Legge il subjectID per il modulo corrente per la risposta al servizio di gestione dati. More... | |
static bool | putFlashFile (const char *const file_name, const bool is_firmware, const bool rewrite, void *buf, size_t count) |
Scrive dati in append su Flash per scrittura sequenziale file data remoto. More... | |
static bool | getFlashFwInfoFile (uint8_t *module_type, uint8_t *version, uint8_t *revision, uint64_t *len) |
GetInfo for Firmware File on Flash. More... | |
static void | prepareSensorsDataValue (uint8_t const sensore, const report_t *report, rmap_module_Rain_1_0 *rmap_data) |
Prepara il blocco messaggio dati per il modulo corrente istantaneo NB: Aggiorno solo i dati fisici in questa funzione i metadati sono esterni. More... | |
static void | prepareSensorsDataValue (uint8_t const sensore, const report_t *report, rmap_service_module_Rain_Response_1_0 *rmap_data) |
static void | publish_rmap_data (canardClass &clsCanard, CanParam_t *param) |
Pubblica i dati RMAP con il metodo publisher se abilitato e configurato. More... | |
static void | processMessagePlugAndPlayNodeIDAllocation (canardClass &clsCanard, const uavcan_pnp_NodeIDAllocationData_1_0 *const msg) |
Plug and Play Slave, Versione 1.0 compatibile con CAN_CLASSIC MTU 8 Messaggi anonimi CAN non sono consentiti se messaggi > LUNGHEZZA MTU disponibile. More... | |
static uavcan_node_ExecuteCommand_Response_1_1 | processRequestExecuteCommand (canardClass &clsCanard, const uavcan_node_ExecuteCommand_Request_1_1 *req, uint8_t remote_node) |
Chiamate gestioni RPC remote da master (yakut o altro servizio di controllo) More... | |
static rmap_service_module_Rain_Response_1_0 | processRequestGetModuleData (canardClass &clsCanard, rmap_service_module_Rain_Request_1_0 *req, CanParam_t *param) |
Chiamate gestioni dati remote da master (yakut o altro servizio di controllo) More... | |
static uavcan_register_Access_Response_1_0 | processRequestRegisterAccess (const uavcan_register_Access_Request_1_0 *req) |
Accesso ai registri UAVCAN risposta a richieste. More... | |
static uavcan_node_GetInfo_Response_1_0 | processRequestNodeGetInfo () |
Risposta a uavcan.node.GetInfo which Info Node (nome, versione, uniqueID di verifica ecc...) More... | |
static void | processRequestUpdateRTC (canardClass &clsCanard, const uavcan_pnp_NodeIDAllocationData_1_0 *const msg) |
static void | processReceivedTransfer (canardClass &clsCanard, const CanardRxTransfer *const transfer, void *param) |
Canard CallBACK Receive message to Node (Solo con sottoscrizioni) More... | |
Private Attributes | |
State_t | state |
CanParam_t | param |
Static Private Attributes | |
static bootloader_t * | boot_state |
static EEprom * | localEeprom |
static cpp_freertos::Queue * | localSystemMessageQueue |
static uint16_t | last_req_rpt_time = (REPORTS_TIME_S) |
static uint16_t | last_req_obs_time = (OBSERVATIONS_TIME_S) |
static CAN_ModePower | canPower |
static STM32RTC & | rtc = STM32RTC::getInstance() |
static EERegister * | localRegister |
static cpp_freertos::BinarySemaphore * | localQspiLock |
static cpp_freertos::BinarySemaphore * | localRegisterAccessLock |
static Flash * | localFlash |
static uint64_t | canFlashPtr = 0 |
static uint16_t | canFlashBlock = 0 |
CAN TASK cpp_freertos class.
Definition at line 132 of file can_task.h.
|
private |
Enum for state switch of running method.
Enumerator | |
---|---|
CAN_STATE_CREATE | |
CAN_STATE_INIT | |
CAN_STATE_SETUP | |
CAN_STATE_CHECK |
Definition at line 135 of file can_task.h.
CanTask::CanTask | ( | const char * | taskName, |
uint16_t | stackSize, | ||
uint8_t | priority, | ||
CanParam_t | canParam | ||
) |
Construct the Can Task::CanTask object Main TASK && INIT TASK — UAVCAN.
taskName | name of the task |
stackSize | size of the stack |
priority | priority of the task |
canParam | parameters for the task |
Definition at line 1131 of file can_task.cpp.
|
staticprivate |
GetInfo for Firmware File on Flash.
module_type | type module of firmware |
version | version firmware |
revision | revision firmware |
len | length of file in bytes |
Definition at line 312 of file can_task.cpp.
|
staticprivate |
Legge il subjectID per il modulo corrente per la risposta al servizio di gestione dati.
modeAccessID | tipo di accesso |
port_name | nome porta uavcan |
type_name | tipo nome registro |
Definition at line 118 of file can_task.cpp.
|
staticprivate |
Ritorna unique-ID 128-bit del nodo locale. E' utilizzato in uavcan.node.GetInfo.Response e durante plug-and-play node-ID allocation da uavcan.pnp.NodeIDAllocationData. SerialNumber, Produttore.. Dovrebbe essere verificato in uavcan.node.GetInfo.Response per la verifica non sia cambiato Nodo. Al momento vengono inseriti 2 BYTE fissi, altri eventuali, che Identificano il Tipo Modulo.
out | data out UniqueID |
serNumb | local Hardware Serial Number (64Bit) Already Send in PNP 1.0 Request (Hash 48Bit) |
Definition at line 87 of file can_task.cpp.
|
staticprivate |
Enable Power CAN_Circuit TJA1443.
ModeCan | (Mode TYPE CAN_BUS) |
Definition at line 43 of file can_task.cpp.
|
staticprivate |
Prepara il blocco messaggio dati per il modulo corrente istantaneo NB: Aggiorno solo i dati fisici in questa funzione i metadati sono esterni.
sensore | tipo di sensore richiesto rmap class_canard di modulo |
report | report data |
rmap_data | report data module output value per modulo sensore specifico publish oppure in overload metodo tramite metodo Response applucapile al servizio request |
Definition at line 357 of file can_task.cpp.
|
staticprivate |
Definition at line 379 of file can_task.cpp.
|
staticprivate |
Plug and Play Slave, Versione 1.0 compatibile con CAN_CLASSIC MTU 8 Messaggi anonimi CAN non sono consentiti se messaggi > LUNGHEZZA MTU disponibile.
clCanard | classe |
msg | messaggio di pubblicazione |
Definition at line 471 of file can_task.cpp.
|
staticprivate |
Canard CallBACK Receive message to Node (Solo con sottoscrizioni)
clCanard | Classe |
transfer | Transfer CanardID |
param | Indirizzo di parametri esterni opzionali |
Definition at line 855 of file can_task.cpp.
|
staticprivate |
Chiamate gestioni RPC remote da master (yakut o altro servizio di controllo)
clCanard | Classe |
req | richiesta |
remote_node | nodo remoto |
Definition at line 506 of file can_task.cpp.
|
staticprivate |
Chiamate gestioni dati remote da master (yakut o altro servizio di controllo)
clCanard | Classe |
req | richiesta |
param | parametri CAN |
saturated uint3 get_istant = 0 Ritorna il dato come richiesto dal master
saturated uint3 test_acq = 7 (Solo x TEST)
NON Gestito, risposta error (undefined)
Definition at line 667 of file can_task.cpp.
|
staticprivate |
Risposta a uavcan.node.GetInfo which Info Node (nome, versione, uniqueID di verifica ecc...)
Definition at line 820 of file can_task.cpp.
|
staticprivate |
Accesso ai registri UAVCAN risposta a richieste.
req | Richiesta |
Definition at line 777 of file can_task.cpp.
|
staticprivate |
|
staticprivate |
Pubblica i dati RMAP con il metodo publisher se abilitato e configurato.
clCanard | classe |
param | parametri del modulo UAVCAN |
Definition at line 405 of file can_task.cpp.
|
staticprivate |
Scrive dati in append su Flash per scrittura sequenziale file data remoto.
file_name | nome del file UAVCAN |
is_firmware | true se il file +-รจ di tipo firmware |
rewrite | true se necessaria la riscrittura del file |
buf | blocco dati da scrivere in formato UAVCAN [256 Bytes] |
count | numero del blocco da scrivere in formato UAVCAN [Blocco x Buffer] |
Definition at line 187 of file can_task.cpp.
|
protectedvirtual |
RUN Task.
Definition at line 1294 of file can_task.cpp.
|
private |
local suspend flag and positor running state Task (optional)
state_position | Sw_Position (Local STATE) |
state_subposition | Sw_SubPosition (Optional Local SUB_STATE Position Monitor) |
state_operation | operative mode flag status for this task |
Definition at line 1279 of file can_task.cpp.
|
private |
local watchDog and Sleep flag Task (optional)
millis_standby | time in ms to perfor check of WDT. If longer than WDT Reset, WDT is temporanly suspend |
Definition at line 1254 of file can_task.cpp.
|
inlinestaticprivate |
Definition at line 176 of file can_task.h.
|
inlinestaticprivate |
Definition at line 189 of file can_task.h.
|
inlinestaticprivate |
Definition at line 188 of file can_task.h.
|
inlinestaticprivate |
Definition at line 181 of file can_task.h.
|
inlinestaticprivate |
Definition at line 180 of file can_task.h.
|
inlinestaticprivate |
Definition at line 179 of file can_task.h.
|
inlinestaticprivate |
Definition at line 177 of file can_task.h.
|
inlinestaticprivate |
Definition at line 187 of file can_task.h.
|
inlinestaticprivate |
Definition at line 185 of file can_task.h.
|
inlinestaticprivate |
Definition at line 184 of file can_task.h.
|
inlinestaticprivate |
Definition at line 186 of file can_task.h.
|
inlinestaticprivate |
Definition at line 178 of file can_task.h.
|
private |
Definition at line 173 of file can_task.h.
|
inlinestaticprivate |
Definition at line 182 of file can_task.h.
|
private |
Definition at line 172 of file can_task.h.