diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/DiscoveryExampleFragment.java b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/DiscoveryExampleFragment.java index c023a9848112c9..4c5d68fdb60654 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/DiscoveryExampleFragment.java +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/DiscoveryExampleFragment.java @@ -45,7 +45,7 @@ public class DiscoveryExampleFragment extends Fragment { private static final String TAG = DiscoveryExampleFragment.class.getSimpleName(); // 35 represents device type of Matter Casting Player - private static final int DISCOVERY_TARGET_DEVICE_TYPE = 35; + private static final Long DISCOVERY_TARGET_DEVICE_TYPE = 35L; private static final int DISCOVERY_RUNTIME_SEC = 15; private TextView matterDiscoveryMessageTextView; private static final ScheduledExecutorService executorService = @@ -70,98 +70,68 @@ public class DiscoveryExampleFragment extends Fragment { @Override public void onAdded(CastingPlayer castingPlayer) { - if (castingPlayer != null) { - Log.i( - TAG, - "onAdded() Discovered CastingPlayer deviceId: " + castingPlayer.getDeviceId()); - // Display CastingPlayer info on the screen - new Handler(Looper.getMainLooper()) - .post( - () -> { - final Optional playerInList = - castingPlayerList - .stream() - .filter(node -> castingPlayer.equals(node)) - .findFirst(); - if (playerInList.isPresent()) { - Log.d( - TAG, - "onAdded() Replacing existing CastingPlayer entry " - + playerInList.get().getDeviceId() - + " in castingPlayerList list"); - arrayAdapter.remove(playerInList.get()); - } - arrayAdapter.add(castingPlayer); - }); - } else { - Log.d(TAG, "onAdded() CastingPlayer is null"); - // Attempt to invoke interface method on a null object reference will throw an error - Log.d( - TAG, - "onAdded() Discovered CastingPlayer with deviceId: " - + castingPlayer.getDeviceId()); - } + Log.i( + TAG, + "onAdded() Discovered CastingPlayer deviceId: " + castingPlayer.getDeviceId()); + // Display CastingPlayer info on the screen + new Handler(Looper.getMainLooper()) + .post( + () -> { + arrayAdapter.add(castingPlayer); + }); } @Override public void onChanged(CastingPlayer castingPlayer) { - if (castingPlayer != null) { - Log.i( - TAG, - "onChanged() Discovered changes to CastingPlayer with deviceId: " - + castingPlayer.getDeviceId()); - // Update the CastingPlayer on the screen - new Handler(Looper.getMainLooper()) - .post( - () -> { - final Optional playerInList = - castingPlayerList - .stream() - .filter(node -> castingPlayer.equals(node)) - .findFirst(); - if (playerInList.isPresent()) { - Log.d( - TAG, - "onChanged() Updating existing CastingPlayer entry " - + playerInList.get().getDeviceId() - + " in castingPlayerList list"); - arrayAdapter.remove(playerInList.get()); - } - arrayAdapter.add(castingPlayer); - }); - } else { - Log.d(TAG, "onChanged() CastingPlayer is null"); - } + Log.i( + TAG, + "onChanged() Discovered changes to CastingPlayer with deviceId: " + + castingPlayer.getDeviceId()); + // Update the CastingPlayer on the screen + new Handler(Looper.getMainLooper()) + .post( + () -> { + final Optional playerInList = + castingPlayerList + .stream() + .filter(node -> castingPlayer.equals(node)) + .findFirst(); + if (playerInList.isPresent()) { + Log.d( + TAG, + "onChanged() Updating existing CastingPlayer entry " + + playerInList.get().getDeviceId() + + " in castingPlayerList list"); + arrayAdapter.remove(playerInList.get()); + } + arrayAdapter.add(castingPlayer); + }); } @Override public void onRemoved(CastingPlayer castingPlayer) { - if (castingPlayer != null) { - Log.i( - TAG, - "onRemoved() Removed CastingPlayer with deviceId: " - + castingPlayer.getDeviceId()); - // Remove CastingPlayer from the screen - new Handler(Looper.getMainLooper()) - .post( - () -> { - final Optional playerInList = - castingPlayerList - .stream() - .filter(node -> castingPlayer.equals(node)) - .findFirst(); - if (playerInList.isPresent()) { - Log.d( - TAG, - "onRemoved() Removing existing CastingPlayer entry " - + playerInList.get().getDeviceId() - + " in castingPlayerList list"); - arrayAdapter.remove(playerInList.get()); - } - }); - } else { - Log.d(TAG, "onRemoved() CastingPlayer is null"); - } + Log.i( + TAG, + "onRemoved() Removed CastingPlayer with deviceId: " + + castingPlayer.getDeviceId()); + // Remove CastingPlayer from the screen + new Handler(Looper.getMainLooper()) + .post( + () -> { + final Optional playerInList = + castingPlayerList + .stream() + .filter(node -> castingPlayer.equals(node)) + .findFirst(); + if (playerInList.isPresent()) { + Log.d( + TAG, + "onRemoved() Removing existing CastingPlayer entry " + + playerInList.get().getDeviceId() + + " in castingPlayerList list"); + arrayAdapter.remove(playerInList.get()); + } + }); } }; @@ -201,14 +171,13 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { Log.d(TAG, "onViewCreated() creating callbacks"); // TODO: In following PRs. Enable startDiscoveryButton and stopDiscoveryButton when - // stopDiscovery is implemented in the core Matter SKD DNS-SD API. Enable in + // stopDiscovery is implemented in the core Matter SDK DNS-SD API. Enable in // fragment_matter_discovery_example.xml Button startDiscoveryButton = getView().findViewById(R.id.startDiscoveryButton); startDiscoveryButton.setOnClickListener( v -> { Log.i( TAG, "onViewCreated() startDiscoveryButton button clicked. Calling startDiscovery()"); - // arrayAdapter.clear(); if (!startDiscovery()) { Log.e(TAG, "onViewCreated() startDiscovery() call Failed"); } @@ -262,6 +231,8 @@ public interface Callback { private boolean startDiscovery() { Log.i(TAG, "startDiscovery() called"); + arrayAdapter.clear(); + // Add the implemented CastingPlayerChangeListener to listen to changes in the discovered // CastingPlayers MatterError err = @@ -271,7 +242,7 @@ private boolean startDiscovery() { return false; } // Start discovery - Log.i(TAG, "startDiscovery() calling startDiscovery()"); + Log.i(TAG, "startDiscovery() calling CastingPlayerDiscovery.startDiscovery()"); err = matterCastingPlayerDiscovery.startDiscovery(DISCOVERY_TARGET_DEVICE_TYPE); if (err.hasError()) { Log.e(TAG, "startDiscovery() startDiscovery() called, err Start: " + err); @@ -392,7 +363,7 @@ private String getCastingPlayerButtonText(CastingPlayer player) { player.getDeviceType() > 0 ? (aux.isEmpty() ? "" : ", ") + "Device Type: " + player.getDeviceType() : ""; - aux += (aux.isEmpty() ? "" : ", ") + "Resolved IP: " + (player.getNumberIPs() > 0); + aux += (aux.isEmpty() ? "" : ", ") + "Resolved IP?: " + (player.getIpAddresses().size() > 0); aux = aux.isEmpty() ? aux : "\n" + aux; return main + aux; diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingPlayer.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingPlayer.java index d359330f25ab97..71ea4767a03994 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingPlayer.java +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingPlayer.java @@ -36,8 +36,6 @@ public interface CastingPlayer { String getInstanceName(); - int getNumberIPs(); - List getIpAddresses(); int getPort(); @@ -46,12 +44,15 @@ public interface CastingPlayer { int getProductId(); - int getDeviceType(); + long getDeviceType(); + @Override String toString(); + @Override boolean equals(Object o); + @Override int hashCode(); // TODO: Implement in following PRs. Related to player connection implementation. diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingPlayerDiscovery.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingPlayerDiscovery.java index 9f2a7f8faff68e..5aa27d06c788d2 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingPlayerDiscovery.java +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingPlayerDiscovery.java @@ -21,11 +21,11 @@ import java.util.List; /** - * The CastingPlayerDiscovery interface defines the API to control Matter Casting Player discovery - * over DNS-SD, and to collect discovery results. Discovery is centrally managed by the native C++ - * layer in the Matter SDK. This class exposes native functions to add and remove a - * CastingPlayerChangeListener, which contains the C++ to Java callbacks for when Casting Players - * are discovered, updated, or lost from the network. This class is a singleton. + * The CastingPlayerDiscovery interface defines the client API to control Matter Casting Player + * discovery over DNS-SD, and to collect discovery results. This interface defines the methods to + * add and remove a CastingPlayerChangeListener. It also defines the CastingPlayerChangeListener + * handler class which must be implemented by the API client. The handler contains the methods + * called when Casting Players are discovered, updated, or lost from the network. */ public interface CastingPlayerDiscovery { @@ -38,11 +38,12 @@ public interface CastingPlayerDiscovery { /** * Starts Casting Players discovery or returns an error. * - * @param discoveryTargetDeviceType the target device type to be discovered using DNS-SD. 35 - * represents device type of Matter Casting Player. + * @param discoveryTargetDeviceType the target device type to be discovered using DNS-SD. For + * example: 35 represents device type of Matter Casting Video Player. If "null" is passed in, + * discovery will default to all "_matterd._udp" device types. * @return a specific MatterError if the the operation failed or NO_ERROR if succeeded. */ - MatterError startDiscovery(int discoveryTargetDeviceType); + MatterError startDiscovery(Long discoveryTargetDeviceType); /** * Stops Casting Players discovery or returns an error. @@ -53,7 +54,7 @@ public interface CastingPlayerDiscovery { /** * Adds a CastingPlayerChangeListener instance to be used during discovery. The - * CastingPlayerChangeListener contains the C++ to Java callbacks for when Casting Players are + * CastingPlayerChangeListener defines the handler methods for when Casting Players are * discovered, updated, or lost from the network. Should be called prior to calling * MatterCastingPlayerDiscovery.startDiscovery(). * @@ -64,7 +65,7 @@ public interface CastingPlayerDiscovery { MatterError addCastingPlayerChangeListener(CastingPlayerChangeListener listener); /** - * Removes CastingPlayerChangeListener from the native layer. + * Removes CastingPlayerChangeListener added by addCastingPlayerChangeListener(). * * @param listener the specific instance of CastingPlayerChangeListener to be removed. * @return a specific MatterError if the the operation failed or NO_ERROR if succeeded. @@ -72,38 +73,38 @@ public interface CastingPlayerDiscovery { MatterError removeCastingPlayerChangeListener(CastingPlayerChangeListener listener); /** - * The CastingPlayerChangeListener can discover CastingPlayers by implementing the onAdded, - * onChanged and onRemoved callbacks which are called as CastingPlayers, are discovered, updated, - * or lost from the network. The onAdded(), onChanged() and onRemoved() callbacks must be - * implemented by the APIs client. + * The CastingPlayerChangeListener can discover CastingPlayers by implementing the onAdded(), + * onChanged() and onRemoved() callbacks which are called as CastingPlayers, are discovered, + * updated, or lost from the network. The onAdded(), onChanged() and onRemoved() handlers must + * be implemented by the API client. */ abstract class CastingPlayerChangeListener { static final String TAG = CastingPlayerChangeListener.class.getSimpleName(); /** - * Called by the native C++ layer when a Casting Player is added to the local network. + * This handler is called when a Casting Player is added to the network. * * @param castingPlayer the Casting Player added. */ public abstract void onAdded(CastingPlayer castingPlayer); /** - * Called by the native C++ layer when a Casting Player on the local network is changed. + * This handler is called when a Casting Player previously detected on the network is changed. * * @param castingPlayer the Casting Player changed. */ public abstract void onChanged(CastingPlayer castingPlayer); /** - * Called by the native C++ layer when a Casting Player is removed from the local network. + * This handler is called when a Casting Player previously detected on the network is removed. * * @param castingPlayer the Casting Player removed. */ public abstract void onRemoved(CastingPlayer castingPlayer); /** - * The following methods are used to catch possible exceptions thrown by the methods above, when - * not implemented correctly. + * The following methods are used to catch possible exceptions thrown by the methods above + * (onAdded(), onChanged() and onRemoved()), when not implemented correctly by the client. */ protected final void _onAdded(CastingPlayer castingPlayer) { try { diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/MatterCastingPlayer.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/MatterCastingPlayer.java index fdf8b4e2cc74fd..ecc76a575a115b 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/MatterCastingPlayer.java +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/MatterCastingPlayer.java @@ -32,12 +32,11 @@ public class MatterCastingPlayer implements CastingPlayer { private String deviceName; private String hostName; private String instanceName; - private int numberIPs; private List ipAddresses; private int port; private int productId; private int vendorId; - private int deviceType; + private long deviceType; public MatterCastingPlayer( boolean connected, @@ -45,18 +44,16 @@ public MatterCastingPlayer( String hostName, String deviceName, String instanceName, - int numberIPs, List ipAddresses, int port, int productId, int vendorId, - int deviceType) { + long deviceType) { this.connected = connected; this.deviceId = deviceId; this.hostName = hostName; this.deviceName = deviceName; this.instanceName = instanceName; - this.numberIPs = numberIPs; this.ipAddresses = ipAddresses; this.port = port; this.productId = productId; @@ -97,12 +94,6 @@ public String getInstanceName() { return this.instanceName; } - /** @return an int, corresponding to the number of valid IP addresses for this Casting PLayer. */ - @Override - public int getNumberIPs() { - return this.numberIPs; - } - /** @return a list of valid IP addresses for this Casting PLayer. */ @Override public List getIpAddresses() { @@ -125,7 +116,7 @@ public int getProductId() { } @Override - public int getDeviceType() { + public long getDeviceType() { return this.deviceType; } diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/MatterCastingPlayerDiscovery.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/MatterCastingPlayerDiscovery.java index bcd36708e7e77b..bf7df60ef74d79 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/MatterCastingPlayerDiscovery.java +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/MatterCastingPlayerDiscovery.java @@ -21,10 +21,9 @@ /** * MatterCastingPlayerDiscovery provides an API to control Matter Casting Player discovery over - * DNS-SD, and to collect discovery results. Discovery is centrally managed by the native C++ layer - * in the Matter SDK. This class exposes native functions to add and remove a - * CastingPlayerChangeListener, which contains the C++ to Java callbacks for when Casting Players - * are discovered, updated, or lost from the network. This class is a singleton. + * DNS-SD, and to collect discovery results. This class provides methods to add and remove a + * CastingPlayerChangeListener, which contains the handlers for when Casting Players are discovered, + * updated, or lost from the network. This class is a singleton. */ public final class MatterCastingPlayerDiscovery implements CastingPlayerDiscovery { private static final String TAG = MatterCastingPlayerDiscovery.class.getSimpleName(); @@ -48,12 +47,13 @@ public static MatterCastingPlayerDiscovery getInstance() { /** * Starts Casting Players discovery or returns an error. * - * @param discoveryTargetDeviceType the target device type to be discovered using DNS-SD. 35 - * represents device type of Matter Casting Player. + * @param discoveryTargetDeviceType the target device type to be discovered using DNS-SD. For + * example: 35 represents device type of Matter Casting Video Player. If "null" is passed in, + * discovery will default to all "_matterd._udp" device types. * @return a specific MatterError if the the operation failed or NO_ERROR if succeeded. */ @Override - public native MatterError startDiscovery(int discoveryTargetDeviceType); + public native MatterError startDiscovery(Long discoveryTargetDeviceType); /** * Stops Casting Players discovery or returns an error. @@ -65,7 +65,7 @@ public static MatterCastingPlayerDiscovery getInstance() { /** * Adds a CastingPlayerChangeListener instance to be used during discovery. The - * CastingPlayerChangeListener contains the C++ to Java callbacks for when Casting Players are + * CastingPlayerChangeListener defines the handler methods for when Casting Players are * discovered, updated, or lost from the network. Should be called prior to calling * MatterCastingPlayerDiscovery.startDiscovery(). * diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp index d585b3412abd93..255ba570082e16 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp @@ -127,15 +127,32 @@ class DiscoveryDelegateImpl : public DiscoveryDelegate // Initialize the static instance to nullptr DiscoveryDelegateImpl * DiscoveryDelegateImpl::discoveryDelegateImplSingletonInstance = nullptr; -JNI_METHOD(jobject, startDiscovery)(JNIEnv * env, jobject, jint discoveryTargetDeviceType) +JNI_METHOD(jobject, startDiscovery)(JNIEnv * env, jobject, jobject targetDeviceTypeLong = nullptr) { chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "CastingPlayerDiscovery-JNI::startDiscovery() called with discoveryTargetDeviceType: %lu", - (uint64_t) discoveryTargetDeviceType); + ChipLogProgress(AppServer, "CastingPlayerDiscovery-JNI::startDiscovery() called"); CastingPlayerDiscovery::GetInstance()->SetDelegate(DiscoveryDelegateImpl::GetInstance()); - // Start CastingPlayer discovery, 35 represents device type of Matter Casting Player - CHIP_ERROR err = CastingPlayerDiscovery::GetInstance()->StartDiscovery((uint64_t) discoveryTargetDeviceType); + // Start CastingPlayer discovery + CHIP_ERROR err = CHIP_NO_ERROR; + if (targetDeviceTypeLong == nullptr) + { + ChipLogProgress(AppServer, + "CastingPlayerDiscovery-JNI::startDiscovery() received null target device type. Using default type."); + err = CastingPlayerDiscovery::GetInstance()->StartDiscovery(); + } + else + { + // Get the long value from the Java Long object + jclass longClass = env->GetObjectClass(targetDeviceTypeLong); + jmethodID longValueMethod = env->GetMethodID(longClass, "longValue", "()J"); + jlong jTargetDeviceType = env->CallLongMethod(targetDeviceTypeLong, longValueMethod); + env->DeleteLocalRef(longClass); + + ChipLogProgress(AppServer, "CastingPlayerDiscovery-JNI::startDiscovery() discovery target device type: %u", + static_cast(jTargetDeviceType)); + err = CastingPlayerDiscovery::GetInstance()->StartDiscovery(static_cast(jTargetDeviceType)); + } if (err != CHIP_NO_ERROR) { ChipLogError(AppServer, "CastingPlayerDiscovery-JNI startDiscovery() err: %" CHIP_ERROR_FORMAT, err.Format()); diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/CastingPlayerConverter-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/CastingPlayerConverter-JNI.cpp index 86d42a76fabc13..a993a501bd6aa0 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/CastingPlayerConverter-JNI.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/CastingPlayerConverter-JNI.cpp @@ -42,7 +42,7 @@ jobject createJCastingPlayer(matter::casting::memory::StrongGetMethodID(matterCastingPlayerJavaClass, "", - "(ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/util/List;IIII)V"); + "(ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;IIIJ)V"); if (constructor == nullptr) { ChipLogError( @@ -52,13 +52,11 @@ jobject createJCastingPlayer(matter::casting::memory::StrongIsConnected() ? true : false; - - jobject ipAddressListJavaObject = nullptr; + jobject jIpAddressList = nullptr; const chip::Inet::IPAddress * ipAddresses = player->GetIPAddresses(); if (ipAddresses != nullptr) { - chip::JniReferences::GetInstance().CreateArrayList(ipAddressListJavaObject); + chip::JniReferences::GetInstance().CreateArrayList(jIpAddressList); for (size_t i = 0; i < player->GetNumIPs() && i < chip::Dnssd::CommonResolutionData::kMaxIPAddresses; i++) { char addrCString[chip::Inet::IPAddress::kMaxStringLength]; @@ -70,24 +68,23 @@ jobject createJCastingPlayer(matter::casting::memory::StrongGetStaticMethodID(jIPAddressClass, "getByName", "(Ljava/lang/String;)Ljava/net/InetAddress;"); jobject jIPAddress = env->CallStaticObjectMethod(jIPAddressClass, jGetByNameMid, jIPAddressStr); - chip::JniReferences::GetInstance().AddToList(ipAddressListJavaObject, jIPAddress); + chip::JniReferences::GetInstance().AddToList(jIpAddressList, jIPAddress); } } // Create a new instance of the MatterCastingPlayer Java class - jobject matterCastingPlayerJavaObject = nullptr; - matterCastingPlayerJavaObject = - env->NewObject(matterCastingPlayerJavaClass, constructor, static_cast(connected), - env->NewStringUTF(player->GetId()), env->NewStringUTF(player->GetHostName()), - env->NewStringUTF(player->GetDeviceName()), env->NewStringUTF(player->GetInstanceName()), - (jint) (player->GetNumIPs()), ipAddressListJavaObject, (jint) (player->GetPort()), - (jint) (player->GetProductId()), (jint) (player->GetVendorId()), (jint) (player->GetDeviceType())); - if (matterCastingPlayerJavaObject == nullptr) + jobject jMatterCastingPlayer = nullptr; + jMatterCastingPlayer = env->NewObject(matterCastingPlayerJavaClass, constructor, static_cast(player->IsConnected()), + env->NewStringUTF(player->GetId()), env->NewStringUTF(player->GetHostName()), + env->NewStringUTF(player->GetDeviceName()), env->NewStringUTF(player->GetInstanceName()), + jIpAddressList, (jint) (player->GetPort()), (jint) (player->GetProductId()), + (jint) (player->GetVendorId()), (jlong) (player->GetDeviceType())); + if (jMatterCastingPlayer == nullptr) { ChipLogError(AppServer, "CastingPlayerConverter-JNI.createJCastingPlayer() Warning: Could not create MatterCastingPlayer Java object"); } - return matterCastingPlayerJavaObject; + return jMatterCastingPlayer; } }; // namespace support diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingPlayerDiscovery.cpp b/examples/tv-casting-app/tv-casting-common/core/CastingPlayerDiscovery.cpp index 2124566e31ee9f..f4eb42c8ca607f 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingPlayerDiscovery.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/CastingPlayerDiscovery.cpp @@ -40,7 +40,7 @@ CastingPlayerDiscovery * CastingPlayerDiscovery::GetInstance() return _castingPlayerDiscovery; } -CHIP_ERROR CastingPlayerDiscovery::StartDiscovery(uint64_t deviceTypeFilter) +CHIP_ERROR CastingPlayerDiscovery::StartDiscovery(uint32_t deviceTypeFilter) { ChipLogProgress(Discovery, "CastingPlayerDiscovery::StartDiscovery() called"); VerifyOrReturnError(mState == DISCOVERY_READY, CHIP_ERROR_INCORRECT_STATE); diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingPlayerDiscovery.h b/examples/tv-casting-app/tv-casting-common/core/CastingPlayerDiscovery.h index 96609eee697d09..3bbd4eb94ba084 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingPlayerDiscovery.h +++ b/examples/tv-casting-app/tv-casting-common/core/CastingPlayerDiscovery.h @@ -101,7 +101,7 @@ class CastingPlayerDiscovery * with CastingPlayers whose deviceType matches filterBydeviceType * @return CHIP_ERROR - CHIP_NO_ERROR if discovery for CastingPlayers started successfully, specific error code otherwise. */ - CHIP_ERROR StartDiscovery(uint64_t filterBydeviceType = 0); + CHIP_ERROR StartDiscovery(uint32_t filterBydeviceType = 0); /** * @brief Stop the discovery for CastingPlayers