Skip to content

Commit 20c6768

Browse files
Doc updates, renamed a function
1 parent 7a2d846 commit 20c6768

7 files changed

+31
-11
lines changed

examples/tv-casting-app/APIs.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ In order to illustrate these steps, refer to the figure below
7171
The Casting Client is expected to consume the Matter TV Casting library built
7272
for its respective platform which implements the APIs described in this
7373
document. Refer to the tv-casting-app READMEs for [Linux](linux/README.md),
74-
Android and [iOS](darwin/TvCasting/README.md) to understand how to build and
75-
consume each platform's specific libraries. The libraries MUST be built with the
76-
client's specific values for `CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID` and
77-
`CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID` updated in the
74+
[Android](android/README.md) and [iOS](darwin/TvCasting/README.md) to understand
75+
how to build and consume each platform's specific libraries. The libraries MUST
76+
be built with the client's specific values for
77+
`CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID` and `CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID`
78+
updated in the
7879
[CHIPProjectAppConfig.h](tv-casting-common/include/CHIPProjectAppConfig.h) file.
7980
Other values like the `CHIP_DEVICE_CONFIG_DEVICE_NAME` may be updated as well to
8081
correspond to the client being built.
@@ -688,7 +689,7 @@ func startDiscovery() {
688689
}
689690
```
690691

691-
Note: You will need to connect with a Casting Player as described below to see
692+
Note: You will need to connect with a Casting Player as described below to se
692693
the list of Endpoints that they support. Refer to the
693694
[Connection](#connect-to-a-casting-player) section for details on how to
694695
discover available endpoints supported by a Casting Player.
@@ -864,7 +865,7 @@ On Android, it can select an `Endpoint` as shown below.
864865
```java
865866
private static final Integer SAMPLE_ENDPOINT_VID = 65521;
866867
867-
private Endpoint selectEndpoint()
868+
private Endpoint selectFirstEndpointByVID()
868869
{
869870
Endpoint endpoint = null;
870871
if(selectedCastingPlayer != null)

examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/GlobalCastingConstants.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ public class GlobalCastingConstants {
66
public static final int SetupPasscode = 20202021;
77
public static final int Discriminator = 0xF00;
88
public static final boolean ChipCastingSimplified =
9-
true; // set this flag to true to demo simplified casting APIs
9+
true; // set to true, to demo the simplified casting APIs. Otherwise, the older deprecated
10+
// APIs are invoked
1011
}

examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ApplicationBasicReadVendorIDExampleFragment.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public View onCreateView(
6868
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
6969
this.readButtonClickListener =
7070
v -> {
71-
Endpoint endpoint = EndpointSelectorExample.selectEndpointByVID(selectedCastingPlayer);
71+
Endpoint endpoint =
72+
EndpointSelectorExample.selectFirstEndpointByVID(selectedCastingPlayer);
7273
if (endpoint == null) {
7374
Log.e(TAG, "No Endpoint with sample vendorID found on CastingPlayer");
7475
return;

examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ContentLauncherLaunchURLExampleFragment.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public View onCreateView(
6868
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
6969
this.launchUrlButtonClickListener =
7070
v -> {
71-
Endpoint endpoint = EndpointSelectorExample.selectEndpointByVID(selectedCastingPlayer);
71+
Endpoint endpoint =
72+
EndpointSelectorExample.selectFirstEndpointByVID(selectedCastingPlayer);
7273
if (endpoint == null) {
7374
Log.e(TAG, "No Endpoint with sample vendorID found on CastingPlayer");
7475
return;

examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/EndpointSelectorExample.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ public class EndpointSelectorExample {
1010
private static final String TAG = EndpointSelectorExample.class.getSimpleName();
1111
private static final Integer SAMPLE_ENDPOINT_VID = 65521;
1212

13-
public static Endpoint selectEndpointByVID(CastingPlayer selectedCastingPlayer) {
13+
/**
14+
* Returns the first Endpoint in the list of Endpoints associated with the selectedCastingPlayer
15+
* whose VendorID matches the EndpointSelectorExample.SAMPLE_ENDPOINT_VID
16+
*/
17+
public static Endpoint selectFirstEndpointByVID(CastingPlayer selectedCastingPlayer) {
1418
Endpoint endpoint = null;
1519
if (selectedCastingPlayer != null) {
1620
List<Endpoint> endpoints = selectedCastingPlayer.getEndpoints();

examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/MediaPlaybackSubscribeToCurrentStateExampleFragment.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void onCreate(Bundle savedInstanceState) {
7070
@Override
7171
public View onCreateView(
7272
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
73-
Endpoint endpoint = EndpointSelectorExample.selectEndpointByVID(selectedCastingPlayer);
73+
Endpoint endpoint = EndpointSelectorExample.selectFirstEndpointByVID(selectedCastingPlayer);
7474
if (endpoint == null) {
7575
Log.e(TAG, "No Endpoint with sample vendorID found on CastingPlayer");
7676
return inflater.inflate(

examples/tv-casting-app/android/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ Complete the following steps to prepare the Matter build:
7070
source scripts/bootstrap.sh
7171
```
7272

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

0 commit comments

Comments
 (0)