| 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 BLOCKLISTED_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 |
| 11 CONNECTION_ERROR_UUIDS = [ | 11 CONNECTION_ERROR_UUIDS = [ |
| 12 '00000000-97e5-4cd7-b9f1-f5a427670c59', | 12 '00000000-97e5-4cd7-b9f1-f5a427670c59', |
| 13 '00000001-97e5-4cd7-b9f1-f5a427670c59', | 13 '00000001-97e5-4cd7-b9f1-f5a427670c59', |
| 14 '00000002-97e5-4cd7-b9f1-f5a427670c59', | 14 '00000002-97e5-4cd7-b9f1-f5a427670c59', |
| 15 '00000003-97e5-4cd7-b9f1-f5a427670c59', | 15 '00000003-97e5-4cd7-b9f1-f5a427670c59', |
| 16 '00000004-97e5-4cd7-b9f1-f5a427670c59', | 16 '00000004-97e5-4cd7-b9f1-f5a427670c59', |
| 17 '00000005-97e5-4cd7-b9f1-f5a427670c59', | 17 '00000005-97e5-4cd7-b9f1-f5a427670c59', |
| 18 '00000006-97e5-4cd7-b9f1-f5a427670c59', | 18 '00000006-97e5-4cd7-b9f1-f5a427670c59', |
| 19 '00000007-97e5-4cd7-b9f1-f5a427670c59', | 19 '00000007-97e5-4cd7-b9f1-f5a427670c59', |
| 20 '00000008-97e5-4cd7-b9f1-f5a427670c59', | 20 '00000008-97e5-4cd7-b9f1-f5a427670c59', |
| 21 '00000009-97e5-4cd7-b9f1-f5a427670c59', | 21 '00000009-97e5-4cd7-b9f1-f5a427670c59', |
| 22 '0000000a-97e5-4cd7-b9f1-f5a427670c59', | 22 '0000000a-97e5-4cd7-b9f1-f5a427670c59', |
| 23 '0000000b-97e5-4cd7-b9f1-f5a427670c59', | 23 '0000000b-97e5-4cd7-b9f1-f5a427670c59', |
| 24 '0000000c-97e5-4cd7-b9f1-f5a427670c59', | 24 '0000000c-97e5-4cd7-b9f1-f5a427670c59', |
| 25 '0000000d-97e5-4cd7-b9f1-f5a427670c59', | 25 '0000000d-97e5-4cd7-b9f1-f5a427670c59', |
| 26 '0000000e-97e5-4cd7-b9f1-f5a427670c59', | 26 '0000000e-97e5-4cd7-b9f1-f5a427670c59', |
| 27 ] | 27 ] |
| 28 | 28 |
| 29 # List of services that are included in our fake adapters. | 29 # List of services that are included in our fake adapters. |
| 30 ADVERTISED_SERVICES = [ | 30 ADVERTISED_SERVICES = [ |
| 31 'generic_access', | 31 'generic_access', |
| 32 'glucose', | 32 'glucose', |
| 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 BLOCKLISTED_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. | 43 # List of services inside devices. |
| 44 SERVICES = [ | 44 SERVICES = [ |
| 45 'generic_access', | 45 'generic_access', |
| 46 'heart_rate', | 46 'heart_rate', |
| 47 'device_information', | 47 'device_information', |
| 48 'generic_access', | 48 'generic_access', |
| 49 'heart_rate', | 49 'heart_rate', |
| 50 'human_interface_device', | 50 'human_interface_device', |
| 51 BLACKLISTED_UUID, | 51 BLOCKLISTED_UUID, |
| 52 DISCONNECTION_UUID, | 52 DISCONNECTION_UUID, |
| 53 GATT_ERROR_UUID, | 53 GATT_ERROR_UUID, |
| 54 ] | 54 ] |
| 55 | 55 |
| 56 # List of characteristics inside devices. | 56 # List of characteristics inside devices. |
| 57 CHARACTERISTICS = [ | 57 CHARACTERISTICS = [ |
| 58 'bad1c9a2-9a5b-4015-8b60-1579bbbf2135', | 58 'bad1c9a2-9a5b-4015-8b60-1579bbbf2135', |
| 59 '01d7d88a-7451-419f-aeb8-d65e7b9277af', | 59 '01d7d88a-7451-419f-aeb8-d65e7b9277af', |
| 60 'body_sensor_location', | 60 'body_sensor_location', |
| 61 'gap.device_name', | 61 'gap.device_name', |
| (...skipping 17 matching lines...) Expand all Loading... |
| 79 'NotPoweredAdapter', | 79 'NotPoweredAdapter', |
| 80 'EmptyAdapter', | 80 'EmptyAdapter', |
| 81 'FailStartDiscoveryAdapter', | 81 'FailStartDiscoveryAdapter', |
| 82 'GlucoseHeartRateAdapter', | 82 'GlucoseHeartRateAdapter', |
| 83 'UnicodeDeviceAdapter', | 83 'UnicodeDeviceAdapter', |
| 84 'MissingServiceHeartRateAdapter', | 84 'MissingServiceHeartRateAdapter', |
| 85 'MissingCharacteristicHeartRateAdapter', | 85 'MissingCharacteristicHeartRateAdapter', |
| 86 'HeartRateAdapter', | 86 'HeartRateAdapter', |
| 87 'TwoHeartRateServicesAdapter', | 87 'TwoHeartRateServicesAdapter', |
| 88 'DisconnectingHeartRateAdapter', | 88 'DisconnectingHeartRateAdapter', |
| 89 'BlacklistTestAdapter', | 89 'BlocklistTestAdapter', |
| 90 'FailingConnectionsAdapter', | 90 'FailingConnectionsAdapter', |
| 91 'FailingGATTOperationsAdapter', | 91 'FailingGATTOperationsAdapter', |
| 92 'DelayedServicesDiscoveryAdapter', | 92 'DelayedServicesDiscoveryAdapter', |
| 93 ] | 93 ] |
| 94 | 94 |
| 95 # List of fake adapters that include devices. | 95 # List of fake adapters that include devices. |
| 96 ADAPTERS_WITH_DEVICES = [ | 96 ADAPTERS_WITH_DEVICES = [ |
| 97 ( | 97 ( |
| 98 'GlucoseHeartRateAdapter', | 98 'GlucoseHeartRateAdapter', |
| 99 ['generic_access', 'heart_rate', 'glucose', 'tx_power'], | 99 ['generic_access', 'heart_rate', 'glucose', 'tx_power'], |
| (...skipping 12 matching lines...) Expand all Loading... |
| 112 ), | 112 ), |
| 113 ( | 113 ( |
| 114 'TwoHeartRateServicesAdapter', | 114 'TwoHeartRateServicesAdapter', |
| 115 ['generic_access', 'heart_rate'], | 115 ['generic_access', 'heart_rate'], |
| 116 ), | 116 ), |
| 117 ( | 117 ( |
| 118 'DisconnectingHeartRateAdapter', | 118 'DisconnectingHeartRateAdapter', |
| 119 ['generic_access', 'heart_rate'], | 119 ['generic_access', 'heart_rate'], |
| 120 ), | 120 ), |
| 121 ( | 121 ( |
| 122 'BlacklistTestAdapter', | 122 'BlocklistTestAdapter', |
| 123 [BLACKLISTED_UUID, 'device_information', 'generic_access', | 123 [BLOCKLISTED_UUID, 'device_information', 'generic_access', |
| 124 'heart_rate', 'human_interface_device'], | 124 'heart_rate', 'human_interface_device'], |
| 125 ), | 125 ), |
| 126 ( | 126 ( |
| 127 'FailingConnectionsAdapter', | 127 'FailingConnectionsAdapter', |
| 128 CONNECTION_ERROR_UUIDS, | 128 CONNECTION_ERROR_UUIDS, |
| 129 ), | 129 ), |
| 130 ( | 130 ( |
| 131 'FailingGATTOperationsAdapter', | 131 'FailingGATTOperationsAdapter', |
| 132 [GATT_ERROR_UUID], | 132 [GATT_ERROR_UUID], |
| 133 ), | 133 ), |
| (...skipping 15 matching lines...) Expand all Loading... |
| 149 ), | 149 ), |
| 150 ( | 150 ( |
| 151 'TwoHeartRateServicesAdapter', | 151 'TwoHeartRateServicesAdapter', |
| 152 ['generic_access', 'heart_rate'], | 152 ['generic_access', 'heart_rate'], |
| 153 ), | 153 ), |
| 154 ( | 154 ( |
| 155 'DisconnectingHeartRateAdapter', | 155 'DisconnectingHeartRateAdapter', |
| 156 ['generic_access', 'heart_rate', DISCONNECTION_UUID], | 156 ['generic_access', 'heart_rate', DISCONNECTION_UUID], |
| 157 ), | 157 ), |
| 158 ( | 158 ( |
| 159 'BlacklistTestAdapter', | 159 'BlocklistTestAdapter', |
| 160 [BLACKLISTED_UUID, 'device_information', 'generic_access', | 160 [BLOCKLISTED_UUID, 'device_information', 'generic_access', |
| 161 'heart_rate', 'human_interface_device'], | 161 'heart_rate', 'human_interface_device'], |
| 162 ), | 162 ), |
| 163 ( | 163 ( |
| 164 'FailingGATTOperationsAdapter', | 164 'FailingGATTOperationsAdapter', |
| 165 [GATT_ERROR_UUID], | 165 [GATT_ERROR_UUID], |
| 166 ), | 166 ), |
| 167 ( | 167 ( |
| 168 'DelayedServicesDiscoveryAdapter', | 168 'DelayedServicesDiscoveryAdapter', |
| 169 ['heart_rate'] | 169 ['heart_rate'] |
| 170 ), | 170 ), |
| 171 ] | 171 ] |
| 172 | 172 |
| 173 ADAPTERS_WITH_CHARACTERISTICS = [ | 173 ADAPTERS_WITH_CHARACTERISTICS = [ |
| 174 ( | 174 ( |
| 175 'HeartRateAdapter', | 175 'HeartRateAdapter', |
| 176 [GENERIC_ACCESS_SERVICE, HEART_RATE_SERVICE], | 176 [GENERIC_ACCESS_SERVICE, HEART_RATE_SERVICE], |
| 177 ), | 177 ), |
| 178 ( | 178 ( |
| 179 'TwoHeartRateServicesAdapter', | 179 'TwoHeartRateServicesAdapter', |
| 180 [HEART_RATE_SERVICE], | 180 [HEART_RATE_SERVICE], |
| 181 ), | 181 ), |
| 182 ( | 182 ( |
| 183 'DisconnectingHeartRateAdapter', | 183 'DisconnectingHeartRateAdapter', |
| 184 [GENERIC_ACCESS_SERVICE, HEART_RATE_SERVICE, | 184 [GENERIC_ACCESS_SERVICE, HEART_RATE_SERVICE, |
| 185 (DISCONNECTION_UUID, ['01d7d88a-7451-419f-aeb8-d65e7b9277af'])] | 185 (DISCONNECTION_UUID, ['01d7d88a-7451-419f-aeb8-d65e7b9277af'])] |
| 186 ), | 186 ), |
| 187 ( | 187 ( |
| 188 'BlacklistTestAdapter', | 188 'BlocklistTestAdapter', |
| 189 [GENERIC_ACCESS_SERVICE, HEART_RATE_SERVICE, ( | 189 [GENERIC_ACCESS_SERVICE, HEART_RATE_SERVICE, ( |
| 190 BLACKLISTED_UUID, ['bad1c9a2-9a5b-4015-8b60-1579bbbf2135'], | 190 BLOCKLISTED_UUID, ['bad1c9a2-9a5b-4015-8b60-1579bbbf2135'], |
| 191 ), ( | 191 ), ( |
| 192 'device_information', ['serial_number_string'], | 192 'device_information', ['serial_number_string'], |
| 193 )] | 193 )] |
| 194 ), | 194 ), |
| 195 ( | 195 ( |
| 196 'FailingGATTOperationsAdapter', | 196 'FailingGATTOperationsAdapter', |
| 197 [(GATT_ERROR_UUID, [ | 197 [(GATT_ERROR_UUID, [ |
| 198 '000000a1-97e5-4cd7-b9f1-f5a427670c59', | 198 '000000a1-97e5-4cd7-b9f1-f5a427670c59', |
| 199 '000000a2-97e5-4cd7-b9f1-f5a427670c59', | 199 '000000a2-97e5-4cd7-b9f1-f5a427670c59', |
| 200 '000000a3-97e5-4cd7-b9f1-f5a427670c59', | 200 '000000a3-97e5-4cd7-b9f1-f5a427670c59', |
| 201 '000000a4-97e5-4cd7-b9f1-f5a427670c59', | 201 '000000a4-97e5-4cd7-b9f1-f5a427670c59', |
| 202 '000000a5-97e5-4cd7-b9f1-f5a427670c59', | 202 '000000a5-97e5-4cd7-b9f1-f5a427670c59', |
| 203 '000000a6-97e5-4cd7-b9f1-f5a427670c59', | 203 '000000a6-97e5-4cd7-b9f1-f5a427670c59', |
| 204 '000000a7-97e5-4cd7-b9f1-f5a427670c59', | 204 '000000a7-97e5-4cd7-b9f1-f5a427670c59', |
| 205 '000000a8-97e5-4cd7-b9f1-f5a427670c59', | 205 '000000a8-97e5-4cd7-b9f1-f5a427670c59', |
| 206 ])], | 206 ])], |
| 207 ), | 207 ), |
| 208 ] | 208 ] |
| OLD | NEW |