xbee: always dump rx frame when debug is on
[protos/xbee-avr.git] / notes.txt
index 260ad08..4096dfa 100644 (file)
--- a/notes.txt
+++ b/notes.txt
@@ -105,10 +105,13 @@ interrupt, software interrupts and background tasks
 problem description
 -------------------
 
-Today, Both command line code, xbee char reception and callout events
+Today, both command line code, xbee char reception and callout events
 are handled in the main loop, with the lowest priority. Therefore, the
 command line cannot block, else the timers + xbee rx won't be executed.
 
+A typical example where the command line blocks is the completion with
+many choices.
+
 solution
 --------
 
@@ -136,7 +139,6 @@ From highest to lowest priority.
 - Events, called from timer interrupt after a call to sei():
 
   - LED_PRIO: led blink
-  - TIME_PRIO: monitor time
   - BEEP_PRIO: process beep requests and modifies the beep_mask
   - SPI_PRIO: send and receive SPI data to the atmega168p
   - CS_PRIO: do the control system of the wing, reading infos from a
@@ -176,3 +178,112 @@ xbee_buf.[ch]: not used
 xbee_neighbor.[ch]: helper to add/delete neighbors, use malloc()/free()
 xbee_rxtx.[ch]: parse rx frames, provides xbee_proto_xmit()
 xbee_stats.[ch]: helper to maintain stats
+
+App
+---
+
+move this in library ?
+
+xbeeapp_send(addr, data, len, timeout, cb, arg)
+XXX to detail
+
+Timeout for xbee commands
+=========================
+
+- send_atcmd or send_msg (xbee_prio)
+
+  - allocate a channel and a context
+  - fill the context with info
+  - send the message
+  - load a timeout (xbee_prio)
+
+- on timeout (xbee_prio)
+
+  - log error
+  - call the cb with retcode == TIMEOUT
+  - unregister channel
+  - remove timer
+  - this could be a critical error
+    - if it's a comm error, it's ok
+    - but if the channel is registered again and 1st callback finally occurs...
+
+- on rx (xbee_prio)
+
+  - if there is a context, it's related to a query:
+    - remove the timeout
+    - unregister channel
+  - do basic checks on the frame
+  - log (hexdump)
+  - the frame must be checked in the cb, we can provide helpers
+
+Tests to do
+===========
+
+::
+
+  Radio Controller      )))     xbee      ((( WING
+     /
+    /
+   PC with command line
+   (through serial)
+
+Test 1: send data, unidirectional
+---------------------------------
+
+Periodically send data from RC to WING (every 20 to 100 ms). The WING sends its
+statistics every second.
+
+Variables:
+
+- period: from 20ms to 200ms
+- packet size: from 1 byte to 20 bytes
+- total number of packets: 1K for short tests, 100K for robustness
+
+If the test is long, take care about maximum duty cycles (10%).
+
+Output:
+
+- local and peer statistics for each test (packet size, pps, number of packets)
+- at the end we will know what is the highest speed we can support for a given
+  packet size, and how reliable is the xbee
+
+Test 2: send data, bidirectional
+--------------------------------
+
+Same than above, except that the WING replies to each received packet with a
+packet of same size.
+
+Same kind of output.
+
+Test 3: test wing control on ground
+-----------------------------------
+
+On the ground, try to control the wing with the RC board. We also use the 2.4
+Ghz controller as a fallback (bypass mode).
+
+Check that the bypass mode is enabled when we ask it (for instance on the
+channnel 5 switch) or when we switch off the RC board.
+
+Test 4: embed in WING and send dummy servo commands
+---------------------------------------------------
+
+Test in real conditions: the WING board is embeded during a flight. The RC board
+sends dummy servo values at a specified rate (choosen from results of test 1 and
+2). The WING sends statistics and "power probes" allowing the RC board to choose
+its tx power level.
+
+Check how the wing distance impacts:
+- the tx power level of the RC board
+- the statistics
+- the RX DB
+
+Maybe check with and without the 433Mhz beacon.
+
+Output:
+
+After this test, we should be confident that xbee is useable in real conditions.
+
+Test 5: control the wing with the RC board
+------------------------------------------
+
+Same than test 3, but in real flight conditions.