Skip to content

Commit f5e96e5

Browse files
committed
added getVDD()
1 parent bd42c2c commit f5e96e5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/TheThingsNetwork.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,14 @@ size_t TheThingsNetwork::getHardwareEui(char *buffer, size_t size)
307307
return readResponse(SYS_TABLE, SYS_TABLE, SYS_GET_HWEUI, buffer, size);
308308
}
309309

310+
uint16_t TheThingsNetwork::getVDD()
311+
{
312+
if (readResponse(SYS_TABLE, SYS_TABLE, SYS_GET_VDD, buffer, sizeof(buffer)) > 0) {
313+
return atoi(buffer);
314+
}
315+
return 0;
316+
}
317+
310318
void TheThingsNetwork::debugPrintIndex(uint8_t index, const char *value)
311319
{
312320
char message[100];

src/TheThingsNetwork.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ class TheThingsNetwork
8383
void showStatus();
8484
size_t getHardwareEui(char *buffer, size_t size);
8585
size_t getAppEui(char *buffer, size_t size);
86+
uint16_t getVDD();
8687
void onMessage(void (*cb)(const uint8_t *payload, size_t size, port_t port));
8788
bool provision(const char *appEui, const char *appKey);
8889
bool join(const char *appEui, const char *appKey, int8_t retries = -1, uint32_t retryDelay = 10000);

0 commit comments

Comments
 (0)