Control program sends to the swipe-card reader

In the case where the Control Program (Control) is sending data to the Swipe-Card Reader (Swipe), we have the following steps:

  1. Control sends to Swipe.
  2. Swipe replies with "OK, event primed."
  3. A big delay occurs until the next person swipes their card.
  4. Swipe uses a pulse to say "I have data available."
  5. Control sends a message, "What is your data?"
  6. Swipe replies with "Swipe card ID # xxxx was swiped."
  7. Control sends message, "Change LED to GREEN."
  8. Swipe replies with "OK."
  9. A 20-second delay occurs, while the door is opened.
  10. Control sends message, "Change LED to RED."
  11. Swipe replies with "OK."

In this case, there was one pulse, and three messages. Granted, you would prime the event just once, so the first message can be eliminated.