Thursday, September 24, 2009

PAC Quick Update

A little bit sleepless (particularly bad due to my weekend trip to Conneticut from New Jersey tomorrow), so a quick PAC update to try and tire myself out.


I finally got around to doing more work on PAC, mostly through the downtime from helping out others at a Python study group at a local hackerspace (of which I'll go more into detail in a later post). My original whiteboard drawing has been kind enough to act as a guiding force, albeit not the actual outline for the full implementation.



The message order will now follow this series:

  1. Alert the MCU and confirm that it is there over a send/receive handshake.
  2. Send an identifier byte.
  3. Notify the MCU of the amount of incoming data.
  4. Send aforementioned data.
  5. This is where it differs from the whiteboard photo, and my original intent: Wait for a confirmation byte / second handshake from the MCU that data has been received.
  6. Receive a byte telling the PC how much data is being returned.
  7. Receive said data.
  8. Send confirmation byte.
  9. Process the data appropriately. Return it.
 In this format, the amount being received is now variable. I am putting it on the end user to know how much data is coming back, and, if it is indeed variable, to make sure their code can figure out what to expect and parse appropiately.

Functions for each message object is being broken down more then I expected, but this is not problematic.

A user will create the Message object for their particular object. Each message object has a very basic process( ) function, which will do nothing more than return what it receives by default. A user-created extension of the Message class shall have a more complicated, fine-tuned process( ) function for their application.

More information shall come as I work on it...

No comments:

Post a Comment