Serial Port Q .NET CF 2.0

Hi.

I realised there was a serial port component in .NET 2.0, which is cool

I haven't touched it nor played with it but will do. But currently have a question.

Serial Ports are Comm Ports correct

Would I be able to use the IR comm port/serial port to send data using this component (without connecting to a device for example)




Answer this question

Serial Port Q .NET CF 2.0

  • Tony Lambert

    ahmedilyas wrote:

    an IOException is raised when opening the port giving the exception:

    An error message cannot be displayed because an optional resource assembly containing it cannot be found

    Does the Smartphone Windows Mobile 2005 device not support serialport




    *bump*
    I have the same problem on my device, I get exactly the same exception with basically the same initialization. Did you ever solve this


  • yuryk

    Hi,

    NETCF V2 provides a managed SerialPort implementation consistent with the Desktop framework. You can use the class to send and receive data from serial/com port usually named as COM1, COM2, etc. NETCF also provides a managed IrDA implementation for communication with devices having IrDA support. You may find more details about our IrDA PMEs here:

    IrDAClient:

    http://msdn2.microsoft.com/system.net.sockets.irdaclient.aspx

    IrDAListener:

    http://msdn2.microsoft.com/system.net.sockets.irdalistener.aspx

    Cheers,

    Anthony Wong [MSFT]


  • sjw7

    Nope however Andrew (MSFT) has some great insights into it and has helped me:

    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=503980&SiteID=1

    but still unresolved



  • A.I.V

    OK, here is a Q

    simple did this:

    new smartphone 5.0 project.

    added the serialport component to the form

    made a simple method:



    this.theSerialPort = new System.IO.Ports.SerialPort("COM4");
    this.theSerialPort.Open();
    this.theSerialPort.Close();

     

     

    an IOException is raised when opening the port giving the exception:

    An error message cannot be displayed because an optional resource assembly containing it cannot be found

     

    Does the Smartphone Windows Mobile 2005 device not support serialport

     

    [edit]Of course I tried Com3 and seems to work until it sends data, when it sends a simple data like "hello" i get just an empty blank IOException. This is to my other smartphone or the PC IRDA usb, or even the media centre IR reciever. Any ideas

    [/edit]



  • Zesovich

    Thanks Anthony, much appreciated.

    I will try this and post here if i come up with questions/issues.



  • Serial Port Q .NET CF 2.0