Skip to content

Dice Profile

TakayukiHoshi1984 edited this page Mar 27, 2017 · 4 revisions

目次

API 機能概要
Magnetometer Event API 磁力センサー値を通知する。
Dice Event API ダイスの目を通知する。

機能概要

Dice+が搭載しているいくつかのセンサー検知を通知するAPI。

参考API

なし

インターフェース名称 Version 種別
Magnetometer Event API 2.0.0 非同期I/F(イベントI/F)

概要

磁力センサー値を通知する。

イベント情報

イベント名 Content-Type
/gotapi/dice/magnetometer/onMagnetometer application/json

メッセージ

論理名 物理名 データ型 省略 設定値
オブジェクト magnetometer object - 磁力センサーオブジェクト
マイクロテスラのX軸の値 x number - マイクロテスラのX軸の値
(単位:μT)
マイクロテスラのY軸の値 y number - マイクロテスラのY軸の値
(単位:μT)
マイクロテスラのZ軸の値 z number - マイクロテスラのZ軸の値
(単位:μT)
フィルタタイプ filter number - この磁力計の読み出しのためのフィルタタイプ
1:RawFilter
2:LowPassFilter
インターバル interval number - 計測のインターバル
(単位: ミリ秒)

メッセージサンプル

{
    "product":"Device Connect Manager",
    "version":"x.x",
    "serviceId":"localhost.deviceconnect.org",
    "api" : "gotapi",
    "profile":"dice",
    "interface":"magnetometer",
    "attribute":"onMagnetometer",
	 "sessionKey":"0a93ac0aade4e046ed63eb24d1172f5f35c88ca60daa901547c28d5827cb418a5de1d7c5f9e62405",
    "magnetometer" : {
		"x": 1.402,
		"y": 1.033,
	   "z" : 0.5,
	   "filter":2,
	   "interval":500
	 }
}
インターフェース名称 Version 種別
Dice Event API 2.0.0 非同期I/F(イベントI/F)

概要

ダイスの目を通知する。

イベント情報

イベント名 Content-Type
/gotapi/dice/onDice application/json

メッセージ

論理名 物理名 データ型 省略 設定値
オブジェクト dice object - ダイスオブジェクト
ダイスの目 pip number - ダイスの目

メッセージサンプル

{
    "product":"Device Connect Manager",
    "version":"x.x",
    "serviceId":"localhost.deviceconnect.org",
    "api" : "gotapi",
    "profile":"dice",
    "attribute":"onDice",
    "sessionKey":"0a93ac0aade4e046ed63eb24d1172f5f35c88ca60daa901547c28d5827cb418a5de1d7c5f9e62405",
    "dice":{
        "pip":1
    }
}

Clone this wiki locally