mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge changes from topic "nan_suspension_hal"
* changes: Add NAN session suspension in shim layer. Add AIDL definitions for NAN suspension.
This commit is contained in:
@@ -49,6 +49,8 @@ interface IWifiNanIface {
|
||||
void stopPublishRequest(in char cmdId, in byte sessionId);
|
||||
void stopSubscribeRequest(in char cmdId, in byte sessionId);
|
||||
void terminateDataPathRequest(in char cmdId, in int ndpInstanceId);
|
||||
void suspendRequest(in char cmdId, in byte sessionId);
|
||||
void resumeRequest(in char cmdId, in byte sessionId);
|
||||
void transmitFollowupRequest(in char cmdId, in android.hardware.wifi.NanTransmitFollowupRequest msg);
|
||||
void initiatePairingRequest(in char cmdId, in android.hardware.wifi.NanPairingRequest msg);
|
||||
void respondToPairingIndicationRequest(in char cmdId, in android.hardware.wifi.NanRespondToPairingIndicationRequest msg);
|
||||
|
||||
@@ -59,6 +59,8 @@ interface IWifiNanIfaceEventCallback {
|
||||
oneway void notifyStopPublishResponse(in char id, in android.hardware.wifi.NanStatus status);
|
||||
oneway void notifyStopSubscribeResponse(in char id, in android.hardware.wifi.NanStatus status);
|
||||
oneway void notifyTerminateDataPathResponse(in char id, in android.hardware.wifi.NanStatus status);
|
||||
oneway void notifySuspendResponse(in char id, in android.hardware.wifi.NanStatus status);
|
||||
oneway void notifyResumeResponse(in char id, in android.hardware.wifi.NanStatus status);
|
||||
oneway void notifyTransmitFollowupResponse(in char id, in android.hardware.wifi.NanStatus status);
|
||||
oneway void eventPairingRequest(in android.hardware.wifi.NanPairingRequestInd event);
|
||||
oneway void eventPairingConfirm(in android.hardware.wifi.NanPairingConfirmInd event);
|
||||
|
||||
@@ -64,20 +64,20 @@ interface IWifiStaIface {
|
||||
void setDtimMultiplier(in int multiplier);
|
||||
@Backing(type="int") @VintfStability
|
||||
enum StaIfaceCapabilityMask {
|
||||
APF = 1,
|
||||
BACKGROUND_SCAN = 2,
|
||||
LINK_LAYER_STATS = 4,
|
||||
RSSI_MONITOR = 8,
|
||||
CONTROL_ROAMING = 16,
|
||||
PROBE_IE_ALLOWLIST = 32,
|
||||
SCAN_RAND = 64,
|
||||
STA_5G = 128,
|
||||
HOTSPOT = 256,
|
||||
PNO = 512,
|
||||
TDLS = 1024,
|
||||
TDLS_OFFCHANNEL = 2048,
|
||||
ND_OFFLOAD = 4096,
|
||||
KEEP_ALIVE = 8192,
|
||||
DEBUG_PACKET_FATE = 16384,
|
||||
APF = (1 << 0),
|
||||
BACKGROUND_SCAN = (1 << 1),
|
||||
LINK_LAYER_STATS = (1 << 2),
|
||||
RSSI_MONITOR = (1 << 3),
|
||||
CONTROL_ROAMING = (1 << 4),
|
||||
PROBE_IE_ALLOWLIST = (1 << 5),
|
||||
SCAN_RAND = (1 << 6),
|
||||
STA_5G = (1 << 7),
|
||||
HOTSPOT = (1 << 8),
|
||||
PNO = (1 << 9),
|
||||
TDLS = (1 << 10),
|
||||
TDLS_OFFCHANNEL = (1 << 11),
|
||||
ND_OFFLOAD = (1 << 12),
|
||||
KEEP_ALIVE = (1 << 13),
|
||||
DEBUG_PACKET_FATE = (1 << 14),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum IfaceConcurrencyType {
|
||||
STA = 0,
|
||||
AP = 1,
|
||||
AP_BRIDGED = 2,
|
||||
P2P = 3,
|
||||
NAN_IFACE = 4,
|
||||
STA,
|
||||
AP,
|
||||
AP_BRIDGED,
|
||||
P2P,
|
||||
NAN_IFACE,
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum IfaceType {
|
||||
STA = 0,
|
||||
AP = 1,
|
||||
P2P = 2,
|
||||
NAN_IFACE = 3,
|
||||
STA,
|
||||
AP,
|
||||
P2P,
|
||||
NAN_IFACE,
|
||||
}
|
||||
|
||||
@@ -35,6 +35,6 @@ package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanBandIndex {
|
||||
NAN_BAND_24GHZ = 0,
|
||||
NAN_BAND_5GHZ = 1,
|
||||
NAN_BAND_5GHZ,
|
||||
NAN_BAND_6GHZ = 2,
|
||||
}
|
||||
|
||||
@@ -34,15 +34,15 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanBootstrappingMethod {
|
||||
BOOTSTRAPPING_OPPORTUNISTIC_MASK = 1,
|
||||
BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK = 2,
|
||||
BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK = 4,
|
||||
BOOTSTRAPPING_QR_DISPLAY_MASK = 8,
|
||||
BOOTSTRAPPING_NFC_TAG_MASK = 16,
|
||||
BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK = 32,
|
||||
BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK = 64,
|
||||
BOOTSTRAPPING_QR_SCAN_MASK = 128,
|
||||
BOOTSTRAPPING_NFC_READER_MASK = 256,
|
||||
BOOTSTRAPPING_SERVICE_MANAGED_MASK = 16384,
|
||||
BOOTSTRAPPING_HANDSHAKE_SHIP_MASK = 32768,
|
||||
BOOTSTRAPPING_OPPORTUNISTIC_MASK = (1 << 0),
|
||||
BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK = (1 << 1),
|
||||
BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK = (1 << 2),
|
||||
BOOTSTRAPPING_QR_DISPLAY_MASK = (1 << 3),
|
||||
BOOTSTRAPPING_NFC_TAG_MASK = (1 << 4),
|
||||
BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK = (1 << 5),
|
||||
BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK = (1 << 6),
|
||||
BOOTSTRAPPING_QR_SCAN_MASK = (1 << 7),
|
||||
BOOTSTRAPPING_NFC_READER_MASK = (1 << 8),
|
||||
BOOTSTRAPPING_SERVICE_MANAGED_MASK = (1 << 14),
|
||||
BOOTSTRAPPING_HANDSHAKE_SHIP_MASK = (1 << 15),
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@ package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanCipherSuiteType {
|
||||
NONE = 0,
|
||||
SHARED_KEY_128_MASK = 1,
|
||||
SHARED_KEY_256_MASK = 2,
|
||||
PUBLIC_KEY_128_MASK = 4,
|
||||
PUBLIC_KEY_256_MASK = 8,
|
||||
SHARED_KEY_128_MASK = (1 << 0),
|
||||
SHARED_KEY_256_MASK = (1 << 1),
|
||||
PUBLIC_KEY_128_MASK = (1 << 2),
|
||||
PUBLIC_KEY_256_MASK = (1 << 3),
|
||||
}
|
||||
|
||||
@@ -35,6 +35,6 @@ package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanClusterEventType {
|
||||
DISCOVERY_MAC_ADDRESS_CHANGED = 0,
|
||||
STARTED_CLUSTER = 1,
|
||||
JOINED_CLUSTER = 2,
|
||||
STARTED_CLUSTER,
|
||||
JOINED_CLUSTER,
|
||||
}
|
||||
|
||||
@@ -35,6 +35,6 @@ package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanDataPathChannelCfg {
|
||||
CHANNEL_NOT_REQUESTED = 0,
|
||||
REQUEST_CHANNEL_SETUP = 1,
|
||||
FORCE_CHANNEL_SETUP = 2,
|
||||
REQUEST_CHANNEL_SETUP,
|
||||
FORCE_CHANNEL_SETUP,
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanDataPathSecurityType {
|
||||
OPEN = 0,
|
||||
PMK = 1,
|
||||
PASSPHRASE = 2,
|
||||
OPEN,
|
||||
PMK,
|
||||
PASSPHRASE,
|
||||
}
|
||||
|
||||
@@ -35,6 +35,6 @@ package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanMatchAlg {
|
||||
MATCH_ONCE = 0,
|
||||
MATCH_CONTINUOUS = 1,
|
||||
MATCH_NEVER = 2,
|
||||
MATCH_CONTINUOUS,
|
||||
MATCH_NEVER,
|
||||
}
|
||||
|
||||
@@ -35,5 +35,5 @@ package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanPairingRequestType {
|
||||
NAN_PAIRING_SETUP = 0,
|
||||
NAN_PAIRING_VERIFICATION = 1,
|
||||
NAN_PAIRING_VERIFICATION,
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanPairingSecurityType {
|
||||
OPPORTUNISTIC = 0,
|
||||
PMK = 1,
|
||||
PASSPHRASE = 2,
|
||||
OPPORTUNISTIC,
|
||||
PMK,
|
||||
PASSPHRASE,
|
||||
}
|
||||
|
||||
@@ -35,6 +35,6 @@ package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanPublishType {
|
||||
UNSOLICITED = 0,
|
||||
SOLICITED = 1,
|
||||
UNSOLICITED_SOLICITED = 2,
|
||||
SOLICITED,
|
||||
UNSOLICITED_SOLICITED,
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanRangingIndication {
|
||||
CONTINUOUS_INDICATION_MASK = 1,
|
||||
INGRESS_MET_MASK = 2,
|
||||
EGRESS_MET_MASK = 4,
|
||||
CONTINUOUS_INDICATION_MASK = (1 << 0),
|
||||
INGRESS_MET_MASK = (1 << 1),
|
||||
EGRESS_MET_MASK = (1 << 2),
|
||||
}
|
||||
|
||||
@@ -35,5 +35,5 @@ package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanSrfType {
|
||||
BLOOM_FILTER = 0,
|
||||
PARTIAL_MAC_ADDR = 1,
|
||||
PARTIAL_MAC_ADDR,
|
||||
}
|
||||
|
||||
@@ -49,4 +49,5 @@ enum NanStatusCode {
|
||||
UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12,
|
||||
INVALID_PAIRING_ID = 13,
|
||||
INVALID_BOOTSTRAPPING_ID = 14,
|
||||
INVALID_STATE = 15,
|
||||
}
|
||||
|
||||
@@ -35,5 +35,5 @@ package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanSubscribeType {
|
||||
PASSIVE = 0,
|
||||
ACTIVE = 1,
|
||||
ACTIVE,
|
||||
}
|
||||
|
||||
@@ -35,5 +35,5 @@ package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanTxType {
|
||||
BROADCAST = 0,
|
||||
UNICAST = 1,
|
||||
UNICAST,
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum RttBw {
|
||||
BW_UNSPECIFIED = 0,
|
||||
BW_5MHZ = 1,
|
||||
BW_10MHZ = 2,
|
||||
BW_20MHZ = 4,
|
||||
BW_40MHZ = 8,
|
||||
BW_80MHZ = 16,
|
||||
BW_160MHZ = 32,
|
||||
BW_320MHZ = 64,
|
||||
BW_UNSPECIFIED = 0x0,
|
||||
BW_5MHZ = 0x01,
|
||||
BW_10MHZ = 0x02,
|
||||
BW_20MHZ = 0x04,
|
||||
BW_40MHZ = 0x08,
|
||||
BW_80MHZ = 0x10,
|
||||
BW_160MHZ = 0x20,
|
||||
BW_320MHZ = 0x40,
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum RttPreamble {
|
||||
LEGACY = 1,
|
||||
HT = 2,
|
||||
VHT = 4,
|
||||
HE = 8,
|
||||
EHT = 16,
|
||||
LEGACY = 0x1,
|
||||
HT = 0x2,
|
||||
VHT = 0x4,
|
||||
HE = 0x8,
|
||||
EHT = 0x10,
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum StaBackgroundScanBucketEventReportSchemeMask {
|
||||
EACH_SCAN = 1,
|
||||
FULL_RESULTS = 2,
|
||||
NO_BATCH = 4,
|
||||
EACH_SCAN = (1 << 0),
|
||||
FULL_RESULTS = (1 << 1),
|
||||
NO_BATCH = (1 << 2),
|
||||
}
|
||||
|
||||
@@ -34,5 +34,5 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum StaScanDataFlagMask {
|
||||
INTERRUPTED = 1,
|
||||
INTERRUPTED = (1 << 0),
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum WifiChannelWidthInMhz {
|
||||
WIDTH_INVALID = -1,
|
||||
WIDTH_INVALID = (-1),
|
||||
WIDTH_20 = 0,
|
||||
WIDTH_40 = 1,
|
||||
WIDTH_80 = 2,
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum WifiDebugPacketFateFrameType {
|
||||
UNKNOWN = 0,
|
||||
ETHERNET_II = 1,
|
||||
MGMT_80211 = 2,
|
||||
UNKNOWN,
|
||||
ETHERNET_II,
|
||||
MGMT_80211,
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum WifiDebugRingBufferFlags {
|
||||
HAS_BINARY_ENTRIES = 1,
|
||||
HAS_ASCII_ENTRIES = 2,
|
||||
HAS_PER_PACKET_ENTRIES = 4,
|
||||
HAS_BINARY_ENTRIES = (1 << 0),
|
||||
HAS_ASCII_ENTRIES = (1 << 1),
|
||||
HAS_PER_PACKET_ENTRIES = (1 << 2),
|
||||
}
|
||||
|
||||
@@ -34,15 +34,15 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum WifiDebugRxPacketFate {
|
||||
SUCCESS = 0,
|
||||
FW_QUEUED = 1,
|
||||
FW_DROP_FILTER = 2,
|
||||
FW_DROP_INVALID = 3,
|
||||
FW_DROP_NOBUFS = 4,
|
||||
FW_DROP_OTHER = 5,
|
||||
DRV_QUEUED = 6,
|
||||
DRV_DROP_FILTER = 7,
|
||||
DRV_DROP_INVALID = 8,
|
||||
DRV_DROP_NOBUFS = 9,
|
||||
DRV_DROP_OTHER = 10,
|
||||
SUCCESS,
|
||||
FW_QUEUED,
|
||||
FW_DROP_FILTER,
|
||||
FW_DROP_INVALID,
|
||||
FW_DROP_NOBUFS,
|
||||
FW_DROP_OTHER,
|
||||
DRV_QUEUED,
|
||||
DRV_DROP_FILTER,
|
||||
DRV_DROP_INVALID,
|
||||
DRV_DROP_NOBUFS,
|
||||
DRV_DROP_OTHER,
|
||||
}
|
||||
|
||||
@@ -34,14 +34,14 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum WifiDebugTxPacketFate {
|
||||
ACKED = 0,
|
||||
SENT = 1,
|
||||
FW_QUEUED = 2,
|
||||
FW_DROP_INVALID = 3,
|
||||
FW_DROP_NOBUFS = 4,
|
||||
FW_DROP_OTHER = 5,
|
||||
DRV_QUEUED = 6,
|
||||
DRV_DROP_INVALID = 7,
|
||||
DRV_DROP_NOBUFS = 8,
|
||||
DRV_DROP_OTHER = 9,
|
||||
ACKED,
|
||||
SENT,
|
||||
FW_QUEUED,
|
||||
FW_DROP_INVALID,
|
||||
FW_DROP_NOBUFS,
|
||||
FW_DROP_OTHER,
|
||||
DRV_QUEUED,
|
||||
DRV_DROP_INVALID,
|
||||
DRV_DROP_NOBUFS,
|
||||
DRV_DROP_OTHER,
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum WifiIfaceMode {
|
||||
IFACE_MODE_STA = 1,
|
||||
IFACE_MODE_SOFTAP = 2,
|
||||
IFACE_MODE_IBSS = 4,
|
||||
IFACE_MODE_P2P_CLIENT = 8,
|
||||
IFACE_MODE_P2P_GO = 16,
|
||||
IFACE_MODE_NAN = 32,
|
||||
IFACE_MODE_MESH = 64,
|
||||
IFACE_MODE_TDLS = 128,
|
||||
IFACE_MODE_STA = (1 << 0),
|
||||
IFACE_MODE_SOFTAP = (1 << 1),
|
||||
IFACE_MODE_IBSS = (1 << 2),
|
||||
IFACE_MODE_P2P_CLIENT = (1 << 3),
|
||||
IFACE_MODE_P2P_GO = (1 << 4),
|
||||
IFACE_MODE_NAN = (1 << 5),
|
||||
IFACE_MODE_MESH = (1 << 6),
|
||||
IFACE_MODE_TDLS = (1 << 7),
|
||||
}
|
||||
|
||||
@@ -34,14 +34,14 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum WifiStatusCode {
|
||||
SUCCESS = 0,
|
||||
ERROR_WIFI_CHIP_INVALID = 1,
|
||||
ERROR_WIFI_IFACE_INVALID = 2,
|
||||
ERROR_WIFI_RTT_CONTROLLER_INVALID = 3,
|
||||
ERROR_NOT_SUPPORTED = 4,
|
||||
ERROR_NOT_AVAILABLE = 5,
|
||||
ERROR_NOT_STARTED = 6,
|
||||
ERROR_INVALID_ARGS = 7,
|
||||
ERROR_BUSY = 8,
|
||||
ERROR_UNKNOWN = 9,
|
||||
SUCCESS,
|
||||
ERROR_WIFI_CHIP_INVALID,
|
||||
ERROR_WIFI_IFACE_INVALID,
|
||||
ERROR_WIFI_RTT_CONTROLLER_INVALID,
|
||||
ERROR_NOT_SUPPORTED,
|
||||
ERROR_NOT_AVAILABLE,
|
||||
ERROR_NOT_STARTED,
|
||||
ERROR_INVALID_ARGS,
|
||||
ERROR_BUSY,
|
||||
ERROR_UNKNOWN,
|
||||
}
|
||||
|
||||
@@ -240,6 +240,32 @@ interface IWifiNanIface {
|
||||
*/
|
||||
void terminateDataPathRequest(in char cmdId, in int ndpInstanceId);
|
||||
|
||||
/**
|
||||
* Start the suspension of a discovery service.
|
||||
* Asynchronous response is with |IWifiNanIfaceEventCallback.notifySuspendResponse|.
|
||||
*
|
||||
* @param cmdId Command Id to use for this invocation.
|
||||
* @param sessionId ID of the publish/subscribe discovery session to be suspended.
|
||||
* @throws ServiceSpecificException with one of the following values:
|
||||
* |WifiStatusCode.ERROR_NOT_SUPPORTED|,
|
||||
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
|
||||
* |WifiStatusCode.ERROR_UNKNOWN|
|
||||
*/
|
||||
void suspendRequest(in char cmdId, in byte sessionId);
|
||||
|
||||
/**
|
||||
* Stop the suspension of a discovery service.
|
||||
* Asynchronous response is with |IWifiNanIfaceEventCallback.notifyResumeResponse|.
|
||||
*
|
||||
* @param cmdId Command Id to use for this invocation.
|
||||
* @param sessionId ID of the publish/subscribe discovery session to be resumed.
|
||||
* @throws ServiceSpecificException with one of the following values:
|
||||
* |WifiStatusCode.ERROR_NOT_SUPPORTED|,
|
||||
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
|
||||
* |WifiStatusCode.ERROR_UNKNOWN|
|
||||
*/
|
||||
void resumeRequest(in char cmdId, in byte sessionId);
|
||||
|
||||
/**
|
||||
* NAN transmit follow up message request.
|
||||
* Asynchronous response is with |IWifiNanIfaceEventCallback.notifyTransmitFollowupResponse|.
|
||||
|
||||
@@ -309,6 +309,32 @@ oneway interface IWifiNanIfaceEventCallback {
|
||||
*/
|
||||
void notifyTerminateDataPathResponse(in char id, in NanStatus status);
|
||||
|
||||
/**
|
||||
* Callback invoked in response to a suspension request
|
||||
* |IWifiNanIface.suspendRequest|.
|
||||
*
|
||||
* @param cmdId Command Id corresponding to the original request.
|
||||
* @param status NanStatus of the operation. Possible status codes are:
|
||||
* |NanStatusCode.SUCCESS|
|
||||
* |NanStatusCode.INVALID_SESSION_ID|
|
||||
* |NanStatusCode.INVALID_STATE|
|
||||
* |NanStatusCode.INTERNAL_FAILURE|
|
||||
*/
|
||||
void notifySuspendResponse(in char id, in NanStatus status);
|
||||
|
||||
/**
|
||||
* Callback invoked in response to a resume request
|
||||
* |IWifiNanIface.resumeRequest|.
|
||||
*
|
||||
* @param cmdId Command Id corresponding to the original request.
|
||||
* @param status NanStatus of the operation. Possible status codes are:
|
||||
* |NanStatusCode.SUCCESS|
|
||||
* |NanStatusCode.INVALID_SESSION_ID|
|
||||
* |NanStatusCode.INVALID_STATE|
|
||||
* |NanStatusCode.INTERNAL_FAILURE|
|
||||
*/
|
||||
void notifyResumeResponse(in char id, in NanStatus status);
|
||||
|
||||
/**
|
||||
* Callback invoked in response to a transmit followup request
|
||||
* |IWifiNanIface.transmitFollowupRequest|.
|
||||
|
||||
@@ -78,5 +78,9 @@ enum NanStatusCode {
|
||||
/**
|
||||
* If the bootstrapping id is invalid
|
||||
*/
|
||||
INVALID_BOOTSTRAPPING_ID = 14
|
||||
INVALID_BOOTSTRAPPING_ID = 14,
|
||||
/**
|
||||
* If the system is not in a valid state for the given request.
|
||||
*/
|
||||
INVALID_STATE = 15
|
||||
}
|
||||
|
||||
@@ -134,6 +134,8 @@ class MockNanIfaceEventCallback : public IWifiNanIfaceEventCallback {
|
||||
ndk::ScopedAStatus(char16_t, const NanStatus&, int32_t));
|
||||
MOCK_METHOD2(notifyRespondToBootstrappingIndicationResponse,
|
||||
ndk::ScopedAStatus(char16_t, const NanStatus&));
|
||||
MOCK_METHOD2(notifySuspendResponse, ndk::ScopedAStatus(char16_t, const NanStatus&));
|
||||
MOCK_METHOD2(notifyResumeResponse, ndk::ScopedAStatus(char16_t, const NanStatus&));
|
||||
};
|
||||
|
||||
class WifiNanIfaceTest : public Test {
|
||||
|
||||
@@ -1559,6 +1559,22 @@ wifi_error WifiLegacyHal::nanDataEnd(const std::string& iface_name, transaction_
|
||||
return status;
|
||||
}
|
||||
|
||||
wifi_error WifiLegacyHal::nanSuspendRequest(const std::string& iface_name, transaction_id id,
|
||||
const NanSuspendRequest& msg) {
|
||||
NanSuspendRequest msg_internal(msg);
|
||||
wifi_error status = global_func_table_.wifi_nan_suspend_request(id, getIfaceHandle(iface_name),
|
||||
&msg_internal);
|
||||
return status;
|
||||
}
|
||||
|
||||
wifi_error WifiLegacyHal::nanResumeRequest(const std::string& iface_name, transaction_id id,
|
||||
const NanResumeRequest& msg) {
|
||||
NanResumeRequest msg_internal(msg);
|
||||
wifi_error status = global_func_table_.wifi_nan_resume_request(id, getIfaceHandle(iface_name),
|
||||
&msg_internal);
|
||||
return status;
|
||||
}
|
||||
|
||||
wifi_error WifiLegacyHal::setCountryCode(const std::string& iface_name,
|
||||
const std::array<uint8_t, 2> code) {
|
||||
std::string code_str(code.data(), code.data() + code.size());
|
||||
|
||||
@@ -165,12 +165,14 @@ using ::NanPublishType;
|
||||
using ::NanRangeReportInd;
|
||||
using ::NanRangeRequestInd;
|
||||
using ::NanResponseMsg;
|
||||
using ::NanResumeRequest;
|
||||
using ::NanSRFType;
|
||||
using ::NanStatusType;
|
||||
using ::NanSubscribeCancelRequest;
|
||||
using ::NanSubscribeRequest;
|
||||
using ::NanSubscribeTerminatedInd;
|
||||
using ::NanSubscribeType;
|
||||
using ::NanSuspendRequest;
|
||||
using ::NanTransmitFollowupInd;
|
||||
using ::NanTransmitFollowupRequest;
|
||||
using ::NanTxType;
|
||||
@@ -701,6 +703,10 @@ class WifiLegacyHal {
|
||||
wifi_error nanBootstrappingIndicationResponse(const std::string& iface_name, transaction_id id,
|
||||
const NanBootstrappingIndicationResponse& msg);
|
||||
wifi_error nanDataEnd(const std::string& iface_name, transaction_id id, uint32_t ndpInstanceId);
|
||||
wifi_error nanSuspendRequest(const std::string& iface_name, transaction_id id,
|
||||
const NanSuspendRequest& msg);
|
||||
wifi_error nanResumeRequest(const std::string& iface_name, transaction_id id,
|
||||
const NanResumeRequest& msg);
|
||||
// AP functions.
|
||||
wifi_error setCountryCode(const std::string& iface_name, const std::array<uint8_t, 2> code);
|
||||
|
||||
|
||||
@@ -173,6 +173,8 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) {
|
||||
populateStubFor(&hal_fn->wifi_get_cached_scan_results);
|
||||
populateStubFor(&hal_fn->wifi_get_chip_capabilities);
|
||||
populateStubFor(&hal_fn->wifi_enable_sta_channel_for_peer_network);
|
||||
populateStubFor(&hal_fn->wifi_nan_suspend_request);
|
||||
populateStubFor(&hal_fn->wifi_nan_resume_request);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -756,6 +756,16 @@ ndk::ScopedAStatus WifiNanIface::respondToBootstrappingIndicationRequest(
|
||||
in_msg);
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus WifiNanIface::suspendRequest(char16_t in_cmdId, int8_t in_sessionId) {
|
||||
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
|
||||
&WifiNanIface::suspendRequestInternal, in_cmdId, in_sessionId);
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus WifiNanIface::resumeRequest(char16_t in_cmdId, int8_t in_sessionId) {
|
||||
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
|
||||
&WifiNanIface::resumeRequestInternal, in_cmdId, in_sessionId);
|
||||
}
|
||||
|
||||
std::pair<std::string, ndk::ScopedAStatus> WifiNanIface::getNameInternal() {
|
||||
return {ifname_, ndk::ScopedAStatus::ok()};
|
||||
}
|
||||
@@ -930,7 +940,20 @@ ndk::ScopedAStatus WifiNanIface::respondToBootstrappingIndicationRequestInternal
|
||||
legacy_hal_.lock()->nanBootstrappingIndicationResponse(ifname_, cmd_id, legacy_msg);
|
||||
return createWifiStatusFromLegacyError(legacy_status);
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus WifiNanIface::suspendRequestInternal(char16_t cmd_id, int8_t sessionId) {
|
||||
legacy_hal::NanSuspendRequest legacy_msg;
|
||||
legacy_msg.publish_subscribe_id = sessionId;
|
||||
legacy_hal::wifi_error legacy_status =
|
||||
legacy_hal_.lock()->nanSuspendRequest(ifname_, cmd_id, legacy_msg);
|
||||
return createWifiStatusFromLegacyError(legacy_status);
|
||||
}
|
||||
ndk::ScopedAStatus WifiNanIface::resumeRequestInternal(char16_t cmd_id, int8_t sessionId) {
|
||||
legacy_hal::NanResumeRequest legacy_msg;
|
||||
legacy_msg.publish_subscribe_id = sessionId;
|
||||
legacy_hal::wifi_error legacy_status =
|
||||
legacy_hal_.lock()->nanResumeRequest(ifname_, cmd_id, legacy_msg);
|
||||
return createWifiStatusFromLegacyError(legacy_status);
|
||||
}
|
||||
} // namespace wifi
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -86,6 +86,8 @@ class WifiNanIface : public BnWifiNanIface {
|
||||
const NanBootstrappingRequest& in_msg) override;
|
||||
ndk::ScopedAStatus respondToBootstrappingIndicationRequest(
|
||||
char16_t in_cmdId, const NanBootstrappingResponse& in_msg) override;
|
||||
ndk::ScopedAStatus suspendRequest(char16_t in_cmdId, int8_t sessionId) override;
|
||||
ndk::ScopedAStatus resumeRequest(char16_t in_cmdId, int8_t sessionId) override;
|
||||
|
||||
protected:
|
||||
// Accessible to child class in the gTest suite.
|
||||
@@ -127,6 +129,8 @@ class WifiNanIface : public BnWifiNanIface {
|
||||
const NanBootstrappingRequest& msg);
|
||||
ndk::ScopedAStatus respondToBootstrappingIndicationRequestInternal(
|
||||
char16_t cmd_id, const NanBootstrappingResponse& msg);
|
||||
ndk::ScopedAStatus suspendRequestInternal(char16_t in_cmdId, int8_t sessionId);
|
||||
ndk::ScopedAStatus resumeRequestInternal(char16_t in_cmdId, int8_t sessionId);
|
||||
|
||||
// Overridden in the gTest suite.
|
||||
virtual std::set<std::shared_ptr<IWifiNanIfaceEventCallback>> getEventCallbacks();
|
||||
|
||||
@@ -104,6 +104,8 @@ class WifiNanIfaceAidlTest : public testing::TestWithParam<std::string> {
|
||||
NOTIFY_RESPOND_TO_PAIRING_INDICATION_RESPONSE,
|
||||
NOTIFY_INITIATE_BOOTSTRAPPING_RESPONSE,
|
||||
NOTIFY_RESPOND_TO_BOOTSTRAPPING_INDICATION_RESPONSE,
|
||||
NOTIFY_SUSPEND_RESPONSE,
|
||||
NOTIFY_RESUME_RESPONSE,
|
||||
|
||||
EVENT_CLUSTER_EVENT,
|
||||
EVENT_DISABLED,
|
||||
@@ -358,6 +360,20 @@ class WifiNanIfaceAidlTest : public testing::TestWithParam<std::string> {
|
||||
parent_.notify();
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
::ndk::ScopedAStatus notifySuspendResponse(char16_t id, const NanStatus& status) override {
|
||||
parent_.callback_type_ = NOTIFY_SUSPEND_RESPONSE;
|
||||
parent_.id_ = id;
|
||||
parent_.status_ = status;
|
||||
parent_.notify();
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
::ndk::ScopedAStatus notifyResumeResponse(char16_t id, const NanStatus& status) override {
|
||||
parent_.callback_type_ = NOTIFY_RESUME_RESPONSE;
|
||||
parent_.id_ = id;
|
||||
parent_.status_ = status;
|
||||
parent_.notify();
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
::ndk::ScopedAStatus notifyTransmitFollowupResponse(char16_t id,
|
||||
const NanStatus& status) override {
|
||||
parent_.callback_type_ = NOTIFY_TRANSMIT_FOLLOWUP_RESPONSE;
|
||||
|
||||
Reference in New Issue
Block a user