|
| 1 | +/* |
| 2 | + * |
| 3 | + * Copyright (c) 2020 Google LLC. |
| 4 | + * All rights reserved. |
| 5 | + * |
| 6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | + * you may not use this file except in compliance with the License. |
| 8 | + * You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, software |
| 13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + * See the License for the specific language governing permissions and |
| 16 | + * limitations under the License. |
| 17 | + */ |
| 18 | + |
| 19 | +/** |
| 20 | + * @file |
| 21 | + * Schema definition for the Weave Device Description profile. |
| 22 | + */ |
| 23 | + |
| 24 | +namespace weave.profiles { |
| 25 | + |
| 26 | +/** Weave Device Description Profile |
| 27 | + */ |
| 28 | +device-description => PROFILE [id common:0x000E] |
| 29 | +{ |
| 30 | + // ---- Message Types ---- |
| 31 | + |
| 32 | + identify-request => MESSAGE [id 1] |
| 33 | + identify-response => MESSAGE [id 2] CONTAINING device-descriptor |
| 34 | + |
| 35 | + |
| 36 | + // ---- Data Types ---- |
| 37 | + |
| 38 | + /** Structure containing information describing a Weave device. |
| 39 | + */ |
| 40 | + device-descriptor [*:1] => STRUCTURE [extensible, tag-order] |
| 41 | + { |
| 42 | + includes product-fields, |
| 43 | + includes feature-fields, |
| 44 | + |
| 45 | + |
| 46 | + manufacturing-date [3,opt] : encoded-date, /**< Calendar date of manufacture in encoded form. */ |
| 47 | + |
| 48 | + serial-number [4] : STRING [len 1..32], /**< Device serial number. */ |
| 49 | + |
| 50 | + primary-15-4-mac-address [5,opt] : BYTE STRING [len 8],/**< MAC address for device's primary 802.15.4 interface. */ |
| 51 | + |
| 52 | + primary-wifi-mac-address [6,opt] : BYTE STRING [len 6],/**< MAC address for device's primary WiFi interface. */ |
| 53 | + |
| 54 | + wifi-essid [7,opt] : STRING [len 1..32], /**< ESSID for device's WiFi rendezvous network. |
| 55 | + * @note: This field is mutually exclusive with the |
| 56 | + * wifi-essid-suffix field. */ |
| 57 | + |
| 58 | + pairing-code [8,opt] : STRING [len 1..16], /**< The pairing code for the device. |
| 59 | + * @note @b IMPORTANT: For security reasons, the PairingCode |
| 60 | + * field should *never* be sent over the network. It is |
| 61 | + * present in a device-descriptor structure so that is can |
| 62 | + * encoded in a data label (e.g. QR-code) that is physically |
| 63 | + * associated with the device. |
| 64 | + */ |
| 65 | + |
| 66 | + software-version [9,opt] : STRING [len 1..32], /**< Version of software on the device. */ |
| 67 | + |
| 68 | + |
| 69 | + device-id [10,opt] : UNSIGNED INTEGER [range 64bits], |
| 70 | + /**< Weave device ID. */ |
| 71 | + |
| 72 | + fabric-id [11,opt] : UNSIGNED INTEGER [range 64bits], |
| 73 | + /**< ID of Weave fabric to which the device belongs. */ |
| 74 | + |
| 75 | + |
| 76 | + pairing-compat-major-ver [12,opt] : UNSIGNED INTEGER [range 1..0xFFFF], |
| 77 | + /**< Pairing software compatibility major version. */ |
| 78 | + |
| 79 | + pairing-compat-minor-ver [13,opt] : UNSIGNED INTEGER [range 1..0xFFFF], |
| 80 | + /**< Pairing software compatibility minor version. */ |
| 81 | + |
| 82 | + wifi-essid-suffix [14,opt] : STRING [len 1..32], /**< ESSID suffix for device's WiFi rendezvous network. |
| 83 | + * @note: This field is mutually exclusive with the |
| 84 | + * wifi-essid field. |
| 85 | + */ |
| 86 | + } |
| 87 | + |
| 88 | + /** Common fields containing product information for a device. |
| 89 | + */ |
| 90 | + product-fields => FIELD GROUP |
| 91 | + { |
| 92 | + vendor-id [0] : UNSIGNED INTEGER [range 1..0xFFFE], |
| 93 | + /**< Code identifying the product vendor. */ |
| 94 | + |
| 95 | + product-id [1] : UNSIGNED INTEGER [range 1..0xFFFE], |
| 96 | + /**< Code identifying the product. */ |
| 97 | + |
| 98 | + product-revision [2,opt] : UNSIGNED INTEGER [range 1..0xFFFF], |
| 99 | + /**< Code identifying the product revision. */ |
| 100 | + } |
| 101 | + |
| 102 | + /** Fields describing features supported by the device. |
| 103 | + */ |
| 104 | + feature-fields => FIELD GROUP |
| 105 | + { |
| 106 | + |
| 107 | + home-alarm-link-capable [100,opt] : BOOLEAN, /**< Indicates a Nest Protect that supports connection to a home alarm panel. */ |
| 108 | + |
| 109 | + line-powered [101,opt] : BOOLEAN /**< Indicates a device that requires line power. */ |
| 110 | + } |
| 111 | + |
| 112 | + /** A calendar date, encoded as an integer. |
| 113 | + * |
| 114 | + * Date values are encoded according to the following formula: |
| 115 | + * |
| 116 | + * encoded-date = (year - 2000) + |
| 117 | + * ((month - 1) * 100) + |
| 118 | + * (day * 12 * 100) |
| 119 | + * |
| 120 | + * Date values are limited to the years 2001 through 2099. |
| 121 | + * |
| 122 | + * Month values must be between 1 and 12. |
| 123 | + * |
| 124 | + * If provided, day values must be between 1 and 31. Alternatively, a day value |
| 125 | + * of 0 can be used to encode a date without a day-of-month (e.g. 2020/05). |
| 126 | + */ |
| 127 | + encoded-date => UNSIGNED INTEGER [range 16bits] |
| 128 | +} |
| 129 | + |
| 130 | +} // namespace weave.profiles |
0 commit comments