Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - SERIAL COMM

SERIAL COMM

Discuss PocketC for CE (including Desktop Edition)

Postby curtis on Fri Nov 14, 2003 1:57 am

I HAVE BEEN TRYING FOR MONTHS SINCE I BOUGHT POCKETC TO GET THE SERIAL PORT TO OPEN. CAN ANYONE HELP?
THANKS
CURTIS
curtis
 
Posts: 5
Joined: Thu Dec 12, 2002 12:03 am
Location: USA

Postby ahkub on Mon Nov 17, 2003 10:42 am

Hi Curtis,
Here is a small program I wrote (based on serialchat). It reads and displays data from a handheld GPS that sends serial ASCII code at 9600 baud. For you probably the part inbetween *** is most important.
If it doesn't let you open the serial port, check if it blocked by e.g. a driver for an external keyboard. Disable this driver, if necessary.
Hope that helps,
Alf


#include "/pocketc/pcheader.h"
// (c) by Alf Kuchenbuch in 08/2002 in Fethiye, Turkey
main(){
int wind_event,ret,o;
int breitegrad,laengegrad;
float breiteminute,laengeminute,speed,kurs;
char laengeOW,breiteNS;
string gps;
// serial init***
// documentation says seropen
// returns 1, but in fact it
// returns the serial connection
// handle, needed
// for many subsequent serial
// i/o calls.
ret=seropen(9600,"8N1N",1000); // the timeout (last parameter) does matter, despite the documentation.
putsl("Seropen returned: "+ret);

putsl("Successful serial port initialization ");
putsl("returns a non zero integer.");
if (ret==0) {
alert("Serial Com Error! Please reset PocketPC.");
quit();
}
// end of serial init***

while(1){ // Hauptschleife
while(1){ // richtigen gps-satz finden
gps="";
while(1){ // kompletten gps-satz einlesen
o=readbyte(ret);
if (o==13)break;
gps=gps+(char)o;
} // kompletten gps-satz einlesen
if(strmid(gps,1,6)=="$GPRMC")
break;
} // richtigen gps-satz finden
breitegrad=(int) strmid(gps,17,2);
breiteminute=(float) strmid(gps,19,6);
breiteNS=strgetc(gps,26);
laengegrad=(int) strmid(gps,28,3);
laengeminute=(float) strmid(gps,31,6);
laengeOW=strgetc(gps,38);
speed=(float) strmid(gps,40,5);
kurs=((float) strmid(gps,46,5)- (float)strmid(gps,60,5));//Missweisung(?) abziehen
rect(10,30,230,130);
text(20,40,"Breite: "+breitegrad+"?Ǭ? "+breiteminute+"\" "+breiteNS+" ");
text(20,60,"L?ɬ§nge: "+laengegrad+"?Ǭ? "+laengeminute+"\" "+laengeOW+" ");
text(20,80,"Kurs: "+kurs+"?Ǭ? ");
text(20,100,"Speed: "+speed+" Knoten = "+(int)(speed*1.852+0.5)+" km/h ");
text(20,160,"Tippen auf Display + Geduld = Ende");

wind_event=event(0);
sleep(0);
if (wind_event==PM_MOUSEMOVE) break;
sleep(1000);
} // Hauptschleife

// ende
fileclose(ret);
quit();
}// end main
ahkub
 
Posts: 7
Joined: Mon Oct 13, 2003 6:47 am
Location: Germany

Postby joh.becker on Tue Nov 18, 2003 7:49 am

Hi,

if you still have problems, let us know which PDA you use and post the serial part of your code.

Johannes
joh.becker
 
Posts: 86
Joined: Tue Apr 17, 2001 6:51 am
Location: Germany

Postby ahkub on Mon Nov 24, 2003 6:39 am

@ Johannes:
Just a quick one: Do you also use CE API for programming serial com?
ahkub
 
Posts: 7
Joined: Mon Oct 13, 2003 6:47 am
Location: Germany

Postby curtis on Mon Nov 24, 2003 12:31 pm

Hi,
I am using the pocketc serial example code.
Thanks,
Curtis
curtis
 
Posts: 5
Joined: Thu Dec 12, 2002 12:03 am
Location: USA

Postby joh.becker on Fri Dec 05, 2003 2:23 pm

I am using both the CEAPI and the built-in serial support. On the HP720 only CEAPI works (there is a bug in the init function of the runtime)

Johannes
joh.becker
 
Posts: 86
Joined: Tue Apr 17, 2001 6:51 am
Location: Germany


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 3 guests

cron