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.

inside custom component

Native Development

Reply
Developer
drPetr007
Posts: 48
Registered: ‎10-11-2012
My Device: Z10
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 (Retired)
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

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

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

--
Rob is no longer associated with BlackBerry.
Please use plain text.
Developer
drPetr007
Posts: 48
Registered: ‎10-11-2012
My Device: Z10
My Carrier: none

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

Posted
Please use plain text.
BlackBerry Development Advisor (Retired)
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

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

Thank you!

--
Rob is no longer associated with BlackBerry.
Please use plain text.