@@ -363,16 +363,16 @@ class BlinkerApi : public BlinkerProtocol
363
363
time_t startTime();
364
364
time_t runTime();
365
365
366
+ // template<typename T>
367
+ // bool sms(const T& msg);
366
368
template<typename T>
367
- bool sms(const T& msg);
368
- template<typename T>
369
- bool sms(const T& msg, const char* cel);
369
+ bool sms(const T& msg, const String & cel = "");
370
370
template<typename T>
371
- bool push(const T& msg);
371
+ bool push(const T& msg, const String & users = "" );
372
372
template<typename T>
373
373
bool wechat(const T& msg);
374
374
template<typename T>
375
- bool wechat(const String & title, const String & state, const T& msg);
375
+ bool wechat(const String & title, const String & state, const T& msg, const String & users = "" );
376
376
#if !defined(BLINKER_AT_MQTT)
377
377
void weather(uint32_t _city = 0);
378
378
void weatherForecast(uint32_t _city = 0);
@@ -5967,54 +5967,54 @@ float BlinkerApi::gps(b_gps_t axis)
5967
5967
}
5968
5968
}
5969
5969
5970
- template<typename T>
5971
- bool BlinkerApi::sms(const T& msg)
5972
- {
5973
- String _msg = STRING_format(msg);
5974
-
5975
- #if defined(BLINKER_MQTT) || defined(BLINKER_PRO) || \
5976
- defined(BLINKER_AT_MQTT) || defined(BLINKER_WIFI_GATEWAY) || \
5977
- defined(BLINKER_NBIOT_SIM7020) || defined(BLINKER_GPRS_AIR202) || \
5978
- defined(BLINKER_PRO_SIM7020) || defined(BLINKER_PRO_AIR202) || \
5979
- defined(BLINKER_MQTT_AUTO) || defined(BLINKER_PRO_ESP) || \
5980
- defined(BLINKER_LOWPOWER_AIR202) || defined(BLINKER_QRCODE_NBIOT_SIM7020) || \
5981
- defined(BLINKER_NBIOT_SIM7000) || defined(BLINKER_QRCODE_NBIOT_SIM7000) || \
5982
- defined(BLINKE_HTTP)
5983
- String data = BLINKER_F("{\"deviceName\":\"");
5984
- data += BProto::deviceName();
5985
- data += BLINKER_F("\",\"key\":\"");
5986
- data += BProto::authKey();
5987
- data += BLINKER_F("\",\"msg\":\"");
5988
- data += _msg;
5989
- data += BLINKER_F("\"}");
5990
- #elif defined(BLINKER_WIFI)
5991
- String data = BLINKER_F("{\"deviceName\":\"");
5992
- data += macDeviceName();
5993
- data += BLINKER_F("\",\"msg\":\"");
5994
- data += _msg;
5995
- data += BLINKER_F("\"}");
5996
- #elif defined(BLINKER_WIFI_SUBDEVICE)
5997
- String data = BLINKER_F("{\"sms\":\"");
5998
- data += _msg;
5999
- data += BLINKER_F("\"}");
6000
- #endif
6001
-
6002
- if (_msg.length() > 20) {
6003
- return false;
6004
- }
5970
+ // template<typename T>
5971
+ // bool BlinkerApi::sms(const T& msg)
5972
+ // {
5973
+ // String _msg = STRING_format(msg);
5974
+
5975
+ // #if defined(BLINKER_MQTT) || defined(BLINKER_PRO) || \
5976
+ // defined(BLINKER_AT_MQTT) || defined(BLINKER_WIFI_GATEWAY) || \
5977
+ // defined(BLINKER_NBIOT_SIM7020) || defined(BLINKER_GPRS_AIR202) || \
5978
+ // defined(BLINKER_PRO_SIM7020) || defined(BLINKER_PRO_AIR202) || \
5979
+ // defined(BLINKER_MQTT_AUTO) || defined(BLINKER_PRO_ESP) || \
5980
+ // defined(BLINKER_LOWPOWER_AIR202) || defined(BLINKER_QRCODE_NBIOT_SIM7020) || \
5981
+ // defined(BLINKER_NBIOT_SIM7000) || defined(BLINKER_QRCODE_NBIOT_SIM7000) || \
5982
+ // defined(BLINKE_HTTP)
5983
+ // String data = BLINKER_F("{\"deviceName\":\"");
5984
+ // data += BProto::deviceName();
5985
+ // data += BLINKER_F("\",\"key\":\"");
5986
+ // data += BProto::authKey();
5987
+ // data += BLINKER_F("\",\"msg\":\"");
5988
+ // data += _msg;
5989
+ // data += BLINKER_F("\"}");
5990
+ // #elif defined(BLINKER_WIFI)
5991
+ // String data = BLINKER_F("{\"deviceName\":\"");
5992
+ // data += macDeviceName();
5993
+ // data += BLINKER_F("\",\"msg\":\"");
5994
+ // data += _msg;
5995
+ // data += BLINKER_F("\"}");
5996
+ // #elif defined(BLINKER_WIFI_SUBDEVICE)
5997
+ // String data = BLINKER_F("{\"sms\":\"");
5998
+ // data += _msg;
5999
+ // data += BLINKER_F("\"}");
6000
+ // #endif
6001
+
6002
+ // if (_msg.length() > 20) {
6003
+ // return false;
6004
+ // }
6005
6005
6006
- #if defined(BLINKER_WIFI_SUBDEVICE)
6007
- if (!checkSMS()) return false;
6008
- _smsTime = millis();
6006
+ // #if defined(BLINKER_WIFI_SUBDEVICE)
6007
+ // if (!checkSMS()) return false;
6008
+ // _smsTime = millis();
6009
6009
6010
- return BProto::subPrint(data);
6011
- #else
6012
- return blinkerServer(BLINKER_CMD_SMS_NUMBER, data) != "false";
6013
- #endif
6014
- }
6010
+ // return BProto::subPrint(data);
6011
+ // #else
6012
+ // return blinkerServer(BLINKER_CMD_SMS_NUMBER, data) != "false";
6013
+ // #endif
6014
+ // }
6015
6015
6016
6016
template<typename T>
6017
- bool BlinkerApi::sms(const T& msg, const char* cel)
6017
+ bool BlinkerApi::sms(const T& msg, const String & cel)
6018
6018
{
6019
6019
String _msg = STRING_format(msg);
6020
6020
@@ -6065,7 +6065,7 @@ float BlinkerApi::gps(b_gps_t axis)
6065
6065
}
6066
6066
6067
6067
template<typename T>
6068
- bool BlinkerApi::push(const T& msg)
6068
+ bool BlinkerApi::push(const T& msg, const String & users )
6069
6069
{
6070
6070
String _msg = STRING_format(msg);
6071
6071
@@ -6083,12 +6083,16 @@ float BlinkerApi::gps(b_gps_t axis)
6083
6083
data += BProto::authKey();
6084
6084
data += BLINKER_F("\",\"msg\":\"");
6085
6085
data += _msg;
6086
+ data += BLINKER_F("\",\"receivers\":\"");
6087
+ data += users;
6086
6088
data += BLINKER_F("\"}");
6087
6089
#elif defined(BLINKER_WIFI)
6088
6090
String data = BLINKER_F("{\"deviceName\":\"");
6089
6091
data += macDeviceName();
6090
6092
data += BLINKER_F("\",\"msg\":\"");
6091
6093
data += _msg;
6094
+ data += BLINKER_F("\",\"receivers\":\"");
6095
+ data += users;
6092
6096
data += BLINKER_F("\"}");
6093
6097
#elif defined(BLINKER_WIFI_SUBDEVICE)
6094
6098
String data = BLINKER_F("{\"push\":\"");
@@ -6147,7 +6151,7 @@ float BlinkerApi::gps(b_gps_t axis)
6147
6151
}
6148
6152
6149
6153
template<typename T>
6150
- bool BlinkerApi::wechat(const String & title, const String & state, const T& msg)
6154
+ bool BlinkerApi::wechat(const String & title, const String & state, const T& msg, const String & users )
6151
6155
{
6152
6156
String _msg = STRING_format(msg);
6153
6157
@@ -6169,6 +6173,8 @@ float BlinkerApi::gps(b_gps_t axis)
6169
6173
data += state;
6170
6174
data += BLINKER_F("\",\"msg\":\"");
6171
6175
data += _msg;
6176
+ data += BLINKER_F("\",\"receivers\":\"");
6177
+ data += users;
6172
6178
data += BLINKER_F("\"}");
6173
6179
#elif defined(BLINKER_WIFI)
6174
6180
String data = BLINKER_F("{\"deviceName\":\"");
@@ -6179,6 +6185,8 @@ float BlinkerApi::gps(b_gps_t axis)
6179
6185
data += state;
6180
6186
data += BLINKER_F("\",\"msg\":\"");
6181
6187
data += _msg;
6188
+ data += BLINKER_F("\",\"receivers\":\"");
6189
+ data += users;
6182
6190
data += BLINKER_F("\"}");
6183
6191
#elif defined(BLINKER_WIFI_SUBDEVICE)
6184
6192
String data = BLINKER_F("{\"wechat\":\"");
0 commit comments