Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send_tnc_data always replies with INCORRECT_STATE before succeeding #1

Open
khusmann opened this issue Dec 25, 2024 · 1 comment
Open

Comments

@khusmann
Copy link
Owner

If you try to send any data with benlink.client.RadioClient.send_tnc_data it will immediately reply with a INCORRECT_STATE error. If you immediately retry the command within two seconds, it will work. I have no idea why it does this. In all of my btsnoop logs, the command appears to work on the first try.

If anyone can figure out what's going on here, please let me know!

@khusmann
Copy link
Owner Author

Ah ha, it works the first try if you send the commands while simultaneously connected via rfcomm to the audio channel. Looks like you can probe for the channel layout via sdptool records <uuid>. With my UV-Pro I get this:

Service RecHandle: 0x10000
Service Class ID List:
  "PnP Information" (0x1200)

Service Name: BS AOC
Service RecHandle: 0x10001
Service Class ID List:
  UUID 128: 39144315-32fa-40db-85ed-fbfeba2d86e6
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 2
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100

Service Name: Voice Gateway
Service RecHandle: 0x10002
Service Class ID List:
  "Handsfree Audio Gateway" (0x111f)
  "Generic Audio" (0x1203)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 3
Profile Descriptor List:
  "Handsfree" (0x111e)
    Version: 0x0107

Service Name: SPP Dev
Service RecHandle: 0x10003
Service Class ID List:
  "Serial Port" (0x1101)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 1
Profile Descriptor List:
  "Serial Port" (0x1101)
    Version: 0x0102

Weirdly, even though the "voice gateway" is listed on channel 3, all of the audio packets show up on channel 2...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant