4.2.0.0R6
Software Development Kit
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
ltrx_stream.h File Reference

Definitions related to streams. More...

Data Structures

struct  input_stream
 Abstract reference to an input stream. More...
 
struct  input_stream_from_file
 Concrete struct for a file input stream. More...
 
struct  input_stream_from_open_abstract_socket
 Concrete struct for an abstract network protocol input stream. More...
 
struct  input_stream_from_open_tcp_socket
 Concrete struct for a tcp input stream. More...
 
struct  input_stream_from_routine
 Concrete struct for an abstract routine input stream. More...
 
struct  input_stream_from_uart
 Concrete struct for a Serial Line input stream. More...
 
struct  output_stream
 Abstract reference to an output stream. More...
 
struct  output_stream_from_open_tcp_socket
 Concrete struct for a tcp output stream. More...
 
struct  output_stream_to_buffer
 Concrete struct for a buffer output stream. More...
 
struct  output_stream_to_file
 Concrete struct for a file output stream. More...
 
struct  output_stream_to_open_abstract_socket
 Concrete struct for a network protocol output stream. More...
 
struct  output_stream_to_uart
 Concrete struct for a Serial Line output stream. More...
 

Enumerations

enum  output_stream_to_buffer_mode { OUTPUT_STREAM_TO_BUFFER_MODE__BINARY, OUTPUT_STREAM_TO_BUFFER_MODE__ZERO_TERMINATE }
 Mode of a buffer output stream. More...
 

Functions

void ltrx_cli_command_loop (struct input_stream *is, struct output_stream *os, const bool *isRunning, bool echoIsOn)
 Enters the command line loop. More...
 
void ltrx_input_stream_close (struct input_stream *inStream)
 Closes the input stream. More...
 
bool ltrx_input_stream_init_from_binary (struct input_stream_from_binary *inStream, const void *data, size_t length)
 Construct input stream from binary. More...
 
bool ltrx_input_stream_init_from_const_char (struct input_stream_from_const_char *inStream, const char *data)
 Construct input stream from const char. More...
 
bool ltrx_input_stream_init_from_file (struct input_stream_from_file *inStream, const char *fileName)
 Set up an input stream from a file. More...
 
bool ltrx_input_stream_init_from_open_abstract_socket (struct input_stream_from_open_abstract_socket *inStream, struct ltrx_ip_socket *lis, const struct ltrx_network_protocol *lnp, struct ltrx_network_protocol_handle *lnph)
 Construct input stream from an open socket. More...
 
bool ltrx_input_stream_init_from_open_tcp_socket (struct input_stream_from_open_tcp_socket *inStream, struct ltrx_ip_socket *lis)
 Construct input stream from an open TCP socket. More...
 
bool ltrx_input_stream_init_from_routine (struct input_stream_from_routine *inStream, const char *thread_name, uint32_t stack_size, void(*routine)(struct output_stream *os, void *opaque), void *opaque)
 Construct input stream from routine. More...
 
bool ltrx_input_stream_init_from_uart (struct input_stream_from_uart *inStream, unsigned int zeroBasedIndex)
 Set up an input stream from a Serial Line. More...
 
int ltrx_input_stream_peek (struct input_stream *inStream)
 Non-blocking peek. More...
 
int ltrx_input_stream_peek_with_block_time (struct input_stream *inStream, uint32_t blockTimeMsec)
 Blocking peek. More...
 
int ltrx_input_stream_read (struct input_stream *inStream)
 Blocking read from an input stream. More...
 
bool ltrx_output_stream_close (struct output_stream *outStream)
 Closes the output stream. More...
 
bool ltrx_output_stream_flush_data (struct output_stream *outStream)
 Forces any buffered data to be actually output. More...
 
bool ltrx_output_stream_from_input_stream (struct output_stream *outStream, struct input_stream *inStream)
 Writes output stream till disconnected, and closes input. More...
 
bool ltrx_output_stream_init_to_buffer (struct output_stream_to_buffer *outStream, void *buffer, size_t bufferLength, enum output_stream_to_buffer_mode mode)
 Set up an output stream to a RAM buffer. More...
 
bool ltrx_output_stream_init_to_count (struct output_stream_to_count *outStream)
 Set up an output stream to only count characters out. More...
 
bool ltrx_output_stream_init_to_file (struct output_stream_to_file *outStream, const char *fileName)
 Set up an output stream to a file. More...
 
bool ltrx_output_stream_init_to_open_abstract_socket (struct output_stream_to_open_abstract_socket *outStream, struct ltrx_ip_socket *lis, const struct ltrx_network_protocol *lnp, struct ltrx_network_protocol_handle *lnph)
 Set up an output stream to an open socket. More...
 
bool ltrx_output_stream_init_to_open_tcp_socket (struct output_stream_from_open_tcp_socket *outStream, struct ltrx_ip_socket *lis)
 Set up an output stream to an open TCP socket. More...
 
bool ltrx_output_stream_init_to_uart (struct output_stream_to_uart *outStream, unsigned int zeroBasedIndex)
 Set up an output stream to a Serial Line. More...
 
bool ltrx_output_stream_write_binary (struct output_stream *outStream, const void *data, size_t length)
 Writes binary data. More...
 
bool ltrx_output_stream_write_hexadecimal (struct output_stream *outStream, uint32_t value)
 Writes unsigned value as ASCII hexadecimal. More...
 
bool ltrx_output_stream_write_line (struct output_stream *outStream, const char *data)
 Writes data ending with newline. More...
 
bool ltrx_output_stream_write_unsigned (struct output_stream *outStream, uint32_t value)
 Writes unsigned value as ASCII decimal. More...
 
bool ltrx_output_stream_write_without_ending_line (struct output_stream *outStream, const char *data)
 Writes data without any newline. More...
 

Detailed Description

Definitions related to streams.

Function Documentation

bool ltrx_output_stream_init_to_buffer ( struct output_stream_to_buffer outStream,
void *  buffer,
size_t  bufferLength,
enum output_stream_to_buffer_mode  mode 
)

Set up an output stream to a RAM buffer.

Return values
trueSuccess.
falseFailed.
Parameters
[out]outStreamYour buffer output stream struct to initialize.
[in]bufferPointer to your buffer that will be written by the stream.
[in]bufferLengthLength of your buffer.
[in]modeSelected output mode.