diff --git a/CHANGELOG.md b/CHANGELOG.md index e636311..a7cb97c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,20 +15,11 @@ All notable changes to this project will be documented in this file. The format ### Added -- No aditional library is used anymore. All used dependencies are writen by me. -- JSON functions are added. These functions are used to parse the JSON data. -- Variables are now controlled by the library. This is used to control the variables in the library. -- Downloaded firmware is now MD5 checked. This is used for checking the downloaded firmware. -- Modem function added. This function is used to ON/OFF the modem. -- Modem function is alse used for controling the modem's power. -- Disconnect function added. This function is used to disconnect the device from the cloud. +- ... ### Changed -- Cloud function name is changed to Connect. -- Listen function is moved to public function. -- Firewall function is moved to public function. -- Syncronize_Time function is moved to public function. +- ... ### Removed @@ -44,6 +35,25 @@ All notable changes to this project will be documented in this file. The format --- +## [1.11.0] + +- No aditional library is used anymore. All used dependencies are writen by me. +- JSON functions are added. These functions are used to parse the JSON data. +- Variables are now controlled by the library. This is used to control the variables in the library. +- Downloaded firmware is now MD5 checked. This is used for checking the downloaded firmware. +- Modem function added. This function is used to ON/OFF the modem. +- Modem function is alse used for controling the modem's power. +- Disconnect function added. This function is used to disconnect the device from the cloud. + +- Cloud function name is changed to Connect. +- Listen function is moved to public function. +- Firewall function is moved to public function. +- Syncronize_Time function is moved to public function. +- Interrupt_Handler and JSON_Parser functions are moved to protected functions. +- Status variable is moved to private variable. + +--- + ## [1.10.0] - 2024-03-13 * Initial updates and first stable version. Detailed documentation is start from these release. diff --git a/library.json b/library.json index 04d3032..0f195ab 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "PostMan", - "version": "1.10.1", + "version": "1.11.0", "keywords": "GSM, Modem, GPRS, 2G, IoT, Telit, GE910, LE910, Backend, Cloud, PostOffice, API", "description": "GSM Based IoT, Cloud Server Integration Library.", "authors": diff --git a/library.properties b/library.properties index 0ef3a2a..4c7e3dd 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=PostOffice -version=1.10.1 +version=1.11.0 author=Gunce Akkoyun maintainer=Gunce Akkoyun sentence=GSM Based IoT, Cloud Server Integration Library. diff --git a/src/PostMan.h b/src/PostMan.h index e933b25..598b1ac 100644 --- a/src/PostMan.h +++ b/src/PostMan.h @@ -77,6 +77,9 @@ uint8_t Time_Zone = 0; } Time; + // Define Variables + uint8_t Status = 0x00; + // Clear Variables void Clear_Variables(void) { @@ -204,17 +207,25 @@ } // Remove Spaces from Char Array - void Remove_Spaces(char *str) { + void Remove_Spaces(char * _Buffer) { + + // Declare Buffer Variables + char * _Source = _Buffer; + char * _Desitination = _Buffer; + + // Loop for Buffer + while (* _Source) { + + // Control for Space + if (* _Source != ' ') * _Desitination++ = * _Source; + + // Increment Source + _Source++; - char *src = str; - char *dst = str; - while (*src) { - if (*src != ' ') { - *dst++ = *src; - } - src++; } - *dst = '\0'; + + // Set End of Buffer + * _Desitination = '\0'; } @@ -416,9 +427,8 @@ // "RSSI": 69, // "WDS": 25, // "ConnTime": 1.978, - // "TAC": 2242, - // "LAC": 0, - // "Cell_ID": 11915553 + // "MCC": 286, + // "MNC": 1 // } // Declare ConnTime Buffer @@ -498,6 +508,9 @@ // Protected Context protected: + // Define Instance + static Postman* Instance; + // Initalize GSM Module bool Initialize(void) { @@ -2165,22 +2178,7 @@ } - // Public Context - public: - - // Define Instance - static Postman* Instance; - - // Define Variables - uint8_t Status = 0x00; - // PCMSK1 Mask Handler Function - static void Interrupt_Handler_Static(void) { - - // Set Interrupt Handler - if (Instance) Instance->Interrupt_Handler(); - - } void Interrupt_Handler(void) { // Set Interrupt Handler @@ -2189,12 +2187,6 @@ } // JSON Parser Handler Function - static void JSON_Parser_Static(void) { - - // Set Interrupt Handler - if (Instance) Instance->JSON_Parser(); - - } void JSON_Parser(void) { // Declare JSON Size @@ -2268,6 +2260,25 @@ } + // Public Context + public: + + // PCMSK1 Mask Handler Function + static void Interrupt_Handler_Static(void) { + + // Set Interrupt Handler + if (Instance) Instance->Interrupt_Handler(); + + } + + // JSON Parser Handler Function + static void JSON_Parser_Static(void) { + + // Set Interrupt Handler + if (Instance) Instance->JSON_Parser(); + + } + // PostMan Constructor Postman(Stream &_Serial, B107AA* _B107AA, Variable* _Variable, PowerStat_Console* _Terminal) : LE910C1_EUX(_Serial), Hardware(_B107AA), Payload(_Variable), Terminal(_Terminal) { @@ -2957,7 +2968,7 @@ } // Send Data Batch Function - bool Publish(const uint8_t _Pack_Type) { + bool Publish(const uint8_t _Pack_Type = Pack_Update) { // Control for Modem Connection if (bitRead(this->Status, PostMan_Status_Connection)) {