Ejemplo n.º 1
0
        /// <summary>
        /// Launch a direct method on a set of devices
        /// </summary>
        //// <param name="devices">List of device ids</param>
        /// <returns>True if the masstransit publish command has succeeded</returns>
        public async Task <bool> LaunchDevicesDirectMethods(DevicesLaunchDirectMethodModel devices)
        {
            await _serviceBus.BusAccess.Publish(new IoTDevicesDirectMethodRequestedEvent()
            {
                DeviceIds     = devices.DeviceIds,
                MethodName    = devices.MethodName,
                MethodPayload = devices.Payload
            });

            return(true);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> LaunchDevicesDirectMethod(DevicesLaunchDirectMethodModel devices)
        {
            var result = await _iotHubControllerDataManager.LaunchDevicesDirectMethods(devices);

            return(Ok(result));
        }