Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist > Bug Reports
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Bug Reports Post about errors or bugs encountered.

Serial2 problems in 6.5

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-16-2008, 09:20 PM
Junior Member
 
Join Date: Mar 2008
Posts: 11
Default Serial2 problems in 6.5

Here is some code which worked fine under 6.3 and falls over under 6.5. It uses serial2. Has anybody else had this problem?

I trimmed it to a minimum. Under 6.3 it reads the GPS on the serial line at good speed and smoothly. Under 6.5 it does it in fits and starts.

The full programme compiled under 6.5 just gets the error in GPSGetChar, as listed below. Under 6.3 it works fine. (This is on the PDA, an HP iPaq 212a. On the PC it runs without any trouble at all. This is still true after a hard reset on the PDA.)

Any ideas please?

- - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub GPSGetChar 'Returns the next character from the GPS, or chr(0) if none available

ErrorLabel(ErrorGetChar)

ok = False
Do While ok = False

If GPSBufferPointer >= GPSBufferLength Then
i = GPSGetBuffer
If i <= 0 Then Return Chr(0)
End If

i = Chr(GPS(GPSBufferPointer))
GPSBufferPointer = GPSBufferPointer + 1
If i <> Chr(0) Then ok = True ' Ignore nulls
Loop

Return i

ErrorGetChar:
Msgbox("Error in GPSGetChar") 'This is where it dies in 6.5 -
' not on the cut down version of the programme, but on the full one which
' is rather too big to put up on this forum!
Serial2.PortOpen = False
AppClose
End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub GPSGetBuffer 'Gets a new bufferful from the GPS ' Returns the character
' count in the buffer (0 if none available)
GPSBufferPointer = 0
GPSBufferLength = 0

ErrorLabel(GetBufErr)

i = Serial2.InBufferCount
If i > 0 Then
GPS() = Serial2.InputArray
GPSBufferLength = ArrayLen(GPS())
'Not always the same as i !
End If

Return GPSBufferLength


GetBufErr:
If Charting = False Then
Msgbox("You have become disconnected from the GPS")
Serial2.PortOpen = False
AppClose
Return 0
End If
End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub GPSFlushBuffer
n = 100 ' Just in case!
i = 1000
Do While (i >= 100) AND (n > 0)
i = GPSGetBuffer
n = n - 1
Loop
GPSLinePointer = 0
End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - -

I will be interested in your ideas. It has taken me a couple of days to sort out that this seems to be a 6.5 bug - including the hard reset of the PDA unfortunately!

Chester Wilson.
Reply With Quote
  #2 (permalink)  
Old 12-17-2008, 10:37 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
I trimmed it to a minimum. Under 6.3 it reads the GPS on the serial line at good speed and smoothly. Under 6.5 it does it in fits and starts.
Is this on the device with an optimised compiled app? Is it the same when run from the device IDE?

Quote:
The full programme compiled under 6.5 just gets the error in GPSGetChar. Under 6.3 it works fine
Optimised compiled? Can you confirm that the same compiled exe runs differently under 6.3 and 6.5? What is the error message if you remove the ErrorLabel statement?

I cannot explain the differences you note between 6.3 and 6.5. I have done a lot of serial port work under 6.5 developing my SerialEx library, which is an enhanced Serial2 library using the Serial2 code as a base, and my GPSSerial library which behaves virtually identically to the GPSDriver library but for for devices without a built-in GPS. They both use the same underlying .NET serial port class as Serial2 - and in fact make greater demands of it, particularly GPSSerial. I did not find any unexpected behaviour of the serial port while I was developing and testing these so am at loss to explain your problem
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial2 and binary transfers agraham Bug Reports 2 10-19-2008 08:19 PM
Status serial2.dll + HTC + WM6? ClarkVent Questions (Windows Mobile) 25 08-11-2008 04:50 AM
Serial2 update - V1.2 Erel Official Updates 0 01-18-2008 08:26 AM
Serial2 problem Henry Questions (Windows Mobile) 2 11-28-2007 09:52 AM
Serial2.dll alfcen Bug Reports 2 08-13-2007 07:04 PM


All times are GMT. The time now is 03:28 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0