1

I'm integrating with a bluetooth blood pressure monitor, and I've come across one of the most bizarre data formats I've ever seen.

The systolic, diastolic and pulse rate (all ints, should all be below 200) are transmitted like this:

  1. the int value is converted to hex
  2. the last two characters of the hex value are taken and transmitted in adjacent bytes

For example, a pulse rate of 80 is transformed to 0x50, the character '5' is transmitted in byte 1, and '0' is transmitted in byte 2.

What could be the reason for this format? Is there a name for it?

I realise this could elicit mostly opinion based answers, but I'm hoping this is a well known method in some circles, with a name that I can use for further research.

  • 1
    My guess is that the the original developer wanted to transmit only ASCII for some reason and also wanted to limit it to a fixed number of bytes. (Since what you describe will always be two bytes per number.) But that's just a guess. – Steven Burnap Jun 25 '15 at 13:31
  • @StevenBurnap Almost everything else in the packet is transmitted as ints. E.g. the year, month, and day of the measurement are transmitted as ints contained within single bytes. – Ian Newson Jun 25 '15 at 13:36
  • 1
    There's no name for it; it's just a custom format, and since it will probably never be used anywhere else, they can make it whatever they want. – Robert Harvey Jun 25 '15 at 14:35
  • Call it "WTF" if you like. – Doc Brown Jun 25 '15 at 14:35
  • 1
    It is possible the data format was originally developed for a serial port. A reason to use characters instead of binary is to avoid the the control characters that have special meanings to serial drivers such as control-s and control-q. A reason to use hex is for 2 byte values instead of 3 byte values, which you would need for base 10. – Erik Eidt Jun 25 '15 at 14:46
6

It is possible the data format was originally developed for a serial port. A reason to use characters instead of binary is to avoid the the control characters that have special meanings to serial drivers such as control-s and control-q, EOF, etc... A reason to use hex is for 2 byte values instead of 3 byte values, which you would need for base 10.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.