Testing the module's internet connection (spoiler: it doesn't work) WARNING: this code has been written in a hurry during an hackathon. It's total crap.
gsm.h
00001 #include "mbed.h" 00002 #ifndef MBED_GSM_H 00003 #define MBED_GSM_H 00004 00005 00006 extern Serial pc; 00007 00008 class GSM { 00009 public: 00010 GSM(PinName tx, PinName rx); 00011 Serial _gsm; 00012 00013 /* char* getGGA(); 00014 float longitude(); 00015 float latitude(); 00016 float time(); 00017 int ns(); 00018 int ew(); 00019 int lock();*/ 00020 private: 00021 void sample(); 00022 void getline(); 00023 char msg[128],gga[128]; 00024 int SMSid; 00025 /* float _longitude; 00026 float _latitude; 00027 float _time; 00028 char _ns, _ew; 00029 int _lock;*/ 00030 int flag_gsm_get; 00031 int flag_gsm_getend; 00032 int count; 00033 // int flag_gga; 00034 }; 00035 #endif 00036 00037 00038 00039 /*#include "mbed.h" 00040 #define GSMdbg 1 00041 00042 00043 extern Serial pc; 00044 extern void GSMtst1();*/
Generated on Sun Jul 17 2022 23:06:21 by 1.7.2