Re: How to set up a serial port with a paired BT device and get the file descriptor of it
i'd like to set up a serial port to the paired device, and get the file descriptor of it.
Introduction to Accessing Hardware From Applications (I/O Kit) <https://developer.apple.com/library/mac/#documentation/DeviceDrivers/Concep tual/AccessingHardware/> Introduction to Device File Access Guide for Serial I/O (tty) <https://developer.apple.com/library/mac/#documentation/DeviceDrivers/Concep tual/WorkingWSerial/WWSerial_Intro/> Code Example <https://developer.apple.com/library/mac/#samplecode/SerialPortSample/>
This is intended to be a mac port of an existing software, and thus i need to use the file descriptor to write/read to/from the serial port rather than using the available rfcomm methods at the framework.
IOBluetooth does not help then. However, I recommend to go for IOBluetooth because with tty Bluetooth ports my experience is rather bad difficult to set-up or to auto-detect new devices. If you code in Objective-C, Xcode (Developer Tools) installed several examples in Macintosh HD » Developer » Examples » Bluetooth. Your¹s are RFCOMMClientSample and RFCOMM_Open_SPP_Example. If you code in Java, I recommend to look at BlueCove <http://code.google.com/p/bluecove/wiki/Documentation>. It bridges IOBluetooth to JSR-82, an standard Java API for Bluetooth access <http://www.jcp.org/en/jsr/detail?id=82>. BlueCove even works in Windows and is open source it is another code example for C. If you code in REALbasic, have a look at the bridge, I made on my own <http://www.traud.de/realbasic/IOBluetooth.img> which is open source, too. The latest version is available on request. If you (really) want to link between IOBluetooth and tty for auto-detection and device selection , I traversed IORegistry of IOKit. An example is in my REALbasic bridge. _______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com
participants (1)
-
Alexander Traud