20#ifndef VLCB_MODULE_HEARTBEAT_MS
21#define VLCB_MODULE_HEARTBEAT_MS 5000
34 vlcb_net_pkt_dgram_module_Heartbeat_Serialize(
35 &packet, (VlcbNetDgramHeartbeat){
62 vlcb_net_pkt_dgram_module_NodeParams_Serialize(
64 (VlcbNetDgramNodeParams){
159 VlcbNetDgramRestartNode request =
160 vlcb_net_pkt_dgram_module_RestartNode_Deserialize(packet);
169 switch (packet->
opc) {
221 const IVlcbModuleUi ui,
224 assert(iface != NULL && socket != NULL && params != NULL &&
225 restartHandler != NULL && name != NULL);
239 .restart = restartHandler};
243 assert(module != NULL);
250 assert(module != NULL && module->
iface != NULL);
@ VLCB_MODULE_FLAG_LEARN_MODE
@ VLCB_MODULE_PARAM_FLAGS
@ VLCB_MODULE_PARAM_NODE_VARIABLE_COUNT
@ VLCB_MODULE_PARAM_MINOR_VERSION
@ VLCB_MODULE_PARAM_MAX_EVENT_COUNT
@ VLCB_MODULE_PARAM_MODULE_TYPE
@ VLCB_MODULE_PARAM_MAJOR_VERSION
@ VLCB_MODULE_PARAM_EVENT_VARIABLE_COUNT
@ VLCB_MODULE_PARAM_MODULE_MANUFACTURER
#define _INTERFACE_CALL(o, m,...)
#define VLCBLOG_ERROR(msg)
#define VLCBLOG_INFO(msg)
@ VLCB_MODULE_FLAGS_HEARTBEAT
void(* RestartRequestHandler)(void)
static void HandleQueryNodeParameters(VlcbModule *const self)
void vlcb_module_Init(VlcbModule *const module, const clock_t now)
static void HandleMnsMessages(VlcbModule *const self, const VlcbNetPacketDatagram *const packet, clock_t now)
static void HandleRebootRequest(VlcbModule *const self, const VlcbNetPacketDatagram *const packet)
#define VLCB_MODULE_HEARTBEAT_MS
static void HandleHeartbeat(VlcbModule *const self, const clock_t now)
static void HandleQueryNodeInfo(VlcbModule *const self)
void vlcb_module_Poll(VlcbModule *const module, const clock_t now)
static void AbortSetup(VlcbModule *const self, clock_t now)
static void HandleQueryModuleName(VlcbModule *const self)
static void HandleQueryNodeParameterByIndex(VlcbModule *const self, const VlcbNetPacketDatagram *const packet)
static void HandleSetNodeNumber(VlcbModule *const self, const VlcbNetPacketDatagram *const packet)
VlcbModule vlcb_module_New(const char *const name, VlcbNetIface *const iface, VlcbNetSocketDatagram *const socket, const IVlcbModuleUi ui, VlcbModuleParams *const params, RestartRequestHandler restartHandler)
#define VLCB_NODE_NUMBER_UNINITIALIZED
VlcbModuleParam ModuleParamGetByte(const VlcbModuleParams *const params, const VlcbModuleParam param)
VlcbNetSocketDgramRecvErr vlcb_net_sock_dgram_Recv(VlcbNetSocketDatagram *const sock, VlcbNetPacketDatagram *const packet)
VlcbNetSocketDgramSendErr
@ VLCB_NET_SOCK_DGRAM_SEND_ERR_OK
@ VLCB_NET_SOCK_DGRAM_SEND_ERR_BUF_FULL
vlcb_error vlcb_net_sock_dgram_SendErrToStr(VlcbNetSocketDgramSendErr err)
VlcbNetSocketDgramSendErr vlcb_net_sock_dgram_Send(VlcbNetSocketDatagram *const sock, const VlcbNetPacketDatagram *const packet)
VlcbNetSocketDgramRecvErr
@ VLCB_NET_SOCK_DGRAM_RECV_ERR_WOULD_BLOCK
@ VLCB_NET_SOCK_DGRAM_RECV_ERR_OK
@ VLCB_MODULE_STATE_SETUP
@ VLCB_MODULE_STATE_UNINITIALIZED
@ VLCB_MODULE_STATE_NORMAL
void state_Dispatch(VlcbModule *const self, const ModuleStateEvent e, const clock_t now)
VlcbModuleOpFlags operationFlags
VlcbNodeNumber nodeNumber
VlcbModuleStateMachine sm
RestartRequestHandler restart
VlcbNetIface *const iface
VlcbModuleParams *const params
VlcbNetSocketDatagram *const socket
uint8_t heartbeatSequence
static double vlcb_platform_time_DiffInMs(const clock_t start, const clock_t end)
@ VLCB_OPC_QUERY_MODULE_INFO
@ VLCB_OPC_QUERY_MODULE_PARAMETERS
@ VLCB_OPC_REQUEST_NEW_NODE_NUMBER
@ VLCB_OPC_RESTART_ALL_NODES
@ VLCB_OPC_QUERY_NODE_PARAMETER_BY_INDEX
@ VLCB_OPC_SET_NODE_NUMBER
@ VLCB_OPC_QUERY_MODULE_NAME