grblHAL core  20241107
io_stream_t Struct Reference

Properties and handlers for stream I/O. More...

#include <stream.h>

Data Fields

stream_type_t type
 Type of stream. More...
 
uint8_t instance
 Instance of stream type, starts from 0. More...
 
io_stream_state_t state
 Optional status flags such as connected status. More...
 
stream_is_connected_ptr is_connected
 Handler for getting stream connected status. More...
 
get_stream_buffer_count_ptr get_rx_buffer_free
 Handler for getting number of free characters in the input buffer. More...
 
stream_write_ptr write
 Handler for writing string to current output stream only. More...
 
stream_write_ptr write_all
 Handler for writing string to all active output streams. More...
 
stream_write_char_ptr write_char
 Handler for writing a single character to current stream only. More...
 
enqueue_realtime_command2_ptr enqueue_rt_command
 (Optional) handler for enqueueing a realtime command character. More...
 
stream_read_ptr read
 Handler for reading a single character from the input stream. More...
 
flush_stream_buffer_ptr reset_read_buffer
 Handler for flushing the input buffer. More...
 
cancel_read_buffer_ptr cancel_read_buffer
 Handler for flushing the input buffer and inserting an ASCII_CAN character. More...
 
set_enqueue_rt_handler_ptr set_enqueue_rt_handler
 Handler for setting the enqueue realtime command character handler. More...
 
suspend_read_ptr suspend_read
 Optional handler for saving away and restoring the current input buffer. More...
 
stream_write_n_ptr write_n
 Optional handler for writing n characters to current output stream only. Required for Modbus support. More...
 
disable_rx_stream_ptr disable_rx
 Optional handler for disabling/enabling a stream. Recommended? More...
 
get_stream_buffer_count_ptr get_rx_buffer_count
 Optional handler for getting number of characters in the input buffer. More...
 
get_stream_buffer_count_ptr get_tx_buffer_count
 Optional handler for getting number of characters in the output buffer(s). Count shall include any unsent characters in any transmit FIFO and/or transmit register. Required for Modbus support. More...
 
flush_stream_buffer_ptr reset_write_buffer
 Optional handler for flushing the output buffer. Any transmit FIFO shall be flushed as well. Required for Modbus support. More...
 
set_baud_rate_ptr set_baud_rate
 Optional handler for setting the stream baud rate. Required for Modbus support, recommended for Bluetooth support. More...
 
on_linestate_changed_ptr on_linestate_changed
 Optional handler to be called when line state changes. Set by client. More...
 
vfs_file_tfile
 File handle, non-null if streaming from a file. More...
 

Detailed Description

Properties and handlers for stream I/O.

Field Documentation

◆ cancel_read_buffer

cancel_read_buffer_ptr cancel_read_buffer

Handler for flushing the input buffer and inserting an ASCII_CAN character.

◆ disable_rx

Optional handler for disabling/enabling a stream. Recommended?

◆ enqueue_rt_command

enqueue_realtime_command2_ptr enqueue_rt_command

(Optional) handler for enqueueing a realtime command character.

◆ file

vfs_file_t* file

File handle, non-null if streaming from a file.

◆ get_rx_buffer_count

get_stream_buffer_count_ptr get_rx_buffer_count

Optional handler for getting number of characters in the input buffer.

◆ get_rx_buffer_free

get_stream_buffer_count_ptr get_rx_buffer_free

Handler for getting number of free characters in the input buffer.

◆ get_tx_buffer_count

get_stream_buffer_count_ptr get_tx_buffer_count

Optional handler for getting number of characters in the output buffer(s). Count shall include any unsent characters in any transmit FIFO and/or transmit register. Required for Modbus support.

◆ instance

uint8_t instance

Instance of stream type, starts from 0.

◆ is_connected

Handler for getting stream connected status.

◆ on_linestate_changed

on_linestate_changed_ptr on_linestate_changed

Optional handler to be called when line state changes. Set by client.

◆ read

Handler for reading a single character from the input stream.

◆ reset_read_buffer

flush_stream_buffer_ptr reset_read_buffer

Handler for flushing the input buffer.

◆ reset_write_buffer

flush_stream_buffer_ptr reset_write_buffer

Optional handler for flushing the output buffer. Any transmit FIFO shall be flushed as well. Required for Modbus support.

◆ set_baud_rate

set_baud_rate_ptr set_baud_rate

Optional handler for setting the stream baud rate. Required for Modbus support, recommended for Bluetooth support.

◆ set_enqueue_rt_handler

set_enqueue_rt_handler_ptr set_enqueue_rt_handler

Handler for setting the enqueue realtime command character handler.

◆ state

Optional status flags such as connected status.

◆ suspend_read

suspend_read_ptr suspend_read

Optional handler for saving away and restoring the current input buffer.

◆ type

Type of stream.

◆ write

Handler for writing string to current output stream only.

◆ write_all

stream_write_ptr write_all

Handler for writing string to all active output streams.

◆ write_char

Handler for writing a single character to current stream only.

◆ write_n

Optional handler for writing n characters to current output stream only. Required for Modbus support.


The documentation for this struct was generated from the following file: