mirror of
https://github.com/schinken/esp8266-geigercounter.git
synced 2024-11-24 09:30:20 +01:00
Fix custom hostname (#2)
- Changed HOSTNAME to constant macro definition so it is properly evaluated via #ifdef directive. - Increased max. hostname length to 24 characters.
This commit is contained in:
parent
4e1dbdd2b0
commit
0c10ef4ba9
2 changed files with 4 additions and 4 deletions
|
@ -30,7 +30,7 @@ char serialInputHelper[RECV_LINE_SIZE];
|
|||
int lastCPM = 0, currentCPM = 0;
|
||||
float lastuSv = 0, currentuSv = 0;
|
||||
|
||||
char hostname[16];
|
||||
char hostname[24];
|
||||
|
||||
void setup() {
|
||||
delay(3000);
|
||||
|
@ -55,9 +55,9 @@ void setup() {
|
|||
|
||||
|
||||
#ifdef HOSTNAME
|
||||
hostname = HOSTNAME;
|
||||
strncpy(hostname, HOSTNAME, sizeof(hostname));
|
||||
#else
|
||||
snprintf(hostname, 24, "GEIGERCTR-%X", chipid);
|
||||
snprintf(hostname, sizeof(hostname), "GEIGERCTR-%X", chipid);
|
||||
#endif
|
||||
|
||||
#ifdef USE_HA_AUTODISCOVERY
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#define BAUD_GEIGERCOUNTER 9600
|
||||
|
||||
//const char* HOSTNAME = "ESP-GeigerCounter"; //Optional
|
||||
//#define HOSTNAME "ESP-GeigerCounter" //Optional
|
||||
|
||||
const char* OTA_PASSWORD = "foobar";
|
||||
|
||||
|
|
Loading…
Reference in a new issue