Im using this library here: WiFlyHQ/WiFlyHQ.cpp at master · harlequin-tech/WiFlyHQ · GitHub
Im trying to get the version of my wifi module from code instead of directly connecting to it via tty. So Im looking at the Wifly::time() function in the WiflyHQ.cpp file of the library and thinking of doing this:
(bool)enterCommandMode -> (bool)startCommand -> char getOpt()
boolean WiFly::versionOfModule()
{
if (!startCommand()) {
return false;
}
send_P(PSTR("ver\r"));
finishCommand();
return true;
}
Does this look reasonable?
It should check if its in command mode and then send that string to the module. Then it should finishCommand() which exits commandMode. Im not sure but I think I might have to call to enterCommandMode first though.
But this means send_P() or finishCommand() need to call to read the terminal...