BusBricks: arduinoMocking Namespace Reference
BusBricks  0.1
Customize bus-communication
Loading...
Searching...
No Matches
arduinoMocking Namespace Reference

Provides mock implementations of Arduino framework functions and classes for native builds. More...

Classes

class  MockSerial
 Simulates Arduino's Serial class for testing purposes. More...
 
class  MockTime
 Simulates Arduino's time functions for testing purposes. More...
 
class  SoftwareSerial
 Mock class to simulate the SoftwareSerial library for native builds. More...
 

Typedefs

typedef std::string String
 Alias for std::string to simulate Arduino's String type.
 

Functions

void pinMode (int pin, int mode)
 Simulates the pinMode function for setting pin modes.
 
unsigned long millis ()
 Simulates the millis function to get the number of milliseconds since the program started.
 
unsigned long micros ()
 Simulates the micros function to get the number of microseconds since the program started.
 

Variables

MockTime mockedTimer
 
MockSerial Serial
 Global instance of MockSerial to mimic Arduino's Serial object.
 

Detailed Description

Provides mock implementations of Arduino framework functions and classes for native builds.

Namespace to provide mock implementations of Arduino framework classes for native builds.

Function Documentation

◆ micros()

unsigned long arduinoMocking::micros ( )

Simulates the micros function to get the number of microseconds since the program started.

Returns
The number of microseconds since the program started.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ millis()

unsigned long arduinoMocking::millis ( )

Simulates the millis function to get the number of milliseconds since the program started.

Returns
The number of milliseconds since the program started.
Here is the call graph for this function:

◆ pinMode()

void arduinoMocking::pinMode ( int pin,
int mode )

Simulates the pinMode function for setting pin modes.

This function is a placeholder for the Arduino pinMode function and does nothing in this mock implementation.

Parameters
pinThe pin number to configure.
modeThe mode to set for the pin (INPUT or OUTPUT).