Ariane Soft PPL2 Pocket Programming DataMite
  #1  
Old 06-30-2009, 08:22 PM
Kobus Kobus is offline
Senior Member
 
Join Date: Feb 2009
Location: Spain
Posts: 141
Default GPS derperado

Hi gentlemen,

I have been collecting forum time for the following story:

Searching for "GPS reading data" code I finally found an appl from one of the neigbours that works on my HTC (GPS Driver NMEA . cs and -. dll(without spaces))
Trying to translate it into ppl I run into one error after another.
Tried to import the .dll file in my code and then got a struct-error Access violation on the HTC, on opening the exe.

When I use: .....$ = ReadString(...$), I get an Access violation on ReadString

This is the code I have been playing with:
p$ = CreateFile("COM4:", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);

ko$ = fopen(p$, "r");

top$ = ReadFile(ko$, &inBuffer$, nBytesToRead$, &nBytesRead$, NULL);
NMEA$ = readstring(top$);

and

#ifdef _WIN32_WCE
#import "\\My Device\\Windows\\GPSDriverNMEA.dll"
#endif

Tried to compile the .cs file, the msdn library "GPS Intermediate driver" is driving me crazy (that's why it's called a driver?? )

Thanks in advance for any suggestions!

Helen.
Reply With Quote
  #2  
Old 07-02-2009, 11:32 AM
Kobus Kobus is offline
Senior Member
 
Join Date: Feb 2009
Location: Spain
Posts: 141
Default

Hi Emilio,

Thank you for this info. I really have to start reading all the non info on msdn and pick out the valuable info.

One error is solved. I have to use #define "\\Windows\\coredll.dll" in PPL. Other programs use #import ............

To be continued ......

Greetzzz,
Helen.
Reply With Quote
  #3  
Old 07-02-2009, 03:00 PM
Mike Halliday Mike Halliday is offline
Senior Member
 
Join Date: Sep 2007
Location: Warrington, United Kingdom
Posts: 821
Send a message via Skype™ to Mike Halliday
Default

Quote:
Originally Posted by Kobus View Post
Hi gentlemen,

I have been collecting forum time for the following story:

Searching for "GPS reading data" code I finally found an appl from one of the neigbours that works on my HTC (GPS Driver NMEA . cs and -. dll(without spaces))
Trying to translate it into ppl I run into one error after another.
Tried to import the .dll file in my code and then got a struct-error Access violation on the HTC, on opening the exe.

When I use: .....$ = ReadString(...$), I get an Access violation on ReadString

This is the code I have been playing with:
p$ = CreateFile("COM4:", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);

ko$ = fopen(p$, "r");

top$ = ReadFile(ko$, &inBuffer$, nBytesToRead$, &nBytesRead$, NULL);
NMEA$ = readstring(top$);

and

#ifdef _WIN32_WCE
#import "\\My Device\\Windows\\GPSDriverNMEA.dll"
#endif

Tried to compile the .cs file, the msdn library "GPS Intermediate driver" is driving me crazy (that's why it's called a driver?? )

Thanks in advance for any suggestions!

Helen.

Helen,

Did I send you this code? I can't remember! Doh. I have compiled it and run it on my Touch Diamond and it recognises the GPS and reads data from it! - I changed the GPS.INI file to COM4: and speed 4800 before I run the code on the Diamons.

Mike.
Attached Files
File Type: zip PPL Code.zip (99.9 KB, 149 views)
Reply With Quote
  #4  
Old 07-02-2009, 04:46 PM
Kobus Kobus is offline
Senior Member
 
Join Date: Feb 2009
Location: Spain
Posts: 141
Default

Hi Mike,

Yehhh, I have been struggling with these files for a while and, grrrrrr, you get it running

I get an error in the #form100 code - line 12 - of the GPS_form.frm:
f$ = SetCommCreate;

and that's why I started searching again for my long lasting non GPS connection.
GPSID looks like a good solution, if I get it running

What I have now:

CreateEvent("GPSOpenDevice", GPSOpenDevice$);
p$ = GPSOpenDevice(NULL, NULL, NULL, 0);

//GPS_POSITION(pos$); I have to ppl this

struct(pos$,"dwVersion", "dwSize");
memset(&pos$, 0, sizeof(pos$));
pos.dwVersion$ = GPS_VERSION_1;
pos.dwSize$ = sizeof(pos$);

ko$ = GPSGetPosition(NULL, &pos$, 20000,0);

and I even added these two lines to the COMM.PLL (

#declare GPSOpenDevice cmdll GPSOpenDevice 4 1
#declare GPSGetPosition cmdll GPSGetPosition 4 1

With these two lines I don't get errors anymore but I have no idea if I need to add more.

Found a site http://www.christec.co.nz/blog/archives/354 which gives some nice info;
eventhough I already got stuck on "include gpsapi.h "

Bye, bye,
Helen.
Reply With Quote
  #5  
Old 07-05-2009, 08:49 PM
Nicknack Nicknack is offline
Senior Member
 
Join Date: Nov 2006
Location: Germany
Posts: 527
Default

gpsapi.h is a header file. header files consists mainly out of #defines and #declares/#imports.
you can compare them with the ppl files which resides in the lib folder, eg swapi.ppl,windows.ppl....
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright (c) ArianeSoft Inc.
Copyright © 2009 www.ppl-lang.com - All rights reserved
Web Design by BR Web Consulting Ltd