After looking into possible Bluetooth SDKs, I have chosen to go with Widcomm for the time being. Microsoft's would be preferable, as it would work on any Windows computer, but I have found it to be too limited for my purposes.
For design purposes, I have thus far created 3 classes for this, WCRadio, WCDevice, and WCL2CapConn. The WCRadio class represents that actual computer using the program (technically it is the bluetooth adapter), WCDevice is a class to hold information on Devices picked up during WCRadio::scan (). WCL2CapConn is used to create an L2Cap connection, and is actually the only class that needs to be changed for other connections.
The basic order in which things are done are as follows:
1) WCRadio initiates a scan for nearby devices
2) A callback function in WCRadio is called whenever a device responds
3) A new device is created from these calls to the callback function. If this device hasn't been seen in the current scan, it is added to a vector of scanned devices
4) After the scan is completed, another callback function is called to inform the application. I have this currently printing out the vector of scanned devices and some of their data
Once a device is created, a connection, such as WCL2CapConn can be created. The design will be such that a WCRFCOMMConn, when created, can easily be substituted for WCL2CapConn, possibly with the use of a WCBTConnection class that all connection classes inherit.
Wednesday, April 16, 2008
Subscribe to:
Comments (Atom)