Esempio n. 1
0
        static void Main(string[] args)
        {
            //Create-Retrieve Device
            ManageDevice manageDevice = new ManageDevice();
            Task<Device> taskDevice = manageDevice.AddRetrieveDevice();
            Device device = taskDevice.Result;
            IoTHubCredentials.DeviceIdentity = device.Authentication.SymmetricKey.PrimaryKey;
            Console.WriteLine("Device: {0}", device.Authentication.SymmetricKey.PrimaryKey);

            //Send Cloud 2 Device Command
            SendCloud2DeviceCommand sendCloud2DeviceCommand = new SendCloud2DeviceCommand();
            sendCloud2DeviceCommand.SendCommand();

            //Get Delivery Status
            GetDeliveryStatus getDeliveryStatus = new GetDeliveryStatus();
            getDeliveryStatus.GetStatus();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            //Create-Retrieve Device
            ManageDevice  manageDevice = new ManageDevice();
            Task <Device> taskDevice   = manageDevice.AddRetrieveDevice();
            Device        device       = taskDevice.Result;

            IoTHubCredentials.DeviceIdentity = device.Authentication.SymmetricKey.PrimaryKey;
            Console.WriteLine("Device: {0}", device.Authentication.SymmetricKey.PrimaryKey);

            //Send Cloud 2 Device Command
            SendCloud2DeviceCommand sendCloud2DeviceCommand = new SendCloud2DeviceCommand();

            sendCloud2DeviceCommand.SendCommand();

            //Get Delivery Status
            GetDeliveryStatus getDeliveryStatus = new GetDeliveryStatus();

            getDeliveryStatus.GetStatus();
        }