package b4a.bbb;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.pc.*;

public class main_subs_0 {


public static RemoteObject  _activity_create(RemoteObject _firsttime) throws Exception{
try {
		Debug.PushSubsStack("Activity_Create (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,43);
if (RapidSub.canDelegate("activity_create")) { return b4a.bbb.main.remoteMe.runUserSub(false, "main","activity_create", _firsttime);}
Debug.locals.put("FirstTime", _firsttime);
 BA.debugLineNum = 43;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
Debug.ShouldStop(1024);
 BA.debugLineNum = 45;BA.debugLine="Activity.LoadLayout(\"1\")";
Debug.ShouldStop(4096);
main.mostCurrent._activity.runMethodAndSync(false,"LoadLayout",(Object)(RemoteObject.createImmutable("1")),main.mostCurrent.activityBA);
 BA.debugLineNum = 48;BA.debugLine="StartService(Collecte_data_sensor)";
Debug.ShouldStop(32768);
main.mostCurrent.__c.runVoidMethod ("StartService",main.processBA,(Object)((main.mostCurrent._collecte_data_sensor.getObject())));
 BA.debugLineNum = 49;BA.debugLine="StartActivity(Cockpit)";
Debug.ShouldStop(65536);
main.mostCurrent.__c.runVoidMethod ("StartActivity",main.processBA,(Object)((main.mostCurrent._cockpit.getObject())));
 BA.debugLineNum = 51;BA.debugLine="End Sub";
Debug.ShouldStop(262144);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _activity_pause(RemoteObject _userclosed) throws Exception{
try {
		Debug.PushSubsStack("Activity_Pause (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,75);
if (RapidSub.canDelegate("activity_pause")) { return b4a.bbb.main.remoteMe.runUserSub(false, "main","activity_pause", _userclosed);}
Debug.locals.put("UserClosed", _userclosed);
 BA.debugLineNum = 75;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
Debug.ShouldStop(1024);
 BA.debugLineNum = 77;BA.debugLine="End Sub";
Debug.ShouldStop(4096);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _activity_resume() throws Exception{
try {
		Debug.PushSubsStack("Activity_Resume (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,53);
if (RapidSub.canDelegate("activity_resume")) { return b4a.bbb.main.remoteMe.runUserSub(false, "main","activity_resume");}
 BA.debugLineNum = 53;BA.debugLine="Sub Activity_Resume";
Debug.ShouldStop(1048576);
 BA.debugLineNum = 55;BA.debugLine="StateChanged";
Debug.ShouldStop(4194304);
_statechanged();
 BA.debugLineNum = 56;BA.debugLine="End Sub";
Debug.ShouldStop(8388608);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _bntlevelbattery_click() throws Exception{
try {
		Debug.PushSubsStack("bntlevelBattery_Click (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,182);
if (RapidSub.canDelegate("bntlevelbattery_click")) { return b4a.bbb.main.remoteMe.runUserSub(false, "main","bntlevelbattery_click");}
 BA.debugLineNum = 182;BA.debugLine="Sub bntlevelBattery_Click";
Debug.ShouldStop(2097152);
 BA.debugLineNum = 183;BA.debugLine="Starter.manager.ReadData2(service_battery,Level_b";
Debug.ShouldStop(4194304);
main.mostCurrent._starter._manager /*RemoteObject*/ .runVoidMethod ("ReadData2",(Object)(main.mostCurrent._service_battery),(Object)(main.mostCurrent._level_battery));
 BA.debugLineNum = 184;BA.debugLine="End Sub";
Debug.ShouldStop(8388608);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _bntreadservice_click() throws Exception{
try {
		Debug.PushSubsStack("bntReadService_Click (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,175);
if (RapidSub.canDelegate("bntreadservice_click")) { return b4a.bbb.main.remoteMe.runUserSub(false, "main","bntreadservice_click");}
 BA.debugLineNum = 175;BA.debugLine="Sub bntReadService_Click";
Debug.ShouldStop(16384);
 BA.debugLineNum = 176;BA.debugLine="pbReadData.Visible = True";
Debug.ShouldStop(32768);
main.mostCurrent._pbreaddata.runMethod(true,"setVisible",main.mostCurrent.__c.getField(true,"True"));
 BA.debugLineNum = 177;BA.debugLine="clv.Clear";
Debug.ShouldStop(65536);
main.mostCurrent._clv.runVoidMethod ("_clear");
 BA.debugLineNum = 178;BA.debugLine="Starter.manager.SetNotify(service_Temperature,Tem";
Debug.ShouldStop(131072);
main.mostCurrent._starter._manager /*RemoteObject*/ .runVoidMethod ("SetNotify",(Object)(main.mostCurrent._service_temperature),(Object)(main.mostCurrent._temperature),(Object)(main.mostCurrent.__c.getField(true,"True")));
 BA.debugLineNum = 180;BA.debugLine="End Sub";
Debug.ShouldStop(524288);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _btndisconnect_click() throws Exception{
try {
		Debug.PushSubsStack("btnDisconnect_Click (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,120);
if (RapidSub.canDelegate("btndisconnect_click")) { return b4a.bbb.main.remoteMe.runUserSub(false, "main","btndisconnect_click");}
 BA.debugLineNum = 120;BA.debugLine="Sub btnDisconnect_Click";
Debug.ShouldStop(8388608);
 BA.debugLineNum = 121;BA.debugLine="CallSub(Starter, \"Disconnect\")";
Debug.ShouldStop(16777216);
main.mostCurrent.__c.runMethodAndSync(false,"CallSubNew",main.processBA,(Object)((main.mostCurrent._starter.getObject())),(Object)(RemoteObject.createImmutable("Disconnect")));
 BA.debugLineNum = 122;BA.debugLine="End Sub";
Debug.ShouldStop(33554432);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _btnreaddata_click() throws Exception{
try {
		Debug.PushSubsStack("btnReadData_Click (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,124);
if (RapidSub.canDelegate("btnreaddata_click")) { return b4a.bbb.main.remoteMe.runUserSub(false, "main","btnreaddata_click");}
 BA.debugLineNum = 124;BA.debugLine="Sub btnReadData_Click";
Debug.ShouldStop(134217728);
 BA.debugLineNum = 125;BA.debugLine="pbReadData.Visible = True";
Debug.ShouldStop(268435456);
main.mostCurrent._pbreaddata.runMethod(true,"setVisible",main.mostCurrent.__c.getField(true,"True"));
 BA.debugLineNum = 126;BA.debugLine="clv.Clear";
Debug.ShouldStop(536870912);
main.mostCurrent._clv.runVoidMethod ("_clear");
 BA.debugLineNum = 127;BA.debugLine="CallSub(Starter, \"ReadData\")";
Debug.ShouldStop(1073741824);
main.mostCurrent.__c.runMethodAndSync(false,"CallSubNew",main.processBA,(Object)((main.mostCurrent._starter.getObject())),(Object)(RemoteObject.createImmutable("ReadData")));
 BA.debugLineNum = 129;BA.debugLine="End Sub";
Debug.ShouldStop(1);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static void  _btnscan_click() throws Exception{
try {
		Debug.PushSubsStack("btnScan_Click (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,79);
if (RapidSub.canDelegate("btnscan_click")) { b4a.bbb.main.remoteMe.runUserSub(false, "main","btnscan_click"); return;}
ResumableSub_btnScan_Click rsub = new ResumableSub_btnScan_Click(null);
rsub.resume(null, null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static class ResumableSub_btnScan_Click extends BA.ResumableSub {
public ResumableSub_btnScan_Click(b4a.bbb.main parent) {
this.parent = parent;
}
java.util.LinkedHashMap<String, Object> rsLocals = new java.util.LinkedHashMap<String, Object>();
b4a.bbb.main parent;
RemoteObject _permission = RemoteObject.createImmutable("");
RemoteObject _result = RemoteObject.createImmutable(false);

@Override
public void resume(BA ba, RemoteObject result) throws Exception{
try {
		Debug.PushSubsStack("btnScan_Click (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,79);
Debug.locals = rsLocals;Debug.currentSubFrame.locals = rsLocals;

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 BA.debugLineNum = 80;BA.debugLine="Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_";
Debug.ShouldStop(32768);
parent.mostCurrent._starter._rp /*RemoteObject*/ .runVoidMethod ("CheckAndRequest",main.processBA,(Object)(parent.mostCurrent._starter._rp /*RemoteObject*/ .getField(true,"PERMISSION_ACCESS_COARSE_LOCATION")));
 BA.debugLineNum = 81;BA.debugLine="Wait For Activity_PermissionResult (Permission As";
Debug.ShouldStop(65536);
parent.mostCurrent.__c.runVoidMethod ("WaitFor","activity_permissionresult", main.processBA, anywheresoftware.b4a.pc.PCResumableSub.createDebugResumeSub(this, "main", "btnscan_click"), null);
this.state = 7;
return;
case 7:
//C
this.state = 1;
_permission = (RemoteObject) result.getArrayElement(true,RemoteObject.createImmutable(0));Debug.locals.put("Permission", _permission);
_result = (RemoteObject) result.getArrayElement(true,RemoteObject.createImmutable(1));Debug.locals.put("Result", _result);
;
 BA.debugLineNum = 82;BA.debugLine="If Result = False Then Return";
Debug.ShouldStop(131072);
if (true) break;

case 1:
//if
this.state = 6;
if (RemoteObject.solveBoolean("=",_result,parent.mostCurrent.__c.getField(true,"False"))) { 
this.state = 3;
;}if (true) break;

case 3:
//C
this.state = 6;
if (true) return ;
if (true) break;

case 6:
//C
this.state = -1;
;
 BA.debugLineNum = 83;BA.debugLine="pbScan.Visible = True";
Debug.ShouldStop(262144);
parent.mostCurrent._pbscan.runMethod(true,"setVisible",parent.mostCurrent.__c.getField(true,"True"));
 BA.debugLineNum = 84;BA.debugLine="CallSub(Starter, \"StartScan\")";
Debug.ShouldStop(524288);
parent.mostCurrent.__c.runMethodAndSync(false,"CallSubNew",main.processBA,(Object)((parent.mostCurrent._starter.getObject())),(Object)(RemoteObject.createImmutable("StartScan")));
 BA.debugLineNum = 85;BA.debugLine="End Sub";
Debug.ShouldStop(1048576);
if (true) break;

            }
        }
    }
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
}
public static void  _activity_permissionresult(RemoteObject _permission,RemoteObject _result) throws Exception{
}
public static RemoteObject  _createcharacteristicitem(RemoteObject _id,RemoteObject _data) throws Exception{
try {
		Debug.PushSubsStack("CreateCharacteristicItem (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,145);
if (RapidSub.canDelegate("createcharacteristicitem")) { return b4a.bbb.main.remoteMe.runUserSub(false, "main","createcharacteristicitem", _id, _data);}
RemoteObject _pnl = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper");
RemoteObject _lbl = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper");
RemoteObject _lbl2 = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper");
Debug.locals.put("Id", _id);
Debug.locals.put("Data", _data);
 BA.debugLineNum = 145;BA.debugLine="Sub CreateCharacteristicItem(Id As String, Data()";
Debug.ShouldStop(65536);
 BA.debugLineNum = 146;BA.debugLine="Dim pnl As Panel";
Debug.ShouldStop(131072);
_pnl = RemoteObject.createNew ("anywheresoftware.b4a.objects.PanelWrapper");Debug.locals.put("pnl", _pnl);
 BA.debugLineNum = 147;BA.debugLine="pnl.Initialize(\"\")";
Debug.ShouldStop(262144);
_pnl.runVoidMethod ("Initialize",main.mostCurrent.activityBA,(Object)(RemoteObject.createImmutable("")));
 BA.debugLineNum = 148;BA.debugLine="pnl.SetLayoutAnimated(0, 0, 0, clv.AsView.Width,";
Debug.ShouldStop(524288);
_pnl.runVoidMethod ("SetLayoutAnimated",(Object)(BA.numberCast(int.class, 0)),(Object)(BA.numberCast(int.class, 0)),(Object)(BA.numberCast(int.class, 0)),(Object)(main.mostCurrent._clv.runMethod(false,"_asview").runMethod(true,"getWidth")),(Object)(main.mostCurrent.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 40)))));
 BA.debugLineNum = 149;BA.debugLine="pnl.Color = Colors.White";
Debug.ShouldStop(1048576);
_pnl.runVoidMethod ("setColor",main.mostCurrent.__c.getField(false,"Colors").getField(true,"White"));
 BA.debugLineNum = 150;BA.debugLine="Dim lbl As Label";
Debug.ShouldStop(2097152);
_lbl = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");Debug.locals.put("lbl", _lbl);
 BA.debugLineNum = 151;BA.debugLine="lbl.Initialize(\"\")";
Debug.ShouldStop(4194304);
_lbl.runVoidMethod ("Initialize",main.mostCurrent.activityBA,(Object)(RemoteObject.createImmutable("")));
 BA.debugLineNum = 152;BA.debugLine="lbl.Text = Id";
Debug.ShouldStop(8388608);
_lbl.runMethod(true,"setText",BA.ObjectToCharSequence(_id));
 BA.debugLineNum = 153;BA.debugLine="pnl.AddView(lbl, 0, 0, clv.AsView.Width, 20dip)";
Debug.ShouldStop(16777216);
_pnl.runVoidMethod ("AddView",(Object)((_lbl.getObject())),(Object)(BA.numberCast(int.class, 0)),(Object)(BA.numberCast(int.class, 0)),(Object)(main.mostCurrent._clv.runMethod(false,"_asview").runMethod(true,"getWidth")),(Object)(main.mostCurrent.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 20)))));
 BA.debugLineNum = 154;BA.debugLine="Dim lbl2 As Label";
Debug.ShouldStop(33554432);
_lbl2 = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");Debug.locals.put("lbl2", _lbl2);
 BA.debugLineNum = 155;BA.debugLine="lbl2.Initialize(\"\")";
Debug.ShouldStop(67108864);
_lbl2.runVoidMethod ("Initialize",main.mostCurrent.activityBA,(Object)(RemoteObject.createImmutable("")));
 BA.debugLineNum = 156;BA.debugLine="Try";
Debug.ShouldStop(134217728);
try { BA.debugLineNum = 157;BA.debugLine="If Id=Level_battery Then";
Debug.ShouldStop(268435456);
if (RemoteObject.solveBoolean("=",_id,main.mostCurrent._level_battery)) { 
 BA.debugLineNum = 158;BA.debugLine="lbl2.Text = \"Level Battery : \" & Data(0) & \"%\"";
Debug.ShouldStop(536870912);
_lbl2.runMethod(true,"setText",BA.ObjectToCharSequence(RemoteObject.concat(RemoteObject.createImmutable("Level Battery : "),_data.getArrayElement(true,BA.numberCast(int.class, 0)),RemoteObject.createImmutable("%"))));
 }else {
 BA.debugLineNum = 160;BA.debugLine="lbl2.Text = BytesToString(Data, 0, Data.Length,";
Debug.ShouldStop(-2147483648);
_lbl2.runMethod(true,"setText",BA.ObjectToCharSequence(main.mostCurrent.__c.runMethod(true,"BytesToString",(Object)(_data),(Object)(BA.numberCast(int.class, 0)),(Object)(_data.getField(true,"length")),(Object)(RemoteObject.createImmutable("UTF8")))));
 };
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e18) {
			BA.rdebugUtils.runVoidMethod("setLastException",main.processBA, e18.toString()); BA.debugLineNum = 164;BA.debugLine="Log(LastException)";
Debug.ShouldStop(8);
main.mostCurrent.__c.runVoidMethod ("LogImpl","6786451",BA.ObjectToString(main.mostCurrent.__c.runMethod(false,"LastException",main.mostCurrent.activityBA)),0);
 BA.debugLineNum = 165;BA.debugLine="lbl2.Text = \"Error reading data as string\"";
Debug.ShouldStop(16);
_lbl2.runMethod(true,"setText",BA.ObjectToCharSequence("Error reading data as string"));
 };
 BA.debugLineNum = 167;BA.debugLine="lbl2.TextColor = 0xFF909090";
Debug.ShouldStop(64);
_lbl2.runMethod(true,"setTextColor",BA.numberCast(int.class, 0xff909090));
 BA.debugLineNum = 168;BA.debugLine="lbl2.TextSize = 14";
Debug.ShouldStop(128);
_lbl2.runMethod(true,"setTextSize",BA.numberCast(float.class, 14));
 BA.debugLineNum = 169;BA.debugLine="pnl.AddView(lbl2, 0, 20dip, clv.AsView.Width, 20d";
Debug.ShouldStop(256);
_pnl.runVoidMethod ("AddView",(Object)((_lbl2.getObject())),(Object)(BA.numberCast(int.class, 0)),(Object)(main.mostCurrent.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 20)))),(Object)(main.mostCurrent._clv.runMethod(false,"_asview").runMethod(true,"getWidth")),(Object)(main.mostCurrent.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 20)))));
 BA.debugLineNum = 170;BA.debugLine="Return pnl";
Debug.ShouldStop(512);
if (true) return _pnl;
 BA.debugLineNum = 171;BA.debugLine="End Sub";
Debug.ShouldStop(1024);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _createserviceitem(RemoteObject _service) throws Exception{
try {
		Debug.PushSubsStack("CreateServiceItem (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,131);
if (RapidSub.canDelegate("createserviceitem")) { return b4a.bbb.main.remoteMe.runUserSub(false, "main","createserviceitem", _service);}
RemoteObject _pnl = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper");
RemoteObject _lbl = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper");
Debug.locals.put("service", _service);
 BA.debugLineNum = 131;BA.debugLine="Sub CreateServiceItem (service As String) As Panel";
Debug.ShouldStop(4);
 BA.debugLineNum = 132;BA.debugLine="Dim pnl As Panel";
Debug.ShouldStop(8);
_pnl = RemoteObject.createNew ("anywheresoftware.b4a.objects.PanelWrapper");Debug.locals.put("pnl", _pnl);
 BA.debugLineNum = 133;BA.debugLine="pnl.Initialize(\"\")";
Debug.ShouldStop(16);
_pnl.runVoidMethod ("Initialize",main.mostCurrent.activityBA,(Object)(RemoteObject.createImmutable("")));
 BA.debugLineNum = 134;BA.debugLine="pnl.Color = 0xFF808080";
Debug.ShouldStop(32);
_pnl.runVoidMethod ("setColor",BA.numberCast(int.class, 0xff808080));
 BA.debugLineNum = 135;BA.debugLine="pnl.SetLayoutAnimated(0, 0, 0, clv.AsView.Width,";
Debug.ShouldStop(64);
_pnl.runVoidMethod ("SetLayoutAnimated",(Object)(BA.numberCast(int.class, 0)),(Object)(BA.numberCast(int.class, 0)),(Object)(BA.numberCast(int.class, 0)),(Object)(main.mostCurrent._clv.runMethod(false,"_asview").runMethod(true,"getWidth")),(Object)(main.mostCurrent.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 30)))));
 BA.debugLineNum = 136;BA.debugLine="Dim lbl As Label";
Debug.ShouldStop(128);
_lbl = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");Debug.locals.put("lbl", _lbl);
 BA.debugLineNum = 137;BA.debugLine="lbl.Initialize(\"\")";
Debug.ShouldStop(256);
_lbl.runVoidMethod ("Initialize",main.mostCurrent.activityBA,(Object)(RemoteObject.createImmutable("")));
 BA.debugLineNum = 138;BA.debugLine="lbl.Text = service";
Debug.ShouldStop(512);
_lbl.runMethod(true,"setText",BA.ObjectToCharSequence(_service));
 BA.debugLineNum = 139;BA.debugLine="lbl.Gravity = Gravity.CENTER";
Debug.ShouldStop(1024);
_lbl.runMethod(true,"setGravity",main.mostCurrent.__c.getField(false,"Gravity").getField(true,"CENTER"));
 BA.debugLineNum = 140;BA.debugLine="lbl.Typeface = Typeface.DEFAULT_BOLD";
Debug.ShouldStop(2048);
_lbl.runMethod(false,"setTypeface",main.mostCurrent.__c.getField(false,"Typeface").getField(false,"DEFAULT_BOLD"));
 BA.debugLineNum = 141;BA.debugLine="pnl.AddView(lbl, 0, 0, clv.AsView.Width, 30dip)";
Debug.ShouldStop(4096);
_pnl.runVoidMethod ("AddView",(Object)((_lbl.getObject())),(Object)(BA.numberCast(int.class, 0)),(Object)(BA.numberCast(int.class, 0)),(Object)(main.mostCurrent._clv.runMethod(false,"_asview").runMethod(true,"getWidth")),(Object)(main.mostCurrent.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 30)))));
 BA.debugLineNum = 142;BA.debugLine="Return pnl";
Debug.ShouldStop(8192);
if (true) return _pnl;
 BA.debugLineNum = 143;BA.debugLine="End Sub";
Debug.ShouldStop(16384);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _dataavailable(RemoteObject _service,RemoteObject _characteristics) throws Exception{
try {
		Debug.PushSubsStack("DataAvailable (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,87);
if (RapidSub.canDelegate("dataavailable")) { return b4a.bbb.main.remoteMe.runUserSub(false, "main","dataavailable", _service, _characteristics);}
RemoteObject _id = RemoteObject.createImmutable("");
RemoteObject _value = null;
RemoteObject _c = RemoteObject.createImmutable("");
Debug.locals.put("Service", _service);
Debug.locals.put("Characteristics", _characteristics);
 BA.debugLineNum = 87;BA.debugLine="Sub DataAvailable (Service As String, Characterist";
Debug.ShouldStop(4194304);
 BA.debugLineNum = 88;BA.debugLine="pbReadData.Visible = False";
Debug.ShouldStop(8388608);
main.mostCurrent._pbreaddata.runMethod(true,"setVisible",main.mostCurrent.__c.getField(true,"False"));
 BA.debugLineNum = 89;BA.debugLine="clv.Add(CreateServiceItem(Service), \"\")";
Debug.ShouldStop(16777216);
main.mostCurrent._clv.runVoidMethod ("_add",RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.B4XViewWrapper"), _createserviceitem(_service).getObject()),(Object)((RemoteObject.createImmutable(""))));
 BA.debugLineNum = 90;BA.debugLine="For Each id As String In Characteristics.Keys";
Debug.ShouldStop(33554432);
{
final RemoteObject group3 = _characteristics.runMethod(false,"Keys");
final int groupLen3 = group3.runMethod(true,"getSize").<Integer>get()
;int index3 = 0;
;
for (; index3 < groupLen3;index3++){
_id = BA.ObjectToString(group3.runMethod(false,"Get",index3));Debug.locals.put("id", _id);
Debug.locals.put("id", _id);
 BA.debugLineNum = 92;BA.debugLine="If Service=service_battery Then";
Debug.ShouldStop(134217728);
if (RemoteObject.solveBoolean("=",_service,main.mostCurrent._service_battery)) { 
 BA.debugLineNum = 93;BA.debugLine="Dim value() As Byte=Characteristics.Get(id)";
Debug.ShouldStop(268435456);
_value = (_characteristics.runMethod(false,"Get",(Object)((_id))));Debug.locals.put("value", _value);Debug.locals.put("value", _value);
 BA.debugLineNum = 94;BA.debugLine="clv.Add(CreateCharacteristicItem(id, value), \"\"";
Debug.ShouldStop(536870912);
main.mostCurrent._clv.runVoidMethod ("_add",RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.B4XViewWrapper"), _createcharacteristicitem(_id,_value).getObject()),(Object)((RemoteObject.createImmutable(""))));
 BA.debugLineNum = 95;BA.debugLine="Log(\"Level Battery : \" & value(0) & \"%\")";
Debug.ShouldStop(1073741824);
main.mostCurrent.__c.runVoidMethod ("LogImpl","6458760",RemoteObject.concat(RemoteObject.createImmutable("Level Battery : "),_value.getArrayElement(true,BA.numberCast(int.class, 0)),RemoteObject.createImmutable("%")),0);
 };
 BA.debugLineNum = 97;BA.debugLine="clv.Add(CreateCharacteristicItem(id, Characteris";
Debug.ShouldStop(1);
main.mostCurrent._clv.runVoidMethod ("_add",RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.B4XViewWrapper"), _createcharacteristicitem(_id,(_characteristics.runMethod(false,"Get",(Object)((_id))))).getObject()),(Object)((RemoteObject.createImmutable(""))));
 BA.debugLineNum = 101;BA.debugLine="Log(Service)";
Debug.ShouldStop(16);
main.mostCurrent.__c.runVoidMethod ("LogImpl","6458766",_service,0);
 BA.debugLineNum = 102;BA.debugLine="Log(id & \";\" & Characteristics.Get(id))";
Debug.ShouldStop(32);
main.mostCurrent.__c.runVoidMethod ("LogImpl","6458767",RemoteObject.concat(_id,RemoteObject.createImmutable(";"),_characteristics.runMethod(false,"Get",(Object)((_id)))),0);
 }
}Debug.locals.put("id", _id);
;
 BA.debugLineNum = 106;BA.debugLine="For Each c As String In Characteristics.Keys";
Debug.ShouldStop(512);
{
final RemoteObject group13 = _characteristics.runMethod(false,"Keys");
final int groupLen13 = group13.runMethod(true,"getSize").<Integer>get()
;int index13 = 0;
;
for (; index13 < groupLen13;index13++){
_c = BA.ObjectToString(group13.runMethod(false,"Get",index13));Debug.locals.put("c", _c);
Debug.locals.put("c", _c);
 BA.debugLineNum = 107;BA.debugLine="PrintCharProperties(c, Starter.manager.GetCharac";
Debug.ShouldStop(1024);
_printcharproperties(_c,main.mostCurrent._starter._manager /*RemoteObject*/ .runMethod(true,"GetCharacteristicProperties",(Object)(_service),(Object)(_c)));
 }
}Debug.locals.put("c", _c);
;
 BA.debugLineNum = 109;BA.debugLine="End Sub";
Debug.ShouldStop(4096);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _globals() throws Exception{
 //BA.debugLineNum = 22;BA.debugLine="Sub Globals";
 //BA.debugLineNum = 23;BA.debugLine="Private btnReadData As Button";
main.mostCurrent._btnreaddata = RemoteObject.createNew ("anywheresoftware.b4a.objects.ButtonWrapper");
 //BA.debugLineNum = 24;BA.debugLine="Private btnDisconnect As Button";
main.mostCurrent._btndisconnect = RemoteObject.createNew ("anywheresoftware.b4a.objects.ButtonWrapper");
 //BA.debugLineNum = 25;BA.debugLine="Private btnScan As Button";
main.mostCurrent._btnscan = RemoteObject.createNew ("anywheresoftware.b4a.objects.ButtonWrapper");
 //BA.debugLineNum = 26;BA.debugLine="Private lblDeviceStatus As Label";
main.mostCurrent._lbldevicestatus = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");
 //BA.debugLineNum = 27;BA.debugLine="Private lblState As Label";
main.mostCurrent._lblstate = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");
 //BA.debugLineNum = 28;BA.debugLine="Private pbReadData As ProgressBar";
main.mostCurrent._pbreaddata = RemoteObject.createNew ("anywheresoftware.b4a.objects.ProgressBarWrapper");
 //BA.debugLineNum = 29;BA.debugLine="Private pbScan As ProgressBar";
main.mostCurrent._pbscan = RemoteObject.createNew ("anywheresoftware.b4a.objects.ProgressBarWrapper");
 //BA.debugLineNum = 30;BA.debugLine="Private clv As CustomListView";
main.mostCurrent._clv = RemoteObject.createNew ("b4a.example3.customlistview");
 //BA.debugLineNum = 31;BA.debugLine="Public bc As ByteConverter";
main.mostCurrent._bc = RemoteObject.createNew ("anywheresoftware.b4a.agraham.byteconverter.ByteConverter");
 //BA.debugLineNum = 32;BA.debugLine="Private bntReadService As Button";
main.mostCurrent._bntreadservice = RemoteObject.createNew ("anywheresoftware.b4a.objects.ButtonWrapper");
 //BA.debugLineNum = 33;BA.debugLine="Private service_battery As String=\"0000180f-0000-";
main.mostCurrent._service_battery = BA.ObjectToString("0000180f-0000-1000-8000-00805f9b34fb");
 //BA.debugLineNum = 34;BA.debugLine="Private Level_battery As String=\"00002a19-0000-10";
main.mostCurrent._level_battery = BA.ObjectToString("00002a19-0000-1000-8000-00805f9b34fb");
 //BA.debugLineNum = 35;BA.debugLine="Private service_Temperature As String=\"226c0000-6";
main.mostCurrent._service_temperature = BA.ObjectToString("226c0000-6476-4566-7562-66734470666d");
 //BA.debugLineNum = 36;BA.debugLine="Private Temperature As String=\"226caa55-6476-4566";
main.mostCurrent._temperature = BA.ObjectToString("226caa55-6476-4566-7562-66734470666d");
 //BA.debugLineNum = 37;BA.debugLine="Public bc As ByteConverter";
main.mostCurrent._bc = RemoteObject.createNew ("anywheresoftware.b4a.agraham.byteconverter.ByteConverter");
 //BA.debugLineNum = 38;BA.debugLine="Private bntlevelBattery As Button";
main.mostCurrent._bntlevelbattery = RemoteObject.createNew ("anywheresoftware.b4a.objects.ButtonWrapper");
 //BA.debugLineNum = 39;BA.debugLine="Dim IME As IME";
main.mostCurrent._ime = RemoteObject.createNew ("anywheresoftware.b4a.objects.IME");
 //BA.debugLineNum = 40;BA.debugLine="Private lbAddSensor As Label";
main.mostCurrent._lbaddsensor = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");
 //BA.debugLineNum = 41;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _lbaddsensor_click() throws Exception{
try {
		Debug.PushSubsStack("lbAddSensor_Click (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,188);
if (RapidSub.canDelegate("lbaddsensor_click")) { return b4a.bbb.main.remoteMe.runUserSub(false, "main","lbaddsensor_click");}
 BA.debugLineNum = 188;BA.debugLine="Sub lbAddSensor_Click";
Debug.ShouldStop(134217728);
 BA.debugLineNum = 190;BA.debugLine="End Sub";
Debug.ShouldStop(536870912);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _printcharproperties(RemoteObject _characteristic,RemoteObject _properties) throws Exception{
try {
		Debug.PushSubsStack("PrintCharProperties (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,111);
if (RapidSub.canDelegate("printcharproperties")) { return b4a.bbb.main.remoteMe.runUserSub(false, "main","printcharproperties", _characteristic, _properties);}
RemoteObject _props = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _key = RemoteObject.createImmutable(0);
Debug.locals.put("Characteristic", _characteristic);
Debug.locals.put("Properties", _properties);
 BA.debugLineNum = 111;BA.debugLine="Sub PrintCharProperties(Characteristic As String,";
Debug.ShouldStop(16384);
 BA.debugLineNum = 112;BA.debugLine="Log($\"${Characteristic} Properties:\"$)";
Debug.ShouldStop(32768);
main.mostCurrent.__c.runVoidMethod ("LogImpl","6524289",(RemoteObject.concat(RemoteObject.createImmutable(""),main.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_characteristic))),RemoteObject.createImmutable(" Properties:"))),0);
 BA.debugLineNum = 113;BA.debugLine="Dim props As Map = CreateMap(1: \"Broadcast\", 2: \"";
Debug.ShouldStop(65536);
_props = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");
_props = main.mostCurrent.__c.runMethod(false, "createMap", (Object)(new RemoteObject[] {RemoteObject.createImmutable((1)),RemoteObject.createImmutable(("Broadcast")),RemoteObject.createImmutable((2)),RemoteObject.createImmutable(("Read")),RemoteObject.createImmutable((4)),RemoteObject.createImmutable(("WriteWithoutResponse")),RemoteObject.createImmutable((8)),RemoteObject.createImmutable(("Write")),RemoteObject.createImmutable((0x10)),(RemoteObject.createImmutable("Notify"))}));Debug.locals.put("props", _props);Debug.locals.put("props", _props);
 BA.debugLineNum = 115;BA.debugLine="For Each key As Int In props.Keys";
Debug.ShouldStop(262144);
{
final RemoteObject group3 = _props.runMethod(false,"Keys");
final int groupLen3 = group3.runMethod(true,"getSize").<Integer>get()
;int index3 = 0;
;
for (; index3 < groupLen3;index3++){
_key = BA.numberCast(int.class, group3.runMethod(false,"Get",index3));Debug.locals.put("key", _key);
Debug.locals.put("key", _key);
 BA.debugLineNum = 116;BA.debugLine="If Bit.And(Properties, key) <> 0 Then Log(props.";
Debug.ShouldStop(524288);
if (RemoteObject.solveBoolean("!",main.mostCurrent.__c.getField(false,"Bit").runMethod(true,"And",(Object)(_properties),(Object)(_key)),BA.numberCast(double.class, 0))) { 
main.mostCurrent.__c.runVoidMethod ("LogImpl","6524293",BA.ObjectToString(_props.runMethod(false,"Get",(Object)((_key)))),0);};
 }
}Debug.locals.put("key", _key);
;
 BA.debugLineNum = 118;BA.debugLine="End Sub";
Debug.ShouldStop(2097152);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}

public static void initializeProcessGlobals() {
    
    if (main.processGlobalsRun == false) {
	    main.processGlobalsRun = true;
		try {
		        main_subs_0._process_globals();
starter_subs_0._process_globals();
param_subs_0._process_globals();
setup_subs_0._process_globals();
cockpit_subs_0._process_globals();
collecte_data_sensor_subs_0._process_globals();
httputils2service_subs_0._process_globals();
main.myClass = BA.getDeviceClass ("b4a.bbb.main");
starter.myClass = BA.getDeviceClass ("b4a.bbb.starter");
param.myClass = BA.getDeviceClass ("b4a.bbb.param");
setup.myClass = BA.getDeviceClass ("b4a.bbb.setup");
cockpit.myClass = BA.getDeviceClass ("b4a.bbb.cockpit");
collecte_data_sensor.myClass = BA.getDeviceClass ("b4a.bbb.collecte_data_sensor");
nb6.myClass = BA.getDeviceClass ("b4a.bbb.nb6");
httputils2service.myClass = BA.getDeviceClass ("b4a.bbb.httputils2service");
httpjob.myClass = BA.getDeviceClass ("b4a.bbb.httpjob");
		
        } catch (Exception e) {
			throw new RuntimeException(e);
		}
    }
}public static RemoteObject  _process_globals() throws Exception{
 //BA.debugLineNum = 16;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 20;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _statechanged() throws Exception{
try {
		Debug.PushSubsStack("StateChanged (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,58);
if (RapidSub.canDelegate("statechanged")) { return b4a.bbb.main.remoteMe.runUserSub(false, "main","statechanged");}
 BA.debugLineNum = 58;BA.debugLine="Public Sub StateChanged";
Debug.ShouldStop(33554432);
 BA.debugLineNum = 59;BA.debugLine="lblState.Text = Starter.currentStateText";
Debug.ShouldStop(67108864);
main.mostCurrent._lblstate.runMethod(true,"setText",BA.ObjectToCharSequence(main.mostCurrent._starter._currentstatetext /*RemoteObject*/ ));
 BA.debugLineNum = 60;BA.debugLine="If Starter.connected Then";
Debug.ShouldStop(134217728);
if (main.mostCurrent._starter._connected /*RemoteObject*/ .<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 61;BA.debugLine="lblDeviceStatus.Text = \"Connected: \" & Starter.C";
Debug.ShouldStop(268435456);
main.mostCurrent._lbldevicestatus.runMethod(true,"setText",BA.ObjectToCharSequence(RemoteObject.concat(RemoteObject.createImmutable("Connected: "),main.mostCurrent._starter._connectedname /*RemoteObject*/ )));
 }else {
 BA.debugLineNum = 63;BA.debugLine="lblDeviceStatus.Text = \"Not connected\"";
Debug.ShouldStop(1073741824);
main.mostCurrent._lbldevicestatus.runMethod(true,"setText",BA.ObjectToCharSequence("Not connected"));
 };
 BA.debugLineNum = 65;BA.debugLine="btnDisconnect.Enabled = Starter.connected";
Debug.ShouldStop(1);
main.mostCurrent._btndisconnect.runMethod(true,"setEnabled",main.mostCurrent._starter._connected /*RemoteObject*/ );
 BA.debugLineNum = 66;BA.debugLine="btnScan.Enabled = Not(Starter.connected)";
Debug.ShouldStop(2);
main.mostCurrent._btnscan.runMethod(true,"setEnabled",main.mostCurrent.__c.runMethod(true,"Not",(Object)(main.mostCurrent._starter._connected /*RemoteObject*/ )));
 BA.debugLineNum = 67;BA.debugLine="pbReadData.Visible = False";
Debug.ShouldStop(4);
main.mostCurrent._pbreaddata.runMethod(true,"setVisible",main.mostCurrent.__c.getField(true,"False"));
 BA.debugLineNum = 68;BA.debugLine="pbScan.Visible = False";
Debug.ShouldStop(8);
main.mostCurrent._pbscan.runMethod(true,"setVisible",main.mostCurrent.__c.getField(true,"False"));
 BA.debugLineNum = 69;BA.debugLine="btnReadData.Enabled = Starter.connected";
Debug.ShouldStop(16);
main.mostCurrent._btnreaddata.runMethod(true,"setEnabled",main.mostCurrent._starter._connected /*RemoteObject*/ );
 BA.debugLineNum = 70;BA.debugLine="bntReadService.Enabled=Starter.connected";
Debug.ShouldStop(32);
main.mostCurrent._bntreadservice.runMethod(true,"setEnabled",main.mostCurrent._starter._connected /*RemoteObject*/ );
 BA.debugLineNum = 71;BA.debugLine="bntlevelBattery.Enabled=Starter.connected";
Debug.ShouldStop(64);
main.mostCurrent._bntlevelbattery.runMethod(true,"setEnabled",main.mostCurrent._starter._connected /*RemoteObject*/ );
 BA.debugLineNum = 72;BA.debugLine="btnScan.Enabled = (Starter.currentState = Starter";
Debug.ShouldStop(128);
main.mostCurrent._btnscan.runMethod(true,"setEnabled",BA.ObjectToBoolean(RemoteObject.solveBoolean(".",BA.ObjectToBoolean((RemoteObject.solveBoolean("=",main.mostCurrent._starter._currentstate /*RemoteObject*/ ,BA.numberCast(double.class, main.mostCurrent._starter._manager /*RemoteObject*/ .getField(true,"STATE_POWERED_ON")))))) && RemoteObject.solveBoolean("=",main.mostCurrent._starter._connected /*RemoteObject*/ ,main.mostCurrent.__c.getField(true,"False"))));
 BA.debugLineNum = 73;BA.debugLine="End Sub";
Debug.ShouldStop(256);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
}