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. 35 SETUP = 1; 36 // The validate step where the data is gathered and compared. 37 VALIDATE = 2; 38 // The step where the wifi capabilities are gathered from the nanoapp. 39 CAPABILITIES = 3; 40} 41 42message StepStartCommand { 43 optional Step step = 1; 44} 45 46/* 47 * The fields that are common between the AP framework ScanResult object @ 48 * //frameworks/base/wifi/java/android/net/wifi/ScanResult.java 49 * and the chreWifiScanResult in the WiFi CHRE API @ 50 * //system/chre/chre_api/include/chre_api/chre/wifi.h 51 */ 52message WifiScanResult { 53 // The name of the access point 54 optional string ssid = 1; 55 // The mac address of the access point 56 optional bytes bssid = 2; 57 // The total number of results that will be sent from AP. 58 optional uint32 totalNumResults = 3; 59 // The index of this result in relation to the entire set of results. 60 // [0 - totalNumResults) 61 optional uint32 resultIndex = 4; 62} 63 64/* 65 * The wifi capabilities listed in 66 * //system/chre/chre_api/include/chre_api/chre/wifi.h 67 */ 68message WifiCapabilities { 69 optional uint32 wifiCapabilities = 1; 70} 71