vendredi 5 juillet 2019

Design-pattern for building reading/writing packages

Let me introduce some initial points: I work with program that is connecting via uart (to the special board) and sending data packages to set/get information about devices in the special board' network. Package format looks like:

|Start byte | Device ID | R/W | Parameter| Data | CRC|

So I have several devices and want to generate data packages in the most efficient way. My question: is there any appropriate design pattern to generate packages above? Of course it could be hardcoded, but I try to found more flexible way.

Aucun commentaire:

Enregistrer un commentaire