1 Star 0 Fork 0

DFRobot/DFRobot_L218

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
DFRobot_L218.h 1.88 KB
一键复制 编辑 原始数据 按行查看 历史
black5heep 提交于 2018-07-10 14:28 +08:00 . add http
#ifndef __DFRobot_L218_H__
#define __DFRobot_L218_H__
#include <Arduino.h>
//#include <stdint.h>
//#include <Wire.h>
//#include <stdio.h>
#define DEFAULT_TIMEOUT 5
#define DEFAULT_INTERCHAR_TIMEOUT 500
enum Protocol {
TCP = 1,
UDP = 2,
};
class DFRobot_L218
{
public:
void init(void);
void cleanBuffer(char *buffer,int count);
void blink(int times , int interval);
void sleepMode(void);
void wakeUp(void);
void turnOFF(void);
bool turnON(void);
bool checkTurnON(void);
bool getPos(void);
bool initPos(void);
bool checkSIMcard(void);
bool initNetwork(void);
bool beginSMS(const char* phoneNumber);
bool sendSMS(const char* content);
bool connect(char *server,Protocol ptl,int port);
bool disconnect(void);
bool mqttConnect(char* iot_client, char* iot_username, char* iot_key);
bool mqttPublish(char* iot_topic, String iot_data);
bool mqttSubscribe(char* iot_topic);
bool mqttUnsubscribe(char* iot_topic);
bool mqttRecv(char* iot_topic, char* buf, int maxlen);
bool mqttDisconnect(void);
bool httpInit(void);
bool httpConnect(const char *Host);
bool httpPost(const char *Host , String data);
void httpGet(const char *Host);
void httpDisconnect(void);
void get_String(void);
bool voiceCall(const char* phoneNumber);
bool check_send_cmd(const char* cmd, const char* resp, unsigned int timeout = DEFAULT_TIMEOUT, unsigned int chartimeout = DEFAULT_INTERCHAR_TIMEOUT);
int readBuffer(char *buffer, int count, unsigned int timeout = DEFAULT_TIMEOUT, unsigned int chartimeout = DEFAULT_INTERCHAR_TIMEOUT);
int checkBattery(void);
double getLongitude(void);
double getLatitude(void);
private:
double longitude_m = 0;
double latitude_m = 0;
};
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/dfrobot/DFRobot_L218.git
git@gitee.com:dfrobot/DFRobot_L218.git
dfrobot
DFRobot_L218
DFRobot_L218
master

搜索帮助