OCI REST for ESP32
Public Member Functions | Public Attributes | List of all members
Oci Class Reference

The OCI API. More...

#include <oci.h>

Public Member Functions

 Oci (OciProfile profile, char *timeServer="pool.ntp.org", long gmtOffsetSeconds=0, int daylightOffsetSeconds=0)
 Construct a new instance of the OCI API. More...
 
void encryptAndEncode (const unsigned char *toEncrypt, unsigned char(&encoded)[500])
 Used internally to hash, sign and base64 encode the auth header to sign the request. More...
 
void apiCall (OciApiRequest request, OciApiResponse &response)
 Make a call to the OCI REST API. More...
 

Public Attributes

WiFiClientSecure client
 
const char * HTTP_METHOD_GET = "GET"
 HTTP GET.
 
const char * HTTP_METHOD_POST = "POST"
 HTTP POST.
 
const char * HTTP_METHOD_PUT = "PUT"
 HTTP PUT.
 
const char * HTTP_METHOD_PATCH = "PATCH"
 HTTP PATCH.
 
const char * HTTP_METHOD_DELETE = "DELETE"
 HTTP DELETE.
 
OciProfile ociProfile
 The OciProfile to use.
 
char * ntpServer = "pool.ntp.org"
 The ntpServer.
 
long gmtOffset = 0
 The offset from GMT to use for retrieving time. You shouldn't change this - requests should be signed with time at GMT.
 
int daylightOffset = 0
 The daylight savings offset. Should not change this either.
 

Detailed Description

The OCI API.

Constructor & Destructor Documentation

◆ Oci()

Oci::Oci ( OciProfile  profile,
char *  timeServer = "pool.ntp.org",
long  gmtOffsetSeconds = 0,
int  daylightOffsetSeconds = 0 
)
inline

Construct a new instance of the OCI API.

Parameters
profileA configured OciProfile to be used to sign API calls
timeServerThe NTP Server to be used to obtain the current time. Normally it should be left as default.
gmtOffsetSecondsThe offset in seconds from GMT for the time object. Leave this as 0, API calls must be signed with the current time in GMT
daylightOffsetSecondsOffset in seconds for DST. Leave as zero.

Member Function Documentation

◆ apiCall()

void Oci::apiCall ( OciApiRequest  request,
OciApiResponse response 
)
inline

Make a call to the OCI REST API.

Parameters
[in]requestThe API request
[out]responseThe API response

◆ encryptAndEncode()

void Oci::encryptAndEncode ( const unsigned char *  toEncrypt,
unsigned char(&)  encoded[500] 
)
inline

Used internally to hash, sign and base64 encode the auth header to sign the request.

Parameters
[in]toEncrypttoEncrypt the value to encrypt
[out]encoded&encoded the hashed/signed/encoded output

The documentation for this class was generated from the following file: