diff --git a/docs/_json_web_client_8cpp.html b/docs/_json_web_client_8cpp.html new file mode 100644 index 0000000..de957fb --- /dev/null +++ b/docs/_json_web_client_8cpp.html @@ -0,0 +1,89 @@ + + +
+ + + + +
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
Implementation of a simple web client receiving json uses an underlying implementation of Client interface. It implements a pseudo background behavior by providing a loop() method that can be polled and calls callback on receiving valid data. +More...
+#include "JsonWebClient.h"
Implementation of a simple web client receiving json uses an underlying implementation of Client interface. It implements a pseudo background behavior by providing a loop() method that can be polled and calls callback on receiving valid data.
+Part of TelegramBotClient (https://github.com/schlingensiepen/TelegramBotClient) Jörn Schlingensiepen joern @sch linge nsie pen.c om
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
Header of a simple web client receiving json uses an underlying implementation of Client interface. It implements a pseudo background behavior by providing a loop() method that can be polled and calls callback on receiving valid data. +More...
+#include "TBCDebug.h"
#include "Arduino.h"
#include <Client.h>
#include <ArduinoJson.h>
Go to the source code of this file.
++Classes | |
class | JsonWebClient |
+Macros | |
+#define | JsonWebClient_h |
+#define | JWC_BUFF_SIZE 10000 |
+#define | JWC_CALLBACK_MESSAGE_SIGNATURE void (*callbackSuccess)(void*, JwcProcessError, JsonObject&) |
+#define | JWC_CALLBACK_ERROR_SIGNATURE void (*callbackError)(void*, JwcProcessError, Client*) |
+Enumerations | |
enum | JwcProcessError : int { JwcProcessError::Ok = 0, +JwcProcessError::HttpErr = -1, +JwcProcessError::MsgTooBig = -2, +JwcProcessError::MsgJsonErr = -3 + } |
enum | JwcClientState : int { + JwcClientState::Unconnected = 0, +JwcClientState::Connected = 1, +JwcClientState::Waiting = 2, +JwcClientState::Headers = 3, + + JwcClientState::Json = 4 + + } |
Header of a simple web client receiving json uses an underlying implementation of Client interface. It implements a pseudo background behavior by providing a loop() method that can be polled and calls callback on receiving valid data.
+JSONWebClient (netClient, "www.example.com", 80, CallBackObject, callBackMessage, callBackError);.
+JwcClientState state = JwcClientState::Unconnected;.
+JwcProcessError state = JwcProcessError::Ok;.
+Part of TelegramBotClient (https://github.com/schlingensiepen/TelegramBotClient) Jörn Schlingensiepen joern @sch linge nsie pen.c om
+Enumeration to indicate internal process state of JsonWebClient.
+This class implements a minimum http client to receive json data from a host. It uses an underlying implementation of Client interface and can be used with raw client or ssl client.
+
+
|
+ +strong | +
+
|
+ +strong | +
Enumerator | |
---|---|
Ok | Everything Ok, no error + |
HttpErr | Not found HTTP 200 Header –> Server Error + |
MsgTooBig | Message bigger than JWC_BUFF_SIZE adjust JWC_BUFF_SIZE to avoid this, beware ArduinoJSON still needs to fit to your device's memory + |
MsgJsonErr | ArduinoJSON was not able to parse the message + |
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
Header of a simple client sending and receiving message via Telegram's Bot API. Uses one or two underlying objects implementing the Client interface. It implements a pseudo background behavior by providing a loop() method that can be polled and calls callback on receiving valid data. +More...
+#include "TBCDebug.h"
#include "Arduino.h"
#include <Client.h>
#include <ArduinoJson.h>
#include "JsonWebClient.h"
Go to the source code of this file.
++Classes | |
struct | Message |
struct | TBCKeyBoardRow |
class | TBCKeyBoard |
class | TelegramBotClient |
+Macros | |
+#define | TelegramBotClient_h |
+#define | TELEGRAMHOST F("api.telegram.org") |
+#define | TELEGRAMPORT 443 |
+#define | POLLINGTIMEOUT 600 |
+#define | USERAGENTSTRING F("telegrambotclient /0.1") |
+#define | TBC_CALLBACK_RECEIVE_SIGNATURE void (*callbackReceive)(TelegramProcessError, JwcProcessError, Message*) |
+#define | TBC_CALLBACK_ERROR_SIGNATURE void (*callbackError)(TelegramProcessError, JwcProcessError) |
+Enumerations | |
enum | TelegramProcessError : int { + TelegramProcessError::Ok = 0, +TelegramProcessError::JcwPollErr = -1, +TelegramProcessError::JcwPostErr = -2, +TelegramProcessError::RetPollErr = -3, + + TelegramProcessError::RetPostErr = -4 + + } |
Header of a simple client sending and receiving message via Telegram's Bot API. Uses one or two underlying objects implementing the Client interface. It implements a pseudo background behavior by providing a loop() method that can be polled and calls callback on receiving valid data.
+Telegram Bot Client.
+Class to represent a keyboard used in Telegram chat.
+Row in a keyboard.
+Telegram Message.
+TelegramProcessError state = TelegramProcessError::Ok;.
+Part of TelegramBotClient (https://github.com/schlingensiepen/TelegramBotClient) Jörn Schlingensiepen joern @sch linge nsie pen.c om
+Enumeration to indicate error or success of processing by TelegramBotClient.
+Struct to store elements of a Telegram Message (https://core.telegram.org/bots/api#message) and the update_id provided by each callback (https://core.telegram.org/bots/api#getting-updates)
+Struct to store elements of a Telegram key board
+This class represents a keyboard that can be displayed in a Telegram chat. Keyboards can be assembled by Rows including buttons. To add a row to a keyboard use push().
+Client to access Telegram's Bot API
+
+
|
+ +strong | +
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
CJsonWebClient | |
CJwcClientState | |
CJwcProcessError | |
CMessage | |
CTBCKeyBoard | |
CTBCKeyBoardRow | |
CTelegramBotClient | |
CTelegramProcessError |
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
This is the complete list of members for JsonWebClient, including all inherited members.
+CallBackObject | JsonWebClient | private |
ContentLength | JsonWebClient | private |
fire(String commands[], int count) | JsonWebClient | |
Host | JsonWebClient | private |
HttpStatusOk | JsonWebClient | private |
JsonWebClient(Client *netClient, String host, int port, void *callBackObject, JWC_CALLBACK_MESSAGE_SIGNATURE, JWC_CALLBACK_ERROR_SIGNATURE) | JsonWebClient | |
JWC_CALLBACK_ERROR_SIGNATURE | JsonWebClient | private |
JWC_CALLBACK_MESSAGE_SIGNATURE | JsonWebClient | private |
loop() | JsonWebClient | |
NetClient | JsonWebClient | private |
Port | JsonWebClient | private |
processHeader() | JsonWebClient | private |
processJson() | JsonWebClient | private |
reConnect() | JsonWebClient | private |
State | JsonWebClient | private |
state() | JsonWebClient | |
stop() | JsonWebClient |
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+Public Member Functions | |
JsonWebClient (Client *netClient, String host, int port, void *callBackObject, JWC_CALLBACK_MESSAGE_SIGNATURE, JWC_CALLBACK_ERROR_SIGNATURE) | |
bool | fire (String commands[], int count) |
Executes a list of commands. More... | |
JwcClientState | state () |
Current state of the client. More... | |
bool | loop () |
Method to poll client processing. More... | |
bool | stop () |
Stops the client. More... | |
+Private Member Functions | |
void | reConnect () |
Reconnects to host. More... | |
bool | processHeader () |
Process a header. More... | |
bool | processJson () |
Process JSON. More... | |
+Private Attributes | |
JwcClientState | State = JwcClientState::Unconnected |
Client * | NetClient |
String | Host |
int | Port |
long | ContentLength = JWC_BUFF_SIZE |
bool | HttpStatusOk = false |
void * | CallBackObject |
JWC_CALLBACK_MESSAGE_SIGNATURE | |
JWC_CALLBACK_ERROR_SIGNATURE | |
JsonWebClient::JsonWebClient | +( | +Client * | +netClient, | +
+ | + | String | +host, | +
+ | + | int | +port, | +
+ | + | void * | +callBackObject, | +
+ | + | JWC_CALLBACK_MESSAGE_SIGNATURE | +, | +
+ | + | JWC_CALLBACK_ERROR_SIGNATURE | ++ |
+ | ) | ++ |
Constructor, initializing all members
netClient | a object implementing Client interface to access the network. Using a Client implementing ssl feature will result in https otherwise http. |
host | Host to connect to |
port | Port to connect to |
callBackObject | Object passed to the callbacks, shall not be 0 |
JWC_CALLBACK_MESSAGE_SIGNATURE | Callback called on receiving a message / valid json data |
JWC_CALLBACK_ERROR_SIGNATURE | Callback called on error while receiving |
bool JsonWebClient::fire | +( | +String | +commands[], | +
+ | + | int | +count | +
+ | ) | ++ |
Executes a list of commands.
+[in] | commands[] | list of commands |
[in] | count | of commands |
Sends a list of commands to the server by calling println() for each command and flush() at the end of list. The commands shall follow the http protocol.
+ +bool JsonWebClient::loop | +( | +) | ++ |
Method to poll client processing.
+Method to poll client processing, shall be called in each main loop()
+ +
+
|
+ +private | +
Process a header.
+Read a header from NetClient and process it.
+ +
+
|
+ +private | +
Process JSON.
+Reads data from underlying Client and process it by ArduinoJSON
+ +
+
|
+ +private | +
Reconnects to host.
+Reconnects to host, skips open connection
+ +JwcClientState JsonWebClient::state | +( | +) | ++ |
Current state of the client.
+Make the current state of the client public accessible.
+ +bool JsonWebClient::stop | +( | +) | ++ |
Stops the client.
+Stops the underlying client connection and reset client state to JwcClientState::unconnected
+ +
+
|
+ +private | +
Object passed to the callbacks
+ +
+
|
+ +private | +
Content length stored during header processing
+ +
+
|
+ +private | +
Host to connect to
+ +
+
|
+ +private | +
Indicate if Http 200 Ok header was found
+ +
+
|
+ +private | +
Callback called on error while receiving
+ +
+
|
+ +private | +
Callback called on receiving a message / valid json data
+ +
+
|
+ +private | +
Client used to access the net (depends on hardware)
+ +
+
|
+ +private | +
Port to connect to
+ +
+
|
+ +private | +
Current state of the client
+ +
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
This is the complete list of members for TBCKeyBoard, including all inherited members.
+Count (defined in TBCKeyBoard) | TBCKeyBoard | private |
Counter (defined in TBCKeyBoard) | TBCKeyBoard | private |
get(const uint row, const uint col) | TBCKeyBoard | |
getOneTime() | TBCKeyBoard | inline |
getResize() | TBCKeyBoard | inline |
length(const uint row) | TBCKeyBoard | |
length() | TBCKeyBoard | |
OneTime | TBCKeyBoard | private |
push(uint count, const String buttons[]) | TBCKeyBoard | |
Resize | TBCKeyBoard | private |
Rows (defined in TBCKeyBoard) | TBCKeyBoard | private |
TBCKeyBoard(uint count, bool oneTime=false, bool resize=false) | TBCKeyBoard | |
~TBCKeyBoard() | TBCKeyBoard |
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+Public Member Functions | |
TBCKeyBoard (uint count, bool oneTime=false, bool resize=false) | |
Constructor. More... | |
~TBCKeyBoard () | |
Destructor. More... | |
TBCKeyBoard & | push (uint count, const String buttons[]) |
Adds a row to the keyboard. More... | |
const String | get (const uint row, const uint col) |
Gets a button text. More... | |
const int | length (const uint row) |
Length of row. More... | |
const int | length () |
Length of keyboard. More... | |
const bool | getOneTime () |
Gets value of OneTime. More... | |
const bool | getResize () |
Gets value of Resize. More... | |
+Private Attributes | |
+uint | Count |
+uint | Counter |
+TBCKeyBoardRow * | Rows |
bool | OneTime = false |
bool | Resize = false |
TBCKeyBoard::TBCKeyBoard | +( | +uint | +count, | +
+ | + | bool | +oneTime = false , |
+
+ | + | bool | +resize = false |
+
+ | ) | ++ |
Constructor.
+Constructor, initializing all members
count | The number of rows in keyboard. |
oneTime | value for OneTime |
resize | value for Resize |
TBCKeyBoard::~TBCKeyBoard | +( | +) | ++ |
Destructor.
+Destructor
+ +const String TBCKeyBoard::get | +( | +const uint | +row, | +
+ | + | const uint | +col | +
+ | ) | ++ |
Gets a button text.
+[in] | row | Index of row to fetch button text from |
[in] | col | Index of column to fetch button text from |
Gets the text of a button in given row and column
+ +
+
|
+ +inline | +
Gets value of OneTime.
+See OneTime, this methods makes it read only.
+ +
+
|
+ +inline | +
Gets value of Resize.
+See Resize, this methods makes it read only.
+ +const int TBCKeyBoard::length | +( | +const uint | +row | ) | ++ |
Length of row.
+[in] | row | Index of row to get length |
Gets the length of the row at the given index The length of a row is the number of buttons in this row.
+ +const int TBCKeyBoard::length | +( | +) | ++ |
Length of keyboard.
+Gets the length of the keyboard The length of a keyboard is the number of rows in this keyboard.
+ +TBCKeyBoard & TBCKeyBoard::push | +( | +uint | +count, | +
+ | + | const String | +buttons[] | +
+ | ) | ++ |
Adds a row to the keyboard.
+[in] | count | Number of buttons passend in buttons |
[in] | buttons | Button to be displayed in this row |
Adds a row to the keyboard containing buttons displaying the string passed in buttons[]
+ +
+
|
+ +private | +
Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again.
+Defaults to false.
+ + +
+
|
+ +private | +
Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
+Defaults to false.
+ + +
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
This is the complete list of members for TelegramBotClient, including all inherited members.
+begin(TBC_CALLBACK_RECEIVE_SIGNATURE, TBC_CALLBACK_ERROR_SIGNATURE) | TelegramBotClient | |
callbackPollError(void *obj, JwcProcessError err, Client *client) (defined in TelegramBotClient) | TelegramBotClient | inlinestatic |
callbackPollSuccess(void *obj, JwcProcessError err, JsonObject &json) (defined in TelegramBotClient) | TelegramBotClient | inlinestatic |
callbackPostError(void *obj, JwcProcessError err, Client *client) (defined in TelegramBotClient) | TelegramBotClient | inlinestatic |
callbackPostSuccess(void *obj, JwcProcessError err, JsonObject &json) (defined in TelegramBotClient) | TelegramBotClient | inlinestatic |
LastUpdateId | TelegramBotClient | private |
loop() | TelegramBotClient | |
Parallel | TelegramBotClient | private |
pollError(JwcProcessError err, Client *client) | TelegramBotClient | |
pollSuccess(JwcProcessError err, JsonObject &json) | TelegramBotClient | |
postError(JwcProcessError err, Client *client) | TelegramBotClient | |
postMessage(long chatId, String text, TBCKeyBoard &keyBoard) | TelegramBotClient | |
postMessage(long chatId, String text) | TelegramBotClient | inline |
postSuccess(JwcProcessError err, JsonObject &json) | TelegramBotClient | |
setCallbacks(TBC_CALLBACK_RECEIVE_SIGNATURE, TBC_CALLBACK_ERROR_SIGNATURE) | TelegramBotClient | |
SslPollClient | TelegramBotClient | private |
SslPostClient | TelegramBotClient | private |
startPolling() | TelegramBotClient | private |
startPosting(String Message) | TelegramBotClient | private |
TBC_CALLBACK_ERROR_SIGNATURE | TelegramBotClient | private |
TBC_CALLBACK_RECEIVE_SIGNATURE | TelegramBotClient | private |
TelegramBotClient(String token, Client &sslPollClient, Client &sslPostClient, TBC_CALLBACK_RECEIVE_SIGNATURE, TBC_CALLBACK_ERROR_SIGNATURE) | TelegramBotClient | |
TelegramBotClient(String token, Client &sslPollClient, Client &sslPostClient) | TelegramBotClient | inline |
TelegramBotClient(String token, Client &sslPollClient) | TelegramBotClient | inline |
Token | TelegramBotClient | private |
~TelegramBotClient() | TelegramBotClient |
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+Public Member Functions | |
TelegramBotClient (String token, Client &sslPollClient, Client &sslPostClient, TBC_CALLBACK_RECEIVE_SIGNATURE, TBC_CALLBACK_ERROR_SIGNATURE) | |
Constructor. More... | |
TelegramBotClient (String token, Client &sslPollClient, Client &sslPostClient) | |
Constructor. More... | |
TelegramBotClient (String token, Client &sslPollClient) | |
Constructor. More... | |
~TelegramBotClient () | |
Destructor. More... | |
void | begin (TBC_CALLBACK_RECEIVE_SIGNATURE, TBC_CALLBACK_ERROR_SIGNATURE) |
Alias for setCallbacks following Arduino convention. More... | |
void | setCallbacks (TBC_CALLBACK_RECEIVE_SIGNATURE, TBC_CALLBACK_ERROR_SIGNATURE) |
Sets callbacks. More... | |
bool | loop () |
Handles client background tasks. More... | |
void | postMessage (long chatId, String text, TBCKeyBoard &keyBoard) |
Post a message. More... | |
void | postMessage (long chatId, String text) |
Post a message. More... | |
void | pollSuccess (JwcProcessError err, JsonObject &json) |
Callback called by JSONWebClient. More... | |
void | pollError (JwcProcessError err, Client *client) |
Callback called by JSONWebClient. More... | |
void | postSuccess (JwcProcessError err, JsonObject &json) |
Callback called by JSONWebClient. More... | |
void | postError (JwcProcessError err, Client *client) |
Callback called by JSONWebClient. More... | |
+Static Public Member Functions | |
+static void | callbackPollSuccess (void *obj, JwcProcessError err, JsonObject &json) |
+static void | callbackPollError (void *obj, JwcProcessError err, Client *client) |
+static void | callbackPostSuccess (void *obj, JwcProcessError err, JsonObject &json) |
+static void | callbackPostError (void *obj, JwcProcessError err, Client *client) |
+Private Member Functions | |
void | startPolling () |
Starts polling. More... | |
void | startPosting (String Message) |
Starts posting a message. More... | |
+Private Attributes | |
long | LastUpdateId = 0 |
String | Token |
bool | Parallel = false |
JsonWebClient * | SslPollClient |
JsonWebClient * | SslPostClient |
TBC_CALLBACK_RECEIVE_SIGNATURE | |
TBC_CALLBACK_ERROR_SIGNATURE | |
TelegramBotClient::TelegramBotClient | +( | +String | +token, | +
+ | + | Client & | +sslPollClient, | +
+ | + | Client & | +sslPostClient, | +
+ | + | TBC_CALLBACK_RECEIVE_SIGNATURE | +, | +
+ | + | TBC_CALLBACK_ERROR_SIGNATURE | ++ |
+ | ) | ++ |
Constructor.
+Constructor, initializing all members including callbacks using different clients for posting and polling
token | secure token for your bot provided by BotFather. |
sslPollClient | SSL client used for polling messages from remote server |
sslPostClient | SSL client used for posting messages to remote server |
TBC_CALLBACK_RECEIVE_SIGNATURE | Callback called on receiving a message |
TBC_CALLBACK_ERROR_SIGNATURE | Callback called on error while receiving |
+
|
+ +inline | +
Constructor.
+Constructor, initializing only members no callbacks using different clients for posting and polling
token | secure token for your bot provided by BotFather. |
sslPollClient | SSL client used for polling messages from remote server |
sslPostClient | SSL client used for posting messages to remote server |
+
|
+ +inline | +
Constructor.
+Constructor, initializing only members no callbacks using the same client for posting and polling
token | secure token for your bot provided by BotFather. |
sslPollClient | SSL client used for polling messages from remote server |
sslPostClient | SSL client used for posting messages to remote server |
TelegramBotClient::~TelegramBotClient | +( | +) | ++ |
Destructor.
+Destructor
+ +void TelegramBotClient::begin | +( | +TBC_CALLBACK_RECEIVE_SIGNATURE | +, | +
+ | + | TBC_CALLBACK_ERROR_SIGNATURE | ++ |
+ | ) | ++ |
Alias for setCallbacks following Arduino convention.
+[in] | TBC_CALLBACK_RECEIVE_SIGNATURE | Callback called on receiving a message |
[in] | TBC_CALLBACK_ERROR_SIGNATURE | Callback called on error while receiving |
Alias for setCallbacks following Arduino convention sets callbacks
+ +bool TelegramBotClient::loop | +( | +) | ++ |
Handles client background tasks.
+Handles client background tasks, shall be calles in every main loop()
+ +void TelegramBotClient::pollError | +( | +JwcProcessError | +err, | +
+ | + | Client * | +client | +
+ | ) | ++ |
Callback called by JSONWebClient.
+[in] | err | Error Code from JwcProcessError |
[in] | client | Client that causes the problem. |
This is an internal method called by underlying JSONWebClient
+void TelegramBotClient::pollSuccess | +( | +JwcProcessError | +err, | +
+ | + | JsonObject & | +json | +
+ | ) | ++ |
Callback called by JSONWebClient.
+[in] | err | Error Code from JwcProcessError |
[in] | json | JsonObject generated by ArduinoJSON |
This is an internal method called by underlying JSONWebClient
+void TelegramBotClient::postError | +( | +JwcProcessError | +err, | +
+ | + | Client * | +client | +
+ | ) | ++ |
Callback called by JSONWebClient.
+[in] | err | Error Code from JwcProcessError |
[in] | client | Client that causes the problem. |
This is an internal method called by underlying JSONWebClient
+void TelegramBotClient::postMessage | +( | +long | +chatId, | +
+ | + | String | +text, | +
+ | + | TBCKeyBoard & | +keyBoard | +
+ | ) | ++ |
Post a message.
+[in] | chatId | Id of the chat the message shall be sent to. |
[in] | text | Text of the message |
[in] | keyBoard | Optional. Keyboard to be send with this message. |
Post a message to a given chat. (Only text messages and custom keyboards are supported, yet.)
+ +
+
|
+ +inline | +
Post a message.
+[in] | chatId | Id of the chat the message shall be sent to. |
[in] | text | Text of the message |
Post a message to a given chat. (Only text messages and custom keyboards are supported, yet.)
+ +void TelegramBotClient::postSuccess | +( | +JwcProcessError | +err, | +
+ | + | JsonObject & | +json | +
+ | ) | ++ |
Callback called by JSONWebClient.
+[in] | err | Error Code from JwcProcessError |
[in] | json | JsonObject generated by ArduinoJSON |
This is an internal method called by underlying JSONWebClient
+void TelegramBotClient::setCallbacks | +( | +TBC_CALLBACK_RECEIVE_SIGNATURE | +, | +
+ | + | TBC_CALLBACK_ERROR_SIGNATURE | ++ |
+ | ) | ++ |
Sets callbacks.
+[in] | TBC_CALLBACK_RECEIVE_SIGNATURE | Callback called on receiving a message |
[in] | TBC_CALLBACK_ERROR_SIGNATURE | Callback called on error while receiving |
sets callbacks for receiving message and error handling
+ +
+
|
+ +private | +
Starts polling.
+Starts the polling by open a http long call
+ +
+
|
+ +private | +
Starts posting a message.
+[in] | The | Message to post as json string |
Start the posting of a message by open a http post call
+ +
+
|
+ +private | +
Id of last update, used to generate a call returning only messages more recent than the last received.
+ +
+
|
+ +private | +
Indicates if the client uses two underlying client objects allowing posting while keeping the poll call open in parallel.
+ +
+
|
+ +private | +
Underlying client for polling.
+ +
+
|
+ +private | +
Underlying client for posting. In case of parallel mode it uses the same Client object than SslPollClient
+ +
+
|
+ +private | +
Callback called on error
+ +
+
|
+ +private | +
Callback called on receiving a message
+ +
+
|
+ +private | +
Secure Token provided by BotFather
+ +
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
| JwcClientState |
| TBCKeyBoardRow | |||
JwcProcessError | TelegramBotClient | |||||
JsonWebClient |
| TBCKeyBoard | TelegramProcessError | |||
Message | ||||||
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+Files | |
file | JsonWebClient.cpp |
Implementation of a simple web client receiving json uses an underlying implementation of Client interface. It implements a pseudo background behavior by providing a loop() method that can be polled and calls callback on receiving valid data. | |
file | JsonWebClient.h [code] |
Header of a simple web client receiving json uses an underlying implementation of Client interface. It implements a pseudo background behavior by providing a loop() method that can be polled and calls callback on receiving valid data. | |
file | TelegramBotClient.h [code] |
Header of a simple client sending and receiving message via Telegram's Bot API. Uses one or two underlying objects implementing the Client interface. It implements a pseudo background behavior by providing a loop() method that can be polled and calls callback on receiving valid data. | |
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
JsonWebClient.cpp | Implementation of a simple web client receiving json uses an underlying implementation of Client interface. It implements a pseudo background behavior by providing a loop() method that can be polled and calls callback on receiving valid data |
JsonWebClient.h | Header of a simple web client receiving json uses an underlying implementation of Client interface. It implements a pseudo background behavior by providing a loop() method that can be polled and calls callback on receiving valid data |
TBCDebug.h | |
TelegramBotClient.h | Header of a simple client sending and receiving message via Telegram's Bot API. Uses one or two underlying objects implementing the Client interface. It implements a pseudo background behavior by providing a loop() method that can be polled and calls callback on receiving valid data |
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
+ Telegram Bot Api Client
+ 0.5.0
+
+ ClientforaccessingTelegram'sBotAPI
+ |
+
t |