blynk & neopixelring & w7500

Fork of WIZwiki-7500_Blynk by IOP

Embed: (wiki syntax)

« Back to documentation index

BlynkApi< Proto > Class Template Reference

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 &param)
 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:
timeoutConnection 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:
msMilliseconds 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:
subjectSubject of message
msgText 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:
emailEmail to send to
subjectSubject of message
msgText of the message

Definition at line 191 of file BlynkApi.h.

void notify ( const T &  msg )

Sends a push notification to the App.

Parameters:
msgText 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:
pinVirtual Pin number

Definition at line 281 of file BlynkApi.h.

bool run ( bool  available = false )

Performs Blynk-related housekeeping and processes incoming commands.

Parameters:
availableTrue 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:
pinVirtual Pin number
propertyProperty name ("label", "labels", "color", ...)
valueProperty value

Definition at line 225 of file BlynkApi.h.

void sms ( const T &  msg )

Sends an SMS.

Parameters:
msgText of the message

Definition at line 176 of file BlynkApi.h.

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:
pinVirtual Pin number

Definition at line 136 of file BlynkApi.h.

void tweet ( const T &  msg )

Tweets a message.

Parameters:
msgText of the message

Definition at line 150 of file BlynkApi.h.

void virtualWrite ( int  pin,
Args...  values 
)

Sends value to a Virtual Pin.

Parameters:
pinVirtual Pin number
dataValue 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:
pinVirtual 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:
pinVirtual Pin number
buffData buffer
lenLength of data

Definition at line 89 of file BlynkApi.h.