Changes between Version 14 and Version 15 of ZigbeeGateway
- Timestamp:
- Oct 13, 2010, 3:17:39 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ZigbeeGateway
v14 v15 12 12 1. Through a Zigbee USB dongle attached to the PC. In this case the PC needs to be in the rario coverage of the Zigbee island. 13 13 2. Through IP connection to an external concentrator. This concentrator is an element that simple translates the Zigbee binary message into IP and transports it using a TCP/IP socket. 14 [[Image(zb2senseigw_connection.JPG, 50%, center)]]14 [[Image(zb2senseigw_connection.JPG, 40%, center)]] 15 15 16 16 … … 155 155 156 156 The Gateway has the following features regarding **Resource End Point (REP) implementation**: 157 * Allows **publication** of individual resources (sensors and actuators) into a Resource Directory .157 * Allows **publication** of individual resources (sensors and actuators) into a Resource Directory, using the [wiki:RpResDescription Resource Description Format]. 158 158 * Allows **getting** data from resources and **acting** over them using **RESTful** access. 159 159 * Allows **subscription** to resources. Notification can be requested upon one or several of the following conditions: … … 167 167 168 168 === RAI interface === 169 This Gateway creates a REST interface for allowing applications to iterate with the Zigbee island resources. This interface is defined in [ [#RpObservationMeasurement]] (**Check proper LINK to the xml specification TODELETE**).169 This Gateway creates a REST interface for allowing applications to iterate with the Zigbee island resources. This interface is defined in [wiki:RpObservationMeasurement Observation & Measurement]. 170 170 Each resource has its one URL, with the following format: "//**BASE_URL/nodeMAC/X/number**//" 171 171 * //nodeMAC// is the node MAC address in hexadecimal capital letters (16 characters). … … 174 174 175 175 Over this resource URL the following operations can be done: 176 * GET http method is used for getting a "xml" with the sensor or actuator value. An xml with the format defined in [[#RpObservationMeasurement]] is obtained.176 * GET http method is used for getting an "xml" with the sensor or actuator value. An xml with the format explained in [wiki:RpObservationMeasurement Observation & Measurement] is obtained. 177 177 * PUT http method is used for changing a parameter, or acting over an actuator. 178 178 179 179 === Subscriptions === 180 180 A POST http method over the resource URL is used for adding a new subscription. For that, the URL must contain after the resource URL the subscription identity: 181 "//**BASE_URL/nodeMAC/X/number/SubscriptionID**//". //"SubscriptionID"// is whatever text allowed in the URL names. The xml format for a subscription request is (**PUT A LINK TO XML SUBSCRIPTION FORMAT IF ANY**). 181 "//**BASE_URL/nodeMAC/X/number/SubscriptionID**//". //"SubscriptionID"// is whatever text allowed in the URL names. 182 To test the Subscription Module you have to issue a post request to a resource url 183 (i.e. http://localhost:8081/2098765432142017/sensei/resources/rai/s/0/sub_id ) with the following xml text: 184 {{{ 185 <?xml version="1.0" encoding="UTF-8"?> 186 <Subscription> 187 <URL> where you want to receive notifications</URL> 188 <Period> maximum time between notifications in ms</Period> 189 <Threshold> 190 <Operation> 0: equal to, 1: greater than, or 2: less than</Operation> 191 <Value> Send a notification when this threshold has been passed</Value> 192 </Threshold> 193 <OnlyOnChange>If present, send notification only if the value has changed </OnlyOnChange> 194 </Subscription> 195 }}} 182 196 * A PUT http method over this subscription URL is used for modifying it. 183 197 * A GET http method over this subscription URL returns the subscription xml information. … … 185 199 * A POST http method over this subscription URL returns an error if it exist or add a new subscription if it does not exist. 186 200 187 GET over "//BASE_URL/nodeMAC/X/number**?Subscription**//" can be used for getting the list of subscriptions of a resource. 188 189 GET over "//**BASE_URL/nodeMAC **//" returns an html page with node information, sensors and actuators, and links for the subscriptions. 201 * GET over "//BASE_URL/nodeMAC/X/number**?Subscription**//" can be used for getting the list of subscriptions of a resource. 202 * GET over "//**BASE_URL/nodeMAC **//" returns an html page with node information, sensors and actuators, and links for the subscriptions. 190 203 191 204 … … 213 226 This section details the message (7.) of figure. The new gateway informs about node mobility to the old gateway with a PUT http method addressing the node id (not resource id) with the following xml content: 214 227 {{{ 228 <?xml version="1.0" encoding="UTF-8"?> 215 229 <Mobility> 216 <newREP-Locator> new URL</newREP-Locator>230 <newREP-Locator> new URL of the resource </newREP-Locator> 217 231 <Credentials> 218 < 232 <ZB2SENSEI_PASSWD> password </ZB2SENSEI_PASSWD> 219 233 </Credentials> 220 234 </Mobility> … … 223 237 In the response, if the credentials are accepted, the old gateway informs about all the subscriptions that the resources of the node contains, with the following xml format: 224 238 {{{ 239 <?xml version="1.0" encoding="UTF-8"?> 225 240 <SubscriptionNodeInfo> 226 241 <SubscriptionInfo sensor="0"> 227 <Subscription> 228 … Subscription info 229 <Subscription> 230 <Subscription> 231 … Subscription info 232 <Subscription> 242 <Subscription> content described in Subscriptions section </Subscription> 243 <Subscription> content described in Subscriptions section </Subscription> 244 … 233 245 </SubscriptionInfo> 234 246 <SubscriptionInfo sensor="1"> 235 … 247 <Subscription> content described in Subscriptions section </Subscription> 248 … 236 249 </SubscriptionInfo> 250 … 237 251 <SubscriptionInfo actuator="0"> 238 <Subscription>239 … Subscription info240 <Subscription>241 252 … 242 253 </SubscriptionInfo> 254 … 243 255 </SubscriptionNodeInfo> 244 256 }}} 245 257 246 247 248 249 250 251 252 253 254 255