Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ATP3011F4.cpp
00001 #include "ATP3011F4.h" 00002 #include <stdio.h> 00003 #include <stdlib.h> 00004 00005 int ATP3011F4::getErrorCode() { 00006 if (ret[0] != 'E') return -1; 00007 ret[5] = '\0'; 00008 return atoi(ret); 00009 } 00010 void ATP3011F4::sendBreak() { 00011 response_ready = false; 00012 send("$"); 00013 } 00014 00015 bool ATP3011F4::sendNumPlain(int val) { 00016 int ret = snprintf(buf, BUF_LEN, "%d", val); 00017 if (ret <= 0) return false; 00018 return sendNumPlain(buf); 00019 } 00020 00021 bool ATP3011F4::sendNumPlain(const char* val) { 00022 if (val == null) return false; 00023 send("<NUM VAL="); 00024 send(val); 00025 sendr(">"); 00026 return true; 00027 } 00028 00029 bool ATP3011F4::sendNum(int val, const char* counter) { 00030 int ret = snprintf(buf, BUF_LEN, "%d", val); 00031 if (ret <= 0) return false; 00032 return sendNum(buf, counter); 00033 } 00034 00035 bool ATP3011F4::sendNum(const char* val, const char* counter) { 00036 if (val == null) return false; 00037 if (!send("<NUMK VAL=")) return false; 00038 if (!send(val)) return false; 00039 if (counter != NULL) { 00040 if (!send(" COUNTER=")) return false; 00041 if (!send(counter)) return false; 00042 } 00043 return sendr(">"); 00044 } 00045 00046 bool ATP3011F4::sendAlpha(const char* val) { 00047 if (!send("<ALPHA VAL=")) return false; 00048 send(val); 00049 return sendr(">"); 00050 }
Generated on Sun Sep 4 2022 00:14:28 by
