Documentation ¶
Index ¶
- type DataGenerator
- func (d *DataGenerator) GenerateC2DAck(c2dMsg *common.Message) *common.Message
- func (d *DataGenerator) GenerateReportedProperties(device *device) (iotdevice.TwinState, error)
- func (d *DataGenerator) GenerateTelemetryMessage(device *device, creationTime time.Time) ([]*telemetryMessage, error)
- func (d *DataGenerator) GenerateTwinUpdateAck(desiredTwin iotdevice.TwinState) iotdevice.TwinState
- type DeviceProvisioner
- type ProvisioningRequest
- type ProvisioningResponse
- type Simulator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataGenerator ¶
type DataGenerator struct { CapabilityModel *models.DeviceCapabilityModel // the capability model of the device. // contains filtered or unexported fields }
DataGenerator generates telemetry messages and reported property updates based on the device capability model.
func NewDataGenerator ¶
func NewDataGenerator(capabilityModel *models.DeviceCapabilityModel, geopoints [][3]float64) *DataGenerator
func (*DataGenerator) GenerateC2DAck ¶
func (d *DataGenerator) GenerateC2DAck(c2dMsg *common.Message) *common.Message
GenerateTwinUpdate creates a reported properties ACK based on the desired properties
func (*DataGenerator) GenerateReportedProperties ¶
func (d *DataGenerator) GenerateReportedProperties(device *device) (iotdevice.TwinState, error)
GenerateReportedProperties generate reported property update based on the device capability model.
func (*DataGenerator) GenerateTelemetryMessage ¶
func (d *DataGenerator) GenerateTelemetryMessage(device *device, creationTime time.Time) ([]*telemetryMessage, error)
GenerateTelemetryMessage generate a telemetry messages based on the device capability model.
func (*DataGenerator) GenerateTwinUpdateAck ¶
func (d *DataGenerator) GenerateTwinUpdateAck(desiredTwin iotdevice.TwinState) iotdevice.TwinState
GenerateTwinUpdate creates a reported properties ACK based on the desired properties
type DeviceProvisioner ¶
type DeviceProvisioner struct {
// contains filtered or unexported fields
}
DeviceProvisioner responsible for provisioning devices via DPS.
func NewProvisioner ¶
func NewProvisioner(ctx context.Context, cfg *config.SimulationConfig) *DeviceProvisioner
NewProvisioner creates a new deviceProvisioner.
func (*DeviceProvisioner) Provision ¶
func (p *DeviceProvisioner) Provision(req *ProvisioningRequest) *ProvisioningResponse
Provision provisions a device in IoT Central
type ProvisioningRequest ¶
type ProvisioningRequest struct { DeviceID string // device deviceID to register the device as. Context context.Context // context of the provision request. Simulation *models.Simulation // simulation that is requesting the device provision. Target *models.SimulationTarget // target to provision the device with. Model *models.DeviceModel // model to associate with the device. }
ProvisioningRequest represents a request to provision a device in IoT Central.
type ProvisioningResponse ¶
type ProvisioningResponse struct { *ProvisioningRequest // the request to which this response is generated. ConnectionString string // Result of the provision request. }
ProvisioningResponse represents the response for a given provision request.
type Simulator ¶
type Simulator struct {
// contains filtered or unexported fields
}
Simulator simulates a number of devices connecting to IoT Central
func Start ¶
func Start( ctx context.Context, config *config.SimulationConfig, simulation *models.Simulation) (*Simulator, error)
Start starts the simulation.