1syntax = "proto2"; 2 3package android.nearby.fastpair.provider.simulator; 4 5option java_package = "android.nearby.fastpair.provider.simulator"; 6option java_outer_classname = "SimulatorStreamProtocol"; 7 8// Used by remote devices to control simulator behaviors. 9message Command { 10 // Type of this command. 11 required Code code = 1; 12 13 // Required for SHOW_BATTERY. 14 optional BatteryInfo battery_info = 2; 15 16 enum Code { 17 // Request for simulator's acknowledge message. 18 POLLING = 0; 19 20 // Reset and clear bluetooth state. 21 RESET = 1; 22 23 // Present battery information in the advertisement. 24 SHOW_BATTERY = 2; 25 26 // Remove battery information in the advertisement. 27 HIDE_BATTERY = 3; 28 29 // Request for BR/EDR address. 30 REQUEST_BLUETOOTH_ADDRESS_PUBLIC = 4; 31 32 // Request for BLE address. 33 REQUEST_BLUETOOTH_ADDRESS_BLE = 5; 34 35 // Request for account key. 36 REQUEST_ACCOUNT_KEY = 6; 37 } 38 39 // Battery information for true wireless headsets. 40 // https://devsite.googleplex.com/nearby/fast-pair/early-access/spec#BatteryNotification 41 message BatteryInfo { 42 // Show or hide the battery UI notification. 43 optional bool suppress_notification = 1; 44 repeated BatteryValue battery_values = 2; 45 46 // Advertised battery level data. 47 message BatteryValue { 48 // The charging flag. 49 required bool charging = 1; 50 51 // Battery level from 0 to 100. 52 required uint32 level = 2; 53 } 54 } 55} 56 57// Notify the remote devices when states are changed or response the command on 58// the simulator. 59message Event { 60 // Type of this event. 61 required Code code = 1; 62 63 // Required for BLUETOOTH_STATE_BOND. 64 optional int32 bond_state = 2; 65 66 // Required for BLUETOOTH_STATE_CONNECTION. 67 optional int32 connection_state = 3; 68 69 // Required for BLUETOOTH_STATE_SCAN_MODE. 70 optional int32 scan_mode = 4; 71 72 // Required for BLUETOOTH_ADDRESS_PUBLIC. 73 optional string public_address = 5; 74 75 // Required for BLUETOOTH_ADDRESS_BLE. 76 optional string ble_address = 6; 77 78 // Required for BLUETOOTH_ALIAS_NAME. 79 optional string alias_name = 7; 80 81 // Required for REQUEST_ACCOUNT_KEY. 82 optional bytes account_key = 8; 83 84 enum Code { 85 // Response the polling. 86 ACKNOWLEDGE = 0; 87 88 // Notify the event android.bluetooth.device.action.BOND_STATE_CHANGED 89 BLUETOOTH_STATE_BOND = 1; 90 91 // Notify the event 92 // android.bluetooth.adapter.action.CONNECTION_STATE_CHANGED 93 BLUETOOTH_STATE_CONNECTION = 2; 94 95 // Notify the event android.bluetooth.adapter.action.SCAN_MODE_CHANGED 96 BLUETOOTH_STATE_SCAN_MODE = 3; 97 98 // Notify the current BR/EDR address 99 BLUETOOTH_ADDRESS_PUBLIC = 4; 100 101 // Notify the current BLE address 102 BLUETOOTH_ADDRESS_BLE = 5; 103 104 // Notify the event android.bluetooth.device.action.ALIAS_CHANGED 105 BLUETOOTH_ALIAS_NAME = 6; 106 107 // Response the REQUEST_ACCOUNT_KEY. 108 ACCOUNT_KEY = 7; 109 } 110} 111