CheckGatewayLoginStatus static method

Future<LoginResponse> CheckGatewayLoginStatus(
  1. String gatewayIp,
  2. int gatewayPort
)

Implementation

static Future<LoginResponse> CheckGatewayLoginStatus(
    String gatewayIp, int gatewayPort) async {
  final channel = await Channel.getGateWayChannel(gatewayIp, gatewayPort);
  final stub = GatewayLoginManagerClient(channel);
  LoginResponse loginResponse = await stub.checkGatewayLoginStatus(Empty());
  print('GetOpenIoTHubToken: ${loginResponse}');
  channel.shutdown();
  //未登录返回false,登录了返回true
  return loginResponse;
}