-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSimInterface.h
37 lines (32 loc) · 949 Bytes
/
SimInterface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
SIM_Interface.h - Library for MQTT protocol on SIM5320.
Created by Boris Deletic, October 30, 2018.
Released into the public domain.
*/
#ifndef SimInterface_h
#define SimInterface_h
#include <Arduino.h>
#include <Sim5320MQTT.h>
#include <SoftwareSerial.h>
class SimInterface
{
public:
SimInterface(SoftwareSerial* pntSim, const int simPowerPin, String provider, String IP);
bool sendATcommand(String cmd, String expected = "OK", unsigned int timeout = 1000, bool openTCP = false);
bool CheckOk (void);
bool verifyResponse(const char MQTT_ACK);
void setLogging(Stream* pntSer, bool verbosity);
String byteToHexStr (const uint8_t value, const String prefix = " 0x");
uint8_t ReadSim5320 (bool print /*= false*/);
void InitSim5320 (void);
void InitWeb (void);
private:
String network;
String netIP;
char gRxMsg[150];
const int powerPin;
bool _gDebug;
Stream* logSer;
SoftwareSerial* Sim5320;
};
#endif