hajoko
Posts: 46
Joined: Thu Dec 18, 2008 2:05 pm
Location: Germany
Contact: Website

programming token ring

Thu Dec 18, 2008 3:23 pm

Dear all,

i have the idea to programm a token ring with a number of PDA's. I would prefere to use serial connections. That means, every member needed to control TWO serial connectiones to their neighbours left and right.
My (ipaq)bluetoothmanager only offers one serial connection. Is it possible with franson tools to open a second connection?

regards

hajoko

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: programming token ring

Thu Dec 18, 2008 4:33 pm

Yes, it shouldn't be a problem.

Regards,
Jonas

hajoko
Posts: 46
Joined: Thu Dec 18, 2008 2:05 pm
Location: Germany
Contact: Website

RE: programming token ring

Thu Dec 18, 2008 4:50 pm

so, which tool do I need - bluetooth only or serial too?

regards

hajoko

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: programming token ring

Thu Dec 18, 2008 5:34 pm

If you are only reading from serial ports, it might be enough with SerialTools.
The best way to determine this is by you testing though. Both toolkits come with a trial period.

Regards,
Jonas

hajoko
Posts: 46
Joined: Thu Dec 18, 2008 2:05 pm
Location: Germany
Contact: Website

RE: programming token ring

Thu Dec 18, 2008 6:31 pm

ups - 'licence key is invalid' with the trial key - I suppose, it is the dotNET Compact Framework- key for to try 'VPortNoEvent'
and suppose further, that I need to open a virtual R232Port to read from a second Bluetooth Port?

regards

hajo

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: programming token ring

Thu Dec 18, 2008 10:15 pm

I have never tried SerialPort so you'll have to ask the question in the appropriate forum.

Regards,
Jonas

hajoko
Posts: 46
Joined: Thu Dec 18, 2008 2:05 pm
Location: Germany
Contact: Website

RE: programming token ring

Thu Dec 18, 2008 10:43 pm

thank you - i'll do so

Regards,
hajoko

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: programming token ring

Thu Dec 18, 2008 11:04 pm

Considering that you need to create a port that you wish to read and write to using a bluetooth connection, you probably need to use BlueTools however.
Look at the SimpleService sample on how to create a service and the Chat sample on how to read and write to a remote service.

Regards,
Jonas

hajoko
Posts: 46
Joined: Thu Dec 18, 2008 2:05 pm
Location: Germany
Contact: Website

RE: programming token ring

Fri Dec 19, 2008 12:20 pm

thank you Jonas,

seems, this Sample is only avayliable in C++- I unfortunately use VB.

Do you think, this Sample only works in C++ or schould it be possible in VB too - so I woud try, to translate it.

regards

hajoko

hajoko
Posts: 46
Joined: Thu Dec 18, 2008 2:05 pm
Location: Germany
Contact: Website

RE: programming token ring

Fri Dec 19, 2008 12:22 pm

sorry, its c# -not c++

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: programming token ring

Fri Dec 19, 2008 2:05 pm

It will work exactly the same in VB, so if you know how to read C#, just write your own SimpleService sample in VB.NET.

Regards,
Jonas

hajoko
Posts: 46
Joined: Thu Dec 18, 2008 2:05 pm
Location: Germany
Contact: Website

RE: programming token ring

Fri Dec 19, 2008 3:12 pm

think, I got most of it - 9 errors remaining, that need more knowledge about franson machine or datatypes. Are you interested to finish it? Of course you can ceep the code at your own then.

regards

hajoko

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: programming token ring

Fri Dec 19, 2008 3:20 pm

Post the errors so I can comment it.

Regards,
Jonas

hajoko
Posts: 46
Joined: Thu Dec 18, 2008 2:05 pm
Location: Germany
Contact: Website

RE: programming token ring

Fri Dec 19, 2008 3:34 pm

at least only 3 errors :

Error 1
m_network = m_manager.Networks \ Der Wert vom Typ "1-dimensionales Array von Franson.BlueTools.Network" kann nicht in "Franson.BlueTools.Network" konvertiert werden. (Val of type 1dim Array cannot be converted to "Franson.BlueTools.Network")

error2
connectedStream.BeginRead(buffer, 0, buffer.Length, New AsyncCallback(!readCallback!), connectedStream)\
the Delegat "System.AsyncCallback" needs as single Argument for his Konstruktor a AddressOf-Expression or a Lambda-Expression.

error3
byteWrite(inx) = CType(charWrite(inx), Byte)\ Char values cannot be konverted to byte values

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: programming token ring

Fri Dec 19, 2008 6:09 pm

1. I guess it means that you are trying to assign a single Network to the Networks array. I don't know VB very well, but maybe Networks(0) or something?

2. What is !readCallback! supposed to mean? This is just like any BeginRead in any case. You can google on how it should look like.

3. You need to case it somehow from char to byte.

Regards,
Jonas

Return to “BlueTools”