Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim ip_port As String
Dim pass As String
Dim username As String
Dim stringtosend As String
ip_port="http://192.168.1.10:667"
pass= "&pass=alstad99"
username="blaster" ' not sure if this is neccesary ?
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private ImageView1 As ImageView
Private tgl_onoff As ToggleButton
Private vol_up As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("ir_main")
End Sub
Sub Send_ir(tmpcode As String)
'Send a POST request
Dim job1 As HttpJob
job1.Initialize("Job1", Me)
job1.Username=username
job1.Password=pass
job1.PostString(ip_port,tmpcode)
Log(ip_port & tmpcode)
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
stringtosend=""
Job.Release
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub vol_up_Click' volume up
stringtosend="/msg?code=C03F906F:NEC:32"
Send_ir(stringtosend.trim)' remove eventual spaces just in case
End Sub
Sub tgl_onoff_CheckedChange(Checked As Boolean)' on/off
stringtosend="/msg?code=FFFFFFFFFFFFFFFF:NEC:0"
Send_ir(stringtosend.Trim)