Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit 54eb455

Browse files
committed
fix bug for setting hostString
1 parent 2513e0e commit 54eb455

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/esp8266-google-home-notifier.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ boolean GoogleHomeNotifier::device(const char *name, const char *locale, int to)
66
{
77
int timeout = millis() + to;
88
int n;
9-
char hostString[20];
10-
uint64_t chipid;
9+
char hostString[32];
1110
#ifdef ARDUINO_ARCH_ESP8266
12-
chipid = ESP.getChipId();
11+
sprintf(hostString, "ESP_%X", ESP.getChipId());
1312
#elif defined ARDUINO_ARCH_ESP32
14-
chipid = ESP.getEfuseMac() & 0x00000000FFFFFFFF;
13+
sprintf(hostString, "ESP_%llX", ESP.getEfuseMac());
1514
#else
1615
#error "ARDUINO_ARCH_ESP8266 or ARDUINO_ARCH_ESP32 has to be defined."
1716
#endif
18-
sprintf(hostString, "ESP_%06llX", chipid);
1917

2018
if (strcmp(this->m_name, name) != 0) {
2119
int i = 0;

0 commit comments

Comments
 (0)