Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a simple text based protocol to the project to display continuous measurement results #30

Open
5 of 7 tasks
KGergo88 opened this issue Apr 19, 2020 · 3 comments · Fixed by #36
Open
5 of 7 tasks
Assignees
Labels
enhancement New, or improved functionality in progress The issue is currently being worked on
Milestone

Comments

@KGergo88
Copy link
Owner

KGergo88 commented Apr 19, 2020

Requirements:

  • - The protocol shall be based on the MDP protocol.
  • - The name shall be CMDP - Continous Measurement Data Protocol
  • - It shall be message based instead a single transmission like the MDP
  • - It shall support transmissions that include only some of the DataLines but not all of them

TODO:

  • - Implement SW
  • - Add unit tests for the implemented code
  • - Update the readme with the documentation of the new protocol
@KGergo88 KGergo88 added enhancement New, or improved functionality in progress The issue is currently being worked on labels Apr 19, 2020
@KGergo88 KGergo88 self-assigned this Apr 19, 2020
@KGergo88 KGergo88 added this to the v2.2.0 milestone Apr 19, 2020
@KGergo88
Copy link
Owner Author

KGergo88 commented Apr 19, 2020

CMDP - Continous Measurement Data Protocol messages:

Header message:

<CMDP_H>
<DIAGRAM_TITLE>
X:"X_AXIS_TITLE",Y0:"Y0_AXIS_TITLE",...,Yn:"Yn_AXIS_TITLE",
>CMDP_H<

Data message:

<CMDP_D>
X:"X_AXIS_DATA0",Y0:"Y0_AXIS_DATA0",...,Yn:"Yn_AXIS_DATA0",
.
.
.
X:"X_AXIS_DATAn",Y0:"Y0_AXIS_DATAn",...,Yn:"Yn_AXIS_DATAn",
>CMDP_D<

Tail message:

<CMDP_T>

Reset message:

<CMDP_R>

@KGergo88
Copy link
Owner Author

KGergo88 commented Apr 19, 2020

CMDP - Continous Measurement Data Protocol documentation:

  • This protocol is used for data reception trough the serial port, the received data can later on be stored in the filesystem in the MDP format
  • It is simple and can be implemented on microcontrollers with limited resources as well
  • One data transmission is called a session, that contains data for one diagram
  • A session is built up by the following messages that must be sent in this order:
    • Header message
    • One or more data messages
    • Tail message
  • If there was an error detected in one of the messages then the whole session is invalid
  • The session is still valid if there is data received between the messages that is not part of the protocol in order to allow sharing the same channel between different protocols
  • The reset message can be used to signal that the session is invalid and the data received until that needs to be dropped

The messages need to be formatted following way in order to be processed by the program:

Header message
INCLUDE HEADER MESSAGE FORMAT HERE

The following requirements have to be fulfilled:

  • The " symbols are not part of the format they are only marking the beginning and the end of an element
  • The header message is always starting with the pattern "<CMDP_H>"
  • Then the optional diagram title is transmitted, which can be omitted if not needed, in which case a title will be generated for the diagram.
  • Then the headline is transmitted:
    • Every header message element is preceded with an identifier and a colon ("X:", "Y0:", ..., "Yn:") so that later the data message content can be assigned to them
    • Every header message element is followed by a comma "," and there are no whitespaces before between and after the elements
    • The headline describes how many different signals are being measured and their names
    • There has to be always at least two headline elements transmitted: the common X axis, which is the horizontal axis and at least one Y axis
    • The headline elements:
      • can only contain alphanumeric characters (0..9, A..Z, a..z)

Data message
INCLUDE DATA MESSAGE FORMAT HERE

  • Every data message element is preceded with an identifier and a colon ("X:", "Y0:", ..., "Yn:") so that they can be assigned to the header message elements
  • Every data message element is followed by a comma "," and there are no whitespaces before between and after the elements
  • The data message must always contain at least two elements: the "X" and one of the "Yn" values
  • The data messages do not have to be sent in order and they do not have to contain all the values for every message
  • All the measured signal values in the data message belong to the first data message element, the common X axis value
  • The data line elements:
    • are integer values
    • can have an optional "+" or "-" sign as a prefix, for example "+25" or "-568"
    • without a sign prefix are considered positive

Tail message
INCLUDE TAIL MESSAGE FORMAT HERE

  • The session always ends with the tail message
  • After the tail message is sent there can be no more data messages sent to the diagram

Reset message
INCLUDE TAIL MESSAGE FORMAT HERE

  • The session can be stopped with the reset message
  • The data of the session will be dropped and not used for creating a diagram

INCLUDE THE SESSION EXAMPLES HERE

@KGergo88
Copy link
Owner Author

KGergo88 commented Apr 19, 2020

CMDP - Continous Measurement Data Protocol session examples:

Examples for a session without diagram title and one measured signals:

<CMDP_H>
X:Time [s],Y0:Temperature [C],
>CMDP_H<

<CMDP_D>
X:0,Y0:10,
>CMDP_D<

<CMDP_D>
X:10,Y0:12,
X:15,Y0:13,
>CMDP_D<

<CMDP_D>
X:5,Y0:11,
X:20,Y0:14,
>CMDP_D<

<CMDP_T>

Examples for a session with diagram title and two measured signal:
INCLUDE SESSION EXAMPLE HERE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New, or improved functionality in progress The issue is currently being worked on
Projects
None yet
1 participant