Changes

Jump to: navigation, search

XMPPHWFS

1,026 bytes added, 01:16, 12 January 2012
/* Sample session */ sending commands does not require XML... updated after playing with jabberbot-python
=== Sample session ===
;To HAL:Here, it should be a good thing This is to have flags such as ''update_all_values''get the simple, ''used_cached_values''human-readable output<pre>help</pre>;From HAL:
<pre>
<describe />rfid_reader: last RFID tag readdoor_lock: status of door locklock_delay: how long should the door stay opentemperature: tell me how cold it is outside
</pre>
 ;To HAL:Here, it should be a good thing to have flags such as ''force_update'' if bot supports it.<pre>describe</pre>;From HAL:I suppose it would be nice to include output from the ''help'' command above. XML validity needs to be checked anyway. Too many line breaks are added on purpose for readability on the wiki.
<pre>
<hal name='HalName' target='event_main' backup_target='event_backup'>
<device
name='rfid_reader'
attrs='ro' type='rfid'
last_update_timestamp=1326310608
value='00EFC0B554' />
name='door_lock'
attrs='rw'
type='enum' value='closed'>
<value>open</value>
<valueselected="selected">closed</value>
<value>locked</value>
<value>unlocked</value>
</hal>
</pre>
 
;To HAL:
<pre><set device='door_lock' value='open' />temperature</pre>
;From HAL:
<pre><hal name='HalName'> <devices> <device name='door_locktemperature' value='open' 23.5 /> </devicespre></hal></pre>
;To HAL:
<pre><get device='temperature' />door_lock unlocked</pre>
;From HAL:
<pre><hal device name='HalNamedoor_lock'value='unlocked' /></pre> ;To HAL:<devicespre>door_lock foobar</pre>;From HAL: format needs to be thought a little better here.. <pre><device name='temperaturedoor_lock' value=23.5 'open' /> error: new value out of range</devicesdevice></halpreDiscussion must be done around where the values should go in the XML, and if the whole device XML string should be sent back when requesting a single value. I say it should, as it simplifies the code (and let's not care too much about the overhead) === Events ===When an event is detected by a HAL (threshold exceeded for example), the HAL sends the info to ''event-master'' who will then decide what to do. In this case, the syntax does not much, so we get something like:<pre><device name='temperature' value=11.8>warn_low_value</device></pre>
== Hardware ==
77
edits