1 Reply Latest reply on Dec 25, 2014 2:29 PM by SuMa_296631

    wiced_hostname_lookup problems


      I am trying to use the 'wiced_hostname_lookup' function to convert a text URL into an IP address, but I only get "WICED_ERROR" as the response.

      I can get back a URL that is the IP address in dotted text string format.

      Immediately prior to making my call, I can use the NTP functions that also contain a call to this function and that seems to work, and immediately afterwards I can make a UDP connection to a remote server and that all works OK. Therefore I believe that the WiFI network is all set up and working correctly.

      The documentation appears to be sadly lacking for this (and many other) functions so I have no idea if there are restriction's or prior functions that must be called to get this to work.

      Any suggestions would be appreciated.


      (SDK 2.4.1, STM32F1xx in an SN8200x, Threadx and Netx Duo)

        • 1. Re: wiced_hostname_lookup problems

          The problem is that I had called the 'wiced_hostname_lookup' function with a timeout value of WICED_NEVER_TIMEOUT. This translates to "-1".

          The 'dns_client_hostname_lookup' function (that does all of the work) uses the initial timeout value in a "while" loop for multiple DNS lookup attempts, each time counting down the remaining timeout value until it goes negative.

          Therefore, by passing WICED_NEVER_TIMEOUT, the "while" loop was never executing which made the function report the error.

          It really is a pity that the documentation is not written with proper descriptions of the functions actions, the valid (or invalid) ranges for the parameters and the meanings of the return values.