GetAllMqttDevice static method

Future<MqttDeviceInfoList> GetAllMqttDevice()

Implementation

static Future<MqttDeviceInfoList> GetAllMqttDevice() async {
  String jwt = await getJWT();
  Empty empty = Empty();
  final channel = await Channel.getDefaultIoTManagerChannel();
  final stub = MqttDeviceManagerClient(channel,
      options: CallOptions(metadata: {'jwt': jwt}));
  MqttDeviceInfoList mqttDeviceInfoList = await stub.getAllMqttDevice(empty);
  print('MqttDeviceInfoList: ${mqttDeviceInfoList}');
  channel.shutdown();
  return mqttDeviceInfoList;
}