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

Document Mizzzee protocol #25

Open
SuhEugene opened this issue Dec 30, 2023 · 1 comment
Open

Document Mizzzee protocol #25

SuhEugene opened this issue Dec 30, 2023 · 1 comment

Comments

@SuhEugene
Copy link

SuhEugene commented Dec 30, 2023

BT Name: XHTKJ
Service UUID: 0xFF10
Characteristic UUID: 0xFF12

Message: 0312f300fc00fe4001XXXX00fc00fe4001YYYY00

  • XXXX and YYYY is 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

@blackspherefollower
Copy link

The handleScale() method is there to avoid the device's motor deadzone (where it can't spin the weight).
The 0x2a50 chacteristic is under the 0x180a service and reads 0x01a70600000100, which is the PnP ID of Manufacturer 06a7=Chipsea, ProductId 0000=0 and Product Version 0100=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants