shellmatta_ymodem.dox 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. @page shellmatta_ymodem Shellmatta ymodem
  3. To be able to pass binary files to the shellmatta there is a ymodem module
  4. implemented.
  5. The ymodem reception can be started from a shellmatta command and handles
  6. the handshaking as well as the data transmission.
  7. As the shellmatta does not use dynamic memory every packet is passed
  8. directly to the application using a callback.
  9. Only the currently received packet is stored in the shellmatta internally.
  10. In order to transmit the start NCKs to the sender you need to poll the
  11. shellmatta_processData() function cyclically even if no new data has been
  12. received.
  13. Do this in 0.1s - 1s periods (depending on the latency you are after).
  14. The shellmatta_ymodem_start() function will return and the command it was
  15. called from will not be executed again. The rest of the ymodem processing
  16. will be handled by the shellmatta. The data will be passed using the
  17. callbacks registered during the start.
  18. To cancel the ymodem (e.g. timeout) just call shellmatta_ymodem_cancel()
  19. @section shellmatta_ymodem_sequence Basic sequence
  20. @startuml
  21. Application -> Shellmatta: shellmatta_ymodem_start()
  22. Shellmatta -> Host: send NCK to start transmission
  23. Shellmatta -> Application: return
  24. loop until ymodem transmission starts (or is canceled)
  25. Application -> Shellmatta: shellmatta_processData(null)
  26. Shellmatta -> Host: send NCK to start transmission
  27. end
  28. loop until shellmatta transmission is complete
  29. Host -> Shellmatta: Data transmission
  30. Shellmatta -> Application: packetRcv() callback
  31. end
  32. Shellmatta -> Application: transmissionComplete() callback
  33. @enduml
  34. While the ymodem is active no command can be executed.
  35. When the ymodem is canceled from the Host the data received afterwards will
  36. be processed as usual.
  37. */