class mrpt::hwdrivers::CWirelessPower

This class implements a wireless power probe.

See also:

mrpt::maps::CWirelessPowerGridMap2D, mrpt::obs::CObservationWirelessPower

#include <mrpt/hwdrivers/CWirelessPower.h>

class CWirelessPower: public mrpt::hwdrivers::CGenericSensor
{
public:
    // typedefs

    typedef std::shared_ptr<CGenericSensor> Ptr;
    typedef std::multimap<mrpt::system::TTimeStamp, mrpt::serialization::CSerializable::Ptr> TListObservations;
    typedef std::pair<mrpt::system::TTimeStamp, mrpt::serialization::CSerializable::Ptr> TListObsPair;

    // construction

    CWirelessPower();

    //
methods

    void setNet(std::string ssid, std::string guid);
    virtual void doProcess();
    virtual void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase& configSource, const std::string& section);
    std::vector<std::string> ListInterfaces();
    int GetPower();
    bool getObservation(mrpt::obs::CObservationWirelessPower& outObservation);
    std::vector<std::string> ListNetworks();
    virtual const mrpt::hwdrivers::TSensorClassId* GetRuntimeClass() const = 0;
    double getProcessRate() const;
    std::string getSensorLabel() const;
    void setSensorLabel(const std::string& sensorLabel);
    bool isVerboseEnabled() const;
    virtual unsigned int getExternalImageJPEGQuality() const;
};

Inherited Members

public:
    //
methods

    CGenericSensor& operator = (const CGenericSensor&);
    virtual void doProcess() = 0;

Construction

CWirelessPower()

Default constructor.

Methods

void setNet(std::string ssid, std::string guid)

Set the SSID and GUID of the target network.

Parameters:

std::exception

In case there is a failure

ssid

SSID of the target network

guid

GUID of the network interface

virtual void doProcess()

This method will be invoked at a minimum rate of “process_rate” (Hz)

Parameters:

This

method must throw an exception with a descriptive message if some critical error is found.

virtual void loadConfig_sensorSpecific(
    const mrpt::config::CConfigFileBase& configSource,
    const std::string& section
    )

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)

Parameters:

This

method must throw an exception with a descriptive message if some critical parameter is missing or has an invalid value.

std::vector<std::string> ListInterfaces()

Gets a list of the interfaces.

Parameters:

std::exception

In case there is a failure

Returns:

std::vector returns the identifiers (GUID) of the available interfaces

int GetPower()

Gets the power of a given network.

Parameters:

std::exception

In case there is a failure

Returns:

Returns the power (0-100).

bool getObservation(mrpt::obs::CObservationWirelessPower& outObservation)

Gets the power of a given network as a timestamped observation NOTE: Deprecated, use getObservations instead.

See CGenericSensor documentation. This function is kept for internal use of the module

Returns:

Returns true if the observation was correct, and false otherwise

See also:

mrpt::hwdrivers::CGenericSensor

std::vector<std::string> ListNetworks()

Gets a list of the networks available for an interface.

Parameters:

std::exception

In case there is a failure

Returns:

std::vector returns handles to the available networks of a given interface