Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
New Developer
drPetr007
Posts: 14
Registered: ‎10-11-2012
My Carrier: none

BUG in QBluetoothLocalDevice.hostMode() [not critical] + solution

[ Edited ]

Hi

Function hostMode()  (https://developer.blackberry.com/cascades/reference/qbluetoothlocaldevice.html#function-hostmode) in QBluetoothLocalDevice always returns HostDiscoverable. So if you powering Bluetooth, that is currently powered on, using Qt in Cascades your application will crash with message

 

default   9000  void QtMobility::QBluetoothLocalDevicePrivate::controlReply
(QtMobility::smileytongue:psResult) "radio is not in disabled state"

 

One have use native bt_ldev_get_power() that return correct Bluetooth state.

 

Bug was found using BlackBerry 10 Dev Alpha Native SDK 10.0.10.261 on Dev Alpha with firmware 10.9.10.35

 

Some code for testing :

	if (__pBtDevice==NULL) {

		QList<QtMobility::QBluetoothHostInfo> devList= QtMobility::QBluetoothLocalDevice::allDevices();
		if (devList.count()!=0){
			qDebug()<<devList.count();
			__pBtDevice= new QtMobility::QBluetoothLocalDevice(devList.at(0).getAddress(), this);

		}
	}
		bt_device_init(NULL) ;
		qDebug()<<"host mode="<<__pBtDevice->hostMode()<<" is valid="<<__pBtDevice->isValid()<<" native_bb_power_mode="<<bt_ldev_get_power();

		bt_device_deinit();
		__pBtDevice->powerOn();

 

 

 

Please use plain text.
BlackBerry Development Advisor
robbieDubya
Posts: 128
Registered: ‎07-18-2012
My Carrier: Bell Canada

Re: BUG in QBluetoothLocalDevice.hostMode() [not critical] + solution

Please create an issue at https://www.blackberry.com/jira

Please use plain text.
New Developer
drPetr007
Posts: 14
Registered: ‎10-11-2012
My Carrier: none

Re: BUG in QBluetoothLocalDevice.hostMode() [not critical] + solution

Posted
Please use plain text.
BlackBerry Development Advisor
robbieDubya
Posts: 128
Registered: ‎07-18-2012
My Carrier: Bell Canada

Re: BUG in QBluetoothLocalDevice.hostMode() [not critical] + solution

Thank you!

Please use plain text.