本文整理汇总了C++中recvFind函数的典型用法代码示例。如果您正苦于以下问题:C++ recvFind函数的具体用法?C++ recvFind怎么用?C++ recvFind使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了recvFind函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rx_empty
bool ESP8266::sATCIPSENDSingle(const uint8_t *buffer, uint32_t len)
{
rx_empty();
printAT("CIPSEND=");
m_puart->println(len);
if (recvFind(">", 5000)) {
rx_empty();
for (uint32_t i = 0; i < len; i++) {
m_puart->write(buffer[i]);
}
return recvFind("SEND OK", 10000);
}
return false;
}
示例2: rx_empty
bool ESP8266::sATCIPSENDSingleFromFlash(const uint8_t *buffer, uint32_t len)
{
rx_empty();
m_puart->print(F("AT+CIPSEND="));
m_puart->println(len);
if (recvFind(">", 5000)) {
rx_empty();
for (uint32_t i = 0; i < len; i++) {
m_puart->write((char) pgm_read_byte(&buffer[i]));
}
return recvFind("SEND OK", 10000);
}
return false;
}
示例3: rx_empty
bool ESP8266::sATCIPSENDSingle(String &str)
{
rx_empty();
m_puart->print("AT+CIPSEND=");
m_puart->println(str.length());
if (recvFind(">", 5000)) {
rx_empty();
for (uint32_t i = 0; i < str.length(); i++) {
m_puart->write(str.charAt(i));
}
return recvFind("SEND OK", 10000);
}
return false;
}
示例4: flush
bool ESP::sATCIPSTO(uint32_t timeout)
{
flush();
this->serial->print(F("AT+CIPSTO="));
this->serial->println(timeout);
return recvFind(F("OK"), COMMAND_TIMEOUT);
}
示例5: rx_empty
///for releaseTCP (sync)
bool ESP8266::eATCIPCLOSESingle(void)
{
//state = STATE_releaseTCP;
rx_empty();
m_puart->println("AT+CIPCLOSE");
return recvFind("OK", 5000);
}
示例6: sATCIPSENDMultiple
/**
* \brief envia pacote de dados
* \param mux_id > 0 envia o AT+HTTPDATA e os dados
* \param mux_id == 0 somente dados
* \param mux_id == -1 aguarda retorno de dados
* \return 0=erro, 1=OK
*/
boolean sATCIPSENDMultiple(int mux_id, uint8_t tipo_buffer, uint8_t *buffer, boolean flag_flush)
{
int len;
if (mux_id==-1) {
return gprs.sendCommand(0);
}
//debugvar(freeMemory());
if (tipo_buffer == POINTER_CHAR_RAM)
len=strlen((char*)buffer);
else
len=strlen_P((char*)buffer);
if (!len) return true;
/// rx_empty();
//if (bitRead(ccStatus,CC_DEBUG)) debugvar(freeMemory());
#if DEBUG >= 1 || HAS_BLUETOOTH >= 1
debugvar(len);
uint8_t *b=buffer;
for (uint16_t i = 0; i < len; i++) {
if (tipo_buffer==POINTER_CHAR_PROGMEM) {
SSdebug.write(pgm_read_byte(b++));
} else {
SSdebug.write(*b++);
}
} // for
SSdebug.write('\n');
#endif
#ifdef GSM_CSTT
// esp8266Flush();
SSwifi.print("AT+CIPSEND=");
#if USE_MUX == 1
SSwifi.print(mux_id);
SSwifi.print(",");
#endif
SSwifi.print(len);
SSwifi.print("\r\n");
SSwifi.flush();
if (recvFind(">",6000)) {
PGM_PRINT("+");
//esp8266Flush();
#if 0
if (tipo_buffer==POINTER_CHAR_PROGMEM) {
#if 0
char *u;
if (len < SERIAL_TX_BUFFER_SIZE-1 && (u=(char*)malloc(SERIAL_TX_BUFFER_SIZE))) {
strcpy_P(u,(char*)buffer);
SSwifi.print(u);
SSwifi.flush();
free(u);
} else
#endif
for (uint16_t i = 0; i < len; i++) {
// SSdebug.write(pgm_read_byte(buffer));
SSwifi.write(pgm_read_byte(buffer++));
}
}else {
SSwifi.print((char*)buffer);
}
#else
for (uint16_t i = 0; i < len; i++) {
if (tipo_buffer==POINTER_CHAR_PROGMEM) {
// SSdebug.write(pgm_read_byte(buffer));
SSwifi.write(pgm_read_byte(buffer++));
}else {
// SSdebug.write(*buffer);
SSwifi.write(*buffer++);
}
}
#endif
// ret=recvFind("SEND OK", 5000);
PGM_PRINT("* ");
SSwifi.write(0x1a);
recvString(str_ret, "SEND OK", "busy","link is", 10000,flag_flush);
#if DEBUG > 0
//if (bitRead(ccStatus,CC_DEBUG))
debugln(str_ret);
#endif
if (!strncmp(str_ret,"SEND OK",7)) {
// PGM_PRINTLN("SOK");
//delay(100);
//SSwifi.flush();
//eATCIPSTATUS();
return true;
}
if (!strncmp(str_ret,"link",4)) {
sATCIPCLOSEMulitple(mux_id);
}
//.........这里部分代码省略.........