Bluetooth Serial Port Communication For Window CE

Topics: Bluetooth - BlueSoliel, Bluetooth - Other, Samples
Mar 18, 2012 at 4:01 AM

may i ask, where i can download a serial port communication for window mobile compact framework?

32.feet got provide this sample?

currently i had a project need to get data from serial port, by using Bluetooth link.

i try to search the sample and tutorial in internet, but it not have any sample that can apply in window mobile compact framework, mostly of them only for desktop using.

i hope to make my gui like this http://tiktakx.wordpress.com/2010/11/21/serial-port-interfacing-with-vb-net-2010/ , but unfortunaly the platform not suport for window CE.

it show me a error:

cmbPort.Items.Add(myPort(i))

//The targeted version of the.NET Compact Framework does not support latebinding.

kindly advice.
thanks in advance.

Developer
Mar 18, 2012 at 5:20 PM

Try replacing the line:

    Dim myPort As Array  ‘COM Ports detected on the system will be stored here

With:

   Dim myPort() As String  ‘COM Ports detected on the system will be stored here

Mar 18, 2012 at 5:34 PM

hi alanjmcf,

after i change to  Dim myPort() As String, it solve the "The targeted version of the.NET Compact Framework does not support latebinding" problem. but it bring me another errors:

 
 myPort = IO.Ports.SerialPort.GetPortNames() 

//Value of type '1-dimensional array of String' cannot be converted to 'string'

 

and

For i = 0 To UBound(myPort)

//Value of type 'string' cannot be converted to 'System.Array'.

 

Mar 18, 2012 at 5:34 PM

hi alanjmcf,

after i change to  Dim myPort() As String, it solve the "The targeted version of the.NET Compact Framework does not support latebinding" problem. but it bring me another errors:

 
 myPort = IO.Ports.SerialPort.GetPortNames() 

//Value of type '1-dimensional array of String' cannot be converted to 'string'

 

and

For i = 0 To UBound(myPort)

//Value of type 'string' cannot be converted to 'System.Array'.

 

Developer
Mar 19, 2012 at 10:17 AM

That look *very* much as if the brackets are missing from:

Dim myPort() As String

You must have the brackets after the variable name to make it an array.

Mar 20, 2012 at 6:21 AM

hi alanjmcf.

thanks again. This solution solved my problem. thanks. after the serial port success, and i add in my current project. it show me another error. 


1. myPort = IO.Ports.SerialPort.GetPortNames()

//'IO' is ambiguous, imported from the namespaces or tyes 'GeoFramework,System'.

2. SerialPort1.Parity = IO.Ports.Parity.None

//'IO' is ambiguous, imported from the namespaces or tyes 'GeoFramework,System'.

3. SerialPort1.StopBits = IO.Ports.StopBits.One

//'IO' is ambiguous, imported from the namespaces or tyes 'GeoFramework,System'.

how can i solve this error? how can i tell the program which io going to use?
I can using two IO in a program?

Kindly advice.
#coding really full of challenge.  

Developer
Mar 20, 2012 at 11:41 AM

http://www.bing.com/search?q=serialport&FORM=IE8SRC So the .NET class SerialPort is in System.IO.Ports, so update the code to match. :-,)  To make it simpler you could remove all the many "IO.Ports." throughout the code and just add at the top of the file "Imports System.IO.Ports".  If you delete one you'll find that the IDE suggests solutions on a drop-down menu -- use the one that says add "Imports System.IO.Ports".