README
1 This is a tool to generate classic Bluetooth traffic with specified period and package size.
2 Together with the SvcMonitor, which will be called automatically in this android service, can be
3 used to measure the CPU usage from the Java layer Bluetooth code and the underlying system service
4 com.android.bluetooth.
5
6 1. Server (Listener) - Client (Sender) model. Both run as an Android service.
7 2. No pairing needed. Communicate via unsecured RFcomm. Client establishes the connection by
8 providing the MAC addr of the server.
9 3. Bluetooth has to be turned on on both side.
10 4. Client can configure the traffic by specifying the transfer period and package size.
11 5. A separate monitor process will be automatically forked and will be reading from /proc file
12 system to calculate the cpu usage. The measurement is updated once per second.
13 6. The monitor process (com.google.android.experimental.svcmonitor/.ScvMonitor) can be run as an
14 independent service to measure cpu usage on any similarly configured tests (e.g. wifi, BLE). Refer
15 to SvcMonitor's README for usage and details.
16
17 Usage:
18 To instal the test:
19 On both the server and client device, install the 2 apk:
20 $ adb install $OUT/system/app/bttraffic/bttraffic.apk
21 $ adb install $OUT/system/app/svcmonitor/svcmonitor.apk
22
23 To start the service on the SERVER side:
24 $ adb shell am startservice -a start --ez ack true \
25 com.google.android.experimental.bttraffic/.BTtraffic
26
27 To start the service on the CLIENT side:
28 $ adb shell am startservice -a start \
29 -e addr "F8:A9:D0:A8:74:8E" --ei size 1000 --ei period 15 \
30 com.google.android.experimental.bttraffic/.BTtraffic
31
32 To stop the test:
33 On either the server or client:
34 $ adb shell am startservice -a stop \
35 com.google.android.experimental.bttraffic/.BTtraffic
36
37 To look at the data:
38 $ adb logcat | grep bttraffic
39
40 Options:
41 -e addr: MAC addr of the server, in uppercase letter.
42 --ei size: package size, unit: byte; default: 1024, MAX: 20MB
43 --ei period: system sleep time between sending each package, unit: ms, default: 5000
44 ** if -1 is provided, client will only send the package once.
45 --ez ack: whether acknowledge is required (true/false)
46