Loading bluetooth/1.0/default/bluetooth_hci.cc +5 −0 Original line number Diff line number Diff line Loading @@ -30,9 +30,13 @@ static const uint8_t HCI_DATA_TYPE_COMMAND = 1; static const uint8_t HCI_DATA_TYPE_ACL = 2; static const uint8_t HCI_DATA_TYPE_SCO = 3; BluetoothHci::BluetoothHci() : deathRecipient(new BluetoothDeathRecipient(this)) {} Return<void> BluetoothHci::initialize( const ::android::sp<IBluetoothHciCallbacks>& cb) { ALOGW("BluetoothHci::initialize()"); cb->linkToDeath(deathRecipient, 0); event_cb_ = cb; bool rc = VendorInterface::Initialize( Loading Loading @@ -62,6 +66,7 @@ Return<void> BluetoothHci::initialize( Return<void> BluetoothHci::close() { ALOGW("BluetoothHci::close()"); event_cb_->unlinkToDeath(deathRecipient); VendorInterface::Shutdown(); return Void(); } Loading bluetooth/1.0/default/bluetooth_hci.h +13 −0 Original line number Diff line number Diff line Loading @@ -30,8 +30,20 @@ namespace implementation { using ::android::hardware::Return; using ::android::hardware::hidl_vec; struct BluetoothDeathRecipient : hidl_death_recipient { BluetoothDeathRecipient(const sp<IBluetoothHci> hci) : mHci(hci) {} virtual void serviceDied( uint64_t /*cookie*/, const wp<::android::hidl::base::V1_0::IBase>& /*who*/) { mHci->close(); } sp<IBluetoothHci> mHci; }; class BluetoothHci : public IBluetoothHci { public: BluetoothHci(); Return<void> initialize( const ::android::sp<IBluetoothHciCallbacks>& cb) override; Return<void> sendHciCommand(const hidl_vec<uint8_t>& packet) override; Loading @@ -42,6 +54,7 @@ class BluetoothHci : public IBluetoothHci { private: void sendDataToController(const uint8_t type, const hidl_vec<uint8_t>& data); ::android::sp<IBluetoothHciCallbacks> event_cb_; ::android::sp<BluetoothDeathRecipient> deathRecipient; }; extern "C" IBluetoothHci* HIDL_FETCH_IBluetoothHci(const char* name); Loading Loading
bluetooth/1.0/default/bluetooth_hci.cc +5 −0 Original line number Diff line number Diff line Loading @@ -30,9 +30,13 @@ static const uint8_t HCI_DATA_TYPE_COMMAND = 1; static const uint8_t HCI_DATA_TYPE_ACL = 2; static const uint8_t HCI_DATA_TYPE_SCO = 3; BluetoothHci::BluetoothHci() : deathRecipient(new BluetoothDeathRecipient(this)) {} Return<void> BluetoothHci::initialize( const ::android::sp<IBluetoothHciCallbacks>& cb) { ALOGW("BluetoothHci::initialize()"); cb->linkToDeath(deathRecipient, 0); event_cb_ = cb; bool rc = VendorInterface::Initialize( Loading Loading @@ -62,6 +66,7 @@ Return<void> BluetoothHci::initialize( Return<void> BluetoothHci::close() { ALOGW("BluetoothHci::close()"); event_cb_->unlinkToDeath(deathRecipient); VendorInterface::Shutdown(); return Void(); } Loading
bluetooth/1.0/default/bluetooth_hci.h +13 −0 Original line number Diff line number Diff line Loading @@ -30,8 +30,20 @@ namespace implementation { using ::android::hardware::Return; using ::android::hardware::hidl_vec; struct BluetoothDeathRecipient : hidl_death_recipient { BluetoothDeathRecipient(const sp<IBluetoothHci> hci) : mHci(hci) {} virtual void serviceDied( uint64_t /*cookie*/, const wp<::android::hidl::base::V1_0::IBase>& /*who*/) { mHci->close(); } sp<IBluetoothHci> mHci; }; class BluetoothHci : public IBluetoothHci { public: BluetoothHci(); Return<void> initialize( const ::android::sp<IBluetoothHciCallbacks>& cb) override; Return<void> sendHciCommand(const hidl_vec<uint8_t>& packet) override; Loading @@ -42,6 +54,7 @@ class BluetoothHci : public IBluetoothHci { private: void sendDataToController(const uint8_t type, const hidl_vec<uint8_t>& data); ::android::sp<IBluetoothHciCallbacks> event_cb_; ::android::sp<BluetoothDeathRecipient> deathRecipient; }; extern "C" IBluetoothHci* HIDL_FETCH_IBluetoothHci(const char* name); Loading