Removed MQTT client. Was more or less unused, anyways.
This commit is contained in:
@ -20,6 +20,8 @@
|
||||
|
||||
#define RFID_SCAN_INTERVAL 100
|
||||
|
||||
#define NUM_BUTTONS 4
|
||||
|
||||
#define PIN_SD_CS(x) (digitalWrite(16, x))
|
||||
#define PIN_SD_CS_SETUP() (pinMode(16, OUTPUT))
|
||||
|
||||
|
@ -9,7 +9,6 @@ class Controller;
|
||||
#include "player.h"
|
||||
#include "playlist.h"
|
||||
#include "playlist_manager.h"
|
||||
#include "mqtt_client.h"
|
||||
#include "http_server.h"
|
||||
#include <MFRC522.h>
|
||||
|
||||
@ -18,7 +17,6 @@ enum ControllerState { NORMAL, LOCKING, LOCKED };
|
||||
class Controller {
|
||||
private:
|
||||
MFRC522* _rfid;
|
||||
MQTTClient* _mqtt_client;
|
||||
HTTPServer* _http_server;
|
||||
PlaylistManager* _pm;
|
||||
ControllerState _state = NORMAL;
|
||||
@ -42,11 +40,8 @@ private:
|
||||
void _execute_command_help();
|
||||
unsigned long _button_last_pressed_at[NUM_BUTTONS];
|
||||
bool _check_button(uint8_t btn);
|
||||
unsigned long _last_mqtt_report_at = 0;
|
||||
void _send_mqtt_report();
|
||||
public:
|
||||
Controller(Player* p, PlaylistManager* pm);
|
||||
void set_mqtt_client(MQTTClient* m);
|
||||
void register_http_server(HTTPServer* h);
|
||||
void loop();
|
||||
void send_controller_status();
|
||||
|
@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "config.h"
|
||||
#include <PubSubClient.h>
|
||||
#include <WiFiClient.h>
|
||||
|
||||
class MQTTClient {
|
||||
private:
|
||||
WiFiClient* _wifi_client;
|
||||
PubSubClient* _mqtt;
|
||||
unsigned long _last_reconnect_attempt;
|
||||
void _reconnect();
|
||||
public:
|
||||
MQTTClient();
|
||||
void loop();
|
||||
void publish_status(String s);
|
||||
void publish_rfid_uid(uint32_t uid);
|
||||
};
|
@ -23,7 +23,6 @@ public:
|
||||
} else {
|
||||
state &= ~1;
|
||||
}
|
||||
delayMicroseconds(MCP_SPI_SETTING_DELAY);
|
||||
}
|
||||
|
||||
static void select_vs1053_xcs(bool enabled=true) {
|
||||
@ -33,7 +32,6 @@ public:
|
||||
} else {
|
||||
state &= ~2;
|
||||
}
|
||||
delayMicroseconds(MCP_SPI_SETTING_DELAY);
|
||||
}
|
||||
|
||||
static void select_vs1053_xdcs(bool enabled=true) {
|
||||
@ -43,7 +41,6 @@ public:
|
||||
} else {
|
||||
state &= ~4;
|
||||
}
|
||||
delayMicroseconds(MCP_SPI_SETTING_DELAY);
|
||||
}
|
||||
|
||||
static void select_rc522(bool enabled=true) {
|
||||
@ -53,7 +50,6 @@ public:
|
||||
} else {
|
||||
state &= ~8;
|
||||
}
|
||||
delayMicroseconds(MCP_SPI_SETTING_DELAY);
|
||||
}
|
||||
|
||||
static void set_state(uint8_t s) {
|
||||
|
Reference in New Issue
Block a user