Fixes YunClient's connected() to behave like other Clients (WiFiClient, EthernetClient, etc)

This commit is contained in:
Rob Kiefer 2015-06-04 12:26:25 -04:00 committed by Cristian Maglie
parent c4de750253
commit 6f566776f9
1 changed files with 4 additions and 0 deletions

View File

@ -114,6 +114,10 @@ void YunClient::flush() {
uint8_t YunClient::connected() {
if (!opened)
return false;
// Client is "connected" if it has unread bytes
if (available())
return true;
uint8_t cmd[] = {'L', handle};
uint8_t res[1];
bridge.transfer(cmd, 2, res, 1);