Rover API Documentation
rover_utils.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 Utils API - Interfaces for Rover utilities application development - Header file
10  *
11  * Usage Note:
12  * read_core_usage.py must be installed to /opt/rover-app/scripts/read_core_usage.py
13  *
14  * Contributors:
15  * M.Ozcelikors <mozcelikors@gmail.com>, created API 17.11.2017
16  *
17  */
18 
19 #ifndef API_ROVER_UTILS_HPP_
20 #define API_ROVER_UTILS_HPP_
21 
22 #include <stdint.h>
23 #include <stdio.h>
24 #include <unistd.h>
25 
26 namespace rover
27 {
31  class RoverUtils
32  {
33 
34  public:
36  static const int numberOfCores = 4;
37 
43  void getCoreUtilization (float coreUtil[numberOfCores]);
44 
49  int getWlanStatus (void);
50 
55  int getEthernetStatus (void);
56 
61  int getInternetStatus (void);
62 
67  int getBluetoothStatus (void);
68 
73  int getHonoCloudStatus (char * host_name, int port, char * tenant_name, char * device_id, char * user, char * password);
74  };
75 }
76 
77 
78 #endif /* API_ROVER_UTILS_HPP_ */
int getWlanStatus(void)
Returns whether the wlan0 interface is on (1) or off (0).
Definition: rover_utils.cpp:49
void getCoreUtilization(float coreUtil[numberOfCores])
Obtain the core utilization of each core in rover&#39;s Raspberry Pi. Uses an external script called read...
Definition: rover_utils.cpp:20
int getInternetStatus(void)
Returns whether the internet is on (1) or off (0).
Definition: rover_utils.cpp:59
RoverUtils contains member functions to retrieve connectivity status and core utilization of the rove...
Definition: rover_utils.hpp:31
rover Namespace contains classes to manage Rover sensors, gpio, buzzer, buttons, driving, utilities, and cloud.
Definition: rover_api.hpp:293
int getHonoCloudStatus(char *host_name, int port, char *tenant_name, char *device_id, char *user, char *password)
Returns whether the remote Eclipse Hono instance is on (1) or off (0).
Definition: rover_utils.cpp:69
static const int numberOfCores
Definition: rover_utils.hpp:36
int getBluetoothStatus(void)
Returns whether the bluetooth is on (1) or off (0).
Definition: rover_utils.cpp:64
int getEthernetStatus(void)
Returns whether the eth0 interface is on (1) or off (0).
Definition: rover_utils.cpp:54