C# Class Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices.DeviceBase

Simulates a single IoT device that sends and recieves data from a transport
Inheritance: IDevice
Afficher le fichier Open project: Azure/azure-iot-remote-monitoring Class Usage Examples

Protected Properties

Свойство Type Description
ConfigProvider IConfigurationProvider
Logger ILogger
RootCommandProcessor Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.CommandProcessors.CommandProcessor
TelemetryFactory ITelemetryFactory
Transport ITransport
TransportFactory ITransportFactory
_telemetryController object

Méthodes publiques

Méthode Description
DeviceBase ( ILogger logger, ITransportFactory transportFactory, ITelemetryFactory telemetryFactory, IConfigurationProvider configurationProvider ) : System

GetDeviceInfo ( ) : DeviceModel

Generates a DeviceInfo packet for a simulated device to send over the wire

Init ( Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.InitialDeviceConfig config ) : void
SendDeviceInfo ( ) : Task
StartAsync ( CancellationToken token ) : Task

Starts the send event loop and runs the receive loop in the background to listen for commands that are sent to the device

Méthodes protégées

Méthode Description
InitCommandProcessors ( ) : void

Builds up a set of commands supported by this device

InitDeviceInfo ( Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.InitialDeviceConfig config ) : void

Private Methods

Méthode Description
StartReceiveLoopAsync ( CancellationToken token ) : Task

Starts the loop that listens for events/commands from the IoT Hub to be sent to this device

StartSendLoopAsync ( CancellationToken token ) : Task

Iterates through the list of IEventGroups and fires off the events in a given event group before moving to the next. If RepeatEventListForever is true the device will continue to loop through each event group, if false once a single pass is made through all event groups the device will stop sending events

Method Details

DeviceBase() public méthode

public DeviceBase ( ILogger logger, ITransportFactory transportFactory, ITelemetryFactory telemetryFactory, IConfigurationProvider configurationProvider ) : System
logger ILogger Logger where this device will log information to
transportFactory ITransportFactory
telemetryFactory ITelemetryFactory
configurationProvider IConfigurationProvider
Résultat System

GetDeviceInfo() public méthode

Generates a DeviceInfo packet for a simulated device to send over the wire
public GetDeviceInfo ( ) : DeviceModel
Résultat Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.DeviceModel

Init() public méthode

public Init ( Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.InitialDeviceConfig config ) : void
config Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.InitialDeviceConfig
Résultat void

InitCommandProcessors() protected méthode

Builds up a set of commands supported by this device
protected InitCommandProcessors ( ) : void
Résultat void

InitDeviceInfo() protected méthode

protected InitDeviceInfo ( Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.InitialDeviceConfig config ) : void
config Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.InitialDeviceConfig
Résultat void

SendDeviceInfo() public méthode

public SendDeviceInfo ( ) : Task
Résultat Task

StartAsync() public méthode

Starts the send event loop and runs the receive loop in the background to listen for commands that are sent to the device
public StartAsync ( CancellationToken token ) : Task
token System.Threading.CancellationToken
Résultat Task

Property Details

ConfigProvider protected_oe property

protected IConfigurationProvider ConfigProvider
Résultat IConfigurationProvider

Logger protected_oe property

protected ILogger Logger
Résultat ILogger

RootCommandProcessor protected_oe property

protected CommandProcessor,Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.CommandProcessors RootCommandProcessor
Résultat Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.CommandProcessors.CommandProcessor

TelemetryFactory protected_oe property

protected ITelemetryFactory TelemetryFactory
Résultat ITelemetryFactory

Transport protected_oe property

protected ITransport Transport
Résultat ITransport

TransportFactory protected_oe property

protected ITransportFactory TransportFactory
Résultat ITransportFactory

_telemetryController protected_oe property

protected object _telemetryController
Résultat object