Skip to content

Commit 3d4fcf9

Browse files
committed
Updated documentation
- Added SinricProTV
1 parent 24bd8ec commit 3d4fcf9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2457
-356
lines changed

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ HTML_TIMESTAMP = NO
13021302
# The default value is: YES.
13031303
# This tag requires that the tag GENERATE_HTML is set to YES.
13041304

1305-
HTML_DYNAMIC_MENUS = YES
1305+
HTML_DYNAMIC_MENUS = NO
13061306

13071307
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
13081308
# documentation will contain sections that can be hidden and shown after the

doc-examples/callbacks.cpp

Lines changed: 143 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,146 @@ bool onSetMode(const String &deviceId, String &mode) {
225225
Serial.printf("Device %s is set to mode %s\r\n", deviceId.c_str(), mode);
226226
return true; // request handled properly
227227
}
228-
//! [onSetMode]
228+
//! [onSetMode]
229+
230+
//! [onChangeChannel]
231+
// channelNames used to convert channelNumber into channelName
232+
// please put in your TV channel names
233+
// channel numbers starts counting from 0!
234+
// so "ZDF" is channel 2
235+
const char* channelNames[] = {
236+
"A/V",
237+
"ard",
238+
"ZDF",
239+
"n. d. r.",
240+
"kabel eins",
241+
"VOX",
242+
"Sat.1",
243+
"ProSieben",
244+
"rtl",
245+
"RTL II",
246+
"SUPER RTL",
247+
"KiKA"
248+
};
249+
250+
int tvChannel; // current channel selected
251+
252+
#define MAX_CHANNELS sizeof(channelNames) / sizeof(channelNames[0]) // just to determine how many channels are in channelNames array
253+
254+
// map channelNumbers used to convert channelName into channelNumber
255+
// This map is initialized in "setupChannelNumbers()" function by using the "channelNames" array
256+
std::map<String, unsigned int> channelNumbers;
257+
258+
void setupChannelNumbers() {
259+
for (unsigned int i=0; i < MAX_CHANNELS; i++) {
260+
channelNumbers[channelNames[i]] = i;
261+
}
262+
}
263+
264+
bool onChangeChannel(const String &deviceId, String &channel) {
265+
tvChannel = channelNumbers[channel]; // save new channelNumber in tvChannel variable
266+
Serial.printf("Change channel to \"%s\" (channel number %d)\r\n", channel.c_str(), tvChannel);
267+
return true;
268+
}
269+
//! [onChangeChannel]
270+
271+
//! [onChangeChannelNumber]
272+
// channelNames used to convert channelNumber into channelName
273+
// please put in your TV channel names
274+
// channel numbers starts counting from 0!
275+
// so "ZDF" is channel 2
276+
const char* channelNames[] = {
277+
"A/V",
278+
"ard",
279+
"ZDF",
280+
"n. d. r.",
281+
"kabel eins",
282+
"VOX",
283+
"Sat.1",
284+
"ProSieben",
285+
"rtl",
286+
"RTL II",
287+
"SUPER RTL",
288+
"KiKA"
289+
};
290+
291+
int tvChannel; // current channel selected
292+
293+
#define MAX_CHANNELS sizeof(channelNames) / sizeof(channelNames[0]) // just to determine how many channels are in channelNames array
294+
295+
// map channelNumbers used to convert channelName into channelNumber
296+
// This map is initialized in "setupChannelNumbers()" function by using the "channelNames" array
297+
std::map<String, unsigned int> channelNumbers;
298+
299+
void setupChannelNumbers() {
300+
for (unsigned int i=0; i < MAX_CHANNELS; i++) {
301+
channelNumbers[channelNames[i]] = i;
302+
}
303+
}
304+
305+
bool onChangeChannelNumber(const String& deviceId, int channelNumber, String& channelName) {
306+
tvChannel = channelNumber; // update tvChannel to new channel number
307+
if (tvChannel < 0) tvChannel = 0;
308+
if (tvChannel > MAX_CHANNELS-1) tvChannel = MAX_CHANNELS-1;
309+
310+
channelName = channelNames[tvChannel]; // return the channelName
311+
312+
Serial.printf("Change to channel to %d (channel name \"%s\")\r\n", tvChannel, channelName.c_str());
313+
return true;
314+
}
315+
//! [onChangeChannelNumber]
316+
317+
318+
//! [onSkipChannels]
319+
// channelNames used to convert channelNumber into channelName
320+
// please put in your TV channel names
321+
// channel numbers starts counting from 0!
322+
// so "ZDF" is channel 2
323+
const char* channelNames[] = {
324+
"A/V",
325+
"ard",
326+
"ZDF",
327+
"n. d. r.",
328+
"kabel eins",
329+
"VOX",
330+
"Sat.1",
331+
"ProSieben",
332+
"rtl",
333+
"RTL II",
334+
"SUPER RTL",
335+
"KiKA"
336+
};
337+
338+
int tvChannel; // current channel selected
339+
340+
#define MAX_CHANNELS sizeof(channelNames) / sizeof(channelNames[0]) // just to determine how many channels are in channelNames array
341+
342+
// map channelNumbers used to convert channelName into channelNumber
343+
// This map is initialized in "setupChannelNumbers()" function by using the "channelNames" array
344+
std::map<String, unsigned int> channelNumbers;
345+
346+
void setupChannelNumbers() {
347+
for (unsigned int i=0; i < MAX_CHANNELS; i++) {
348+
channelNumbers[channelNames[i]] = i;
349+
}
350+
}
351+
352+
bool onSkipChannels(const String &deviceId, const int channelCount, String &channelName) {
353+
tvChannel += channelCount; // calculate new channel number
354+
if (tvChannel < 0) tvChannel = 0;
355+
if (tvChannel > MAX_CHANNELS-1) tvChannel = MAX_CHANNELS-1;
356+
channelName = String(channelNames[tvChannel]); // return channel name
357+
358+
Serial.printf("Skip channel: %i (number: %i / name: \"%s\")\r\n", channelCount, tvChannel, channelName.c_str());
359+
360+
return true;
361+
}
362+
//! [onSkipChannels]
363+
364+
365+
//! [onSelectInput]
366+
bool onSelectInput(const String &deviceId, String &input) {
367+
Serial.printf("Device %s input changed to %s\r\n", deviceId.c_str(), input.c_str());
368+
return true;
369+
}
370+
//! [onSelectInput]

0 commit comments

Comments
 (0)