Giter Club home page Giter Club logo

Comments (3)

coroiu avatar coroiu commented on July 19, 2024

Trying to fix this too, though I'm trying to fix it on pangliangs library. Doesn't matter though as I'm sending the commands that I find here. I know of apps in the store that succesfully implement custom vibrations, so they should work!

Have you made any progress since opening this issue?

Edit:
I seem to be able to successfully trigger the standard 2-times vibrations and also the vibrate-until-stop. What I can't seem to do for some reason is make any of them stop...

from mi-band.

DarioNevistic avatar DarioNevistic commented on July 19, 2024

Can you please share how you trigger the vibration-until-stop?
From Elad Nava, this helped on original MiBand- Color Led:

public synchronized void notifyBandRepeated (final int flashColour, final int vibrateTimes, final int 
waitDuration) {

        List<BLEAction> list = new ArrayList<>();

        byte[] colors = convertRgb(flashColour);

        for (int i = 1; i <= vibrateTimes; i++) {
            list.add(new WriteAction(Profile.UUID_SERVICE_VIBRATE, Profile.UUID_CHAR_ALERT_LEVEL, Protocol.VIBRATION_NEW_FIRMWARE));
            list.add(new WriteAction(Profile.UUID_CHAR_CONTROL_POINT, colors));
            list.add(new WaitAction(waitDuration));
        }

        queue(list);
    }

from mi-band.

coroiu avatar coroiu commented on July 19, 2024

I'm currently much deeper inside the libraries, but the following is what I'm sending to my band:

Service: Profile.UUID_SERVICE_VIBRATE
Characteristic: Profile.UUID_CHAR_ALERT_LEVEL,
Data: new byte[] { 2 }

It makes my band with heart sensor (1S?) vibrate until I tap it (or almost, it keeps going for like a few seconds). For some reason betamalujes library (this) has byte[] VIBRATION_UNTIL_CALL_STOP = {0x8, 1}; which does not work for me. Maybe try changing this to what I used?

Edit:
Finally managed to stop the vibration above. It seems to be some problem with multi-threading. Anyways, to stop it I used the same service and characteristic as above, just sent new byte[] { 0 } instead!

from mi-band.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.