Skip to content

Commit

Permalink
modified: inc/openweather.h
Browse files Browse the repository at this point in the history
	new file:   inc/openweather_private.h.template
	modified:   src/app.c
  • Loading branch information
chris committed May 31, 2024
1 parent 1b2577e commit dfc32f0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
Binary file modified c_mX.bin
Binary file not shown.
4 changes: 3 additions & 1 deletion inc/openweather.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef OPEN_WEATHER_H
#define OPEN_WEATHER_H

#include "openweather_private.h"

/*** Request Parameters **/
#define OWAPI_DNS_PORT "\"api.openweathermap.org\",80"
#define OWAPI_DNS_PORT_LEN 27
Expand All @@ -19,7 +21,7 @@

// UNITS, METRICS and
#define OWAPI_GET_UNITSnKEY "&units=metric"\
"&appid=3c3d5b8f488f7c3f32b5f04165bf4bbe HTTP/1.1\r\n"\
"&appid=" OPENWEATHER_APP_ID " HTTP/1.1\r\n"\
"Host: api.openweathermap.org\r\n"\
"User-Agent: ERIKA RTOS/ESP8266/v1.0\r\n\r\n"
#define OWAPI_GET_UNITSnKEY_LEN 132 // length of requested resources
Expand Down
6 changes: 6 additions & 0 deletions inc/openweather_private.h.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef OPENWEATHER_PRIVATE_H
#define OPENWEATHER_PRIVATE_H

#define OPENWEATHER_APP_ID <OPENWEATHER_APP_ID>

#endif
9 changes: 7 additions & 2 deletions src/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,13 @@ static void spotify_token_processor(uint8_t *success, char *http, void *arg) {
return;
}

memcpy(token[iSPOTIFY_TOKEN], tokens_ptr[iSPOTIFY_TOKEN] + 1, sizes[iSPOTIFY_TOKEN] - 2);
memcpy(token[iSPOTIFY_RTOKEN], tokens_ptr[iSPOTIFY_RTOKEN] + 1, sizes[iSPOTIFY_RTOKEN] - 2);
memcpy(token[iSPOTIFY_TOKEN],\
tokens_ptr[iSPOTIFY_TOKEN] + 1,\
sizes[iSPOTIFY_TOKEN] - 2);

memcpy(token[iSPOTIFY_RTOKEN],\
tokens_ptr[iSPOTIFY_RTOKEN] + 1,\
sizes[iSPOTIFY_RTOKEN] - 2);

*success = 0;
}
Expand Down

0 comments on commit dfc32f0

Please sign in to comment.