property : changedProperties.entrySet())
@@ -1564,7 +1564,7 @@ public class DaFitDeviceSupport extends AbstractBTLEDeviceSupport {
try {
TransactionBuilder builder = performInitialized("onSendWeather");
- DaFitWeatherToday weatherToday = new DaFitWeatherToday(weatherSpec);
+ MoyoungWeatherToday weatherToday = new MoyoungWeatherToday(weatherSpec);
ByteBuffer packetWeatherToday = ByteBuffer.allocate(weatherToday.pm25 != null ? 21 : 19);
packetWeatherToday.put(weatherToday.pm25 != null ? (byte)1 : (byte)0);
packetWeatherToday.put(weatherToday.conditionId);
@@ -1573,21 +1573,21 @@ public class DaFitDeviceSupport extends AbstractBTLEDeviceSupport {
packetWeatherToday.putShort(weatherToday.pm25);
packetWeatherToday.put(weatherToday.lunar_or_festival.getBytes("unicodebigunmarked"));
packetWeatherToday.put(weatherToday.city.getBytes("unicodebigunmarked"));
- sendPacket(builder, DaFitPacketOut.buildPacket(DaFitConstants.CMD_SET_WEATHER_TODAY, packetWeatherToday.array()));
+ sendPacket(builder, MoyoungPacketOut.buildPacket(MoyoungConstants.CMD_SET_WEATHER_TODAY, packetWeatherToday.array()));
ByteBuffer packetWeatherForecast = ByteBuffer.allocate(7 * 3);
for(int i = 0; i < 7; i++)
{
- DaFitWeatherForecast forecast;
+ MoyoungWeatherForecast forecast;
if (weatherSpec.forecasts.size() > i)
- forecast = new DaFitWeatherForecast(weatherSpec.forecasts.get(i));
+ forecast = new MoyoungWeatherForecast(weatherSpec.forecasts.get(i));
else
- forecast = new DaFitWeatherForecast(DaFitConstants.WEATHER_HAZE, (byte)-100, (byte)-100); // I don't think there is a way to send less (my watch shows only tomorrow anyway...)
+ forecast = new MoyoungWeatherForecast(MoyoungConstants.WEATHER_HAZE, (byte)-100, (byte)-100); // I don't think there is a way to send less (my watch shows only tomorrow anyway...)
packetWeatherForecast.put(forecast.conditionId);
packetWeatherForecast.put(forecast.minTemp);
packetWeatherForecast.put(forecast.maxTemp);
}
- sendPacket(builder, DaFitPacketOut.buildPacket(DaFitConstants.CMD_SET_WEATHER_FUTURE, packetWeatherForecast.array()));
+ sendPacket(builder, MoyoungPacketOut.buildPacket(MoyoungConstants.CMD_SET_WEATHER_FUTURE, packetWeatherForecast.array()));
builder.queue(getQueue());
} catch (IOException e) {
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/dafit/DaFitPacket.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/moyoung/MoyoungPacket.java
similarity index 89%
rename from app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/dafit/DaFitPacket.java
rename to app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/moyoung/MoyoungPacket.java
index 3550968b2..dda8ae912 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/dafit/DaFitPacket.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/moyoung/MoyoungPacket.java
@@ -14,9 +14,9 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see . */
-package nodomain.freeyourgadget.gadgetbridge.service.devices.dafit;
+package nodomain.freeyourgadget.gadgetbridge.service.devices.moyoung;
-public class DaFitPacket {
+public class MoyoungPacket {
protected byte[] packet;
protected int position = 0;
}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/dafit/DaFitPacketIn.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/moyoung/MoyoungPacketIn.java
similarity index 91%
rename from app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/dafit/DaFitPacketIn.java
rename to app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/moyoung/MoyoungPacketIn.java
index 9c60e6d1e..e3e93f900 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/dafit/DaFitPacketIn.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/moyoung/MoyoungPacketIn.java
@@ -14,9 +14,8 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see . */
-package nodomain.freeyourgadget.gadgetbridge.service.devices.dafit;
+package nodomain.freeyourgadget.gadgetbridge.service.devices.moyoung;
-import android.util.Log;
import android.util.Pair;
import androidx.annotation.NonNull;
@@ -33,8 +32,8 @@ import nodomain.freeyourgadget.gadgetbridge.Logging;
*
* {@code
* if(packetIn.putFragment(fragment)) {
- * Pair packet = DaFitPacketIn.parsePacket(packetIn.getPacket());
- * packetIn = new DaFitPacketIn();
+ * Pair packet = MoyoungPacketIn.parsePacket(packetIn.getPacket());
+ * packetIn = new MoyoungPacketIn();
* if (packet != null) {
* byte packetType = packet.first;
* byte[] payload = packet.second;
@@ -43,10 +42,10 @@ import nodomain.freeyourgadget.gadgetbridge.Logging;
* }
*
*/
-public class DaFitPacketIn extends DaFitPacket {
- private static final Logger LOG = LoggerFactory.getLogger(DaFitPacketIn.class);
+public class MoyoungPacketIn extends MoyoungPacket {
+ private static final Logger LOG = LoggerFactory.getLogger(MoyoungPacketIn.class);
- public DaFitPacketIn()
+ public MoyoungPacketIn()
{
}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/dafit/DaFitPacketOut.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/moyoung/MoyoungPacketOut.java
similarity index 88%
rename from app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/dafit/DaFitPacketOut.java
rename to app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/moyoung/MoyoungPacketOut.java
index a1c9b8bb2..18efef729 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/dafit/DaFitPacketOut.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/moyoung/MoyoungPacketOut.java
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see . */
-package nodomain.freeyourgadget.gadgetbridge.service.devices.dafit;
+package nodomain.freeyourgadget.gadgetbridge.service.devices.moyoung;
import androidx.annotation.NonNull;
@@ -24,15 +24,15 @@ import androidx.annotation.NonNull;
* Usage:
*
* {@code
- * DaFitPacketOut packetOut = new DaFitPacketOut(DaFitPacketOut.buildPacket(type, payload));
+ * MoyoungPacketOut packetOut = new MoyoungPacketOut(MoyoungPacketOut.buildPacket(type, payload));
* byte[] fragment = new byte[MTU];
* while(packetOut.getFragment(fragment))
* send(fragment);
* }
*
*/
-public class DaFitPacketOut extends DaFitPacket {
- public DaFitPacketOut(byte[] packet)
+public class MoyoungPacketOut extends MoyoungPacket {
+ public MoyoungPacketOut(byte[] packet)
{
this.packet = packet;
}
@@ -64,7 +64,7 @@ public class DaFitPacketOut extends DaFitPacket {
byte[] packet = new byte[payload.length + 5];
packet[0] = (byte)0xFE;
packet[1] = (byte)0xEA;
- if (DaFitDeviceSupport.MTU == 20)
+ if (MoyoungDeviceSupport.MTU == 20)
{
packet[2] = 16;
packet[3] = (byte)(packet.length & 0xFF);
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/dafit/QuerySettingsOperation.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/moyoung/QuerySettingsOperation.java
similarity index 76%
rename from app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/dafit/QuerySettingsOperation.java
rename to app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/moyoung/QuerySettingsOperation.java
index 35ecec657..5ac5e87c1 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/dafit/QuerySettingsOperation.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/moyoung/QuerySettingsOperation.java
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see . */
-package nodomain.freeyourgadget.gadgetbridge.service.devices.dafit;
+package nodomain.freeyourgadget.gadgetbridge.service.devices.moyoung;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
@@ -27,31 +27,31 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.UUID;
-import nodomain.freeyourgadget.gadgetbridge.devices.dafit.DaFitConstants;
-import nodomain.freeyourgadget.gadgetbridge.devices.dafit.DaFitDeviceCoordinator;
-import nodomain.freeyourgadget.gadgetbridge.devices.dafit.settings.DaFitSetting;
+import nodomain.freeyourgadget.gadgetbridge.devices.moyoung.MoyoungConstants;
+import nodomain.freeyourgadget.gadgetbridge.devices.moyoung.MoyoungDeviceCoordinator;
+import nodomain.freeyourgadget.gadgetbridge.devices.moyoung.settings.MoyoungSetting;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEOperation;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.devices.miband.operations.OperationStatus;
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
-public class QuerySettingsOperation extends AbstractBTLEOperation {
+public class QuerySettingsOperation extends AbstractBTLEOperation {
private static final Logger LOG = LoggerFactory.getLogger(QuerySettingsOperation.class);
- private final DaFitSetting[] settingsToQuery;
+ private final MoyoungSetting[] settingsToQuery;
private boolean[] received;
- private DaFitPacketIn packetIn = new DaFitPacketIn();
+ private MoyoungPacketIn packetIn = new MoyoungPacketIn();
- public QuerySettingsOperation(DaFitDeviceSupport support, DaFitSetting[] settingsToQuery) {
+ public QuerySettingsOperation(MoyoungDeviceSupport support, MoyoungSetting[] settingsToQuery) {
super(support);
this.settingsToQuery = settingsToQuery;
}
- public QuerySettingsOperation(DaFitDeviceSupport support) {
+ public QuerySettingsOperation(MoyoungDeviceSupport support) {
super(support);
- DaFitDeviceCoordinator coordinator = (DaFitDeviceCoordinator) DeviceHelper.getInstance().getCoordinator(getDevice());
+ MoyoungDeviceCoordinator coordinator = (MoyoungDeviceCoordinator) DeviceHelper.getInstance().getCoordinator(getDevice());
this.settingsToQuery = coordinator.getSupportedSettings();
}
@@ -65,12 +65,12 @@ public class QuerySettingsOperation extends AbstractBTLEOperation packet = DaFitPacketIn.parsePacket(packetIn.getPacket());
- packetIn = new DaFitPacketIn();
+ Pair packet = MoyoungPacketIn.parsePacket(packetIn.getPacket());
+ packetIn = new MoyoungPacketIn();
if (packet != null) {
byte packetType = packet.first;
byte[] payload = packet.second;
@@ -108,7 +108,7 @@ public class QuerySettingsOperation extends AbstractBTLEOperation. */
-package nodomain.freeyourgadget.gadgetbridge.service.devices.dafit;
+package nodomain.freeyourgadget.gadgetbridge.service.devices.moyoung;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
@@ -37,10 +37,10 @@ import nodomain.freeyourgadget.gadgetbridge.Logging;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.database.DBHandler;
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
-import nodomain.freeyourgadget.gadgetbridge.devices.dafit.DaFitConstants;
-import nodomain.freeyourgadget.gadgetbridge.devices.dafit.DaFitSampleProvider;
+import nodomain.freeyourgadget.gadgetbridge.devices.moyoung.MoyoungConstants;
+import nodomain.freeyourgadget.gadgetbridge.devices.moyoung.MoyoungSampleProvider;
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
-import nodomain.freeyourgadget.gadgetbridge.entities.DaFitActivitySample;
+import nodomain.freeyourgadget.gadgetbridge.entities.MoyoungActivitySample;
import nodomain.freeyourgadget.gadgetbridge.entities.User;
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEOperation;
@@ -48,7 +48,7 @@ import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.devices.miband.operations.OperationStatus;
import nodomain.freeyourgadget.gadgetbridge.util.GB;
-public class TrainingFinishedDataOperation extends AbstractBTLEOperation {
+public class TrainingFinishedDataOperation extends AbstractBTLEOperation {
private static final Logger LOG = LoggerFactory.getLogger(FetchDataOperation.class);
@@ -56,9 +56,9 @@ public class TrainingFinishedDataOperation extends AbstractBTLEOperation packet = DaFitPacketIn.parsePacket(packetIn.getPacket());
- packetIn = new DaFitPacketIn();
+ Pair packet = MoyoungPacketIn.parsePacket(packetIn.getPacket());
+ packetIn = new MoyoungPacketIn();
if (packet != null) {
byte packetType = packet.first;
byte[] payload = packet.second;
@@ -106,11 +106,11 @@ public class TrainingFinishedDataOperation extends AbstractBTLEOperation 1)
+ if (sequenceType == MoyoungConstants.ARG_TRANSMISSION_LAST && payload.length > 1)
throw new IllegalArgumentException("Last packet shouldn't have any data");
data.write(payload, 1, payload.length - 1);
- if (sequenceType != DaFitConstants.ARG_TRANSMISSION_LAST)
+ if (sequenceType != MoyoungConstants.ARG_TRANSMISSION_LAST)
queryMoreData();
else
processAllData();
@@ -137,7 +137,7 @@ public class TrainingFinishedDataOperation extends AbstractBTLEOperationru_RU
-
+
- Watch face 1
- Watch face 2
- Watch face 3
-
+
- 1
- 2
- 3
-
+
- Chinese edition
- International edition
-
+
- 0
- 1
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 494d79fca..964f57fd1 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1821,7 +1821,6 @@
Mijia Temperature and Humidity Sensor 2
Mijia Temperature and Humidity Sensor 2 (E-ink)
Mijia MHO-C303
- Da Fit
Makibes HR3
Bangle.js
TLW64
diff --git a/app/src/main/res/xml/devicesettings_dafit_device_version.xml b/app/src/main/res/xml/devicesettings_moyoung_device_version.xml
similarity index 63%
rename from app/src/main/res/xml/devicesettings_dafit_device_version.xml
rename to app/src/main/res/xml/devicesettings_moyoung_device_version.xml
index b50f003ad..96db58259 100644
--- a/app/src/main/res/xml/devicesettings_dafit_device_version.xml
+++ b/app/src/main/res/xml/devicesettings_moyoung_device_version.xml
@@ -2,9 +2,9 @@
diff --git a/app/src/main/res/xml/devicesettings_dafit_language.xml b/app/src/main/res/xml/devicesettings_moyoung_language.xml
similarity index 90%
rename from app/src/main/res/xml/devicesettings_dafit_language.xml
rename to app/src/main/res/xml/devicesettings_moyoung_language.xml
index 6eda64262..e4c18b756 100644
--- a/app/src/main/res/xml/devicesettings_dafit_language.xml
+++ b/app/src/main/res/xml/devicesettings_moyoung_language.xml
@@ -3,7 +3,7 @@
\ No newline at end of file
diff --git a/app/src/main/res/xml/devicesettings_dafit_sedentary_reminder.xml b/app/src/main/res/xml/devicesettings_moyoung_sedentary_reminder.xml
similarity index 100%
rename from app/src/main/res/xml/devicesettings_dafit_sedentary_reminder.xml
rename to app/src/main/res/xml/devicesettings_moyoung_sedentary_reminder.xml
diff --git a/app/src/main/res/xml/devicesettings_dafit_watchface.xml b/app/src/main/res/xml/devicesettings_moyoung_watchface.xml
similarity index 68%
rename from app/src/main/res/xml/devicesettings_dafit_watchface.xml
rename to app/src/main/res/xml/devicesettings_moyoung_watchface.xml
index 731e0d49e..6b8879080 100644
--- a/app/src/main/res/xml/devicesettings_dafit_watchface.xml
+++ b/app/src/main/res/xml/devicesettings_moyoung_watchface.xml
@@ -3,9 +3,9 @@