diff options
Diffstat (limited to 'include/ble/Bluetooth.h')
-rw-r--r-- | include/ble/Bluetooth.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/include/ble/Bluetooth.h b/include/ble/Bluetooth.h index 28e2794..80becec 100644 --- a/include/ble/Bluetooth.h +++ b/include/ble/Bluetooth.h @@ -38,31 +38,38 @@ typedef std::shared_ptr<BluetoothAdapter> BluetoothAdapterPtr; class Mac { public: - explicit Mac(uint8_t _5, uint8_t _4, uint8_t _3, uint8_t _2, uint8_t _1, uint8_t _0) : bytes() { - bytes[5] = _5; - bytes[4] = _4; - bytes[3] = _3; - bytes[2] = _2; - bytes[1] = _1; + explicit Mac(uint8_t _0, uint8_t _1, uint8_t _2, uint8_t _3, uint8_t _4, uint8_t _5) : bytes() { bytes[0] = _0; + bytes[1] = _1; + bytes[2] = _2; + bytes[3] = _3; + bytes[4] = _4; + bytes[5] = _5; }; string str() const; - bool operator==(Mac &other) const; +// bool operator==(const Mac &other) const; +// bool operator!=(const Mac &other) const; +// bool operator<(const Mac &other) const; - bool operator!=(Mac &other) const; - - void copy(uint8_t &_5, uint8_t &_4, uint8_t &_3, uint8_t &_2, uint8_t &_1, uint8_t &_0) const; + void copy(uint8_t &_0, uint8_t &_1, uint8_t &_2, uint8_t &_3, uint8_t &_4, uint8_t &_5) const; static Mac parseMac(string s); friend bool operator<(const Mac &a, const Mac &b); + friend bool operator==(const Mac &a, const Mac &b); private: uint8_t bytes[6]; }; +std::ostream& operator<<(std::ostream& os, const Mac& mac); + +bool operator==(const Mac &a, const Mac &b); +bool operator!=(const Mac &a, const Mac &b); +bool operator<(const Mac &a, const Mac &b); + class BluetoothCallback { virtual ~BluetoothCallback() = default; |