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

Question about delegate(IOBluetooth) #614

Open
Realbuber opened this issue Jul 1, 2024 · 0 comments
Open

Question about delegate(IOBluetooth) #614

Realbuber opened this issue Jul 1, 2024 · 0 comments

Comments

@Realbuber
Copy link

sorry I am a begineer here,

  @objc.typedSelector(b"v@:@^vQ")
  def rfcommChannelData_data_length_(self, channel, data, length):
      print(f"DATA::{data}")
  
  @objc.typedSelector(b'v@:@@I')
  def rfcommChannelWriteComplete_refcon_status_(self, rfcommChannel, refcon, status):
      if status == 0:  # kIOReturnSuccess
          print("Data sent successfully.")
      else:
          print("Failed to send data.")

I've tried a lot of way, rfcomm channel can connect and open successfully, also I can send the data to my device and get the call back in delegate method(rfcommChannelWriteComplete_refcon_status_), but the read data always failed, I don't know how to trigger the rfcommChannelData_data_length_ method, am I miss something?

@Realbuber Realbuber changed the title Question about IOBluetooth Question about delegate(IOBluetooth) Jul 1, 2024
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