From 1f9073cfcb1a9674beb839efa24046851dee0222 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Mon, 10 Oct 2016 10:32:22 -0700 Subject: [PATCH] wifi(interface): Add status for every method Add a status parameter for every HIDL interface object method which can possibly become invalid. This should help inform the caller that the object being used is stale/invalid now. While there, Rename |CommandFailureReson| to |FailureReasonCode|. NOTE: |FailureReason| will continue to indicate any errors during the processing of the command via the corresponding |onFailure| callback. Bug: 32056230 Test: Compiles Change-Id: I2ec5af3075221e483579410f344bcedd6bf17a93 --- wifi/1.0/Android.mk | 62 +++++++++++++++---- wifi/1.0/IWifiChip.hal | 130 +++++++++++++++++++++++++++++++++------- wifi/1.0/IWifiIface.hal | 12 +++- wifi/1.0/IWifiRttController.hal | 6 +- wifi/1.0/IWifiStaIface.hal | 49 ++++++++++++--- wifi/1.0/types.hal | 24 ++++++-- 6 files changed, 234 insertions(+), 49 deletions(-) diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk index a1a716d2..e345dd2e 100644 --- a/wifi/1.0/Android.mk +++ b/wifi/1.0/Android.mk @@ -13,9 +13,9 @@ intermediates := $(local-generated-sources-dir) HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX) # -# Build types.hal (CommandFailureReason) +# Build types.hal (FailureReason) # -GEN := $(intermediates)/android/hardware/wifi/1.0/CommandFailureReason.java +GEN := $(intermediates)/android/hardware/wifi/1.0/FailureReason.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -23,16 +23,16 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.CommandFailureReason + android.hardware.wifi@1.0::types.FailureReason $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) # -# Build types.hal (FailureReason) +# Build types.hal (FailureReasonCode) # -GEN := $(intermediates)/android/hardware/wifi/1.0/FailureReason.java +GEN := $(intermediates)/android/hardware/wifi/1.0/FailureReasonCode.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -40,7 +40,7 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.FailureReason + android.hardware.wifi@1.0::types.FailureReasonCode $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) @@ -64,6 +64,23 @@ $(GEN): $(LOCAL_PATH)/types.hal LOCAL_GENERATED_SOURCES += $(GEN) # +# Build types.hal (StatusCode) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StatusCode.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StatusCode + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# # Build IWifi.hal # GEN := $(intermediates)/android/hardware/wifi/1.0/IWifi.java @@ -242,6 +259,8 @@ $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiRttController.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal $(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ @@ -307,9 +326,9 @@ intermediates := $(local-generated-sources-dir) HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX) # -# Build types.hal (CommandFailureReason) +# Build types.hal (FailureReason) # -GEN := $(intermediates)/android/hardware/wifi/1.0/CommandFailureReason.java +GEN := $(intermediates)/android/hardware/wifi/1.0/FailureReason.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -317,16 +336,16 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.CommandFailureReason + android.hardware.wifi@1.0::types.FailureReason $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) # -# Build types.hal (FailureReason) +# Build types.hal (FailureReasonCode) # -GEN := $(intermediates)/android/hardware/wifi/1.0/FailureReason.java +GEN := $(intermediates)/android/hardware/wifi/1.0/FailureReasonCode.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -334,7 +353,7 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.FailureReason + android.hardware.wifi@1.0::types.FailureReasonCode $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) @@ -358,6 +377,23 @@ $(GEN): $(LOCAL_PATH)/types.hal LOCAL_GENERATED_SOURCES += $(GEN) # +# Build types.hal (StatusCode) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StatusCode.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StatusCode + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# # Build IWifi.hal # GEN := $(intermediates)/android/hardware/wifi/1.0/IWifi.java @@ -536,6 +572,8 @@ $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiRttController.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal $(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal index 55f6d61a..c9ff0381 100644 --- a/wifi/1.0/IWifiChip.hal +++ b/wifi/1.0/IWifiChip.hal @@ -121,9 +121,13 @@ interface IWifiChip { /** * Get the id assigned to this chip. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return id Assigned chip Id. */ - getId() generates (ChipId id); + getId() generates (StatusCode status, ChipId id); /** * Requests notifications of significant events on this chip. Multiple calls @@ -132,15 +136,23 @@ interface IWifiChip { * * @param callback An instance of the |IWifiChipEventCallback| HIDL interface * object. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - oneway registerEventCallback(IWifiChipEventCallback callback); + registerEventCallback(IWifiChipEventCallback callback) generates (StatusCode status); /** * Get the set of operation modes that the chip supports. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return modes List of modes supported by the device. */ - getAvailableModes() generates (vec modes); + getAvailableModes() generates (StatusCode status, vec modes); /** * Reconfigure the Chip. @@ -149,37 +161,60 @@ interface IWifiChip { * * @param modeId The mode that the chip should switch to, corresponding to the * id property of the target ChipMode. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - oneway configureChip(ChipModeId modeId); + configureChip(ChipModeId modeId) generates (StatusCode status); /** * Get the current mode that the chip is in. * * @return modeId The mode that the chip is currently configured to, * corresponding to the id property of the target ChipMode. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - getMode() generates (ChipModeId modeId); + getMode() generates (StatusCode status, ChipModeId modeId); /** * Request information about the chip. * Must trigger |IWifiChipEventCallback.onChipDebugInfoAvailable| on sucess, * or |IWifiChipEventCallback.onChipDebugInfoFailure| on failure. + * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - oneway requestChipDebugInfo(); + requestChipDebugInfo() generates (StatusCode status); /** * Request vendor debug info from the driver. * Must trigger |IWifiChipEventCallback.onDriverDebugDumpAvailable| on success, * or |IWifiChipEventCallback.onDriverDebugDumpFailure| on failure. + * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - oneway requestDriverDebugDump(); + requestDriverDebugDump() generates (StatusCode status); /** * Request vendor debug info from the firmware. * Must trigger |IWifiChipEventCallback.onFirmwareDebugDumpAvailable| on * success, or |IWifiChipEventCallback.onFirmwareDebugDumpFailure| on failure. + * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - oneway requestFirmwareDebugDump(); + requestFirmwareDebugDump() generates (StatusCode status); /** * Create an AP iface on the chip. @@ -188,29 +223,41 @@ interface IWifiChip { * may fail if we've already reached the maximum allowed * (specified in |ChipIfaceCombination|) number of ifaces of the AP type. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * successful, null otherwise. */ - createApIface() generates (IWifiApIface iface); + createApIface() generates (StatusCode status, IWifiApIface iface); /** * List all the AP iface names configured on the chip. * The corresponding |IWifiApIface| object for any iface are * retrieved using |getApIface| method. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return ifnames List of all AP iface names on the chip. */ - getApIfaceNames() generates (vec ifnames); + getApIfaceNames() generates (StatusCode status, vec ifnames); /** * Gets a HIDL interface object for the AP Iface corresponding * to the provided ifname. * * @param ifname Name of the iface. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * it exists, null otherwise. */ - getApIface(string ifname) generates (IWifiApIface iface); + getApIface(string ifname) generates (StatusCode status, IWifiApIface iface); /** * Create a NAN iface on the chip. @@ -219,29 +266,41 @@ interface IWifiChip { * may fail if we've already reached the maximum allowed * (specified in |ChipIfaceCombination|) number of ifaces of the NAN type. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * successful, null otherwise. */ - createNanIface() generates (IWifiNanIface iface); + createNanIface() generates (StatusCode status, IWifiNanIface iface); /** * List all the NAN iface names configured on the chip. * The corresponding |IWifiNanIface| object for any iface are * retrieved using |getNanIface| method. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return ifnames List of all NAN iface names on the chip. */ - getNanIfaceNames() generates (vec ifnames); + getNanIfaceNames() generates (StatusCode status, vec ifnames); /** * Gets a HIDL interface object for the NAN Iface corresponding * to the provided ifname. * * @param ifname Name of the iface. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * it exists, null otherwise. */ - getNanIface(string ifname) generates (IWifiNanIface iface); + getNanIface(string ifname) generates (StatusCode status, IWifiNanIface iface); /** * Create a P2P iface on the chip. @@ -250,29 +309,41 @@ interface IWifiChip { * may fail if we've already reached the maximum allowed * (specified in |ChipIfaceCombination|) number of ifaces of the P2P type. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * successful, null otherwise. */ - createP2pIface() generates (IWifiP2pIface iface); + createP2pIface() generates (StatusCode status, IWifiP2pIface iface); /** * List all the P2P iface names configured on the chip. * The corresponding |IWifiP2pIface| object for any iface are * retrieved using |getP2pIface| method. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return ifnames List of all P2P iface names on the chip. */ - getP2pIfaceNames() generates (vec ifnames); + getP2pIfaceNames() generates (StatusCode status, vec ifnames); /** * Gets a HIDL interface object for the P2P Iface corresponding * to the provided ifname. * * @param ifname Name of the iface. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * it exists, null otherwise. */ - getP2pIface(string ifname) generates (IWifiP2pIface iface); + getP2pIface(string ifname) generates (StatusCode status, IWifiP2pIface iface); /** * Create an STA iface on the chip. @@ -281,29 +352,41 @@ interface IWifiChip { * may fail if we've already reached the maximum allowed * (specified in |ChipIfaceCombination|) number of ifaces of the STA type. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * successful, null otherwise. */ - createStaIface() generates (IWifiStaIface iface); + createStaIface() generates (StatusCode status, IWifiStaIface iface); /** * List all the STA iface names configured on the chip. * The corresponding |IWifiStaIface| object for any iface are * retrieved using |getStaIface| method. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return ifnames List of all STA iface names on the chip. */ - getStaIfaceNames() generates (vec ifnames); + getStaIfaceNames() generates (StatusCode status, vec ifnames); /** * Gets a HIDL interface object for the STA Iface corresponding * to the provided ifname. * * @param ifname Name of the iface. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * it exists, null otherwise. */ - getStaIface(string ifname) generates (IWifiStaIface iface); + getStaIface(string ifname) generates (StatusCode status, IWifiStaIface iface); /** * Create a RTTController instance. @@ -316,6 +399,11 @@ interface IWifiChip { * * @param boundIface HIDL interface object representing the iface if * the responder must be bound to a specific iface, null otherwise. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - createRttController(IWifiIface boundIface) generates (IWifiRttController rtt); + createRttController(IWifiIface boundIface) + generates (StatusCode status, IWifiRttController rtt); }; diff --git a/wifi/1.0/IWifiIface.hal b/wifi/1.0/IWifiIface.hal index f4150e79..726a973f 100644 --- a/wifi/1.0/IWifiIface.hal +++ b/wifi/1.0/IWifiIface.hal @@ -23,14 +23,22 @@ interface IWifiIface { /** * Get the type of this iface. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| * @return type One of the supported iface types. */ - getType() generates (IfaceType type); + getType() generates (StatusCode status, IfaceType type); /** * Get the name of this iface. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| * @return name Name of the iface. */ - getName() generates (string name); + getName() generates (StatusCode status, string name); }; diff --git a/wifi/1.0/IWifiRttController.hal b/wifi/1.0/IWifiRttController.hal index d735da76..cc827bbd 100644 --- a/wifi/1.0/IWifiRttController.hal +++ b/wifi/1.0/IWifiRttController.hal @@ -25,8 +25,12 @@ interface IWifiRttController { /** * Get the iface on which the RTT operations will be performed. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID| * @return boundIface HIDL interface object representing the iface if bound * to a specific iface, null otherwise */ - getBoundIface() generates (IWifiIface boundIface); + getBoundIface() generates (StatusCode status, IWifiIface boundIface); }; diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal index a738ebe4..402385bb 100644 --- a/wifi/1.0/IWifiStaIface.hal +++ b/wifi/1.0/IWifiStaIface.hal @@ -213,24 +213,37 @@ interface IWifiStaIface extends IWifiIface { * * @param callback An instance of the |IWifiStaIfaceEventCallback| HIDL interface * object. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| */ - oneway registerEventCallback(IWifiStaIfaceEventCallback callback); + registerEventCallback(IWifiStaIfaceEventCallback callback) + generates (StatusCode status); /** * Get the capabilities supported by this STA iface. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| * @return capabilities Bitset of |StaIfaceCapabilityMask| values. */ - getCapabilities() generates (uint64_t capabilities); + getCapabilities() generates (StatusCode status, uint64_t capabilities); /** * Used to query additional information about the chip's APF capabilities. * Will fail if |StaIfaceCapabilityMask.APF| is not set. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| * @return capabilities Instance of |ApfPacketFilterCapabilities|. */ getApfPacketFilterCapabilities() - generates (ApfPacketFilterCapabilities capabilities); + generates (StatusCode status, ApfPacketFilterCapabilities capabilities); /** * Installs an APF program on this iface, replacing an existing @@ -238,18 +251,27 @@ interface IWifiStaIface extends IWifiIface { * Will fail if |StaIfaceCapabilityMask.APF| is not set. * * @param cmdId command Id to use for this invocation. - * @param program APF Program to be set. + * @param APF Program to be set. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| */ - oneway installApfPacketFilter(CommandId cmdId, vec program); + installApfPacketFilter(CommandId cmdId, vec program) + generates (StatusCode status); /** * Used to query additional information about the chip's APF capabilities. * Will fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| * @return capabilities Instance of |BackgroundScanCapabilities|. */ getBackgroundScanCapabilities() - generates (BackgroundScanCapabilities capabilities); + generates (StatusCode status, BackgroundScanCapabilities capabilities); /** * Start a background scan using the given cmdId as an identifier. Only one @@ -278,14 +300,23 @@ interface IWifiStaIface extends IWifiIface { * WIFI_SCAN_FLAG_INTERRUPTED flag set. * * @param cmdId command Id to use for this invocation. - * @param params Background scan parameters. + * @params Background scan parameters. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| */ - oneway startBackgroundScan(CommandId cmdId, BackgroundScanParameters params); + startBackgroundScan(CommandId cmdId, BackgroundScanParameters params) + generates (StatusCode status); /** * Stop the background scan started. * * @param cmdId command Id corresponding to the request. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| */ - oneway stopBackgroundScan(CommandId cmdId); + stopBackgroundScan(CommandId cmdId) generates (StatusCode status); }; diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal index cabb97dc..25d4fa1d 100644 --- a/wifi/1.0/types.hal +++ b/wifi/1.0/types.hal @@ -17,9 +17,24 @@ package android.hardware.wifi@1.0; /** - * List of failure reasons returned. + * Enum values indicating whether the command processing was successfully + * initiated or not. */ -enum CommandFailureReason : uint32_t { +enum StatusCode : uint32_t { + /** No errors. Command processing successfully initiated. */ + SUCCESS, + /** Method invoked on an invalid |IWifiChip| object. */ + ERROR_WIFI_CHIP_INVALID, + /** Method invoked on an invalid |IWifiIface| object. */ + ERROR_WIFI_IFACE_INVALID, + /** Method invoked on an invalid |IWifiRttController| object. */ + ERROR_WIFI_RTT_CONTROLLER_INVALID +}; + +/** + * List of failure reasons returned in |FailureReason|. + */ +enum FailureReasonCode : uint32_t { UNKNOWN, DUPLICATE_COMMAND_ID, NOT_SUPPORTED, @@ -32,10 +47,11 @@ enum CommandFailureReason : uint32_t { /** * Generic structure to return information about a failure. + * The failure reason will be returned in the corresponding |onFailure| + * callback. */ struct FailureReason { - CommandFailureReason reason; - + FailureReasonCode reason; /** * A vendor specific error message from the vendor to provide more * information beyond the reason code. -- 2.11.0