Skip to content

Commit

Permalink
Tested and ready
Browse files Browse the repository at this point in the history
  • Loading branch information
niccellular committed Oct 25, 2023
1 parent 4f5cc1f commit ede8b77
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ public enum ServiceConnectionState {
public static final String STATE_CONNECTED = "CONNECTED";
public static final String STATE_DISCONNECTED = "DISCONNECTED";
public static final String STATE_DEVICE_SLEEP = "DEVICE_SLEEP";

public static boolean deviceConnected = false;
public static MeshtasticWidget mw;
private MeshtasticReceiver mr;
public static List<byte[]> divideArray(byte[] source, int chunksize) {
Expand All @@ -115,7 +113,7 @@ public static List<byte[]> divideArray(byte[] source, int chunksize) {
@Override
public void processCotEvent(CotEvent cotEvent, String[] strings) {

if (mConnectionState == ServiceConnectionState.DISCONNECTED || deviceConnected == false)
if (mConnectionState == ServiceConnectionState.DISCONNECTED)
return;

Log.d(TAG, cotEvent.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public void onReceive(Context context, Intent intent) {
} catch (RemoteException e) {
e.printStackTrace();
}
} else {
MeshtasticMapComponent.mConnectionState = MeshtasticMapComponent.ServiceConnectionState.DISCONNECTED;
MeshtasticMapComponent.mw.setIcon("red");
}
}
else if (action.equals(MeshtasticMapComponent.ACTION_MESH_DISCONNECTED)) {
Expand All @@ -50,14 +53,6 @@ else if (action.equals(MeshtasticMapComponent.ACTION_MESH_DISCONNECTED)) {
MeshtasticMapComponent.mw.setIcon("red");
}
}
else if (action.equals(MeshtasticMapComponent.STATE_DISCONNECTED)) {
MeshtasticMapComponent.mw.setIcon("red");
MeshtasticMapComponent.deviceConnected = false;
}
else if (action.equals(MeshtasticMapComponent.STATE_CONNECTED)) {
MeshtasticMapComponent.mw.setIcon("green");
MeshtasticMapComponent.deviceConnected = true;
}
else if (action.equals(MeshtasticMapComponent.ACTION_MESSAGE_STATUS)) {
int id = intent.getIntExtra(MeshtasticMapComponent.EXTRA_PACKET_ID, 0);
MessageStatus status = intent.getParcelableExtra(MeshtasticMapComponent.EXTRA_STATUS);
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.8.0'
ext.kotlin_version = '1.6.0'
repositories {
google()
mavenCentral()
Expand Down

0 comments on commit ede8b77

Please sign in to comment.