parseTransportsBitmask function

List<ComputerTransport> parseTransportsBitmask(
  1. int transportsBitmask
)

Implementation

List<ComputerTransport> parseTransportsBitmask(int transportsBitmask) {
  final transports = <ComputerTransport>[];

  if (transportsBitmask & 1 << 0 != 0) {
    transports.add(ComputerTransport.serial);
  }
  if (transportsBitmask & 1 << 1 != 0) {
    transports.add(ComputerTransport.usb);
  }
  if (transportsBitmask & 1 << 2 != 0) {
    transports.add(ComputerTransport.usbhid);
  }
  if (transportsBitmask & 1 << 3 != 0) {
    transports.add(ComputerTransport.irda);
  }
  if (transportsBitmask & 1 << 4 != 0) {
    transports.add(ComputerTransport.bluetooth);
  }
  if (transportsBitmask & 1 << 5 != 0) {
    transports.add(ComputerTransport.ble);
  }

  return transports;
}