| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Module that contains information about Web Bluetooth's Fake Adapters.""" | 5 """Module that contains information about Web Bluetooth's Fake Adapters.""" |
| 6 | 6 |
| 7 BLACKLISTED_UUID = '611c954a-263b-4f4a-aab6-01ddb953f985' | 7 BLACKLISTED_UUID = '611c954a-263b-4f4a-aab6-01ddb953f985' |
| 8 DISCONNECTION_UUID = '01d7d889-7451-419f-aeb8-d65e7b9277af' | 8 DISCONNECTION_UUID = '01d7d889-7451-419f-aeb8-d65e7b9277af' |
| 9 GATT_ERROR_UUID = '000000a0-97e5-4cd7-b9f1-f5a427670c59' | 9 GATT_ERROR_UUID = '000000a0-97e5-4cd7-b9f1-f5a427670c59' |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 'tx_power', | 33 'tx_power', |
| 34 'heart_rate', | 34 'heart_rate', |
| 35 'human_interface_device', | 35 'human_interface_device', |
| 36 'device_information', | 36 'device_information', |
| 37 BLACKLISTED_UUID, | 37 BLACKLISTED_UUID, |
| 38 CONNECTION_ERROR_UUIDS[0], | 38 CONNECTION_ERROR_UUIDS[0], |
| 39 DISCONNECTION_UUID, | 39 DISCONNECTION_UUID, |
| 40 GATT_ERROR_UUID, | 40 GATT_ERROR_UUID, |
| 41 ] | 41 ] |
| 42 | 42 |
| 43 # List of services inside devices. |
| 44 SERVICES = [ |
| 45 'generic_access', |
| 46 'heart_rate', |
| 47 'device_information', |
| 48 'generic_access', |
| 49 'heart_rate', |
| 50 'human_interface_device', |
| 51 BLACKLISTED_UUID, |
| 52 DISCONNECTION_UUID, |
| 53 GATT_ERROR_UUID, |
| 54 ] |
| 55 |
| 43 # List of available fake adapters. | 56 # List of available fake adapters. |
| 44 ALL_ADAPTERS = [ | 57 ALL_ADAPTERS = [ |
| 45 'NotPresentAdapter', | 58 'NotPresentAdapter', |
| 46 'NotPoweredAdapter', | 59 'NotPoweredAdapter', |
| 47 'EmptyAdapter', | 60 'EmptyAdapter', |
| 48 'FailStartDiscoveryAdapter', | 61 'FailStartDiscoveryAdapter', |
| 49 'GlucoseHeartRateAdapter', | 62 'GlucoseHeartRateAdapter', |
| 50 'UnicodeDeviceAdapter', | 63 'UnicodeDeviceAdapter', |
| 51 'MissingServiceHeartRateAdapter', | 64 'MissingServiceHeartRateAdapter', |
| 52 'MissingCharacteristicHeartRateAdapter', | 65 'MissingCharacteristicHeartRateAdapter', |
| 53 'HeartRateAdapter', | 66 'HeartRateAdapter', |
| 54 'TwoHeartRateServicesAdapter', | 67 'TwoHeartRateServicesAdapter', |
| 55 'DisconnectingHeartRateAdapter', | 68 'DisconnectingHeartRateAdapter', |
| 56 'BlacklistTestAdapter', | 69 'BlacklistTestAdapter', |
| 57 'FailingConnectionsAdapter', | 70 'FailingConnectionsAdapter', |
| 58 'FailingGATTOperationsAdapter', | 71 'FailingGATTOperationsAdapter', |
| 59 'DelayedServicesDiscoveryAdapter', | 72 'DelayedServicesDiscoveryAdapter', |
| 60 ] | 73 ] |
| 61 | 74 |
| 75 # List of characteristics inside devices. |
| 76 CHARACTERISTICS = [ |
| 77 'bad1c9a2-9a5b-4015-8b60-1579bbbf2135', |
| 78 '01d7d88a-7451-419f-aeb8-d65e7b9277af', |
| 79 'body_sensor_location', |
| 80 'gap.device_name', |
| 81 'heart_rate_measurement', |
| 82 'serial_number_string', |
| 83 'gap.peripheral_privacy_flag', |
| 84 ] |
| 85 |
| 62 # List of fake adapters that include devices. | 86 # List of fake adapters that include devices. |
| 63 ADAPTERS_WITH_DEVICES = [ | 87 ADAPTERS_WITH_DEVICES = [ |
| 64 ( | 88 ( |
| 65 'GlucoseHeartRateAdapter', | 89 'GlucoseHeartRateAdapter', |
| 66 ['generic_access', 'heart_rate', 'glucose', 'tx_power'], | 90 ['generic_access', 'heart_rate', 'glucose', 'tx_power'], |
| 67 ), | 91 ), |
| 68 ( | 92 ( |
| 69 'MissingServiceHeartRateAdapter', | 93 'MissingServiceHeartRateAdapter', |
| 70 ['generic_access', 'heart_rate'], | 94 ['generic_access', 'heart_rate'], |
| 71 ), | 95 ), |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 ), | 153 ), |
| 130 ( | 154 ( |
| 131 'FailingGATTOperationsAdapter', | 155 'FailingGATTOperationsAdapter', |
| 132 [GATT_ERROR_UUID], | 156 [GATT_ERROR_UUID], |
| 133 ), | 157 ), |
| 134 ( | 158 ( |
| 135 'DelayedServicesDiscoveryAdapter', | 159 'DelayedServicesDiscoveryAdapter', |
| 136 ['heart_rate'] | 160 ['heart_rate'] |
| 137 ), | 161 ), |
| 138 ] | 162 ] |
| 163 |
| 164 GENERIC_ACCESS_SERVICE = ( |
| 165 'generic_access', ['gap.device_name', 'gap.peripheral_privacy_flag'] |
| 166 ) |
| 167 |
| 168 HEART_RATE_SERVICE = ( |
| 169 'heart_rate', ['heart_rate_measurement', 'body_sensor_location'] |
| 170 ) |
| 171 |
| 172 ADAPTERS_WITH_CHARACTERISTICS = [ |
| 173 # ( |
| 174 # 'HeartRateAdapter', |
| 175 # [GENERIC_ACCESS_SERVICE, HEART_RATE_SERVICE], |
| 176 # ), |
| 177 # ( |
| 178 # 'TwoHeartRateServicesAdapter', |
| 179 # [HEART_RATE_SERVICE], |
| 180 # ), |
| 181 # ( |
| 182 # 'DisconnectingHeartRateAdapter', |
| 183 # [GENERIC_ACCESS_SERVICE, HEART_RATE_SERVICE, |
| 184 # (DISCONNECTION_UUID, ['01d7d88a-7451-419f-aeb8-d65e7b9277af'])] |
| 185 # ), |
| 186 # ( |
| 187 # 'BlacklistTestAdapter', |
| 188 # [GENERIC_ACCESS_SERVICE, HEART_RATE_SERVICE, ( |
| 189 # BLACKLISTED_UUID, ['bad1c9a2-9a5b-4015-8b60-1579bbbf2135'], |
| 190 # ), ( |
| 191 # 'device_information', ['serial_number_string'], |
| 192 # )] |
| 193 # ), |
| 194 ( |
| 195 'FailingGATTOperationsAdapter', |
| 196 [(GATT_ERROR_UUID, [ |
| 197 '000000a1-97e5-4cd7-b9f1-f5a427670c59', |
| 198 '000000a2-97e5-4cd7-b9f1-f5a427670c59', |
| 199 '000000a3-97e5-4cd7-b9f1-f5a427670c59', |
| 200 '000000a4-97e5-4cd7-b9f1-f5a427670c59', |
| 201 '000000a5-97e5-4cd7-b9f1-f5a427670c59', |
| 202 '000000a6-97e5-4cd7-b9f1-f5a427670c59', |
| 203 '000000a7-97e5-4cd7-b9f1-f5a427670c59', |
| 204 '000000a8-97e5-4cd7-b9f1-f5a427670c59', |
| 205 ])], |
| 206 ), |
| 207 ] |
| OLD | NEW |