代码拉取完成,页面将自动刷新
#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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。