AiThinker_A7
所属分类:GPS编程
开发工具:C++
文件大小:0KB
下载次数:0
上传日期:2017-07-06 09:36:23
上 传 者:
sh-1993
说明: ESP8266 Arduino库,用于与Ai Thinker A7(A6 A20)GSM GPRS模块通信
(An ESP8266 Arduino library for communicating with the Ai-Thinker A7 ( A6 A20 ) GSM GPRS module)
文件列表:
AiThinker_A7.cpp (9447, 2017-07-06)
AiThinker_A7.h (5022, 2017-07-06)
LICENSE (35141, 2017-07-06)
examples/ (0, 2017-07-06)
examples/send_sms/ (0, 2017-07-06)
examples/send_sms/send_sms.ino (462, 2017-07-06)
examples/tcp_demo/ (0, 2017-07-06)
examples/tcp_demo/tcp_demo.ino (1068, 2017-07-06)
examples/udp_demo/ (0, 2017-07-06)
examples/udp_demo/udp_demo.ino (553, 2017-07-06)
# AiThinker_A7
An ESP8266/Arduino library for communicating with the Ai-Thinker A7 ( A6 ) GSM module
Arduino's GSM mobile phone module library for Ai-Thinker A6 A7 A20 series chips, theoretically also support other devices using AT commands.
Provide SMS, call, GPRS networking (TCP UDP TCP data transmission) and other functions.
```
#include "AiThinker_A7.h"
#define GPRS_Serial_RX 7
#define GPRS_Serial_TX 8
#define GPRS_Power_pin 9
#define GPRS_Reset_pin 10
AiThinker_A7 Board(GPRS_Serial_RX, GPRS_Serial_TX,GPRS_Power_pin,GPRS_Reset_pin); // RX, TX
void setup() {
Serial.begin(115200);
//Board.debug();
Board.begin(9600);
// Start the network
Board.GPRS_Start();
// 1, send the data once:
Board.Send_once("www.fengpiao.net","9001","I'm Data");
// 2, send multiple data:
// establish connection
Board.TCP("www.fengpiao.net","9001");
for (size_t i = 0; i < 10; i++) {
Board.Send("I'm Data");
delay(2000);
}
// close the connection
Board.Close();
// 3, using transparent mode:
//establish connection
Board.TCP("www.fengpiao.net","9001");
// Enable heartbeat pack once every 60 seconds
Board.heartbeat("60");
// open through
Board.TC_Start();
for (size_t i = 0; i < 10; i++) {
Board.TC_Send("I'm Data");
delay(2000);
}
// exit transparent mode
Board.TC_Stop();
// 4, send UDP data
Board.UDP("www.fengpiao.net","9001");
for (size_t i = 0; i < 10; i++) {
Board.Send("I'm Data");
delay(2000);
}
//shut down
Board.Close();
}
void loop(void) {
}
```
近期下载者:
相关文件:
收藏者: