Skip to content
Frederik Walk edited this page Feb 4, 2016 · 2 revisions

msgpc is a client application intended to simulate a device. Most operations supported by the device API are supported by the client.

Each invocation of msgpc can simulate a single device at any given time. A simulated device may be saved to a configuration file, which later invocations may load and simulate further actions of the same device. Each operation of a device is triggered by an action specification on the command line, which itself consists of the action name and possibly action arguments.

All commands that require communication use ::1 for the server address. This is not currently configurable.

Supported actions are:

  • newRandom: create a new device with a random device ID, without any sensors attached to it and unattached to any user
  • newSDM630" Create a new device with a random device ID, unattached to any user and sensors for all SDM630 measurement values attached.
  • save <filename>: save the currently simulated device to <filename>
  • load <filename>: load <filename> and simulate the device it describes
  • heartbeat: send a heartbeat to the registered-device server
  • genSensors <n>: generate n sensors with random IDs and units. Sensors are not automatically registered
  • registerSensors: register the current sensor set of the device with the server
  • sendRandomUpdates <interval> <n>: send updates for all sensors in interval interval, up to n times. If n is negative, updates will be sent until the client is terminated. interval is a string understood by time.ParseDuration
  • sendSDM630Update <interval <n> <device>: Same a sendRandomUpdates, but using values from a SDM630 device
  • renameSensors: rename all sensors of the simulated device to random names
  • replaceSensors: delete all sensors of the current device and create equally many new random sensors. Sensors are automatically registered.
  • rename: rename the current device to a random name derived from the device ID
  • wait <n>: n times, wait for command from the server and process it
Clone this wiki locally