Chat app update, EspNow v2 & GPS Info (#460)
This commit is contained in:
@@ -36,6 +36,7 @@ bool isEnabled() {
|
||||
if (service != nullptr) {
|
||||
return service->isEnabled();
|
||||
} else {
|
||||
LOGGER.error("Service not found");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -79,6 +80,21 @@ void unsubscribeReceiver(ReceiverSubscription subscription) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t getVersion() {
|
||||
auto service = findService();
|
||||
if (service != nullptr) {
|
||||
return service->getVersion();
|
||||
}
|
||||
LOGGER.error("Service not found");
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t getMaxDataLength() {
|
||||
auto v = getVersion();
|
||||
if (v == 0) return 0;
|
||||
return v >= 2 ? MAX_DATA_LEN_V2 : MAX_DATA_LEN_V1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // CONFIG_SOC_WIFI_SUPPORTED && !CONFIG_SLAVE_SOC_WIFI_SUPPORTED
|
||||
|
||||
Reference in New Issue
Block a user