Class EventsManager

Nested Relationships

Nested Types

Class Documentation

class EventsManager

Public Functions

explicit EventsManager(bool uploadCachedOnStart = false)
~EventsManager()
bool sendEvent(const std::string &name, const std::vector<std::string> &tags = {}, const std::unordered_map<std::string, std::string> &extras = {}, const std::string &deviceSerialNo = "", const std::vector<std::string> &associateFiles = {})

Send an event to the events service

Parameters:
  • name – Name of the event

  • tags – List of tags to send

  • extras – Extra data to send

  • deviceSerialNoDevice serial number

  • associateFiles – List of associate files with ids

Returns:

bool

bool sendSnap(const std::string &name, const std::shared_ptr<FileGroup> fileGroup, const std::vector<std::string> &tags = {}, const std::unordered_map<std::string, std::string> &extras = {}, const std::string &deviceSerialNo = "")

Send a snap to the events service. Snaps should be used for sending images and other files.

Parameters:
  • name – Name of the snap

  • fileGroupFileGroup containing FileData objects to send

  • tags – List of tags to send

  • extras – Extra data to send

  • deviceSerialNoDevice serial number

Returns:

bool

bool sendSnap(const std::string &name, const std::optional<std::string> &fileName, const std::shared_ptr<ImgFrame> imgFrame, const std::optional<std::shared_ptr<ImgDetections>> &imgDetections = std::nullopt, const std::vector<std::string> &tags = {}, const std::unordered_map<std::string, std::string> &extras = {}, const std::string &deviceSerialNo = "")

Send a snap to the events service, with an ImgFrame and ImgDetections pair as files

Parameters:
  • name – Name of the snap

  • fileName – File name used to create FileData

  • imgFrameImgFrame to send

  • imgDetectionsImgDetections to sent

  • tags – List of tags to send

  • extras – Extra data to send

  • deviceSerialNoDevice serial number

Returns:

bool

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 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

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