Re: Operate on BlueZ provided file descriptor in C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Austin,

On Thu, Aug 10, 2017 at 5:06 AM, Austin Riffle <ARiffle@xxxxxxxx> wrote:
> Hello
>
> I am attempting to work with the org.bluez.Profile1 in BlueZ 5.44. When connecting with a new device via the NewConnection DBus method, we get a file descriptor to work with. I am fairly confused on what state this file descriptor is in, and what I need to do in order to read/write from it. Simply calling read/write does not behave as expected for me.
>
> In the file test/test-profile, I see this line of python code:
>
> self.fd = fd.take()
>
> I am struggling to find the Linux C equivalent to the take method, as I believe this is what I need to do to operate on the fd. Any advice on how to configure this fd in Linux C code so I can read/write with the fd would be very helpful!

Though the code bellow is not handling the NewConnection it should
give you clear picture how to deal with file descriptors:

https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/client/gatt.c#n750

Or in case of actual NewConnection you can check how PulseAudio
implements it for HSP:

https://github.com/pulseaudio/pulseaudio/blob/master/src/modules/bluetooth/backend-native.c#L492

> Thanks
> Austin
> This e-mail transmission, and any documents, files or previous e-mail messages attached to it, may contain confidential information. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, distribution, review, copy or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify us by reply e-mail, and destroy the original transmission and its attachments without reading them or saving them to disk. Thank you.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux