※一部、英文及び仏文を自動翻訳した日本語訳を使用しています。
2 サービスモデリングの定義
2.1 サービスタイプ
次のサービス タイプは、このテンプレートに準拠するサービスを識別します。
2.2 状態変数
読者の注意: 初めて読む人は、状態変数の定義を読む前に、アクションの定義 (表 3 へのリンクをたどる) を読むと、より洞察が深まるかもしれません 。
「通常の」状態変数は、デバイスのサービスの実際の永続的な状態を表します。
A_ARG_TYPE 状態変数は、アクションの継続中にのみ有効な一時値に関連付けられます。これらの状態変数は、特定の状態変数に直接関係しない引数で使用されます。
2.2.1 派生データ型
この句は、特別な構文を使用して UPnP 文字列データ型として表されるいくつかの派生データ型を定義します。
2.2.1.1 UPnP 引数としての XML ドキュメント
UPnP Low Power サービスは、XML ドキュメントを UPnP アクションの引数として使用します。含まれる UPnP データ型は文字列です。これにより、文字列の内容に制限がかかります。整形式の XML ドキュメントを表す必要があります。
UPnP 低電力デバイスで使用される XML スキーマは、 http://www.upnp.org/schemas/ にあるそれぞれのファイルで定義されています。
XML ドキュメントでは、実装は適切な名前空間への明示的な参照を使用する場合があります。最後に、XML ドキュメントは、UPnP™ V1.0 アーキテクチャ 0 に準拠し、SOAP 要求または応答メッセージに埋め込む前に、通常の XML ルール [XML10] を使用してエスケープする必要があります。 XML エスケープ ルールは、上記の参考資料から要約されています。
- • (<) 文字は (<) としてエンコードされます。
- • (>) 文字は (>) としてエンコードされます。
- • (&) 文字は (&) としてエンコードされます。
- • ("") 文字は (") としてエンコードされます。
- • (') 文字は (') としてエンコードされます。
表 3 —状態変数
| 変数名 | 必須またはa | データ型 | 許容値b | デフォルト値b | 近くに。単位 |
|---|---|---|---|---|---|
| バッテリー低下 | O | ブール値 | falseの場合は 1 本当です。 | 0 | 該当なし |
| 外部電源供給源 | O | ui1 | ACの場合は1, 内部電源の場合は0 | 該当なし | 該当なし |
| ウェイクアップ方法 | R | 文字列 (XML ドキュメント) | 第 2.2.4 項を参照 | 該当なし | 該当なし |
| 電源ステータス | R | 文字列 (XML ドキュメント) | 2.2.5項を参照 | 該当なし | 該当なし |
| 睡眠期間 | R | ui4 | -1=無限 秒単位の整数値 | -1 | 秒 |
| 電源状態 | R | 弦 | 4 つの電力状態: -アクティブ=0 透明=1 -ディープスリープオンライン=2 -ディープスリープオフライン=4 (範囲 0 ~ 4) | 0 | 該当なし |
2.2.2 バッテリー残量低下
この変数は、バッテリーの充電量が低下したことを示すために使用されます。この変数のタイプはブール値であり、ベンダーは希望の充電レベルを選択して、この変数をそれぞれ true 状態または false 状態に設定できます。
これはブール型のオプションの変数です。デフォルト値は「0」で、バッテリーの充電量が少なくないことを示します。
2.2.3 外部電源ソース
この変数は、外部電源が使用されているか内部電源が使用されているかを示します。これは、電源ステータスの変化をイベント化することを目的としています。
これは、ui1 型のオプションの変数です。値はAC電源の場合は1, 内部電源の場合は0です。
2.2.4 ウェイクアップ方法
この変数には、アクションが受信された特定のベアラーのデバイスによってサポートされるウェイクアップ方法が含まれます。これは XML ドキュメントのタイプの必須変数です
この変数は、「urn:schema-upnp-org:lp:wakeupmethod」で識別されるスキーマによって記述されます。これは http://www.upnp.org/schemas/lp/WakeupMethod.xsd にあります。要素は次のとおりです。
- • BearerWakeupMethod: ウェイクアップ メソッドごとに固有の要素
- • IanaTechnology Type 、802.3 (値 = 6) や 802.11 (値 = 71) などのメディア インターフェイス タイプを示す整数です。このパラメータに許可される整数値は、IANA リファレンス ifType-MIB < http://www.iana.org/assignments/ianaiftype-mib > で指定されています。
- •特定の Wakeup メソッドで指定されたとおりにデバイスをウェイクアップするには、WakeUpPattern を送信する必要があります。タイプは文字列で、使用されるシステムに依存し、正確な形式は UPnP フォーラムによって定義されていません。
- • AdditionalBearerInfo を使用すると、ベンダーはデバイスの MAC アドレスを追加できます。これは文字列形式ですが、ベアラーによって定義されたアドレス タイプに従う必要があります。たとえば、802 ネットワークでは 802 アドレス タイプが使用されます。ベンダーは、インターフェイスの名前 (MAC アドレス、BTH アドレスなど) などの追加情報を文字列形式で追加することもできます。
• NonBearerWakeupMethod には 2 つの文字列型要素 (赤外線リモコンなど) が含まれます。
- • Bearer Type 、新しいベアラで拡張できる列挙リストです。現在、「NFC」と「赤外線」の 2 つの方式が定義されています。
- • VendorNonBearerInfo は、このベアラーのベンダーを定義する文字列型です。
2.2.5 電源ステータス
この必須の変数は、「urn: schema-upnporg:lp:powersupplystatus」で識別されるスキーマによって記述されます。これは http://www.upnp.org/schemas/lp/PowerSupplyStatus.xsd にあります。これには次のフィールドが含まれます。
- •外部電源
- • ExternalPowerSupplySource は文字列型で、外部電源のベンダー定義情報 (たとえば、「mains」) が含まれます。
- • IsConnected はブール型で、使用される値は接続状態を示す「1」、未接続状態を示す 0 です。
•内部電源
- •パーセンテージで表した残量ステータス (値の範囲は 0 ~ 100)
- •バッテリーが持続する残り時間 (値は PxxDTyyHzzMここで, は日 (0 ~ 99)、yy は時間 (0 ~ 24)、zz は分 (0 ~ 60) です。0 から詳細を参照してください。
2.2.6 スリープ期間
この必須変数には、デバイスがスリープ状態になる期間が含まれます。この変数の型は ui4 です。
2.2.7 電源状態
この必須変数は、デバイスの電源状態情報を提供します。この変数は「GoToSleep」アクションで使用されます。低電力対応コントロール ポイントは、デバイスが移行するスリープ状態の PowerState を定義できます。スリープ デバイスには 3 つのスリープ電源状態 (トランスペアレント、ディープ スリープ オンライン、ディープ スリープ オフライン) があるため、PowerState=1 はトランスペアレント状態を定義するために使用され、PowerState=2 はディープ スリープ オンラインを定義し、PowerState=4 はディープ スリープ オフラインを表します。この変数のタイプは文字列であり、サービス説明ドキュメントには、allowedvaluelist 属性でサポートされている電源状態の更新されたリストが含まれている必要があります。デバイスはいずれかの電源状態にのみ移行できるため、電源状態を組み合わせることはできません。表 1 の状態の説明を参照してください。
2.2.8 低電力 SSDP 拡張機能
低電力デバイスには、電力状態の変更を伝達するための新しい SSDP ヘッダーのセットが含まれている必要があります。
表 4 — SSDP 電源管理拡張ヘッダー。
| ヘッダー | 価値 | 説明 |
|---|---|---|
| パワーステート | 表 1 の電源状態 | デバイスの新しい電源状態を示します。 |
| 睡眠期間 | 秒数または無限 | デバイスが特定の電力モード状態に留まると予想される期間を示します (例: スリープ: 整数 (スペースなし) で表される秒数または無限、または無限の場合は -1) 基本電源管理プロキシには、推奨されるスリープ時間が含まれる場合があり、デバイスはプロキシによって推奨されるスリープ期間よりも長いスリープ期間を設定できない場合があります。 |
| 登録状態 | バイナリ状態 | この項目は将来のバージョン用に予約されています。 |
2.3 イベンティングとモデレーション
表 5 —状態変数イベント処理
| 変数名 | イベントあり | モデレートされたイベント | 最大イベントレート(N/min) | 論理結合 | イベントごとの最小デルタ |
|---|---|---|---|---|---|
| バッテリー低下 | はい | はい | 1 | 該当なし | 該当なし |
| 外部電源供給源 | はい | はい | 1 | 該当なし | 該当なし |
| ウェイクアップ方法 | no | 該当なし | 該当なし | 該当なし | 該当なし |
| 電源ステータス | no | 該当なし | 該当なし | 該当なし | 該当なし |
| 睡眠期間 | no | 該当なし | 該当なし | 該当なし | 該当なし |
| 電源状態 | no | 該当なし | 該当なし | 該当なし | 該当なし |
UPnP 低電力デバイスは、現在の電源ステータスを通知するために使用できる 2 つのイベント変数 (表 5) を提供します。 BatteryLow は、バッテリー駆動のデバイスが、デバイスが低バッテリーで動作していることを示す警告メッセージをコントロール ポイントに送信することを目的としています。 ExternalPowerSupplySource は、デバイスの電源が主電源 (AC) とバッテリー電源 (DC) の間で切り替わったときにイベントを送信することを目的としています。ベンダーは、必要に応じてイベント レートを最大から 1 分あたり 1 イベントまで調整できます。
2.4 一般的な LP 対応コントロール ポイントの推奨事項
コントロール ポイントは、ネットワーク内のすべての低電力デバイスの電力管理情報をキャッシュできます。特に、LP 対応コントロール ポイント ベンダーが基本電源管理プロキシの存在に依存したくない場合はそうです。
基本電源管理プロキシが存在する場合、LP 対応コントロール ポイントは、検出プロセス中にプロキシからスリープ状態のデバイスのリストを取得する必要があります。
低電力対応コントロール ポイントがデバイスによって提供される帯域外ウェイクアップを実行できる場合、コントロール ポイントは低電力デバイスを直接ウェイクアップする必要があります。
ネットワーク内で使用可能なキャッシュ プロキシがない場合は、スリープ デバイスのリストを維持するために LP 対応コントロール ポイントをアクティブのままにしておく必要があります。
LP 対応コントロール ポイントは、低電力 SSDP 拡張ヘッダーをサポートする必要があります。 。
低電力デバイスが M-Search または UPnP アクションに応答しない場合、コントロール ポイントはデバイスが切断状態にあると想定する必要があります。ただし、デバイスがディープ スリープ オフライン状態になっている可能性があり、LP 対応コントロール ポイントがデバイスのウェイクアップを数回試行する可能性があります。ウェイクアップ試行が数回失敗した後、LP 対応コントロール ポイントはデバイスが利用できないと想定し、UPnP 低電力デバイスは切断状態にあると見なす必要があります。
低電力デバイスがディープ スリープ オンラインまたはディープ スリープ オフライン状態にある場合、コントロール ポイントは、低電力デバイスのスリープ期間が終了するまでキャッシュからそのデバイスを削除しないでください。 wakeup コマンドが失敗した場合、コントロール ポイントはデバイスが切断されたと見なす必要があります (追加の待機時間を追加する必要があります)ディープ スリープ オンラインまたはディープ スリープ オフラインの低電力デバイスは SSDP キープ アライブ メッセージを送信しないため、これは必要です。
2.5 アクション
表 6 は、後で詳細に示されるアクションを示し、その後に、アクションの簡単な説明、状態変数に対するアクションの影響、およびアクションによって定義されるエラー コードを含む、アクションに関する詳細情報が続きます。
表 6 —アクション
| 名前 | 必須またはa |
|---|---|
| GetPowerManagementInfo() | R |
| 起きろ() | R |
| 寝る() | R |
2.5.1 GetPowerManagementInfo()
デバイスは、アクションが受信されたインターフェイスの電力管理関連情報 (たとえば、ベアラー固有のウェイクアップ メカニズム、ネットワーク インターフェイス情報、ベンダー定義の情報、非ベアラー固有のウェイクアップ メカニズムなど) を提供します。
2.5.1.1 引数
表 7 — GetPowerManagementInfo() の引数
| 口論 | 方向 | 関連する状態変数 |
|---|---|---|
| ウェイクアップ方法 | 外 | ウェイクアップ方法 |
| 電源ステータス | 外 | 電源ステータス |
2.5.1.2 状態への依存性 (存在する場合)
なし。これらは静的な機能です。
2.5.1.3 状態への影響(ある場合)
なし。
2.5.1.4 コントロールポイントの要件
このアクションは、デバイスから情報を取得するために使用されます。コントロール ポイントは、後で使用するためにウェイクアップ情報をキャッシュする場合があります。この情報は、基本電源管理プロキシが存在しない場合に、ディープ スリープ状態でデバイスをウェイクアップするために使用できます。当然のことながら、標準のキープアライブメッセージングを備えたアクティブまたはトランスペアレント状態のデバイスはキャッシュに保持される可能性があります。
2.5.1.5 エラー
一般的なエラー コードについては、「UPnP デバイス アーキテクチャ」を参照してください。
表 8 — GetPowerManagementInfo() のエラー コード
| エラーコード | エラーの説明 | 説明 |
|---|---|---|
| 701 | 電源管理情報を返せません | デバイスエラー |
2.5.2 ウェイクアップ()
デバイスは、トランスペアレントまたはディープ スリープ オンライン状態のときにデバイスをウェイクアップするための制御アクションを提供します。
2.5.2.1 状態への依存性 (存在する場合)
このアクションはオンライン モードでのみ使用できます
2.5.2.2 状態への影響 (ある場合)
デバイスがウェイクアップ アクションに応答すると、電源状態が変化します。ウェイクアップ アクションを受信すると、デバイスはアクティブ状態に遷移します。スリープ期間は 0 に設定する必要があります。
2.5.2.3 コントロールポイントの要件
コントロール ポイントは、ウェイクアップ アクション後にデバイスの新しい電源状態を確認する必要があります。デバイスは内部電源状態を唯一制御しており、電源状態を変更することはできません。検証は、デバイスのアドバタイズメントから行うことも、GetPowerManagementInfo() アクションを通じて直接行うこともできます。
コントロール ポイントは、新しい状態が通知されるまで、新しい電源管理アクションを実行しないでください。
デバイスがアクティブ状態に移行するときは、スリープ期間を使用しないでください。
2.5.2.4 エラー
デバイスがアクティブ モードへの変更を拒否する場合があります。この場合、エラー 707 が返されます。
表 9 — WakeUp() のエラー コード
| エラーコード | エラーの説明 | 説明 |
|---|---|---|
| 707 | アクションが拒否されました | デバイスが電源状態の変更を拒否しました |
2.5.3 GoToSleep()
デバイスは、アクションを受信するとスリープ モードに入る制御アクションを提供します。このアクションは、デバイスにスリープ モード (つまり、オンラインまたはオフラインのトランスペアレントなディープ スリープ) に入るように推奨します。
2.5.3.1 引数
表 10 — GoToSleep() の引数
| 口論 | 方向 | 関連する状態変数 |
|---|---|---|
| 推奨睡眠時間 | で | 睡眠期間 |
| 推奨される電源状態 | で | 電源状態 |
| 睡眠期間 | 外 | 睡眠期間 |
| 電源状態 | 外 | 電源状態 |
2.5.3.2 状態への依存性 (存在する場合)
2.5.3.3 状態への影響(ある場合)
デバイスが推奨される電源状態の変更によるアクションに応答すると、電源状態が変更されます。
2.5.3.4 コントロールポイントの要件
図 1 は、低電力デバイスで許可される状態遷移を示しています。低電力デバイスは、許可された状態遷移を維持しますが、図 1 で定義された遷移に違反するか、内部的な理由により、ある状態への遷移を拒否する場合があります。
コントロール ポイントは、特定の電源状態または遷移が実装されていない場合の状況を適切に処理する必要があります。
2.5.3.5 エラー
一般的なエラー コードについては、「UPnP デバイス アーキテクチャ」を参照してください。
表 11 — GoToSleep() のエラー コード
| エラーコード | エラーの説明 | 説明 |
|---|---|---|
| 705 | デバイスが電源状態の変更を拒否する | デバイスは現在の電源状態の変更を拒否します |
| 706 | パワーステートは実装されていません | 推奨される PowerState がデバイスに実装されていない |
| 402 | 無効な引数 | 入力引数が無効です |
2.6 動作理論
低電力デバイス制御プロトコルは、低電力デバイスを照会および管理するためのコントロール ポイントのアクションを提供します。デバイスは、必要な SSDP 低電力拡張ヘッダーを実装する必要があり、電力状態間の遷移時に、図 3 で説明されている低電力ステート マシンに準拠する必要があります。
2.6.1 アクションと操作の説明
UPnP 低電力デバイスは、GetPowerManagementInfo, () アクションを通じて静的な電源管理関連情報を公開します。この情報には、ベアラ タイプ、ウェイクアップ パターン、AdditionalBearerInfo (MAC アドレス、BTH アドレスなど)、NonBearerWakeupMetho, サポートされている電力状態、および PowerSupplyStatus などのベアラ固有のウェイクアップ方法が含まれます。
低電力デバイスは、wakeup() アクションを受信すると、スリープ状態 (つまり、トランスペアレント状態またはディープ スリープ オンライン状態) からアクティブ状態に移行します。 GoToSleep() アクションは、低電力対応コントロール ポイントがデバイスに一定期間スリープ状態のいずれかに入るように要求するメカニズムを提供します。入力スリープ状態とスリープ期間は、低電力対応制御ポイントによって提案されます。デバイスは推奨値を実装している場合と実装していない場合があります。移行先の電源状態と、選択したスリープ期間を返します。
低電力デバイスは、その電力状態を変更するたびに、SSDP メッセージ内の SSDP 拡張ヘッダーを介してこの電力状態の遷移を通知する必要があります。
- •低電力デバイスがアクティブ状態になると、PowerState がアクティブに設定された SSDP アライブ メッセージを送信します。低電力デバイスには、キープアライブ メッセージでアクティブに設定された PowerState オプション ヘッダーが含まれています。
- •低電力デバイスがトランスペアレント状態に移行すると、PowerState がトランスペアレントに設定された SSDP アライブ メッセージが送信され、低電力デバイスがトランスペアレント状態の場合は、PowerState がトランスペアレントに設定された定期的な SSDP アナウンスも送信されます。
- •低電力デバイスがディープ スリープ オンラインまたはディープ スリープ オフライン状態に移行すると、デバイスの対応する電源状態 (つまり、PowerState がディープ スリープ オンラインまたはディープ スリープ オフラインに設定) を含む SSDP byebye メッセージを送信します。
- •デバイスが切断、オンラインのディープ スリープ、またはオフラインのディープ スリープからよりアクティブな状態に移行する場合、最初にアクティブな状態に移行する必要があります。非アクティブな状態に段階的に移行することができます (例: アクティブからトランスペアレント スリープ、トランスペアレント スリープからオンライン ディープ スリープ、オンライン ディープ スリープからオフライン ディープ スリープ、またはオフラインからディープ スリープ)デバイスは、非アクティブ状態に移行するときに状態をバイパスすることもあります。
- •デバイスがどの状態からでも切断状態に移行するときは、低電力拡張ヘッダーなしで byebye メッセージを送信する必要があります。
M-Search を受信すると、アクティブ状態またはトランスペアレント状態の低電力デバイスは、デバイスの対応する PowerState で応答します。低電力デバイスがディープ スリープ オンライン状態にある場合、低電力デバイスは wakeup() アクションにのみ応答します。
デバイスがアクティブまたはトランスペアレント状態にある場合、デバイスは通常の SSDP アライブ メッセージを送信し、デバイス アーキテクチャで定義されているすべての検索に応答します。デバイスがディープ スリープ オンライン状態にある場合、アクティブ状態に移行する前にキープアライブ メッセージは送信されません。ディープ スリープ オフライン状態では、デバイスは通信できず、帯域外の方法でのみウェイクアップできます。デバイスは、低電力 SSDP 拡張ヘッダーでアドバタイズされたスリープ期間が終了する前にウェイクアップし、プロキシまたはコントロール ポイントを使用して UPnP 状態を更新する必要があります。
2.6.2 低電力状態の動作
低電力デバイスは、その低電力状態をアドバタイズすることにより、UPnP ネットワークに対して状態の動作を示します。デバイス ベンダーは、さまざまな方法で内部動作を実装し、低電力状態を実際に実装する方法を決定する場合があります。実装固有のバリエーションに関係なく、実装はこの仕様で指定された応答性要件に従う必要があります。低電力デバイスの状態遷移を図 1 に示します。図 1 では、遷移の一部はデバイスの内部動作によって引き起こされており、これらの遷移は制御ポイントやその他の外部エンティティによって呼び出すことができないことに注意してください。次の状態固有の動作が必要です。
- •アクティブ:アクティブ状態では、UPnP 低電力デバイスはネットワーク上にあり、ネットワーク内の他の UPnP デバイスから認識できます。アクティブ状態のデバイスは、M-search リクエストに応答します。アクティブ状態のデバイスは、通常の SSDP: Alive メッセージを送信します。
- •トランスペアレント:トランスペアレント状態では、UPnP 低電力デバイスはオンラインになり、他の UPnP 低電力デバイスから認識できます。トランスペアレント状態のデバイスは M-search リクエストに応答し、Wakeup() コントロール アクションを呼び出すことでアクティブ状態に復帰できます。トランスペアレント状態のデバイスは、通常の SSDP: Alive メッセージを送信します。
- •ディープ スリープ オンライン:ディープ スリープ オンラインのデバイスはネットワーク上にありますが、ディープ スリープ オンラインの UPnP スタックが部分的にオンラインであるため、Wakeup() 制御アクションを除く UPnP 制御アクションに応答しません。 Deep Sleep Onlineのデバイスは M-search リクエストに応答せず、SSDP: Alive メッセージを送信しません。この状態のデバイスは、Wakeup() コントロール アクションを呼び出すことでウェイクアップできます。
- •ディープ スリープ オフライン:ディープ スリープ オフラインのデバイスはネットワーク上に存在しないため、ネットワーク上の他のデバイスからは認識されません。ディープ スリープ オフラインのデバイスは、M-search リクエストに応答せず、SSDP: Alive メッセージを送信しません。この状態のデバイスは、帯域外ベアラー依存のウェイクアップ メカニズムによってウェイクアップできます。
- •切断:切断状態のデバイスはシャットダウンまたはオフ状態です。この状態のデバイスは、ベンダー定義の方法を使用して起動できます。
以下の図は、さまざまなスリープ状態と状態遷移を引き起こすトリガーの遷移図を示しています。
図 1 — UPnP の低電力状態
遷移については、次の表で説明します。最後の列の内部トリガーは、スリープ状態のデバイスによって生成されるトリガーです。たとえば、省電力モードへの切り替え、ネットワークからの離脱、またはタイムアウト値後のウェイクアップなどのデバイスの決定です。逆に、外部トリガーは、デバイスのスリープ モードへの移行やウェイクアップの要求など、低電力対応コントロール ポイントまたは基本電源管理プロキシによって生成されるトリガーです。また、ネットワーク障害の場合は、すべての電源状態に対する一般的な問題であるため、トリガーとして含まれません。アクティブor トランスペアレント スリープ状態では、定期的な通知がないことによって予期せぬ切断を検出できます。ディープ スリープ状態では、コントロール ポイントは、スリープ期間のタイムアウトの期限を過ぎた場合、またはコントロール ポイントが低電力デバイスのウェイクアップに失敗した場合に、予期しない切断が発生したと推測できます。
表 12 —ステートマシン遷移の説明
| 遷移番号 | 遷移の説明 | トリガーの例 |
|---|---|---|
| 1 | アクティブから切断to 移行: byebyeメッセージが送信されます。 | 内部 |
| 2 | 切断からアクティブto 移行: Aliveメッセージが送信されます。 | 内部 |
| .3 | アクティブからディープ スリープ オンラインto 移行:byebyeメッセージが送信され、PowerState がディープ スリープ オンライン(2) になります。 | 内部または外部のスリープ要求 |
| 4 | ディープ スリープ オンラインからアクティブto 移行: Aliveメッセージが送信されます。 | 内部または外部のユニキャスト制御ウェイクアップ メッセージ |
| 5 | アクティブからトランスペアレントスリープto 移行: PowerState がトランスペアレント(1) スリープ状態に等しいアライブメッセージが送信されます。 | 内部または外部のスリープ要求 |
| 6 | 透過的スリープからアクティブへの移行: Aliveメッセージが送信されます。 | 内部および外部ユニキャスト制御メッセージ |
| 7 | アクティブからディープ スリープ オフラインto 移行: PowerState がディープ スリープ オフライン (4) であるバイバイメッセージが送信されます。 | 内部または外部のスリープ要求 |
| 8 | ディープ スリープ オフラインからアクティブto 移行: Aliveメッセージが送信されます。 | 内部または外部、ベアラー固有のウェイクアップ メカニズム (例: WL) |
| 9 | トランスペアレントスリープからディープ スリープ オンラインへの移行: PowerState がディープ スリープ オンライン(2) に等しいbyebyeメッセージが送信されます。 | 内部または外部のスリープ要求 |
| 10 | ディープ スリープ オンラインからトランスペアレントスリープto 移行: PowerState がトランスペアレント(1) スリープ状態に等しいAliveメッセージが送信されます。 | 内部 |
| 11 | トランスペアレントスリープからディープ スリープ オフラインへの移行: PowerState がディープ スリープ/オフライン (4) に等しいバイバイメッセージが送信されます。 | 内部または外部のスリープ要求 |
| 12 | ディープ スリープ オフラインからトランスペアレントスリープto 移行: PowerState がトランスペアレント(1) スリープ状態に等しいAliveメッセージが送信されます。 | 内部または外部ベアラー固有のウェイクアップ メカニズム |
| 13 | ディープ スリープ オンラインからディープ スリープ オフラインto 移行: ディープ スリープ オフライン (4) と等しい PowerState を持つバイバイメッセージが送信されます。 | 内部 |
| 14 | ディープ スリープ オンラインから切断to 移行: byebyeメッセージが送信されます。 | 内部 |
| 15 | 透過的スリープから切断への移行: byebyeメッセージが送信されます。 | 内部 |
| 16 | 切断から透過的スリープto 移行: PowerState が透過的(1) スリープ状態に等しいAliveメッセージが送信されます。 | 内部 |
| 17 | ディープ スリープ オフラインから切断to 移行: IP 接続がないため、スリープ状態のデバイスからメッセージを送信できません。 | 内部 |
2 Service Modeling Definitions
2.1 ServiceType
The following service type identifies a service that is compliant with this template:
2.2 State Variables
Reader Note: For first-time reader, it may be more insightful to read the actiondefinition (follow link to Table 3) before reading the state variable definitions.
The"regular" state variables represent some actual, persistent state of the device's service.
The A_ARG_TYPE state variables are associated with temporary values only valid for the duration of the action. These state variables are used in arguments that do not directly relate to a specific state variable.
2.2.1 Derived data Types
This clause defines some derived data types that are represented as UPnP string data types with special syntax.
2.2.1.1 XML documents as UPnP Arguments
The UPnP Low Power service uses XML documents as arguments in UPnP actions. The containing UPnP data type is a string. This places restrictions on a string's content; it has to represent a well-formed XML document.
The XML schemas used in UPnP Low Power Device are defined in the respective files located on http://www.upnp.org/schemas/
In the XML documents, implementations may use an explicit reference to appropriate namespaces. Finally, an XML document, in adherence to the UPnP™ V1.0 architecture 0, needs to be escaped by using the normal XML rules [XML10] before embedding it in a SOAP request or response message. The XML escaping rules are summarized from the reference mentioned above:
- • The (<) character is encoded as (<)
- • The (>) character is encoded as (>)
- • The (&) character is encoded as (&)
- • The (") character is encoded as (")
- • The (') character is encoded as (')
Table 3 — State Variables
| Variable Name | Req. or Opt. a | Data Type | Allowed Value b | Default Value b | Eng. Units |
|---|---|---|---|---|---|
| BatteryLow | O | boolean | 0 for false; 1 true. | 0 | N/A |
| ExternalPowerSupplySource | O | ui1 | 1 for AC, 0 for internal power source | N/A | N/A |
| WakeupMethod | R | string (XML document) | See Clause 2.2.4 | N/A | N/A |
| PowerSupplyStatus | R | string (XML document ) | See clause 2.2.5 | N/A | N/A |
| SleepPeriod | R | ui4 | -1= infinite Integer value in seconds | -1 | Seconds |
| PowerState | R | string | Four PowerStates: -Active=0 Transparent=1 -Deep Sleep Online=2 -Deep Sleep Offline=4 (range 0-4) | 0 | N/A |
2.2.2 BatteryLow
This variable is used to indicate when battery charge is low. The type of this variable is Boolean and vendors may select desired charge level to set this variable to true state or to false state, respectively..
This is an optional variable of Boolean type. The Default value is"0" indicating that battery charge is not low.
2.2.3 ExternalPowerSupplySource
This variable indicates whether external or internal power source is in use. This is intended for eventing changes on power supply status.
This is an optional variable of ui1 type. Values are 1 for AC power, and 0 for internal power source
2.2.4 WakeupMethod
This variable includes the wake up methods supported by the device for the specific bearer on which the action was received. This is required variable of type of XML document
This variable is described by schema identified by"urn: schema-upnp-org:lp:wakeupmethod"; and it is located at: http://www.upnp.org/schemas/lp/WakeupMethod.xsd . The elements are:
- • BearerWakeupMethod: Unique element per wake up method
- • IanaTechnologyType is an integer that indicates media interface type, such as 802.3 (value=6) or 802.11 (value=71). The allowed integer values for this parameter are specified in the IANA reference ifType-MIB < http://www.iana.org/assignments/ianaiftype-mib >.
- • WakeUpPattern has to be transmitted to wake up the device as specified by the specific Wakeup method. The type is string and it is dependent on the system used and exact format is not defined by UPnP forum.
- • AdditionalBearerInfo allows vendors to add MAC address of the device. This is a string format, but it should follow the address type defined by the bearer. For instance, 802 address types are used in 802 network. A vendor may also add additional information in string format, for instance, the name of the interface (e.g.MAC address, BTH Address).
• NonBearerWakeupMethod includes two string type elements (e.g. Infrared remote control):
- • BearerType is enumerated list that can be extended with new bearers. Currently two methods have been defined:"NFC", and"Infrared"
- • VendorNonBearerInfo is of type string defining the vendor of this bearer
2.2.5 PowerSupplyStatus
This required variable is described by schema identified by"urn: schema-upnporg:lp:powersupplystatus" ; and it is located at http://www.upnp.org/schemas/lp/PowerSupplyStatus.xsd . It includes the following fields:
- • ExternalPowerSupply
- • ExternalPowerSupplySource is of type string including vendor defined information for external power source, for instance," mains"
- • IsConnected is of type Boolean and values used are"1" indicating connected state, 0 for unconnected state
• InternalPowerSupply
- • The remaining power status in terms of percentage (value range 0-100)
- • The remaining time that battery lasts (The value should be in format of PxxDTyyHzzM ここで, xx is days (0-99) , yy is hours (0-24), and zz is minutes (0-60). See details from 0
2.2.6 SleepPeriod
This required variable includes duration that the device is going to be in sleep state. The type of this variable is ui4.
2.2.7 PowerState
This required variable provides the power state information of the device. This variable is used in"GoToSleep" action. Low power aware Control Point can define the sleeping PowerState that the device should transition to. Since the sleeping device can have three sleeping power states, i.e., Transparent, Deep Sleep Online, Deep Sleep Offline, PowerState=1 is used to define Transparent state, PowerState=2 defines Deep Sleep Online, and PowerState=4 stands for Deep Sleep Offline. The type of this variable is string and service description document must have updated list of supported powerstates in allowedvaluelist attribute. The device can transition into only one of the power states, therefore a combination of power states is not allowed. See states description from Table 1.
2.2.8 Low power SSDP extensions
The low power device has to include a set of new SSDP headers to communicate the power state changes.
Table 4 — SSDP power management extension headers.
| Header | Value | Description |
|---|---|---|
| Powerstate | Power states in Table 1 | Indicate the new power state of the device. |
| SleepPeriod | Number of seconds or infinite | Indicate the period that the device is expected to remain in certain power mode state (e.g. Sleep: number of seconds or infinite represented with an integer (no space) or -1 for infinite The Basic Power Management Proxy may include recommended time to sleep and the device may not set a sleep period bigger than the one recommended by the proxy. |
| RegistrationState | Binary state | This item is reserved for future versions. |
2.3 Eventing and Moderation
Table 5 — State variable eventing
| Variable Name | Evented | Moderated event | Max event rate(N/min) | Logical combination | Min Delta per event |
|---|---|---|---|---|---|
| BatteryLow | Yes | Yes | 1 | N/A | N/A |
| ExternalPowerSupplySource | Yes | Yes | 1 | N/A | N/A |
| WakeupMethod | no | N/A | N/A | N/A | N/A |
| PowerSupplyStatus | no | N/A | N/A | N/A | N/A |
| SleepPeriod | no | N/A | N/A | N/A | N/A |
| PowerState | no | N/A | N/A | N/A | N/A |
UPnP low power device provides two evented variables (Table 5) that can be used to advertise current power source status. BatteryLow is intended for battery powered device to send warning messages to control points stating that the device is operating on a low battery. The ExternalPowerSupplySource is intended to send events when the device's power is switched between main power (AC) and battery power (DC). Vendors may tune event rates from maximum to 1 event per minute if so desired.
2.4 Generic LP-aware control point recommendations
Control points may cache power management information of all low power devices in the network. Especially, if the LP-aware control point vendor does not want to rely on the presence of Basic power management proxies.
If Basic Power Management Proxy is present, LP-aware control point should fetch the list of sleeping devices from the proxy during the discovery process.
If a low power aware control point can perform out-of-band wake-up provided by the device, the control point should wake the low power device directly.
If no caching proxies are available in the network, LP-aware control point should stay active to maintain list of sleeping devices.
LP-aware Control point must support low power SSDP extension headers. .
If a low power device does not respond to M-Search or UPnP action, the control point should assume that device is in disconnected state. However, the device may be in deep sleep offline state and the LP-aware control point may try to wake up the device several times. After several unsuccessful wake up attempts, the LP-aware control point should assume that device is not available and the UPnP Low Power device should be considered to be in the disconnected state.
If a low power device is in deep sleep online or deep sleep offline state, the control point should not remove it from cache before the low power device's sleep period has expired. If wakeup command fails, then control point should consider device disconnected (some additional wait time should be added). This is necessary as a low power device in deep sleep online or deep sleep offline does not send SSDP keep alive messages.
2.5 Actions
Table 6 presents actions that are later presented in detail followed by detailed information about actions, including short descriptions of the actions, the effects of the actions on state variables, and error codes defined by the actions.
Table 6 — Actions
| Name | Req. or Opt. a |
|---|---|
| GetPowerManagementInfo() | R |
| Wakeup() | R |
| GoToSleep() | R |
2.5.1 GetPowerManagementInfo()
The device will provide power management related information of the interface on which the action was received (e.g. bearer specific wake up mechanism, network interface information, vendor defined information, non-bearer specific wakeup mechanism, etc).
2.5.1.1 Arguments
Table 7 — Arguments for GetPowerManagementInfo()
| Argument | Direction | relatedStateVariable |
|---|---|---|
| WakeupMethod | Out | WakeupMethod |
| PowerSupplyStatus | Out | PowerSupplyStatus |
2.5.1.2 Dependency on State (if any)
None, these are static capabilities.
2.5.1.3 Effect on State (if any)
None.
2.5.1.4 Control point requirements
This action is used to retrieve information from the device. The control point may cache Wake-up information for later use. This information can be used to wake up device in deep sleep states in the case when Basic Power Management Proxy is not present. Naturally, devices in active or transparent states with standard keep alive messaging may be kept in cache.
2.5.1.5 Errors
Refer to UPnP Device architecture for common error codes.
Table 8 — Error Codes for GetPowerManagementInfo()
| errorCode | ErrorDescription | Description |
|---|---|---|
| 701 | Cannot return power management info | Device error |
2.5.2 Wakeup()
The device will provide a control action to wake up the device when it is transparent or deep sleep online state.
2.5.2.1 Dependency on State (if any)
This action can be used only in online modes
2.5.2.2 Effect on State (if any)
The power state changes after the device responds to the wake up action. When wake up action is received, the device transitions to the Active state. The sleep period should be set to 0.
2.5.2.3 Control point requirements
Control point must verify new power state of a device after wake up action. The Device has the sole control of internal power states and may not change its power state. Verification may happen either from device advertisement or directly through GetPowerManagementInfo() action.
Control point should not engage new power management action until the new state is advertised.
When a device transitions to active state, the sleep period should not be used.
2.5.2.4 Errors
Device may refuse to change into active mode. In this case it returns error 707
Table 9 — Error Codes for WakeUp()
| errorCode | ErrorDescription | Description |
|---|---|---|
| 707 | Action refused | Device refused to change power state |
2.5.3 GoToSleep()
The device will provide a control action to go into sleep mode when the action is received. This action provides a recommendation to the device to go into sleep mode (i.e. Transparent, deep sleep online or offline)
2.5.3.1 Arguments
Table 10 — Arguments for GoToSleep()
| Argument | Direction | RelatedStateVariable |
|---|---|---|
| RecommendedSleepPeriod | In | SleepPeriod |
| RecommendedPowerState | In | PowerState |
| SleepPeriod | Out | SleepPeriod |
| PowerState | Out | PowerState |
2.5.3.2 Dependency on State (if any)
2.5.3.3 Effect on State (if any)
The power state changes when the device responds to the action with the recommended power state change.
2.5.3.4 Control point requirements
Figure 1 presents allowed state transitions for a low power device. A low power device retains in allowed state transitions and may decline to transition to some state either by violating transitions defined in figure one or due internal reasons
Control point should gracefully handle situation when certain power state or transition is not implemented.
2.5.3.5 Errors
Refer to UPnP Device architecture for common error codes.
Table 11 — Error Codes for GoToSleep()
| errorCode | ErrorDescription | Description |
|---|---|---|
| 705 | Device rejects to change power state | The device refuses to change the current power state |
| 706 | Powerstate not implemented | The recommended PowerState is not implemented by device |
| 402 | Invalid argument | The input arguments are not valid |
2.6 Theory of Operation
The Low Power Device Control Protocol provides actions for control points to query and manage low-power devices. The device must implement the required SSDP low power extension headers and should conform to the low power state machine, described in Figure 3, when transitioning between power states.
2.6.1 Explanation of Actions and operations
A UPnP Low Power device will expose its static Power Management related information through the GetPowerManagementInfo() action. This information includes bearer specific wakeup method such as Bearer type, wakeup pattern, AdditionalBearerInfo (e.g. MAC address, BTH Address, etc), NonBearerWakeupMethod (e.g. Infrared, NFC), supported power states and PowerSupplyStatus.
The Low Power device will transition out of the sleeping state (i.e., transparent state or Deep Sleep Online state) to active state upon receiving a wakeup() action. The GoToSleep() action provides a mechanism for low power aware Control Point to request the device to enter one of the sleeping states for a certain period. The input sleeping state and sleeping period are suggested by the low power aware control point. The device may or may not implement the recommended values. It will return the power state that it is going to transition to and the sleeping period that it chooses.
Whenever the Low Power device changes its power state, it must announce this power state transition via the SSDP extension header inside SSDP messages.
- • When the Low Power device enters active state, it sends SSDP alive messages with PowerState set to active. The low power device includes the PowerState optional header set to active in the keepalive messages.
- • When the Low Power device transitions to Transparent state, it sends SSDP alive messages with PowerState set to transparent, and when the Low Power device is in Transparent state, it also sends periodic SSDP announcements with PowerState set to transparent.
- • When the Low Power device transitions to Deep Sleep Online or Deep Sleep Offline state, it sends SSDP byebye messages with the corresponding power state of device (i.e., PowerState set to deep sleep online or deep sleep offline).
- • When a device transitions from Disconnected, Deep Sleep online, or Deep Sleep offline to more active state, it must first transition to the active state. It is allowed to transition step-by-step to less active state(e.g. active to transparent sleep, transparent sleep to deep-sleep online, deep sleep online to deep sleep offline, or deep sleep offline to disconnected). The device may also bypass states when going to less active state.
- • When a device transitions to disconnected state from any state it should send a byebye message without Low power extension headers.
On receiving M-Search, the Low Power device in either Active state or Transparent state responds with the corresponding PowerState of the device. If a Low Power device is in Deep Sleep Online state, the Low Power device responds only to the wakeup() action.
When a device is in active or transparent states, it sends normal SSDP alive messages and responds to all searches as defined in the device architecture. If device is in deep sleep online state, it will not send keepalive messages before it transitions to active state. In deep sleep offline state the device cannot communicate and can be woken up only by out-of-band methods. The device should wake up before the sleep period it advertised in the low power SSDP extension headers expires and renew its UPnP state with a proxy or control points.
2.6.2 Low power state behavior
A low power device exhibits state behavior to UPnP network by advertising its low power states. Device vendors may implement internal behavior in various ways and decide how the low power states are actually implemented. Regardless of implementation specific variations, the implementations must follow responsiveness requirements given in this specification. The low power device state transitions is presented in Figure 1. Notice that in Figure 1 some of the transitions are caused by an internal action of the device and these transitions cannot be invoked by the control points or other external entities. The following state specific behavior is required:
- • Active: In the Active state the UPnP Low Power device is on the network and is visible to other UPnP devices in the network. The device in Active state responds to M-search requests. The device in Active state sends out regular SSDP: Alive messages.
- • Transparent: In the Transparent state the UPnP Low Power device is in online and visible to other UPnP Low Power devices. The device in Transparent state responds to M-search requests and can be woken up to the Active state by invoking the Wakeup() control action. The device in Transparent state sends out regular SSDP: Alive messages.
- • Deep Sleep Online: A device in Deep Sleep Online is on the network but will not respond to any UPnP control actions except for the Wakeup() control action because the UPnP stack in Deep Sleep Online is partially online. A device in Deep Sleep Online will not respond to an M-search request and will not send any SSDP: Alive messages. A device in this state can be woken up by invoking the Wakeup() control action.
- • Deep Sleep Offline: A device in Deep Sleep Offline will not be on the network and thus will not be visible to other devices on the network. A device in Deep Sleep Offline will not respond to an M-search request and will not send any SSDP: Alive messages. A device in this state can be woken up by out of band bearer dependent wake up mechanisms.
- • Disconnect: A device in Disconnect state is shutdown or is in the OFF state. A device in this state can be woken using vendor defined methods.
Figure below shows a transition diagram for the various sleep states and the triggers that cause state transitions.
Figure 1 — UPnP Low Power states
The transitions are explained in the following table. In the last column, internal triggers are the triggers generated by a sleeping device, such as a device's decision to switch to power save mode, to leave the network or to wake up after a timeout value. Conversely, external triggers are the triggers generated by Low Power Aware Control Points or Basic Power Management Proxies, such as a request for the device to enter a sleep mode or to wake up. In addition, the case of network failures is not included as a trigger because it is a generic problem for all the power states. In ActiveorTransparent sleep state, an unexpected disconnection can be detected by the absence of periodic advertisements. In deep sleep state, Control Points can infer that an unexpected disconnection occurred from an overdue sleep period timeout or when a control point fails to wake the Low Power device.
Table 12 — State machine Transition Description
| Transition Number | Transition Description | Examples of Triggers |
|---|---|---|
| 1 | Transition from ActivetoDisconnect: byebye messages are sent. | Internal |
| 2 | Transition from DisconnecttoActive: Alive messages are sent. | Internal |
| .3 | Transition from ActivetoDeep Sleep Online:byebye message and with PowerState equal to Deep Sleep Online (2) is sent. | Internal or external sleep request |
| 4 | Transition from Deep Sleep OnlinetoActive: Alive messages are sent. | Internal or external Unicast control wake-up message |
| 5 | Transition from ActivetoTransparent Sleep: Alive messages with PowerState equal to Transparent (1) sleep state are sent. | Internal or external sleep request |
| 6 | Transition from Transparent Sleep to Active: Alive messages are sent. | Internal, external Unicast control messages |
| 7 | Transition from ActivetoDeep Sleep Offline: byebye message and with PowerState equal to Deep Sleep Offline (4) is sent. | Internal or external sleep request |
| 8 | Transition from Deep Sleep OfflinetoActive: Alive messages are sent. | Internal or external, bearer specific wake up mechanism (e.g. WoL) |
| 9 | Transition from Transparent Sleep to Deep Sleep Online: byebye message and with PowerState equal to Deep Sleep Online (2) is sent. | Internal or external sleep request |
| 10 | Transition from Deep Sleep OnlinetoTransparent Sleep: Alive messages with PowerState equal to Transparent (1) sleep state are sent. | Internal |
| 11 | Transition from Transparent Sleep to Deep Sleep Offline: byebye message and with PowerState equal to Deep Sleep/ Offline (4) is sent. | Internal or external sleep request |
| 12 | Transition from Deep Sleep OfflinetoTransparent Sleep: Alive messages with PowerState equal to Transparent (1) sleep state are sent. | Internal or external bearer specific wake-up mechanism |
| 13 | Transition from Deep Sleep OnlinetoDeep Sleep Offline: byebye message and with PowerState equal to Deep Sleep Offline (4) is sent. | Internal |
| 14 | Transition from Deep Sleep OnlinetoDisconnect: byebye messages are sent. | Internal |
| 15 | Transition from Transparent Sleep to Disconnect: byebye messages are sent. | Internal |
| 16 | Transition from DisconnecttoTransparent Sleep: Alive messages with PowerState equal to Transparent (1) sleep state are sent. | Internal |
| 17 | Transition from Deep Sleep OfflinetoDisconnect: No messages can be sent by the sleeping device due to lack of IP connectivity. | Internal |