Add additional code for implementing BluetoothClassicMedium.

This commit is contained in:
Vibhav Pant
2023-08-01 18:27:05 +05:30
parent a891e8bee0
commit 24d1021bfa
11 changed files with 332 additions and 144 deletions
@@ -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};
};