Keyevent - masaru-takano/DeviceConnect-Spec GitHub Wiki

概要

デバイスのキーイベントが操作されたことを通知する機能。

目次

API 概要
GET /gotapi/keyevent/onDown デバイスのキーが押されたときの情報を取得する。
PUT /gotapi/keyevent/onDown デバイスのキーが押されたことを通知するイベントを開始する。
DELETE /gotapi/keyevent/onDown デバイスのキーが押されたことを通知するイベントを停止する。
GET /gotapi/keyevent/onKeyChange デバイスのキーが押された、離された時の情報を取得する。
PUT /gotapi/keyevent/onKeyChange デバイスのキーが押された、または離されたことを通知するイベントを開始する。
DELETE /gotapi/keyevent/onKeyChange デバイスのキーが押された、または離されたことを通知するイベントを停止する。
GET /gotapi/keyevent/onUp デバイスのキーが離されたときの情報を取得する。
PUT /gotapi/keyevent/onUp デバイスのキーが離されたことを通知するイベントを開始する。
DELETE /gotapi/keyevent/onUp デバイスのキーが離されたことを通知するイベントを停止する。

種別

one-shot

概要

デバイスのキーが押されたときの情報を取得する。

プラグイン側でキャッシュしている最新のイベントメッセージを1つ取得する。

リクエスト

物理名 データ型 必須 説明
serviceId string Yes サービスID。取得対象スマートデバイス

レスポンス

物理名 データ型 必須 説明
result integer Yes 0:正常応答
0以外:異常応答
keyevent object Yes KeyEvent
KeyEventのオブジェクト。
id integer Yes 離されたKeyのID
config string No 離されたKeyのConfig
product string Yes DeviceConnectシステムの名前。
version string Yes DeviceConnectシステムのバージョン名。
hmac string No レスポンスに対する署名。アプリケーション側から事前にHMACキーを共有されていた場合は必須。

レスポンスサンプル

{
  "result" : 0,
  "product" : "Example System",
  "version" : "1.0.0",
  "keyevent" : {
    "config" : "5",
    "id" : 149
  }
}

種別

event

概要

デバイスのキーが押されたことを通知するイベントを開始する。

当該イベントの通知を開始する。

リクエスト

物理名 データ型 必須 説明
serviceId string Yes サービスID。取得対象スマートデバイス
interval long No デバイスプラグインがイベントを送信する間隔。

レスポンス

物理名 データ型 必須 説明
result integer Yes 0:正常応答
0以外:異常応答
product string Yes DeviceConnectシステムの名前。
version string Yes DeviceConnectシステムのバージョン名。
hmac string No レスポンスに対する署名。アプリケーション側から事前にHMACキーを共有されていた場合は必須。

レスポンスサンプル

{
  "result" : 0,
  "product" : "Example System",
  "version" : "1.0.0"
}

イベント

物理名 データ型 必須 説明
keyevent object Yes KeyEvent
KeyEventのオブジェクト。
id integer Yes 離されたKeyのID
config string No 離されたKeyのConfig
attribute string Yes アトリビュート名。
serviceId string Yes 0:正常応答
0以外:異常応答
interface string Yes インターフェース名。
profile string Yes プロファイル名。

イベントサンプル

{
  "serviceId" : "Host.dummyId.localhost.deviceconnect.org",
  "profile" : "keyevent",
  "attribute" : "ondown",
  "keyevent" : {
    "config" : "5",
    "id" : 149
  }
}

種別

event

概要

デバイスのキーが押されたことを通知するイベントを停止する。

当該イベントの通知を停止する。

リクエスト

物理名 データ型 必須 説明
serviceId string Yes サービスID。取得対象スマートデバイス

レスポンス

物理名 データ型 必須 説明
result integer Yes 0:正常応答
0以外:異常応答
product string Yes DeviceConnectシステムの名前。
version string Yes DeviceConnectシステムのバージョン名。
hmac string No レスポンスに対する署名。アプリケーション側から事前にHMACキーを共有されていた場合は必須。

レスポンスサンプル

{
  "result" : 0,
  "product" : "Example System",
  "version" : "1.0.0"
}

種別

one-shot

概要

デバイスのキーが押された、離された時の情報を取得する。

プラグイン側でキャッシュしている最新のイベントメッセージを1つ取得する。

リクエスト

物理名 データ型 必須 説明
serviceId string Yes サービスID。取得対象スマートデバイス

レスポンス

物理名 データ型 必須 説明
result integer Yes 0:正常応答
0以外:異常応答
keyevent object Yes KeyEvent
KeyEventのオブジェクト。
state string Yes 押されたKeyのID
id integer Yes 押された、もしくは離された時のKeyのID
config string No 押された、もしくは離された時のKeyのConfig
product string Yes DeviceConnectシステムの名前。
version string Yes DeviceConnectシステムのバージョン名。
hmac string No レスポンスに対する署名。アプリケーション側から事前にHMACキーを共有されていた場合は必須。

レスポンスサンプル

{
  "result" : 0,
  "product" : "Example System",
  "version" : "1.0.0",
  "keyevent" : {
    "state" : "up",
    "config" : "5",
    "id" : 149
  }
}

種別

event

概要

デバイスのキーが押された、または離されたことを通知するイベントを開始する。

当該イベントの通知を開始する。

リクエスト

物理名 データ型 必須 説明
serviceId string Yes サービスID。取得対象スマートデバイス

レスポンス

物理名 データ型 必須 説明
result integer Yes 0:正常応答
0以外:異常応答
product string Yes DeviceConnectシステムの名前。
version string Yes DeviceConnectシステムのバージョン名。
hmac string No レスポンスに対する署名。アプリケーション側から事前にHMACキーを共有されていた場合は必須。

レスポンスサンプル

{
  "result" : 0,
  "product" : "Example System",
  "version" : "1.0.0"
}

イベント

物理名 データ型 必須 説明
keyevent object Yes KeyEvent
KeyEventのオブジェクト。
state string Yes 押されたKeyのID
id integer Yes 押された、もしくは離された時のKeyのID
config string No 押された、もしくは離された時のKeyのConfig
attribute string Yes アトリビュート名。
serviceId string Yes 0:正常応答
0以外:異常応答
interface string Yes インターフェース名。
profile string Yes プロファイル名。

イベントサンプル

{
  "serviceId" : "Host.dummyId.localhost.deviceconnect.org",
  "profile" : "keyevent",
  "attribute" : "onkeychange",
  "keyevent" : {
    "state" : "up",
    "config" : "5",
    "id" : 149
  }
}

種別

event

概要

デバイスのキーが押された、または離されたことを通知するイベントを停止する。

当該イベントの通知を停止する。

リクエスト

物理名 データ型 必須 説明
serviceId string Yes サービスID。取得対象スマートデバイス

レスポンス

物理名 データ型 必須 説明
result integer Yes 0:正常応答
0以外:異常応答
product string Yes DeviceConnectシステムの名前。
version string Yes DeviceConnectシステムのバージョン名。
hmac string No レスポンスに対する署名。アプリケーション側から事前にHMACキーを共有されていた場合は必須。

レスポンスサンプル

{
  "result" : 0,
  "product" : "Example System",
  "version" : "1.0.0"
}

種別

one-shot

概要

デバイスのキーが離されたときの情報を取得する。

プラグイン側でキャッシュしている最新のイベントメッセージを1つ取得する。

リクエスト

物理名 データ型 必須 説明
serviceId string Yes サービスID。取得対象スマートデバイス

レスポンス

物理名 データ型 必須 説明
result integer Yes 0:正常応答
0以外:異常応答
keyevent object Yes KeyEvent
KeyEventのオブジェクト。
id integer Yes 押されたKeyのID
config string No 押されたKeyのConfig
product string Yes DeviceConnectシステムの名前。
version string Yes DeviceConnectシステムのバージョン名。
hmac string No レスポンスに対する署名。アプリケーション側から事前にHMACキーを共有されていた場合は必須。

レスポンスサンプル

{
  "result" : 0,
  "product" : "Example System",
  "version" : "1.0.0",
  "keyevent" : {
    "config" : "play",
    "id" : 672
  }
}

種別

event

概要

デバイスのキーが離されたことを通知するイベントを開始する。

当該イベントの通知を開始する。

リクエスト

物理名 データ型 必須 説明
serviceId string Yes サービスID。取得対象スマートデバイス
interval long No デバイスプラグインがイベントを送信する間隔。

レスポンス

物理名 データ型 必須 説明
result integer Yes 0:正常応答
0以外:異常応答
product string Yes DeviceConnectシステムの名前。
version string Yes DeviceConnectシステムのバージョン名。
hmac string No レスポンスに対する署名。アプリケーション側から事前にHMACキーを共有されていた場合は必須。

レスポンスサンプル

{
  "result" : 0,
  "product" : "Example System",
  "version" : "1.0.0"
}

イベント

物理名 データ型 必須 説明
keyevent object Yes KeyEvent
KeyEventのオブジェクト。
id integer Yes 押されたKeyのID
config string No 押されたKeyのConfig
attribute string Yes アトリビュート名。
serviceId string Yes 0:正常応答
0以外:異常応答
interface string Yes インターフェース名。
profile string Yes プロファイル名。

イベントサンプル

{
  "serviceId" : "Host.dummyId.localhost.deviceconnect.org",
  "profile" : "keyevent",
  "attribute" : "onup",
  "keyevent" : {
    "config" : "play",
    "id" : 672
  }
}

種別

event

概要

デバイスのキーが離されたことを通知するイベントを停止する。

当該イベントの通知を停止する。

リクエスト

物理名 データ型 必須 説明
serviceId string Yes サービスID。取得対象スマートデバイス

レスポンス

物理名 データ型 必須 説明
result integer Yes 0:正常応答
0以外:異常応答
product string Yes DeviceConnectシステムの名前。
version string Yes DeviceConnectシステムのバージョン名。
hmac string No レスポンスに対する署名。アプリケーション側から事前にHMACキーを共有されていた場合は必須。

レスポンスサンプル

{
  "result" : 0,
  "product" : "Example System",
  "version" : "1.0.0"
}
⚠️ **GitHub.com Fallback** ⚠️