Fledge
An open source edge computing platform for industrial users
ocs.h
1 #ifndef _OCS_H
2 #define _OCS_H
3 /*
4  * Fledge OSI Soft OCS integration.
5  *
6  * Copyright (c) 2020 Dianomic Systems
7  *
8  * Released under the Apache 2.0 Licence
9  *
10  * Author: Stefano Simonelli
11  */
12 
13 #include <string>
14 
15 using namespace std;
16 
17 #define OCS_HOST "dat-b.osisoft.com:443"
18 #define ADH_HOST "uswe.datahub.connect.aveva.com"
19 #define TIMEOUT_CONNECT 10
20 #define TIMEOUT_REQUEST 10
21 #define RETRY_SLEEP_TIME 1
22 #define MAX_RETRY 3
23 
24 #define URL_RETRIEVE_TOKEN "/identity/connect/token"
25 
26 #define PAYLOAD_RETRIEVE_TOKEN "grant_type=client_credentials&client_id=CLIENT_ID_PLACEHOLDER&client_secret=CLIENT_SECRET_ID_PLACEHOLDER"
27 
31 class OCS
32 {
33  public:
34  OCS();
35  OCS(bool adh);
36 
37  // Destructor
38  ~OCS();
39 
40  string retrieveToken(const string& clientId, const string& clientSecret);
41  string extractToken(const string& response);
42  private:
43  bool m_adh;
44 };
45 #endif
Definition: asset_tracking.h:108
The OCS class.
Definition: ocs.h:31