C library to interact with Roku devices remotely with ECP.
Dependencies
- libsoup 3
- gssdp 1.6
- libxml2 2.13
Compatibility
Should work with anything supported by the dependencies above. Tested on Linux, macOS, and Windows (build with MinGW).
Example usage
This example assumes there are 4 or less Roku devices on the local network and finds them, then prints their names.
#include <stdio.h>
#include <stdlib.h>
int main() {
char* urlList[4];
for (int i = 0; i < 4; i++) {
urlList[i] = malloc(30);
}
for (int i = 0; i < devicesFound; i++) {
printf(
"Device %d: %s\n", i + 1, device.
name);
}
for (int i = 0; i < 4; i++) {
free(urlList[i]);
}
}
RokuECP: Interact with Roku devices using ECP.
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
int getRokuDevice(const char *url, RokuDevice *device)
Get information about a Roku Device from its ECP URL.
Definition rokuecp.c:187
Information about a Roku Device.
Definition rokuecp.h:27
char name[121]
Name of the device, up to Roku's 120-character maximum.
Definition rokuecp.h:28
API Reference
A complete API reference is available at https://benthetechguy.github.io/rokuecp/rokuecp_8h.html
Build and install
mkdir build && cd build
cmake ..
cmake --build .
sudo cmake --install .