-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcamera.h
More file actions
59 lines (52 loc) · 1.98 KB
/
camera.h
File metadata and controls
59 lines (52 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once
#include <iostream>
#include <string>
#include <vector>
#include "database.h"
#include "Poco/Net/HTTPClientSession.h"
#include "Poco/Net/HTTPRequest.h"
#include "Poco/Net/HTTPResponse.h"
#include "Poco/File.h"
#include "Poco/Path.h"
class Camera
{
public:
typedef struct event{
std::string evt_type;
std::string evt_channel;
std::string evt_parking_status;
std::string evt_lane;
std::string evt_lot_no;
std::string evt_lpn;
std::string evt_snapshot_time;
} event_t;
const std::string username = "admin";
const std::string password = "nexpa1234";
const std::string imageDirectoryPath = Poco::Path::home() + "Desktop/Ev_Charging_Hogging_Image";
static Camera* getInstance();
void FnCameraInit();
void FnSetCameraStatus(bool status);
bool FnGetCameraStatus();
bool FnGetHeartBeat();
bool FnSubscribeToSnapShot();
bool FnSetCurrentTime();
bool FnGetCurrentTime(std::string& dateTime);
void FnSetCameraRecoveryFlag(bool flag);
bool FnGetCameraRecoveryFlag();
Camera(Camera& camera) = delete;
void operator=(const Camera&) = delete;
private:
static Camera* camera_;
static Poco::Mutex singletonCameraMutex_;
std::string cameraServerIP;
Poco::Mutex cameraMutex_;
bool cameraRecoveryFlag_;
bool cameraStatus_;
Camera();
void createImageDirectory();
bool isImageDirectoryExists();
bool do_heartBeatRequest(Poco::Net::HTTPClientSession& session, Poco::Net::HTTPRequest& request, Poco::Net::HTTPResponse& response);
bool do_subscribeToSnapShot(Poco::Net::HTTPClientSession& session, Poco::Net::HTTPRequest& request, Poco::Net::HTTPResponse& response);
bool do_setCurrentTime(Poco::Net::HTTPClientSession& session, Poco::Net::HTTPRequest& request, Poco::Net::HTTPResponse& response);
bool do_getCurrentTime(Poco::Net::HTTPClientSession& session, Poco::Net::HTTPRequest& request, Poco::Net::HTTPResponse& response, std::string& dateTime);
};