Well, surely I’m just another user,but simply because Blynk lib is open source (happily!!) there is one, very simple way to verify all doubts. Here is excerpt from Blynk library:
in BlynkApi.h
:
/**
* Connects to the server.
* Blocks until connected or timeout happens.
* May take less or more then timeout value.
*
* @param timeout Connection timeout
* @returns True if connected to the server
*/
bool connect(unsigned long timeout = BLYNK_TIMEOUT_MS*3);
and in BlynkProtocol.h
:
bool connect(uint32_t timeout = BLYNK_TIMEOUT_MS*3) {
conn.disconnect();
state = CONNECTING;
millis_time_t started = BlynkMillis();
while ((state != CONNECTED) &&
(BlynkMillis() - started < timeout))
{
run();
}
return state == CONNECTED;
}
Now, a quick look will bring an answer to both your questions @mikekgr:
- yes, it is a blocking function (until it timeouts or connects)
- it’s timeout should be passed in milliseconds
moreover, there is this in BlynkConfig.h:
// Network timeout in milliseconds.
#ifndef BLYNK_TIMEOUT_MS
#define BLYNK_TIMEOUT_MS 2000UL
#endif
Now, I believe the default timeout for connect()
is 2000*3 =6000ms, unless defined otherwise (for example for GSM boards)