From 6017e6a00ca9aaed2f0391ed5d863638a37c28bf Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Mon, 19 Nov 2018 21:03:04 +0100 Subject: [PATCH] Add Beurer protocol specification --- doc/protocols/beurer.md | 170 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 doc/protocols/beurer.md diff --git a/doc/protocols/beurer.md b/doc/protocols/beurer.md new file mode 100644 index 00000000..e77c6596 --- /dev/null +++ b/doc/protocols/beurer.md @@ -0,0 +1,170 @@ +Beurer +====== + +General +------- + +* ``: start byte (e7 or f7) +* ``: alternative start byte (eY or fY) +* ``: user ID (8 bytes, BE) +* ``: 3 characters (bytes) +* ``: unix timestamp (4 bytes) +* ``: 2 bytes, BE (unit g / 50) +* ``: 2 bytes, BE + +All protocol bytes are in hex. Writes are done to characteristic +0xffe1 on the service 0xffe0. This is also where notifications are +received from. + + +Initialization +-------------- + +1. Enable notifications. +2. Write: ` 01` +3. Notification: ` 00 20` +4. Write: ` ` +5. Write: ` 4f <8 bytes 00>` +6. Notification: ` f0 4f ` + +* ``: battery level +* ``: weight threshold (unit g / 100) +* ``: fat threshold +* ``: 1 = kg, 2 = lb, 3 = st +* `, , `: user (reference weight, measurement) exists +* ``: scale version + + +### Configure threshold + +1. Write: ` 4e ` +2. Notification: ` f0 4e 00` + + +### Set unit + +1. Write: ` 4d ` +2. Notification: ` f0 4d 00` + + +### Force disconnect + +1. Write: ` 2` + + +Users +----- + +### Request user list + +1. Write: ` 33` +2. Notification: ` f0 33 00 ` +3. Notification: ` 34 ` +4. Write: ` f1 34 ` +5. Goto 3 if ` != ` + + +### Get user info + +1. Write: ` 36 ` +2. Notification: ` f0 36 00 ` + +* ``: January == 0 +* ``: sex (female = 0x00, male = 0x80) | activity level 1 - 5 + + +### Add new user + +1. Write: ` 31 ` +2. Notification: ` f0 31 00` +3. Perform initial measurement. + +Status in notification: 00 (ok), 01 (full), 02 (uid taken), 03 (name used) + +### Update user + +1. Write: ` 35 ... (same as when adding user)` +2. Notification: ` f0 35 00` + + +### Delete user + +1. Write: ` 32 ` +2. Notification: ` f0 32 00` + + +Measurements +------------ + +### Perform measurement + +1. Write: ` 40 ` +2. Notification: ` f0 40 00` +3. Notification: ` 58 ` +4. Write: ` f1 58 ` +5. Goto 3 if ` != 0` +6. Notification: ` 59 01 ` +7. Write: ` f1 59 ` +8. Notification: ` 59 <11 bytes data>` +9. Write: ` f1 59 ` +10. Goto 8 if ` != ` + +* Step 1 selects the user with the given ID. +* ``: 0 for stable measurement, 1 otherwise +* All `` from step 8 is joined and parsed as a measurement. + + +### Request saved measurements + +1. Write: ` 41 ` +2. Notification: ` f0 41 00` +3. Notification: ` 42 <11 bytes data>` +4. Write: ` f1 42 ` +5. Goto 3 if ` != ` + +* All `` from step 3 is joined and parsed as a measurement. + + +### Delete saved measurements + +1. Write: ` 43 ` +2. Notification: ` f0 43 00` + + +### Measurement + +22 bytes of data: + +` + ` + + +Unknown measurements +-------------------- + +### Request unknown measurements + +1. Write: ` 46` +2. Notification: ` f0 46 00` +3. Notification: ` 47 ` +4. Write: ` f1 47 ` +5. Goto 3 if ` != ` + +* ``: index in memory (stays constant after removal) + + +### Assign unknown measurement + +1. Write: ` 4b ` +2. Notification: ` f0 4b 00` +3. Notification: ` 4c <11 bytes data>` +4. Write: ` f1 4c ` +5. Goto 3 if ` != ` + +* All `` from step 3 is joined and parsed as a measurement. + + +### Delete unknown measurement + +1. Write: ` 49 ` +2. Notification: ` f0 49 00`