Vineesh TP
Vineesh TP

Reputation: 7963

CoreBluetooth with C++

I need to send data via bluetooth from iOS app into a C++ application. So I have to implement Bluetooth module in c++, in iOS app using Corebluetooth framework.I created a wrapper class of bluetooth module for C++ app. I can call the iOS function from C++ application but, C++ doesn't have Corebbluetooth. Is it possible to create wrapper class for corebluetooth to use with C++ ? If possible how to create the same?

Upvotes: 1

Views: 983

Answers (1)

Jens Meder
Jens Meder

Reputation: 4367

Yes, that is possible.

You just need to create an Objective-C++ wrapper that forwards the messages to your C++ code. Objective-C++ allows you to use C++ code in your Objective-C classes. To use it, you either need to set the extensions of source files with your Objective-C wrapper from .m to .mm or set the sources to Objective-C++ in the File Inspector in Xcode.

Upvotes: 1

Related Questions