C++ Pixels Library For Windows
Enable communications with Pixels dice using Bluetooth Low Energy.
Loading...
Searching...
No Matches
Helpers.h File Reference

Some helper functions for Pixels. More...

#include <cstdint>
#include <chrono>
#include "PixelTypes.h"
Include dependency graph for Helpers.h:

Go to the source code of this file.

Namespaces

namespace  Systemic::Pixels
 A collection of C++ classes and types to scan for and connect to Pixels dice.
 

Functions

DieType Systemic::Pixels::Helpers::getDieType (int ledCount)
 Returns the die type based on the number of LEDs. More...
 
int Systemic::Pixels::Helpers::getFaceCount (DieType dieType)
 Returns the number of faces based on the die type. More...
 
bool Systemic::Pixels::Helpers::isPixelChargingOrDone (PixelBatteryState batteryState)
 
std::chrono::system_clock::time_point Systemic::Pixels::Helpers::getFirmwareDate (uint32_t buildTimestamp)
 Converts a UNIX timestamp in seconds to a time_point. Use this function to get the date of a Pixels firmware from its timestamp. More...
 

Detailed Description

Some helper functions for Pixels.

Function Documentation

◆ getDieType()

DieType Systemic::Pixels::Helpers::getDieType ( int  ledCount)

Returns the die type based on the number of LEDs.

Parameters
ledCountNumber of LEDs on Pixels die.
Returns
The die type for the given number of LEDs.

◆ getFaceCount()

int Systemic::Pixels::Helpers::getFaceCount ( DieType  dieType)

Returns the number of faces based on the die type.

Parameters
dieTypeThe Pixels die type.
Returns
The number of faces for the given die type.

◆ getFirmwareDate()

std::chrono::system_clock::time_point Systemic::Pixels::Helpers::getFirmwareDate ( uint32_t  buildTimestamp)

Converts a UNIX timestamp in seconds to a time_point. Use this function to get the date of a Pixels firmware from its timestamp.

Parameters
buildTimestampUNIX timestamp in seconds.
Returns
The time_point value for the given timestamp.

◆ isPixelChargingOrDone()

bool Systemic::Pixels::Helpers::isPixelChargingOrDone ( PixelBatteryState  batteryState)
Parameters
batteryState
Returns