Skip to content

Commit

Permalink
Added SIM7600 GNSS Power Control
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Jan 16, 2024
1 parent 492e471 commit 41c0d0a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/TinyGsmClientSIM7600.h
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,32 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600>,
protected:
// enable GPS
bool enableGPSImpl(int8_t power_en_pin ,uint8_t enable_level) {
if(power_en_pin == GSM_MODEM_AUX_POWER){
sendAT("+CVAUXV=2800");
waitResponse();
sendAT("+CVAUXS=1");
waitResponse();
}else if(power_en_pin != -1){
sendAT("+CGDRT=",power_en_pin,",1");
waitResponse();
sendAT("+CGSETV=",power_en_pin,",",enable_level);
waitResponse();
}
sendAT(GF("+CGPS=1"));
if (waitResponse() != 1) { return false; }
return true;
}

bool disableGPSImpl(int8_t power_en_pin ,uint8_t disbale_level) {
if(power_en_pin == GSM_MODEM_AUX_POWER){
sendAT("+CVAUXS=0");
waitResponse();
}else if(power_en_pin != -1){
sendAT("+CGSETV=",power_en_pin,",",disbale_level);
waitResponse();
sendAT("+CGDRT=",power_en_pin,",0");
waitResponse();
}
sendAT(GF("+CGPS=0"));
if (waitResponse() != 1) { return false; }
return waitResponse(30000UL,"+CGPS: 0") == 1;
Expand Down

0 comments on commit 41c0d0a

Please sign in to comment.