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 // H2C: Host telling nanoapp whether or not to allow a certain threshold of 31 // the CHRE scan results size to be less than the AP scan results size. 32 // The payload must be a UseScanResultsSizeThreshold message. 33 USE_SCAN_RESULTS_SIZE_THRESHOLD = 5; 34} 35 36enum Step { 37 // The initial step where no action is performed. 38 INIT = 0; 39 // The step where the nanoapp is configured to monitor for wifi scans and the 40 // scan results threshold message is sent. 41 SETUP = 1; 42 // The validate step where the data is gathered and compared. 43 VALIDATE = 2; 44 // The step where the wifi capabilities are gathered from the nanoapp. 45 CAPABILITIES = 3; 46} 47 48message StepStartCommand { 49 optional Step step = 1; 50} 51 52/* 53 * The fields that are common between the AP framework ScanResult object @ 54 * //frameworks/base/wifi/java/android/net/wifi/ScanResult.java 55 * and the chreWifiScanResult in the WiFi CHRE API @ 56 * //system/chre/chre_api/include/chre_api/chre/wifi.h 57 */ 58message WifiScanResult { 59 // The name of the access point 60 optional string ssid = 1; 61 // The mac address of the access point 62 optional bytes bssid = 2; 63 // The total number of results that will be sent from AP. 64 optional uint32 totalNumResults = 3; 65 // The index of this result in relation to the entire set of results. 66 // [0 - totalNumResults) 67 optional uint32 resultIndex = 4; 68} 69 70/* 71 * The wifi capabilities listed in 72 * //system/chre/chre_api/include/chre_api/chre/wifi.h 73 */ 74message WifiCapabilities { 75 optional uint32 wifiCapabilities = 1; 76} 77 78message UseScanResultsSizeThreshold { 79 optional bool useThreshold = 1; 80} 81