Withings Steel HR: Request MTU before enabling notifications

It looks like enabling notifications before setting the MTU will
sometimes fail, which would leave the device stuck initializing.
This commit is contained in:
José Rebelo
2025-10-18 22:53:59 +01:00
parent 85b982a1a3
commit d42466c663
@@ -184,9 +184,8 @@ public class WithingsSteelHRDeviceSupport extends AbstractBTLESingleDeviceSuppor
builder.setDeviceState(GBDevice.State.INITIALIZING);
getDevice().setFirmwareVersion("N/A");
getDevice().setFirmwareVersion2("N/A");
builder.requestMtu(512);
builder.notify(WithingsUUID.WITHINGS_WRITE_CHARACTERISTIC_UUID, true);
logger.debug("Requesting change of MTU...");
builder.requestMtu(119);
return builder;
}
@@ -203,7 +202,7 @@ public class WithingsSteelHRDeviceSupport extends AbstractBTLESingleDeviceSuppor
return;
}
logger.debug("MTU has changed to " + mtu);
logger.debug("MTU has changed to {}", mtu);
mtuSize = mtu;
if (firstTimeConnect) {
addSimpleConversationToQueue(new WithingsMessage(WithingsMessageType.INITIAL_CONNECT));