-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
149 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef BOARDINFO_HPP | ||
#define BOARDINFO_HPP | ||
|
||
#include "Machine.hpp" | ||
|
||
struct BoardInfo | ||
{ | ||
bool server_connected; | ||
Machine::PowerState power_state; | ||
bool power_warning; | ||
bool operator==(const BoardInfo &t) const | ||
{ | ||
return server_connected == t.server_connected && | ||
power_state == t.power_state && | ||
power_warning == t.power_warning; | ||
} | ||
}; | ||
|
||
#endif // BOARDINFO_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
#define CARD_H_ | ||
|
||
#include "Arduino.h" | ||
#include "conf.h" | ||
#include "conf.hpp" | ||
|
||
namespace card | ||
{ | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#ifndef SECRETS_H_ | ||
#define SECRETS_H_ | ||
|
||
#include <cstdint> | ||
#include <array> | ||
#include <string_view> | ||
#include "Machine.hpp" | ||
#include "conf.hpp" | ||
#include "FabUser.hpp" | ||
|
||
namespace secrets::cards | ||
{ | ||
using WhiteListEntry = std::tuple<card::uid_t, FabUser::UserLevel, std::string_view>; | ||
using WhiteList = std::array<WhiteListEntry, conf::whitelist::LEN>; | ||
|
||
static constexpr WhiteList whitelist /* List of RFID tags whitelisted, regardless of connection */ | ||
{ | ||
std::make_tuple(0xAABBCCD1, FabUser::UserLevel::FABLAB_ADMIN, "ABCDEFG"), | ||
std::make_tuple(0xAABBCCD2, FabUser::UserLevel::FABLAB_ADMIN, "PIPPO"), | ||
std::make_tuple(0xAABBCCD3, FabUser::UserLevel::FABLAB_USER, "USER1"), | ||
std::make_tuple(0xAABBCCD4, FabUser::UserLevel::FABLAB_USER, "USER2"), | ||
std::make_tuple(0xAABBCCD5, FabUser::UserLevel::FABLAB_USER, "USER3"), | ||
std::make_tuple(0xAABBCCD6, FabUser::UserLevel::FABLAB_USER, "USER1"), | ||
std::make_tuple(0xAABBCCD7, FabUser::UserLevel::FABLAB_USER, "USER1"), | ||
std::make_tuple(0xAABBCCD8, FabUser::UserLevel::FABLAB_USER, "USER1"), | ||
std::make_tuple(0xAABBCCD9, FabUser::UserLevel::FABLAB_USER, "USER1"), | ||
std::make_tuple(0xAABBCCDA, FabUser::UserLevel::FABLAB_USER, "USER1")}; | ||
} // namespace secrets::cards | ||
|
||
namespace secrets::machine | ||
{ | ||
// Machine connected to the ESP32 | ||
static constexpr std::string_view machine_name = "LASER1"; | ||
static constexpr Machine::MachineType machine_type = Machine::MachineType::LASER; | ||
static constexpr std::string_view machine_topic = "shellyplus1-007/command/switch:0"; | ||
static constexpr Machine::MachineID machine_id{1}; /* ID of the machine. Will be used to compose MQTT topic*/ | ||
|
||
} // namespace secrets::machine | ||
|
||
namespace secrets::wifi | ||
{ | ||
static constexpr std::string_view ssid = "MORIA"; /* Change with WIFI SSID name */ | ||
static constexpr std::string_view password = "Youshallnotpass!"; /* Change with WIFI SSID password */ | ||
} // namespace secrets::wifi | ||
|
||
namespace secrets::mqtt | ||
{ | ||
static constexpr std::string_view client = "BOARD-1"; /* Name of with MQTT client */ | ||
static constexpr std::string_view user = "user!"; /* Change with MQTT user */ | ||
static constexpr std::string_view password = "password"; /* Change with MQTT password */ | ||
static constexpr std::string_view server = "192.168.1.123"; /* IP of MQTT broker*/ | ||
static constexpr std::string_view topic = "/machine"; /* Initial part of the topic, machine ID will be added */ | ||
static constexpr std::string_view response_topic = "/reply"; /* Server reply (sub-topic of the full machine topic) */ | ||
} // namespace secrets::mqtt | ||
|
||
#endif // SECRETS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.