code

Dependencies:   MPU6050_SIM5320_TEST SDFileSystem WakeUp

Fork of Nucleo_L476RG_SDCard_WorkingSample by M J.

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SIM5320.h Source File

SIM5320.h

00001 #ifndef _SIM5320_H_
00002 #define _SIM5320_H_
00003 
00004 #include "mbed.h"
00005 #include <string>
00006 
00007 
00008 #define BUFFER_SIZE 512
00009 
00010 class SIM5320 {
00011 private:      
00012  char* concatChars(const char* in1, const char* in2, const char* in3);
00013  void rxInterrupt();
00014 public:
00015   SIM5320();
00016   SIM5320(PinName tx, PinName rx, bool debug = false); 
00017   string readBuffer();
00018   Serial SIM5320Serial; 
00019   Serial debugSerial; 
00020   char rx_buffer[BUFFER_SIZE];
00021   void flushBuffer();
00022   int rx_in; 
00023 
00024   bool connect(const char *apn, const char *userName, const char *passPhrase);
00025   bool disconnect();
00026   bool enableGPS(bool isEnabled);
00027   
00028   string sendCommand(const char *command, uint8_t timeout = 20);           
00029   uint8_t sendCommandAndCheck(const char *command, const char *response, uint8_t timeout = 20);  
00030 
00031   void printDebug(const char *line);
00032 
00033 };
00034 #endif