Agamnentzar / bluetooth-serial-port

multi-platform bluetooth serial port library for C++
Other
89 stars 27 forks source link

not able to compile code in mac #15

Open kurmanadhvalla opened 4 years ago

kurmanadhvalla commented 4 years ago

I tried to compile and run ur code . I am using cmake from macports. It is creating btscan and libbluetoothserialport.a. when I try to excute that syntax error near unexpected tokennewline' ./libbluetoothserialport.a: line 1: !<arch>'

can u please help me how to make it work in mac. !!

Agamnentzar commented 4 years ago

@TobiSchluter did you have this issue on mac too ?

kurmanadhvalla commented 4 years ago

hey!! can someone help me with this please ?

TobiSchluter commented 4 years ago

Hi, it looks like you're trying to run the library. That wouldn't make sense. The library needs to be linked into a program to be useful. Have a look at the test executable to get started.

kurmanadhvalla commented 4 years ago

Hey !! Sorry about this basic question and I just want to know how to run that main.cpp inside test folder and what libraries to be linked ??

TobiSchluter commented 4 years ago

There's a target 'inquiretest' in the CMakeLists.txt which corresponds to this source file. I'm not in a position to test right now, but because it's flagged EXCLUDE_FROM_ALL I think you'll have to do 'make inquiretest' (or the equivalent for your build system) before it's actually built. You should then be able to execute 'inquiretest' like any other executable.

kurmanadhvalla commented 4 years ago

Hey Thanks that worked !! trying to connect to my phone from my mac using unique_ptr<BTSerialPortBinding> t(BTSerialPortBinding::Create("address of phone",inq->SdpSearch("address of phone") )); t->Connect(); .I am getting this exceptionCannot connect and I also tried channelId as 1 instead of SdpSearch(address) as mentioned in readme.md but still no luck .

kurmanadhvalla commented 4 years ago

Hey !! can you tell me what could be the issue ? and how can I resolve it ? instantiateOnDevice for regular cannot connect

TobiSchluter commented 4 years ago

Is your phone a BT serial device? I really don't know how we could help you with this.