Example #1
0
        public static RegisterDeviceResponse Unmarshall(UnmarshallerContext _ctx)
        {
            RegisterDeviceResponse registerDeviceResponse = new RegisterDeviceResponse();

            registerDeviceResponse.HttpResponse = _ctx.HttpResponse;
            registerDeviceResponse.Message      = _ctx.StringValue("RegisterDevice.Message");
            registerDeviceResponse.RequestId    = _ctx.StringValue("RegisterDevice.RequestId");
            registerDeviceResponse.ErrorCode    = _ctx.IntegerValue("RegisterDevice.ErrorCode");
            registerDeviceResponse.ErrorMessage = _ctx.StringValue("RegisterDevice.ErrorMessage");

            RegisterDeviceResponse.RegisterDevice_Data data = new RegisterDeviceResponse.RegisterDevice_Data();
            data.Rid = _ctx.StringValue("RegisterDevice.Data.Rid");
            registerDeviceResponse.Data = data;

            return(registerDeviceResponse);
        }
Example #2
0
        public static RegisterDeviceResponse Unmarshall(UnmarshallerContext context)
        {
            RegisterDeviceResponse registerDeviceResponse = new RegisterDeviceResponse();

            registerDeviceResponse.HttpResponse = context.HttpResponse;
            registerDeviceResponse.RequestId    = context.StringValue("RegisterDevice.RequestId");
            registerDeviceResponse.Success      = context.BooleanValue("RegisterDevice.Success");
            registerDeviceResponse.ErrorMessage = context.StringValue("RegisterDevice.ErrorMessage");

            RegisterDeviceResponse.RegisterDevice_Data data = new RegisterDeviceResponse.RegisterDevice_Data();
            data.IotId                  = context.StringValue("RegisterDevice.Data.IotId");
            data.ProductKey             = context.StringValue("RegisterDevice.Data.ProductKey");
            data.DeviceName             = context.StringValue("RegisterDevice.Data.DeviceName");
            data.DeviceSecret           = context.StringValue("RegisterDevice.Data.DeviceSecret");
            registerDeviceResponse.Data = data;

            return(registerDeviceResponse);
        }
        //在某一产品下创建一台设备
        public void TestRegisterDevice()
        {
            DefaultAcsClient acsClient = Demo.IotClient.GetClient();

            RegisterDeviceRequest request = new RegisterDeviceRequest();

            request.ProductKey = "<productKey>";
            request.DeviceName = "device0822";


            RegisterDeviceResponse response = acsClient.GetAcsResponse(request);

            Console.WriteLine(response.Success);
            Console.WriteLine(response.ErrorMessage);

            RegisterDeviceResponse.RegisterDevice_Data device = response.Data;
            Console.WriteLine("Device IotId: " + device.IotId);
            Console.WriteLine("Device Secret: " + device.DeviceSecret);
            Console.WriteLine("Device Name: " + device.DeviceName);
        }
Example #4
0
        public static RegisterDeviceResponse Unmarshall(UnmarshallerContext _ctx)
        {
            RegisterDeviceResponse registerDeviceResponse = new RegisterDeviceResponse();

            registerDeviceResponse.HttpResponse = _ctx.HttpResponse;
            registerDeviceResponse.RequestId    = _ctx.StringValue("RegisterDevice.RequestId");
            registerDeviceResponse.Success      = _ctx.BooleanValue("RegisterDevice.Success");
            registerDeviceResponse.Code         = _ctx.StringValue("RegisterDevice.Code");
            registerDeviceResponse.ErrorMessage = _ctx.StringValue("RegisterDevice.ErrorMessage");

            RegisterDeviceResponse.RegisterDevice_Data data = new RegisterDeviceResponse.RegisterDevice_Data();
            data.IotId                  = _ctx.StringValue("RegisterDevice.Data.IotId");
            data.ProductKey             = _ctx.StringValue("RegisterDevice.Data.ProductKey");
            data.DeviceName             = _ctx.StringValue("RegisterDevice.Data.DeviceName");
            data.DeviceSecret           = _ctx.StringValue("RegisterDevice.Data.DeviceSecret");
            data.DevEui                 = _ctx.StringValue("RegisterDevice.Data.DevEui");
            data.JoinEui                = _ctx.StringValue("RegisterDevice.Data.JoinEui");
            data.Nickname               = _ctx.StringValue("RegisterDevice.Data.Nickname");
            registerDeviceResponse.Data = data;

            return(registerDeviceResponse);
        }