Commit bc2ad760 authored by jamuraa's avatar jamuraa Committed by Commit bot

Update constants to MACRO_STYLE

BUG=418696

Review URL: https://codereview.chromium.org/643213002

Cr-Commit-Position: refs/heads/master@{#299349}
parent 45bf27b1
...@@ -39,24 +39,24 @@ class BluetoothGattCharacteristic { ...@@ -39,24 +39,24 @@ class BluetoothGattCharacteristic {
// Values representing the possible properties of a characteristic, which // Values representing the possible properties of a characteristic, which
// define how the characteristic can be used. Each of these properties serve // define how the characteristic can be used. Each of these properties serve
// a role as defined in the Bluetooth Specification. // a role as defined in the Bluetooth Specification.
// |kPropertyExtendedProperties| is a special property that, if present, // |PROPERTY_EXTENDED_PROPERTIES| is a special property that, if present,
// indicates that there is a characteristic descriptor (namely the // indicates that there is a characteristic descriptor (namely the
// "Characteristic Extended Properties Descriptor" with UUID 0x2900) that // "Characteristic Extended Properties Descriptor" with UUID 0x2900) that
// contains additional properties pertaining to the characteristic. // contains additional properties pertaining to the characteristic.
// The properties "ReliableWrite| and |WriteAuxiliaries| are retrieved from // The properties "ReliableWrite| and |WriteAuxiliaries| are retrieved from
// that characteristic. // that characteristic.
enum Property { enum Property {
kPropertyNone = 0, PROPERTY_NONE = 0,
kPropertyBroadcast = 1 << 0, PROPERTY_BROADCAST = 1 << 0,
kPropertyRead = 1 << 1, PROPERTY_READ = 1 << 1,
kPropertyWriteWithoutResponse = 1 << 2, PROPERTY_WRITE_WITHOUT_RESPONSE = 1 << 2,
kPropertyWrite = 1 << 3, PROPERTY_WRITE = 1 << 3,
kPropertyNotify = 1 << 4, PROPERTY_NOTIFY = 1 << 4,
kPropertyIndicate = 1 << 5, PROPERTY_INDICATE = 1 << 5,
kPropertyAuthenticatedSignedWrites = 1 << 6, PROPERTY_AUTHENTICATED_SIGNED_WRITES = 1 << 6,
kPropertyExtendedProperties = 1 << 7, PROPERTY_EXTENDED_PROPERTIES = 1 << 7,
kPropertyReliableWrite = 1 << 8, PROPERTY_RELIABLE_WRITE = 1 << 8,
kPropertyWritableAuxiliaries = 1 << 9 PROPERTY_WRITABLE_AUXILIARIES = 1 << 9
}; };
typedef uint32 Properties; typedef uint32 Properties;
...@@ -66,17 +66,17 @@ class BluetoothGattCharacteristic { ...@@ -66,17 +66,17 @@ class BluetoothGattCharacteristic {
// value permissions are left up to the higher-level profile. // value permissions are left up to the higher-level profile.
// //
// Attribute permissions are distinct from the characteristic properties. For // Attribute permissions are distinct from the characteristic properties. For
// example, a characteristic may have the property |kPropertyRead| to make // example, a characteristic may have the property |PROPERTY_READ| to make
// clients know that it is possible to read the characteristic value and have // clients know that it is possible to read the characteristic value and have
// the permission |kPermissionReadEncrypted| to require a secure connection. // the permission |PERMISSION_READ_ENCRYPTED| to require a secure connection.
// It is up to the application to properly specify the permissions and // It is up to the application to properly specify the permissions and
// properties for a local characteristic. // properties for a local characteristic.
enum Permission { enum Permission {
kPermissionNone = 0, PERMISSION_NONE = 0,
kPermissionRead = 1 << 0, PERMISSION_READ = 1 << 0,
kPermissionWrite = 1 << 1, PERMISSION_WRITE = 1 << 1,
kPermissionReadEncrypted = 1 << 2, PERMISSION_READ_ENCRYPTED = 1 << 2,
kPermissionWriteEncrypted = 1 << 3 PERMISSION_WRITE_ENCRYPTED = 1 << 3
}; };
typedef uint32 Permissions; typedef uint32 Permissions;
...@@ -106,11 +106,11 @@ class BluetoothGattCharacteristic { ...@@ -106,11 +106,11 @@ class BluetoothGattCharacteristic {
// BluetoothGattService instance, in which case the delegate will handle read // BluetoothGattService instance, in which case the delegate will handle read
// and write requests. // and write requests.
// //
// NOTE: Don't explicitly set |kPropertyExtendedProperties| in |properties|. // NOTE: Don't explicitly set |PROPERTY_EXTENDED_PROPERTIES| in |properties|.
// Instead, create and add a BluetoothGattDescriptor that represents the // Instead, create and add a BluetoothGattDescriptor that represents the
// "Characteristic Extended Properties" descriptor and this will automatically // "Characteristic Extended Properties" descriptor and this will automatically
// set the correspoding bit in the characteristic's properties field. If // set the correspoding bit in the characteristic's properties field. If
// |properties| has |kPropertyExtendedProperties| set, it will be ignored. // |properties| has |PROPERTY_EXTENDED_PROPERTIES| set, it will be ignored.
static BluetoothGattCharacteristic* Create(const BluetoothUUID& uuid, static BluetoothGattCharacteristic* Create(const BluetoothUUID& uuid,
const std::vector<uint8>& value, const std::vector<uint8>& value,
Properties properties, Properties properties,
......
...@@ -1045,19 +1045,19 @@ TEST_F(BluetoothGattChromeOSTest, GattCharacteristicProperties) { ...@@ -1045,19 +1045,19 @@ TEST_F(BluetoothGattChromeOSTest, GattCharacteristicProperties) {
BluetoothGattCharacteristic *characteristic = service->GetCharacteristic( BluetoothGattCharacteristic *characteristic = service->GetCharacteristic(
fake_bluetooth_gatt_characteristic_client_-> fake_bluetooth_gatt_characteristic_client_->
GetBodySensorLocationPath().value()); GetBodySensorLocationPath().value());
EXPECT_EQ(BluetoothGattCharacteristic::kPropertyRead, EXPECT_EQ(BluetoothGattCharacteristic::PROPERTY_READ,
characteristic->GetProperties()); characteristic->GetProperties());
characteristic = service->GetCharacteristic( characteristic = service->GetCharacteristic(
fake_bluetooth_gatt_characteristic_client_-> fake_bluetooth_gatt_characteristic_client_->
GetHeartRateControlPointPath().value()); GetHeartRateControlPointPath().value());
EXPECT_EQ(BluetoothGattCharacteristic::kPropertyWrite, EXPECT_EQ(BluetoothGattCharacteristic::PROPERTY_WRITE,
characteristic->GetProperties()); characteristic->GetProperties());
characteristic = service->GetCharacteristic( characteristic = service->GetCharacteristic(
fake_bluetooth_gatt_characteristic_client_-> fake_bluetooth_gatt_characteristic_client_->
GetHeartRateMeasurementPath().value()); GetHeartRateMeasurementPath().value());
EXPECT_EQ(BluetoothGattCharacteristic::kPropertyNotify, EXPECT_EQ(BluetoothGattCharacteristic::PROPERTY_NOTIFY,
characteristic->GetProperties()); characteristic->GetProperties());
} }
......
...@@ -112,31 +112,31 @@ BluetoothRemoteGattCharacteristicChromeOS::GetProperties() const { ...@@ -112,31 +112,31 @@ BluetoothRemoteGattCharacteristicChromeOS::GetProperties() const {
GetProperties(object_path_); GetProperties(object_path_);
DCHECK(properties); DCHECK(properties);
Properties props = kPropertyNone; Properties props = PROPERTY_NONE;
const std::vector<std::string>& flags = properties->flags.value(); const std::vector<std::string>& flags = properties->flags.value();
for (std::vector<std::string>::const_iterator iter = flags.begin(); for (std::vector<std::string>::const_iterator iter = flags.begin();
iter != flags.end(); iter != flags.end();
++iter) { ++iter) {
if (*iter == bluetooth_gatt_characteristic::kFlagBroadcast) if (*iter == bluetooth_gatt_characteristic::kFlagBroadcast)
props |= kPropertyBroadcast; props |= PROPERTY_BROADCAST;
if (*iter == bluetooth_gatt_characteristic::kFlagRead) if (*iter == bluetooth_gatt_characteristic::kFlagRead)
props |= kPropertyRead; props |= PROPERTY_READ;
if (*iter == bluetooth_gatt_characteristic::kFlagWriteWithoutResponse) if (*iter == bluetooth_gatt_characteristic::kFlagWriteWithoutResponse)
props |= kPropertyWriteWithoutResponse; props |= PROPERTY_WRITE_WITHOUT_RESPONSE;
if (*iter == bluetooth_gatt_characteristic::kFlagWrite) if (*iter == bluetooth_gatt_characteristic::kFlagWrite)
props |= kPropertyWrite; props |= PROPERTY_WRITE;
if (*iter == bluetooth_gatt_characteristic::kFlagNotify) if (*iter == bluetooth_gatt_characteristic::kFlagNotify)
props |= kPropertyNotify; props |= PROPERTY_NOTIFY;
if (*iter == bluetooth_gatt_characteristic::kFlagIndicate) if (*iter == bluetooth_gatt_characteristic::kFlagIndicate)
props |= kPropertyIndicate; props |= PROPERTY_INDICATE;
if (*iter == bluetooth_gatt_characteristic::kFlagAuthenticatedSignedWrites) if (*iter == bluetooth_gatt_characteristic::kFlagAuthenticatedSignedWrites)
props |= kPropertyAuthenticatedSignedWrites; props |= PROPERTY_AUTHENTICATED_SIGNED_WRITES;
if (*iter == bluetooth_gatt_characteristic::kFlagExtendedProperties) if (*iter == bluetooth_gatt_characteristic::kFlagExtendedProperties)
props |= kPropertyExtendedProperties; props |= PROPERTY_EXTENDED_PROPERTIES;
if (*iter == bluetooth_gatt_characteristic::kFlagReliableWrite) if (*iter == bluetooth_gatt_characteristic::kFlagReliableWrite)
props |= kPropertyReliableWrite; props |= PROPERTY_RELIABLE_WRITE;
if (*iter == bluetooth_gatt_characteristic::kFlagWritableAuxiliaries) if (*iter == bluetooth_gatt_characteristic::kFlagWritableAuxiliaries)
props |= kPropertyWritableAuxiliaries; props |= PROPERTY_WRITABLE_AUXILIARIES;
} }
return props; return props;
...@@ -146,7 +146,7 @@ device::BluetoothGattCharacteristic::Permissions ...@@ -146,7 +146,7 @@ device::BluetoothGattCharacteristic::Permissions
BluetoothRemoteGattCharacteristicChromeOS::GetPermissions() const { BluetoothRemoteGattCharacteristicChromeOS::GetPermissions() const {
// TODO(armansito): Once BlueZ defines the permissions, return the correct // TODO(armansito): Once BlueZ defines the permissions, return the correct
// values here. // values here.
return kPermissionNone; return PERMISSION_NONE;
} }
bool BluetoothRemoteGattCharacteristicChromeOS::IsNotifying() const { bool BluetoothRemoteGattCharacteristicChromeOS::IsNotifying() const {
......
...@@ -72,7 +72,7 @@ device::BluetoothGattCharacteristic::Permissions ...@@ -72,7 +72,7 @@ device::BluetoothGattCharacteristic::Permissions
BluetoothRemoteGattDescriptorChromeOS::GetPermissions() const { BluetoothRemoteGattDescriptorChromeOS::GetPermissions() const {
// TODO(armansito): Once BlueZ defines the permissions, return the correct // TODO(armansito): Once BlueZ defines the permissions, return the correct
// values here. // values here.
return device::BluetoothGattCharacteristic::kPermissionNone; return device::BluetoothGattCharacteristic::PERMISSION_NONE;
} }
void BluetoothRemoteGattDescriptorChromeOS::ReadRemoteDescriptor( void BluetoothRemoteGattDescriptorChromeOS::ReadRemoteDescriptor(
......
...@@ -61,24 +61,24 @@ const char kTestServiceUuid1[] = "5678"; ...@@ -61,24 +61,24 @@ const char kTestServiceUuid1[] = "5678";
const char kTestCharacteristicId0[] = "char_id0"; const char kTestCharacteristicId0[] = "char_id0";
const char kTestCharacteristicUuid0[] = "1211"; const char kTestCharacteristicUuid0[] = "1211";
const BluetoothGattCharacteristic::Properties kTestCharacteristicProperties0 = const BluetoothGattCharacteristic::Properties kTestCharacteristicProperties0 =
BluetoothGattCharacteristic::kPropertyBroadcast | BluetoothGattCharacteristic::PROPERTY_BROADCAST |
BluetoothGattCharacteristic::kPropertyRead | BluetoothGattCharacteristic::PROPERTY_READ |
BluetoothGattCharacteristic::kPropertyWriteWithoutResponse | BluetoothGattCharacteristic::PROPERTY_WRITE_WITHOUT_RESPONSE |
BluetoothGattCharacteristic::kPropertyIndicate; BluetoothGattCharacteristic::PROPERTY_INDICATE;
const uint8 kTestCharacteristicDefaultValue0[] = {0x01, 0x02, 0x03, 0x04, 0x05}; const uint8 kTestCharacteristicDefaultValue0[] = {0x01, 0x02, 0x03, 0x04, 0x05};
const char kTestCharacteristicId1[] = "char_id1"; const char kTestCharacteristicId1[] = "char_id1";
const char kTestCharacteristicUuid1[] = "1212"; const char kTestCharacteristicUuid1[] = "1212";
const BluetoothGattCharacteristic::Properties kTestCharacteristicProperties1 = const BluetoothGattCharacteristic::Properties kTestCharacteristicProperties1 =
BluetoothGattCharacteristic::kPropertyRead | BluetoothGattCharacteristic::PROPERTY_READ |
BluetoothGattCharacteristic::kPropertyWrite | BluetoothGattCharacteristic::PROPERTY_WRITE |
BluetoothGattCharacteristic::kPropertyNotify; BluetoothGattCharacteristic::PROPERTY_NOTIFY;
const uint8 kTestCharacteristicDefaultValue1[] = {0x06, 0x07, 0x08}; const uint8 kTestCharacteristicDefaultValue1[] = {0x06, 0x07, 0x08};
const char kTestCharacteristicId2[] = "char_id2"; const char kTestCharacteristicId2[] = "char_id2";
const char kTestCharacteristicUuid2[] = "1213"; const char kTestCharacteristicUuid2[] = "1213";
const BluetoothGattCharacteristic::Properties kTestCharacteristicProperties2 = const BluetoothGattCharacteristic::Properties kTestCharacteristicProperties2 =
BluetoothGattCharacteristic::kPropertyNone; BluetoothGattCharacteristic::PROPERTY_NONE;
// Test descriptor constants. // Test descriptor constants.
const char kTestDescriptorId0[] = "desc_id0"; const char kTestDescriptorId0[] = "desc_id0";
...@@ -153,7 +153,7 @@ class BluetoothLowEnergyApiTest : public ExtensionApiTest { ...@@ -153,7 +153,7 @@ class BluetoothLowEnergyApiTest : public ExtensionApiTest {
BluetoothUUID(kTestCharacteristicUuid0), BluetoothUUID(kTestCharacteristicUuid0),
false /* is_local */, false /* is_local */,
kTestCharacteristicProperties0, kTestCharacteristicProperties0,
BluetoothGattCharacteristic::kPermissionNone)); BluetoothGattCharacteristic::PERMISSION_NONE));
default_value.assign(kTestCharacteristicDefaultValue0, default_value.assign(kTestCharacteristicDefaultValue0,
(kTestCharacteristicDefaultValue0 + (kTestCharacteristicDefaultValue0 +
sizeof(kTestCharacteristicDefaultValue0))); sizeof(kTestCharacteristicDefaultValue0)));
...@@ -165,7 +165,7 @@ class BluetoothLowEnergyApiTest : public ExtensionApiTest { ...@@ -165,7 +165,7 @@ class BluetoothLowEnergyApiTest : public ExtensionApiTest {
BluetoothUUID(kTestCharacteristicUuid1), BluetoothUUID(kTestCharacteristicUuid1),
false /* is_local */, false /* is_local */,
kTestCharacteristicProperties1, kTestCharacteristicProperties1,
BluetoothGattCharacteristic::kPermissionNone)); BluetoothGattCharacteristic::PERMISSION_NONE));
default_value.assign(kTestCharacteristicDefaultValue1, default_value.assign(kTestCharacteristicDefaultValue1,
(kTestCharacteristicDefaultValue1 + (kTestCharacteristicDefaultValue1 +
sizeof(kTestCharacteristicDefaultValue1))); sizeof(kTestCharacteristicDefaultValue1)));
...@@ -177,14 +177,14 @@ class BluetoothLowEnergyApiTest : public ExtensionApiTest { ...@@ -177,14 +177,14 @@ class BluetoothLowEnergyApiTest : public ExtensionApiTest {
BluetoothUUID(kTestCharacteristicUuid2), BluetoothUUID(kTestCharacteristicUuid2),
false /* is_local */, false /* is_local */,
kTestCharacteristicProperties2, kTestCharacteristicProperties2,
BluetoothGattCharacteristic::kPermissionNone)); BluetoothGattCharacteristic::PERMISSION_NONE));
desc0_.reset(new testing::NiceMock<MockBluetoothGattDescriptor>( desc0_.reset(new testing::NiceMock<MockBluetoothGattDescriptor>(
chrc0_.get(), chrc0_.get(),
kTestDescriptorId0, kTestDescriptorId0,
BluetoothUUID(kTestDescriptorUuid0), BluetoothUUID(kTestDescriptorUuid0),
false /* is_local */, false /* is_local */,
BluetoothGattCharacteristic::kPermissionNone)); BluetoothGattCharacteristic::PERMISSION_NONE));
default_value.assign( default_value.assign(
kTestDescriptorDefaultValue0, kTestDescriptorDefaultValue0,
(kTestDescriptorDefaultValue0 + sizeof(kTestDescriptorDefaultValue0))); (kTestDescriptorDefaultValue0 + sizeof(kTestDescriptorDefaultValue0)));
...@@ -195,7 +195,7 @@ class BluetoothLowEnergyApiTest : public ExtensionApiTest { ...@@ -195,7 +195,7 @@ class BluetoothLowEnergyApiTest : public ExtensionApiTest {
kTestDescriptorId1, kTestDescriptorId1,
BluetoothUUID(kTestDescriptorUuid1), BluetoothUUID(kTestDescriptorUuid1),
false /* is_local */, false /* is_local */,
BluetoothGattCharacteristic::kPermissionNone)); BluetoothGattCharacteristic::PERMISSION_NONE));
default_value.assign( default_value.assign(
kTestDescriptorDefaultValue1, kTestDescriptorDefaultValue1,
(kTestDescriptorDefaultValue1 + sizeof(kTestDescriptorDefaultValue1))); (kTestDescriptorDefaultValue1 + sizeof(kTestDescriptorDefaultValue1)));
...@@ -539,32 +539,32 @@ IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, CharacteristicProperties) { ...@@ -539,32 +539,32 @@ IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, CharacteristicProperties) {
.WillRepeatedly(Return(chrc0_.get())); .WillRepeatedly(Return(chrc0_.get()));
EXPECT_CALL(*chrc0_, GetProperties()) EXPECT_CALL(*chrc0_, GetProperties())
.Times(12) .Times(12)
.WillOnce(Return(BluetoothGattCharacteristic::kPropertyNone)) .WillOnce(Return(BluetoothGattCharacteristic::PROPERTY_NONE))
.WillOnce(Return(BluetoothGattCharacteristic::kPropertyBroadcast)) .WillOnce(Return(BluetoothGattCharacteristic::PROPERTY_BROADCAST))
.WillOnce(Return(BluetoothGattCharacteristic::kPropertyRead)) .WillOnce(Return(BluetoothGattCharacteristic::PROPERTY_READ))
.WillOnce( .WillOnce(
Return(BluetoothGattCharacteristic::kPropertyWriteWithoutResponse)) Return(BluetoothGattCharacteristic::PROPERTY_WRITE_WITHOUT_RESPONSE))
.WillOnce(Return(BluetoothGattCharacteristic::kPropertyWrite)) .WillOnce(Return(BluetoothGattCharacteristic::PROPERTY_WRITE))
.WillOnce(Return(BluetoothGattCharacteristic::kPropertyNotify)) .WillOnce(Return(BluetoothGattCharacteristic::PROPERTY_NOTIFY))
.WillOnce(Return(BluetoothGattCharacteristic::kPropertyIndicate)) .WillOnce(Return(BluetoothGattCharacteristic::PROPERTY_INDICATE))
.WillOnce(Return( .WillOnce(Return(
BluetoothGattCharacteristic::kPropertyAuthenticatedSignedWrites)) BluetoothGattCharacteristic::PROPERTY_AUTHENTICATED_SIGNED_WRITES))
.WillOnce( .WillOnce(
Return(BluetoothGattCharacteristic::kPropertyExtendedProperties)) Return(BluetoothGattCharacteristic::PROPERTY_EXTENDED_PROPERTIES))
.WillOnce(Return(BluetoothGattCharacteristic::kPropertyReliableWrite)) .WillOnce(Return(BluetoothGattCharacteristic::PROPERTY_RELIABLE_WRITE))
.WillOnce( .WillOnce(
Return(BluetoothGattCharacteristic::kPropertyWritableAuxiliaries)) Return(BluetoothGattCharacteristic::PROPERTY_WRITABLE_AUXILIARIES))
.WillOnce(Return( .WillOnce(Return(
BluetoothGattCharacteristic::kPropertyBroadcast | BluetoothGattCharacteristic::PROPERTY_BROADCAST |
BluetoothGattCharacteristic::kPropertyRead | BluetoothGattCharacteristic::PROPERTY_READ |
BluetoothGattCharacteristic::kPropertyWriteWithoutResponse | BluetoothGattCharacteristic::PROPERTY_WRITE_WITHOUT_RESPONSE |
BluetoothGattCharacteristic::kPropertyWrite | BluetoothGattCharacteristic::PROPERTY_WRITE |
BluetoothGattCharacteristic::kPropertyNotify | BluetoothGattCharacteristic::PROPERTY_NOTIFY |
BluetoothGattCharacteristic::kPropertyIndicate | BluetoothGattCharacteristic::PROPERTY_INDICATE |
BluetoothGattCharacteristic::kPropertyAuthenticatedSignedWrites | BluetoothGattCharacteristic::PROPERTY_AUTHENTICATED_SIGNED_WRITES |
BluetoothGattCharacteristic::kPropertyExtendedProperties | BluetoothGattCharacteristic::PROPERTY_EXTENDED_PROPERTIES |
BluetoothGattCharacteristic::kPropertyReliableWrite | BluetoothGattCharacteristic::PROPERTY_RELIABLE_WRITE |
BluetoothGattCharacteristic::kPropertyWritableAuxiliaries)); BluetoothGattCharacteristic::PROPERTY_WRITABLE_AUXILIARIES));
ExtensionTestMessageListener listener("ready", true); ExtensionTestMessageListener listener("ready", true);
listener.set_failure_message("fail"); listener.set_failure_message("fail");
......
...@@ -54,35 +54,36 @@ void PopulateCharacteristicProperties( ...@@ -54,35 +54,36 @@ void PopulateCharacteristicProperties(
std::vector<apibtle::CharacteristicProperty>* api_properties) { std::vector<apibtle::CharacteristicProperty>* api_properties) {
DCHECK(api_properties && api_properties->empty()); DCHECK(api_properties && api_properties->empty());
if (properties == BluetoothGattCharacteristic::kPropertyNone) if (properties == BluetoothGattCharacteristic::PROPERTY_NONE)
return; return;
if (properties & BluetoothGattCharacteristic::kPropertyBroadcast) if (properties & BluetoothGattCharacteristic::PROPERTY_BROADCAST)
api_properties->push_back(apibtle::CHARACTERISTIC_PROPERTY_BROADCAST); api_properties->push_back(apibtle::CHARACTERISTIC_PROPERTY_BROADCAST);
if (properties & BluetoothGattCharacteristic::kPropertyRead) if (properties & BluetoothGattCharacteristic::PROPERTY_READ)
api_properties->push_back(apibtle::CHARACTERISTIC_PROPERTY_READ); api_properties->push_back(apibtle::CHARACTERISTIC_PROPERTY_READ);
if (properties & BluetoothGattCharacteristic::kPropertyWriteWithoutResponse) { if (properties &
BluetoothGattCharacteristic::PROPERTY_WRITE_WITHOUT_RESPONSE) {
api_properties->push_back( api_properties->push_back(
apibtle::CHARACTERISTIC_PROPERTY_WRITEWITHOUTRESPONSE); apibtle::CHARACTERISTIC_PROPERTY_WRITEWITHOUTRESPONSE);
} }
if (properties & BluetoothGattCharacteristic::kPropertyWrite) if (properties & BluetoothGattCharacteristic::PROPERTY_WRITE)
api_properties->push_back(apibtle::CHARACTERISTIC_PROPERTY_WRITE); api_properties->push_back(apibtle::CHARACTERISTIC_PROPERTY_WRITE);
if (properties & BluetoothGattCharacteristic::kPropertyNotify) if (properties & BluetoothGattCharacteristic::PROPERTY_NOTIFY)
api_properties->push_back(apibtle::CHARACTERISTIC_PROPERTY_NOTIFY); api_properties->push_back(apibtle::CHARACTERISTIC_PROPERTY_NOTIFY);
if (properties & BluetoothGattCharacteristic::kPropertyIndicate) if (properties & BluetoothGattCharacteristic::PROPERTY_INDICATE)
api_properties->push_back(apibtle::CHARACTERISTIC_PROPERTY_INDICATE); api_properties->push_back(apibtle::CHARACTERISTIC_PROPERTY_INDICATE);
if (properties & if (properties &
BluetoothGattCharacteristic::kPropertyAuthenticatedSignedWrites) { BluetoothGattCharacteristic::PROPERTY_AUTHENTICATED_SIGNED_WRITES) {
api_properties->push_back( api_properties->push_back(
apibtle::CHARACTERISTIC_PROPERTY_AUTHENTICATEDSIGNEDWRITES); apibtle::CHARACTERISTIC_PROPERTY_AUTHENTICATEDSIGNEDWRITES);
} }
if (properties & BluetoothGattCharacteristic::kPropertyExtendedProperties) { if (properties & BluetoothGattCharacteristic::PROPERTY_EXTENDED_PROPERTIES) {
api_properties->push_back( api_properties->push_back(
apibtle::CHARACTERISTIC_PROPERTY_EXTENDEDPROPERTIES); apibtle::CHARACTERISTIC_PROPERTY_EXTENDEDPROPERTIES);
} }
if (properties & BluetoothGattCharacteristic::kPropertyReliableWrite) if (properties & BluetoothGattCharacteristic::PROPERTY_RELIABLE_WRITE)
api_properties->push_back(apibtle::CHARACTERISTIC_PROPERTY_RELIABLEWRITE); api_properties->push_back(apibtle::CHARACTERISTIC_PROPERTY_RELIABLEWRITE);
if (properties & BluetoothGattCharacteristic::kPropertyWritableAuxiliaries) { if (properties & BluetoothGattCharacteristic::PROPERTY_WRITABLE_AUXILIARIES) {
api_properties->push_back( api_properties->push_back(
apibtle::CHARACTERISTIC_PROPERTY_WRITABLEAUXILIARIES); apibtle::CHARACTERISTIC_PROPERTY_WRITABLEAUXILIARIES);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment