try to catch bad devicenames
This commit is contained in:
parent
786a91f7e1
commit
5465e8f5aa
3 changed files with 9 additions and 1 deletions
|
@ -68,6 +68,7 @@ public class Notification {
|
||||||
public static final int NSMALFUNCTION = 40;
|
public static final int NSMALFUNCTION = 40;
|
||||||
public static final int NEWVERSIONDETECTED = 41;
|
public static final int NEWVERSIONDETECTED = 41;
|
||||||
public static final int SENDLOGFILES = 42;
|
public static final int SENDLOGFILES = 42;
|
||||||
|
public static final int DEVICENOTPAIRED = 43;
|
||||||
|
|
||||||
|
|
||||||
public int id;
|
public int id;
|
||||||
|
|
|
@ -662,7 +662,13 @@ public class BLEComm {
|
||||||
|
|
||||||
private void SendPumpCheck() {
|
private void SendPumpCheck() {
|
||||||
// 1st message sent to pump after connect
|
// 1st message sent to pump after connect
|
||||||
byte[] bytes = BleCommandUtil.getInstance().getEncryptedPacket(BleCommandUtil.DANAR_PACKET__OPCODE_ENCRYPTION__PUMP_CHECK, null, getConnectDeviceName());
|
String devicename = getConnectDeviceName();
|
||||||
|
if(devicename == null || devicename == ""){
|
||||||
|
Notification n = new Notification(Notification.DEVICENOTPAIRED, MainApp.gs(R.string.pairfirst), Notification.URGENT);
|
||||||
|
MainApp.bus().post(new EventNewNotification(n));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
byte[] bytes = BleCommandUtil.getInstance().getEncryptedPacket(BleCommandUtil.DANAR_PACKET__OPCODE_ENCRYPTION__PUMP_CHECK, null, devicename);
|
||||||
if (L.isEnabled(L.PUMPBTCOMM))
|
if (L.isEnabled(L.PUMPBTCOMM))
|
||||||
log.debug(">>>>> " + "ENCRYPTION__PUMP_CHECK (0x00)" + " " + DanaRS_Packet.toHexString(bytes));
|
log.debug(">>>>> " + "ENCRYPTION__PUMP_CHECK (0x00)" + " " + DanaRS_Packet.toHexString(bytes));
|
||||||
writeCharacteristic_NO_RESPONSE(getUARTWriteBTGattChar(), bytes);
|
writeCharacteristic_NO_RESPONSE(getUARTWriteBTGattChar(), bytes);
|
||||||
|
|
|
@ -1209,6 +1209,7 @@
|
||||||
<string name="loop_openmode_min_change">Minimal request change [%]</string>
|
<string name="loop_openmode_min_change">Minimal request change [%]</string>
|
||||||
<string name="loop_openmode_min_change_summary">Loop will popup new change request only if change is bigger than this value. Default value is 20%</string>
|
<string name="loop_openmode_min_change_summary">Loop will popup new change request only if change is bigger than this value. Default value is 20%</string>
|
||||||
<string name="key_short_tabtitles" translatable="false">short_tabtitles</string>
|
<string name="key_short_tabtitles" translatable="false">short_tabtitles</string>
|
||||||
|
<string name="pairfirst">Please pair your pump with your phone!</string>
|
||||||
|
|
||||||
<plurals name="objective_days">
|
<plurals name="objective_days">
|
||||||
<item quantity="one">%1$d day</item>
|
<item quantity="one">%1$d day</item>
|
||||||
|
|
Loading…
Reference in a new issue