MRPT  2.0.0
CWirelessPower.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
14 
15 namespace mrpt::hwdrivers
16 {
17 /** This class implements a wireless power probe.
18  * \sa mrpt::maps::CWirelessPowerGridMap2D,
19  * mrpt::obs::CObservationWirelessPower
20  * \ingroup mrpt_hwdrivers_grp
21  */
23 {
25 
26  private:
27  /** SSID of the WiFi network
28  */
29  std::string ssid;
30 
31  /** GUID of the WiFi interface
32  */
33  std::string guid;
34 
35  /** Handle to the WLAN server (Windows)
36  */
37  void* hClient{nullptr};
38 
39  /** Poses
40  */
41  float pose_x{0}, pose_y{0}, pose_z{0}, pose_yaw{0}, pose_pitch{0},
43 
44  public:
45  /** Default constructor.
46  */
48  ~CWirelessPower() override = default;
49 
50  /** Set the SSID and GUID of the target network.
51  * \exception std::exception In case there is a failure
52  * \param ssid_ SSID of the target network
53  * \param guid_ GUID of the network interface
54  */
55  void setNet(std::string ssid_, std::string guid_);
56 
57  void doProcess() override;
59  const mrpt::config::CConfigFileBase& configSource,
60  const std::string& section) override;
61 
62  /** Gets a list of the interfaces
63  * \exception std::exception In case there is a failure
64  * \return std::vector returns the identifiers (GUID) of the available
65  * interfaces
66  */
67  std::vector<std::string> ListInterfaces();
68 
69  /** Gets the power of a given network
70  * \exception std::exception In case there is a failure
71  * \return Returns the power (0-100).
72  */
73  int GetPower();
74 
75  /** Gets the power of a given network as a timestamped observation
76  * NOTE: Deprecated, use getObservations instead. See CGenericSensor
77  * documentation. This function is kept for internal use of the module
78  * \return Returns true if the observation was correct, and false otherwise
79  * \sa mrpt::hwdrivers::CGenericSensor
80  */
81 
83 
84  /** Gets a list of the networks available for an interface
85  * \exception std::exception In case there is a failure
86  * \return std::vector returns handles to the available networks of a given
87  * interface
88  */
89  std::vector<std::string> ListNetworks();
90 
91 }; // End of class def.
92 
93 } // namespace mrpt::hwdrivers
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
~CWirelessPower() override=default
Contains classes for various device interfaces.
std::string guid
GUID of the WiFi interface.
CWirelessPower()
Default constructor.
This class allows loading and storing values and vectors of different types from a configuration text...
bool getObservation(mrpt::obs::CObservationWirelessPower &outObservation)
Gets the power of a given network as a timestamped observation NOTE: Deprecated, use getObservations ...
This class implements a wireless power probe.
std::string ssid
SSID of the WiFi network.
This represents a measurement of the wireless strength perceived by the robot.
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
std::vector< std::string > ListNetworks()
Gets a list of the networks available for an interface.
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &section) override
Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see config::CConfigFileBase and derived classes)
std::vector< std::string > ListInterfaces()
Gets a list of the interfaces.
void setNet(std::string ssid_, std::string guid_)
Set the SSID and GUID of the target network.
void doProcess() override
This method will be invoked at a minimum rate of "process_rate" (Hz)
int GetPower()
Gets the power of a given network.
void * hClient
Handle to the WLAN server (Windows)



Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020