Browse Source

Fixed XBee mux array compiler warning, updated readme

v_master
SRGDamia1 7 years ago
parent
commit
c4d2492902
2 changed files with 30 additions and 29 deletions
  1. +21
    -20
      README.md
  2. +9
    -9
      TinyGsmClientXBee.h

+ 21
- 20
README.md View File

@ -10,8 +10,8 @@ A small Arduino library for GSM modules, that just works.
[![GitHub stars](https://img.shields.io/github/stars/vshymanskyy/TinyGSM.svg)](https://github.com/vshymanskyy/TinyGSM/stargazers) [![GitHub stars](https://img.shields.io/github/stars/vshymanskyy/TinyGSM.svg)](https://github.com/vshymanskyy/TinyGSM/stargazers)
[![License](https://img.shields.io/badge/license-LGPL3-blue.svg)](https://github.com/vshymanskyy/TinyGSM/blob/master/LICENSE) [![License](https://img.shields.io/badge/license-LGPL3-blue.svg)](https://github.com/vshymanskyy/TinyGSM/blob/master/LICENSE)
If you like **TinyGSM** - give it a star, or fork it and contribute!
[![GitHub stars](https://img.shields.io/github/stars/vshymanskyy/TinyGSM.svg?style=social&label=Star)](https://github.com/vshymanskyy/TinyGSM/stargazers)
If you like **TinyGSM** - give it a star, or fork it and contribute!
[![GitHub stars](https://img.shields.io/github/stars/vshymanskyy/TinyGSM.svg?style=social&label=Star)](https://github.com/vshymanskyy/TinyGSM/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/vshymanskyy/TinyGSM.svg?style=social&label=Fork)](https://github.com/vshymanskyy/TinyGSM/network) [![GitHub forks](https://img.shields.io/github/forks/vshymanskyy/TinyGSM.svg?style=social&label=Fork)](https://github.com/vshymanskyy/TinyGSM/network)
You can also join our chat: You can also join our chat:
@ -35,29 +35,29 @@ TinyGSM also pulls data gently from the modem (whenever possible), so it can ope
## Features ## Features
Feature \ Modem | SIM800 | SIM8x8 | A6/A7/A20 | M590 | ESP8266
--- | --- | --- | --- | --- | ---
Feature \ Modem | SIM800 | SIM8x8 | A6/A7/A20 | M590 | ESP8266 | XBee
--- | --- | --- | --- | --- | --- |
**Data connections** **Data connections**
TCP (HTTP, MQTT, Blynk, ...) | ✔ | ✔ | ✔ | ✔ | ✔
UDP | | | | |
SSL/TLS (HTTPS) | ✔¹ | ✔¹ | 🅧 | 🅧 | ◌
TCP (HTTP, MQTT, Blynk, ...) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔
UDP | | | | | | ◌
SSL/TLS (HTTPS) | ✔¹ | ✔¹ | 🅧 | 🅧 | ◌ |
**USSD** **USSD**
Sending USSD requests | ✔ | ✔ | ✔ | ✔ |
Decoding 7,8,16-bit response | ✔ | ✔ | ✔ | ✔ |
Sending USSD requests | ✔ | ✔ | ✔ | ✔ | |
Decoding 7,8,16-bit response | ✔ | ✔ | ✔ | ✔ | |
**SMS** **SMS**
Sending | ✔ | ✔ | ✔ | ✔ |
Sending Unicode | ✔ | ✔ | ◌ | 🅧 |
Reading | | | | |
Incoming message event | | | | ? |
Sending | ✔ | ✔ | ✔ | ✔ | | ✔
Sending Unicode | ✔ | ✔ | ◌ | 🅧 | |
Reading | | | | | |
Incoming message event | | | | ? | |
**Calls** **Calls**
Dial, hangup | ✔ | ✔ | ✔ | 🅧 |
Receiving calls | ✔ | ✔ | ✔ | 🅧 |
Incoming event (RING) | ◌ | ◌ | ◌ | 🅧 |
DTMF sending | ◌ | ◌ | ◌ | 🅧 |
DTMF decoding | ◌ | ◌ | 🅧 | 🅧 |
Dial, hangup | ✔ | ✔ | ✔ | 🅧 | | 🅧
Receiving calls | ✔ | ✔ | ✔ | 🅧 | | 🅧
Incoming event (RING) | ◌ | ◌ | ◌ | 🅧 | | 🅧
DTMF sending | ◌ | ◌ | ◌ | 🅧 | | 🅧
DTMF decoding | ◌ | ◌ | 🅧 | 🅧 | | 🅧
**Location** **Location**
GSM location service | ✔ | ✔ | 🅧 | 🅧 |
GPS/GNSS | 🅧 | ✔² | ◌¹ | 🅧 |
GSM location service | ✔ | ✔ | 🅧 | 🅧 | | 🅧
GPS/GNSS | 🅧 | ✔² | ◌¹ | 🅧 | | 🅧
✔ - implemented  ◌ - planned  🅧 - not available for this modem ✔ - implemented  ◌ - planned  🅧 - not available for this modem
¹ - only some device models or firmware revisions have this feature ¹ - only some device models or firmware revisions have this feature
@ -70,6 +70,7 @@ GPS/GNSS | 🅧 | ✔² | ◌¹ | 🅧 |
- [x] AI-Thinker A6, A6C, A7 - [x] AI-Thinker A6, A6C, A7
- [x] Neoway M590 - [x] Neoway M590
- [x] ESP8266 (AT commands interface, similar to GSM modems) - [x] ESP8266 (AT commands interface, similar to GSM modems)
- [x] Digi XBee WiFi and Cellular (using XBee command mode)
### Supported modules ### Supported modules
- [x] GPRSbee - [x] GPRSbee


+ 9
- 9
TinyGsmClientXBee.h View File

@ -15,6 +15,8 @@
#define TINY_GSM_RX_BUFFER 256 #define TINY_GSM_RX_BUFFER 256
#endif #endif
#define TINY_GSM_MUX_COUNT 1 // Multi-plexing isn't supported using command mode
#include <TinyGsmCommon.h> #include <TinyGsmCommon.h>
#define GSM_NL "\r" #define GSM_NL "\r"
@ -59,11 +61,11 @@ class GsmClient : public Client
public: public:
GsmClient() {} GsmClient() {}
GsmClient(TinyGsm& modem, uint8_t mux = 1) {
GsmClient(TinyGsm& modem, uint8_t mux = 0) {
init(&modem, mux); init(&modem, mux);
} }
bool init(TinyGsm* modem, uint8_t mux = 1) {
bool init(TinyGsm* modem, uint8_t mux = 0) {
this->at = modem; this->at = modem;
this->mux = mux; this->mux = mux;
sock_connected = false; sock_connected = false;
@ -438,7 +440,7 @@ public:
private: private:
int modemConnect(const char* host, uint16_t port, uint8_t mux = 1) {
int modemConnect(const char* host, uint16_t port, uint8_t mux = 0) {
sendAT(GF("LA"), host); sendAT(GF("LA"), host);
String strIP; strIP.reserve(16); String strIP; strIP.reserve(16);
// wait for the response // wait for the response
@ -460,7 +462,7 @@ private:
return modemConnect(res, port); return modemConnect(res, port);
} }
int modemConnect(IPAddress ip, uint16_t port, uint8_t mux = 1) {
int modemConnect(IPAddress ip, uint16_t port, uint8_t mux = 0) {
String host; host.reserve(16); String host; host.reserve(16);
host += ip[0]; host += ip[0];
host += "."; host += ".";
@ -478,13 +480,13 @@ private:
return rsp; return rsp;
} }
int modemSend(const void* buff, size_t len, uint8_t mux = 1) {
int modemSend(const void* buff, size_t len, uint8_t mux = 0) {
stream.write((uint8_t*)buff, len); stream.write((uint8_t*)buff, len);
stream.flush(); stream.flush();
return len; return len;
} }
bool modemGetConnected(uint8_t mux = 1) {
bool modemGetConnected(uint8_t mux = 0) {
commandMode(); commandMode();
if (beeType == S6B) sendAT(GF("AI")); if (beeType == S6B) sendAT(GF("AI"));
else sendAT(GF("CI")); else sendAT(GF("CI"));
@ -625,9 +627,7 @@ private:
int guardTime; int guardTime;
XBeeType beeType; XBeeType beeType;
Stream& stream; Stream& stream;
GsmClient* sockets[1];
GsmClient* sockets[TINY_GSM_MUX_COUNT];
}; };
typedef TinyGsm::GsmClient TinyGsmClient;
#endif #endif

Loading…
Cancel
Save