SinricPro Library
MuteController< T >

MuteController. More...

Inheritance diagram for MuteController< T >:

Public Types

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

Public Member Functions

void onMute (MuteCallback cb)
 Set callback function for setMute request. More...
 
bool sendMuteEvent (bool mute, String cause="PHYSICAL_INTERACTION")
 Send setMute event to SinricPro Server indicating actual mute state. More...
 

Detailed Description

template<typename T>
class MuteController< T >

MuteController.

Member Typedef Documentation

◆ MuteCallback

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

Callback definition for onMute function.

Gets called when device receive a setMute request

Parameters
[in]deviceIdString which contains the ID of device
[in]mutetrue mute device
false unmute device
[out]mutetrue device is muted
false device is unmuted
Returns
the success of the request
Return values
truerequest handled properly
falserequest was not handled properly because of some error

Example-Code

bool onMute(const String &deviceId, bool &mute) {
Serial.printf("Device %s is %s\r\n", deviceId.c_str(), mute?"muted":"unmuted");
return true; // request handled properly
}
void onMute(MuteCallback cb)
Set callback function for setMute request.
Definition: MuteController.h:47

Member Function Documentation

◆ onMute()

void onMute ( MuteCallback  cb)

Set callback function for setMute request.

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

◆ sendMuteEvent()

bool sendMuteEvent ( bool  mute,
String  cause = "PHYSICAL_INTERACTION" 
)

Send setMute event to SinricPro Server indicating actual mute state.

Parameters
mutetrue = device is muted on
false = device is unmuted
cause(optional) String reason why event is sent (default = "PHYSICAL_INTERACTION")
Returns
the success of sending the even
Return values
trueevent has been sent successfully
falseevent has not been sent, maybe you sent to much events in a short distance of time