Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Blynk_Example_WIZwiki-W7500
Fork of Blynk by
BlynkApi< Proto > Class Template Reference
Represents high-level functions of Blynk. More...
#include <BlynkApi.h>
Public Member Functions | |
| bool | connect (unsigned long timeout=BLYNK_TIMEOUT_MS *3) |
| Connects to the server. | |
| void | disconnect () |
| Disconnects from the server. | |
| bool | connected () |
| bool | run (bool available=false) |
| Performs Blynk-related housekeeping and processes incoming commands. | |
| template<typename... Args> | |
| void | virtualWrite (int pin, Args...values) |
| Sends value to a Virtual Pin. | |
| void | virtualWriteBinary (int pin, const void *buff, size_t len) |
| Sends buffer to a Virtual Pin. | |
| void | virtualWrite (int pin, const BlynkParam ¶m) |
| Sends BlynkParam to a Virtual Pin. | |
| void | syncAll () |
| Requests Server to re-send current values for all widgets. | |
| template<typename... Args> | |
| void | sendInternal (Args...params) |
| Sends internal command. | |
| template<typename... Args> | |
| void | syncVirtual (Args...pins) |
| Requests App or Server to re-send current value of a Virtual Pin. | |
| template<typename T > | |
| void | tweet (const T &msg) |
| Tweets a message. | |
| template<typename T > | |
| void | notify (const T &msg) |
| Sends a push notification to the App. | |
| template<typename T > | |
| void | sms (const T &msg) |
| Sends an SMS. | |
| template<typename T1 , typename T2 > | |
| void | email (const char *email, const T1 &subject, const T2 &msg) |
| Sends an email message. | |
| template<typename T1 , typename T2 > | |
| void | email (const T1 &subject, const T2 &msg) |
| Sends an email message. | |
| template<typename T , typename... Args> | |
| void | setProperty (int pin, const T &property, Args...values) |
| Sets property of a Widget. | |
| void | refresh (int pin) |
| Refreshes value of a widget by running user-defined BLYNK_READ handler of a pin. | |
| void | delay (unsigned long ms) |
| Delays for N milliseconds, handling server communication in background. | |
Detailed Description
template<class Proto>
class BlynkApi< Proto >
Represents high-level functions of Blynk.
Definition at line 25 of file BlynkApi.h.
Member Function Documentation
| bool connect | ( | unsigned long | timeout = BLYNK_TIMEOUT_MS *3 ) |
Connects to the server.
Blocks until connected or timeout happens. May take less or more then timeout value.
- Parameters:
-
timeout Connection timeout
- Returns:
- True if connected to the server
| bool connected | ( | ) |
- Returns:
- True if connected to the server
| void delay | ( | unsigned long | ms ) |
Delays for N milliseconds, handling server communication in background.
- Warning:
- Should be used very carefully, especially on platforms with small RAM.
- Parameters:
-
ms Milliseconds to wait
Definition at line 296 of file BlynkApi.h.
| void disconnect | ( | ) |
Disconnects from the server.
It will not try to reconnect, until connect() is called
| void email | ( | const T1 & | subject, |
| const T2 & | msg | ||
| ) |
Sends an email message.
- Parameters:
-
subject Subject of message msg Text of the message
Definition at line 207 of file BlynkApi.h.
| void email | ( | const char * | email, |
| const T1 & | subject, | ||
| const T2 & | msg | ||
| ) |
Sends an email message.
- Parameters:
-
email Email to send to subject Subject of message msg Text of the message
Definition at line 191 of file BlynkApi.h.
| void notify | ( | const T & | msg ) |
Sends a push notification to the App.
- Parameters:
-
msg Text of the message
Definition at line 163 of file BlynkApi.h.
| void refresh | ( | int | pin ) |
Refreshes value of a widget by running user-defined BLYNK_READ handler of a pin.
- Parameters:
-
pin Virtual Pin number
Definition at line 281 of file BlynkApi.h.
| bool run | ( | bool | available = false ) |
Performs Blynk-related housekeeping and processes incoming commands.
- Parameters:
-
available True if there is incoming data to process Only used when user manages connection manually.
| void sendInternal | ( | Args... | params ) |
Sends internal command.
Definition at line 122 of file BlynkApi.h.
| void setProperty | ( | int | pin, |
| const T & | property, | ||
| Args... | values | ||
| ) |
Sets property of a Widget.
- Parameters:
-
pin Virtual Pin number property Property name ("label", "labels", "color", ...) value Property value
Definition at line 225 of file BlynkApi.h.
| void sms | ( | const T & | msg ) |
| void syncAll | ( | ) |
Requests Server to re-send current values for all widgets.
Definition at line 114 of file BlynkApi.h.
| void syncVirtual | ( | Args... | pins ) |
Requests App or Server to re-send current value of a Virtual Pin.
This will probably cause user-defined BLYNK_WRITE handler to be called.
- Parameters:
-
pin Virtual Pin number
Definition at line 136 of file BlynkApi.h.
| void tweet | ( | const T & | msg ) |
| void virtualWrite | ( | int | pin, |
| Args... | values | ||
| ) |
Sends value to a Virtual Pin.
- Parameters:
-
pin Virtual Pin number data Value to be sent
Definition at line 73 of file BlynkApi.h.
| void virtualWrite | ( | int | pin, |
| const BlynkParam & | param | ||
| ) |
Sends BlynkParam to a Virtual Pin.
- Parameters:
-
pin Virtual Pin number param
Definition at line 103 of file BlynkApi.h.
| void virtualWriteBinary | ( | int | pin, |
| const void * | buff, | ||
| size_t | len | ||
| ) |
Sends buffer to a Virtual Pin.
- Parameters:
-
pin Virtual Pin number buff Data buffer len Length of data
Definition at line 89 of file BlynkApi.h.
Generated on Tue Jul 12 2022 17:30:45 by
1.7.2
