update
This commit is contained in:
27
app/main.h
27
app/main.h
@@ -19,10 +19,19 @@ class CMain
|
||||
public:
|
||||
CMain();
|
||||
void Init(HardwareSerial &serial);
|
||||
void CheckSleep();
|
||||
void EnterLightSleep();
|
||||
|
||||
void OnFingerInterrupt(bool finger);
|
||||
void OnStationGotIP(IpAddress ip, IpAddress mask, IpAddress gateway);
|
||||
void OnStationDisconnect(const String& ssid, MacAddress bssid, WifiDisconnectReason reason);
|
||||
int MqttOnConnect(MqttClient& client, mqtt_message_t* message);
|
||||
void MqttOnDisconnect(TcpClient& client, bool flag);
|
||||
|
||||
void FingerEnable(bool enable);
|
||||
void OnFinger(bool finger);
|
||||
void OnLock(bool unlocked);
|
||||
void OnDoor(bool opened);
|
||||
|
||||
void FingerPower(bool enable);
|
||||
|
||||
void LockUnlock();
|
||||
void EnrollMessage(const char *msg, bool error=false);
|
||||
@@ -38,9 +47,14 @@ private:
|
||||
bool HttpAuthorized(HttpRequest &request, HttpResponse &response);
|
||||
void HttpOnApi(HttpRequest &request, HttpResponse &response);
|
||||
void HttpOnFile(HttpRequest &request, HttpResponse &response);
|
||||
int HttpOnUpload(HttpServerConnection& connection, HttpRequest& request, HttpResponse& response);
|
||||
|
||||
HttpStatus HandleApi(HttpMethod method, String endpoint, JsonDocument &req, JsonDocument &resp);
|
||||
|
||||
void StartMqttClient();
|
||||
void MqttSendDescription();
|
||||
void MqttSendMessage(const char *topic, const char *msg);
|
||||
|
||||
private:
|
||||
void LockSendBytes(uint8_t *pBytes, uint8_t len);
|
||||
void LockSendCode(uint8_t code[8]);
|
||||
@@ -51,12 +65,21 @@ private:
|
||||
|
||||
FtpServer m_FTP;
|
||||
HttpServer m_HttpServer;
|
||||
MqttClient m_Mqtt;
|
||||
Timer m_MqttTimer;
|
||||
Timer m_LightSleepTimer;
|
||||
|
||||
String m_EnrollMessage;
|
||||
String m_EnrollLabel;
|
||||
CSettings::CFingerPrint m_EnrolledFinger;
|
||||
bool m_Enrolling;
|
||||
bool m_Enrolled;
|
||||
|
||||
bool m_StationConnected;
|
||||
|
||||
bool m_FingerPlaced;
|
||||
bool m_LockUnlocked;
|
||||
bool m_DoorOpened;
|
||||
};
|
||||
|
||||
extern CMain g_Main;
|
||||
|
||||
Reference in New Issue
Block a user