VLCB SDK
An opinionated SDK for VLCB protocol
Loading...
Searching...
No Matches
module/inc/vlcb/module.h
Go to the documentation of this file.
1#pragma once
2
3#include "vlcb/common/node.h"
4#include "vlcb/module/param.h"
5#include "vlcb/module/state.h"
6#include "vlcb/module/ui.h"
7#include "vlcb/net/iface.h"
10#include <stdint.h>
11
12// typedef struct {
13// } VlcbServiceTrait;
14
15// typedef struct {
16// void *const self;
17// const VlcbServiceTrait *const tc;
18// } VlcbService;
19
20// typedef VlcbService *VlcbServiceHandle;
21//
22// typedef struct {
23// VlcbServiceHandle can;
24// VlcbServiceHandle event_producer;
25// VlcbServiceHandle event_consumer;
26// VlcbServiceHandle event_loopback;
27// VlcbServiceHandle event_ack;
28// VlcbServiceHandle event_teach;
29// VlcbServiceHandle nv;
30// } VlcbServiceMngr;
31
42
43typedef uint8_t VlcbModuleOpFlags;
48
55
56typedef void (*RestartRequestHandler)(void);
57
58typedef struct {
59 const char *const name;
64 IVlcbModuleUi ui;
67 // VlcbServiceMngr services;
71
72VlcbModule vlcb_module_New(const char *const name, VlcbNetIface *const iface,
73 VlcbNetSocketDatagram *const socket,
74 const IVlcbModuleUi ui,
75 VlcbModuleParams *const params,
77
78void vlcb_module_Init(VlcbModule *const module, const clock_t now);
79void vlcb_module_Poll(VlcbModule *const module, const clock_t now);
void vlcb_module_Init(VlcbModule *const module, const clock_t now)
Definition module.c:242
VlcbPersistedModuleState
@ VLCB_MODULE_PERSISTED_STATE_UNINITIALIZED
@ VLCB_MODULE_PERSISTED_STATE_NORMAL
uint8_t VlcbModulePersistedState
void vlcb_module_Poll(VlcbModule *const module, const clock_t now)
Definition module.c:249
@ VLCB_MODULE_FLAGS_HEARTBEAT
@ VLCB_MODULE_FLAGS_EVENT_ACK
VlcbModule vlcb_module_New(const char *const name, VlcbNetIface *const iface, VlcbNetSocketDatagram *const socket, const IVlcbModuleUi ui, VlcbModuleParams *const params, RestartRequestHandler reboot)
Definition module.c:219
void(* RestartRequestHandler)(void)
uint16_t VlcbNodeNumber
Definition node.h:8
VlcbModuleOpFlags operationFlags
VlcbModulePersistedState state
VlcbModuleStateMachine sm
RestartRequestHandler restart
const char *const name
VlcbNetIface *const iface
VlcbModuleParams *const params
VlcbModuleConfig config
VlcbNetSocketDatagram *const socket