OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
Loading...
Searching...
No Matches
openlcb_gridconnect.h
Go to the documentation of this file.
1
38#ifndef __OPENLCB_OPENLCB_GRIDCONNECT__
39#define __OPENLCB_OPENLCB_GRIDCONNECT__
40
41#include <stdbool.h>
42#include <stdint.h>
43
45
47#define GRIDCONNECT_STATE_SYNC_START 0
48
50#define GRIDCONNECT_STATE_SYNC_FIND_HEADER 2
51
53#define GRIDCONNECT_STATE_SYNC_FIND_DATA 4
54
56#define GRIDCONNECT_IDENTIFIER_START_POS 2
57
59#define GRIDCONNECT_IDENTIFIER_LEN 8
60
62#define GRIDCONNECT_NORMAL_FLAG_POS 10
63
65#define GRIDCONNECT_DATA_START_POS 11
66
68#define GRIDCONNECT_HEADER_LEN 12
69
71#define MAX_GRID_CONNECT_LEN 29
72
75
76#ifdef __cplusplus
77extern "C"
78{
79#endif /* __cplusplus */
80
92 extern bool OpenLcbGridConnect_copy_out_gridconnect_when_done(uint8_t next_byte, gridconnect_buffer_t *gridconnect_buffer);
93
102 extern void OpenLcbGridConnect_to_can_msg(gridconnect_buffer_t *gridconnect_buffer, can_msg_t *can_msg);
103
114 extern void OpenLcbGridConnect_from_can_msg(gridconnect_buffer_t *gridconnect_buffer, can_msg_t *can_msg);
115
116#ifdef __cplusplus
117}
118#endif /* __cplusplus */
119
120#endif /* __OPENLCB_OPENLCB_GRIDCONNECT__ */
Type definitions and constants for the CAN transport layer.
#define MAX_GRID_CONNECT_LEN
Max GridConnect string length: :X(8)N(16); + NUL = 29 bytes.
Definition openlcb_gridconnect.h:71
uint8_t gridconnect_buffer_t[MAX_GRID_CONNECT_LEN]
Type definition for GridConnect message buffer.
Definition openlcb_gridconnect.h:74
bool OpenLcbGridConnect_copy_out_gridconnect_when_done(uint8_t next_byte, gridconnect_buffer_t *gridconnect_buffer)
Feeds one byte into the streaming GridConnect parser.
Definition openlcb_gridconnect.c:121
void OpenLcbGridConnect_to_can_msg(gridconnect_buffer_t *gridconnect_buffer, can_msg_t *can_msg)
Converts a validated GridConnect string to a can_msg_t.
Definition openlcb_gridconnect.c:266
void OpenLcbGridConnect_from_can_msg(gridconnect_buffer_t *gridconnect_buffer, can_msg_t *can_msg)
Converts a can_msg_t to a null-terminated GridConnect string.
Definition openlcb_gridconnect.c:341
Definition can_types.h:118

Copyright (c) 2026 Jim Kueneman all rights reserved. See the License