82 lines
1.7 KiB
C++
82 lines
1.7 KiB
C++
/*
|
||
* © Copyright 2014 – Urheberrechtshinweis
|
||
* Alle Rechte vorbehalten / All Rights Reserved
|
||
*
|
||
* Programmcode ist urheberrechtlich geschuetzt.
|
||
* Das Urheberrecht liegt, soweit nicht ausdruecklich anders gekennzeichnet, bei Frank Ebner.
|
||
* Keine Verwendung ohne explizite Genehmigung.
|
||
* (vgl. § 106 ff UrhG / § 97 UrhG)
|
||
*/
|
||
|
||
#ifndef ACCESSPOINT_H
|
||
#define ACCESSPOINT_H
|
||
|
||
#include "../MACAddress.h"
|
||
|
||
/**
|
||
* represents a Wi-Fi-AccessPoint
|
||
* an AP is represented by its MAC-Address and
|
||
* may provide a readably SSID
|
||
*/
|
||
class AccessPoint {
|
||
|
||
private:
|
||
|
||
/** the AP's MAC-Address */
|
||
MACAddress mac;
|
||
|
||
/** OPTIONAL the AP's readable SSID */
|
||
std::string ssid;
|
||
|
||
public:
|
||
|
||
/** empty ctor */
|
||
AccessPoint() {
|
||
;
|
||
}
|
||
|
||
/** ctor with MAC and SSID */
|
||
AccessPoint(const MACAddress& mac, const std::string& ssid) : mac(mac), ssid(ssid) {
|
||
;
|
||
}
|
||
|
||
/** ctor with MAC and SSID */
|
||
AccessPoint(const std::string& mac, const std::string& ssid) : mac(mac), ssid(ssid) {
|
||
;
|
||
}
|
||
|
||
/** ctor with MAC and without SSID */
|
||
AccessPoint(const MACAddress& mac) : mac(mac), ssid() {
|
||
;
|
||
}
|
||
|
||
/** ctor with MAC and without SSID */
|
||
AccessPoint(const std::string& mac) : mac(mac), ssid() {
|
||
;
|
||
}
|
||
|
||
/** equals? */
|
||
bool operator == (const AccessPoint& o) {
|
||
return (o.mac == mac) && (o.ssid == ssid);
|
||
}
|
||
|
||
public:
|
||
|
||
/** get the AP's MAC address */
|
||
inline const MACAddress& getMAC() const {return mac;}
|
||
|
||
/** OPTIONAL: get the AP's ssid (if any) */
|
||
inline const std::string& getSSID() const {return ssid;}
|
||
|
||
/** as string for debuging */
|
||
std::string asString() const {
|
||
std::string res = "AP(" + mac.asString();
|
||
if (!ssid.empty()) {res += ", '" + ssid + "'";}
|
||
res += ")";
|
||
return res;
|
||
}
|
||
|
||
};
|
||
|
||
#endif // ACCESSPOINT_H
|