Class EventsManager
Defined in File EventsManager.hpp
Nested Relationships
Nested Types
Class Documentation
-
class EventsManager
Public Functions
-
explicit EventsManager(std::string url = "https://events-ingest.cloud.luxonis.com", bool uploadCachedOnStart = false, float publishInterval = 10.0)
-
~EventsManager()
Send an event to the events service
Send a snap to the events service. Snaps should be used for sending images and other large files.
-
void setDeviceSerialNumber(const std::string &deviceSerialNumber)
-
void setUrl(const std::string &url)
Set the URL of the events service. By default, the URL is set to https://events-ingest.cloud.luxonis.com
- Parameters:
url – URL of the events service
- Returns:
void
-
void setSourceAppId(const std::string &sourceAppId)
Set the source app ID. By default, the source app ID is taken from the environment variable AGENT_APP_ID
- Parameters:
sourceAppId – Source app ID
- Returns:
void
-
void setSourceAppIdentifier(const std::string &sourceAppIdentifier)
Set the source app identifier. By default, the source app identifier is taken from the environment variable AGENT_APP_IDENTIFIER
- Parameters:
sourceAppIdentifier – Source app identifier
- Returns:
void
-
void setToken(const std::string &token)
Set the token for the events service. By default, the token is taken from the environment variable DEPTHAI_HUB_API_KEY
- Parameters:
token – Token for the events service
- Returns:
void
-
void setQueueSize(uint64_t queuSize)
Set the queue size for the amount of events that can be added and sent. By default, the queue size is set to 10
- Parameters:
queueSize – Queue size
- Returns:
void
-
void setLogResponse(bool logResponse)
Set whether to log the responses from the server. By default, logResponse is set to false
- Parameters:
logResponse – bool
- Returns:
void
-
void setVerifySsl(bool verifySsl)
Set whether to verify the SSL certificate. By default, verifySsl is set to false
- Parameters:
verifySsl – bool
- Returns:
void
-
bool checkConnection()
Check if the device is connected to Hub. Performs a simple GET request to the URL/health endpoint
- Returns:
bool
-
void uploadCachedData()
Upload cached data to the events service
- Returns:
void
-
void setCacheDir(const std::string &cacheDir)
Set the cache directory for storing cached data. By default, the cache directory is set to /internal/private
- Parameters:
cacheDir – Cache directory
- Returns:
void
-
void setCacheIfCannotSend(bool cacheIfCannotSend)
Set whether to cache data if it cannot be sent. By default, cacheIfCannotSend is set to false
- Parameters:
cacheIfCannotSend – bool
- Returns:
void
-
explicit EventsManager(std::string url = "https://events-ingest.cloud.luxonis.com", bool uploadCachedOnStart = false, float publishInterval = 10.0)