rename htu to dhta ... c
This commit is contained in:
parent
4d90cd2e3f
commit
9355f678e3
2 changed files with 6 additions and 6 deletions
|
@ -52,7 +52,7 @@ RESOURCE(res_htu21dhum,
|
|||
NULL,
|
||||
NULL);
|
||||
|
||||
extern char dht_hum_s[8];
|
||||
extern char dhta_hum_s[8];
|
||||
|
||||
|
||||
static void
|
||||
|
@ -64,12 +64,12 @@ res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferr
|
|||
|
||||
if(accept == -1 || accept == REST.type.TEXT_PLAIN) {
|
||||
REST.set_header_content_type(response, REST.type.TEXT_PLAIN);
|
||||
snprintf((char *)buffer, REST_MAX_CHUNK_SIZE, "%s", dht_hum_s);
|
||||
snprintf((char *)buffer, REST_MAX_CHUNK_SIZE, "%s", dhta_hum_s);
|
||||
|
||||
REST.set_response_payload(response, buffer, strlen((char *)buffer));
|
||||
} else if(accept == REST.type.APPLICATION_JSON) {
|
||||
REST.set_header_content_type(response, REST.type.APPLICATION_JSON);
|
||||
snprintf((char *)buffer, REST_MAX_CHUNK_SIZE, "{'moisture':%s}", dht_hum_s);
|
||||
snprintf((char *)buffer, REST_MAX_CHUNK_SIZE, "{'moisture':%s}", dhta_hum_s);
|
||||
|
||||
REST.set_response_payload(response, buffer, strlen((char *)buffer));
|
||||
} else {
|
|
@ -52,7 +52,7 @@ RESOURCE(res_htu21dtemp,
|
|||
NULL,
|
||||
NULL);
|
||||
|
||||
extern char dht_temp_s[8];
|
||||
extern char dhta_temp_s[8];
|
||||
|
||||
static void
|
||||
res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||
|
@ -63,12 +63,12 @@ res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferr
|
|||
|
||||
if(accept == -1 || accept == REST.type.TEXT_PLAIN) {
|
||||
REST.set_header_content_type(response, REST.type.TEXT_PLAIN);
|
||||
snprintf((char *)buffer, REST_MAX_CHUNK_SIZE, "%s", dht_temp_s);
|
||||
snprintf((char *)buffer, REST_MAX_CHUNK_SIZE, "%s", dhta_temp_s);
|
||||
|
||||
REST.set_response_payload(response, buffer, strlen((char *)buffer));
|
||||
} else if(accept == REST.type.APPLICATION_JSON) {
|
||||
REST.set_header_content_type(response, REST.type.APPLICATION_JSON);
|
||||
snprintf((char *)buffer, REST_MAX_CHUNK_SIZE, "{'temperature':%s}", dht_temp_s);
|
||||
snprintf((char *)buffer, REST_MAX_CHUNK_SIZE, "{'temperature':%s}", dhta_temp_s);
|
||||
|
||||
REST.set_response_payload(response, buffer, strlen((char *)buffer));
|
||||
} else {
|
Loading…
Reference in a new issue