35#ifndef _NRMANET_SIMPLENODEINFO_HXX_
36#define _NRMANET_SIMPLENODEINFO_HXX_
49 const char *user_description);
62 , responseFlow_(response_flow)
78 return release_and_exit();
79 if (node_ &&
nmsg()->dstNode != node_)
80 return release_and_exit();
81 return allocate_and_call(responseFlow_,
STATE(send_response_request));
84 Action send_response_request()
86 auto *b = get_allocation_result(responseFlow_);
88 responseFlow_->
send(b);
89 return release_and_exit();
#define STATE(_fn)
Turns a function name into an argument to be supplied to functions expecting a state.
void register_handler(HandlerType *handler, ID id, ID mask)
Adds a new handler to this dispatcher.
void unregister_handler(HandlerType *handler, ID id, ID mask)
Removes a specific instance of a handler from this dispatcher.
Base::Action Action
Allows using Action without having StateFlowBase:: prefix in front of it.
void send(MessageType *msg, unsigned priority=UINT_MAX) OVERRIDE
Sends a message to the state flow for processing.
Abstract class representing an OpenLCB Interface.
MessageDispatchFlow * dispatcher()
Base class for incoming message handler flows.
GenMessage * nmsg()
Returns the NMRAnet message we received.
Base class for NMRAnet nodes conforming to the asynchronous interface.
Handler for the Simple Node Information Protocol requests.
static const SimpleInfoDescriptor SNIP_RESPONSE[]
Defines the SNIP response fields.
static const SimpleInfoDescriptor SNIP_STATIC_RESPONSE[]
Defines the SNIP response fields without dynamic file.
Action entry() OVERRIDE
Entry into the StateFlow activity.
StateFlow for sending out medium-sized data payloads like the Simple Node Ident Info protocol.
#define OVERRIDE
Function attribute for virtual functions declaring that this funciton is overriding a funciton that s...
#define HASSERT(x)
Checks that the value of expression x is true, else terminates the current process.
const SimpleNodeStaticValues SNIP_STATIC_DATA
This static data will be exported as the first block of SNIP.
void decode_snip_response(const openlcb::Payload &payload, SnipDecodedData *output)
Takes an NMRANet SNIP repsonse message paylaod and splits it up into individual fields of the respons...
void init_snip_user_file(int fd, const char *user_name, const char *user_description)
Helper function for test nodes.
string Payload
Container that carries the data bytes in an NMRAnet message.
const char *const SNIP_DYNAMIC_FILENAME
The SNIP dynamic data will be read from this file.
The generic interface for NMRAnet network interfaces.
@ MTI_IDENT_INFO_REQUEST
request node identity
@ MTI_EXACT
match mask for a single MTI
This structure defines how to piece together a reply to a Simple Info request, sich as SNIP.
Holds the data we decoded from a SNIP response.
void clear()
Resets all entries to empty.
string hardware_version
SNIP response field.
string manufacturer_name
SNIP response field.
string user_description
SNIP response field.
string software_version
SNIP response field.
string user_name
SNIP response field.
string model_name
SNIP response field.