Rover API Documentation
rover_honocloud.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 FH Dortmund and others
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Description:
9  * Rover Hono Cloud API - Interfaces for Rover Hono cloud application development - Header file
10  *
11  * Contributors:
12  * M.Ozcelikors <mozcelikors@gmail.com>, created API 17.11.2017
13  *
14  */
15 
16 #ifndef API_ROVER_HONO_CLOUD_HPP_
17 #define API_ROVER_HONO_CLOUD_HPP_
18 
19 #include <roverapi/rover_cloud.hpp>
20 
21 namespace rover
22 {
27  class RoverHonoCloud : public RoverCloud
28  {
29  private:
33  char * HOST_NAME;
37  int PORT;
41  mutable int REGISTRATION_PORT;
45  mutable char * TENANT_NAME;
46 
50  int attributeErrorCheck (void) const;
51 
52  public:
56  explicit RoverHonoCloud();
57 
65  explicit RoverHonoCloud(char * host_name, const int port, const int registration_port, char * tenant_name);
66 
71  void setHostName (char * host_name);
72 
77  void setPort (const int port);
78 
83  void setTenantName (char * tenant) const;
84 
91  void setHono (char * host_name, const int port, char * tenant);
92 
96  char * getHostName (void) const;
97 
101  int getPort (void) const;
102 
106  char * getTenantName (void) const;
107 
113  void setRegistrationPort (const int port) const;
114 
119  int getRegistrationPort (void) const;
120 
126  int registerDevice (char * device_id);
127 
132  int sendTelemetry (char * device_id, char * user, char * password, char * field, double value);
133 
138  int sendEvent (char * device_id, char * user, char * password, char * field, double value);
139 
144  int getHonoStatus (char * device_id, char * user, char * password);
145  };
146 }
147 
148 
149 #endif /* API_ROVER_HONO_CLOUD_HPP_ */
int attributeErrorCheck(void) const
Checks private attributes and gives an error message and returns 0 if they&#39;re invalid.
Definition: rover_honocloud.cpp:45
int PORT
Port used for connecting to the Eclipse Hono using REST API.
Definition: rover_honocloud.hpp:37
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.
Definition: rover_honocloud.cpp:76
int getHonoStatus(char *device_id, char *user, char *password)
Retrieves Hono cloud status by constructing a dummy REST API telemetry sending command to Eclipse Hon...
Definition: rover_honocloud.cpp:157
int registerDevice(char *device_id)
Constructs curl command to register a device to Hono instance given device ID using REST API...
Definition: rover_honocloud.cpp:58
void setHono(char *host_name, const int port, char *tenant)
Sets up a hono connection using host name, port, and tenant name.
Definition: rover_honocloud.cpp:110
RoverHonoCloud()
(default) Constructor for the RoverHonoCloud
Definition: rover_honocloud.cpp:24
rover Namespace contains classes to manage Rover sensors, gpio, buzzer, buttons, driving, utilities, and cloud.
Definition: rover_api.hpp:293
Contains the member functions to connect and send data to Eclipse Hono instance using several paramet...
Definition: rover_honocloud.hpp:27
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.
Definition: rover_honocloud.cpp:93
char * getTenantName(void) const
Retrieves private attribute TENANT_NAME.
Definition: rover_honocloud.cpp:152
char * HOST_NAME
Host name used for connecting to the Eclipse Hono using REST API.
Definition: rover_honocloud.hpp:33
int getPort(void) const
Retrieves private attribute PORT.
Definition: rover_honocloud.cpp:147
RoverCloud defines the interfaces that can be used for classes that connect to a remote cloud server...
Definition: rover_cloud.hpp:25
void setTenantName(char *tenant) const
Sets private attribute TENANT_NAME.
Definition: rover_honocloud.cpp:137
char * TENANT_NAME
Tenant name used for connecting to the Eclipse Hono using REST API.
Definition: rover_honocloud.hpp:45
int getRegistrationPort(void) const
Retrieves private attribute REGISTRATION_PORT.
Definition: rover_honocloud.cpp:132
void setPort(const int port)
Sets private attribute PORT.
Definition: rover_honocloud.cpp:122
void setRegistrationPort(const int port) const
Sets the default REGISTRATION_PORT variable.
Definition: rover_honocloud.cpp:127
char * getHostName(void) const
Retrieves private attribute HOST_NAME.
Definition: rover_honocloud.cpp:142
int REGISTRATION_PORT
Port used for registering a device to the Eclipse Hono using REST API.
Definition: rover_honocloud.hpp:41
void setHostName(char *host_name)
Sets private attribute HOST_NAME.
Definition: rover_honocloud.cpp:117