diff --git a/参考文档(21-30)/LocReport/SIM7000.cpp b/参考文档(21-30)/LocReport/SIM7000.cpp index bf498e0..28d63ea 100644 --- a/参考文档(21-30)/LocReport/SIM7000.cpp +++ b/参考文档(21-30)/LocReport/SIM7000.cpp @@ -15,35 +15,6 @@ bool SIM7000::begin(Stream &port) return false; } -bool SIM7000::checkSIMStatus(void) -{ - int count = 0; - while(count < 3){ - if(check_send_cmd("AT\r\n","OK")){ - break; - }else{ - count++; - delay(300); - } - } - if(count == 3){ - return false; - } - count = 0; - while(count < 3){ - if(check_send_cmd("AT+CPIN?\r\n","READY")){ - break; - }else{ - count++; - delay(300); - } - } - if(count == 3){ - return false; - } - return true; -} - bool SIM7000::check_send_cmd(const char* cmd, const char* resp, unsigned int timeout, unsigned int chartimeout) { char SIMbuffer[100]; diff --git a/参考文档(21-30)/LocReport/SIM7000.h b/参考文档(21-30)/LocReport/SIM7000.h index 6b41597..68c704c 100644 --- a/参考文档(21-30)/LocReport/SIM7000.h +++ b/参考文档(21-30)/LocReport/SIM7000.h @@ -9,15 +9,11 @@ class SIM7000 { public: + bool begin(Stream &port); bool check_send_cmd(const char* cmd, const char* resp, unsigned int timeout = DEFAULT_TIMEOUT, unsigned int chartimeout = DEFAULT_INTERCHAR_TIMEOUT); void sendCmd(const char* cmd); int readBuffer(char *buffer, int count, unsigned int timeout = DEFAULT_TIMEOUT, unsigned int chartimeout = DEFAULT_INTERCHAR_TIMEOUT); - bool setBaudRate(long rate); - bool checkSIMStatus(void); - bool begin(Stream &port); private: - char latitude[8]; - char longitude[8]; SoftwareSerial* mySerial; };