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.