Easyuino  1.2.0
Easyuino::Utilities Class Reference

Provides some auxiliary functions for internal use in library but at same time expose it to public for the library users. More...

#include <Utilities.h>

Static Public Member Functions

static void * EasyMalloc (IN unsigned int sizeInBytes)
 Wrapper around the stdlib.h malloc to make it safe of overflows in the the majority of common string manipulation cases and at same time zero's all the allocated memory too. More...
 
static void ZeroBuffer (IN void *buffer, IN size_t bufferSize)
 Fills a given buffer with zeros aka \0. More...
 
static void OverrideLastStringChar (IN char *string)
 Put a \0 in the last character of the string. More...
 
static void OverrideLastTwoChar (IN char *string)
 Put a \0 in the last two characters of the string. More...
 
static void ObtainI2CDeviceAddress (INOUT int *listOfAddresses, IN uint8_t sizeOfList)
 Obtain the addresses of all devices connected to Arduino using I2C. More...
 

Detailed Description

Provides some auxiliary functions for internal use in library but at same time expose it to public for the library users.

Member Function Documentation

◆ EasyMalloc()

static void* Easyuino::Utilities::EasyMalloc ( IN unsigned int  sizeInBytes)
static

Wrapper around the stdlib.h malloc to make it safe of overflows in the the majority of common string manipulation cases and at same time zero's all the allocated memory too.

Parameters
sizeInBytesAmount of bytes to be allocated
Returns
ptr Pointer to the first byte of the allocated memory

◆ ObtainI2CDeviceAddress()

static void Easyuino::Utilities::ObtainI2CDeviceAddress ( INOUT int *  listOfAddresses,
IN uint8_t  sizeOfList 
)
static

Obtain the addresses of all devices connected to Arduino using I2C.

It scans all the addresses to see if someone is on the other side. Based on http://playground.arduino.cc/Main/I2cScanner.

◆ OverrideLastStringChar()

static void Easyuino::Utilities::OverrideLastStringChar ( IN char *  string)
static

Put a \0 in the last character of the string.

Parameters
stringPointer to the string

◆ OverrideLastTwoChar()

static void Easyuino::Utilities::OverrideLastTwoChar ( IN char *  string)
static

Put a \0 in the last two characters of the string.

Parameters
stringPointer to the string

◆ ZeroBuffer()

static void Easyuino::Utilities::ZeroBuffer ( IN void *  buffer,
IN size_t  bufferSize 
)
static

Fills a given buffer with zeros aka \0.

Parameters
bufferPointer to the buffer
bufferSizeBuffer's size

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