fastpair.proto 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. syntax = "proto3";
  5. package nearby.fastpair;
  6. import "fastpair_data.proto";
  7. import "enums.proto";
  8. message Timestamp {
  9. // Represents seconds of UTC time since Unix epoch
  10. // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
  11. // 9999-12-31T23:59:59Z inclusive.
  12. int64 seconds = 1;
  13. // Non-negative fractions of a second at nanosecond resolution. Negative
  14. // second values with fractions must still have non-negative nanos values
  15. // that count forward in time. Must be from 0 to 999,999,999
  16. // inclusive.
  17. int32 nanos = 2;
  18. }
  19. // An anti-spoofing key pair for a device that allows us to verify the device is
  20. // broadcasting legitimately.
  21. message AntiSpoofingKeyPair {
  22. // The private key (restricted to only be viewable by trusted clients).
  23. bytes private_key = 1;
  24. // The public key.
  25. bytes public_key = 2;
  26. }
  27. // Strings to be displayed in notifications surfaced for a device.
  28. message ObservedDeviceStrings {
  29. // The locale of all of the strings.
  30. string locale = 1;
  31. // The notification description for when the device is initially discovered.
  32. string initial_notification_description = 2;
  33. // The notification description for when the device is initially discovered
  34. // and no account is logged in.
  35. string initial_notification_description_no_account = 3;
  36. // The notification description for once we have finished pairing and the
  37. // companion app has been opened. For Bisto devices, this string will point
  38. // users to setting up the assistant.
  39. string open_companion_app_description = 4;
  40. // The notification description for once we have finished pairing and the
  41. // companion app needs to be updated before use.
  42. string update_companion_app_description = 5;
  43. // The notification description for once we have finished pairing and the
  44. // companion app needs to be installed.
  45. string download_companion_app_description = 6;
  46. // The notification title when a pairing fails.
  47. string unable_to_connect_title = 7;
  48. // The notification summary when a pairing fails.
  49. string unable_to_connect_description = 8;
  50. // The description that helps user initially paired with device.
  51. string initial_pairing_description = 9;
  52. // The description that let user open the companion app.
  53. string connect_success_companion_app_installed = 10;
  54. // The description that let user download the companion app.
  55. string connect_success_companion_app_not_installed = 11;
  56. // The description that reminds user there is a paired device nearby.
  57. string subsequent_pairing_description = 12;
  58. // The description that reminds users opt in their device.
  59. string retroactive_pairing_description = 13;
  60. // The description that indicates companion app is about to launch.
  61. string wait_launch_companion_app_description = 14;
  62. // The description that indicates go to bluetooth settings when connection
  63. // fail.
  64. string fail_connect_go_to_settings_description = 15;
  65. // The title of the UI to ask the user to confirm the pin code.
  66. string confirm_pin_title = 16;
  67. // The description of the UI to ask the user to confirm the pin code.
  68. string confirm_pin_description = 17;
  69. // The title of the UI to ask the user to confirm to sync contacts.
  70. string sync_contacts_title = 18;
  71. // The description of the UI to ask the user to confirm to sync contacts.
  72. string sync_contacts_description = 19;
  73. // The title of the UI to ask the user to confirm to sync SMS.
  74. string sync_sms_title = 20;
  75. // The description of the UI to ask the user to confirm to sync SMS.
  76. string sync_sms_description = 21;
  77. }
  78. // A device that has been registered by the user.
  79. message Device {
  80. // Output only. The server-generated ID of the device.
  81. int64 id = 1;
  82. // The pantheon project number the device is created under. Only Nearby admins
  83. // can change this.
  84. int64 project_number = 2;
  85. // How the notification will be displayed to the user
  86. NotificationType notification_type = 3;
  87. // The image to show on the notification.
  88. string image_url = 4;
  89. // The name of the device.
  90. string name = 5;
  91. // The intent that will be launched via the notification.
  92. string intent_uri = 6;
  93. // The transmit power of the device's BLE chip.
  94. int32 ble_tx_power = 7;
  95. // The distance that the device must be within to show a notification.
  96. // If no distance is set, we default to 0.6 meters. Only Nearby admins can
  97. // change this.
  98. float trigger_distance = 8;
  99. // Output only. Fast Pair only - The anti-spoofing key pair for the device.
  100. AntiSpoofingKeyPair anti_spoofing_key_pair = 9;
  101. // Output only. The current status of the device.
  102. Status status = 10;
  103. // Output only.
  104. // The timestamp of when the device information was last updated on spanner.
  105. Timestamp last_update_timestamp = 11;
  106. // DEPRECATED - check for published_version instead.
  107. // Output only.
  108. // Whether the device has a different, already published version.
  109. // bool has_published_version = 12;
  110. // Fast Pair only - The type of device being registered.
  111. DeviceType device_type = 13;
  112. // Fast Pair only - Whether the device should be treated as 1P. Only Nearby
  113. // admins can change this.
  114. ManufacturerType manufacturer_type = 14;
  115. // Fast Pair only - Additional images for true wireless headsets.
  116. TrueWirelessHeadsetImages true_wireless_images = 15;
  117. // Fast Pair only - When true, this device can support assistant function.
  118. // Only Nearby admins can change this.
  119. // TODO(b/128545971): Transition this to a feature.
  120. bool assistant_supported = 16;
  121. // Output only.
  122. // The published version of a device that has been approved to be displayed
  123. // as a notification - only populated if the device has a different published
  124. // version. (A device that only has a published version would not have this
  125. // populated).
  126. Device published_version = 17;
  127. // Fast Pair only - When true, Fast Pair will only create a bond with the
  128. // device and not attempt to connect any profiles (for example, A2DP or HFP).
  129. // Only Nearby admins can change this.
  130. // TODO(b/128545971): Transition this to a feature.
  131. bool data_only_connection = 18;
  132. // Name of the company/brand that will be selling the product.
  133. string company_name = 19;
  134. repeated FastPairFeature features = 20;
  135. // Name of the device that is displayed on the console.
  136. string display_name = 21;
  137. // How the device will be interacted with by the user when the scan record
  138. // is detected.
  139. InteractionType interaction_type = 22;
  140. // Companion app information.
  141. CompanionAppDetails companion_detail = 23;
  142. }
  143. // Various states that a customer-configured device notification can be in.
  144. // PUBLISHED is the only state that shows notifications to the public.
  145. message Status {
  146. // Status types available for each device.
  147. enum StatusType {
  148. // Unknown status.
  149. TYPE_UNSPECIFIED = 0;
  150. // Drafted device.
  151. DRAFT = 1;
  152. // Submitted and waiting for approval.
  153. SUBMITTED = 2;
  154. // Fully approved and available for end users.
  155. PUBLISHED = 3;
  156. // Rejected and not available for end users.
  157. REJECTED = 4;
  158. }
  159. // Details about a device that has been rejected.
  160. message RejectionDetails {
  161. // The reason for the rejection.
  162. enum RejectionReason {
  163. // Unspecified reason.
  164. REASON_UNSPECIFIED = 0;
  165. // Name is not valid.
  166. NAME = 1;
  167. // Image is not valid.
  168. IMAGE = 2;
  169. // Tests have failed.
  170. TESTS = 3;
  171. // Other reason.
  172. OTHER = 4;
  173. }
  174. // A list of reasons the device was rejected.
  175. repeated RejectionReason reasons = 1;
  176. // Comment about an OTHER rejection reason.
  177. string additional_comment = 2;
  178. }
  179. // The status of the device.
  180. StatusType status_type = 1;
  181. // Accompanies Status.REJECTED.
  182. RejectionDetails rejection_details = 2;
  183. }
  184. // Request for getting an observed device.
  185. message GetObservedDeviceRequest {
  186. // The mode the requesting device is currently in, eg release or debug.
  187. enum Mode {
  188. // Unknown mode.
  189. MODE_UNKNOWN = 0;
  190. // Release mode.
  191. MODE_RELEASE = 1;
  192. // Debug mode.
  193. MODE_DEBUG = 2;
  194. }
  195. // The ID of the device to find.
  196. int64 device_id = 1;
  197. // The request mode for the device.
  198. Mode mode = 2;
  199. // The locale to get a translated description for.
  200. string locale = 3;
  201. // 6-hexdigit Device Id and will be auto-converted and used instead of
  202. // device_id. If both device_id and hex_device_id, device_id will be used and
  203. // hex_device_id will be ignored
  204. string hex_device_id = 4;
  205. // The max size of an icon to be displayed in pixels.
  206. int64 max_icon_size_pixels = 5;
  207. }
  208. // Response containing an observed device.
  209. message GetObservedDeviceResponse {
  210. // The device from the request.
  211. Device device = 1;
  212. // The image icon that shows in the notification
  213. bytes image = 3;
  214. ObservedDeviceStrings strings = 4;
  215. reserved 2;
  216. }
  217. // Device metadata used to load cache of popular devices.
  218. message GetObservedDeviceResponses {
  219. repeated GetObservedDeviceResponse responses = 1;
  220. }
  221. // Request to read the user's devices.
  222. message UserReadDevicesRequest {
  223. // Optional secondary ID that can be used for lookups.
  224. bytes secondary_id = 1;
  225. }
  226. // Response containing the list of devices for a user.
  227. message UserReadDevicesResponse {
  228. repeated FastPairInfo fast_pair_info = 1;
  229. }
  230. // Request to write a new device to a user.
  231. message UserWriteDeviceRequest {
  232. FastPairInfo fast_pair_info = 1;
  233. }
  234. // Response to writing a new device to a user.
  235. message UserWriteDeviceResponse {}