Skip to content

Commit

Permalink
Doc updates, renamed a function
Browse files Browse the repository at this point in the history
  • Loading branch information
sharadb-amazon committed Apr 17, 2024
1 parent 7a2d846 commit b88be43
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/tv-casting-app/APIs.md
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ func startDiscovery() {
}
```

Note: You will need to connect with a Casting Player as described below to see
Note: You will need to connect with a Casting Player as described below to se
the list of Endpoints that they support. Refer to the
[Connection](#connect-to-a-casting-player) section for details on how to
discover available endpoints supported by a Casting Player.
Expand Down Expand Up @@ -864,7 +864,7 @@ On Android, it can select an `Endpoint` as shown below.
```java
private static final Integer SAMPLE_ENDPOINT_VID = 65521;
private Endpoint selectEndpoint()
private Endpoint selectFirstEndpointByVID()
{
Endpoint endpoint = null;
if(selectedCastingPlayer != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ public class GlobalCastingConstants {
public static final int SetupPasscode = 20202021;
public static final int Discriminator = 0xF00;
public static final boolean ChipCastingSimplified =
true; // set this flag to true to demo simplified casting APIs
true; // set to true, to demo the simplified casting APIs. Otherwise, the older deprecated
// APIs are invoked
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public View onCreateView(
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
this.readButtonClickListener =
v -> {
Endpoint endpoint = EndpointSelectorExample.selectEndpointByVID(selectedCastingPlayer);
Endpoint endpoint =
EndpointSelectorExample.selectFirstEndpointByVID(selectedCastingPlayer);
if (endpoint == null) {
Log.e(TAG, "No Endpoint with sample vendorID found on CastingPlayer");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public View onCreateView(
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
this.launchUrlButtonClickListener =
v -> {
Endpoint endpoint = EndpointSelectorExample.selectEndpointByVID(selectedCastingPlayer);
Endpoint endpoint =
EndpointSelectorExample.selectFirstEndpointByVID(selectedCastingPlayer);
if (endpoint == null) {
Log.e(TAG, "No Endpoint with sample vendorID found on CastingPlayer");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ public class EndpointSelectorExample {
private static final String TAG = EndpointSelectorExample.class.getSimpleName();
private static final Integer SAMPLE_ENDPOINT_VID = 65521;

public static Endpoint selectEndpointByVID(CastingPlayer selectedCastingPlayer) {
/**
* Returns the first Endpoint in the list of Endpoints associated with the selectedCastingPlayer
* whose VendorID matches the EndpointSelectorExample.SAMPLE_ENDPOINT_VID
*/
public static Endpoint selectFirstEndpointByVID(CastingPlayer selectedCastingPlayer) {
Endpoint endpoint = null;
if (selectedCastingPlayer != null) {
List<Endpoint> endpoints = selectedCastingPlayer.getEndpoints();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void onCreate(Bundle savedInstanceState) {
@Override
public View onCreateView(
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Endpoint endpoint = EndpointSelectorExample.selectEndpointByVID(selectedCastingPlayer);
Endpoint endpoint = EndpointSelectorExample.selectFirstEndpointByVID(selectedCastingPlayer);
if (endpoint == null) {
Log.e(TAG, "No Endpoint with sample vendorID found on CastingPlayer");
return inflater.inflate(
Expand Down
12 changes: 12 additions & 0 deletions examples/tv-casting-app/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ Complete the following steps to prepare the Matter build:
source scripts/bootstrap.sh
```

3. The build will produce libraries: AndroidPlatform.jar, CHIPAppServer.jar,
CHIPInteractionModel.jar and TVCastingApp.jar in [App/app/libs](App/app/libs)
and libTvCastingApp.so and libc++\_shared.so in
[App/app/libs/jniLibs/](App/app/libs/jniLibs/) consumed by any casting app to
leverage the [casting APIs](../APIs.md), like the sample android
tv-casting-app. If building for your own casting app, make sure your client's
specific values are set for `CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID` and
`CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID` in the
[CHIPProjectAppConfig.h](tv-casting-common/include/CHIPProjectAppConfig.h)
file, before the build. Other values like the
`CHIP_DEVICE_CONFIG_DEVICE_NAME` may be optionally updated as well.
## Building & Installing the app
This is the simplest option. In the command line, run the following command from
Expand Down

0 comments on commit b88be43

Please sign in to comment.