[RESOLVED] internal gps vs external gps
Hello,
I am having a bit of a problem programming for internal GPS's. I have created a free golf program that works fine for all my external GPS's, but, when a person with an internal gps comes along, my problems begin. I am just using the serialport to acquire byte value data from the port. I found out that for internal GPS's, opening and closing the port is actually turning on and shutting down the GPS(not so for my external GPS, it just opens and shuts the port). So I ended up having to leave the port open to accomodate the internal GPS's. Then I guess I ended up with the buffer overflowing when I wasn't actually pulling from the port. So i used the discardoutbuffer and discardinbuffer to fix this. now, my poor internal gps friends, can only get about 2 readings (by pushing a button to initiate the reading), and then no more GPGGA data (the data sentence that I use) sentences can be found.. only the other types. my question is, do you have to use discardoutbuffer and discardinbuffer in a certain order? I have another section of the program that works fine (the internal gps users have not complained) and the only differance that I have seen is that in one I do a discardoutbuffer and then a discardinbuffer and in the one that is not working I reversed it.
Rick...
Re: internal gps vs external gps
Sorry guys, I fixed it. Seems like I was right.. you have to do a discardoutbuffer before the discardinbuffer. The person using the internal GPS (I am in san diego and he is in australia) notified me tonight that my change made it work. so..... this is the way it supposed to be
serialport.discardoutbuffer()
serialport.discardinbuffer()
and not like this
serialport.discardinbuffer()
serialport.discardoutbuffer()
it will make it act wierd... I don't know why though.....
Rick.....