6 years, 3 months ago.

Get status of connection to access point?

Hello,

Briefly looking over the library API, I don't see a way to query the RN-XV for its connection status to an access point ( wireless router ).

Does this exist within the library at this time? Or does the library need to be extended to support a basic status() type method?

Regards,

Jim

EDIT:

So after looking through some of the code in Wifly.h and Wifly.cpp I added the following method:

    bool isAssociated()
    {
        return( state.associated );
    }

So then to use in my application I have this small example:

        while(1)
        {
            if( wifly.isAssociated() == true )
            {
                pc.printf("[%ld]Still connected....\r\n", connectCount++);
            }
            wait_ms(5000);
        }

Does this seem like a reasonable change and does it do what I think it should be doing?

Question relating to:

1 Answer

5 years, 7 months ago.

Hi Jim,

Your solution meets your needs I'm sure. I came across your post just now, and was looking at my own derived solution. It is a bit more complex than yours - my WiflyInterface has similar API "is_connected()". It actually quizzes the Wifly module for the current connection state. I didn't leave quite enough historical documentation to recall exactly why I did that (an older version was much more like what you suggested).

@David, time to write there a comment once you recall :)

posted by Martin Kojtal 14 Jun 2014