Skip to content

Commit

Permalink
Removed some compiler warnings
Browse files Browse the repository at this point in the history
bportaluri committed Mar 3, 2019
1 parent 1492fc0 commit 9997f65
Showing 2 changed files with 9 additions and 12 deletions.
19 changes: 8 additions & 11 deletions src/utility/EspDrv.cpp
Original file line number Diff line number Diff line change
@@ -459,18 +459,14 @@ int32_t EspDrv::getCurrentRSSI()
uint8_t EspDrv::getScanNetworks()
{
uint8_t ssidListNum = 0;
int idx;
bool ret = false;

int idx;

espEmptyBuf();

LOGDEBUG(F("----------------------------------------------"));
LOGDEBUG(F(">> AT+CWLAP"));

espSerial->println(F("AT+CWLAP"));

char buf[100];

idx = readUntil(10000, "+CWLAP:(");

@@ -611,7 +607,8 @@ bool EspDrv::startClient(const char* host, uint16_t port, uint8_t sock, uint8_t
// for UDP we set a dummy remote port and UDP mode to 2
// this allows to specify the target host/port in CIPSEND

int ret;

int ret = -1;
if (protMode==TCP_MODE)
ret = sendCmd(F("AT+CIPSTART=%d,\"TCP\",\"%s\",%u"), 5000, sock, host, port);
else if (protMode==SSL_MODE)
@@ -632,7 +629,7 @@ void EspDrv::stopClient(uint8_t sock)
{
LOGDEBUG1(F("> stopClient"), sock);

int ret = sendCmd(F("AT+CIPCLOSE=%d"), 4000, sock);
sendCmd(F("AT+CIPCLOSE=%d"), 4000, sock);
}


@@ -781,7 +778,7 @@ int EspDrv::getDataBuf(uint8_t connId, uint8_t *buf, uint16_t bufSize)
if(_bufPos<bufSize)
bufSize = _bufPos;

for(int i=0; i<bufSize; i++)
for(uint16_t i=0; i<bufSize; i++)
{
int c = timedRead();
//LOGDEBUG(c);
@@ -842,7 +839,7 @@ bool EspDrv::sendData(uint8_t sock, const __FlashStringHelper *data, uint16_t le

//espSerial->write(data, len);
PGM_P p = reinterpret_cast<PGM_P>(data);
for (int i=0; i<len; i++)
for (uint16_t i=0; i<len; i++)
{
unsigned char c = pgm_read_byte(p++);
espSerial->write(c);
@@ -1043,7 +1040,7 @@ int EspDrv::sendCmd(const __FlashStringHelper* cmd, int timeout, ...)
// Returns:
// the index of the tag found in the ESPTAGS array
// -1 if no tag was found (timeout)
int EspDrv::readUntil(int timeout, const char* tag, bool findTags)
int EspDrv::readUntil(unsigned int timeout, const char* tag, bool findTags)
{
ringBuf.reset();

@@ -1112,7 +1109,7 @@ void EspDrv::espEmptyBuf(bool warn)
// copied from Serial::timedRead
int EspDrv::timedRead()
{
int _timeout = 1000;
unsigned int _timeout = 1000;
int c;
long _startMillis = millis();
do
2 changes: 1 addition & 1 deletion src/utility/EspDrv.h
Original file line number Diff line number Diff line change
@@ -322,7 +322,7 @@ class EspDrv
static bool sendCmdGet(const __FlashStringHelper* cmd, const char* startTag, const char* endTag, char* outStr, int outStrLen);
static bool sendCmdGet(const __FlashStringHelper* cmd, const __FlashStringHelper* startTag, const __FlashStringHelper* endTag, char* outStr, int outStrLen);

static int readUntil(int timeout, const char* tag=NULL, bool findTags=true);
static int readUntil(unsigned int timeout, const char* tag=NULL, bool findTags=true);

static void espEmptyBuf(bool warn=true);

0 comments on commit 9997f65

Please sign in to comment.