Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66dcae06 authored by Etan Cohen's avatar Etan Cohen Committed by Gerrit Code Review
Browse files

Merge "[AWARE] Update HIDL to match spec and add comments"

parents ff14eb32 44983aee
Loading
Loading
Loading
Loading
+21 −3
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@ import IWifiNanIfaceEventCallback;

/**
 * Interface used to represent a single NAN(Neighbour Aware Network) iface.
 *
 * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness
 * Networking (NAN) Technical Specification".
 */
interface IWifiNanIface extends IWifiIface {
  /**
@@ -39,7 +42,8 @@ interface IWifiNanIface extends IWifiIface {
      generates (WifiStatus status);

  /**
   * Get NAN capabilities.
   * Get NAN capabilities. Asynchronous response is with
   * |IWifiNanIfaceEventCallback.notifyCapabilitiesResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @return status WifiStatus of the operation.
@@ -53,8 +57,9 @@ interface IWifiNanIface extends IWifiIface {
  /**
   * Enable NAN: configures and activates NAN clustering (does not start
   * a discovery session or set up data-interfaces or data-paths). Use the
   * |configureRequest| method to change the configuration of an already enabled
   * |IWifiNanIface.configureRequest| method to change the configuration of an already enabled
   * NAN interface.
   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyEnableResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @param msg Instance of |NanEnableRequest|.
@@ -70,7 +75,8 @@ interface IWifiNanIface extends IWifiIface {

  /**
   * Configure NAN: configures an existing NAN functionality (i.e. assumes
   * |enableRequest| already submitted and succeeded).
   * |IWifiNanIface.enableRequest| already submitted and succeeded).
   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyConfigResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @param msg Instance of |NanConfigRequest|.
@@ -86,6 +92,7 @@ interface IWifiNanIface extends IWifiIface {

  /**
   * Disable NAN functionality.
   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyDisableResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @return status WifiStatus of the operation.
@@ -98,6 +105,7 @@ interface IWifiNanIface extends IWifiIface {

  /**
   * Publish request to start advertising a discovery service.
   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStartPublishResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @param msg Instance of |NanPublishRequest|.
@@ -113,6 +121,7 @@ interface IWifiNanIface extends IWifiIface {

  /**
   * Stop publishing a discovery service.
   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStopPublishResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @param sessionId ID of the publish discovery session to be stopped.
@@ -127,6 +136,7 @@ interface IWifiNanIface extends IWifiIface {

  /**
   * Subscribe request to start searching for a discovery service.
   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStartSubscribeResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @param msg Instance of |NanSubscribeRequest|.
@@ -142,6 +152,7 @@ interface IWifiNanIface extends IWifiIface {

  /**
   * Stop subscribing to a discovery service.
   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStopSubscribeResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @param sessionId ID of the subscribe discovery session to be stopped.
@@ -156,6 +167,7 @@ interface IWifiNanIface extends IWifiIface {

  /**
   * NAN transmit follow up message request.
   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyTransmitFollowupResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @param msg Instance of |NanTransmitFollowupRequest|.
@@ -171,6 +183,7 @@ interface IWifiNanIface extends IWifiIface {

  /**
   * Create a NAN Data Interface.
   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyCreateDataInterfaceResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @return status WifiStatus of the operation.
@@ -184,6 +197,7 @@ interface IWifiNanIface extends IWifiIface {

  /**
   * Delete a NAN Data Interface.
   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyDeleteDataInterfaceResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @return status WifiStatus of the operation.
@@ -197,6 +211,7 @@ interface IWifiNanIface extends IWifiIface {

  /**
   * Initiate a data-path (NDP) setup operation: Initiator.
   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyInitiateDataPathResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @param msg Instance of |NanInitiateDataPathRequest|.
@@ -213,6 +228,8 @@ interface IWifiNanIface extends IWifiIface {
  /**
   * Respond to a received data indication as part of a data-path (NDP) setup operation. An
   * indication is received by the Responder from the Initiator.
   * Asynchronous response is with
   * |IWifiNanIfaceEventCallback.notifyRespondToDataPathIndicationResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @param msg Instance of |NanRespondToDataPathIndicationRequest|.
@@ -229,6 +246,7 @@ interface IWifiNanIface extends IWifiIface {

  /**
   * Data-path (NDP) termination request: executed by either Initiator or Responder.
   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyTerminateDataPathResponse|.
   *
   * @param cmdId command Id to use for this invocation.
   * @param ndpInstanceId Data-path instance ID to be terminated.
+33 −15
Original line number Diff line number Diff line
@@ -18,10 +18,19 @@ package android.hardware.wifi@1.0;

/**
 * NAN Response and Asynchronous Event Callbacks.
 *
 * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness
 * Networking (NAN) Technical Specification".
 */
interface IWifiNanIfaceEventCallback {
  /**
   * Callback invoked in response to a capability request |getCapabilitiesRequest|.
   * Notify callbacks are asynchronous callbacks - but in response to |IWifiNanIface| method calls.
   * Each method will receive a notify callback to return results (on success) or failure status.
   */

  /**
   * Asynchronous callback invoked in response to a capability request
   * |IWifiNanIface.getCapabilitiesRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -32,7 +41,7 @@ interface IWifiNanIfaceEventCallback {
                                    NanCapabilities capabilities);

  /**
   * Callback invoked in response to an enable request |enableRequest|.
   * Asynchronous callback invoked in response to an enable request |IWifiNanIface.enableRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -46,7 +55,7 @@ interface IWifiNanIfaceEventCallback {
  oneway notifyEnableResponse(CommandIdShort id, WifiNanStatus status);

  /**
   * Callback invoked in response to a config request |configRequest|.
   * Asynchronous callback invoked in response to a config request |IWifiNanIface.configRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -58,7 +67,7 @@ interface IWifiNanIfaceEventCallback {
  oneway notifyConfigResponse(CommandIdShort id, WifiNanStatus status);

  /**
   * Callback invoked in response to a disable request |disableRequest|.
   * Asynchronous callback invoked in response to a disable request |IWifiNanIface.disableRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -68,7 +77,8 @@ interface IWifiNanIfaceEventCallback {
  oneway notifyDisableResponse(CommandIdShort id, WifiNanStatus status);

  /**
   * Callback invoked to notify the status of the start publish request |startPublishRequest|.
   * Asynchronous callback invoked to notify the status of the start publish request
   * |IWifiNanIface.startPublishRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -82,7 +92,8 @@ interface IWifiNanIfaceEventCallback {
  oneway notifyStartPublishResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId);

  /**
   * Callback invoked in response to a stop publish request |stopPublishRequest|.
   * Asynchronous callback invoked in response to a stop publish request
   * |IWifiNanIface.stopPublishRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -93,7 +104,8 @@ interface IWifiNanIfaceEventCallback {
  oneway notifyStopPublishResponse(CommandIdShort id, WifiNanStatus status);

  /**
   * Callback invoked to notify the status of the start subscribe request |startSubscribeRequest|.
   * Asynchronous callback invoked to notify the status of the start subscribe request
   * |IWifiNanIface.startSubscribeRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -107,7 +119,8 @@ interface IWifiNanIfaceEventCallback {
  oneway notifyStartSubscribeResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId);

  /**
   * Callback invoked in response to a stop subscribe request |stopSubscribeRequest|.
   * Asynchronous callback invoked in response to a stop subscribe request
   * |IWifiNanIface.stopSubscribeRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -118,7 +131,8 @@ interface IWifiNanIfaceEventCallback {
  oneway notifyStopSubscribeResponse(CommandIdShort id, WifiNanStatus status);

  /**
   * Callback invoked in response to a transmit followup request |transmitFollowupRequest|.
   * Asynchronous callback invoked in response to a transmit followup request
   * |IWifiNanIface.transmitFollowupRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -131,7 +145,8 @@ interface IWifiNanIfaceEventCallback {
  oneway notifyTransmitFollowupResponse(CommandIdShort id, WifiNanStatus status);

  /**
   * Callback invoked in response to a create data interface request |createDataInterfaceRequest|.
   * Asynchronous callback invoked in response to a create data interface request
   * |IWifiNanIface.createDataInterfaceRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -142,7 +157,8 @@ interface IWifiNanIfaceEventCallback {
  oneway notifyCreateDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);

  /**
   * Callback invoked in response to a delete data interface request |deleteDataInterfaceRequest|.
   * Asynchronous callback invoked in response to a delete data interface request
   * |IWifiNanIface.deleteDataInterfaceRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -153,7 +169,8 @@ interface IWifiNanIfaceEventCallback {
  oneway notifyDeleteDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);

  /**
   * Callback invoked in response to an initiate data path request |initiateDataPathRequest|.
   * Asynchronous callback invoked in response to an initiate data path request
   * |IWifiNanIface.initiateDataPathRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -168,8 +185,8 @@ interface IWifiNanIfaceEventCallback {
        uint32_t ndpInstanceId );

  /**
   * Callback invoked in response to a respond to data path indication request
   * |respondToDataPathIndicationRequest|.
   * Asynchronous callback invoked in response to a respond to data path indication request
   * |IWifiNanIface.respondToDataPathIndicationRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -182,7 +199,8 @@ interface IWifiNanIfaceEventCallback {
  oneway notifyRespondToDataPathIndicationResponse(CommandIdShort id, WifiNanStatus status);

  /**
   * Callback invoked in response to a terminate data path request |terminateDataPathRequest|.
   * Asynchronous callback invoked in response to a terminate data path request
   * |IWifiNanIface.terminateDataPathRequest|.
   *
   * @param cmdId command Id corresponding to the original request.
   * @param status WifiNanStatus of the operation. Possible status codes are:
+18 −17
Original line number Diff line number Diff line
@@ -780,12 +780,13 @@ bool convertHidlNanEnableRequestToLegacy(
  legacy_request->discovery_indication_cfg |=
        hidl_request.configParams.disableJoinedClusterIndication ? 0x4 : 0x0;
  legacy_request->config_sid_beacon = 1;
  if (hidl_request.configParams.numberOfServiceIdsInBeacon > 127) {
    LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: numberOfServiceIdsInBeacon > 127";
  if (hidl_request.configParams.numberOfPublishServiceIdsInBeacon > 127) {
    LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: numberOfPublishServiceIdsInBeacon > 127";
    return false;
  }
  legacy_request->sid_beacon_val = (hidl_request.configParams.includeServiceIdsInBeacon ? 0x1 : 0x0)
        | (hidl_request.configParams.numberOfServiceIdsInBeacon << 1);
  legacy_request->sid_beacon_val =
        (hidl_request.configParams.includePublishServiceIdsInBeacon ? 0x1 : 0x0)
            | (hidl_request.configParams.numberOfPublishServiceIdsInBeacon << 1);
  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;
@@ -809,7 +810,7 @@ bool convertHidlNanEnableRequestToLegacy(
  legacy_request->config_2dot4g_rssi_proximity = 1;
  legacy_request->rssi_proximity_2dot4g_val =
        hidl_request.configParams.bandSpecificConfig[
            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiCloseProximity;
  legacy_request->config_scan_params = 1;
  legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
        hidl_request.configParams.bandSpecificConfig[
@@ -832,7 +833,7 @@ bool convertHidlNanEnableRequestToLegacy(
  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;
            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiCloseProximity;
  legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
        hidl_request.configParams.bandSpecificConfig[
            (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
@@ -850,8 +851,8 @@ bool convertHidlNanEnableRequestToLegacy(
  legacy_request->config_dw.dw_5g_interval_val = hidl_request.configParams
        .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].discoveryWindowIntervalVal;
  if (hidl_request.debugConfigs.validClusterIdVals) {
    legacy_request->cluster_low = hidl_request.debugConfigs.clusterIdLowVal;
    legacy_request->cluster_high = hidl_request.debugConfigs.clusterIdHighVal;
    legacy_request->cluster_low = hidl_request.debugConfigs.clusterIdBottomRangeVal;
    legacy_request->cluster_high = hidl_request.debugConfigs.clusterIdTopRangeVal;
  } else { // need 'else' since not configurable in legacy HAL
    legacy_request->cluster_low = 0x0000;
    legacy_request->cluster_high = 0xFFFF;
@@ -1072,13 +1073,13 @@ bool convertHidlNanTransmitFollowupRequestToLegacy(
        legacy_hal::NAN_TX_PRIORITY_HIGH : legacy_hal::NAN_TX_PRIORITY_NORMAL;
  legacy_request->dw_or_faw = hidl_request.shouldUseDiscoveryWindow ?
        legacy_hal::NAN_TRANSMIT_IN_DW : legacy_hal::NAN_TRANSMIT_IN_FAW;
  legacy_request->service_specific_info_len = hidl_request.message.size();
  legacy_request->service_specific_info_len = hidl_request.serviceSpecificInfo.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,
        hidl_request.message.data(),
        hidl_request.serviceSpecificInfo.data(),
        legacy_request->service_specific_info_len);
  legacy_request->recv_indication_cfg = hidl_request.disableFollowupResultIndication ? 0x1 : 0x0;

@@ -1104,12 +1105,12 @@ bool convertHidlNanConfigRequestToLegacy(
  legacy_request->discovery_indication_cfg |=
        hidl_request.disableJoinedClusterIndication ? 0x4 : 0x0;
  legacy_request->config_sid_beacon = 1;
  if (hidl_request.numberOfServiceIdsInBeacon > 127) {
    LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: numberOfServiceIdsInBeacon > 127";
  if (hidl_request.numberOfPublishServiceIdsInBeacon > 127) {
    LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: numberOfPublishServiceIdsInBeacon > 127";
    return false;
  }
  legacy_request->sid_beacon = (hidl_request.includeServiceIdsInBeacon ? 0x1 : 0x0)
        | (hidl_request.numberOfServiceIdsInBeacon << 1);
  legacy_request->sid_beacon = (hidl_request.includePublishServiceIdsInBeacon ? 0x1 : 0x0)
        | (hidl_request.numberOfPublishServiceIdsInBeacon << 1);
  legacy_request->config_rssi_window_size = 1;
  legacy_request->rssi_window_size_val = hidl_request.rssiWindowSize;
  legacy_request->config_disc_mac_addr_randomization = 1;
@@ -1130,7 +1131,7 @@ bool convertHidlNanConfigRequestToLegacy(
  legacy_request->config_2dot4g_rssi_proximity = 1;
  legacy_request->rssi_proximity_2dot4g_val =
        hidl_request.bandSpecificConfig[
            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiCloseProximity;
  */
  legacy_request->config_scan_params = 1;
  legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
@@ -1156,7 +1157,7 @@ bool convertHidlNanConfigRequestToLegacy(
  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;
            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiCloseProximity;
  legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
        hidl_request.bandSpecificConfig[
            (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
@@ -1322,7 +1323,7 @@ bool convertLegacyNanFollowupIndToHidl(
  hidl_ind->peerId = legacy_ind.requestor_instance_id;
  hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
  hidl_ind->receivedInFaw = legacy_ind.dw_or_faw == 1;
  hidl_ind->message = std::vector<uint8_t>(legacy_ind.service_specific_info,
  hidl_ind->serviceSpecificInfo = std::vector<uint8_t>(legacy_ind.service_specific_info,
        legacy_ind.service_specific_info + legacy_ind.service_specific_info_len);

  return true;
+239 −151

File changed.

Preview size limit exceeded, changes collapsed.