Loading wifi/1.2/default/wifi_nan_iface.cpp +22 −7 Original line number Diff line number Diff line Loading @@ -427,7 +427,8 @@ WifiNanIface::WifiNanIface( return; } for (const auto& callback : shared_ptr_this->getEventCallbacks()) { for (const auto& callback : shared_ptr_this->getEventCallbacks_1_2()) { if (!callback->eventDataPathConfirm_1_2(hidl_struct).isOk()) { LOG(ERROR) << "Failed to invoke the callback"; } Loading Loading @@ -483,7 +484,7 @@ WifiNanIface::WifiNanIface( return; } for (const auto& callback : shared_ptr_this->getEventCallbacks()) { for (const auto& callback : shared_ptr_this->getEventCallbacks_1_2()) { if (!callback->eventDataPathScheduleUpdate(hidl_struct).isOk()) { LOG(ERROR) << "Failed to invoke the callback"; } Loading @@ -507,6 +508,7 @@ void WifiNanIface::invalidate() { legacy_hal_.reset(); event_cb_handler_.invalidate(); event_cb_handler_1_2_.invalidate(); is_valid_ = false; } Loading @@ -514,10 +516,16 @@ bool WifiNanIface::isValid() { return is_valid_; } std::string WifiNanIface::getName() { return ifname_; } std::set<sp<IWifiNanIfaceEventCallback>> WifiNanIface::getEventCallbacks() { std::set<sp<V1_0::IWifiNanIfaceEventCallback>> WifiNanIface::getEventCallbacks() { return event_cb_handler_.getCallbacks(); } std::set<sp<V1_2::IWifiNanIfaceEventCallback>> WifiNanIface::getEventCallbacks_1_2() { return event_cb_handler_1_2_.getCallbacks(); } Return<void> WifiNanIface::getName(getName_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, &WifiNanIface::getNameInternal, hidl_status_cb); Loading Loading @@ -681,8 +689,11 @@ std::pair<WifiStatus, IfaceType> WifiNanIface::getTypeInternal() { } WifiStatus WifiNanIface::registerEventCallbackInternal( const sp<V1_0::IWifiNanIfaceEventCallback>& /*callback*/) { return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); const sp<V1_0::IWifiNanIfaceEventCallback>& callback) { if (!event_cb_handler_.addCallback(callback)) { return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } return createWifiStatus(WifiStatusCode::SUCCESS); } WifiStatus WifiNanIface::getCapabilitiesRequestInternal(uint16_t cmd_id) { Loading Loading @@ -808,8 +819,12 @@ WifiStatus WifiNanIface::terminateDataPathRequestInternal( } WifiStatus WifiNanIface::registerEventCallback_1_2Internal( const sp<IWifiNanIfaceEventCallback>& callback) { if (!event_cb_handler_.addCallback(callback)) { const sp<V1_2::IWifiNanIfaceEventCallback>& callback) { sp<V1_0::IWifiNanIfaceEventCallback> callback_1_0 = callback; if (!event_cb_handler_.addCallback(callback_1_0)) { return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } if (!event_cb_handler_1_2_.addCallback(callback)) { return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } return createWifiStatus(WifiStatusCode::SUCCESS); Loading wifi/1.2/default/wifi_nan_iface.h +8 −3 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ class WifiNanIface : public V1_2::IWifiNanIface { uint32_t ndpInstanceId); WifiStatus registerEventCallback_1_2Internal( const sp<IWifiNanIfaceEventCallback>& callback); const sp<V1_2::IWifiNanIfaceEventCallback>& callback); WifiStatus enableRequest_1_2Internal( uint16_t cmd_id, const NanEnableRequest& msg1, const NanConfigRequestSupplemental& msg2); Loading @@ -140,13 +140,18 @@ class WifiNanIface : public V1_2::IWifiNanIface { uint16_t cmd_id, const NanConfigRequest& msg, const NanConfigRequestSupplemental& msg2); std::set<sp<IWifiNanIfaceEventCallback>> getEventCallbacks(); // all 1_0 and descendant callbacks std::set<sp<V1_0::IWifiNanIfaceEventCallback>> getEventCallbacks(); // all 1_2 and descendant callbacks std::set<sp<V1_2::IWifiNanIfaceEventCallback>> getEventCallbacks_1_2(); std::string ifname_; std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_; bool is_valid_; hidl_callback_util::HidlCallbackHandler<IWifiNanIfaceEventCallback> hidl_callback_util::HidlCallbackHandler<V1_0::IWifiNanIfaceEventCallback> event_cb_handler_; hidl_callback_util::HidlCallbackHandler<V1_2::IWifiNanIfaceEventCallback> event_cb_handler_1_2_; DISALLOW_COPY_AND_ASSIGN(WifiNanIface); }; Loading Loading
wifi/1.2/default/wifi_nan_iface.cpp +22 −7 Original line number Diff line number Diff line Loading @@ -427,7 +427,8 @@ WifiNanIface::WifiNanIface( return; } for (const auto& callback : shared_ptr_this->getEventCallbacks()) { for (const auto& callback : shared_ptr_this->getEventCallbacks_1_2()) { if (!callback->eventDataPathConfirm_1_2(hidl_struct).isOk()) { LOG(ERROR) << "Failed to invoke the callback"; } Loading Loading @@ -483,7 +484,7 @@ WifiNanIface::WifiNanIface( return; } for (const auto& callback : shared_ptr_this->getEventCallbacks()) { for (const auto& callback : shared_ptr_this->getEventCallbacks_1_2()) { if (!callback->eventDataPathScheduleUpdate(hidl_struct).isOk()) { LOG(ERROR) << "Failed to invoke the callback"; } Loading @@ -507,6 +508,7 @@ void WifiNanIface::invalidate() { legacy_hal_.reset(); event_cb_handler_.invalidate(); event_cb_handler_1_2_.invalidate(); is_valid_ = false; } Loading @@ -514,10 +516,16 @@ bool WifiNanIface::isValid() { return is_valid_; } std::string WifiNanIface::getName() { return ifname_; } std::set<sp<IWifiNanIfaceEventCallback>> WifiNanIface::getEventCallbacks() { std::set<sp<V1_0::IWifiNanIfaceEventCallback>> WifiNanIface::getEventCallbacks() { return event_cb_handler_.getCallbacks(); } std::set<sp<V1_2::IWifiNanIfaceEventCallback>> WifiNanIface::getEventCallbacks_1_2() { return event_cb_handler_1_2_.getCallbacks(); } Return<void> WifiNanIface::getName(getName_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, &WifiNanIface::getNameInternal, hidl_status_cb); Loading Loading @@ -681,8 +689,11 @@ std::pair<WifiStatus, IfaceType> WifiNanIface::getTypeInternal() { } WifiStatus WifiNanIface::registerEventCallbackInternal( const sp<V1_0::IWifiNanIfaceEventCallback>& /*callback*/) { return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); const sp<V1_0::IWifiNanIfaceEventCallback>& callback) { if (!event_cb_handler_.addCallback(callback)) { return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } return createWifiStatus(WifiStatusCode::SUCCESS); } WifiStatus WifiNanIface::getCapabilitiesRequestInternal(uint16_t cmd_id) { Loading Loading @@ -808,8 +819,12 @@ WifiStatus WifiNanIface::terminateDataPathRequestInternal( } WifiStatus WifiNanIface::registerEventCallback_1_2Internal( const sp<IWifiNanIfaceEventCallback>& callback) { if (!event_cb_handler_.addCallback(callback)) { const sp<V1_2::IWifiNanIfaceEventCallback>& callback) { sp<V1_0::IWifiNanIfaceEventCallback> callback_1_0 = callback; if (!event_cb_handler_.addCallback(callback_1_0)) { return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } if (!event_cb_handler_1_2_.addCallback(callback)) { return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } return createWifiStatus(WifiStatusCode::SUCCESS); Loading
wifi/1.2/default/wifi_nan_iface.h +8 −3 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ class WifiNanIface : public V1_2::IWifiNanIface { uint32_t ndpInstanceId); WifiStatus registerEventCallback_1_2Internal( const sp<IWifiNanIfaceEventCallback>& callback); const sp<V1_2::IWifiNanIfaceEventCallback>& callback); WifiStatus enableRequest_1_2Internal( uint16_t cmd_id, const NanEnableRequest& msg1, const NanConfigRequestSupplemental& msg2); Loading @@ -140,13 +140,18 @@ class WifiNanIface : public V1_2::IWifiNanIface { uint16_t cmd_id, const NanConfigRequest& msg, const NanConfigRequestSupplemental& msg2); std::set<sp<IWifiNanIfaceEventCallback>> getEventCallbacks(); // all 1_0 and descendant callbacks std::set<sp<V1_0::IWifiNanIfaceEventCallback>> getEventCallbacks(); // all 1_2 and descendant callbacks std::set<sp<V1_2::IWifiNanIfaceEventCallback>> getEventCallbacks_1_2(); std::string ifname_; std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_; bool is_valid_; hidl_callback_util::HidlCallbackHandler<IWifiNanIfaceEventCallback> hidl_callback_util::HidlCallbackHandler<V1_0::IWifiNanIfaceEventCallback> event_cb_handler_; hidl_callback_util::HidlCallbackHandler<V1_2::IWifiNanIfaceEventCallback> event_cb_handler_1_2_; DISALLOW_COPY_AND_ASSIGN(WifiNanIface); }; Loading