Reputation: 913
I have self developed Bluetooth device which support Serial Port service.
I am using the WCL library from BTframework.com .
I am also familiar with 32feet code.
I have no problem pairing the device via code, but I cant figure out how to activate the SPP service, Any idea how ?
Thanks
Upvotes: 1
Views: 2785
Reputation: 1
To enable SPP: deviceInfo.SetServiceState(BluetoothService.SerialPort, true);
Upvotes: 0
Reputation: 1024
Then can you explaing what you need to do exactly. Following your question you do not need to activate service. You can simple connect to that service. And there are 2 ways to do so.
The first way is to use native bluetooth communication (API). As there are at least 4 popular bluetooth stacks on Windows platform than first thing you have to do is decide whicb one is installed on your PC. Then you can use its API. They are all absolutely different. WCL and 32feet hides those differents from you and provides high level classes. Both have demo shows how to communicate with spp service. In WCL it is BluetoothClientDemo.
The second way is to use vCOM mechanism It is when you use Bluetooth drivers tool (on your picture it is ms add device dialog) to pair witb your device and connect to it. In this case a Bluetooth driver hides the connection under Virtual COM port which you can use then in your application. And again the low-level methods depend on driver used and are very fifferent. I am not sure if 32feet provides such functional but you can do it with WCL easy.
In both cases it is better to work with your device completly from your application. Because there is no easy way to find vCOM number for device installed by Bluetooth driver tool.
And I should repeat: yoj do not need to "activate" service. Think about it as about tcp services (ftp, smtp, http).
I hope this answered your question.
Upvotes: 0
Reputation: 21
With BTFramework (Wireless Communication Library) you have 2 ways to communicate with your device:
Direct communication using native Bluetooth connection. In this case use wclClient class with Trasport set to trBluetooth. It allows you to communicate with any RFCOMM enabled Bluetooth device. This is preffered way and you do not need to use any vCOM then. As far as I know 32feet has identical mechanism.
Legacy vCOM way. You can use wclVirtualCOMPort class to create vCOM associated with device and then you can use wclClient too (with Trasport set to trSerial) or any thrid-party Serial Library. This way is not so good and is in WCL only for legacy application support.
Upvotes: 2