arduino-emulator
Loading...
Searching...
No Matches
arduino::HardwareSetupRemote Class Reference

Configures and manages remote hardware interfaces for Arduino emulation. More...

#include <HardwareSetupRemote.h>

Inheritance diagram for arduino::HardwareSetupRemote:
arduino::I2CSource arduino::SPISource arduino::GPIOSource

Public Member Functions

 HardwareSetupRemote ()=default
 default constructor: you need to call begin() afterwards
 HardwareSetupRemote (int port)
 HardwareSetup that uses udp.
 HardwareSetupRemote (Stream &stream)
 HardwareSetup uses the indicated stream.
void begin (bool asDefault=true)
 start with the default udp stream.
void begin (int port, bool asDefault)
 start with udp on the indicatd port
bool begin (Stream *s, bool asDefault=true, bool doHandShake=true)
 assigns the different protocols to the stream
void end ()
HardwareGPIO * getGPIO ()
HardwareI2C * getI2C ()
HardwareSPI * getSPI ()

Protected Member Functions

void handShake (Stream *s)

Protected Attributes

arduino::UDPStream default_stream
RemoteGPIO gpio
RemoteI2C i2c
bool is_default_objects_active = false
Stream * p_stream = nullptr
int port
RemoteSPI spi

Detailed Description

Configures and manages remote hardware interfaces for Arduino emulation.

This class is responsible for setting up and managing remote hardware APIs such as I2C, SPI, and GPIO over a network or stream interface. It provides mechanisms to assign protocol handlers to a communication stream, perform handshakes with remote devices, and manage the lifecycle of hardware connections.

Key features:

  • Supports initialization via a stream or UDP port.
  • Assigns remote protocol handlers (I2C, SPI, GPIO) to the provided stream.
  • Optionally sets up global protocol objects for use throughout the application.
  • Performs handshake with remote devices to ensure connectivity.
  • Provides accessors for the underlying protocol handler objects.
  • Manages cleanup and resource release on shutdown.

Usage:

  • Create an instance and call begin() with the desired configuration.
  • Use getI2C(), getSPI(), and getGPIO() to access protocol handlers.
  • Call end() to release resources when done.

Member Function Documentation

◆ getGPIO()

HardwareGPIO * arduino::HardwareSetupRemote::getGPIO ( )
inlinevirtual

Implements arduino::GPIOSource.

◆ getI2C()

HardwareI2C * arduino::HardwareSetupRemote::getI2C ( )
inlinevirtual

Implements arduino::I2CSource.

◆ getSPI()

HardwareSPI * arduino::HardwareSetupRemote::getSPI ( )
inlinevirtual

Implements arduino::SPISource.


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