setDeviceMac static method

Future setDeviceMac(
  1. Device device
)

Implementation

static Future setDeviceMac(Device device) async {
  final channel = await Channel.getOpenIoTHubChannel();
  final stub = CommonDeviceManagerClient(channel);
  final response = await stub.setDeviceMac(device);
  print('Greeter client received: ${response}');
  channel.shutdown();
  //服务器同步
  HostInfo hostInfo = HostInfo();
  hostInfo.uUID = device.uuid;
  hostInfo.mac = device.mac;
  HostManager.SetDeviceMac(hostInfo);
}