IoT PnP Bridgeのconfig.json

IoT Plug and Play Bridgeのconfig.jsonを斜め読み。

config.jsonはこちら。

github.com

ドキュメントはこちらにありますが、当然、英語ですorz

雰囲気で読んでみましょう。

全体の構成

大きく、

  • pnp_bridge_parameters
  • devices
  • discovery_adapters

の3つ。

pnp_bridge_parameters

pnp_bridge_parametersに上位への接続文字列(Azure IoT Hubとか、Azure IoT Hub DPSへの接続文字列)が含まれています。

pnp_bridge_parameters.connection_parameters.device_capability_model_uriがあるので、事前にリポジトリへDCMを登録しておかないと動かないのかな?

devices

下位デバイスの情報。配列です。

サンプルでは、DEVICE1~4の、4つが書かれています。

  • DEVICE1 ... USB device
  • DEVICE2 ... MCU sensor hub(←UARTっぽい)
  • DEVICE3 ... Camera
  • DEVICE4 ... Modbus Sensor(←TCP

discovery_adapters

謎。

サンプルで書かれているのは、USBデバイスの探索(USBデバイスが接続されたのを検知する)のようです。

For example, we want the WindowPnPDiscovery to report device that register USB device interface class.

CameraDisoverySerialPnpは、どうやって書くんだろう??