17#ifndef VLCB_MODULE_STATE_CHANGE_TIMEOUT_MS
18#define VLCB_MODULE_STATE_CHANGE_TIMEOUT_MS 30000
28 if (addr != VLCB_NODE_ADDR_UNINITIALIZED) {
30 vlcb_net_pkt_dgram_module_ReleaseNodeNumber_Serialize(
31 &packet, (VlcbNetDgramReleaseNodeNumber){.addr = addr});
34 if (err != VLCB_NET_SOCK_ERR_OK) {
49 vlcb_net_pkt_dgram_module_RequestNodeNumber_Serialize(
50 &packet, (VlcbNetDgramRequestNodeNumber){.addr = setupData.
nodeAddr});
53 if (err != VLCB_NET_SOCK_ERR_OK) {
63 vlcb_net_pkt_dgram_module_ReleaseNodeNumber_Serialize(
65 (VlcbNetDgramReleaseNodeNumber){.addr = self->
config.nodeAddr});
68 if (err != VLCB_NET_SOCK_ERR_OK) {
73 VLCB_NODE_ADDR_UNINITIALIZED;
79 vlcb_net_pkt_dgram_module_NodeNumberAck_Serialize(
84 if (err != VLCB_NET_SOCK_ERR_OK) {
128 switch (currentState) {
132 .prevState = currentState,
133 .nodeAddr = VLCB_NODE_ADDR_UNINITIALIZED,
196 .prevState = currentState,
216 if (currentState != self->
sm.
state) {
#define _INTERFACE_CALL(o, m,...)
@ VLCB_MODULE_PERSISTED_STATE_UNINITIALIZED
@ VLCB_MODULE_PERSISTED_STATE_NORMAL
uint8_t VlcbModulePersistedState
VlcbNetSocketDgramSendErr vlcb_net_sock_dgram_Send(VlcbNetSocketDatagram *const sock, const VlcbNetPacketDatagram *const packet)
@ VLCB_MODULE_STATE_SETUP
@ VLCB_MODULE_STATE_UNINITIALIZED
@ VLCB_MODULE_STATE_NORMAL
static bool HandleTransitionToNormal(VlcbModule *const self)
static bool HandleTransitionToUninitialized(VlcbModule *const self)
void state_Dispatch(VlcbModule *const self, const ModuleStateEvent e, const clock_t now)
static bool HandleTransitionToSetup(VlcbModule *const self, VlcbModuleStateMachineSetupData setupData)
static bool CheckForSetupTimeout(VlcbModule *const self, const clock_t now)
#define VLCB_MODULE_STATE_CHANGE_TIMEOUT_MS
@ MSE_MODE_MSG_FOR_ANOTHER_MODULE
ModuleStateEventSignal sig
VlcbModulePersistedState state
VlcbNodeNumber nodeNumber
VlcbModuleState prevState
VlcbModuleStateMachineData data
VlcbModuleStateMachine sm
VlcbNetSocketDatagram *const socket
static double vlcb_platform_time_DiffInMs(const clock_t start, const clock_t end)
VlcbModuleStateMachineSetupData setup