roleCapabilities property

String? get roleCapabilities

Implementation

String? get roleCapabilities {
  if (attributes.containsKey(EIRType.LERole)) {
    assert(attributes[EIRType.LERole]!.length == 1,
        "Bytes length of LE Role must be 1");
    var index = attributes[EIRType.LERole]![0];
    if (index < leRoleList.length) {
      return leRoleList[index];
    } else {
      return "Reserved 0x${index.toRadixString(16)}";
    }
  } else {
    return null;
  }
}
set roleCapabilities (String? value)

Implementation

set roleCapabilities(String? value) {
  if (leRoleList.contains(value)) {
    int index = leRoleList.indexOf(value!);
    var bytes = <int>[0];
    bytes.add(index);
    attributes[EIRType.LERole] = Uint8List.fromList(bytes);
  } else {
    throw ArgumentError("Role capability $value is undefined");
  }
}