Loading...
Searching...
No Matches
rokuecp.h
Go to the documentation of this file.
#ifndef ROKUECP_H
#define ROKUECP_H
#include <stdbool.h>
#include <stdint.h>
#include <wchar.h>
typedef struct {
char name[121];
char location[61];
char url[30];
char model[31];
char serial[14];
bool isTV;
bool isOn;
bool isLimited;
bool developerMode;
bool hasSearchSupport;
bool hasHeadphoneSupport;
bool headphonesConnected;
char resolution[8];
char macAddress[18];
char softwareVersion[10];
} RokuDevice;
typedef struct {
char id[8];
char name[8];
char type[14];
char network[25];
uint8_t physicalChannel;
unsigned long frequency;
} RokuTVChannel;
typedef struct {
char title[112];
char description[256];
char rating[15];
bool hasCC;
} RokuTVProgram;
typedef struct {
RokuTVChannel channel;
bool isActive;
RokuTVProgram program;
bool signalReceived;
char resolution[8];
uint8_t signalQuality;
int8_t signalStrength;
} RokuExtTVChannel;
typedef struct {
char id[14];
char name[31];
char type[5];
char version[22];
} RokuApp;
typedef struct {
const unsigned char* data;
unsigned long size;
} RokuAppIcon;
typedef struct {
enum {
MOVIE,
SHOW,
PERSON,
APP,
GAME,
NONE
} type;
bool includeUnavailable;
char tmsID[15];
unsigned short season;
bool autoSelect;
bool autoLaunch;
char providerIDs[14][8];
} RokuSearchParams;
typedef struct {
char appID[14];
char contentID[256];
enum {
FILM,
SERIES,
SEASON,
EPISODE,
SHORT_FORM_VIDEO,
TV_SPECIAL,
NO_TYPE
} mediaType;
const char** otherParamNames;
const char** otherParamValues;
size_t numOtherParams;
} RokuAppLaunchParams;
int findRokuDevices(const char* interface, size_t maxDevices, size_t urlStringSize, char* deviceList[]);
int getRokuDevice(const char* url, RokuDevice* device);
int rokuSendKey(const RokuDevice* device, const char* key);
int getRokuTVChannels(const RokuDevice* device, int maxChannels, RokuTVChannel channelList[]);
int getActiveRokuTVChannel(const RokuDevice* device, RokuExtTVChannel* channel);
int launchRokuTVChannel(const RokuDevice* device, const RokuTVChannel* channel);
int getRokuApps(const RokuDevice* device, int maxApps, RokuApp appList[]);
int getActiveRokuApp(const RokuDevice* device, RokuApp* app);
int launchRokuApp(const RokuDevice* device, const RokuAppLaunchParams* params);
int getRokuAppIcon(const RokuDevice* device, const RokuApp* app, RokuAppIcon* icon);
int sendCustomRokuInput(const RokuDevice* device, size_t params, const char* names[], const char* values[]);
int rokuSearch(const RokuDevice* device, const char* keyword, const RokuSearchParams* params);
int rokuTypeString(const RokuDevice* device, const wchar_t* string);
#endif //ROKUECP_H
findRokuDevices
int findRokuDevices(const char *interface, size_t maxDevices, size_t urlStringSize, char *deviceList[])
Find Roku devices on the network using SSDP.
Definition rokuecp.c:158
getRokuAppIcon
int getRokuAppIcon(const RokuDevice *device, const RokuApp *app, RokuAppIcon *icon)
Get a given app's icon.
Definition rokuecp.c:676
getRokuApps
int getRokuApps(const RokuDevice *device, int maxApps, RokuApp appList[])
Get a list of apps on a given Roku device.
Definition rokuecp.c:487
rokuSearch
int rokuSearch(const RokuDevice *device, const char *keyword, const RokuSearchParams *params)
Run search for a movie, TV show, person, or app.
Definition rokuecp.c:726
launchRokuApp
int launchRokuApp(const RokuDevice *device, const RokuAppLaunchParams *params)
Launch a given app on a given Roku device.
Definition rokuecp.c:608
launchRokuTVChannel
int launchRokuTVChannel(const RokuDevice *device, const RokuTVChannel *channel)
Launch a given Live TV channel on a given Roku device.
Definition rokuecp.c:470
getActiveRokuApp
int getActiveRokuApp(const RokuDevice *device, RokuApp *app)
Get the current active app on a given Roku device.
Definition rokuecp.c:550
rokuSendKey
int rokuSendKey(const RokuDevice *device, const char *key)
Send a keypress to a Roku Device, emulating the press of a button on a Roku Remote.
Definition rokuecp.c:256
rokuTypeString
int rokuTypeString(const RokuDevice *device, const wchar_t *string)
Send Unicode string to Roku device as a series of keyboard keypresses.
Definition rokuecp.c:798
getActiveRokuTVChannel
int getActiveRokuTVChannel(const RokuDevice *device, RokuExtTVChannel *channel)
Get either the current or last active TV channel on a given Roku device.
Definition rokuecp.c:356
sendCustomRokuInput
int sendCustomRokuInput(const RokuDevice *device, size_t params, const char *names[], const char *values[])
Send custom input to the currently active app on a given Roku device.
Definition rokuecp.c:699
getRokuDevice
int getRokuDevice(const char *url, RokuDevice *device)
Get information about a Roku Device from its ECP URL.
Definition rokuecp.c:187
getRokuTVChannels
int getRokuTVChannels(const RokuDevice *device, int maxChannels, RokuTVChannel channelList[])
Get a list of TV channels accessible from a given Roku device.
Definition rokuecp.c:283
RokuAppIcon
A Roku channel (app) icon.
Definition rokuecp.h:91
RokuAppIcon::size
unsigned long size
number of bytes pointed to by the data attribute
Definition rokuecp.h:93
RokuAppIcon::data
const unsigned char * data
pointer to icon data
Definition rokuecp.h:92
RokuAppLaunchParams
Parameters for Roku app launch command.
Definition rokuecp.h:115
RokuAppLaunchParams::otherParamValues
const char ** otherParamValues
Array of values for these extra parameters.
Definition rokuecp.h:128
RokuAppLaunchParams::otherParamNames
const char ** otherParamNames
Array of names for other parameters to pass to app.
Definition rokuecp.h:127
RokuAppLaunchParams::contentID
char contentID[256]
Optional unique identifier for a specific piece of content (empty string if none) up to 255 character...
Definition rokuecp.h:117
RokuAppLaunchParams::appID
char appID[14]
ID of Roku app to launch, up to 13 characters.
Definition rokuecp.h:116
RokuAppLaunchParams::numOtherParams
size_t numOtherParams
Number of extra parameters.
Definition rokuecp.h:129
RokuApp
Information about a Roku channel (app).
Definition rokuecp.h:83
RokuApp::version
char version[22]
App version, up to 21 characters.
Definition rokuecp.h:87
RokuApp::type
char type[5]
App type (usually "appl") up to 4 characters.
Definition rokuecp.h:86
RokuApp::name
char name[31]
App name, up to 30 characters.
Definition rokuecp.h:85
RokuDevice
Information about a Roku Device.
Definition rokuecp.h:27
RokuDevice::hasHeadphoneSupport
bool hasHeadphoneSupport
true if the device supports Private Listening
Definition rokuecp.h:38
RokuDevice::serial
char serial[14]
Device serial number, 13 characters.
Definition rokuecp.h:32
RokuDevice::developerMode
bool developerMode
true if the device has developer mode enabled
Definition rokuecp.h:36
RokuDevice::isLimited
bool isLimited
true if the device's "Control by mobile apps" setting is "Limited"
Definition rokuecp.h:35
RokuDevice::softwareVersion
char softwareVersion[10]
Device software version, up to 9 characters.
Definition rokuecp.h:42
RokuDevice::url
char url[30]
ECP URL for the device (like "http://192.168.1.162:8060/") up to 29 characters.
Definition rokuecp.h:30
RokuDevice::isTV
bool isTV
true if the device is a Roku TV
Definition rokuecp.h:33
RokuDevice::isOn
bool isOn
true if the device is currently powered on
Definition rokuecp.h:34
RokuDevice::name
char name[121]
Name of the device, up to Roku's 120-character maximum.
Definition rokuecp.h:28
RokuDevice::model
char model[31]
Device model, up to 30 characters.
Definition rokuecp.h:31
RokuDevice::location
char location[61]
Location of the device (like "Bedroom") up to Roku's 60-character maximum.
Definition rokuecp.h:29
RokuDevice::hasSearchSupport
bool hasSearchSupport
true if the device has search support
Definition rokuecp.h:37
RokuDevice::macAddress
char macAddress[18]
Device MAC address, 17 characters.
Definition rokuecp.h:41
RokuDevice::resolution
char resolution[8]
Device resolution (like "1080p") up to 7 characters.
Definition rokuecp.h:40
RokuDevice::headphonesConnected
bool headphonesConnected
true if the device is currently in Private Listening mode
Definition rokuecp.h:39
RokuExtTVChannel
Extended information about a TV channel.
Definition rokuecp.h:67
RokuExtTVChannel::isActive
bool isActive
true if the channel is currently playing on the TV.
Definition rokuecp.h:73
RokuExtTVChannel::program
RokuTVProgram program
The currently playing program.
Definition rokuecp.h:75
RokuExtTVChannel::signalStrength
int8_t signalStrength
Signal strength in dB.
Definition rokuecp.h:79
RokuExtTVChannel::signalQuality
uint8_t signalQuality
Signal quality level from 0-100.
Definition rokuecp.h:78
RokuExtTVChannel::resolution
char resolution[8]
Resolution at which the channel is available (like 1080i) up to 7 characters.
Definition rokuecp.h:77
RokuExtTVChannel::signalReceived
bool signalReceived
false if there is currently no signal
Definition rokuecp.h:76
RokuExtTVChannel::channel
RokuTVChannel channel
Base channel info.
Definition rokuecp.h:68
RokuSearchParams
Information about a Roku search to be performed.
Definition rokuecp.h:97
RokuSearchParams::autoSelect
bool autoSelect
true if the first result should automatically be selected
Definition rokuecp.h:109
RokuSearchParams::season
unsigned short season
season of the show to search for
Definition rokuecp.h:108
RokuSearchParams::tmsID
char tmsID[15]
TMS ID of the movie or show to search for, 14 characters.
Definition rokuecp.h:107
RokuSearchParams::includeUnavailable
bool includeUnavailable
true if results that are unavailable in your region should still be included
Definition rokuecp.h:106
RokuSearchParams::autoLaunch
bool autoLaunch
true if the first provider in providerIDs with a result found should be launched automatically
Definition rokuecp.h:110
RokuSearchParams::providerIDs
char providerIDs[14][8]
array of up to 8 Roku app IDs (up to 13 characters) for providers to look for results from (like "12"...
Definition rokuecp.h:111
RokuTVChannel
Information about a TV channel on a Roku device.
Definition rokuecp.h:46
RokuTVChannel::physicalChannel
uint8_t physicalChannel
integer physical RF channel number (2-69)
Definition rokuecp.h:51
RokuTVChannel::type
char type[14]
Channel type (like "air-digital") up to 13 characters.
Definition rokuecp.h:49
RokuTVChannel::frequency
unsigned long frequency
integer channel frequency in Hz (54-806 million)
Definition rokuecp.h:52
RokuTVChannel::network
char network[25]
Broadcast network label (Antenna, Cable, etc.) up to 24 characters.
Definition rokuecp.h:50
RokuTVChannel::name
char name[8]
Channel short name, up to 7 characters.
Definition rokuecp.h:48
RokuTVProgram
Information about a TV program on a Roku device.
Definition rokuecp.h:56
RokuTVProgram::rating
char rating[15]
Program rating (like TV-14) up to 14 characters.
Definition rokuecp.h:59
RokuTVProgram::description
char description[256]
Program description, up to 255 characters.
Definition rokuecp.h:58
RokuTVProgram::hasCC
bool hasCC
true if the program has closed captions available
Definition rokuecp.h:60
RokuTVProgram::title
char title[112]
Program title, up to 111 characters.
Definition rokuecp.h:57