-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
Description
BT Name: XHTKJ
Service UUID: 0xFF10
Characteristic UUID: 0xFF12
Message: 0312f300fc00fe4001XXXX00fc00fe4001YYYY00
XXXXandYYYYis hex representation of strength-based UInt16- For my toy they are both the same
- Strength is value between 0 and 1 and it's handled in scale
- UInt16 is
(handleScale(strength) * 1023) << 6 | 60 - UInt16 must be written in little-endian
Scale handling
function handleScale(v) {
if (!v) return 0;
if (is019DDevice()) return (v * 0.8) + 0.2;
if (is030Device()) return (v * 0.7) + 0.3;
if (is035Device()) return (v * 0.6) + 0.4;
if (is018Device()) return (v * 0.6) + 0.4;
return (v * 0.7) + 0.3;
}Device types
Device info is in the 0x2A50 characteristic, no service stated.
You need to get little-endian UInt16 with byte offset 3.
My device has no binary information in any of 0x2A50 characteristics, so i can't provide any example
const is018Device = () => deviceType == 1;
const is030Device = () => deviceType == 2;
const is035Device = () => deviceType == 3;
const is019DDevice = () => deviceType == 4;
const is029Device = () => deviceType == 29;Examples:
OFF 0312f300fc00fe40013c0000fc00fe40013c0000
VAL 0312f300fc00fe4001bc6e00fc00fe4001bc6e00
MAX 0312f300fc00fe4001fcff00fc00fe4001fcff00
WeChat app sends message every 0.2 seconds
If no message sent within a cetain amount of time, toy stops
Also app has some setModel and setClear messages
setClear is sent once when user touches drag bar
It is constant message: 0312f00700000000000000000000000000000000
setModel(0) is called when app pages are unloaded and in some other cases i don't understand.
Message: 0312f60000000000000000000000000000000000
Reactions are currently unavailable