Automatique simple GPS start

Put Claude

Active Member
Licensed User
Hi,

So... my bluetooth-GPS is always on. But my PPC with GPS-program running, get off power at the and of use by turning off the main power, meaning : the program stays running till automatique shut-off of the PPC...
When the main-power comes back after a night, my PPC lights up on the same spot I was leaving it... but it does not repair the bluetooth-GPS connection...
So, I put a little code snippet into my GPS program, and my bluetooth-connection will restart automatiquely... You can use it in all kinds of bluetooth connections programming.

'----------------------------------
Sub Timer1_Tick 'See 'Sub Serial_OnCom', if time-out : reset your 'serial-port and try to connect again
ResetSerial 'reset serialport: CLOSE IT and OPEN IT AGAIN to get 'connected again
End Sub

'----------------------------------
Sub Serial_OnCom 'Fires whenever the EnableOnComm is true and 'there is communication

Timer1.Enabled = False 'stop timer at data-received-event
Timer1.Interval = 5000 'reset the timer to 5 seconds
Timer1.Enabled = True 'start timer again

if serial.PortOpen = true then 'check if port is open
' and so on ..............
'.............................

Put Claude Belgium
 
Top