SinricPro Library
KeypadController< T >

KeypadController. More...

Public Types

using KeystrokeCallback = std::function< bool(const String &, String &)>
 Callback definition for onKeystroke function. More...
 

Public Member Functions

void onKeystroke (KeystrokeCallback cb)
 Set callback function for SendKeystroke request. More...
 

Detailed Description

template<typename T>
class KeypadController< T >

KeypadController.

Member Typedef Documentation

◆ KeystrokeCallback

using KeystrokeCallback = std::function<bool(const String &, String &)>

Callback definition for onKeystroke function.

Gets called when device receive a setBands request

Parameters
[in]deviceIdString which contains the ID of device
[in]keystrokeString keystroke
INFO, MORE, SELECT, UP, DOWN, LEFT, RIGHT, PAGE_UP, PAGE_DOWN, PAGE_LEFT, PAGE_RIGHT
[out]keystrokeString keystroke
INFO, MORE, SELECT, UP, DOWN, LEFT, RIGHT, PAGE_UP, PAGE_DOWN, PAGE_LEFT, PAGE_RIGHT
Returns
the success of the request
Return values
truerequest handled properly
falserequest was not handled properly because of some error

Example-Code

bool onKeystroke(const String& deviceId, String &keystroke) {
Serial.printf("Device %s, key %s pressed\r\n", deviceId.c_str(), keystroke.c_str());
return true;
}
void onKeystroke(KeystrokeCallback cb)
Set callback function for SendKeystroke request.
Definition: KeypadController.h:47

Member Function Documentation

◆ onKeystroke()

void onKeystroke ( KeystrokeCallback  cb)

Set callback function for SendKeystroke request.

Parameters
cbFunction pointer to a KeystrokeCallback function
Returns
void
See also
KeystrokeCallback