PureSwift / BluetoothLinux

Pure Swift Linux Bluetooth Stack
MIT License
184 stars 30 forks source link

Problems with BlueZ library #1

Closed Antonasg closed 8 years ago

Antonasg commented 8 years ago

Hi

Wanted to try out your library but I'm stuck with a compile error:

/home/antongregersen/Swift/Projects/helloswift/Packages/CBlueZ-1.0.1/module.modulemap:3:12: error: header '/usr/include/bluetooth/a2mp.h' not found
    header "/usr/include/bluetooth/a2mp.h"

I've installed the libbluetooth-dev package, where according to http://packages.ubuntu.com/trusty/libbluetooth-dev the à2mp.h file should be included, but it's not in the usr/include/bluetooth/ folder.

Have you experienced any issues with this?

I'm running Ubuntu 15.10 on VMWare.

colemancda commented 8 years ago

Weird, worked for me on Ubuntu 14.04 on VMWare Fusion

Antonasg commented 8 years ago

Okay, I got it working by manually copying in the missing header files. Strange, I don't see how the Ubuntu version difference would explain the missing files.

Anyway, did a quick scan with the adapter and got the following:

[__C.inquiry_info(bdaddr: __C.bdaddr_t(b: (116, 50, 104, 247, 68, 72)), pscan_rep_mode: 0, pscan_period_mode: 0, pscan_mode: 0, dev_class: (60, 4, 8), clock_offset: 0)]

Not sure what it means yet, have to read up on BT programming and BlueZ. But hopefully I'll be able to contribute in a while :)

colemancda commented 8 years ago

It means its working. Thats the Swift runtime printing the description of the inquiry_info C struct.

Coleman,

On Dec 15, 2015, at 3:35 PM, Anton Schmidt Gregersen notifications@github.com wrote:

Okay, I got it working by manually copying in the missing header files. Strange, I don't see how the Ubuntu version difference would explain the missing files.

Anyway, did a quick scan with the adapter and got the following:

[__C.inquiry_info(bdaddr: __C.bdaddr_t(b: (116, 50, 104, 247, 68, 72)), pscan_rep_mode: 0, pscan_period_mode: 0, pscan_mode: 0, dev_class: (60, 4, 8), clock_offset: 0)] Not sure what it means yet, have to read up on BT programming and BlueZ. But hopefully I'll be able to contribute in a while :)

— Reply to this email directly or view it on GitHub https://github.com/PureSwift/SwiftBlueZ/issues/1#issuecomment-164889042.

Antonasg commented 8 years ago

By the way, I got the following error when building:

/home/antongregersen/Swift/Projects/helloswift/Packages/SwiftBlueZ-1.0.0/Sources/BlueZ/Address.swift:15:24: error: use of undeclared type 'ByteValue'

Had to remove ByteValue from Address for it to build. Where is ByteValuedefined? Can't find it in any Swift documentation.

Edit: Ahh I just saw it in SwiftFoundation. Hmm strange it can't find it.

colemancda commented 8 years ago

Sorry, just rename it to ByteValueType.

Coleman,

On Dec 15, 2015, at 3:49 PM, Anton Schmidt Gregersen notifications@github.com wrote:

By the way, I got the following error when building:

/home/antongregersen/Swift/Projects/helloswift/Packages/SwiftBlueZ-1.0.0/Sources/BlueZ/Address.swift:15:24: error: use of undeclared type 'ByteValue' Had to remove ByteValue from Address for it to build. Where is ByteValuedefined? Can't find it in any Swift documentation.

— Reply to this email directly or view it on GitHub https://github.com/PureSwift/SwiftBlueZ/issues/1#issuecomment-164892717.