@@ -929,7 +929,7 @@ void BlinkerMQTT::flush()
929
929
{
930
930
BLINKER_LOG_ALL (BLINKER_F (" flush" ));
931
931
932
- _needCheckShare = false ;
932
+ // _needCheckShare = false;
933
933
934
934
free (msgBuf_MQTT); isFresh_MQTT = false ; isAvail_MQTT = false ;
935
935
isAliAvail = false ; isDuerAvail = false ; isMIOTAvail = false ;// isBavail = false;
@@ -1863,125 +1863,6 @@ int BlinkerMQTT::connectServer() {
1863
1863
String host = BLINKER_F (BLINKER_SERVER_HOST);
1864
1864
String fingerprint = BLINKER_F (" 84 5f a4 8a 70 5e 79 7e f5 b3 b4 20 45 c8 35 55 72 f6 85 5a" );
1865
1865
1866
- // WiFiClientSecure client_s;
1867
-
1868
- // BearSSL::WiFiClientSecure *client_s;
1869
-
1870
- // client_s = new BearSSL::WiFiClientSecure();
1871
-
1872
- // BLINKER_LOG_ALL(BLINKER_F("connecting to "), host);
1873
-
1874
- // // BLINKER_LOG_FreeHeap();
1875
-
1876
- // uint8_t connet_times = 0;
1877
- // // client_s.stop();
1878
- // ::delay(100);
1879
-
1880
- // // bool mfln = client_s.probeMaxFragmentLength(host, httpsPort, 1024);
1881
- // // if (mfln) {
1882
- // // client_s.setBufferSizes(1024, 1024);
1883
- // // }
1884
- // client_s->setFingerprint(fingerprint.c_str());
1885
-
1886
- // client_s->setInsecure();
1887
-
1888
- // // while (1) {
1889
- // bool cl_connected = false;
1890
- // if (!client_s->connect(host, httpsPort)) {
1891
- // BLINKER_ERR_LOG(BLINKER_F("server connection failed"));
1892
- // // connet_times++;
1893
-
1894
- // ::delay(1000);
1895
- // }
1896
- // else {
1897
- // BLINKER_LOG_ALL(BLINKER_F("connection succeed"));
1898
- // cl_connected = true;
1899
-
1900
- // // break;
1901
- // }
1902
-
1903
- // // if (connet_times >= 4 && !cl_connected) return BLINKER_CMD_FALSE;
1904
- // // }
1905
-
1906
- // String client_msg;
1907
-
1908
- // String url_iot = BLINKER_F("/api/v1/user/device/diy/auth?authKey=");
1909
- // url_iot += _authKey;
1910
- // url_iot += _aliType;
1911
- // url_iot += _duerType;
1912
-
1913
- // // #if defined(BLINKER_ALIGENIE_LIGHT)
1914
- // // url_iot += BLINKER_F("&aliType=light");
1915
- // // #elif defined(BLINKER_ALIGENIE_OUTLET)
1916
- // // url_iot += BLINKER_F("&aliType=outlet");
1917
- // // #elif defined(BLINKER_ALIGENIE_SWITCH)
1918
- // // #elif defined(BLINKER_ALIGENIE_SENSOR)
1919
- // // url_iot += BLINKER_F("&aliType=sensor");
1920
- // // #endif
1921
-
1922
- // BLINKER_LOG_ALL(BLINKER_F("HTTPS begin: "), host, url_iot);
1923
-
1924
- // client_msg = BLINKER_F("GET ");
1925
- // client_msg += url_iot;
1926
- // client_msg += BLINKER_F(" HTTP/1.1\r\nHost: ");
1927
- // client_msg += host;
1928
- // client_msg += BLINKER_F(":");
1929
- // client_msg += STRING_format(httpsPort);
1930
- // client_msg += BLINKER_F("\r\nConnection: close\r\n\r\n");
1931
-
1932
- // client_s->print(client_msg);
1933
-
1934
- // BLINKER_LOG_ALL(BLINKER_F("client_msg: "), client_msg);
1935
-
1936
- // unsigned long timeout = millis();
1937
- // while (client_s->available() == 0) {
1938
- // if (millis() - timeout > 5000) {
1939
- // BLINKER_LOG_ALL(BLINKER_F(">>> Client Timeout !"));
1940
- // client_s->stop();
1941
- // return false;
1942
- // }
1943
- // }
1944
-
1945
- // String _dataGet;
1946
- // String lastGet;
1947
- // String lengthOfJson;
1948
- // while (client_s->available()) {
1949
- // // String line = client_s.readStringUntil('\r');
1950
- // _dataGet = client_s->readStringUntil('\n');
1951
-
1952
- // if (_dataGet.startsWith("Content-Length: ")){
1953
- // int addr_start = _dataGet.indexOf(' ');
1954
- // int addr_end = _dataGet.indexOf('\0', addr_start + 1);
1955
- // lengthOfJson = _dataGet.substring(addr_start + 1, addr_end);
1956
- // }
1957
-
1958
- // if (_dataGet == "\r") {
1959
- // BLINKER_LOG_ALL(BLINKER_F("headers received"));
1960
-
1961
- // break;
1962
- // }
1963
- // }
1964
-
1965
- // for(int i=0;i<lengthOfJson.toInt();i++){
1966
- // lastGet += (char)client_s->read();
1967
- // }
1968
-
1969
- // // BLINKER_LOG_FreeHeap();
1970
-
1971
- // client_s->stop();
1972
- // client_s->flush();
1973
-
1974
- // free(client_s);
1975
-
1976
- // // BLINKER_LOG_FreeHeap();
1977
-
1978
- // _dataGet = lastGet;
1979
-
1980
- // BLINKER_LOG_ALL(BLINKER_F("_dataGet: "), _dataGet);
1981
-
1982
- // String payload = _dataGet;
1983
-
1984
-
1985
1866
#ifndef BLINKER_WITHOUT_SSL
1986
1867
client_mqtt.stop ();
1987
1868
0 commit comments