1syntax = "proto2";
2
3package chre_cross_validation_wifi;
4
5option java_package = "com.google.android.chre.nanoapp.proto";
6option java_outer_classname = "ChreCrossValidationWifi";
7
8enum MessageType {
9  // Reserved for corrupted messages
10  UNDEFINED = 0;
11
12  // H2C: Host informing nanoapp to start a new step
13  // Payload must be StepStartCommand Message
14  STEP_START = 1;
15
16  // C2H: Nanoapp informing host on the result of a step
17  // Payload must be chre_test_common::TestResult message.
18  // This will also include the final validation result if this is the step
19  // result for the VALIDATE step.
20  STEP_RESULT = 2;
21
22  // H2C: Host passing down wifi scan result data to CHRE to validate.
23  // There may be multiple messages with this type sent.
24  SCAN_RESULT = 3;
25
26  // C2H: Nanoapp informing host about the wifi capabilities it has.
27  // The payload must be a WifiCapabilities message.
28  WIFI_CAPABILITIES = 4;
29}
30
31enum Step {
32  // The initial step where no action is performed.
33  INIT = 0;
34  // The step where the nanoapp is configured to monitor for wifi scans and the
35  // scan results threshold message is sent.
36  SETUP = 1;
37  // The validate step where the data is gathered and compared.
38  VALIDATE = 2;
39  // The step where the wifi capabilities are gathered from the nanoapp.
40  CAPABILITIES = 3;
41}
42
43message StepStartCommand {
44  optional Step step = 1;
45}
46
47/*
48 * The fields that are common between the AP framework ScanResult object @
49 * //frameworks/base/wifi/java/android/net/wifi/ScanResult.java
50 * and the chreWifiScanResult in the WiFi CHRE API @
51 * //system/chre/chre_api/include/chre_api/chre/wifi.h
52 */
53message WifiScanResult {
54  // The name of the access point
55  optional string ssid = 1;
56  // The mac address of the access point
57  optional bytes bssid = 2;
58  // The total number of results that will be sent from AP.
59  optional uint32 totalNumResults = 3;
60  // The index of this result in relation to the entire set of results.
61  // [0 - totalNumResults)
62  optional uint32 resultIndex = 4;
63}
64
65/*
66 * The wifi capabilities listed in
67 * //system/chre/chre_api/include/chre_api/chre/wifi.h
68 */
69message WifiCapabilities {
70  optional uint32 wifiCapabilities = 1;
71}
72
73message UseScanResultsSizeThreshold {
74  optional bool useThreshold = 1;
75}
76