RokuECP 0.1
Control Roku devices remotely with ECP
 
Loading...
Searching...
No Matches
rokuecp Namespace Reference

RokuECP namespace. More...

Classes

struct  RokuApp
 Object containing information about a Roku channel (app) More...
 
struct  RokuAppIcon
 Object containing a Roku channel (app) icon. More...
 
struct  RokuDevice
 Object containing information about a Roku Device. More...
 
struct  RokuExtTVChannel
 Object containing extended information about a TV channel. More...
 
struct  RokuSearchParams
 Object containing information about a Roku search to be performed. More...
 
struct  RokuTVChannel
 Object containing information about a TV channel on a Roku device. More...
 
struct  RokuTVProgram
 Object containing information about a TV program on a Roku device. More...
 

Enumerations

enum  RokuSearchType {
  MOVIE , SHOW , PERSON ,
  APP , GAME , NONE
}
 enum Roku search filter (movie, TV show, person, app, game, or none)
 

Functions

int findRokuDevices (int maxDevices, char *deviceList[])
 Find Roku devices on the network using SSDP.
 
RokuDevice getRokuDevice (const char *url)
 Get information about a Roku Device from its ECP URL.
 
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.
 
int getRokuTVChannels (const RokuDevice *device, int maxChannels, RokuTVChannel channelList[])
 Get a list of TV channels accessible from a given Roku device.
 
RokuExtTVChannel getActiveRokuTVChannel (const RokuDevice *device)
 Get either the current or last active TV channel on a given Roku device.
 
int getRokuApps (const RokuDevice *device, int maxApps, RokuApp appList[])
 Get a list of apps on a given Roku device.
 
RokuApp getActiveRokuApp (const RokuDevice *device)
 Get the current active app on a given Roku device.
 
RokuAppIcon getRokuAppIcon (const RokuDevice *device, const RokuApp *app)
 Get a given app's icon.
 
int sendCustomRokuInput (const RokuDevice *device, int params, const char *names[], const char *values[])
 Send custom input to the currently active app on a given Roku device.
 
int rokuSearch (const RokuDevice *device, const char *keyword, const RokuSearchParams *params)
 Run search for a movie, TV show, person, or app.
 
int rokuTypeString (const RokuDevice *device, const wchar_t *string)
 Send Unicode string to Roku device as a series of keyboard keypresses.
 

Detailed Description

RokuECP namespace.

Function Documentation

◆ findRokuDevices()

int rokuecp::findRokuDevices ( int  maxDevices,
char *  deviceList[] 
)

Find Roku devices on the network using SSDP.

Parameters
maxDevicesMaximum integer number of devices to look for
deviceListArray (of size maxDevices) of C-strings (size 30), which will be updated to contain the ECP URLs of found Roku Devices. Remaining elements, if any, will be made empty strings.
Returns
Integer number of devices found within five seconds, or a negative gssdp error code

◆ getActiveRokuApp()

rokuecp::RokuApp rokuecp::getActiveRokuApp ( const RokuDevice device)

Get the current active app on a given Roku device.

Parameters
devicePointer to RokuDevice object representing the device to list the active app of
Returns
RokuApp object representing the current active app (Home if no app is active)

◆ getActiveRokuTVChannel()

rokuecp::RokuExtTVChannel rokuecp::getActiveRokuTVChannel ( const RokuDevice device)

Get either the current or last active TV channel on a given Roku device.

Parameters
devicePointer to RokuDevice object representing the device to list the active channel of
Returns
RokuTVChannel object representing the current or last active TV channel

◆ getRokuAppIcon()

rokuecp::RokuAppIcon rokuecp::getRokuAppIcon ( const RokuDevice device,
const RokuApp app 
)

Get a given app's icon.

Parameters
devicePointer to RokuDevice object representing the device on which the app is installed
appPointer to RokuApp object representing the app to get the icon of
Returns
RokuAppIcon object representing the app icon

◆ getRokuApps()

int rokuecp::getRokuApps ( const RokuDevice device,
int  maxApps,
RokuApp  appList[] 
)

Get a list of apps on a given Roku device.

Parameters
devicePointer to RokuDevice object representing the device to list the apps on
maxAppsInteger maximum number of apps to list
appListArray (of size maxApps) of RokuApp objects which will be updated to contain listed apps
Returns
Integer number of apps found, or -1 if the GET request failed, -2 if XML parsing failed, or -3 if app list is empty

◆ getRokuDevice()

rokuecp::RokuDevice rokuecp::getRokuDevice ( const char *  url)

Get information about a Roku Device from its ECP URL.

Parameters
urlC-string containing the Roku Device's ECP URL (like "http://192.168.1.162:8060/")
Returns
RokuDevice object representing the device

◆ getRokuTVChannels()

int rokuecp::getRokuTVChannels ( const RokuDevice device,
int  maxChannels,
RokuTVChannel  channelList[] 
)

Get a list of TV channels accessible from a given Roku device.

Parameters
devicePointer to RokuDevice object representing the device to list the channels of
maxChannelsInteger maximum number of channels to list
channelListArray (of size maxChannels) of RokuTVChannel objects which will be updated to contain listed channels
Returns
Integer number of channels found, or one of the following error codes: -1 if the GET request failed , -2 if XML parsing failed , -3 if channel list is empty , -4 if the device is not a TV.

◆ rokuSearch()

int rokuecp::rokuSearch ( const RokuDevice device,
const char *  keyword,
const RokuSearchParams params 
)

Run search for a movie, TV show, person, or app.

Either display the results or auto-launch the first one.

Parameters
devicePointer to RokuDevice object representing the device to run the search on
keywordC-string with the movie/show title, app name, person name, or other keyword to be searched
paramsPointer to RokuSearchParams object describing the parameters of the search
Returns
Result of search POST request, or -1 if device does not support searches, or -2 if keyword is empty

◆ rokuSendKey()

int rokuecp::rokuSendKey ( const RokuDevice device,
const char *  key 
)

Send a keypress to a Roku Device, emulating the press of a button on a Roku Remote.

Parameters
devicePointer to RokuDevice object representing the chosen device to send the keypress to
keyC-string containing the key code to send to the Roku. Accepted keys are listed at https://developer.roku.com/docs/developer-program/dev-tools/external-control-api.md#keypress-key-values.
Returns
Result of POST request or -1 if the selected key isn't valid for that device type

◆ rokuTypeString()

int rokuecp::rokuTypeString ( const RokuDevice device,
const wchar_t *  string 
)

Send Unicode string to Roku device as a series of keyboard keypresses.

Parameters
devicePointer to RokuDevice object representing the device to send the string to
stringWide Unicode C-string to send
Returns
Result of the last keypress request

◆ sendCustomRokuInput()

int rokuecp::sendCustomRokuInput ( const RokuDevice device,
int  params,
const char *  names[],
const char *  values[] 
)

Send custom input to the currently active app on a given Roku device.

Parameters
devicePointer to RokuDevice object representing the device to send input to
paramsInteger number of parameters to send
namesArray (size params) of C-strings with the names of the parameters
valuesArray (size params) of C-strings with the values of the parameters
Returns
Result of input POST request