-
Notifications
You must be signed in to change notification settings - Fork 28
Bracelet commands
The android app for DS-D6 is com.mpow.base.framework. The same rebranded Lenovo Healthy app by same developer is also used for Lenovo branded devices (e.g. HX-06, HX-03F, HX-03W).
Supported functions for specific bracelets are defined inside apk in files assets/DSEBLE*.json
. The structures are somewhat redundant with same bracelet defined in multiple files, DS-D6 is defined e.g. in DSBLEBandD.json as:
"DS-D6": { "protocolName": "Band_521", "deviceName": "DS-D6", "functions": [ "Func_Motor", "Func_SetDHR", "Func_SetRHR", "Func_Display", "Func_Alarm/2/2", "Func_Target", "Func_Version", "Func_Reset", "Func_Reboot", "Func_Bind", "Func_UserInfo", "Func_Battery", "Func_AutoStep", "Func_Language", "Func_WristingTime/2/2", "Func_Sedentary", "Func_FindBand", "Func_Active", "Func_Time", "Func_Timezone", "Func_DFU", "Func_SaveStep", "Func_TestHR", "Func_Sync", "Func_SyncIcon", "Func_FindPhone", "Func_Unit", "Func_HRMonitor", "Func_24Hour", "Func_SportMode/2/2", "Func_SetPace", "Func_Gsensor", "Func_SN", "Func_PUSH", "Func_Age", "Func_Gender", "Func_AntiLost", "Func_SportInfo" ], "exceptions": [ ], "manuCode": "51", "parentDevice": "", "deviceType": "Band", "vendor":"Nordic" }
The communication with the device is done via AT commands sent to BLE services 0000190b-0000-1000-8000-00805f9b34fb or 0000190a-0000-1000-8000-00805f9b34fb. Both appears to work in almost same way and accept (same?) AT commands. Looks like Mpow android app uses 190a service so that one may be preferred - it was verified some functionality related to notification messages (AT+PUSH command) work better with 190a service than 190b.
On android one can use Serial Bluetooth Terminal app as it allows custom settings of service ids - scan for LE devices, hold on device name and select Edit menu, then select 'Custom' choice and you can select service guid, then you can select characteristics for read and write (there is only one choice for each - 3,4 for service 190b, 1,2 for service 190a).
Constants for "Band_521" protocol are defined inside class com.desay.dsbluetooth.data.cmd.BandCommandB521.
CMD_ACT = "AT+ACT"
CMD_AGE = "AT+AGE"
CMD_ALARM = "AT+ALARM"
CMD_ALARM2 = "AT+ALARM2"
CMD_ALERTDISTANCE = "AT+ALERTDISTANCE"
CMD_ALERTTYPE = "AT+ALERTTYPE"
CMD_ANCS = "BT+IOS"
CMD_ANCS_SET = "AT+ANCS"
CMD_ANTILOST_SET = "AT+ANTI_LOST"
CMD_ANTISTATUS = "AT+BONDSTATUS"
CMD_AT_TEST = ""
CMD_BIND = "AT+BOND"
CMD_BP = "NT+BP"
CMD_BP_SET = "AT+BP"
CMD_BRIGHT = "AT+CONTRAST"
CMD_CAL = "NT+CAL"
CMD_CAL_DC = "AT+CALDC"
CMD_CAPCAL = ""
CMD_DATA = "AT+DATA"
CMD_DEST_SET = "AT+DEST"
CMD_DISPLAY = "AT+DISMOD"
CMD_FINDPHONE = "NT+BEEP"
CMD_FINDPHONE_SET = "AT+FINDPHONE"
CMD_FIND_BAND = "AT+FINDBT"
CMD_GENDER = "AT+SEX"
CMD_GET_POWER = "AT+BATT"
CMD_GET_SN = "AT+SN"
CMD_GSENSOR = "AT+GSENSOR"
CMD_HEARTRATE = "NT+HEART"
CMD_HO = "NT+HO"
CMD_HRALERTM = "AT+HRALERTM"
CMD_HRALERTS = "AT+HRALERTS"
CMD_HRMONITOR = "AT+HRMONITOR"
CMD_LAN_SET = "AT+LAN"
CMD_MODEL_PARA = "AT+MODEL"
CMD_MOTOR = "AT+MOTOR"
CMD_MOTOR_ON = ""
CMD_MUSICCRL_SET = "AT+MUSIC"
CMD_MUSICPLY = "AT+MUSICPLY"
CMD_NEXTMUSIC = "NT+MUSICNEXT"
CMD_NOSLEEP = "AT+NOSLEEP"
CMD_NOSLEEPAUTO = "NT+NOSLEEP"
CMD_OFF = "AT+OFF"
CMD_PACE = "AT+PACE"
CMD_PAI = "AT+PAI"
CMD_PAIH = "AT+PAIH"
CMD_PAIL = "AT+PAIL"
CMD_PAIT = "AT+PAIT"
CMD_PAUSEMUSIC = "NT+MUSICPAUSE"
CMD_PLAYMUSIC = "NT+MUSICON"
CMD_PREMUSIC = "NT+MUSICPRE"
CMD_PUSH = "AT+PUSH"
CMD_REBOOT = "BT+RESET"
CMD_REMOTE_CAMERA = "AT+CAMERA"
CMD_RESET = "BT+REC"
CMD_RESTMODE = "AT+REST"
CMD_SEDENTARY = "AT+SIT"
CMD_SLEEPTIME = ""
CMD_SOS = "NT+SOS"
CMD_SPE_RUN = "AT+RUN"
CMD_SPORTINFO = "AT+RD"
CMD_STEPSTO = "AT+STEPSTORE"
CMD_STOPMUSIC = "NT+MUSICOFF"
CMD_SYNC_SHOW = "AT+SYN"
CMD_TAKE_PHOTO = "NT+CAMERA"
CMD_TEST_HEARTRATE = "AT+HEART"
CMD_TIME = "AT+DT"
CMD_TIMEFORMAT = "AT+TIMEFORMAT"
CMD_TIMEZONE = "AT+TIMEZONE"
CMD_TOPACE = "NT+TOPACE"
CMD_TOPAI = "NT+TOPAI"
CMD_UNIT_SET = "AT+UNITS"
CMD_UPGB = "BT+UPGB"
CMD_UPSTEP = "AT+TOPACE"
CMD_USER_HEIGHT = "AT+HEIGHT"
CMD_USER_INFO = "AT+USER"
CMD_USER_NAME = "AT+NAME"
CMD_USER_SEX = "AT+SEX"
CMD_USER_WEIGHT = "AT+WEIGHT"
CMD_VER = "BT+VER"
CMD_WEATHER = "AT+AQT"
CMD_WRISTINGTIME = "AT+HANDSUP"
Also when checking firmware binary there are also few others, some of them duplicating same features in different way or having similar but different results (eg. AT/BT+VER return different version strings - app vs bootloader version?)
AT+ACCEL
AT+VER
BT+VER
BT+RELSEDATE
AT+FIFO
BT+DEVICE
BT+UART
BT+MAC
BT+STEP
AT+BOND
AT+NAME
AT+PWD
AT+SN
AT+POWER
AT+ZI
AT+LAN
AT+SLPTIME
AT+CALDC
AT+MFG
AT+CAPCAL
AT+ANCS
AT+RESETREAS
AT+READDATA
Here is also some additional commands info from https://github.com/sulancheng/myble/blob/master/blelab/src/main/java/com/desay/corn/blelab/NordicSeriesDevices.java translated to english
//The bracelet is not activated by default. After sending AT+BOND, the bracelet vibrates, click the bracelet button, report AT+BOND: OK to the upper layer, and the binding ends.
public static final String CMD_BOND = "AT+BOND";
/ / The actual return version depends on the situation, such as AT + VER: 1.0.1
public static final String CMD_BAND_VERSION = "BT+VER";
/ / User information
public static final String CMD_BAND_USER = "AT+USER";
/ / Query / set the current time
public static final String CMD_SYN_TIME = "AT+DT";
// Bracelet alarm clock 1
public static final String CMD_SET_CLOCK_ONE = "AT+ALARM";
// Bracelet alarm clock 1
public static final String CMD_SET_CLOCK_TWO = "AT+ALARM2";
/ / Get the bracelet power
public static final String CMD_BATTERY = "AT+BATT";
/ / Set or get the total number of steps in the bracelet, AT + PACE query, AT + PACE = 01234 settings, (format is 5, less than zero)
public static final String CMD_STEP = "AT+PACE";
/**
* AT+SIT=030,0100,2223,1
* AT+SIT:cycle,start_time,stop_time,switch
* cycle: cycle, in minutes
Start_time: start time (representing meaning, the first two digits represent the clock, the last two digits represent the minute, for example, 0100 means 1:00, 2223 means 22:23)
Stop_time: end time (same as above)
Switch: Switch 1: On 0: Off
(Between the start time and the end time of the setting, every minute of the interval, if the number of steps does not reach the limit, it is considered to be sedentary, then the vibration reminds)
*
* **/
public static final String CMD_SIT_SETTINGS = "AT+SIT";
/**
* AT+PUSH=type, phone_num, time_long call reminder push
* type: type (number or Chinese name) 0: number 1: Chinese name
* phone_num: when Type is a number, phone_num is data
* time_long: bright time (seconds)
* **/
public static final String CMD_PHONE_CALL = "AT+PUSH";
// APP sends the Chinese byte stream preparation instruction of the incoming call
public static final String CMD_PUSH_CH = "AT+ZI";
/**
* Request: AT+DATA=num
* Reply AT+DATA: type, len, fulllen, num, total, crc, en
* In the request command, num is the serial number of the package.
* The type in the return instruction is the data type, 0: for motion, and 7 for sleep.
* len is the effective length of the current package,
* Fulllen is the total length of the current package,
* num is the package serial number,
* total is the total number of packages (how many fulllen length packages),
* crc is the package check,
* en is the encryption of the secondary package. Repeatedly issued after verification
* **/
public static final String CMD_REQUEST_DATA = "AT+DATA";
/ / Get the bracelet unique identification code
// public static final String CMD_GET_SN = "AT+SN";
/ / Set the bracelet language AT + LAN = 0/1
/ / Set the bracelet language: 0: English
// 1: Chinese
public static final String CMD_SET_LAN = "AT+LAN";
/ / Set the bracelet movement target AT + DEST = 10000 five digits, the insufficient digits need to fill zero
// AT+DEST=00000 is the function to turn off
public static final String CMD_SETSPORT_AIM = "AT+DEST";
/**
* APP configuration raises the hand to display AT+HANDSUP=1
* Parameters:
* 0: off
* 1: Automatic
* 2: left hand
* 3: Right hand
**/
public static final String CMD_HANDUP = "AT+HANDSUP";
// Special motion 1 is start, 0 is exit AT+RUN =1 /0
public static final String CMD_START_RUN = "AT+RUN";
/**
* AT+TOPACE = 1 Open the real-time sync step interface
* AT+TOPACE = 0 Turn off the real-time sync step interface
* **/
public static final String CMD_SYN_TIMELY_STEPS = "AT+TOPACE";
/**
* AT+SYN = 1 notification bracelet display synchronization interface
* AT+SYN = 0 to notify the bracelet to close the synchronization interface
* **/
public static final String CMD_SET_SYN_FLAG = "AT+SYN";
/**
* Synchronize music playback status
* AT+MUSICPLY = 1 notification shows the icon that has been played
* AT+MUSICPLY = 0 notification shows the icon that stops playing
* **/
public static final String CMD_SYN_MUSICPLAY_STATE = "AT+MUSICPLY";
/**
* AT+HEART = 1 control bracelet test heart rate begins
* AT+HEART = 0 Forced control bracelet test heart rate end
* **/
public static final String CMD_STATIC_HEART = "AT+HEART";
/ / Find the bracelet
public static final String CMD_FIND_BAND = "AT+FINDBT";
/**
* Set time zone, East 8th zone is 0
* For example, Dongjiu District
* AT+TIMEZONE = (9-1)*3600
**/
public static final String CMD_SYN_TIME_ZONE = "AT+TIMEZONE";
/**
* Remote photo taking
* AT+CAMERA = 1 notification bracelet display photo interface
* AT+CAMERA = 0 informs the bracelet to end the camera interface
* **/
public static final String CMD_CAMERA_FLAG = "AT+CAMERA";
/ / Turn music on or off
public static final String CMD_MUSIC = "AT+MUSIC";
public static final String BAND_MUSIC_CMD_PLAY = "NT+MUSICON";
public static final String BAND_MUSIC_CMD_PAUSE = "AT+MUSICPAUSE";
public static final String BAND_MUSIC_CMD_NEXT = "NT+MUSICNEXT";
public static final String BAND_MUSIC_CMD_PRE = "NT+MUSICPRE";
/ / Find the phone AT + FINDPHONE = 1 / 0
public static final String CMD_FIND_PHONE = "AT+FINDPHONE";
/ / Set the bracelet display unit
public static final String CMD_SET_DISTANCE_UNITS = "AT+UNITS";
// //find phone notify
public static final String BAND_FIND_PHONE_CMD = "NT+BEEP";
// //timely steps
public static final String TIMELY_STEPS_NOTIF = "NT+TOPACE";
// //camera
public static final String CMD_BAND_PHOTO = "NT+CAMERA";
Also it looks like the Desay Bluetooth library that is used in the Mpow app is here https://github.com/jaysonjh/DesayBluetooth_Android so one could use it in own Android app (and have support for many/all Desay devices out of box as the assets/*.json files with device configuration are part of the library). There is also react native module that is using this library here https://github.com/jaysonjh/react-native-dsbluetooth and also here https://github.com/desayteam/dsbluetooth