From b3fc9eedae8fdf103acb5b7f28161c505aa90571 Mon Sep 17 00:00:00 2001 From: Lukas_Skywalker Date: Sat, 9 Oct 2021 19:06:48 +0200 Subject: [PATCH] Add phone call implementation for SIM7600 --- README.md | 4 ++-- src/TinyGsmClientSIM7600.h | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 01e1be4..c71cc1c 100644 --- a/README.md +++ b/README.md @@ -145,9 +145,9 @@ Watch this repo for new updates! And of course, contributions are welcome ;) **Voice Calls** - Supported on: - - SIM800/SIM900, A6/A7, Quectel modems, u-blox + - SIM800/SIM900, SIM7600, A6/A7, Quectel modems, u-blox - Not yet supported on: - - SIM7000, SIM5360/5320/7100, SIM7500/7600/7800, VZM20Q (Monarch) + - SIM7000, SIM5360/5320/7100, SIM7500/7800, VZM20Q (Monarch) - Not possible on: - XBee (any type), u-blox SARA R4/N4, Neoway M590, ESP8266 (obviously) - Functions: diff --git a/src/TinyGsmClientSIM7600.h b/src/TinyGsmClientSIM7600.h index 55f50a0..9f47c5d 100644 --- a/src/TinyGsmClientSIM7600.h +++ b/src/TinyGsmClientSIM7600.h @@ -16,6 +16,7 @@ #define TINY_GSM_BUFFER_READ_AND_CHECK_SIZE #include "TinyGsmBattery.tpp" +#include "TinyGsmCalling.tpp" #include "TinyGsmGPRS.tpp" #include "TinyGsmGPS.tpp" #include "TinyGsmGSMLocation.tpp" @@ -54,7 +55,8 @@ class TinyGsmSim7600 : public TinyGsmModem, public TinyGsmTime, public TinyGsmNTP, public TinyGsmBattery, - public TinyGsmTemperature { + public TinyGsmTemperature, + public TinyGsmCalling { friend class TinyGsmModem; friend class TinyGsmGPRS; friend class TinyGsmTCP; @@ -65,6 +67,7 @@ class TinyGsmSim7600 : public TinyGsmModem, friend class TinyGsmNTP; friend class TinyGsmBattery; friend class TinyGsmTemperature; + friend class TinyGsmCalling; /* * Inner Client @@ -407,11 +410,10 @@ class TinyGsmSim7600 : public TinyGsmModem, * Phone Call functions */ protected: - bool callAnswerImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED; - bool callNumberImpl(const String& number) TINY_GSM_ATTR_NOT_IMPLEMENTED; - bool callHangupImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED; - bool dtmfSendImpl(char cmd, - int duration_ms = 100) TINY_GSM_ATTR_NOT_IMPLEMENTED; + bool callHangupImpl() { + sendAT(GF("+CHUP")); + return waitResponse() == 1; + } /* * Messaging functions