From: Roger B. <ro...@ro...> - 2003-09-22 08:21:26
|
The first phase of using protocol descriptions rather than handling stuff byte by byte now has the infrastructure in place. Do an update (with -d to pick up the new examples directory). Then run analyser examples/vx4400phonebookentry.txt and you will see it in action. This is the bigger picture: - All protocol should be described at a higher level. For an example see p_lgvx4400.p - Reading and writing data should be done by manipulating one of these. You can easily access members. For example with the one description in there: stuff.serial1=3 The class handles all marshalling and sanity checking of data. - When sending stuff to the data log, you also supply a class or an object that read the buffer. For example: entry=p_lgvx4400.readphoneentryresponse() entry.readfrombuffer(prototypes.buffer(rawbytes)) self.logdata("Read entry", res, entry) - The datalog inserts a special line with the class name For example: 9:34:58.312 LG-VX4400: Read entry Data - 529 bytes <#! p_lgvx4400.readphoneentryresponse !#> 00000000 ff 13 4c 00 ea 00 00 00 02 02 ea 00 00 00 25 00 ..L...........%. - In the protocol log pane, you can press Ctrl-Alt-P and it will bring up the protocol analyser on what you highlighted (or all of it if nothing was highlighted) - You can also save protocol information to a file and run the analyser stand alone. For the truly lazy (like me :-) it will look in the clipboard if you don't give it a filename. The point behind all this: - Make protocol decoding and encoding more formal, and easier to see and very easy to develop - Very easy to get data from users and run the analyser on it - Easy to play 'what-if' on the data These are the next steps: - Make com_lgvx4400.py use descriptions for all protocol - Strip file down into seperate ones. For example a generic "brew" file, and an "lg phonebook one". The individual phone classes will then multipily inherit from whatever components they use. - Replace the phonebook grid widget with a text widget. The raw phonebook dictionary will just be dumped in there and will be easy to edit. - Integrate in Alan and Scott's work - Start on new phonebook gui widget - Start on import and export - Start on synchronisation and merging Some little projects in case anyone wants one: - Move all gui code over to the wx namespace. This is needed because the exception handling code now prints out local variables and the import * approach leaves several thousand local variables - Add enhancements to the analyser. Add a menu bar. Allow the contents to be refreshed from the clipboard. Allow multiple entries to be saved out as a plain text file. - Add protocol samples to the examples directory. My preference is for longer sequences (eg initialising and grabbing all phonebook entries). Since this is in public CVS you will need to wipe your phonebook and only have dummy entries. (I use the backup/restore stuff for this :-) As protocol descriptions get added, the examples can be modified with the classnames. - Start writing protocol descriptions. Note that it may change slightly over the next few days as I discover issues. Roger |