C++ Pixels Library For Windows
Enable communications with Pixels dice using Bluetooth Low Energy.
Loading...
Searching...
No Matches
PixelInfo.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <string>
9#include <chrono>
11#include "PixelTypes.h"
12
13namespace Systemic::Pixels
14{
17
20 {
21 protected:
22 PixelInfo() = default;
23 virtual ~PixelInfo() = default;
24
25 public:
27 using Date = std::chrono::system_clock::time_point;
28
35 virtual bluetooth_address_t systemId() const = 0;
36
41 virtual bluetooth_address_t address() const = 0;
42
47 virtual pixel_id_t pixelId() const = 0;
48
53 virtual const std::wstring& name() const = 0;
54
59 virtual int ledCount() const = 0;
60
66
71 virtual Date firmwareDate() const = 0;
72
77 virtual int rssi() const = 0;
78
83 virtual int batteryLevel() const = 0;
84
90 virtual bool isCharging() const = 0;
91
96 virtual PixelRollState rollState() const = 0;
97
102 virtual int currentFace() const = 0;
103
109
115 };
116}
Common types used across the Systemic::BluetoothLE namespace.
Common types used across the Systemic::Pixel namespace.
Common accessible values between Pixel advertised data and a connected Pixel.
Definition: PixelInfo.h:20
std::chrono::system_clock::time_point Date
Type for a system Date.
Definition: PixelInfo.h:27
virtual bluetooth_address_t systemId() const =0
Gets the unique id assigned by the OS to Pixel Bluetooth peripheral.
DieType dieType()
Gets die type of the Pixel.
virtual int currentFace() const =0
Gets the Pixel face value that is currently facing up.
virtual Date firmwareDate() const =0
Gets the firmware build date of the Pixel.
virtual bool isCharging() const =0
Indicates whether the Pixel battery is charging or not. Set to 'true' if fully charged but still on c...
virtual const std::wstring & name() const =0
Gets the Pixel name.
virtual int rssi() const =0
Gets the last RSSI value measured by the Pixel.
virtual bluetooth_address_t address() const =0
Gets the Bluetooth address of the Pixel.
virtual PixelDesignAndColor designAndColor() const =0
Gets the design and color of the Pixel.
virtual PixelRollState rollState() const =0
Gets the Pixel roll state.
int dieFaceCount()
Gets the number of faces of the Pixel.
virtual int batteryLevel() const =0
Gets the Pixel battery level (percentage).
virtual pixel_id_t pixelId() const =0
Gets the unique Pixel id of the die.
virtual int ledCount() const =0
Gets the number of LEDs of the Pixel.
std::uint64_t bluetooth_address_t
Type for a Bluetooth address.
Definition: BleTypes.h:40
A collection of C++ classes and types to scan for and connect to Pixels dice.
Definition: Helpers.h:13
PixelRollState
Pixel roll states.
Definition: PixelTypes.h:45
PixelDesignAndColor
Available combinations of Pixel designs and colors.
Definition: PixelTypes.h:27
uint32_t pixel_id_t
Type for a Pixel Id.
Definition: PixelTypes.h:23
DieType
The different types of dice.
Definition: PixelTypes.h:87
Systemic::BluetoothLE::bluetooth_address_t bluetooth_address_t
Type for a Bluetooth address.
Definition: PixelInfo.h:16