Showing posts with label Bluetooth. Show all posts
Showing posts with label Bluetooth. Show all posts

Wednesday, August 29, 2012

Designing a Robust Communication Protocol

In today's world of designing distributed embedded systems, it is imperative to design, document and test the communication protocol early on.

I recommend building upon the layers of protocol provided by the underlying architecture you have chosen, for example, TCP/IP, Bluetooth, USB, etc. If the underlying communication layer provides data integrity and delivery then it should not be duplicated in the application portion of the communication protocol. At a minimum, you are looking to have a low-level handshake between subsystems with assured delivery. Consider the following questions:

  • Does the packet need to be routed?

  • Does the sender need to know that the recipient received the communication packet?

  • Is the data intact?


Now you can move to the business logic portion of the packet--the data payload definition--and begin to address these questions:

  • Is there a command/response requirement?

  • What is the general packet definition?

  • Are there different types of packets?

  • Is the packet size variable- or fixed-length?

  • What are the physical units of the data transmitted?

  • Was the packet understood by the receiving subsystem?


In addition to these questions, it's imperative that you list all of the possible error conditions. Ask yourself how you will be able to make them happen so you can test for robustness, which sometimes requires writing test applications to intentionally insert error conditions. Sometimes an external communication test device is the best choice.

There are many factors to consider, and this brief writeup is simply a starting point. What issues do you think are most important in building a robust communication mechanism?

-Gary

Tuesday, June 12, 2012

Embrace Change

I’m amazed how many developers and companies are reluctant to adopt modern technologies in their projects, especially when it could cut significant costs from the development process.

I even recently met a team who is still designing serial communication ports for their external interface. Ouch.

Thus, I'll focus my next few emails on development technology areas that have significantly benefited from recent innovations:
• Display technologies: highly integrated graphic chips and capacitive screens
• Wireless communications: near field communication, Bluetooth, WiFi
• Location-based systems: low-cost integrated GPS chips

-Gary