wirelessgateway/localserver/SH_LocalServer.hpp

49 lines
1.2 KiB
C++
Raw Permalink Normal View History

2021-09-18 13:45:24 +08:00
#ifndef _LOCALSERVER_H_
#define _LOCALSERVER_H_
#include <iostream>
#include <string>
#include <stack>
#include <vector>
#include <boost/asio.hpp>
#include <boost/thread/thread.hpp>
#include <boost/unordered_set.hpp>
#include "../utility/SH_MySingleton.hpp"
#include "../common/SH_global.h"
#include "../platform/SH_PlatformInit.hpp"
#include "../secure/SH_Secure.hpp"
#include "../jsonparse/SH_JsonCmd.hpp"
2025-02-15 18:49:38 +08:00
enum WebCommand {
2021-09-18 13:45:24 +08:00
2025-02-15 18:49:38 +08:00
//CMT TCP
kGateWayVersion = 80,
kSensorInfo = 81,
kSensorWave = 82,
KDownloadConfig = 83,
KUploadConfig = 84,
KUpgadeGateway = 85,
KUpgradeSensor = 86,
KEigenvalue = 87,
KUpgradeSensorStop = 88
};
enum GatewayType{
kGWTDW2700 = 1,
kGWTDG101 = 10,
kGWTDG102 = 11
};
2021-09-18 13:45:24 +08:00
class LocalServer : public MySingleton<LocalServer>
{
private:
boost::mutex mMutex;
// _Event mWaveEvent;
std::vector<std::string> m_VecFileName;
public:
LocalServer();
virtual ~LocalServer();
void HandleFromServer(const char *pData, int pLen, const char *topic);
std::string HandleCgi_cmd(std::string &pData);
2025-02-15 18:49:38 +08:00
static void HandleTcp_cmd(const char* recvData,char* send_data,uint8_t& rescmd,int& reslength,int recvbody_length = 0);
2021-09-18 13:45:24 +08:00
};
#endif