aboutsummaryrefslogtreecommitdiff
path: root/apps/test/common/proto/chre_cross_validation_wifi.proto
blob: 8a681d09df7d5ddd139057055dbce8e9e76f8cb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
syntax = "proto2";

package chre_cross_validation_wifi;

option java_package = "com.google.android.chre.nanoapp.proto";
option java_outer_classname = "ChreCrossValidationWifi";

enum MessageType {
  // Reserved for corrupted messages
  UNDEFINED = 0;

  // H2C: Host informing nanoapp to start a new step
  // Payload must be StepStartCommand Message
  STEP_START = 1;

  // C2H: Nanoapp informing host on the result of a step
  // Payload must be chre_test_common::TestResult message.
  // This will also include the final validation result if this is the step
  // result for the VALIDATE step.
  STEP_RESULT = 2;

  // H2C: Host passing down wifi scan result data to CHRE to validate.
  // There may be multiple messages with this type sent.
  SCAN_RESULT = 3;

  // C2H: Nanoapp informing host about the wifi capabilities it has.
  // The payload must be a WifiCapabilities message.
  WIFI_CAPABILITIES = 4;
}

enum Step {
  // The initial step where no action is performed.
  INIT = 0;
  // The step where the nanoapp is configured to monitor for wifi scans and the
  // scan results threshold message is sent.
  SETUP = 1;
  // The validate step where the data is gathered and compared.
  VALIDATE = 2;
  // The step where the wifi capabilities are gathered from the nanoapp.
  CAPABILITIES = 3;
}

message StepStartCommand {
  optional Step step = 1;
}

/*
 * The fields that are common between the AP framework ScanResult object @
 * //frameworks/base/wifi/java/android/net/wifi/ScanResult.java
 * and the chreWifiScanResult in the WiFi CHRE API @
 * //system/chre/chre_api/include/chre_api/chre/wifi.h
 */
message WifiScanResult {
  // The name of the access point
  optional string ssid = 1;
  // The mac address of the access point
  optional bytes bssid = 2;
  // The total number of results that will be sent from AP.
  optional uint32 totalNumResults = 3;
  // The index of this result in relation to the entire set of results.
  // [0 - totalNumResults)
  optional uint32 resultIndex = 4;
}

/*
 * The wifi capabilities listed in
 * //system/chre/chre_api/include/chre_api/chre/wifi.h
 */
message WifiCapabilities {
  optional uint32 wifiCapabilities = 1;
}

message UseScanResultsSizeThreshold {
  optional bool useThreshold = 1;
}