Code Monkey home page Code Monkey logo

sming-googlecast's Introduction

GoogleCast

This component allows you to communicate with Chrome Cast dongles or smart TVs that support the Google Cast Protocol.

Using

  1. Add these lines to your application componenent.mk file:

    COMPONENT_DEPENDS += GoogleCast
    ENABLE_SSL := Bearssl
  2. Add these lines to your application:

    #include <Network/GoogleCast/Client.h>
  3. Basic example:

    #include <Network/GoogleCast/Client.h>
    
    GoogleCast::Client castClient;
    
    void gotIp(IpAddress ip, IpAddress mask, IpAddress gateway)
    {
       // connect directly to the IP of the devise
       castClient.connect(IpAddress("192.168.10.15"));
    
       castClient.onConnect([](bool success) {
          Serial.print(F("Client connect: "));
          Serial.println(success ? "OK" : "FAIL");
          if(success) {
            // Starting YouTube on the device
            castClient.receiver.launch(APPID_YOUTUBE);
          }
       });
    }

Re-Generating C files from proto file

You can re-generate the C files from the proto file. This can be useful if you want to use a newer version of the Google Cast proto file. Make sure to compile it using nanopb. The re-generation can be done with the commands below:

cd $SMING_HOME/Libraries/GoogleCast/samples/basic
make python-requirements # should be executed once to download and install the required python packages
make rebuild-cast-proto

Protocol

There are multiple documents in internet that describe the Google Cast protocol and its inner workings. As a start one can take a look at the presentation and documents below.

App-Ids

List of current APP-IDS https://clients3.google.com/cast/chromecast/device/baseconfig

Individual app configurations are obtained from this url: https://clients3.google.com/cast/chromecast/device/app?a={appid}

Where {appid} is the id of the app, and the output of this is JSON in the format of a receiver app definition.

sming-googlecast's People

Contributors

mikee47 avatar slaff avatar slav-at-attachix avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mikee47

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.