-
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed wrong "inverter type can't be detected!" messages repaired NTP and static IP #459 MQTT status about availability and produce are retain messages now
- Loading branch information
Showing
11 changed files
with
96 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//----------------------------------------------------------------------------- | ||
// 2022 Ahoy, https://github.com/lumpapu/ahoy | ||
// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/ | ||
//----------------------------------------------------------------------------- | ||
|
||
#include "helper.h" | ||
|
||
namespace ah { | ||
void ip2Arr(uint8_t ip[], const char *ipStr) { | ||
memset(ip, 0, 4); | ||
char *tmp = new char[strlen(ipStr)+1]; | ||
strncpy(tmp, ipStr, strlen(ipStr)+1); | ||
char *p = strtok(tmp, "."); | ||
uint8_t i = 0; | ||
while(NULL != p) { | ||
ip[i++] = atoi(p); | ||
p = strtok(NULL, "."); | ||
} | ||
delete[] tmp; | ||
} | ||
|
||
// note: char *str needs to be at least 16 bytes long | ||
void ip2Char(uint8_t ip[], char *str) { | ||
if(0 == ip[0]) | ||
str[0] = '\0'; | ||
else | ||
snprintf(str, 16, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//----------------------------------------------------------------------------- | ||
// 2022 Ahoy, https://ahoydtu.de | ||
// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/ | ||
//----------------------------------------------------------------------------- | ||
|
||
#ifndef __HELPER_H__ | ||
#define __HELPER_H__ | ||
|
||
#include <cstdint> | ||
#include <cstring> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
namespace ah { | ||
void ip2Arr(uint8_t ip[], const char *ipStr); | ||
void ip2Char(uint8_t ip[], char *str); | ||
} | ||
|
||
#endif /*__HELPER_H__*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters