forked from SeattleTestbed/repy_v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_sensors.r2py
53 lines (50 loc) · 1.27 KB
/
test_sensors.r2py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
list_of_noargs_sensor_calls = [
get_bluetooth_info,
get_bluetooth_scan_info,
is_wifi_enabled,
get_wifi_state,
get_wifi_connection_info,
get_wifi_scan_info,
get_network_info,
get_cellular_provider_info,
get_cell_info,
get_sim_info,
get_phone_info,
get_mode_settings,
get_display_info,
get_volume_info,
get_battery_info,
get_sensor_list,
get_acceleration,
get_ambient_temperature,
get_game_rotation_vector,
get_geomagnetic_rotation_vector,
get_gravity,
get_gyroscope,
get_gyroscope_uncalibrated,
get_heart_rate,
get_light,
get_linear_acceleration,
get_magnetic_field,
get_magnetic_field_uncalibrated,
get_pressure,
get_proximity,
get_relative_humidity,
get_rotation_vector,
get_step_counter,
is_media_playing,
is_tts_speaking,
get_location,
get_lastknown_location,
]
# Add sensors to skip here:
bad_sensor_indices = []
for sensor_number in range(len(list_of_noargs_sensor_calls)):
if sensor_number in bad_sensor_indices:
continue
sensor_call_void = list_of_noargs_sensor_calls[sensor_number]
log(getruntime(), sensor_number)
try:
log(sensor_call_void(), "\n")
except Exception, e:
log("FAILED with exception", repr(e), "\n")