Rover API Documentation
rover::RoverHonoCloud Class Reference

Contains the member functions to connect and send data to Eclipse Hono instance using several parameters such as host name, port, tenant name, user name, and password. This class wraps hono_interaction library for Rover-specific interactions. More...

#include <rover_honocloud.hpp>

Inheritance diagram for rover::RoverHonoCloud:
rover::RoverCloud

Public Member Functions

 RoverHonoCloud ()
 (default) Constructor for the RoverHonoCloud More...
 
 RoverHonoCloud (char *host_name, const int port, const int registration_port, char *tenant_name)
 (assigning) Constructor for the RoverHonoCloud More...
 
void setHostName (char *host_name)
 Sets private attribute HOST_NAME. More...
 
void setPort (const int port)
 Sets private attribute PORT. More...
 
void setTenantName (char *tenant) const
 Sets private attribute TENANT_NAME. More...
 
void setHono (char *host_name, const int port, char *tenant)
 Sets up a hono connection using host name, port, and tenant name. More...
 
char * getHostName (void) const
 Retrieves private attribute HOST_NAME. More...
 
int getPort (void) const
 Retrieves private attribute PORT. More...
 
char * getTenantName (void) const
 Retrieves private attribute TENANT_NAME. More...
 
void setRegistrationPort (const int port) const
 Sets the default REGISTRATION_PORT variable. More...
 
int getRegistrationPort (void) const
 Retrieves private attribute REGISTRATION_PORT. More...
 
int registerDevice (char *device_id)
 Constructs curl command to register a device to Hono instance given device ID using REST API. More...
 
int sendTelemetry (char *device_id, char *user, char *password, char *field, double value)
 Constructs curl command to send telemetry data to Eclipse Hono using REST API. More...
 
int sendEvent (char *device_id, char *user, char *password, char *field, double value)
 Constructs curl command to send event data to Eclipse Hono using REST API. More...
 
int getHonoStatus (char *device_id, char *user, char *password)
 Retrieves Hono cloud status by constructing a dummy REST API telemetry sending command to Eclipse Hono. More...
 
- Public Member Functions inherited from rover::RoverCloud
virtual ~RoverCloud ()
 Virtual destructor. More...
 

Private Member Functions

int attributeErrorCheck (void) const
 Checks private attributes and gives an error message and returns 0 if they're invalid. More...
 

Private Attributes

char * HOST_NAME
 Host name used for connecting to the Eclipse Hono using REST API. More...
 
int PORT
 Port used for connecting to the Eclipse Hono using REST API. More...
 
int REGISTRATION_PORT
 Port used for registering a device to the Eclipse Hono using REST API. More...
 
char * TENANT_NAME
 Tenant name used for connecting to the Eclipse Hono using REST API. More...
 

Detailed Description

Contains the member functions to connect and send data to Eclipse Hono instance using several parameters such as host name, port, tenant name, user name, and password. This class wraps hono_interaction library for Rover-specific interactions.

Constructor & Destructor Documentation

rover::RoverHonoCloud::RoverHonoCloud ( )
explicit

(default) Constructor for the RoverHonoCloud

rover::RoverHonoCloud::RoverHonoCloud ( char *  host_name,
const int  port,
const int  registration_port,
char *  tenant_name 
)
explicit

(assigning) Constructor for the RoverHonoCloud

Parameters
host_name
registration_port
port
tenant

Member Function Documentation

int rover::RoverHonoCloud::attributeErrorCheck ( void  ) const
private

Checks private attributes and gives an error message and returns 0 if they're invalid.

int rover::RoverHonoCloud::getHonoStatus ( char *  device_id,
char *  user,
char *  password 
)

Retrieves Hono cloud status by constructing a dummy REST API telemetry sending command to Eclipse Hono.

Returns
status code (int) is returned. 1 indicates successful operation and 0 indicates unsuccessful operation.
char * rover::RoverHonoCloud::getHostName ( void  ) const

Retrieves private attribute HOST_NAME.

int rover::RoverHonoCloud::getPort ( void  ) const

Retrieves private attribute PORT.

int rover::RoverHonoCloud::getRegistrationPort ( void  ) const

Retrieves private attribute REGISTRATION_PORT.

Returns
Private attribute REGISTRATION_PORT
char * rover::RoverHonoCloud::getTenantName ( void  ) const

Retrieves private attribute TENANT_NAME.

int rover::RoverHonoCloud::registerDevice ( char *  device_id)

Constructs curl command to register a device to Hono instance given device ID using REST API.

Parameters
device_id
Returns
status code (int) is returned. 1 indicates successful operation and 0 indicates unsuccessful operation.
int rover::RoverHonoCloud::sendEvent ( char *  device_id,
char *  user,
char *  password,
char *  field,
double  value 
)

Constructs curl command to send event data to Eclipse Hono using REST API.

Returns
status code (int) is returned. 1 indicates successful operation and 0 indicates unsuccessful operation.
int rover::RoverHonoCloud::sendTelemetry ( char *  device_id,
char *  user,
char *  password,
char *  field,
double  value 
)

Constructs curl command to send telemetry data to Eclipse Hono using REST API.

Returns
status code (int) is returned. 1 indicates successful operation and 0 indicates unsuccessful operation.
void rover::RoverHonoCloud::setHono ( char *  host_name,
const int  port,
char *  tenant 
)

Sets up a hono connection using host name, port, and tenant name.

Parameters
host_name
port
tenant
void rover::RoverHonoCloud::setHostName ( char *  host_name)
virtual

Sets private attribute HOST_NAME.

Parameters
host_name

Implements rover::RoverCloud.

void rover::RoverHonoCloud::setPort ( const int  port)
virtual

Sets private attribute PORT.

Parameters
port

Implements rover::RoverCloud.

void rover::RoverHonoCloud::setRegistrationPort ( const int  port) const

Sets the default REGISTRATION_PORT variable.

Parameters
port(int) to be set as REGISTRATION_PORT
Returns
void
void rover::RoverHonoCloud::setTenantName ( char *  tenant) const

Sets private attribute TENANT_NAME.

Parameters
tenant

Member Data Documentation

char* rover::RoverHonoCloud::HOST_NAME
private

Host name used for connecting to the Eclipse Hono using REST API.

int rover::RoverHonoCloud::PORT
private

Port used for connecting to the Eclipse Hono using REST API.

int rover::RoverHonoCloud::REGISTRATION_PORT
mutableprivate

Port used for registering a device to the Eclipse Hono using REST API.

char* rover::RoverHonoCloud::TENANT_NAME
mutableprivate

Tenant name used for connecting to the Eclipse Hono using REST API.


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