This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Ethernet example enetio.c

Hi,

In the tivaware ethernet enet_io example for DK-TM4C129x, they have locator.c file. The description is somewhat confusing and I'm not able to relate it to the given project. It says "locator.c - A device locator server using UDP in lwIP."  All the time they use terms like "Locator response packet". So what is this file regarding? does it locate something or what?

  • Hello Spandan89

    The locator application has a exe in the bin which can be used to find other LaunchPads on the LAN

    Regards
    Amit
  • Hi Amit,

    Is there a document realted to TCP/IP stack which is being used in the example? Its hard to figure out which function calls which one?
    So do you mean that using locator.c file the application (.exe)can find other launchpads?
    Locator.c file has useful functions. So if I dont have any other launchpads connected to the network and i'm the one who is being connected to network, can I still use the locator.c file?
    What I want say is that, under what scenario one should use the locator.c?
    I hope I'm being clear with my question.
    When I connect to the network, first network will assign me a IP address which i can get using lwIPLocalIPAddrGet() function. is that correct? then I can send this address to router so that I can start the communication.

    Thanks
  • Hello Spandan89,

    My mistake. I got it confused with the finder.exe

    The locator uses UDP packets sent by the Host PC which is running a discovery protocol to which the LaunchPad responds with it's MAC, IP, Board ID etc. It is a custom format being created in the locator file.

    Regards
    Amit
  • Hi Amit,

    I'm trying to understand the program flow of the given example enet_io. They first initializes httpd_init and io_init functions. When we do something from the webpage it sends requests to the board and then board acts accordingly. This is what happening overall. But I'm having difficulty tracking these requests and how does http and io file connects. So far I understood that there are timer interrupts which is called whenever there is some interrupt and performs the ISR. I want to track whole process from sending data from applicaton layer and receiving it on the board. I couldnt track the ethernet APIs which actually does Tx and Rx functionality.

    Thanks
  • Hello Spandan89

    The actual TX and RX functions are handled by the LwIP stack, The lwiplib.c and lwiplib.h manage the HAL between the Lwip and the Ethernet MAC Controller.

    Regards
    Amit
  • Hi Amit,

    I'm working on an application in which the sender will send me some message (OPCODE) telling me to turn on /off LEDs. They are sending me through some UDP port. My task is to detect that OPCODE and turn on/off LEDs. I know this sounds very simple but for a beginner like me its not.

    I tried to understand that enetio.c example and it gets complected when http , CGI, SSI things gets involved. I tried to track the program flow but wasnt successful.

    I believe, i can create a dummy application in which i can detect that OPCODE. But the problem is that I dont know where the message will be stored in the IP stack. I know that when sender sends me message it will pass through 4 layers of TCP/IP stack and when I receive it will be passed up the layer by the lwIP stack. When the message will reach to my application how can I know where its stored. I really have no idea.

    Also is it necessary to bind my application to the same port number through which sender is sending me?
    Any suggestions are welcomed.

    Thanks
  • Hello Spandan89,

    Why not use the existing example (I am not very clear as to how the existing example is preventing you from doing the same)?

    Regards
    Amit