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.
Fork of Io_moon 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 T > | |
| void | virtualWrite (int pin, const T &data) |
| 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. | |
| void | syncVirtual (int pin) |
| 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. | |
| 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 24 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 262 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 227 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 211 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 183 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 247 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 sms | ( | const T & | msg ) |
| void syncAll | ( | ) |
Requests Server to re-send current values for all widgets.
Definition at line 146 of file BlynkApi.h.
| void syncVirtual | ( | int | pin ) |
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 156 of file BlynkApi.h.
| void tweet | ( | const T & | msg ) |
| void virtualWrite | ( | int | pin, |
| const T & | data | ||
| ) |
Sends value to a Virtual Pin.
- Parameters:
-
pin Virtual Pin number data Value to be sent
Definition at line 72 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 139 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 125 of file BlynkApi.h.
Generated on Tue Jul 19 2022 01:01:49 by
1.7.2
