Author Topic: Responding to TI's Finder utility  (Read 12217 times)

Offline phomann

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Homann Designs
Responding to TI's Finder utility
« on: September 28, 2010, 08:03:54 AM »
Hi Mark,

I want my application to respond to TI's Finder application.

The Finder application is a utility that communicates via UDP (Port 23 I think which is normally the telnet port)

The purpose of Finder is to locate Stellaris  boards on the LAN, and display their MAC and IP address  so the user can see what IP address has been assigned by DHCP, etc.

The source code for the PC application is in the Stellarwise tool/finder directory. The source for the target boards is in;
utils/locator.c, and .h


The finder broadcasts a UDP message on port 23.  The target boards bind to port 23 setup to respond to any IP address.

Is it possible to setup a UDP listener that will receive the broadcast UDP packet?

Cheers,

Peter.




Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: Responding to TI's Finder utility
« Reply #1 on: September 28, 2010, 01:39:54 PM »
Hi Peter

I don't see any difficulties involved in this. There is a UDP demo in application.c (#define DEMO_UDP) and you can change the UDP port number that it assigns so that you can receive the requests.

The demo will echo received data back but you can interpret and respond accordingly. As long as the requests are correctly interpreted and the answers constructed to match the TI's utility's syntax (and local data is inserted in the content) it should operate.

Regards

Mark

Offline phomann

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Homann Designs
Re: Responding to TI's Finder utility
« Reply #2 on: September 29, 2010, 12:36:50 AM »
Hi Mark,

Thanks for the reply.

How do I set up  to get the UDP demo to respond as the finder application is broadcasting the message (using the IP address 255.255.255.255)

Do I need to do any setup to get the udp demo to respond to broadcast  packets? Or is it that  udp will receive any broadcast packet if it is on the set up port?  (probably showing my lack of IP knowledge :) )

Cheers,

Peter.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: Responding to TI's Finder utility
« Reply #3 on: September 29, 2010, 01:32:06 PM »
Hi Peter

Broadcast IP addresses will be received by IP so will arrive at the UDP level.

If sub-net broadcasts are to be received too, the define SUPPORT_SUBNET_BROADCAST can be used (then 192.168.0.255 would be considered a broadcast in the 255.255.255.0 sub-net, for example). This is used by NETBIOS, which you could also look at. NETBIOS is also a sort of "finder" since it is UDP based (using sub-net broadcast rather than full broadcast) checks a string name with its own and then answers if it matches.

Regards

Mark

Offline phomann

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Homann Designs
Re: Responding to TI's Finder utility
« Reply #4 on: September 30, 2010, 12:05:44 AM »
Hi Mark,

Thankyou. That's very helpful.

Cheers,

Peter.

Offline mhoneywill

  • Full Member
  • ***
  • Posts: 173
    • View Profile
Re: Responding to TI's Finder utility
« Reply #5 on: September 30, 2010, 04:51:43 PM »
Hi Peter, And anyone else who might be interested.

I quickly knocked up the code to do this for you. The code's rough and I've kept it as similar to the TI example as possible. I've tested it in the simulator and it works.

Just make the following changes to application.c

1. Ensure that  #define DEMO_UDP is uncommented about line 110

2. Change the definition of  MY_UDP_PORT  to 23 about line 214

3. If necessary change your default MAC address and IP address about line 307

4. Replace the function fnUDPListner with the new version in the attached file.

Cheers

Martin
 

Offline phomann

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Homann Designs
Re: Responding to TI's Finder utility
« Reply #6 on: October 01, 2010, 02:09:36 PM »
Hi Martin,

Thanks for that, I appreciate it. I figured it out in the end.  I've downloaded you code to check how well I've done. :)



Cheers,

Peter.