diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index 37fcfea..7464b81 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -759,17 +759,17 @@
     const NanEnableRequest& hidl_request,
     legacy_hal::NanEnableRequest* legacy_request) {
   if (!legacy_request) {
+    LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: null legacy_request";
     return false;
   }
   memset(legacy_request, 0, sizeof(legacy_hal::NanEnableRequest));
 
-  // TODO: b/34059183 tracks missing configurations in legacy HAL or uknown defaults
   legacy_request->config_2dot4g_support = 1;
   legacy_request->support_2dot4g_val = hidl_request.operateInBand[
         (size_t) NanBandIndex::NAN_BAND_24GHZ];
   legacy_request->config_support_5g = 1;
   legacy_request->support_5g_val = hidl_request.operateInBand[(size_t) NanBandIndex::NAN_BAND_5GHZ];
-  legacy_request->config_hop_count_limit = 0; // TODO: don't know default yet
+  legacy_request->config_hop_count_limit = 1;
   legacy_request->hop_count_limit_val = hidl_request.hopCountMax;
   legacy_request->master_pref = hidl_request.configParams.masterPref;
   legacy_request->discovery_indication_cfg = 0;
@@ -781,11 +781,12 @@
         hidl_request.configParams.disableJoinedClusterIndication ? 0x4 : 0x0;
   legacy_request->config_sid_beacon = 1;
   if (hidl_request.configParams.numberOfServiceIdsInBeacon > 127) {
+    LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: numberOfServiceIdsInBeacon > 127";
     return false;
   }
   legacy_request->sid_beacon_val = (hidl_request.configParams.includeServiceIdsInBeacon ? 0x1 : 0x0)
         | (hidl_request.configParams.numberOfServiceIdsInBeacon << 1);
-  legacy_request->config_rssi_window_size = 0; // TODO: don't know default yet
+  legacy_request->config_rssi_window_size = 1;
   legacy_request->rssi_window_size_val = hidl_request.configParams.rssiWindowSize;
   legacy_request->config_disc_mac_addr_randomization = 1;
   legacy_request->disc_mac_addr_rand_interval_sec =
@@ -793,19 +794,23 @@
   legacy_request->config_responder_auto_response = 1;
   legacy_request->ranging_auto_response_cfg = hidl_request.configParams.acceptRangingRequests ?
        legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
-  legacy_request->config_2dot4g_rssi_close = 0; // TODO: don't know default yet
+  legacy_request->config_2dot4g_rssi_close = 1;
+  if (hidl_request.configParams.bandSpecificConfig.size() != 2) {
+    LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: bandSpecificConfig.size() != 2";
+    return false;
+  }
   legacy_request->rssi_close_2dot4g_val =
         hidl_request.configParams.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiClose;
-  legacy_request->config_2dot4g_rssi_middle = 0; // TODO: don't know default yet
+  legacy_request->config_2dot4g_rssi_middle = 1;
   legacy_request->rssi_middle_2dot4g_val =
         hidl_request.configParams.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiMiddle;
-  legacy_request->config_2dot4g_rssi_proximity = 0; // TODO: don't know default yet
+  legacy_request->config_2dot4g_rssi_proximity = 1;
   legacy_request->rssi_proximity_2dot4g_val =
         hidl_request.configParams.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
-  legacy_request->config_scan_params = 0; // TODO: don't know default yet
+  legacy_request->config_scan_params = 1;
   legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
         hidl_request.configParams.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_24GHZ].dwellTimeMs;
@@ -816,15 +821,15 @@
         .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].validDiscoveryWindowIntervalVal;
   legacy_request->config_dw.dw_2dot4g_interval_val = hidl_request.configParams
         .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].discoveryWindowIntervalVal;
-  legacy_request->config_5g_rssi_close = 0; // TODO: don't know default yet
+  legacy_request->config_5g_rssi_close = 1;
   legacy_request->rssi_close_5g_val =
         hidl_request.configParams.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiClose;
-  legacy_request->config_5g_rssi_middle = 0; // TODO: don't know default yet
+  legacy_request->config_5g_rssi_middle = 1;
   legacy_request->rssi_middle_5g_val =
         hidl_request.configParams.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiMiddle;
-  legacy_request->config_5g_rssi_close_proximity = 0; // TODO: don't know default yet
+  legacy_request->config_5g_rssi_close_proximity = 1;
   legacy_request->rssi_close_proximity_5g_val =
         hidl_request.configParams.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiProximity;
@@ -885,6 +890,7 @@
     const NanPublishRequest& hidl_request,
     legacy_hal::NanPublishRequest* legacy_request) {
   if (!legacy_request) {
+    LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: null legacy_request";
     return false;
   }
   memset(legacy_request, 0, sizeof(legacy_hal::NanPublishRequest));
@@ -895,14 +901,16 @@
   legacy_request->publish_count = hidl_request.baseConfigs.discoveryCount;
   legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size();
   if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
+    LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: service_name_len too large";
     return false;
   }
-  memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.c_str(),
+  memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.data(),
         legacy_request->service_name_len);
   legacy_request->publish_match_indicator =
         (legacy_hal::NanMatchAlg) hidl_request.baseConfigs.discoveryMatchIndicator;
   legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size();
   if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
+    LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: service_specific_info_len too large";
     return false;
   }
   memcpy(legacy_request->service_specific_info,
@@ -910,6 +918,7 @@
         legacy_request->service_specific_info_len);
   legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size();
   if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
+    LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: rx_match_filter_len too large";
     return false;
   }
   memcpy(legacy_request->rx_match_filter,
@@ -917,6 +926,7 @@
         legacy_request->rx_match_filter_len);
   legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size();
   if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
+    LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: tx_match_filter_len too large";
     return false;
   }
   memcpy(legacy_request->tx_match_filter,
@@ -933,6 +943,7 @@
   legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes;
   legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
   if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
+    LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: pmk_len too large";
     return false;
   }
   memcpy(legacy_request->pmk,
@@ -957,6 +968,7 @@
     const NanSubscribeRequest& hidl_request,
     legacy_hal::NanSubscribeRequest* legacy_request) {
   if (!legacy_request) {
+    LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: legacy_request is null";
     return false;
   }
   memset(legacy_request, 0, sizeof(legacy_hal::NanSubscribeRequest));
@@ -967,14 +979,16 @@
   legacy_request->subscribe_count = hidl_request.baseConfigs.discoveryCount;
   legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size();
   if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
+    LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: service_name_len too large";
     return false;
   }
-  memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.c_str(),
+  memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.data(),
         legacy_request->service_name_len);
   legacy_request->subscribe_match_indicator =
         (legacy_hal::NanMatchAlg) hidl_request.baseConfigs.discoveryMatchIndicator;
   legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size();
   if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
+    LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: service_specific_info_len too large";
     return false;
   }
   memcpy(legacy_request->service_specific_info,
@@ -982,6 +996,7 @@
         legacy_request->service_specific_info_len);
   legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size();
   if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
+    LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: rx_match_filter_len too large";
     return false;
   }
   memcpy(legacy_request->rx_match_filter,
@@ -989,6 +1004,7 @@
         legacy_request->rx_match_filter_len);
   legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size();
   if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
+    LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: tx_match_filter_len too large";
     return false;
   }
   memcpy(legacy_request->tx_match_filter,
@@ -1005,6 +1021,7 @@
   legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes;
   legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
   if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
+    LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: pmk_len too large";
     return false;
   }
   memcpy(legacy_request->pmk,
@@ -1029,6 +1046,7 @@
         legacy_hal::NAN_SSI_REQUIRED_IN_MATCH_IND : legacy_hal::NAN_SSI_NOT_REQUIRED_IN_MATCH_IND;
   legacy_request->num_intf_addr_present = hidl_request.intfAddr.size();
   if (legacy_request->num_intf_addr_present > NAN_MAX_SUBSCRIBE_MAX_ADDRESS) {
+    LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: num_intf_addr_present - too many";
     return false;
   }
   for (int i = 0; i < legacy_request->num_intf_addr_present; i++) {
@@ -1042,6 +1060,7 @@
     const NanTransmitFollowupRequest& hidl_request,
     legacy_hal::NanTransmitFollowupRequest* legacy_request) {
   if (!legacy_request) {
+    LOG(ERROR) << "convertHidlNanTransmitFollowupRequestToLegacy: legacy_request is null";
     return false;
   }
   memset(legacy_request, 0, sizeof(legacy_hal::NanTransmitFollowupRequest));
@@ -1055,6 +1074,7 @@
         legacy_hal::NAN_TRANSMIT_IN_DW : legacy_hal::NAN_TRANSMIT_IN_FAW;
   legacy_request->service_specific_info_len = hidl_request.message.size();
   if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
+    LOG(ERROR) << "convertHidlNanTransmitFollowupRequestToLegacy: service_specific_info_len too large";
     return false;
   }
   memcpy(legacy_request->service_specific_info,
@@ -1069,6 +1089,7 @@
     const NanConfigRequest& hidl_request,
     legacy_hal::NanConfigRequest* legacy_request) {
   if (!legacy_request) {
+    LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: legacy_request is null";
     return false;
   }
   memset(legacy_request, 0, sizeof(legacy_hal::NanConfigRequest));
@@ -1084,11 +1105,12 @@
         hidl_request.disableJoinedClusterIndication ? 0x4 : 0x0;
   legacy_request->config_sid_beacon = 1;
   if (hidl_request.numberOfServiceIdsInBeacon > 127) {
+    LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: numberOfServiceIdsInBeacon > 127";
     return false;
   }
   legacy_request->sid_beacon = (hidl_request.includeServiceIdsInBeacon ? 0x1 : 0x0)
         | (hidl_request.numberOfServiceIdsInBeacon << 1);
-  legacy_request->config_rssi_window_size = 0; // TODO: don't know default yet
+  legacy_request->config_rssi_window_size = 1;
   legacy_request->rssi_window_size_val = hidl_request.rssiWindowSize;
   legacy_request->config_disc_mac_addr_randomization = 1;
   legacy_request->disc_mac_addr_rand_interval_sec =
@@ -1097,20 +1119,20 @@
   legacy_request->ranging_auto_response_cfg = hidl_request.acceptRangingRequests ?
        legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
   /* TODO : missing
-  legacy_request->config_2dot4g_rssi_close = 0; // TODO: don't know default yet
+  legacy_request->config_2dot4g_rssi_close = 1;
   legacy_request->rssi_close_2dot4g_val =
         hidl_request.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiClose;
-  legacy_request->config_2dot4g_rssi_middle = 0; // TODO: don't know default yet
+  legacy_request->config_2dot4g_rssi_middle = 1;
   legacy_request->rssi_middle_2dot4g_val =
         hidl_request.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiMiddle;
-  legacy_request->config_2dot4g_rssi_proximity = 0; // TODO: don't know default yet
+  legacy_request->config_2dot4g_rssi_proximity = 1;
   legacy_request->rssi_proximity_2dot4g_val =
         hidl_request.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
   */
-  legacy_request->config_scan_params = 0; // TODO: don't know default yet
+  legacy_request->config_scan_params = 1;
   legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
         hidl_request.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_24GHZ].dwellTimeMs;
@@ -1122,16 +1144,16 @@
   legacy_request->config_dw.dw_2dot4g_interval_val = hidl_request
         .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].discoveryWindowIntervalVal;
   /* TODO: missing
-  legacy_request->config_5g_rssi_close = 0; // TODO: don't know default yet
+  legacy_request->config_5g_rssi_close = 1;
   legacy_request->rssi_close_5g_val =
         hidl_request.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiClose;
-  legacy_request->config_5g_rssi_middle = 0; // TODO: don't know default yet
+  legacy_request->config_5g_rssi_middle = 1;
   legacy_request->rssi_middle_5g_val =
         hidl_request.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiMiddle;
   */
-  legacy_request->config_5g_rssi_close_proximity = 0; // TODO: don't know default yet
+  legacy_request->config_5g_rssi_close_proximity = 1;
   legacy_request->rssi_close_proximity_5g_val =
         hidl_request.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiProximity;
@@ -1159,6 +1181,7 @@
     const NanBeaconSdfPayloadRequest& hidl_request,
     legacy_hal::NanBeaconSdfPayloadRequest* legacy_request) {
   if (!legacy_request) {
+    LOG(ERROR) << "convertHidlNanBeaconSdfPayloadRequestToLegacy: legacy_request is null";
     return false;
   }
   memset(legacy_request, 0, sizeof(legacy_hal::NanBeaconSdfPayloadRequest));
@@ -1170,6 +1193,7 @@
   legacy_request->vsa.vendor_oui = hidl_request.vendorOui;
   legacy_request->vsa.vsa_len = hidl_request.vsa.size();
   if (legacy_request->vsa.vsa_len > NAN_MAX_VSA_DATA_LEN) {
+    LOG(ERROR) << "convertHidlNanBeaconSdfPayloadRequestToLegacy: vsa_len too long";
     return false;
   }
   memcpy(legacy_request->vsa.vsa, hidl_request.vsa.data(), legacy_request->vsa.vsa_len);
@@ -1181,6 +1205,7 @@
     const NanInitiateDataPathRequest& hidl_request,
     legacy_hal::NanDataPathInitiatorRequest* legacy_request) {
   if (!legacy_request) {
+    LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: legacy_request is null";
     return false;
   }
   memset(legacy_request, 0, sizeof(legacy_hal::NanDataPathInitiatorRequest));
@@ -1195,6 +1220,7 @@
         legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
   legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size();
   if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) {
+    LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: ndp_app_info_len to large";
     return false;
   }
   memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
@@ -1213,6 +1239,7 @@
     const NanRespondToDataPathIndicationRequest& hidl_request,
     legacy_hal::NanDataPathIndicationResponse* legacy_request) {
   if (!legacy_request) {
+    LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: legacy_request is null";
     return false;
   }
   memset(legacy_request, 0, sizeof(legacy_hal::NanDataPathIndicationResponse));
@@ -1225,6 +1252,7 @@
         legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
   legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size();
   if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) {
+    LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: ndp_app_info_len too large";
     return false;
   }
   memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
@@ -1232,6 +1260,7 @@
   legacy_request->cipher_type = hidl_request.supportedCipherTypes;
   legacy_request->pmk_len = hidl_request.pmk.size();
   if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
+    LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: pmk_len too large";
     return false;
   }
   memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len);
@@ -1243,6 +1272,7 @@
     const legacy_hal::NanResponseMsg& legacy_response,
     WifiNanStatus* wifiNanStatus) {
   if (!wifiNanStatus) {
+    LOG(ERROR) << "convertLegacyNanResponseHeaderToHidl: wifiNanStatus is null";
     return false;
   }
   wifiNanStatus->status = convertLegacyNanStatusTypeToHidl(legacy_response.status);
@@ -1255,6 +1285,7 @@
     const legacy_hal::NanCapabilities& legacy_response,
     NanCapabilities* hidl_response) {
   if (!hidl_response) {
+    LOG(ERROR) << "convertLegacyNanCapabilitiesResponseToHidl: hidl_response is null";
     return false;
   }
   hidl_response->maxConcurrentClusters = legacy_response.max_concurrent_nan_clusters;
@@ -1280,6 +1311,7 @@
     const legacy_hal::NanMatchInd& legacy_ind,
     NanMatchInd* hidl_ind) {
   if (!hidl_ind) {
+    LOG(ERROR) << "convertLegacyNanMatchIndToHidl: hidl_ind is null";
     return false;
   }
   hidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id;
@@ -1307,6 +1339,7 @@
     const legacy_hal::NanFollowupInd& legacy_ind,
     NanFollowupReceivedInd* hidl_ind) {
   if (!hidl_ind) {
+    LOG(ERROR) << "convertLegacyNanFollowupIndToHidl: hidl_ind is null";
     return false;
   }
   hidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id;
@@ -1323,6 +1356,7 @@
     const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
     NanBeaconSdfPayloadInd* hidl_ind) {
   if (!hidl_ind) {
+    LOG(ERROR) << "convertLegacyNanBeaconSdfPayloadIndToHidl: hidl_ind is null";
     return false;
   }
   hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
@@ -1342,6 +1376,7 @@
     const legacy_hal::NanDataPathRequestInd& legacy_ind,
     NanDataPathRequestInd* hidl_ind) {
   if (!hidl_ind) {
+    LOG(ERROR) << "convertLegacyNanDataPathRequestIndToHidl: hidl_ind is null";
     return false;
   }
   hidl_ind->discoverySessionId = legacy_ind.service_instance_id;
@@ -1359,6 +1394,7 @@
     const legacy_hal::NanDataPathConfirmInd& legacy_ind,
     NanDataPathConfirmInd* hidl_ind) {
   if (!hidl_ind) {
+    LOG(ERROR) << "convertLegacyNanDataPathConfirmIndToHidl: hidl_ind is null";
     return false;
   }
   hidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id;
diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.0/default/wifi_nan_iface.cpp
index 5ac6fa8..333fac7 100644
--- a/wifi/1.0/default/wifi_nan_iface.cpp
+++ b/wifi/1.0/default/wifi_nan_iface.cpp
@@ -60,6 +60,7 @@
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
     }
     case legacy_hal::NAN_RESPONSE_DISABLED: {
         for (const auto& callback : shared_ptr_this->event_callbacks_) {
@@ -67,6 +68,7 @@
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
     }
     case legacy_hal::NAN_RESPONSE_PUBLISH: {
         for (const auto& callback : shared_ptr_this->event_callbacks_) {
@@ -75,6 +77,7 @@
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
     }
     case legacy_hal::NAN_RESPONSE_PUBLISH_CANCEL: {
         for (const auto& callback : shared_ptr_this->event_callbacks_) {
@@ -82,6 +85,7 @@
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
     }
     case legacy_hal::NAN_RESPONSE_TRANSMIT_FOLLOWUP: {
         for (const auto& callback : shared_ptr_this->event_callbacks_) {
@@ -89,6 +93,7 @@
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
     }
     case legacy_hal::NAN_RESPONSE_SUBSCRIBE: {
         for (const auto& callback : shared_ptr_this->event_callbacks_) {
@@ -97,6 +102,7 @@
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
     }
     case legacy_hal::NAN_RESPONSE_SUBSCRIBE_CANCEL: {
         for (const auto& callback : shared_ptr_this->event_callbacks_) {
@@ -104,6 +110,7 @@
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
     }
     case legacy_hal::NAN_RESPONSE_CONFIG: {
         for (const auto& callback : shared_ptr_this->event_callbacks_) {
@@ -111,6 +118,7 @@
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
      }
     case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD: {
         for (const auto& callback : shared_ptr_this->event_callbacks_) {
@@ -118,6 +126,7 @@
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
      }
     case legacy_hal::NAN_GET_CAPABILITIES: {
         NanCapabilities hidl_struct;
@@ -132,6 +141,7 @@
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
     }
     case legacy_hal::NAN_DP_INTERFACE_CREATE: {
         for (const auto& callback : shared_ptr_this->event_callbacks_) {
@@ -139,6 +149,7 @@
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
     }
     case legacy_hal::NAN_DP_INTERFACE_DELETE: {
         for (const auto& callback : shared_ptr_this->event_callbacks_) {
@@ -146,18 +157,20 @@
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
     }
     case legacy_hal::NAN_DP_INITIATOR_RESPONSE: {
         for (const auto& callback : shared_ptr_this->event_callbacks_) {
-          if (!callback->notifyInitiateDataPathResponse(id, wifiNanStatus).isOk()) {
+          if (!callback->notifyInitiateDataPathResponse(id, wifiNanStatus,
+                msg.body.data_request_response.ndp_instance_id).isOk()) {
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
     }
     case legacy_hal::NAN_DP_RESPONDER_RESPONSE: {
         for (const auto& callback : shared_ptr_this->event_callbacks_) {
-          if (!callback->notifyRespondToDataPathIndicationResponse(id, wifiNanStatus,
-                    msg.body.data_request_response.ndp_instance_id).isOk()) {
+          if (!callback->notifyRespondToDataPathIndicationResponse(id, wifiNanStatus).isOk()) {
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
@@ -168,6 +181,7 @@
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
     }
     case legacy_hal::NAN_RESPONSE_TCA:
         /* fall through */
