cooja
cooja copied to clipboard
Provide handy cooja:mote:serialUI (with perks)
This patch split cooja:mote:DebugLog from cooja:mote:serialUI, allowing split DbgIO output from Serial io. Therefore we have pure serial connection to host, with no debug prints. And introduce new SerialUI visualiser, with hex,dump views, and receive/send display.
- This patch relays to contiki-ng add-cooja-dbglog patch look contiki-ng PR#1218. That one separate
rs232_interface from simlog_interface, so that-> simlog_interface, and slip, rs232_print/putc -> rs232_interface. To provide tests pass, this branch migrate cooja to that related branch.
- this patch establisg new interface DebugLog, that listens rs232_interface only. And ContikiRS232 now connects only with rs232_interface. Therefore log printing now separated from serial io.
- Log can listen serial for received lines. This is turn on by default, and controls UI.
-
Mote:Interfaces:getSerial - establish SerialPort interface separated from Log.
-
ApplicationLogPort - establish separate LogUI for debugLog interface.
-
SerialUI now shows received and sent data over serial. Also this data can be view as text, hex bytes, and dump16.
-
SerialUI:bufReceived - provide block response on received from mote data. this use for immediate display received data, not waiting for \n char - suppose that serial is binary, so \n is no relyable marker of sequence end. Assume that prints happen over significant pieces, that can be shown imediate.
- SerialSocketServer now pass received frame to SerialUI by whole block, that is shown as one piece.
cleanup occasional code, that was left due build cache. Checked that ant build cooja from cleanup.
Fix receive data misses. And cleanup debug messages from serial. Now looks pretty.
Now checked an fixed transfer data from srial to tun6 host via socket connect. Simulation looks now correct
Since DebugLog interface now not used as SerialPort, cleanup it from SerialNotification on every byte. Now Log call handles only for message line.
There was wrong design of new MessageListUI render for wraped text. That leads to huge memory leaks, and grand slowdow cpu after messages log comes a few thousands messages. Render now fixed, and
MessageUI now more clever - it can style messages with border, it now can use not only MessageContainer with text, but also MessageRanged - with overriden text render.
Also some rework of debug strings collect in DebugLog interface - hope it now faster.
I change behaviour of RSR232 interface sends data to mote - there infers \n char at end of received bufer. This may crush data transfer on binary trafics. Now cooja SerialUI inserts \n after comands byself. And no need to infer lineends. also fixes DebugLog - was missed last char in debul message
MesageContainer changes was not good, so i revert old MessageContainer behaviour, for compatibily with old code. Here StringMessage introduced by MessageListUI, to pass strings. looks like nowhere it is used, so new code is comatible high.
Provide compatibily for legacy projects - thay now load ContikiLog interface if have ContikiRS232.
Old projects test may rely for serial receives data showed in mote log. Therefore provided mote log listening for incoming messages from serial. this turn on by default, and can be controled by UI.
with last changes sucessful loads Z1 motes project, and seen it's log in MoteOutput, in serial and DefaultLog of mote.
import here PR #44, to provide tests pass on contiki-ng/contiki-ng#1218