本文整理汇总了Java中android.bluetooth.BluetoothGattDescriptor.PERMISSION_WRITE_SIGNED属性的典型用法代码示例。如果您正苦于以下问题:Java BluetoothGattDescriptor.PERMISSION_WRITE_SIGNED属性的具体用法?Java BluetoothGattDescriptor.PERMISSION_WRITE_SIGNED怎么用?Java BluetoothGattDescriptor.PERMISSION_WRITE_SIGNED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.bluetooth.BluetoothGattDescriptor
的用法示例。
在下文中一共展示了BluetoothGattDescriptor.PERMISSION_WRITE_SIGNED属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decodePermissions
public static WritableMap decodePermissions(BluetoothGattDescriptor descriptor) {
// NOTE: props strings need to be consistent across iOS and Android
WritableMap props = Arguments.createMap();
int permissions = descriptor.getPermissions();
if ((permissions & BluetoothGattDescriptor.PERMISSION_READ) != 0x0 ) {
props.putString("Read", "Read");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_WRITE) != 0x0 ) {
props.putString("Write", "Write");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_READ_ENCRYPTED) != 0x0 ) {
props.putString("ReadEncrypted", "ReadEncrypted");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_WRITE_ENCRYPTED) != 0x0 ) {
props.putString("WriteEncrypted", "WriteEncrypted");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_READ_ENCRYPTED_MITM) != 0x0 ) {
props.putString("ReadEncryptedMITM", "ReadEncryptedMITM");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_WRITE_ENCRYPTED_MITM) != 0x0 ) {
props.putString("WriteEncryptedMITM", "WriteEncryptedMITM");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_WRITE_SIGNED) != 0x0 ) {
props.putString("WriteSigned", "WriteSigned");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_WRITE_SIGNED_MITM) != 0x0 ) {
props.putString("WriteSignedMITM", "WriteSignedMITM");
}
return props;
}
示例2: decodePermissions
public static JSONArray decodePermissions(BluetoothGattDescriptor descriptor) {
// NOTE: props strings need to be consistent across iOS and Android
JSONArray props = new JSONArray();
int permissions = descriptor.getPermissions();
if ((permissions & BluetoothGattDescriptor.PERMISSION_READ) != 0x0 ) {
props.put("Read");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_WRITE) != 0x0 ) {
props.put("Write");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_READ_ENCRYPTED) != 0x0 ) {
props.put("ReadEncrypted");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_WRITE_ENCRYPTED) != 0x0 ) {
props.put("WriteEncrypted");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_READ_ENCRYPTED_MITM) != 0x0 ) {
props.put("ReadEncryptedMITM");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_WRITE_ENCRYPTED_MITM) != 0x0 ) {
props.put("WriteEncryptedMITM");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_WRITE_SIGNED) != 0x0 ) {
props.put("WriteSigned");
}
if ((permissions & BluetoothGattDescriptor.PERMISSION_WRITE_SIGNED_MITM) != 0x0 ) {
props.put("WriteSignedMITM");
}
return props;
}