mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-14 20:27:09 +01:00
Fix warnings
This commit is contained in:
@@ -88,11 +88,11 @@ ArRequestHandlerFunction _bindAPI(unsigned int apiID) {
|
||||
}
|
||||
|
||||
// Get response from callback
|
||||
char value[API_BUFFER_SIZE];
|
||||
char value[API_BUFFER_SIZE] = {0};
|
||||
(api.getFn)(value, API_BUFFER_SIZE);
|
||||
|
||||
// The response will be a 404 NOT FOUND if the resource is not available
|
||||
if (!value) {
|
||||
if (0 == value[0]) {
|
||||
DEBUG_MSG_P(PSTR("[API] Sending 404 response\n"));
|
||||
request->send(404);
|
||||
return;
|
||||
|
||||
@@ -84,6 +84,7 @@ uint8_t mapEvent(uint8_t event, uint8_t count, uint16_t length) {
|
||||
}
|
||||
if (count == 2) return BUTTON_EVENT_DBLCLICK;
|
||||
}
|
||||
return BUTTON_EVENT_NONE;
|
||||
}
|
||||
|
||||
void buttonEvent(unsigned int id, unsigned char event) {
|
||||
|
||||
@@ -63,7 +63,7 @@ template<typename T> bool setSetting(const String& key, T value);
|
||||
template<typename T> bool setSetting(const String& key, unsigned int index, T value);
|
||||
template<typename T> String getSetting(const String& key, T defaultValue);
|
||||
template<typename T> String getSetting(const String& key, unsigned int index, T defaultValue);
|
||||
bool settingsGetJson(JsonObject& data);
|
||||
void settingsGetJson(JsonObject& data);
|
||||
bool settingsRestoreJson(JsonObject& data);
|
||||
void settingsRegisterCommand(const String& name, void (*call)(Embedis*));
|
||||
void settingsInject(void *data, size_t len);
|
||||
|
||||
@@ -46,7 +46,7 @@ class StreamInjector : public Stream {
|
||||
}
|
||||
|
||||
virtual uint8_t inject(char *data, size_t len) {
|
||||
for (int i=0; i<len; i++) {
|
||||
for (uint8_t i=0; i<len; i++) {
|
||||
inject(data[i]);
|
||||
}
|
||||
return len;
|
||||
@@ -60,6 +60,7 @@ class StreamInjector : public Stream {
|
||||
|
||||
virtual size_t write(uint8_t ch) {
|
||||
if (_callback) _callback(ch);
|
||||
return 1;
|
||||
}
|
||||
|
||||
virtual int read() {
|
||||
|
||||
@@ -80,8 +80,8 @@ class WebSocketIncommingBuffer {
|
||||
private:
|
||||
|
||||
AwsMessageHandler _cb;
|
||||
bool _cb_on_fragments;
|
||||
bool _terminate_string;
|
||||
bool _cb_on_fragments;
|
||||
std::vector<uint8_t> *_buffer;
|
||||
|
||||
};
|
||||
|
||||
@@ -104,7 +104,7 @@ bool _schIsThisWeekday(time_t t, String weekdays){
|
||||
char pch;
|
||||
char * p = (char *) weekdays.c_str();
|
||||
unsigned char position = 0;
|
||||
while (pch = p[position++]) {
|
||||
while ((pch = p[position++])) {
|
||||
if ((pch - '0') == w) return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -382,7 +382,7 @@ bool settingsRestoreJson(JsonObject& data) {
|
||||
|
||||
}
|
||||
|
||||
bool settingsGetJson(JsonObject& root) {
|
||||
void settingsGetJson(JsonObject& root) {
|
||||
|
||||
// Get sorted list of keys
|
||||
std::vector<String> keys = _settingsKeys();
|
||||
|
||||
@@ -192,7 +192,7 @@ void _tspkPost(String data) {
|
||||
|
||||
#endif // THINGSPEAK_USE_ASYNC
|
||||
|
||||
bool _tspkEnqueue(unsigned char index, char * payload) {
|
||||
void _tspkEnqueue(unsigned char index, char * payload) {
|
||||
DEBUG_MSG_P(PSTR("[THINGSPEAK] Enqueuing field #%d with value %s\n"), index, payload);
|
||||
--index;
|
||||
if (_tspk_queue[index] != NULL) free(_tspk_queue[index]);
|
||||
@@ -230,7 +230,9 @@ bool tspkEnqueueRelay(unsigned char index, unsigned char status) {
|
||||
char payload[3] = {0};
|
||||
itoa(status ? 1 : 0, payload, 10);
|
||||
_tspkEnqueue(id, payload);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool tspkEnqueueMeasurement(unsigned char index, char * payload) {
|
||||
@@ -238,7 +240,9 @@ bool tspkEnqueueMeasurement(unsigned char index, char * payload) {
|
||||
unsigned char id = getSetting("tspkMagnitude", index, 0).toInt();
|
||||
if (id > 0) {
|
||||
_tspkEnqueue(id, payload);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void tspkFlush() {
|
||||
|
||||
Reference in New Issue
Block a user