Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) 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
schimanski's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: Germany
Posts: 289
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 Expert
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 592
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.
__________________
.
.
.
Don't ask, I'm fine, honest. !!
.
.
.
Just a little crazy at times



O2 XDA, GW Evo 2.1 UC WWE Rom, WM6.1
Radio Ver 03.34.90
With Basic4ppc V6.80


http://www.taximania.co.uk
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: 162
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 SP3 / Basic4PPC v6.5
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 Expert
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 592
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Original post in another thread:
http://www.basic4ppc.com/forum/questions-windows-mobile/2087-null-modem-emulator-von-wm5.html

Perhaps I missed his point
__________________
.
.
.
Don't ask, I'm fine, honest. !!
.
.
.
Just a little crazy at times



O2 XDA, GW Evo 2.1 UC WWE Rom, WM6.1
Radio Ver 03.34.90
With Basic4ppc V6.80


http://www.taximania.co.uk
Reply With Quote
  #5 (permalink)  
Old 04-04-2008, 08:44 PM
schimanski's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: Germany
Posts: 289
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
schimanski's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: Germany
Posts: 289
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 Expert
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 592
Awards Showcase
Beta Tester 
Total Awards: 1
Default

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

Nice one
__________________
.
.
.
Don't ask, I'm fine, honest. !!
.
.
.
Just a little crazy at times



O2 XDA, GW Evo 2.1 UC WWE Rom, WM6.1
Radio Ver 03.34.90
With Basic4ppc V6.80


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
send information to running application Mr_Gee Questions (Windows Mobile) 8 08-06-2008 11:10 AM
Serial port handling mjcoon Questions (Windows Mobile) 5 06-26-2008 10:48 AM
send the hex data alex_up Questions (Windows Mobile) 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


All times are GMT. The time now is 09:11 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0