Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Send data to serial port for other application


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-04-2008, 06:22 PM
Junior Member
 
Join Date: Oct 2007
Posts: 47
Default Send data to serial port for other application

Hello!

Is it possible to send GPS-data out of a basic4ppc-application to a serial port with serial.output(String) and tap this data with other GPS-applications?

I have asked the same problem in another thread with looking for a null modem emulator, but i thought, that i have perhaps oversee something. Perhaps there is another chance to to it by using ther serial lib.





m.f.G.

schimanski
Reply With Quote
  #2 (permalink)  
Old 04-04-2008, 07:31 PM
taximania's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 214
Awards Showcase
Beta Tester 
Total Awards: 1
Default

To reply to both your posts in 1,
and I'm probably wrong

Connect the TX and RX lines of your COM port together.
Anything you send will be received from the same port.

You may need an RS232 serial cable for your unit,
as apposed to a USB cable.
__________________
Avoiding lawyers
For a full year now

O2 XDA Artemis Touch Flo 4.02 Full Cube Rom WM6.1

http://www.taximania.net
Reply With Quote
  #3 (permalink)  
Old 04-04-2008, 07:38 PM
willisgt's Avatar
Senior Member
 
Join Date: Aug 2007
Location: Nacogdoches, Texas USA
Posts: 154
Default

All right, you've got me curious...

It sounds as though you want to run one application which would read the GPS data and pass it to other applications.

What prevents these other applications from simply reading the GPS data directly?

Gary
__________________
PC: Windows XP Pro SP2 / Basic4PPC v6.3
PPC: HTC 8925 (AT&T Tilt) / Windows Mobile 6
Reply With Quote
  #4 (permalink)  
Old 04-04-2008, 07:46 PM
taximania's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 214
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Original post in another thread:
Null modem emulator von WM5

Perhaps I missed his point
__________________
Avoiding lawyers
For a full year now

O2 XDA Artemis Touch Flo 4.02 Full Cube Rom WM6.1

http://www.taximania.net
Reply With Quote
  #5 (permalink)  
Old 04-04-2008, 08:44 PM
Junior Member
 
Join Date: Oct 2007
Posts: 47
Default the sense of reading GPS-data

Hello Gary!

"What prevents these other applications from simply reading the GPS data directly?"

I have written an application, that takes the GPS-data from a server. Now, my application creates a NMEA-protokoll with these GPS-data. After that, I want to show these GPS-data in every navigation software (like TomTom for example), which is able to read NMEA-strings. (Both applications runs on one Pocket-PC)

I have tested two null modem emulators. The first is "VSPD Mobile", it runs fine, but it is to expensive. The second is "ComPipe", but i'm not able to run it, there is no data-transfer between the existing com-ports.

Taxmania says, that i have to connect the TX and RX lines of the COM port together and anything will be received from the same port. I think, it's like a cross-over cable, but how should i make this in my Pocket-PC?

Is there no way to program the TX and RX lines in the COM ports?



schimanski
Reply With Quote
  #6 (permalink)  
Old 04-08-2008, 10:49 AM
Junior Member
 
Join Date: Oct 2007
Posts: 47
Default I have found an answer for my problem....

Hello!

I have found an answer for my problem and I will post it, because it is perhaps interested for someone:

Under

http://www.franson.com/serialtools/

you can get different libraries for .Net Framework and .Net Compact Framework (1.0 and 2.0) to create serial and virtual serial ports. So it is very easy to create a virtual serial port pair and send and receive data from the first to the second port. In the sequel, you can create your own null modem emulator for example.

To create a null modem emulator on your device under .Net Compact Framework 2.0, you only have to do this:

Contain first the SerialNET.200.CF.dll and create a virtual serial input and output-object. For example:

Vserial_input.VPort
Vserial_output.VPort

After that, you init the virtual ports and open them. In the code, I will create a virtual serial port pair with port 7 and 8.

Code:
Sub App_Start
    Vserial_input.New1
    Vserial_output.New1

    Vserial_input.ComPort=7
    Vserial_output.ComPort=8

    Vserial_input.Created=true     'open virtual port 7'
    Vserial_output.Created=true   'open virtual port 8'

    timer1.Enabled=true
End Sub

Sub Timer1_Tick
    Errorlabel(IOError)
    DataString=Vserial_input.DataFromPort(0,0)   'null modem function'
    Vserial_output.DataToPort(DataString)
    IOError:
End Sub
With this simple code, you have your own null modem emulator. Now you can send with serial.output(String) from the Serial2.dll data out of your own application to COM7, which is received from COM8. So you can get this data with serial.readstring out of another application. In this way, you can send data from your own application to a navigation-software like GoogleMaps or TomTom Navigator for example.

To use SerialTools SDK from Franson, you first have to create a license-object with a trial- or full-licensekey.

I hope, there is someone who can use this in his own applications.
Reply With Quote
  #7 (permalink)  
Old 04-08-2008, 05:45 PM
taximania's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 214
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I used serialNET for my RawIR library. Never thought about using it like this.

Nice one
__________________
Avoiding lawyers
For a full year now

O2 XDA Artemis Touch Flo 4.02 Full Cube Rom WM6.1

http://www.taximania.net
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial Port won't open djmrozinski Questions & Help Needed 6 03-16-2008 04:25 PM
send the hex data alex_up Questions & Help Needed 10 12-18-2007 04:50 AM
Serial terminal ,send ASCII/HEX alex_up Russian Forum 0 12-15-2007 11:18 AM
Use Basic4ppc to send serial data from a PDA to a BlueSMiRF Bluetooth module. pdablue Share Your Creations 3 11-19-2007 09:58 PM
GPS and Virtual Serial Port alfcen Questions & Help Needed 2 10-05-2007 01:56 PM


All times are GMT. The time now is 12:42 PM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0