Skip to content

Hello, when I want to connect to the TV, the pairing is successful but I can't control it #34

@Kanagizhe

Description

@Kanagizhe

Hello, I have a TCL TV and I want to connect to it. According to the problem reported in the issue, I use this code to send a pairing request for the first connection:

func connect(host: String) {
queue.async {
self.remoteManager.stateChanged = { [weak self] remoteState in
self?.remoteStateChanged?(remoteState.toString())
}

            self.pairingManager.stateChanged = { [weak self] pairingState in
                self?.pairingStateChanged?(pairingState.toString())

                if case .successPaired = pairingState {
                    //self?.isPaired = true
                    self?.remoteManager.connect(host)
                }
            }
            
            self.pairingManager.connect(host, "client", "iPhone")
        }
}

The pin code successfully appeared on the TV. After I sent it, I got a callback that the pairing was successful, but an error message popped up:

2024-09-12 17:15:08.209844+0800 Demo[1010:205481] Info: Pairing: extract TLS parameters
2024-09-12 17:15:08.231894+0800 Demo[1010:205480] Info: Pairing: connecting 192.168.5.39:6467
2024-09-12 17:15:08.292147+0800 Demo[1010:205481] Info: Pairing: connection prepairing
2024-09-12 17:15:08.466333+0800 Demo[1010:205481] Debug: Pairing: Sending pairing request
2024-09-12 17:15:08.466414+0800 Demo[1010:205527] Info: Pairing: connected
2024-09-12 17:15:08.471393+0800 Demo[1010:205481] Debug: Pairing: Sending data: [23]
2024-09-12 17:15:08.471826+0800 Demo[1010:205527] Info: Pairing: pairing request has been sent
2024-09-12 17:15:08.472247+0800 Demo[1010:205527] Debug: Pairing: Success sent
2024-09-12 17:15:08.472541+0800 Demo[1010:205527] Debug: Pairing: Sending data: [16, 200, 1, 8, 2, 82, 16, 10, 6, 105, 80, 104, 111, 110, 101, 18, 6, 99, 108, 105, 101, 110, 116]
2024-09-12 17:15:08.472941+0800 Demo[1010:205527] Debug: Pairing: Success sent
2024-09-12 17:15:08.523048+0800 Demo[1010:205481] Debug: Pairing: recived: [7]
2024-09-12 17:15:08.523520+0800 Demo[1010:205481] Debug: Pairing: it's lentgh of pairing response
2024-09-12 17:15:08.525315+0800 Demo[1010:205481] Debug: Pairing: recived: [8, 2, 16, 200, 1, 90, 0]
2024-09-12 17:15:08.525801+0800 Demo[1010:205481] Debug: Pairing: it's pairing response data
2024-09-12 17:15:08.526286+0800 Demo[1010:205481] Debug: Pairing: Sending option request
2024-09-12 17:15:08.526399+0800 Demo[1010:205480] Info: Pairing: pairing sesponse success
2024-09-12 17:15:08.527219+0800 Demo[1010:205481] Debug: Pairing: Sending data: [16]
2024-09-12 17:15:08.527826+0800 Demo[1010:205527] Info: Pairing: option request sent
2024-09-12 17:15:08.528308+0800 Demo[1010:205527] Debug: Pairing: Success sent
2024-09-12 17:15:08.528803+0800 Demo[1010:205527] Debug: Pairing: Sending data: [8, 2, 16, 200, 1, 162, 1, 8, 10, 4, 8, 3, 16, 6, 24, 1]
2024-09-12 17:15:08.529884+0800 Demo[1010:205527] Debug: Pairing: Success sent
2024-09-12 17:15:08.579861+0800 Demo[1010:205480] Debug: Pairing: recived: [16]
2024-09-12 17:15:08.580163+0800 Demo[1010:205480] Debug: Pairing: it's lentgh of option response
2024-09-12 17:15:08.582104+0800 Demo[1010:205481] Debug: Pairing: recived: [8, 2, 16, 200, 1, 162, 1, 8, 18, 4, 8, 3, 16, 6, 24, 1]
2024-09-12 17:15:08.582316+0800 Demo[1010:205481] Debug: Pairing: it's option response data
2024-09-12 17:15:08.582726+0800 Demo[1010:205481] Debug: Pairing: Sending configuration request
2024-09-12 17:15:08.582788+0800 Demo[1010:205480] Info: Pairing: option response success
2024-09-12 17:15:08.583291+0800 Demo[1010:205481] Debug: Pairing: Sending data: [16]
2024-09-12 17:15:08.583638+0800 Demo[1010:205527] Info: Pairing: confirmation request has been sent
2024-09-12 17:15:08.583897+0800 Demo[1010:205481] Debug: Pairing: Success sent
2024-09-12 17:15:08.584141+0800 Demo[1010:205481] Debug: Pairing: Sending data: [8, 2, 16, 200, 1, 242, 1, 8, 10, 4, 8, 3, 16, 6, 16, 1]
2024-09-12 17:15:08.584509+0800 Demo[1010:205527] Debug: Pairing: Success sent
2024-09-12 17:15:08.633944+0800 Demo[1010:205481] Debug: Pairing: recived: [8]
2024-09-12 17:15:08.634240+0800 Demo[1010:205481] Debug: Pairing: it's lentgh of confirmation response
2024-09-12 17:15:08.640470+0800 Demo[1010:205480] Debug: Pairing: recived: [8, 2, 16, 200, 1, 250, 1, 0]
2024-09-12 17:15:08.640712+0800 Demo[1010:205480] Debug: Pairing: it's confirmation response data
2024-09-12 17:15:08.641207+0800 Demo[1010:205480] Info: Pairing: confirmation response success
2024-09-12 17:15:08.641592+0800 Demo[1010:205480] Info: Pairing: waiting code
2024-09-12 17:15:12.540122+0800 Demo[1010:205070] Successfully load keyboard extensions
2024-09-12 17:15:19.077973+0800 Demo[1010:205527] Debug: code: 0048c8
2024-09-12 17:15:19.082156+0800 Demo[1010:205527] Debug: Pairing: Sending data: [42]
2024-09-12 17:15:19.082662+0800 Demo[1010:205528] Info: Pairing: secret has been sent
2024-09-12 17:15:19.083159+0800 Demo[1010:205528] Debug: Pairing: Success sent
2024-09-12 17:15:19.083747+0800 Demo[1010:205528] Debug: Pairing: Sending data: [8, 2, 16, 200, 1, 194, 2, 34, 10, 32, 0, 48, 16, 241, 169, 224, 242, 89, 170, 63, 29, 172, 246, 139, 122, 76, 138, 167, 116, 27, 138, 136, 207, 112, 165, 200, 187, 18, 8, 140, 175, 12]
2024-09-12 17:15:19.084251+0800 Demo[1010:205528] Debug: Pairing: Success sent
2024-09-12 17:15:19.231269+0800 Demo[1010:205528] Debug: Pairing: recived: [42, 8, 2, 16, 200, 1, 202, 2, 34, 10, 32, 0, 48, 16, 241, 169, 224, 242, 89, 170, 63, 29, 172, 246, 139, 122, 76, 138, 167, 116, 27, 138, 136, 207, 112, 165, 200, 187, 18, 8, 140, 175, 12]
2024-09-12 17:15:19.232235+0800 Demo[1010:205527] Info: Pairing: success paired
2024-09-12 17:15:19.232255+0800 Demo[1010:205528] Info: Pairing: disconnect
2024-09-12 17:15:19.253661+0800 Demo[1010:205527] Info: Remote: connecting 192.168.5.39:6466
2024-09-12 17:15:19.253959+0800 Demo[1010:205527] Info: Pairing: success paired
2024-09-12 17:15:19.256490+0800 Demo[1010:205481] Info: Remote: connection preparing
2024-09-12 17:15:19.267084+0800 Demo[1010:205527] Info: Remote: connecting 192.168.5.39:6466
2024-09-12 17:15:19.269258+0800 Demo[1010:205481] Info: Remote: connection preparing
2024-09-12 17:15:19.429446+0800 Demo[1010:205528] Info: Remote: connected
2024-09-12 17:15:19.436590+0800 Demo[1010:205527] Info: Remote: connected
2024-09-12 17:15:19.438638+0800 Demo[1010:205527] Debug: Remote: handle: [5, 10, 3, 8, 255, 4]
2024-09-12 17:15:19.438942+0800 Demo[1010:205527] Debug: Remote: it's not configuration message

When I send the volume down command, I get the error message:
2024-09-12 17:23:28.659355+0800 Demo[1010:205603] Debug: Remote: Sending data: [6]

2024-09-12 17:23:28.660482+0800 Demo[1010:205603] Debug: Remote: Success sent
2024-09-12 17:23:28.660799+0800 Demo[1010:205603] Debug: Remote: Sending data: [82, 4, 8, 25, 16, 3]
2024-09-12 17:23:28.661436+0800 Demo[1010:205603] Debug: Remote: Success sent
2024-09-12 17:23:28.844407+0800 Demo[1010:205603] Debug: Remote: handle: [5, 10, 3, 8, 255, 4, 12, 26, 10]
2024-09-12 17:23:28.844753+0800 Demo[1010:205603] Debug: Remote: it's not configuration message
2024-09-12 17:23:28.845453+0800 Demo[1010:207483] Debug: Remote: handle: [5, 10, 3, 8, 255, 4, 12, 26, 10, 8, 2, 18, 6, 82, 4, 8, 25, 16, 3]
2024-09-12 17:23:28.847112+0800 Demo[1010:207483] Debug: Remote: it's not configuration message
2024-09-12 17:23:28.847402+0800 Demo[1010:207483] Info: Remote: Empty or completion data received
2024-09-12 17:23:28.847488+0800 Demo[1010:205603] [connection] nw_flow_add_read_request [C4 192.168.5.39:6466 ready parent-flow (satisfied (Path is satisfied), interface: en0[802.11], ipv4, dns, proxy)] already delivered final read, cannot accept read requests
2024-09-12 17:23:28.847751+0800 Demo[1010:205603] [connection] nw_read_request_report [C4] Receive failed with error "No message available on STREAM"
2024-09-12 17:23:28.848061+0800 Demo[1010:205603] [connection] nw_flow_add_read_request [C4 192.168.5.39:6466 ready parent-flow (satisfied (Path is satisfied), interface: en0[802.11], ipv4, dns, proxy)] already delivered final read, cannot accept read requests
2024-09-12 17:23:28.848363+0800 Demo[1010:205603] [connection] nw_read_request_report [C4] Receive failed with error "No message available on STREAM"
2024-09-12 17:23:28.848945+0800 Demo[1010:207483] Error: Remote: Connection Error: receive data error - The operation couldn’t be completed. No message available on STREAM
2024-09-12 17:23:28.849783+0800 Demo[1010:207483] Error: Remote: Connection Error: receive data error - The operation couldn’t be completed. No message available on STREAM

Do you have any ideas on how to solve this problem? I would be very grateful for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions