|
| void | ProtocolSnip_initialize (const interface_openlcb_protocol_snip_t *interface_openlcb_protocol_snip) |
| | Stores the callback interface. Call once at startup.
|
| |
| void | ProtocolSnip_handle_simple_node_info_request (openlcb_statemachine_info_t *statemachine_info) |
| | Builds a SNIP reply (MTI 0x0A08) from node params + config memory.
|
| |
| void | ProtocolSnip_handle_simple_node_info_reply (openlcb_statemachine_info_t *statemachine_info) |
| | Handles an incoming SNIP reply (MTI 0x0A08). No automatic response.
|
| |
| uint16_t | ProtocolSnip_load_manufacturer_version_id (openlcb_node_t *openlcb_node, openlcb_msg_t *outgoing_msg, uint16_t offset, uint16_t requested_bytes) |
| | Copies manufacturer version ID byte (1 byte).
|
| |
| uint16_t | ProtocolSnip_load_name (openlcb_node_t *openlcb_node, openlcb_msg_t *outgoing_msg, uint16_t offset, uint16_t requested_bytes) |
| | Copies manufacturer name string (null-terminated).
|
| |
| uint16_t | ProtocolSnip_load_model (openlcb_node_t *openlcb_node, openlcb_msg_t *outgoing_msg, uint16_t offset, uint16_t requested_bytes) |
| | Copies model string (null-terminated).
|
| |
| uint16_t | ProtocolSnip_load_hardware_version (openlcb_node_t *openlcb_node, openlcb_msg_t *outgoing_msg, uint16_t offset, uint16_t requested_bytes) |
| | Copies hardware version string (null-terminated).
|
| |
| uint16_t | ProtocolSnip_load_software_version (openlcb_node_t *openlcb_node, openlcb_msg_t *outgoing_msg, uint16_t offset, uint16_t requested_bytes) |
| | Copies software version string (null-terminated).
|
| |
| uint16_t | ProtocolSnip_load_user_version_id (openlcb_node_t *openlcb_node, openlcb_msg_t *outgoing_msg, uint16_t offset, uint16_t requested_bytes) |
| | Copies user version ID byte (1 byte).
|
| |
| uint16_t | ProtocolSnip_load_user_name (openlcb_node_t *openlcb_node, openlcb_msg_t *outgoing_msg, uint16_t offset, uint16_t requested_bytes) |
| | Reads user name from config memory (null-terminated, max 63 bytes).
|
| |
| uint16_t | ProtocolSnip_load_user_description (openlcb_node_t *openlcb_node, openlcb_msg_t *outgoing_msg, uint16_t offset, uint16_t requested_bytes) |
| | Reads user description from config memory (null-terminated, max 64 bytes).
|
| |
| bool | ProtocolSnip_validate_snip_reply (openlcb_msg_t *snip_reply_msg) |
| | Validates a SNIP reply: correct MTI, valid length, exactly 6 null terminators.
|
| |
Simple Node Information Protocol (SNIP) handler.
- Copyright
- Copyright (c) 2024, Jim Kueneman All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Returns manufacturer info (from node params) and user name/description (from config memory) in a single reply message. Provides individual field loaders for assembling the SNIP payload and a validation function for incoming SNIP replies.
- Author
- Jim Kueneman
- Date
- 4 Mar 2026
Builds a SNIP reply (MTI 0x0A08) from node params + config memory.
Assembles eight fields: mfg version, name, model, HW ver, SW ver, user version, user name, user description. Max 253 bytes.
- Parameters
-
Builds a SNIP reply (MTI 0x0A08) from node params + config memory.
Algorithm:
- Prepare outgoing message header addressed to the requester
- Append 8 fields sequentially: mfg version, name, model, HW ver, SW ver, user version, user name, user description
- Mark outgoing message valid
* @param statemachine_info Context with the incoming SNIP request.
*