Skip to content

Instantly share code, notes, and snippets.

@elisaado
Last active February 1, 2021 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elisaado/5c58486713f355d786415a1499f171ce to your computer and use it in GitHub Desktop.
Save elisaado/5c58486713f355d786415a1499f171ce to your computer and use it in GitHub Desktop.
pcr_bluetooth_serial_protocol v2 (add message newline delimiter)

PCR Bluetooth serial protocol

All messages are utf-8 encoded.

Message

A message consists of several fields

Each field is delimitered by a space ( ), and each message is delimitered by a CRLF character (\r\n).

1st field

This indicates the type of the message. Currently there are:

  • status
  • command

Depending on this field, there are other fields.

Status

A status message will have a total of 4 fields.

The 1st field has already been discussed. The other fields are:

2nd field

Type of status. Currently there are:

  • temperature
  • power
  • cycle

3rd and 4th field

power and cycle both have just 1 more field: the actual state.

The state of power is either on or off and indicates whether or not the machine is running a program. (e.g. status power on)

The state of cycle is a number, indicating the current cycle. (Every cycle starts at denaturation.) (e.g. status cycle 2)

temperature has two more, the sensor where the temperature has been measured, and then the temperature in celsius as a double. (e.g. status temperature thermistor_rear 82)

Command

2nd field

The command sent. Currently there are:

  • request returns all statuses
  • start starts a thermocycle program.

3rd and 4th field

request doesn't have any other fields. (e.g. command request)

start has the number of cycles as its 3rd field. (e.g. command start 30)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment