mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Add additional code for implementing BluetoothClassicMedium.
This commit is contained in:
@@ -40,19 +40,27 @@ private:
|
||||
|
||||
class BluetoothSocket : public api::BluetoothSocket {
|
||||
public:
|
||||
BluetoothSocket(std::string object, int fd) {
|
||||
BluetoothSocket(api::BluetoothDevice &device,
|
||||
absl::string_view device_object_path,
|
||||
absl::string_view connected_profile_uuid, int fd)
|
||||
: device_(device) {
|
||||
fd_ = fd;
|
||||
object_ = object;
|
||||
device_object_path_ = device_object_path;
|
||||
connected_profile_uuid_ = connected_profile_uuid;
|
||||
input_stream_ = BluetoothInputStream(fd_);
|
||||
output_stream_ = BluetoothOutputStream(fd_);
|
||||
}
|
||||
|
||||
InputStream &GetInputStream() override { return input_stream_; }
|
||||
OutputStream &GetOutputStream() override { return output_stream_; }
|
||||
Exception Close() override;
|
||||
api::BluetoothDevice *GetRemoteDevice() override { return &device_; };
|
||||
|
||||
private:
|
||||
int fd_;
|
||||
std::string object_;
|
||||
std::string device_object_path_;
|
||||
api::BluetoothDevice &device_;
|
||||
std::string connected_profile_uuid_;
|
||||
BluetoothInputStream input_stream_ = {-1};
|
||||
BluetoothOutputStream output_stream_ = {-1};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user