NMEA2000 Library  0.1
Library to handle NMEA 2000 Communication written in C++
N2kStream Class Referenceabstract

Streaming Class to handle all Streams generated by the Library. More...

#include <N2kStream.h>

Public Member Functions

virtual int peek ()=0
 reads a byte from the file without advancing to the next one More...
 
size_t print (const char *str)
 Print string to stream. More...
 
size_t print (int val, uint8_t radix=10)
 Print an value to the stream. More...
 
size_t println (const char *str)
 Print string and newline to stream. More...
 
size_t println (int val, uint8_t radix=10)
 Print value and newline to stream. More...
 
virtual int read ()=0
 reads characters from an incoming stream to the buffer More...
 
virtual size_t write (const uint8_t *data, size_t size)=0
 Write data to stream. More...
 

Detailed Description

Streaming Class to handle all Streams generated by the Library.

Non Arduino platforms need to implement this class if they want to use functions which operate on streams.

Definition at line 60 of file N2kStream.h.

Member Function Documentation

◆ peek()

virtual int N2kStream::peek ( )
pure virtual

reads a byte from the file without advancing to the next one

Returns
int The next byte (or character), or -1 if none is available

◆ print() [1/2]

size_t N2kStream::print ( const char *  str)

Print string to stream.

Parameters
strString data for the stream
Returns
size_t

Definition at line 32 of file N2kStream.cpp.

◆ print() [2/2]

size_t N2kStream::print ( int  val,
uint8_t  radix = 10 
)

Print an value to the stream.

Parameters
valValue for the stream
radixBase format to be used (e.g. 10, 16, 8 ,2)
Returns
size_t

Definition at line 55 of file N2kStream.cpp.

◆ println() [1/2]

size_t N2kStream::println ( const char *  str)

Print string and newline to stream.

Parameters
strString data for the stream
Returns
size_t

Definition at line 75 of file N2kStream.cpp.

◆ println() [2/2]

size_t N2kStream::println ( int  val,
uint8_t  radix = 10 
)

Print value and newline to stream.

Parameters
valValue for the stream
radixBase format to be used (e.g. 10, 16, 8 ,2)
Returns
size_t

Definition at line 79 of file N2kStream.cpp.

◆ read()

virtual int N2kStream::read ( )
pure virtual

reads characters from an incoming stream to the buffer

Returns
The first byte of incoming data available (or -1 if no data is available)

◆ write()

virtual size_t N2kStream::write ( const uint8_t *  data,
size_t  size 
)
pure virtual

Write data to stream.

Parameters
datauint8 Array of Data for the stream
sizesize of the Data
Returns
size_t

The documentation for this class was generated from the following files: