IBM Streams 4.2.1

SPL File device.spl

Content

Operators
  • DeviceCommands: Subscribe to device commands for an IBM Watson IoT Platform organization.
  • DeviceEvents: Subscribe to device events for an IBM Watson IoT Platform organization.
  • DeviceStatuses: Subscribe to device status events for an IBM Watson IoT Platform organization.
  • SendCommandToDevice: Send commands to devices registered for an IBM Watson IoT Platform organization.

Composites

composite DeviceEvents(output stream<DeviceEvent> Events)

Subscribe to device events for an IBM Watson IoT Platform organization.

This operator subscribes to the MQTT topic:

iot-2/type/typeId/id/deviceId/evt/eventId/fmt/json

Parameters

  • org: Organization identifier.
  • domain: Service domain, used to define the host for the MQTT message hub host, which will be org.messaging.domain. Defaults to internetofthings.ibmcloud.com supporting IBM Watson IoT Platform hosted on Bluemix.
  • authKey: Application key.
  • authToken: Application authorization token.
  • appId: Application identifier for the MQTT client identifier, defaults to jobId_evt.
  • typeId: Subscribe to device events from devices of a specific type. Defaults to + for all device types.
  • deviceId: Subscribe to device events from a specific device. Defaults to + for all devices with the specified type.
  • eventId: Subscribe to device events for a specified identifier. Defaults to + for all event identifiers.
  • encrypted: True to use encrypted connections to IBM Watson IoT Platform, false to use unencrypted , defaults to true.

Output Ports

composite DeviceStatuses(output stream<DeviceStatus> Statuses)

Subscribe to device status events for an IBM Watson IoT Platform organization.

This operator subscribes to the MQTT topic:

iot-2/type/typeId/id/deviceId/mon/

Parameters

  • org: Organization identifier.
  • domain: Service domain, used to define the host for the MQTT message hub host, which will be org.messaging.domain. Defaults to internetofthings.ibmcloud.com supporting IBM Watson IoT Platform hosted on Bluemix.
  • appId: application identifier for the MQTT client identifier, defaults to jobId_mon.
  • authKey: Application key.
  • authToken: Application authorization token.
  • typeId: Subscribe to device events from devices of a specific type. Defaults to + for all device types.
  • deviceId: Subscribe to device events from a specific device. Defaults to + for all devices with the specified type.
  • encrypted: True to use encrypted connections to IBM Watson IoT Platform, false to use unencrypted , defaults to true.

Output Ports

  • Statuses: Stream of device status events of type DeviceStatus.

composite DeviceCommands(output stream<DeviceCmd> Commands)

Subscribe to device commands for an IBM Watson IoT Platform organization.

This operator subscribes to the MQTT topic:

iot-2/type/typeId/id/deviceId/cmd/cmdId/fmt/json

Parameters

  • org: Organization identifier.
  • domain: Service domain, used to define the host for the MQTT message hub host, which will be org.messaging.domain. Defaults to internetofthings.ibmcloud.com supporting IBM Watson IoT Platform hosted on Bluemix.
  • authKey: Application key.
  • authToken: Application authorization token.
  • appId: Application identifier for the MQTT client identifier, defaults to jobId_cmd.
  • typeId: Subscribe to device commands for devices of a specific type. Defaults to + for all device types.
  • deviceId: Subscribe to device commands for a specific device. Defaults to + for all devices with the specified type.
  • cmdId: Subscribe to device commands for a specified identifier. Defaults to + for all command identifiers.
  • encrypted: True to use encrypted connections to IBM Watson IoT Platform, false to use unencrypted , defaults to true.

Output Ports

  • Commands: Stream of device commands of type DeviceCmd.

composite SendCommandToDevice(input stream<DeviceCmd> Commands)

Send commands to devices registered for an IBM Watson IoT Platform organization. Each tuple is published as a device command to the device specified in the input tuple.

This operator publishes each command to MQTT topic at QoS 2:

iot-2/type/typeId/id/deviceId/cmd/cmdId/fmt/json

Parameters

  • org: Organization identifier.
  • domain: Service domain, used to define the host for the MQTT message hub host, which will be org.messaging.domain. Defaults to internetofthings.ibmcloud.com supporting IBM Watson IoT Platform hosted on Bluemix.
  • appId: application identifier for the MQTT client identifier, defaults to jobId_snd.
  • authKey: Application key.
  • authToken: Application authorization token.
  • encrypted: True to use encrypted connections to IBM Watson IoT Platform, false to use unencrypted , defaults to true.

Input Ports

  • Commands: Stream of device commands of type DeviceCmd.