Lines Matching refs:resp
119 string resp = m_uart.readStr(maxLen); in sendCommand() local
122 cerr << "RSP: " << string2HexString(resp) << endl; in sendCommand()
125 if (!((uint8_t)resp[0] == 0xff && (uint8_t)resp[1] == 0x00)) in sendCommand()
132 if (resp.size() != ((uint8_t)resp[2] + 2 + 1 + 1)) in sendCommand()
135 << int((uint8_t)resp[2] + 2 + 1 + 1) in sendCommand()
136 << ", got " << resp.size() << endl; in sendCommand()
142 for (int i=2; i<(resp.size() - 1); i++) in sendCommand()
143 cksum += (uint8_t)resp[i]; in sendCommand()
145 if (cksum != (uint8_t)resp[resp.size() - 1]) in sendCommand()
148 << int(cksum) << ", got " << (uint8_t)resp[resp.size()-1] << endl; in sendCommand()
157 resp.erase(resp.size() - 1, 1); // cksum in sendCommand()
158 resp.erase(0, 2); // header bytes in sendCommand()
161 return resp; in sendCommand()
168 string resp = sendCommand(CMD_VERSION, ""); in getFirmwareVersion() local
170 if (resp.empty()) in getFirmwareVersion()
177 resp.erase(0, 2); in getFirmwareVersion()
178 return resp; in getFirmwareVersion()
185 string resp = sendCommand(CMD_RESET, ""); in reset() local
186 if (resp.empty()) in reset()
210 string resp = sendCommand(CMD_SELECT_TAG, ""); in select() local
212 if (resp.empty()) in select()
218 if ((uint8_t)resp[0] == 2) in select()
222 m_lastErrorCode = resp[2]; in select()
237 m_tagType = (TAG_TYPE_T)resp[2]; in select()
239 if ((uint8_t)resp[0] == 6) in select()
245 m_uid.push_back(resp[i+3]); in select()
277 string resp = sendCommand(CMD_AUTHENTICATE, data); in authenticate() local
279 if (resp.empty()) in authenticate()
286 if (resp[2] != 'L') in authenticate()
290 m_lastErrorCode = resp[2]; in authenticate()
317 string resp = sendCommand(CMD_READ16, data); in readBlock16() local
319 if (resp.empty()) in readBlock16()
325 if ((uint8_t)resp[0] == 2) in readBlock16()
329 m_lastErrorCode = resp[2]; in readBlock16()
345 resp.erase(0, 3); in readBlock16()
346 return resp; in readBlock16()
357 string resp = sendCommand(CMD_READ_VALUE, data); in readValueBlock() local
359 if (resp.empty()) in readValueBlock()
365 if ((uint8_t)resp[0] == 2) in readValueBlock()
369 m_lastErrorCode = resp[2]; in readValueBlock()
387 rv = ((uint8_t)resp[3] | in readValueBlock()
388 ((uint8_t)resp[4] << 8) | in readValueBlock()
389 ((uint8_t)resp[5] << 16) | in readValueBlock()
390 ((uint8_t)resp[6] << 24)); in readValueBlock()
412 string resp = sendCommand(CMD_WRITE16, data); in writeBlock16() local
414 if (resp.empty()) in writeBlock16()
420 if ((uint8_t)resp[0] == 2) in writeBlock16()
424 m_lastErrorCode = resp[2]; in writeBlock16()
457 string resp = sendCommand(CMD_WRITE_VALUE, data); in writeValueBlock() local
459 if (resp.empty()) in writeValueBlock()
465 if ((uint8_t)resp[0] == 2) in writeValueBlock()
469 m_lastErrorCode = resp[2]; in writeValueBlock()
505 string resp = sendCommand(CMD_WRITE4, data); in writeBlock4() local
507 if (resp.empty()) in writeBlock4()
513 if ((uint8_t)resp[0] == 2) in writeBlock4()
517 m_lastErrorCode = resp[2]; in writeBlock4()
566 string resp = sendCommand(CMD_WRITE_KEY, data); in writeKey() local
568 if (resp.empty()) in writeKey()
575 if ((uint8_t)resp[2] != 'L') in writeKey()
579 m_lastErrorCode = resp[2]; in writeKey()
606 string resp = sendCommand(((incr) ? CMD_INC_VALUE : CMD_DEC_VALUE), data); in adjustValueBlock() local
608 if (resp.empty()) in adjustValueBlock()
614 if ((uint8_t)resp[0] == 2) in adjustValueBlock()
618 m_lastErrorCode = resp[2]; in adjustValueBlock()
636 rv = ((uint8_t)resp[3] | in adjustValueBlock()
637 ((uint8_t)resp[4] << 8) | in adjustValueBlock()
638 ((uint8_t)resp[5] << 16) | in adjustValueBlock()
639 ((uint8_t)resp[6] << 24)); in adjustValueBlock()
648 string resp = sendCommand(CMD_ANTENNA_POWER, ""); in setAntennaPower() local
650 if (resp.empty()) in setAntennaPower()
663 string resp = sendCommand(CMD_READ_PORT, ""); in readPorts() local
665 if (resp.empty()) in readPorts()
672 return (resp[2] & 3); in readPorts()
685 string resp = sendCommand(CMD_WRITE_PORT, data); in writePorts() local
687 if (resp.empty()) in writePorts()
700 string resp = sendCommand(CMD_HALT_TAG, ""); in haltTag() local
702 if (resp.empty()) in haltTag()
709 if ((uint8_t)resp[2] != 'L') in haltTag()
713 m_lastErrorCode = resp[2]; in haltTag()
758 string resp = sendCommand(CMD_SET_BAUD, data); in setSM130BaudRate() local
760 if (resp.empty()) in setSM130BaudRate()
777 string resp = sendCommand(CMD_SLEEP, ""); in sleep() local
779 if (resp.empty()) in sleep()