locked
Application to communicate with Embedded Device using wireless communication RRS feed

  • Question

  • Hi,

    I am beginner in wireless communication field.

    I am currently working on writing an application in C#(.net 3.5/4.0) to communicate with embedded device using wi-fi adapter(network card).

    application should able to talk to embedded device on Ad hoc network.

    Since past few days I am looking for the programming to do the task, but I could not find anything relevant.

    In few places I saw about socket programming, can we use a socket programming to send data wirelessly to embedded device.

    Embedded device is also having a wi-fi adapter in it.

    Any direction in this topic will help me alot as I am still looking for the start point,

    Plz share your idea in this.


    Abhishek

    Thursday, November 29, 2012 8:29 PM

Answers

  • Your question is really a Network question and not a wireless question.  If you plan to assign an IP address to each of your embedded devices, then from a C# programming lanaguage it doesn't matter if you are communicating with a computer on an ethernet land line or a wireless device, they look the same.  The ethernet card on a PC and the wireless card both have IP address and mask.  The ethernet interfcae on the PC will be configured as your back bone network with a mask of 0.0.0.0.  the network card will be configure as a subnet with a mask like 255.255.0.0.

    The operating system that you are installing on the embedded devices probably has a driver to communicate wiht the network card and a library equivalent to the Microsoft System.Net library  for transmission over an IP network.


    jdweng

    • Marked as answer by abhi41186 Friday, December 21, 2012 9:02 PM
    Thursday, November 29, 2012 10:25 PM
  • Yes you can use socket programming.  It is easier to use one of the Client Class than the Socket Class.  The Client Classes inherit the socket class as well as perform additional intiailization which isn't perform on a raw socket. 

    jdweng

    • Marked as answer by abhi41186 Friday, December 21, 2012 9:02 PM
    Thursday, November 29, 2012 10:45 PM
  • I was using the code on the webpage below on another posting.  Down load the ZIP file from webpage which has two flat files (clent and server).  the server code worked very well.  It is old code so there is one line that need updating.  It is a form project.  You can open the client and server both on the same computer and send data in both directions.

    http://www.codeguru.com/csharp/csharp/cs_misc/sampleprograms/article.php/c7695/Asynchronous-Socket-Programming-in-C-Part-I.htm


    jdweng

    • Marked as answer by abhi41186 Friday, December 21, 2012 9:02 PM
    Friday, November 30, 2012 3:26 PM
  • I haven't brought up the client code.  the server runs exactly as is.  The client you would need to put the IP address or name of the Server computer.  The IP address you would use in the client for the server is not the loopback 127.0.0.1.

    You may want to use "PING HOST" (in a cmd.exe window) to make sure you have a route between the two computer.


    jdweng

    • Marked as answer by abhi41186 Friday, December 21, 2012 9:01 PM
    Friday, November 30, 2012 4:54 PM

All replies

  • Your question is really a Network question and not a wireless question.  If you plan to assign an IP address to each of your embedded devices, then from a C# programming lanaguage it doesn't matter if you are communicating with a computer on an ethernet land line or a wireless device, they look the same.  The ethernet card on a PC and the wireless card both have IP address and mask.  The ethernet interfcae on the PC will be configured as your back bone network with a mask of 0.0.0.0.  the network card will be configure as a subnet with a mask like 255.255.0.0.

    The operating system that you are installing on the embedded devices probably has a driver to communicate wiht the network card and a library equivalent to the Microsoft System.Net library  for transmission over an IP network.


    jdweng

    • Marked as answer by abhi41186 Friday, December 21, 2012 9:02 PM
    Thursday, November 29, 2012 10:25 PM
  • thanks for giving your input on it.

    Actually you can think in this way also , An application that can send/receive data wirelessly from one PC to Another.

    Both the PC has a wireless card on it, so can I use socket programming over here?


    Abhishek

    Thursday, November 29, 2012 10:41 PM
  • Yes you can use socket programming.  It is easier to use one of the Client Class than the Socket Class.  The Client Classes inherit the socket class as well as perform additional intiailization which isn't perform on a raw socket. 

    jdweng

    • Marked as answer by abhi41186 Friday, December 21, 2012 9:02 PM
    Thursday, November 29, 2012 10:45 PM
  • Thanks, this is what I am looking for..

    Do you have any online link where I can go and study about it in a more detail or if you have sample code...Plz share

    Also can I use TCP/IP to establish communication?

    I will look into the client class, I have no idea about it....


    Abhishek

    Friday, November 30, 2012 2:42 PM
  • I was using the code on the webpage below on another posting.  Down load the ZIP file from webpage which has two flat files (clent and server).  the server code worked very well.  It is old code so there is one line that need updating.  It is a form project.  You can open the client and server both on the same computer and send data in both directions.

    http://www.codeguru.com/csharp/csharp/cs_misc/sampleprograms/article.php/c7695/Asynchronous-Socket-Programming-in-C-Part-I.htm


    jdweng

    • Marked as answer by abhi41186 Friday, December 21, 2012 9:02 PM
    Friday, November 30, 2012 3:26 PM
  • Hey thanks alot..

    I run the code in same PC and dont find any difficulty,but when it comes to run in two diffrent PC then I get stuck in configuring the PC, Do you have idea about what are the things I need to do to run this client server program in different PC?

    like what are changes need to done in adapter properties.


    Abhishek

    Friday, November 30, 2012 4:39 PM
  • I haven't brought up the client code.  the server runs exactly as is.  The client you would need to put the IP address or name of the Server computer.  The IP address you would use in the client for the server is not the loopback 127.0.0.1.

    You may want to use "PING HOST" (in a cmd.exe window) to make sure you have a route between the two computer.


    jdweng

    • Marked as answer by abhi41186 Friday, December 21, 2012 9:01 PM
    Friday, November 30, 2012 4:54 PM
  • Thnks Joel

    Your input really helped me alot..

    :)


    Abhishek

    Friday, December 21, 2012 9:03 PM