OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
Loading...
Searching...
No Matches
Node Login State Machine States

CAN alias allocation sequence: CID → RID → AMD → Init Complete → Run. More...

Macros

#define RUNSTATE_INIT   0
 General boot initialization - sets Node ID as initial seed.
 
#define RUNSTATE_GENERATE_SEED   1
 Generate new 48-bit seed from previous seed (used after alias collision)
 
#define RUNSTATE_GENERATE_ALIAS   2
 Generate 12-bit alias from current seed using LFSR algorithm.
 
#define RUNSTATE_LOAD_CHECK_ID_07   3
 Send CID frame 7 with first 12 bits of 48-bit Node ID.
 
#define RUNSTATE_LOAD_CHECK_ID_06   4
 Send CID frame 6 with 2nd 12 bits of 48-bit Node ID.
 
#define RUNSTATE_LOAD_CHECK_ID_05   5
 Send CID frame 5 with 3rd 12 bits of 48-bit Node ID.
 
#define RUNSTATE_LOAD_CHECK_ID_04   6
 Send CID frame 4 with last 12 bits of 48-bit Node ID.
 
#define RUNSTATE_WAIT_200ms   7
 Wait 200ms for alias collision detection. An objection from another node could occur in this or the previous state, if they do then jump back to RUNSTATE_GENERATE_SEED to try again.
 
#define RUNSTATE_LOAD_RESERVE_ID   8
 Send Reserve ID (RID) frame to claim the alias.
 
#define RUNSTATE_LOAD_ALIAS_MAP_DEFINITION   9
 Send Alias Map Definition (AMD) frame, node becomes "Permitted".
 
#define RUNSTATE_LOAD_INITIALIZATION_COMPLETE   10
 Send Initialization Complete message, node becomes "Initialized".
 
#define RUNSTATE_LOAD_CONSUMER_EVENTS   11
 Broadcast all consumer event IDs that this node handles.
 
#define RUNSTATE_LOAD_PRODUCER_EVENTS   12
 Broadcast all producer event IDs that this node generates.
 
#define RUNSTATE_LOGIN_COMPLETE   13
 Callback to allow any startup messages to be sent.
 
#define RUNSTATE_RUN   14
 Normal operation mode - process messages from FIFO.
 

Detailed Description

CAN alias allocation sequence: CID → RID → AMD → Init Complete → Run.

Macro Definition Documentation

◆ RUNSTATE_INIT

#define RUNSTATE_INIT   0

General boot initialization - sets Node ID as initial seed.

◆ RUNSTATE_GENERATE_SEED

#define RUNSTATE_GENERATE_SEED   1

Generate new 48-bit seed from previous seed (used after alias collision)

◆ RUNSTATE_GENERATE_ALIAS

#define RUNSTATE_GENERATE_ALIAS   2

Generate 12-bit alias from current seed using LFSR algorithm.

◆ RUNSTATE_LOAD_CHECK_ID_07

#define RUNSTATE_LOAD_CHECK_ID_07   3

Send CID frame 7 with first 12 bits of 48-bit Node ID.

◆ RUNSTATE_LOAD_CHECK_ID_06

#define RUNSTATE_LOAD_CHECK_ID_06   4

Send CID frame 6 with 2nd 12 bits of 48-bit Node ID.

◆ RUNSTATE_LOAD_CHECK_ID_05

#define RUNSTATE_LOAD_CHECK_ID_05   5

Send CID frame 5 with 3rd 12 bits of 48-bit Node ID.

◆ RUNSTATE_LOAD_CHECK_ID_04

#define RUNSTATE_LOAD_CHECK_ID_04   6

Send CID frame 4 with last 12 bits of 48-bit Node ID.

◆ RUNSTATE_WAIT_200ms

#define RUNSTATE_WAIT_200ms   7

Wait 200ms for alias collision detection. An objection from another node could occur in this or the previous state, if they do then jump back to RUNSTATE_GENERATE_SEED to try again.

◆ RUNSTATE_LOAD_RESERVE_ID

#define RUNSTATE_LOAD_RESERVE_ID   8

Send Reserve ID (RID) frame to claim the alias.

◆ RUNSTATE_LOAD_ALIAS_MAP_DEFINITION

#define RUNSTATE_LOAD_ALIAS_MAP_DEFINITION   9

Send Alias Map Definition (AMD) frame, node becomes "Permitted".

◆ RUNSTATE_LOAD_INITIALIZATION_COMPLETE

#define RUNSTATE_LOAD_INITIALIZATION_COMPLETE   10

Send Initialization Complete message, node becomes "Initialized".

◆ RUNSTATE_LOAD_CONSUMER_EVENTS

#define RUNSTATE_LOAD_CONSUMER_EVENTS   11

Broadcast all consumer event IDs that this node handles.

◆ RUNSTATE_LOAD_PRODUCER_EVENTS

#define RUNSTATE_LOAD_PRODUCER_EVENTS   12

Broadcast all producer event IDs that this node generates.

◆ RUNSTATE_LOGIN_COMPLETE

#define RUNSTATE_LOGIN_COMPLETE   13

Callback to allow any startup messages to be sent.

◆ RUNSTATE_RUN

#define RUNSTATE_RUN   14

Normal operation mode - process messages from FIFO.


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