Cold Boot, Service does not load correctly if using Serial Library

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hi All

Has anyone experienced any issues with a service app loading that uses serial/Bluetooth.

It loads fine on a warm boot(restart phone) but on a cold boot(power on) is seems to have issues.

It there a delay required when using core services ?

Regards

John
 

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hi All

After spending much of the day on this, it would appear that some core services are not availble on a cold boot. In this event a timer hook and the use of startServiceAt over come this issue.

I introduced a boot loader service to load the main service. The main service then checks to see if the core service you want to use is available or not.

Sub tmrServiceHook_tick()

Dim now As Long
Dim dt As String

DateTime.DateFormat = "yyyy/MM/dd HH:mm:ss"
dt = DateTime.Date(DateTime.now)

Try
' // bluetooth is not enabled
If Main.devCOM.IsEnabled = False Then
' // disconnect
com_disconnect
' // show warnings
ToastMessageShow("VitlLink: Switch on Bluetooth !" ,False)
snow_notify ("Switch on Bluetooth ! ")
' // turn off timer
tmrServiceHook.Enabled = False
' // stop the service
StopService ("")
' // start in 5 seconds
StartServiceAt("",DateTime.now + (5 * DateTime.TicksPerSecond), True)
Else
' // do main processing
do_com_service
End If
Catch
' // disconnect
com_disconnect
End Try



End Sub

Hope this helps anyone who has had the same issue.

Regards

John.
 
Upvote 0
Top