@@ -764,7 +764,9 @@ class AACPManager {
764764
765765 fun sendMediaInformationNewDevice (selfMacAddress : String , targetMacAddress : String ): Boolean {
766766 if (selfMacAddress.length != 17 || ! selfMacAddress.matches(Regex (" ([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}" )) || targetMacAddress.length != 17 || ! targetMacAddress.matches(Regex (" ([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}" ))) {
767- throw IllegalArgumentException (" MAC address must be 6 bytes" )
767+ // throw IllegalArgumentException("MAC address must be 6 bytes")
768+ Log .w(TAG , " Invalid MAC address format, got: selfMacAddress=$selfMacAddress , targetMacAddress=$targetMacAddress " )
769+ return false
768770 }
769771 Log .d(TAG , " SELFMAC: ${selfMacAddress} , TARGETMAC: $targetMacAddress " )
770772 Log .d(TAG , " Sending Media Information packet to $targetMacAddress " )
@@ -804,7 +806,9 @@ class AACPManager {
804806
805807 fun sendHijackRequest (selfMacAddress : String ): Boolean {
806808 if (selfMacAddress.length != 17 || ! selfMacAddress.matches(Regex (" ([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}" ))) {
807- throw IllegalArgumentException (" MAC address must be 6 bytes" )
809+ // throw IllegalArgumentException("MAC address must be 6 bytes")
810+ Log .w(TAG , " Invalid MAC address format, got: selfMacAddress=$selfMacAddress " )
811+ return false
808812 }
809813 var success = false
810814 for (connectedDevice in connectedDevices) {
@@ -845,7 +849,9 @@ class AACPManager {
845849
846850 fun sendMediaInformataion (selfMacAddress : String , streamingState : Boolean = false): Boolean {
847851 if (selfMacAddress.length != 17 || ! selfMacAddress.matches(Regex (" ([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}" ))) {
848- throw IllegalArgumentException (" MAC address must be 6 bytes" )
852+ // throw IllegalArgumentException("MAC address must be 6 bytes")
853+ Log .d(TAG , " Invalid MAC address format, got: selfMacAddress=$selfMacAddress " )
854+ return false
849855 }
850856 Log .d(TAG , " SELFMAC: $selfMacAddress " )
851857 val targetMac = connectedDevices.find { it.mac != selfMacAddress }?.mac
@@ -904,7 +910,9 @@ class AACPManager {
904910
905911 fun sendSmartRoutingShowUI (selfMacAddress : String ): Boolean {
906912 if (selfMacAddress.length != 17 || ! selfMacAddress.matches(Regex (" ([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}" ))) {
907- throw IllegalArgumentException (" MAC address must be 6 bytes" )
913+ // throw IllegalArgumentException("MAC address must be 6 bytes")
914+ Log .w(TAG , " Invalid MAC address format, got: selfMacAddress=$selfMacAddress " )
915+ return false
908916 }
909917
910918 val targetMac = connectedDevices.find { it.mac != selfMacAddress }?.mac
@@ -980,7 +988,9 @@ class AACPManager {
980988
981989 fun sendAddTiPiDevice (selfMacAddress : String , targetMacAddress : String ): Boolean {
982990 if (selfMacAddress.length != 17 || ! selfMacAddress.matches(Regex (" ([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}" )) || targetMacAddress.length != 17 || ! targetMacAddress.matches(Regex (" ([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}" ))) {
983- throw IllegalArgumentException (" MAC address must be 6 bytes" )
991+ // throw IllegalArgumentException("MAC address must be 6 bytes")
992+ Log .w(TAG , " Invalid MAC address format, got: selfMacAddress=$selfMacAddress , targetMacAddress=$targetMacAddress " )
993+ return false
984994 }
985995 Log .d(TAG , " Sending Add TiPi Device packet to $targetMacAddress " )
986996 return sendDataPacket(createAddTiPiDevicePacket(selfMacAddress, targetMacAddress))
0 commit comments