Command and Control (CaC) Tool

The Command and Control (CaC) Tool is a functional web sender for developers to test and debug a Web Receiver application.

Developers can use the CaC Tool to:

  • Launch a Web Receiver app on a Cast-enabled device and send a load request to start media playback.
  • Simulate voice commands sent by Google Assistant to the Web Receiver.
  • Capture logs from Cast Debug Logger and control the Web Receiver debug overlay.

Launch Web Receiver app

There are two ways to launch your Web Receiver with the CaC Tool:

  1. To start a new Cast session:

    1. Open the CaC Tool, enter your Web Receiver App ID and click the SET APP ID button.
    2. Click on the Cast button and select a device to launch the Web Receiver on a remote Cast-enabled device.

  2. To join an existing Cast session:

    1. Get the running Cast session ID by using the following codes:

      From the Web Receiver side, use the following method to get session ID in the Chrome Remote Debugger console:

      cast.framework.CastReceiverContext.getInstance().getApplicationData().sessionId;
      

      Or to get the session ID from a connected web sender, use the following method:

      cast.framework.CastContext.getInstance().getCurrentSession().getSessionId();
      
    2. Enter the session ID in the CaC Tool and click the RESUME button.

When the CaC Tool is connected to the Web Receiver app, the Cast button appears with a filled frame shape. The Web Receiver app ID and session ID are also displayed at the top of the tool.

Load media

Load media from either your sender app or the CaC Tool.

Sender app

To start media playback on your Web Receiver, cast your sender app to the same Cast-enabled device and send a load request from your sender app to the Web Receiver.

CaC Tool

The CaC Tool also provides multiple ways to send a load request to the Web Receiver app:

Load by entity (voice casting)

When users initiate media playback through Google Assistant, Google Assistant uses Command and Control (CaC) messages to send user credentials and entity to your Web Receiver.

The CaC Tool simulates voice casting and sends a load request with credentials and entity.

Load by content

The CaC Tool can also simulate your app sending a load request with Content ID or Content Url.

When a media playback starts, the CaC Tool receives Media Status messages from your Web Receiver app and displays them on the MEDIA STATUS tab.

Test voice commands

The CaC Tool also simulates voice commands sent by Google Assistant to your Web Receiver app. You can test if the media commands that your app supported are working properly. Non-supported media commands must be handled with appropriate error type and error reasons.

Inspect and control Cast Debug Logger

If your Web Receiver app enables Cast Debug Logger, the CaC Tool captures the log messages and controls the Web Receiver debug overlay.

Use the following buttons to control the Web Receiver and log messages:

  • Web Receiver App ID
    • Clear Cache and Stop Web Receiver - Reload the Web Receiver app and stop casting
  • Web Receiver Debug Overlay
    • Show - Toggle the debug overlay on the Web Receiver
    • Clear - Clear log messages on the Web Receiver debug overlay
  • Log Message Controls
    • Insert Message - Insert comments or dividers to the log area
    • Download Log - Save log messages
    • Clear Log - Clear log messages on the log area
  • Log Messages
    • Custom Tags - Click the checkbox to filter log messages