value property

int get value

Retrieves the bitmask value corresponding to the characteristic permission.

Each characteristic permission has a unique bitmask value. This method maps the enum value to its corresponding bitmask value.

Implementation

int get value {
  switch (this) {
    case BleCharacteristicPermission.read:
      return 0x01;
    case BleCharacteristicPermission.readEncrypted:
      return 0x02;
    case BleCharacteristicPermission.readEncryptedMitm:
      return 0x04;
    case BleCharacteristicPermission.write:
      return 0x10;
    case BleCharacteristicPermission.writeEncrypted:
      return 0x20;
    case BleCharacteristicPermission.writeEncryptedMitm:
      return 0x40;
    case BleCharacteristicPermission.writeSigned:
      return 0x80;
    case BleCharacteristicPermission.writeSignedMitm:
      return 0x100;
  }
}