This code is not working unless I put a break point.
Any idea?
Any idea?
B4X:
Dim job As HttpJob
job.Initialize("", Me)
'check result
currentState = MANUAL_MODE
If state == 1 Then
'not activate, so need to activate
job.PostString("https://api.particle.io/v1/devices/" & deviceName & "/zoneCtrlId", "access_token=" & accessToken & "¶ms=" & controlPin & "," & ON)
manControlFlag = True
Else If state == 0 Then
'not activate, so need to activate
job.PostString("https://api.particle.io/v1/devices/" & deviceName & "/zoneCtrlId", "access_token=" & accessToken & "¶ms=" & controlPin & "," & OFF)
manControlFlag = False
End If
Wait For (job) JobDone(job As HttpJob)
If job.Success = True Then
Log(job.GetString)
cloudRx = job.GetString
updateState
Log("result from Post is : " & result)
Else
Log("job failed")
End If
job.Release
End Sub