mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-25 16:50:44 +02:00
Merge branch 'master' of github.com:Freeyourgadget/Gadgetbridge into fossil-q-hybrid
This commit is contained in:
commit
ea1653d616
@ -1,5 +1,8 @@
|
||||
### Changelog
|
||||
|
||||
#### Version 0.36.3
|
||||
* Basic Makibes HR3 support
|
||||
|
||||
#### Version 0.36.2
|
||||
* Amazfit Bip: Untested support for Lite variant
|
||||
* Force Lineage OS to ask for permission when Trust is used to fix non-working incoming calls
|
||||
|
@ -25,8 +25,8 @@ android {
|
||||
targetSdkVersion 27
|
||||
|
||||
// Note: always bump BOTH versionCode and versionName!
|
||||
versionName "0.36.2"
|
||||
versionCode 157
|
||||
versionName "0.36.3"
|
||||
versionCode 158
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
}
|
||||
buildTypes {
|
||||
|
@ -0,0 +1,5 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.activities.devicesettings;
|
||||
|
||||
public class DeviceSettingsPreferenceConst {
|
||||
public static final String PREF_TIMEFORMAT = "timeformat";
|
||||
}
|
@ -0,0 +1,213 @@
|
||||
/* Copyright (C) 2016-2019 Andreas Shimokawa, Carsten Pfeiffer, João
|
||||
Paulo Barraca
|
||||
|
||||
This file is part of Gadgetbridge.
|
||||
|
||||
Gadgetbridge is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Gadgetbridge is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.makibeshr3;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public final class MakibesHR3Constants {
|
||||
|
||||
|
||||
public static final UUID UUID_SERVICE = UUID.fromString("6e400001-b5a3-f393-e0a9-e50e24dcca9e");
|
||||
public static final UUID UUID_CHARACTERISTIC_CONTROL = UUID.fromString("6e400002-b5a3-f393-e0a9-e50e24dcca9e");
|
||||
|
||||
// time
|
||||
// mode ab:00:04:ff:7c:80:** (00: 24h, 01: 12h)
|
||||
|
||||
// confirm write?
|
||||
// ab:00:09:ff:52:80:00:13:06:09:0f:0b
|
||||
|
||||
// disconnect?
|
||||
// ab:00:03:ff:ff:80
|
||||
|
||||
// Services and Characteristics
|
||||
// 00001801-0000-1000-8000-00805f9b34fb
|
||||
// 00002a05-0000-1000-8000-00805f9b34fb
|
||||
// 00001800-0000-1000-8000-00805f9b34fb
|
||||
// 00002a00-0000-1000-8000-00805f9b34fb
|
||||
// 00002a01-0000-1000-8000-00805f9b34fb
|
||||
// 00002a02-0000-1000-8000-00805f9b34fb
|
||||
// 00002a04-0000-1000-8000-00805f9b34fb
|
||||
// 00002aa6-0000-1000-8000-00805f9b34fb
|
||||
// 6e400001-b5a3-f393-e0a9-e50e24dcca9e // Nordic UART Service
|
||||
// 6e400002-b5a3-f393-e0a9-e50e24dcca9e // control
|
||||
// 6e400003-b5a3-f393-e0a9-e50e24dcca9e
|
||||
// 0000fee7-0000-1000-8000-00805f9b34fb
|
||||
// 0000fec9-0000-1000-8000-00805f9b34fb
|
||||
// 0000fea1-0000-1000-8000-00805f9b34fb
|
||||
// 0000fea2-0000-1000-8000-00805f9b34fb
|
||||
|
||||
// Command structure
|
||||
// ab 00 [argument_count] ff [command] 80 [arguments]
|
||||
// where [argument_count] is [arguments].length + 3
|
||||
|
||||
// refresh sends
|
||||
// 51
|
||||
// 52
|
||||
// 93 (CMD_SET_DATE_TIME)
|
||||
|
||||
public static final byte[] DATA_TEMPLATE = {
|
||||
(byte) 0xab,
|
||||
(byte) 0x00,
|
||||
(byte) 0, // argument_count
|
||||
(byte) 0xff,
|
||||
(byte) 0, // command
|
||||
(byte) 0x80
|
||||
// ,arguments
|
||||
};
|
||||
|
||||
public static final int DATA_ARGUMENT_COUNT_INDEX = 2;
|
||||
public static final int DATA_COMMAND_INDEX = 4;
|
||||
public static final int DATA_ARGUMENTS_INDEX = 6;
|
||||
|
||||
|
||||
// 00
|
||||
public static final byte CMD_FACTORY_RESET = (byte) 0x23;
|
||||
|
||||
|
||||
// 00
|
||||
// year (+2000)
|
||||
// month
|
||||
// day
|
||||
// 0b
|
||||
// 00
|
||||
// year (+2000)
|
||||
// month
|
||||
// day
|
||||
// 0b
|
||||
// 19
|
||||
public static final byte CMD_UNKNOWN_51 = (byte) 0x51;
|
||||
|
||||
// this is the last command sent on sync
|
||||
// 00
|
||||
// year (+2000)
|
||||
// month
|
||||
// 14 this isn't the current day
|
||||
// hour (current)
|
||||
// minute (current)
|
||||
public static final byte CMD_UNKNOWN_52 = (byte) 0x52;
|
||||
|
||||
|
||||
public static final byte CMD_FIND_DEVICE = (byte) 0x71;
|
||||
|
||||
|
||||
public static final byte ARG_SEND_NOTIFICATION_SOURCE_CALL = (byte) 0x01;
|
||||
public static final byte ARG_SEND_NOTIFICATION_SOURCE_STOP_CALL = (byte) 0x02;
|
||||
public static final byte ARG_SEND_NOTIFICATION_SOURCE_MESSAGE = (byte) 0x03;
|
||||
public static final byte ARG_SEND_NOTIFICATION_SOURCE_QQ = (byte) 0x07;
|
||||
public static final byte ARG_SEND_NOTIFICATION_SOURCE_WECHAT = (byte) 0x09;
|
||||
public static final byte ARG_SEND_NOTIFICATION_SOURCE_WHATSAPP = (byte) 0x0a;
|
||||
public static final byte ARG_SEND_NOTIFICATION_SOURCE_LINE = (byte) 0x0e;
|
||||
public static final byte ARG_SEND_NOTIFICATION_SOURCE_TWITTER = (byte) 0x0f;
|
||||
public static final byte ARG_SEND_NOTIFICATION_SOURCE_FACEBOOK = (byte) 0x10;
|
||||
public static final byte ARG_SEND_NOTIFICATION_SOURCE_FACEBOOK2 = (byte) 0x11;
|
||||
public static final byte ARG_SEND_NOTIFICATION_SOURCE_WEIBO = (byte) 0x13;
|
||||
public static final byte ARG_SEND_NOTIFICATION_SOURCE_KAKOTALK = (byte) 0x14;
|
||||
// ARG_SET_NOTIFICATION_SOURCE_*
|
||||
// 02
|
||||
// ASCII
|
||||
public static final byte CMD_SEND_NOTIFICATION = (byte) 0x72;
|
||||
|
||||
|
||||
public static final byte ARG_SET_ALARM_REMINDER_REPEAT_WEEKDAY = (byte) 0x1F;
|
||||
public static final byte ARG_SET_ALARM_REMINDER_REPEAT_CUSTOM = (byte) 0x40;
|
||||
public static final byte ARG_SET_ALARM_REMINDER_REPEAT_EVERY_DAY = (byte) 0x7F;
|
||||
public static final byte ARG_SET_ALARM_REMINDER_REPEAT_ONE_TIME = (byte) 0x80;
|
||||
// reminder id starting at 0
|
||||
// enable (00/01)
|
||||
// hour
|
||||
// minute
|
||||
// ARG_SET_ALARM_REMINDER_REPEAT_*
|
||||
public static final byte CMD_SET_ALARM_REMINDER = (byte) 0x73;
|
||||
|
||||
|
||||
public static final byte ARG_SET_PERSONAL_INFORMATION_UNIT_DISTANCE_MILES = (byte) 0x00;
|
||||
public static final byte ARG_SET_PERSONAL_INFORMATION_UNIT_DISTANCE_KILOMETERS = (byte) 0x01;
|
||||
public static final byte ARG_SET_PERSONAL_INFORMATION_UNIT_LENGTH_INCHES = (byte) 0x00;
|
||||
public static final byte ARG_SET_PERSONAL_INFORMATION_UNIT_LENGTH_CENTIMETERS = (byte) 0x01;
|
||||
// step length (in/cm)
|
||||
// age (years)
|
||||
// height (in/cm)
|
||||
// weight (lb/kg)
|
||||
// ARG_SET_PERSONAL_INFORMATION_UNIT_DISTANCE_*
|
||||
// target step count (kilo)
|
||||
// 5a
|
||||
// 82
|
||||
// 3c
|
||||
// 5a
|
||||
// 28
|
||||
// b4
|
||||
// 5d
|
||||
// 64
|
||||
public static final byte CMD_SET_PERSONAL_INFORMATION = (byte) 0x74;
|
||||
|
||||
|
||||
// enable (00/01)
|
||||
// start hour
|
||||
// start minute
|
||||
// end hour
|
||||
// end minute
|
||||
// 2d
|
||||
public static final byte CMD_SET_SEDENTARY_REMINDER = (byte) 0x75;
|
||||
|
||||
|
||||
// enable (00/01)
|
||||
// start hour
|
||||
// start minute
|
||||
// end hour
|
||||
// end minute
|
||||
public static final byte CMD_SET_QUITE_HOURS = (byte) 0x76;
|
||||
|
||||
|
||||
// enable (00/01)
|
||||
public static final byte CMD_SET_HEADS_UP_SCREEN = (byte) 0x77;
|
||||
|
||||
|
||||
// The watch enters photograph mode, but doesn't appear to send a trigger signal.
|
||||
// enable (00/01)
|
||||
public static final byte CMD_SET_PHOTOGRAPH_MODE = (byte) 0x79;
|
||||
|
||||
|
||||
// enable (00/01)
|
||||
public static final byte CMD_SET_LOST_REMINDER = (byte) 0x7a;
|
||||
|
||||
|
||||
// 7b has 1 argument. Looks like enable/disable.
|
||||
|
||||
// 7e has 14 arguments.
|
||||
|
||||
public static final byte ARG_SET_TIMEMODE_24H = 0x00;
|
||||
public static final byte ARG_SET_TIMEMODE_12H = 0x01;
|
||||
// ARG_SET_TIMEMODE_*
|
||||
public static final byte CMD_SET_TIMEMODE = (byte) 0x7c;
|
||||
|
||||
|
||||
// 00
|
||||
// year hi
|
||||
// year lo
|
||||
// month
|
||||
// day
|
||||
// hour
|
||||
// minute
|
||||
// second
|
||||
public static final byte CMD_SET_DATE_TIME = (byte) 0x93;
|
||||
|
||||
|
||||
// If this is sent after {@link CMD_FACTORY_RESET}, it's a shutdown, not a reboot.
|
||||
// Rebooting resets the watch face and wallpaper.
|
||||
public static final byte CMD_REBOOT = (byte) 0xff;
|
||||
}
|
@ -0,0 +1,181 @@
|
||||
/* Copyright (C) 2017-2019 Daniele Gobbetti, João Paulo Barraca, tiparega
|
||||
|
||||
This file is part of Gadgetbridge.
|
||||
|
||||
Gadgetbridge is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Gadgetbridge is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.makibeshr3;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
||||
|
||||
import static nodomain.freeyourgadget.gadgetbridge.GBApplication.getContext;
|
||||
|
||||
|
||||
public class MakibesHR3Coordinator extends AbstractDeviceCoordinator {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MakibesHR3Coordinator.class);
|
||||
|
||||
public static byte getTimeMode(String deviceAddress) {
|
||||
SharedPreferences sharedPrefs = GBApplication.getDeviceSpecificSharedPrefs(deviceAddress);
|
||||
|
||||
String tmode = sharedPrefs.getString(DeviceSettingsPreferenceConst.PREF_TIMEFORMAT, getContext().getString(R.string.p_timeformat_24h));
|
||||
|
||||
LOG.debug("tmode is " + tmode);
|
||||
|
||||
if (getContext().getString(R.string.p_timeformat_24h).equals(tmode)) {
|
||||
return MakibesHR3Constants.ARG_SET_TIMEMODE_24H;
|
||||
} else {
|
||||
return MakibesHR3Constants.ARG_SET_TIMEMODE_12H;
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
||||
String name = candidate.getDevice().getName();
|
||||
|
||||
// TODO:
|
||||
if ((name != null) && name.equals("Y808")) {
|
||||
return DeviceType.MAKIBESHR3;
|
||||
}
|
||||
|
||||
return DeviceType.UNKNOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBondingStyle(GBDevice deviceCandidate) {
|
||||
return BONDING_STYLE_NONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRealtimeData() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFindDevice() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceType getDeviceType() {
|
||||
return DeviceType.MAKIBESHR3;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice device, DaoSession session) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount() {
|
||||
// TODO:
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSmartWakeup(GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Makibes";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppsManagement() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
||||
return new int[]{
|
||||
R.xml.devicesettings_timeformat
|
||||
};
|
||||
}
|
||||
}
|
@ -17,14 +17,10 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.miband;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.Version;
|
||||
|
||||
public final class MiBandConst {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MiBandConst.class);
|
||||
|
||||
public static final String PREF_USER_ALIAS = "mi_user_alias";
|
||||
public static final String PREF_MIBAND_WEARSIDE = "mi_wearside";
|
||||
|
@ -57,6 +57,7 @@ public enum DeviceType {
|
||||
CASIOGB6900(120, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_casiogb6900),
|
||||
MISCALE2(131, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_miscale2),
|
||||
BFH16(140, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_bfh16),
|
||||
MAKIBESHR3(150, R.drawable.ic_device_default, R.drawable.ic_device_hplus_disabled, R.string.devicetype_makibes_hr3),
|
||||
MIJIA_LYWSD02(200, R.drawable.ic_device_pebble, R.drawable.ic_device_pebble_disabled, R.string.devicetype_mijia_lywsd02),
|
||||
TEST(1000, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_test);
|
||||
|
||||
|
@ -42,6 +42,7 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.id115.ID115Support;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.jyou.BFH16DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.jyou.TeclastH30Support;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.liveview.LiveviewSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.makibeshr3.MakibesHR3DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.miband.MiBandSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.mijia_lywsd02.MijiaLywsd02Support;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.miscale2.MiScale2DeviceSupport;
|
||||
@ -199,6 +200,10 @@ public class DeviceSupportFactory {
|
||||
break;
|
||||
case MIJIA_LYWSD02:
|
||||
deviceSupport = new ServiceDeviceSupport(new MijiaLywsd02Support(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
|
||||
break;
|
||||
case MAKIBESHR3:
|
||||
deviceSupport = new ServiceDeviceSupport(new MakibesHR3DeviceSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
|
||||
break;
|
||||
}
|
||||
if (deviceSupport != null) {
|
||||
deviceSupport.setContext(gbDevice, mBtAdapter, mContext);
|
||||
|
@ -112,6 +112,7 @@ public class AmazfitBipFirmwareInfo extends HuamiFirmwareInfo {
|
||||
|
||||
// Latin Firmware
|
||||
crcToVersion.put(52828, "1.1.5.36 (Latin)");
|
||||
crcToVersion.put(60625, "1.1.6.30 (Latin)");
|
||||
|
||||
// resources
|
||||
crcToVersion.put(12586, "0.0.8.74");
|
||||
@ -138,6 +139,7 @@ public class AmazfitBipFirmwareInfo extends HuamiFirmwareInfo {
|
||||
crcToVersion.put(5341, "1.1.5.02-24");
|
||||
crcToVersion.put(22662, "1.1.5.36");
|
||||
crcToVersion.put(24045, "1.1.5.56");
|
||||
crcToVersion.put(37677, "1.1.6.30");
|
||||
|
||||
// gps
|
||||
crcToVersion.put(61520, "9367,8f79a91,0,0,");
|
||||
@ -149,7 +151,8 @@ public class AmazfitBipFirmwareInfo extends HuamiFirmwareInfo {
|
||||
|
||||
// font
|
||||
crcToVersion.put(61054, "8");
|
||||
crcToVersion.put(62291, "9 (Latin)");
|
||||
crcToVersion.put(62291, "9 (old Latin)");
|
||||
crcToVersion.put(59577, "9 (Latin)");
|
||||
}
|
||||
|
||||
public AmazfitBipFirmwareInfo(byte[] bytes) {
|
||||
@ -182,7 +185,7 @@ public class AmazfitBipFirmwareInfo extends HuamiFirmwareInfo {
|
||||
if (ArrayUtils.startsWith(bytes, NEWFT_HEADER)) {
|
||||
if (bytes[10] == 0x01) {
|
||||
return HuamiFirmwareType.FONT;
|
||||
} else if (bytes[10] == 0x02) {
|
||||
} else if (bytes[10] == 0x02 || bytes[10] == 0x0A) {
|
||||
return HuamiFirmwareType.FONT_LATIN;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,522 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.devices.makibeshr3;
|
||||
|
||||
import android.bluetooth.BluetoothGattCharacteristic;
|
||||
import android.net.Uri;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.UUID;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.makibeshr3.MakibesHR3Constants;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.makibeshr3.MakibesHR3Coordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.serial.GBDeviceProtocol;
|
||||
|
||||
public class MakibesHR3DeviceSupport extends AbstractBTLEDeviceSupport {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MakibesHR3DeviceSupport.class);
|
||||
|
||||
private BluetoothGattCharacteristic ctrlCharacteristic = null;
|
||||
|
||||
public MakibesHR3DeviceSupport() {
|
||||
super(LOG);
|
||||
|
||||
addSupportedService(MakibesHR3Constants.UUID_SERVICE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useAutoConnect() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNotification(NotificationSpec notificationSpec) {
|
||||
TransactionBuilder transactionBuilder = this.createTransactionBuilder("onnotificaiton");
|
||||
|
||||
byte sender;
|
||||
|
||||
switch (notificationSpec.type) {
|
||||
case FACEBOOK:
|
||||
case FACEBOOK_MESSENGER:
|
||||
sender = MakibesHR3Constants.ARG_SEND_NOTIFICATION_SOURCE_FACEBOOK;
|
||||
break;
|
||||
case LINE:
|
||||
sender = MakibesHR3Constants.ARG_SEND_NOTIFICATION_SOURCE_LINE;
|
||||
break;
|
||||
case TELEGRAM:
|
||||
sender = MakibesHR3Constants.ARG_SEND_NOTIFICATION_SOURCE_MESSAGE;
|
||||
break;
|
||||
case TWITTER:
|
||||
sender = MakibesHR3Constants.ARG_SEND_NOTIFICATION_SOURCE_TWITTER;
|
||||
break;
|
||||
case WECHAT:
|
||||
sender = MakibesHR3Constants.ARG_SEND_NOTIFICATION_SOURCE_WECHAT;
|
||||
break;
|
||||
case WHATSAPP:
|
||||
sender = MakibesHR3Constants.ARG_SEND_NOTIFICATION_SOURCE_WHATSAPP;
|
||||
break;
|
||||
case KAKAO_TALK:
|
||||
sender = MakibesHR3Constants.ARG_SEND_NOTIFICATION_SOURCE_KAKOTALK;
|
||||
break;
|
||||
|
||||
default:
|
||||
sender = MakibesHR3Constants.ARG_SEND_NOTIFICATION_SOURCE_MESSAGE;
|
||||
break;
|
||||
}
|
||||
|
||||
this.sendNotification(transactionBuilder,
|
||||
sender, notificationSpec.title + ": " + notificationSpec.body);
|
||||
|
||||
try {
|
||||
this.performConnected(transactionBuilder.getTransaction());
|
||||
} catch (Exception ex) {
|
||||
LoggerFactory.getLogger(this.getClass()).error("notification failed");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleteNotification(int id) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetTime() {
|
||||
TransactionBuilder transactionBuilder = this.createTransactionBuilder("settime");
|
||||
|
||||
this.setDateTime(transactionBuilder);
|
||||
|
||||
try {
|
||||
this.performConnected(transactionBuilder.getTransaction());
|
||||
} catch (Exception ex) {
|
||||
LoggerFactory.getLogger(this.getClass()).error("factory reset failed");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetAlarms(ArrayList<? extends Alarm> alarms) {
|
||||
|
||||
TransactionBuilder transactionBuilder = this.createTransactionBuilder("setalarms");
|
||||
|
||||
for (int i = 0; i < alarms.size(); ++i) {
|
||||
Alarm alarm = alarms.get(i);
|
||||
|
||||
// Should we use @alarm.getPosition() rather than @i?
|
||||
this.setAlarmReminder(
|
||||
transactionBuilder,
|
||||
i,
|
||||
alarm.getEnabled(),
|
||||
alarm.getHour(),
|
||||
alarm.getMinute(),
|
||||
MakibesHR3Constants.ARG_SET_ALARM_REMINDER_REPEAT_CUSTOM);
|
||||
}
|
||||
|
||||
try {
|
||||
this.performConnected(transactionBuilder.getTransaction());
|
||||
} catch (Exception ex) {
|
||||
LoggerFactory.getLogger(this.getClass()).error("setalarms failed");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetCallState(CallSpec callSpec) {
|
||||
TransactionBuilder transactionBuilder = this.createTransactionBuilder("callstate");
|
||||
LOG.debug("callSpec " + callSpec.command);
|
||||
if (callSpec.command == CallSpec.CALL_INCOMING) {
|
||||
this.sendNotification(transactionBuilder, MakibesHR3Constants.ARG_SEND_NOTIFICATION_SOURCE_CALL, callSpec.name);
|
||||
} else {
|
||||
this.sendNotification(transactionBuilder, MakibesHR3Constants.ARG_SEND_NOTIFICATION_SOURCE_STOP_CALL, callSpec.name);
|
||||
}
|
||||
|
||||
try {
|
||||
this.performConnected(transactionBuilder.getTransaction());
|
||||
} catch (Exception ex) {
|
||||
LoggerFactory.getLogger(this.getClass()).error("call state failed");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetCannedMessages(CannedMessagesSpec cannedMessagesSpec) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetMusicState(MusicStateSpec stateSpec) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetMusicInfo(MusicSpec musicSpec) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnableRealtimeSteps(boolean enable) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInstallApp(Uri uri) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAppInfoReq() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAppStart(UUID uuid, boolean start) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAppDelete(UUID uuid) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAppConfiguration(UUID appUuid, String config, Integer id) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAppReorder(UUID[] uuids) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFetchRecordedData(int dataTypes) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReset(int flags) {
|
||||
|
||||
if ((flags & GBDeviceProtocol.RESET_FLAGS_FACTORY_RESET) != 0) {
|
||||
TransactionBuilder transactionBuilder = this.createTransactionBuilder("reset");
|
||||
this.factoryReset(transactionBuilder);
|
||||
|
||||
try {
|
||||
this.performConnected(transactionBuilder.getTransaction());
|
||||
} catch (Exception ex) {
|
||||
LoggerFactory.getLogger(this.getClass()).error("factory reset failed");
|
||||
}
|
||||
} else if ((flags & GBDeviceProtocol.RESET_FLAGS_REBOOT) != 0) {
|
||||
TransactionBuilder transactionBuilder = this.createTransactionBuilder("reboot");
|
||||
this.reboot(transactionBuilder);
|
||||
|
||||
try {
|
||||
this.performConnected(transactionBuilder.getTransaction());
|
||||
} catch (Exception ex) {
|
||||
LoggerFactory.getLogger(this.getClass()).error("factory reset failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHeartRateTest() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnableRealtimeHeartRateMeasurement(boolean enable) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFindDevice(boolean start) {
|
||||
if (!start) {
|
||||
return;
|
||||
}
|
||||
|
||||
TransactionBuilder transactionBuilder = this.createTransactionBuilder("finddevice");
|
||||
|
||||
this.findDevice(transactionBuilder);
|
||||
|
||||
try {
|
||||
this.performConnected(transactionBuilder.getTransaction());
|
||||
} catch (Exception e) {
|
||||
LOG.debug("ERROR");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetConstantVibration(int integer) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScreenshotReq() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnableHeartRateSleepSupport(boolean enable) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetHeartRateMeasurementInterval(int seconds) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAddCalendarEvent(CalendarEventSpec calendarEventSpec) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleteCalendarEvent(byte type, long id) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSendConfiguration(String config) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReadConfiguration(String config) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTestNewFunction() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSendWeather(WeatherSpec weatherSpec) {
|
||||
|
||||
}
|
||||
|
||||
private MakibesHR3DeviceSupport sendUserInfo(TransactionBuilder builder) {
|
||||
// builder.write(ctrlCharacteristic, MakibesHR3Constants.CMD_SET_PREF_START);
|
||||
// builder.write(ctrlCharacteristic, MakibesHR3Constants.CMD_SET_PREF_START1);
|
||||
|
||||
syncPreferences(builder);
|
||||
|
||||
// builder.write(ctrlCharacteristic, new byte[]{MakibesHR3Constants.CMD_SET_CONF_END});
|
||||
return this;
|
||||
}
|
||||
|
||||
private MakibesHR3DeviceSupport syncPreferences(TransactionBuilder transaction) {
|
||||
|
||||
this.setTimeMode(transaction);
|
||||
this.setDateTime(transaction);
|
||||
// setDayOfWeek(transaction);
|
||||
// setTimeMode(transaction);
|
||||
|
||||
// setGender(transaction);
|
||||
// setAge(transaction);
|
||||
// setWeight(transaction);
|
||||
// setHeight(transaction);
|
||||
|
||||
// setGoal(transaction);
|
||||
// setLanguage(transaction);
|
||||
// setScreenTime(transaction);
|
||||
// setUnit(transaction);
|
||||
// setAllDayHeart(transaction);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TransactionBuilder initializeDevice(TransactionBuilder builder) {
|
||||
gbDevice.setState(GBDevice.State.INITIALIZING);
|
||||
gbDevice.sendDeviceUpdateIntent(getContext());
|
||||
|
||||
this.ctrlCharacteristic = getCharacteristic(MakibesHR3Constants.UUID_CHARACTERISTIC_CONTROL);
|
||||
|
||||
builder.setGattCallback(this);
|
||||
|
||||
// Allow modifications
|
||||
builder.write(this.ctrlCharacteristic, new byte[]{0x01, 0x00});
|
||||
|
||||
// Initialize device
|
||||
sendUserInfo(builder); //Sync preferences
|
||||
|
||||
gbDevice.setState(GBDevice.State.INITIALIZED);
|
||||
gbDevice.sendDeviceUpdateIntent(getContext());
|
||||
|
||||
getDevice().setFirmwareVersion("N/A");
|
||||
getDevice().setFirmwareVersion2("N/A");
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param command
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
private byte[] craftData(byte command, byte[] data) {
|
||||
byte[] result = new byte[MakibesHR3Constants.DATA_TEMPLATE.length + data.length];
|
||||
|
||||
System.arraycopy(MakibesHR3Constants.DATA_TEMPLATE, 0, result, 0, MakibesHR3Constants.DATA_TEMPLATE.length);
|
||||
|
||||
result[MakibesHR3Constants.DATA_ARGUMENT_COUNT_INDEX] = (byte) (data.length + 3);
|
||||
result[MakibesHR3Constants.DATA_COMMAND_INDEX] = command;
|
||||
|
||||
System.arraycopy(data, 0, result, 6, data.length);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private byte[] craftData(byte command) {
|
||||
return this.craftData(command, new byte[]{});
|
||||
}
|
||||
|
||||
private void writeSafe(BluetoothGattCharacteristic characteristic, TransactionBuilder builder, byte[] data) {
|
||||
final int maxMessageLength = 20;
|
||||
|
||||
// For every split, we need 1 byte extra.
|
||||
int extraBytes = (((data.length - maxMessageLength) / maxMessageLength) + 1);
|
||||
|
||||
int totalDataLength = (data.length + extraBytes);
|
||||
|
||||
int segmentCount = (((totalDataLength - 1) / maxMessageLength) + 1);
|
||||
|
||||
byte[] indexedData = new byte[totalDataLength];
|
||||
|
||||
int it = 0;
|
||||
int segmentIndex = 0;
|
||||
for (int i = 0; i < data.length; ++i) {
|
||||
if ((i != 0) && ((it % maxMessageLength) == 0)) {
|
||||
indexedData[it++] = (byte) segmentIndex++;
|
||||
}
|
||||
|
||||
indexedData[it++] = data[i];
|
||||
}
|
||||
|
||||
for (int i = 0; i < segmentCount; ++i) {
|
||||
int segmentStart = (i * maxMessageLength);
|
||||
int segmentLength;
|
||||
|
||||
if (i == (segmentCount - 1)) {
|
||||
segmentLength = (indexedData.length - segmentStart);
|
||||
} else {
|
||||
segmentLength = maxMessageLength;
|
||||
}
|
||||
|
||||
byte[] segment = new byte[segmentLength];
|
||||
|
||||
System.arraycopy(indexedData, segmentStart, segment, 0, segmentLength);
|
||||
|
||||
builder.write(characteristic, segment);
|
||||
}
|
||||
}
|
||||
|
||||
private MakibesHR3DeviceSupport factoryReset(TransactionBuilder transaction) {
|
||||
transaction.write(this.ctrlCharacteristic, this.craftData(MakibesHR3Constants.CMD_FACTORY_RESET));
|
||||
|
||||
return this.reboot(transaction);
|
||||
}
|
||||
|
||||
private MakibesHR3DeviceSupport findDevice(TransactionBuilder transaction) {
|
||||
transaction.write(this.ctrlCharacteristic, this.craftData(MakibesHR3Constants.CMD_FIND_DEVICE));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private MakibesHR3DeviceSupport sendNotification(TransactionBuilder transaction,
|
||||
byte source, String message) {
|
||||
byte[] data = new byte[message.length() + 2];
|
||||
data[0] = source;
|
||||
data[1] = (byte) 0x02;
|
||||
|
||||
for (int i = 0; i < message.length(); ++i) {
|
||||
data[i + 2] = (byte) message.charAt(i);
|
||||
}
|
||||
|
||||
this.writeSafe(
|
||||
this.ctrlCharacteristic,
|
||||
transaction,
|
||||
this.craftData(MakibesHR3Constants.CMD_SEND_NOTIFICATION, data));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private MakibesHR3DeviceSupport setAlarmReminder(TransactionBuilder transaction,
|
||||
int id, boolean enable, int hour, int minute, byte repeat) {
|
||||
transaction.write(this.ctrlCharacteristic,
|
||||
this.craftData(MakibesHR3Constants.CMD_SET_ALARM_REMINDER, new byte[]{
|
||||
(byte) id,
|
||||
(byte) (enable ? 0x01 : 0x00),
|
||||
(byte) hour,
|
||||
(byte) minute,
|
||||
repeat
|
||||
}));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private MakibesHR3DeviceSupport setTimeMode(TransactionBuilder transaction) {
|
||||
byte value = MakibesHR3Coordinator.getTimeMode(getDevice().getAddress());
|
||||
|
||||
byte[] data = this.craftData(MakibesHR3Constants.CMD_SET_TIMEMODE, new byte[]{value});
|
||||
|
||||
transaction.write(this.ctrlCharacteristic, data);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private MakibesHR3DeviceSupport setDateTime(TransactionBuilder transaction,
|
||||
int year,
|
||||
int month,
|
||||
int day,
|
||||
int hour,
|
||||
int minute,
|
||||
int second) {
|
||||
|
||||
byte[] data = this.craftData(MakibesHR3Constants.CMD_SET_DATE_TIME,
|
||||
new byte[]{
|
||||
(byte) 0x00,
|
||||
(byte) (year & 0xff00),
|
||||
(byte) (year & 0x00ff),
|
||||
(byte) month,
|
||||
(byte) day,
|
||||
(byte) hour,
|
||||
(byte) minute,
|
||||
(byte) second
|
||||
});
|
||||
|
||||
transaction.write(this.ctrlCharacteristic, data);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private MakibesHR3DeviceSupport setDateTime(TransactionBuilder transaction) {
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
||||
return this.setDateTime(transaction,
|
||||
calendar.get(Calendar.YEAR),
|
||||
calendar.get(Calendar.MONTH) + 1,
|
||||
calendar.get(Calendar.DAY_OF_MONTH),
|
||||
calendar.get(Calendar.HOUR_OF_DAY),
|
||||
calendar.get(Calendar.MINUTE),
|
||||
calendar.get(Calendar.SECOND)
|
||||
);
|
||||
}
|
||||
|
||||
private MakibesHR3DeviceSupport reboot(TransactionBuilder transaction) {
|
||||
transaction.write(this.ctrlCharacteristic, this.craftData(MakibesHR3Constants.CMD_REBOOT));
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
@ -45,6 +45,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.casiogb6900.CasioGB6900Devic
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.EXRIZUK8Coordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.HPlusCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.MakibesF68Coordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.makibeshr3.MakibesHR3Coordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.Q8Coordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip.AmazfitBipCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitcor.AmazfitCorCoordinator;
|
||||
@ -230,6 +231,7 @@ public class DeviceHelper {
|
||||
result.add(new CasioGB6900DeviceCoordinator());
|
||||
result.add(new BFH16DeviceCoordinator());
|
||||
result.add(new MijiaLywsd02Coordinator());
|
||||
result.add(new MakibesHR3Coordinator());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -263,7 +263,7 @@
|
||||
<string name="initializing">Инициализиране</string>
|
||||
<string name="busy_task_fetch_activity_data">Извличане на данните за активност</string>
|
||||
<string name="sleep_activity_date_range">От %1$s До %2$s</string>
|
||||
<string name="miband_prefs_wearside">На коя ръка - лява или дясна\?</string>
|
||||
<string name="prefs_wearside">На коя ръка - лява или дясна\?</string>
|
||||
<string name="pref_screen_vibration_profile">Профил на вибрациите</string>
|
||||
<string name="vibration_profile_staccato">Стакато</string>
|
||||
<string name="vibration_profile_short">Кратко</string>
|
||||
|
@ -224,7 +224,7 @@
|
||||
<string name="initializing">S\'està inicialitzant</string>
|
||||
<string name="busy_task_fetch_activity_data">S\'estàn recollint les dades d\'activitat</string>
|
||||
<string name="sleep_activity_date_range">De %1$s a %2$s</string>
|
||||
<string name="miband_prefs_wearside">A quina mà porteu l\'aparell\?</string>
|
||||
<string name="prefs_wearside">A quina mà porteu l\'aparell\?</string>
|
||||
<string name="pref_screen_vibration_profile">Perfil de vibració</string>
|
||||
<string name="vibration_profile_staccato">Molt curta</string>
|
||||
<string name="vibration_profile_short">Curta</string>
|
||||
|
@ -200,7 +200,7 @@
|
||||
<string name="initializing">Spouštím</string>
|
||||
<string name="busy_task_fetch_activity_data">Stahuji data o aktivitě</string>
|
||||
<string name="sleep_activity_date_range">Od %1$s do %2$s</string>
|
||||
<string name="miband_prefs_wearside">Nosíte vlevo nebo vpravo?</string>
|
||||
<string name="prefs_wearside">Nosíte vlevo nebo vpravo?</string>
|
||||
<string name="pref_screen_vibration_profile">Profil vibrací</string>
|
||||
<string name="vibration_profile_staccato">Staccato</string>
|
||||
<string name="vibration_profile_short">Krátké</string>
|
||||
|
@ -211,7 +211,7 @@
|
||||
<string name="initializing">Initialisieren</string>
|
||||
<string name="busy_task_fetch_activity_data">Aktivitätsdaten abrufen</string>
|
||||
<string name="sleep_activity_date_range">Von %1$s bis %2$s</string>
|
||||
<string name="miband_prefs_wearside">Wird links oder rechts getragen\?</string>
|
||||
<string name="prefs_wearside">Wird links oder rechts getragen\?</string>
|
||||
<string name="pref_screen_vibration_profile">Vibrationsprofile</string>
|
||||
<string name="vibration_profile_staccato">Stakkato</string>
|
||||
<string name="vibration_profile_short">Kurz</string>
|
||||
@ -776,4 +776,6 @@
|
||||
<item quantity="one">%d Std</item>
|
||||
<item quantity="other">%d Std</item>
|
||||
</plurals>
|
||||
<string name="preferences_makibes_hr3_settings">Makibes HR3 Einstellungen</string>
|
||||
<string name="devicetype_makibes_hr3">Makibes HR3</string>
|
||||
</resources>
|
@ -229,7 +229,7 @@
|
||||
<string name="initializing">Αρχικοποίηση</string>
|
||||
<string name="busy_task_fetch_activity_data">Λήψη δεδομένων δραστηριότητας</string>
|
||||
<string name="sleep_activity_date_range">Από %1$s έως %2$s</string>
|
||||
<string name="miband_prefs_wearside">Σε ποιο χέρι το φοράτε;</string>
|
||||
<string name="prefs_wearside">Σε ποιο χέρι το φοράτε;</string>
|
||||
<string name="pref_screen_vibration_profile">Προφίλ δόνησης</string>
|
||||
<string name="vibration_profile_staccato">Κοφτή</string>
|
||||
<string name="vibration_profile_short">Σύντομη</string>
|
||||
|
@ -207,7 +207,7 @@
|
||||
<string name="initializing">Iniciando</string>
|
||||
<string name="busy_task_fetch_activity_data">Recuperando datos de actividad</string>
|
||||
<string name="sleep_activity_date_range">Desde %1$s a %2$s</string>
|
||||
<string name="miband_prefs_wearside">¿En derecha o en izquierda?</string>
|
||||
<string name="prefs_wearside">¿En derecha o en izquierda?</string>
|
||||
<string name="pref_screen_vibration_profile">Perfil de vibración</string>
|
||||
<string name="vibration_profile_staccato">Muy corto</string>
|
||||
<string name="vibration_profile_short">Corto</string>
|
||||
|
@ -204,7 +204,7 @@
|
||||
<string name="initializing">Initialisation</string>
|
||||
<string name="busy_task_fetch_activity_data">Récupération des données d\'activité</string>
|
||||
<string name="sleep_activity_date_range">De %1$s à %2$s</string>
|
||||
<string name="miband_prefs_wearside">Port main gauche ou droite ?</string>
|
||||
<string name="prefs_wearside">Port main gauche ou droite ?</string>
|
||||
<string name="pref_screen_vibration_profile">Profil de vibration</string>
|
||||
<string name="vibration_profile_staccato">Saccadé</string>
|
||||
<string name="vibration_profile_short">Court</string>
|
||||
|
@ -237,7 +237,7 @@
|
||||
<string name="initializing">Inicializando</string>
|
||||
<string name="busy_task_fetch_activity_data">Adquirindo datos de actividade</string>
|
||||
<string name="sleep_activity_date_range">De %1$s até %2$s</string>
|
||||
<string name="miband_prefs_wearside">De que lado a usa?</string>
|
||||
<string name="prefs_wearside">De que lado a usa?</string>
|
||||
<string name="pref_screen_vibration_profile">Perfil de vibración</string>
|
||||
|
||||
<string name="vibration_profile_staccato">Moi curto</string>
|
||||
|
@ -190,7 +190,7 @@
|
||||
<string name="initializing">מתבצע אתחול</string>
|
||||
<string name="busy_task_fetch_activity_data">נתוני הפעילות מתקבלים</string>
|
||||
<string name="sleep_activity_date_range">מ־%1$s עד %2$s</string>
|
||||
<string name="miband_prefs_wearside">על יד ימין או שמאל?</string>
|
||||
<string name="prefs_wearside">על יד ימין או שמאל?</string>
|
||||
<string name="pref_screen_vibration_profile">פרופיל רטט</string>
|
||||
<string name="vibration_profile_staccato">סטקטו</string>
|
||||
<string name="vibration_profile_short">קצר</string>
|
||||
@ -757,4 +757,7 @@
|
||||
<item quantity="many">%d שעות</item>
|
||||
<item quantity="other">%d שעות</item>
|
||||
</plurals>
|
||||
<string name="activity_error_no_app_for_gpx">כדי לצפות בעקבות פעילות, עליך להתקין יישומון שיכול לטפל בקובצי GPX.</string>
|
||||
<string name="preferences_makibes_hr3_settings">הגדרות של Makibes HR3</string>
|
||||
<string name="devicetype_makibes_hr3">Makibes HR3</string>
|
||||
</resources>
|
@ -200,7 +200,7 @@
|
||||
<string name="initializing">Inicializálás</string>
|
||||
<string name="busy_task_fetch_activity_data">Aktivitási adatok lekérdezése.</string>
|
||||
<string name="sleep_activity_date_range">%1$s és %2$s között</string>
|
||||
<string name="miband_prefs_wearside">Melyik kezeden hordod?</string>
|
||||
<string name="prefs_wearside">Melyik kezeden hordod?</string>
|
||||
<string name="pref_screen_vibration_profile">Rezgés profil</string>
|
||||
<string name="vibration_profile_staccato">Szaggatott</string>
|
||||
<string name="vibration_profile_short">Rövid</string>
|
||||
|
@ -201,7 +201,7 @@
|
||||
<string name="initializing">Inizializzazione in corso</string>
|
||||
<string name="busy_task_fetch_activity_data">Recupero dati attività</string>
|
||||
<string name="sleep_activity_date_range">Da %1$s a %2$s</string>
|
||||
<string name="miband_prefs_wearside">Indossato sul braccio sinistro o destro?</string>
|
||||
<string name="prefs_wearside">Indossato sul braccio sinistro o destro?</string>
|
||||
<string name="pref_screen_vibration_profile">Profilo vibrazioni</string>
|
||||
<string name="vibration_profile_staccato">Staccato</string>
|
||||
<string name="vibration_profile_short">Breve</string>
|
||||
|
@ -204,7 +204,7 @@
|
||||
<string name="initializing">初期化中</string>
|
||||
<string name="busy_task_fetch_activity_data">アクティビティデータを取得中</string>
|
||||
<string name="sleep_activity_date_range">%1$sから%2$sまで</string>
|
||||
<string name="miband_prefs_wearside">左または右に身に着けますか?</string>
|
||||
<string name="prefs_wearside">左または右に身に着けますか?</string>
|
||||
<string name="pref_screen_vibration_profile">バイブレーション プロファイル</string>
|
||||
<string name="vibration_profile_staccato">スタッカート</string>
|
||||
<string name="vibration_profile_short">短い</string>
|
||||
|
@ -115,7 +115,7 @@
|
||||
<string name="initializing">초기화 중</string>
|
||||
<string name="busy_task_fetch_activity_data">활동 데이터 가져오는 중</string>
|
||||
<string name="sleep_activity_date_range">%1$s에서 %2$s(으)로</string>
|
||||
<string name="miband_prefs_wearside">왼쪽과 오른쪽 중 어느 방향으로 착용합니까?</string>
|
||||
<string name="prefs_wearside">왼쪽과 오른쪽 중 어느 방향으로 착용합니까?</string>
|
||||
<string name="pref_screen_vibration_profile">진동 프로파일</string>
|
||||
<string name="vibration_profile_staccato">스타카토</string>
|
||||
<string name="vibration_profile_short">짧게</string>
|
||||
|
@ -214,7 +214,7 @@
|
||||
<string name="initializing">Igangsetter</string>
|
||||
<string name="busy_task_fetch_activity_data">Henter aktivitetsdato</string>
|
||||
<string name="sleep_activity_date_range">Fra %1$s til %2$s</string>
|
||||
<string name="miband_prefs_wearside">Venstre- eller høyre-hånd?</string>
|
||||
<string name="prefs_wearside">Venstre- eller høyre-hånd?</string>
|
||||
<string name="pref_screen_vibration_profile">Vibrasjonsprofil</string>
|
||||
<string name="vibration_profile_staccato">Stakkato</string>
|
||||
<string name="vibration_profile_short">Kort</string>
|
||||
@ -760,4 +760,7 @@
|
||||
<item quantity="one">%d time</item>
|
||||
<item quantity="other">%d timer</item>
|
||||
</plurals>
|
||||
<string name="activity_error_no_app_for_gpx">For å vise aktivitetsspor, installer et program som kan håndtere GPX-filer.</string>
|
||||
<string name="preferences_makibes_hr3_settings">Makibes HR3-innstillinger</string>
|
||||
<string name="devicetype_makibes_hr3">Makibes HR3</string>
|
||||
</resources>
|
@ -236,7 +236,7 @@
|
||||
<string name="initializing">Initialiseren</string>
|
||||
<string name="busy_task_fetch_activity_data">Ophalen van activiteitsgegevens</string>
|
||||
<string name="sleep_activity_date_range">Van %1$s aan %2$s</string>
|
||||
<string name="miband_prefs_wearside">Links of rechts dragen?</string>
|
||||
<string name="prefs_wearside">Links of rechts dragen?</string>
|
||||
<string name="pref_screen_vibration_profile">Vibratie profiel</string>
|
||||
<string name="vibration_profile_staccato">Staccato</string>
|
||||
<string name="vibration_profile_short">Kort</string>
|
||||
|
@ -148,7 +148,7 @@
|
||||
<string name="initializing">Inicjalizacja</string>
|
||||
<string name="busy_task_fetch_activity_data">Pobieranie danych o aktywności</string>
|
||||
<string name="sleep_activity_date_range">Od %1$s do %2$s</string>
|
||||
<string name="miband_prefs_wearside">Na której ręce noszone jest urządzenie\?</string>
|
||||
<string name="prefs_wearside">Na której ręce noszone jest urządzenie\?</string>
|
||||
<string name="pref_screen_vibration_profile">Profil wibracji</string>
|
||||
<string name="vibration_profile_staccato">Słabe</string>
|
||||
<string name="vibration_profile_short">Krótkie</string>
|
||||
|
@ -197,7 +197,7 @@
|
||||
<string name="initializing">Inicializando</string>
|
||||
<string name="busy_task_fetch_activity_data">Coletando dados de atividade</string>
|
||||
<string name="sleep_activity_date_range">De %1$s a %2$s</string>
|
||||
<string name="miband_prefs_wearside">Dispositivo na esquerda ou direita?</string>
|
||||
<string name="prefs_wearside">Dispositivo na esquerda ou direita?</string>
|
||||
<string name="pref_screen_vibration_profile">Perfil de vibração</string>
|
||||
<string name="vibration_profile_staccato">Destacado</string>
|
||||
<string name="vibration_profile_short">Pequeno</string>
|
||||
@ -768,4 +768,7 @@
|
||||
<item quantity="one">% hora</item>
|
||||
<item quantity="other">% horas</item>
|
||||
</plurals>
|
||||
<string name="activity_error_no_app_for_gpx">Para visualizar o rastreamento de atividade, instale um aplicativo que consegue manipular arquivos GPX.</string>
|
||||
<string name="preferences_makibes_hr3_settings">Configurações de Makibes HR3</string>
|
||||
<string name="devicetype_makibes_hr3">Makibes HR3</string>
|
||||
</resources>
|
@ -197,7 +197,7 @@
|
||||
<string name="initializing">Inicializando</string>
|
||||
<string name="busy_task_fetch_activity_data">A Descarregar Dados de Atividade</string>
|
||||
<string name="sleep_activity_date_range">De %1$s até %2$s</string>
|
||||
<string name="miband_prefs_wearside">De que lado a usa?</string>
|
||||
<string name="prefs_wearside">De que lado a usa?</string>
|
||||
<string name="pref_screen_vibration_profile">Perfil de Vibração</string>
|
||||
<string name="vibration_profile_staccato">Destacado</string>
|
||||
<string name="vibration_profile_short">Pequeno</string>
|
||||
|
@ -198,7 +198,7 @@
|
||||
<string name="initializing">Запускается</string>
|
||||
<string name="busy_task_fetch_activity_data">Получение данных активности</string>
|
||||
<string name="sleep_activity_date_range">От %1$s до %2$s</string>
|
||||
<string name="miband_prefs_wearside">Носите на левой или правой руке?</string>
|
||||
<string name="prefs_wearside">Носите на левой или правой руке?</string>
|
||||
<string name="pref_screen_vibration_profile">Профиль настроек вибрации</string>
|
||||
<string name="vibration_profile_staccato">Стаккато</string>
|
||||
<string name="vibration_profile_short">Короткий</string>
|
||||
|
@ -266,7 +266,7 @@
|
||||
<string name="initializing">Spúšťanie</string>
|
||||
<string name="busy_task_fetch_activity_data">Načítavanie údajov o aktivite</string>
|
||||
<string name="sleep_activity_date_range">Od %1$s do %2$s</string>
|
||||
<string name="miband_prefs_wearside">Na ktorej ruke nosíte?</string>
|
||||
<string name="prefs_wearside">Na ktorej ruke nosíte?</string>
|
||||
<string name="pref_screen_vibration_profile">Profil vibrácií</string>
|
||||
|
||||
<string name="vibration_profile_staccato">Staccato</string>
|
||||
|
@ -134,7 +134,7 @@
|
||||
<string name="initializing">Ініціалізація</string>
|
||||
<string name="busy_task_fetch_activity_data">Отримання даних активності</string>
|
||||
<string name="sleep_activity_date_range">Від %1$s до %2$s</string>
|
||||
<string name="miband_prefs_wearside">На якій руці носите?</string>
|
||||
<string name="prefs_wearside">На якій руці носите?</string>
|
||||
<string name="pref_screen_vibration_profile">Профіль вібровідгуку</string>
|
||||
<string name="vibration_profile_staccato">Стакато</string>
|
||||
<string name="vibration_profile_short">Короткий</string>
|
||||
|
@ -79,7 +79,7 @@
|
||||
<string name="title_activity_sleepmonitor">Trình giám sát giấc ngủ</string>
|
||||
<string name="initializing">đang khởi chạy</string>
|
||||
<string name="sleep_activity_date_range">Từ %1$s đến %2$s</string>
|
||||
<string name="miband_prefs_wearside">Đeo bên trái hay phải?</string>
|
||||
<string name="prefs_wearside">Đeo bên trái hay phải?</string>
|
||||
<string name="vibration_profile_short">Ngắn</string>
|
||||
<string name="vibration_profile_medium">Trung bình</string>
|
||||
<string name="vibration_profile_long">Dài</string>
|
||||
|
@ -217,7 +217,7 @@
|
||||
<string name="initializing">初始化中</string>
|
||||
<string name="busy_task_fetch_activity_data">获取活动数据</string>
|
||||
<string name="sleep_activity_date_range">从 %1$s 到 %2$s</string>
|
||||
<string name="miband_prefs_wearside">佩戴在左手还是右手?</string>
|
||||
<string name="prefs_wearside">佩戴在左手还是右手?</string>
|
||||
<string name="vibration_profile_short">短</string>
|
||||
<string name="vibration_profile_medium">中</string>
|
||||
<string name="vibration_profile_long">长</string>
|
||||
@ -765,4 +765,7 @@
|
||||
<plurals name="widget_alarm_target_hours">
|
||||
<item quantity="other">%d 小时</item>
|
||||
</plurals>
|
||||
<string name="activity_error_no_app_for_gpx">若需要查看活动轨迹,请安装一个能查看 GPX 文件的应用。</string>
|
||||
<string name="preferences_makibes_hr3_settings">Makibes HR3 设置</string>
|
||||
<string name="devicetype_makibes_hr3">Makibes HR3</string>
|
||||
</resources>
|
@ -186,6 +186,8 @@
|
||||
<string name="pref_title_screentime">Screen on duration</string>
|
||||
<string name="prefs_title_all_day_heart_rate">All day heart rate measurement</string>
|
||||
<string name="preferences_hplus_settings">HPlus/Makibes settings</string>
|
||||
<!-- Makibes HR3 Preferences -->
|
||||
<string name="preferences_makibes_hr3_settings">Makibes HR3 settings</string>
|
||||
<!-- ID115 Preferences -->
|
||||
<string name="preferences_id115_settings">ID115 settings</string>
|
||||
<string name="prefs_screen_orientation">Screen orientation</string>
|
||||
@ -316,7 +318,7 @@
|
||||
<string name="initializing">Initializing</string>
|
||||
<string name="busy_task_fetch_activity_data">Fetching activity data</string>
|
||||
<string name="sleep_activity_date_range">From %1$s to %2$s</string>
|
||||
<string name="miband_prefs_wearside">Wearing left or right?</string>
|
||||
<string name="prefs_wearside">Wearing left or right?</string>
|
||||
<string name="pref_screen_vibration_profile">Vibration profile</string>
|
||||
<string name="vibration_profile_staccato">Staccato</string>
|
||||
<string name="vibration_profile_short">Short</string>
|
||||
@ -674,6 +676,7 @@
|
||||
<string name="devicetype_miscale2">Mi Scale 2</string>
|
||||
<string name="devicetype_bfh16">BFH-16</string>
|
||||
<string name="devicetype_mijia_lywsd02">Mijia Smart Clock</string>
|
||||
<string name="devicetype_makibes_hr3">Makibes HR3</string>
|
||||
<string name="choose_auto_export_location">Choose export location</string>
|
||||
<string name="notification_channel_name">Gadgetbridge notifications</string>
|
||||
<!-- Menus on the smart device -->
|
||||
|
12
app/src/main/res/xml/devicesettings_timeformat.xml
Normal file
12
app/src/main/res/xml/devicesettings_timeformat.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<ListPreference
|
||||
android:defaultValue="24h"
|
||||
android:entries="@array/pref_timeformat_entries"
|
||||
android:entryValues="@array/pref_timeformat_values"
|
||||
android:icon="@drawable/ic_access_time"
|
||||
android:key="timeformat"
|
||||
android:summary="%s"
|
||||
android:title="@string/pref_title_timeformat" />
|
||||
|
||||
</androidx.preference.PreferenceScreen>
|
@ -14,7 +14,7 @@
|
||||
android:entries="@array/wearside"
|
||||
android:entryValues="@array/wearside_values"
|
||||
android:key="mi_wearside"
|
||||
android:title="@string/miband_prefs_wearside"
|
||||
android:title="@string/prefs_wearside"
|
||||
android:summary="%s" />
|
||||
|
||||
<EditTextPreference
|
||||
|
@ -567,7 +567,7 @@
|
||||
android:entries="@array/wearside"
|
||||
android:entryValues="@array/wearside_values"
|
||||
android:key="hplus_wrist"
|
||||
android:title="@string/miband_prefs_wearside"
|
||||
android:title="@string/prefs_wearside"
|
||||
android:summary="%s" />
|
||||
|
||||
<ListPreference
|
||||
@ -592,6 +592,7 @@
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
<PreferenceScreen
|
||||
android:icon="@drawable/ic_device_h30_h10"
|
||||
android:key="pref_key_id115"
|
||||
@ -605,7 +606,7 @@
|
||||
android:entries="@array/wearside"
|
||||
android:entryValues="@array/wearside_values"
|
||||
android:key="id115_wrist"
|
||||
android:title="@string/miband_prefs_wearside"
|
||||
android:title="@string/prefs_wearside"
|
||||
android:summary="%s" />
|
||||
|
||||
<ListPreference
|
||||
|
@ -9,7 +9,7 @@
|
||||
android:entries="@array/wearside"
|
||||
android:entryValues="@array/wearside_values"
|
||||
android:key="zetime_wrist"
|
||||
android:title="@string/miband_prefs_wearside"
|
||||
android:title="@string/prefs_wearside"
|
||||
android:summary="%s" />
|
||||
<EditTextPreference
|
||||
android:inputType="number"
|
||||
|
Loading…
Reference in New Issue
Block a user