Rename blacklist to blocklist

This commit is contained in:
Zakor Gyula 2016-11-14 11:39:30 +01:00
parent 870841099a
commit f98fbecfda
26 changed files with 181 additions and 181 deletions

View file

@ -43,7 +43,7 @@ const EMPTY_NAME_HEART_RATE_ADAPTER: &'static str = "EmptyNameHeartRateAdapter";
const NO_NAME_HEART_RATE_ADAPTER: &'static str = "NoNameHeartRateAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=284
const TWO_HEART_RATE_SERVICES_ADAPTER: &'static str = "TwoHeartRateServicesAdapter";
const BLACKLIST_TEST_ADAPTER: &'static str = "BlacklistTestAdapter";
const BLOCKLIST_TEST_ADAPTER: &'static str = "BlocklistTestAdapter";
// Device names
const CONNECTABLE_DEVICE_NAME: &'static str = "Connectable Device";
@ -63,7 +63,7 @@ const HEART_RATE_DEVICE_ADDRESS: &'static str = "00:00:00:00:00:03";
const UNICODE_DEVICE_ADDRESS: &'static str = "00:00:00:00:00:01";
// Service UUIDs
const BLACKLIST_TEST_SERVICE_UUID: &'static str = "611c954a-263b-4f4a-aab6-01ddb953f985";
const BLOCKLIST_TEST_SERVICE_UUID: &'static str = "611c954a-263b-4f4a-aab6-01ddb953f985";
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.device_information.xml
const DEVICE_INFORMATION_UUID: &'static str = "0000180a-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.generic_access.xml
@ -79,7 +79,7 @@ const HUMAN_INTERFACE_DEVICE_SERVICE_UUID: &'static str = "00001812-0000-1000-80
const TX_POWER_SERVICE_UUID: &'static str = "00001804-0000-1000-8000-00805f9b34fb";
// Characteristic UUIDs
const BLACKLIST_EXCLUDE_READS_CHARACTERISTIC_UUID: &'static str = "bad1c9a2-9a5b-4015-8b60-1579bbbf2135";
const BLOCKLIST_EXCLUDE_READS_CHARACTERISTIC_UUID: &'static str = "bad1c9a2-9a5b-4015-8b60-1579bbbf2135";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.characteristic.body_sensor_location.xml
const BODY_SENSOR_LOCATION_CHARACTERISTIC_UUID: &'static str = "00002a38-0000-1000-8000-00805f9b34fb";
@ -97,8 +97,8 @@ const PERIPHERAL_PRIVACY_FLAG_CHARACTERISTIC_UUID: &'static str = "00002a02-0000
const SERIAL_NUMBER_STRING_UUID: &'static str = "00002a25-0000-1000-8000-00805f9b34fb";
// Descriptor UUIDs
const BLACKLIST_EXCLUDE_READS_DESCRIPTOR_UUID: &'static str = "aaaaaaaa-aaaa-1181-0510-810819516110";
const BLACKLIST_DESCRIPTOR_UUID: &'static str = "07711111-6104-0970-7011-1107105110aaa";
const BLOCKLIST_EXCLUDE_READS_DESCRIPTOR_UUID: &'static str = "aaaaaaaa-aaaa-1181-0510-810819516110";
const BLOCKLIST_DESCRIPTOR_UUID: &'static str = "07711111-6104-0970-7011-1107105110aaa";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_user_description.xml
const CHARACTERISTIC_USER_DESCRIPTION_UUID: &'static str = "00002901-0000-1000-8000-00805f9b34fb";
@ -374,33 +374,33 @@ fn create_two_heart_rate_services_device(adapter: &BluetoothAdapter) -> Result<(
Ok(())
}
fn create_blacklisted_device(adapter: &BluetoothAdapter) -> Result<(), Box<Error>> {
fn create_blocklisted_device(adapter: &BluetoothAdapter) -> Result<(), Box<Error>> {
let connectable_device =
try!(create_device_with_uuids(adapter,
CONNECTABLE_DEVICE_NAME.to_owned(),
CONNECTABLE_DEVICE_ADDRESS.to_owned(),
vec![BLACKLIST_TEST_SERVICE_UUID.to_owned(),
vec![BLOCKLIST_TEST_SERVICE_UUID.to_owned(),
DEVICE_INFORMATION_UUID.to_owned(),
GENERIC_ACCESS_SERVICE_UUID.to_owned(),
HEART_RATE_SERVICE_UUID.to_owned(),
HUMAN_INTERFACE_DEVICE_SERVICE_UUID.to_owned()]));
let blacklist_test_service = try!(create_service(&connectable_device, BLACKLIST_TEST_SERVICE_UUID.to_owned()));
let blocklist_test_service = try!(create_service(&connectable_device, BLOCKLIST_TEST_SERVICE_UUID.to_owned()));
let blacklist_exclude_reads_characteristic =
try!(create_characteristic(&blacklist_test_service,
BLACKLIST_EXCLUDE_READS_CHARACTERISTIC_UUID.to_owned()));
try!(blacklist_exclude_reads_characteristic
let blocklist_exclude_reads_characteristic =
try!(create_characteristic(&blocklist_test_service,
BLOCKLIST_EXCLUDE_READS_CHARACTERISTIC_UUID.to_owned()));
try!(blocklist_exclude_reads_characteristic
.set_flags(vec![READ_FLAG.to_string(), WRITE_FLAG.to_string()]));
let _blacklist_exclude_reads_descriptor =
try!(create_descriptor_with_value(&blacklist_exclude_reads_characteristic,
BLACKLIST_EXCLUDE_READS_DESCRIPTOR_UUID.to_owned(),
let _blocklist_exclude_reads_descriptor =
try!(create_descriptor_with_value(&blocklist_exclude_reads_characteristic,
BLOCKLIST_EXCLUDE_READS_DESCRIPTOR_UUID.to_owned(),
vec![54; 3]));
let _blacklist_descriptor =
try!(create_descriptor_with_value(&blacklist_exclude_reads_characteristic,
BLACKLIST_DESCRIPTOR_UUID.to_owned(),
let _blocklist_descriptor =
try!(create_descriptor_with_value(&blocklist_exclude_reads_characteristic,
BLOCKLIST_DESCRIPTOR_UUID.to_owned(),
vec![54; 3]));
let device_information_service = try!(create_service(&connectable_device, DEVICE_INFORMATION_UUID.to_owned()));
@ -490,10 +490,10 @@ pub fn test(manager: &mut BluetoothManager, data_set_name: String) -> Result<(),
let _ = try!(create_two_heart_rate_services_device(adapter));
},
BLACKLIST_TEST_ADAPTER => {
try!(set_adapter(adapter, BLACKLIST_TEST_ADAPTER.to_owned()));
BLOCKLIST_TEST_ADAPTER => {
try!(set_adapter(adapter, BLOCKLIST_TEST_ADAPTER.to_owned()));
let _ = try!(create_blacklisted_device(adapter));
let _ = try!(create_blocklisted_device(adapter));
},
_ => return Err(Box::from(WRONG_DATA_SET_ERROR.to_string())),
}