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 com for Bluetooth? Virtual com port

Serial com for Bluetooth? Virtual com port

Discuss PocketC for CE (including Desktop Edition)

Postby ahkub on Fri Oct 17, 2003 10:50 am

Hi there,
after the huge success of my last question (database sorting), I have another one which I don't expect to see any answers: ;)

Does anybody know if PocketC can handle virtual com ports com7 and com8?
I'd like to read serial data (9600 bps) from a bluetooth GPS via SPP and read it into PocketC.

Best Regards,
Alf
ahkub
 
Posts: 7
Joined: Mon Oct 13, 2003 6:47 am
Location: Germany

Postby Brendan Donovan on Tue Mar 09, 2004 2:43 pm

Hi Alf,

Don't know if this is still of interest to you, but I have used PocketC to communicate with a serial bluetooth device on the virtual com ports.

There were two main issues in getting it to work.(I assume you are using an iPAQ based on your reference to com7 and 8)

1) After connecting to the bluetooth device in bluetooth manager, you actually need to send and receive on com8 despite what the iPAQ documentation says about sending on one and receiving on the other.

2) The pocketC serial functions did not work for com8. I had to download the PocketC wince api from http://www.networkdynamics.net/PCForm.html#library , and use CreatFile() rather than seropen().

Below is the section of code adapted from the serial example on the orbworks site. -brendan
-----------

SetLastError(0);
portName="COM8:";

// instead of seropen
ret=CreateFile(portName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);

//// set parameters

//get current parameters
if(! GetCommState(ret, &rDCB)){
confirm("Error getting comm state " + GetLastError());
CloseHandle(ret);
quit();
}

//Change parameters
rDCB.BaudRate=9600;
rDCB.fParity=FALSE;
rDCB.ByteSize=8;
rDCB.Parity=NOPARITY;
rDCB.StopBits=ONESTOPBIT;
rDCB.fOutxCtsFlow=FALSE;
rDCB.fRtsControl=FALSE;
rDCB.fOutxDsrFlow=FALSE;
rDCB.fDsrSensitivity=FALSE;
rDCB.fDtrControl=FALSE;
rDCB.fOutX=FALSE;
rDCB.fInX=FALSE;
rDCB.fAbortOnError=FALSE;

//Write parameters
if(!SetCommState(ret,&rDCB)){
confirm("SetCommState faile " + GetLastError());
CloseHandle(ret);
quit();
}


//confirm("open error was " + GetLastError());
putsl("Seropen returned: "+ret);
putsl("Successful serial port initialization returns a non zero integer.");

commsetmask(ret,EV_RXCHAR); // generate comm interrupt on character inputs.
Brendan Donovan
 
Posts: 3
Joined: Mon Aug 18, 2003 3:48 pm

Postby ahkub on Wed May 19, 2004 10:09 am

Thanks, Brandon, looks promising. I'll give it a try!:|
ahkub
 
Posts: 7
Joined: Mon Oct 13, 2003 6:47 am
Location: Germany


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 2 guests

cron