SparkFun Iridium 9604  v1.0.0
Library for the Iridium 9604 Hybrid LTE-M Cellular + Iridium Satellite (SBD) + GNSS IoT module
Loading...
Searching...
No Matches
SparkFun_Iridium_9604::IridiumDeviceBus Class Referenceabstract

The following abstract class is used as an interface for the platform-specific implementations. It replicates the methods of the GNSS v4 GNSSDeviceBus which are meaningful for a UART, and adds the UART-specific setBaudRate() - the Iridium 9604 library changes the baud rate during initialization (autobaud) and when setBaud() is called. More...

#include <sfe_bus.h>

Public Member Functions

virtual ~IridiumDeviceBus ()
 
virtual bool ping ()=0
 Check whether a device is present on this bus. More...
 
virtual uint16_t available ()=0
 Get the number of bytes currently available to read from this bus. More...
 
virtual size_t writeBytes (const uint8_t *data, size_t length)=0
 Write a block of bytes out over this bus. More...
 
virtual size_t readBytes (uint8_t *data, size_t length)=0
 Read a block of bytes in from this bus. Does not wait for data. More...
 
virtual bool setBaudRate (unsigned long baud)=0
 (Re)configure the UART baud rate. More...
 

Detailed Description

The following abstract class is used as an interface for the platform-specific implementations. It replicates the methods of the GNSS v4 GNSSDeviceBus which are meaningful for a UART, and adds the UART-specific setBaudRate() - the Iridium 9604 library changes the baud rate during initialization (autobaud) and when setBaud() is called.

Constructor & Destructor Documentation

◆ ~IridiumDeviceBus()

virtual SparkFun_Iridium_9604::IridiumDeviceBus::~IridiumDeviceBus ( )
inlinevirtual

Member Function Documentation

◆ available()

virtual uint16_t SparkFun_Iridium_9604::IridiumDeviceBus::available ( )
pure virtual

Get the number of bytes currently available to read from this bus.

Returns
Number of bytes available to read (0 if the bus has not been initialized).

◆ ping()

virtual bool SparkFun_Iridium_9604::IridiumDeviceBus::ping ( )
pure virtual

Check whether a device is present on this bus.

Not applicable for a UART: always returns false. Retained for compatibility with the GNSS v4 GNSSDeviceBus interface. Use DevIridium9604::at() to check the module is responding.

Returns
Always false.

◆ readBytes()

virtual size_t SparkFun_Iridium_9604::IridiumDeviceBus::readBytes ( uint8_t *  data,
size_t  length 
)
pure virtual

Read a block of bytes in from this bus. Does not wait for data.

Parameters
dataBuffer to receive the bytes read.
lengthMaximum number of bytes to read.
Returns
The number of bytes actually read.

◆ setBaudRate()

virtual bool SparkFun_Iridium_9604::IridiumDeviceBus::setBaudRate ( unsigned long  baud)
pure virtual

(Re)configure the UART baud rate.

Called by the library during begin() (to start the UART at the requested baud rate) and during autobaud / setBaud().

Parameters
baudThe baud rate.
Returns
true on success.

◆ writeBytes()

virtual size_t SparkFun_Iridium_9604::IridiumDeviceBus::writeBytes ( const uint8_t *  data,
size_t  length 
)
pure virtual

Write a block of bytes out over this bus.

Unlike GNSS v4, the length is a size_t: the Iridium library writes socket, file and MQTT payloads of up to 1024 bytes in a single call.

Parameters
dataPointer to the bytes to write.
lengthNumber of bytes to write.
Returns
The number of bytes actually written (0 on failure).

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