mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 07:06:11 -04:00
Signed-off-by: Alexey Polyudov <apolyudov@google.com> Change-Id: I9850950db8bd84f0904ea1a413151887f52098cf
56 lines
1.5 KiB
C++
56 lines
1.5 KiB
C++
#ifndef CORE_INTERNAL_MEDIUMS_MEDIUMS_H_
|
|
#define CORE_INTERNAL_MEDIUMS_MEDIUMS_H_
|
|
|
|
#include "core/internal/mediums/ble.h"
|
|
#include "core/internal/mediums/bluetooth_classic.h"
|
|
#include "core/internal/mediums/bluetooth_radio.h"
|
|
#include "core/internal/mediums/webrtc.h"
|
|
#include "core/internal/mediums/wifi_lan.h"
|
|
|
|
namespace location {
|
|
namespace nearby {
|
|
namespace connections {
|
|
|
|
// Facilitates convenient and reliable usage of various wireless mediums.
|
|
class Mediums {
|
|
public:
|
|
Mediums() = default;
|
|
~Mediums() = default;
|
|
|
|
// Returns a handle to the Bluetooth radio.
|
|
BluetoothRadio& GetBluetoothRadio();
|
|
|
|
// Returns a handle to the Bluetooth Classic medium.
|
|
BluetoothClassic& GetBluetoothClassic();
|
|
|
|
// Returns a handle to the Ble medium.
|
|
Ble& GetBle();
|
|
|
|
// Returns a handle to the Wifi-Lan medium.
|
|
WifiLan& GetWifiLan();
|
|
|
|
// Returns a handle to the WebRtc medium.
|
|
mediums::WebRtc& GetWebRtc();
|
|
|
|
private:
|
|
// The order of declaration is critical for both construction and
|
|
// destruction.
|
|
//
|
|
// 1) Construction: The individual mediums have a dependency on the
|
|
// corresponding radio, so the radio must be initialized first.
|
|
//
|
|
// 2) Destruction: The individual mediums should be shut down before the
|
|
// corresponding radio.
|
|
BluetoothRadio bluetooth_radio_;
|
|
BluetoothClassic bluetooth_classic_{bluetooth_radio_};
|
|
Ble ble_{bluetooth_radio_};
|
|
WifiLan wifi_lan_;
|
|
mediums::WebRtc webrtc_;
|
|
};
|
|
|
|
} // namespace connections
|
|
} // namespace nearby
|
|
} // namespace location
|
|
|
|
#endif // CORE_INTERNAL_MEDIUMS_MEDIUMS_H_
|