Skip to content

Commit b089f46

Browse files
committed
update codes, fix TIMESLOT DATA support codes.
1 parent c66011e commit b089f46

File tree

2 files changed

+36
-22
lines changed

2 files changed

+36
-22
lines changed

src/Blinker/BlinkerApi.h

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,9 +1560,9 @@ class BlinkerApi : public BlinkerProtocol
15601560

15611561
url_iot = BLINKER_F("/api/v1/storage/ts ");
15621562
#ifndef BLINKER_WITHOUT_SSL
1563-
http.begin("https://storage.diandeng.tech", url_iot);
1563+
http.begin(BLINKER_STORAGE_HTTP, url_iot);
15641564
#else
1565-
http.begin("http://storage.diandeng.tech", url_iot);
1565+
http.begin(BLINKER_STORAGE_HTTP, url_iot);
15661566
#endif
15671567
// http.addHeader(conType, application);
15681568
httpCode = http.POST(msg, conType, application);
@@ -1579,9 +1579,9 @@ class BlinkerApi : public BlinkerProtocol
15791579

15801580
url_iot = BLINKER_F("/api/v1/storage/text ");
15811581
#ifndef BLINKER_WITHOUT_SSL
1582-
http.begin("https://storage.diandeng.tech", url_iot);
1582+
http.begin(BLINKER_STORAGE_HTTP, url_iot);
15831583
#else
1584-
http.begin("http://storage.diandeng.tech", url_iot);
1584+
http.begin(BLINKER_STORAGE_HTTP, url_iot);
15851585
#endif
15861586
// http.addHeader(conType, application);
15871587
httpCode = http.POST(msg, conType, application);
@@ -2227,29 +2227,29 @@ class BlinkerApi : public BlinkerProtocol
22272227
case BLINKER_CMD_TIME_SLOT_DATA_NUMBER :
22282228
url_iot = BLINKER_F("/api/v1/storage/ts");
22292229
#ifndef BLINKER_WITHOUT_SSL
2230-
http.begin("https://storage.diandeng.tech", url_iot);
2230+
http.begin(BLINKER_STORAGE_HTTP, url_iot);
22312231
#else
2232-
http.begin("http://storage.diandeng.tech", url_iot);
2232+
http.begin(BLINKER_STORAGE_HTTP, url_iot);
22332233
#endif
22342234
// http.addHeader(conType, application);
22352235
httpCode = http.POST(msg, conType, application);
22362236
break;
22372237
case BLINKER_CMD_TEXT_DATA_NUMBER :
22382238
url_iot = BLINKER_F("/api/v1/storage/text");
22392239
#ifndef BLINKER_WITHOUT_SSL
2240-
http.begin("https://storage.diandeng.tech", url_iot);
2240+
http.begin(BLINKER_STORAGE_HTTP, url_iot);
22412241
#else
2242-
http.begin("http://storage.diandeng.tech", url_iot);
2242+
http.begin(BLINKER_STORAGE_HTTP, url_iot);
22432243
#endif
22442244
// http.addHeader(conType, application);
22452245
httpCode = http.POST(msg, conType, application);
22462246
break;
22472247
case BLINKER_CMD_JSON_DATA_NUMBER :
22482248
url_iot = BLINKER_F("/api/v1/storage/object");
22492249
#ifndef BLINKER_WITHOUT_SSL
2250-
http.begin("https://storage.diandeng.tech", url_iot);
2250+
http.begin(BLINKER_STORAGE_HTTP, url_iot);
22512251
#else
2252-
http.begin("http://storage.diandeng.tech", url_iot);
2252+
http.begin(BLINKER_STORAGE_HTTP, url_iot);
22532253
#endif
22542254
// http.addHeader(conType, application);
22552255
httpCode = http.POST(msg, conType, application);
@@ -12182,15 +12182,17 @@ char * BlinkerApi::widgetName_tab(uint8_t num)
1218212182
break;
1218312183
case BLINKER_CMD_TIME_SLOT_DATA_NUMBER :
1218412184
// url_iot = host;
12185-
// #ifndef BLINKER_WITHOUT_SSL
12186-
// url_iot = BLINKER_F("https://storage.diandeng.tech/api/v1/storage/ts");
12187-
// #else
12188-
// url_iot = BLINKER_F("http://storage.diandeng.tech/api/v1/storage/ts");
12189-
// #endif
12185+
#ifndef BLINKER_WITHOUT_SSL
12186+
url_iot = BLINKER_STORAGE_HTTP;
12187+
url_iot += BLINKER_F("/api/v1/storage/ts");
12188+
#else
12189+
url_iot = BLINKER_STORAGE_HTTP;
12190+
url_iot += BLINKER_F("/api/v1/storage/ts");
12191+
#endif
1219012192

1219112193

12192-
url_iot = host;
12193-
url_iot += BLINKER_F("/api/v1/user/device/cloud_storage/object");
12194+
// url_iot = host;
12195+
// url_iot += BLINKER_F("/api/v1/user/device/cloud_storage/object");
1219412196

1219512197
#if defined(ESP8266)
1219612198
#ifndef BLINKER_WITHOUT_SSL
@@ -12208,9 +12210,11 @@ char * BlinkerApi::widgetName_tab(uint8_t num)
1220812210
case BLINKER_CMD_TEXT_DATA_NUMBER :
1220912211
// url_iot = host;
1221012212
#ifndef BLINKER_WITHOUT_SSL
12211-
url_iot = BLINKER_F("https://storage.diandeng.tech/api/v1/storage/tt");
12213+
url_iot = BLINKER_STORAGE_HTTP;
12214+
url_iot += BLINKER_F("/api/v1/storage/tt");
1221212215
#else
12213-
url_iot = BLINKER_F("http://storage.diandeng.tech/api/v1/storage/tt");
12216+
url_iot = BLINKER_STORAGE_HTTP;
12217+
url_iot += BLINKER_F("/api/v1/storage/tt");
1221412218
#endif
1221512219

1221612220
#if defined(ESP8266)
@@ -12229,9 +12233,11 @@ char * BlinkerApi::widgetName_tab(uint8_t num)
1222912233
case BLINKER_CMD_JSON_DATA_NUMBER :
1223012234
// url_iot = host;
1223112235
#ifndef BLINKER_WITHOUT_SSL
12232-
url_iot = BLINKER_F("https://storage.diandeng.tech/api/v1/storage/ot");
12236+
url_iot = BLINKER_STORAGE_HTTP;
12237+
url_iot += BLINKER_F("/api/v1/storage/ot");
1223312238
#else
12234-
url_iot = BLINKER_F("http://storage.diandeng.tech/api/v1/storage/ot");
12239+
url_iot = BLINKER_STORAGE_HTTP;
12240+
url_iot += BLINKER_F("/api/v1/storage/ot");
1223512241
#endif
1223612242

1223712243
#if defined(ESP8266)

src/Server/BlinkerServer.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@
1010
#endif
1111

1212
#ifndef BLINKER_SERVER_HOST
13-
#define BLINKER_SERVER_HOST "iot.diandeng.tech"
13+
#define BLINKER_SERVER_HOST "iot.diandeng.tech"
14+
#endif
15+
16+
#ifndef BLINKER_STORAGE_HTTP
17+
#ifndef BLINKER_WITHOUT_SSL
18+
#define BLINKER_STORAGE_HTTP "https://storage.diandeng.tech"
19+
#else
20+
#define BLINKER_STORAGE_HTTP "http://storage.diandeng.tech"
21+
#endif
1422
#endif
1523

1624
#endif

0 commit comments

Comments
 (0)