• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Bluetooth test interfaces
2
3The Pandora Bluetooth test interfaces are Remote Procedure Call (RPC) interfaces
4exposed to testing tools to trigger behaviors within a Bluetooth stack under
5test.
6
7While all Bluetooth stacks are different in their supported profiles, features,
8and corresponding APIs, the goal of Pandora is to provide a set of unified
9test interfaces which they could all implement, so we can reuse and scale
10testing tools and processes across all of them.
11
12## Requirements
13
14Since each Bluetooth stack exposes different APIs, the test interfaces must be
15generic enough and must not rely on any implementation specific behavior.
16However, they must ensure that they provide all the necessary access to the
17existing testing tools. For this reason, the test interfaces are co-designed by
18multiple teams at Google.
19
20The test interfaces must be implemented using [gRPC](https://grpc.io/) services
21and must use [protocol buffers](https://developers.google.com/protocol-buffers)
22as Interface Definition Language (IDL). A Bluetooth stack under test exposing
23such interfaces must thus implement a gRPC server.
24
25The test interfaces definition must follow the [Pandora style guide](
26style-guide.md).
27
28## Abstraction level
29
30**A test interface is defined for each Bluetooth profile (standard or custom)**.
31This allows the Bluetooth stack under test to implement only the test interfaces
32corresponding to its supported profiles. Additional platform/device-specific
33interfaces may also be added if necessary (but should be avoided as much as
34possible).
35
36**The same test interface can be implemented at different levels**: for
37instance, in Android, the Pandora Bluetooth test interfaces can be implemented
38both on top of Topshim (which is a Rust shim layer just on top of the stack),
39which is advantageous as tests running at that level can apply to Chrome OS as
40well, or on top of the Android Bluetooth SDK (Java) which is advantageous for
41Mainline, since the Bluetooth module includes both the stack and the SDK.
42
43![PTS-bot on Android](images/pts-bot-aosp.svg)
44
45## Optional features
46
47As Bluetooth profiles contain optional features, some methods of the test
48interfaces might not be implementable by a specific Bluetooth stack.
49
50Such unimplemented methods must return an [UNIMPLEMENTED](
51https://grpc.github.io/grpc/core/md_doc_statuscodes.html) status code as defined
52by gRPC.
53
54Discovering which features are supported by a Bluetooth stack is not (yet) part
55of the test interfaces as this is already doable via Bluetooth SIG
56[Implementation Conformance Statements (ICS)](
57https://www.bluetooth.com/specifications/qualification-test-requirements/).
58