Seeed-Studio / GPRS_SIM900

library for GPRS shield with sim900 module.
MIT License
138 stars 96 forks source link

Added support for HardwareSerial #24

Closed boylesg closed 6 years ago

boylesg commented 6 years ago

GPRS::GPRS(HardwareSerial *pHWSerial, uint32_t baudRate): gprsSerial(60, 61) { inst = this; pHWSerial->begin(baudRate); sim900_init(pHWSerial); }

GPRS::GPRS(uint8_t tx, uint8_t rx, uint32_t baudRate): gprsSerial(tx, rx) { inst = this; gprsSerial.begin(baudRate); sim900_init(&gprsSerial); }

Stream *serialSIM900 = NULL;

void sim900_init(Stream* uart_device) { serialSIM900 = uart_device; } Are these functions really needed? Not used by any example sketches and no equivalent functions available in class HardwareSerial. void GPRS::listen(void) { gprsSerial.listen(); }

bool GPRS::isListening(void) { return gprsSerial.isListening(); }

lanselambor commented 6 years ago

That's good modification.