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
tanphat1412
Posts: 125
Registered: ‎11-06-2012
My Device: BlackBerry

Wifi, NFC, GPS, Bluetooth service

Any body know how to check  and change status (enabled, disabled)  of Wifi, NFC, GPS and Bluetooth? I didn't find any api to do that.

 

Thanks.

Retired
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10

Re: Wifi, NFC, GPS, Bluetooth service

Not all of those features can be enabled programatically.

 

Check bps/geolcation.h - have a look at error code 0x00001.

Check nfc/nfc.h - you can get user settings

Check btapi/btdevice.h - look for the word 'power'

Check wifi/wifi_service.h - look for the word 'power'

 

Thanks.

 

--
Rob is no longer associated with BlackBerry.
Developer
tanphat1412
Posts: 125
Registered: ‎11-06-2012
My Device: BlackBerry

Re: Wifi, NFC, GPS, Bluetooth service

Thanks. I feel a litte disappointed if those features can be enabled or disabled programatically.

Retired
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10

Re: Wifi, NFC, GPS, Bluetooth service

Some of them can...

--
Rob is no longer associated with BlackBerry.
Developer
tanphat1412
Posts: 125
Registered: ‎11-06-2012
My Device: BlackBerry

Re: Wifi, NFC, GPS, Bluetooth service

I've check the NFC from API, and there is no way except turn it off in the menu. About the Wifi, I've used "wifi_set_sta_power()" but nothing happen. Finally, I've no idea about bluetooth. Can you help me?

 

Thanks.

 

I forgot something, when I checkde NFC status by "nfc_get_setting()", It was right in the first time, but the second time is wrong. Can you explain to me? I'm a beginner at this :smileyhappy:

Retired
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10

Re: Wifi, NFC, GPS, Bluetooth service

nfc_get_setting shouldn't be responding differently - that sounds like a bug...

--
Rob is no longer associated with BlackBerry.
Developer
tanphat1412
Posts: 125
Registered: ‎11-06-2012
My Device: BlackBerry

Re: Wifi, NFC, GPS, Bluetooth service

I have no idea, the NFC is on. The first  nfc_get_setting is right, it shows that nfc is on, but i keep checking in a qtimer, the rest of time, it shows off.

Developer
smiley
Posts: 1,497
Registered: ‎07-14-2008
My Device: Z10

Re: Wifi, NFC, GPS, Bluetooth service

Anyone know what is the library that I need to link with wifi service?

 

 

Developer
pushkaraj9009
Posts: 72
Registered: ‎06-20-2013
My Device: Blackberry 10

Re: Wifi, NFC, GPS, Bluetooth service

u can enable or disable bluetooth by using bt_ldev_get_power() and bt_ldev_set_power() methods....for wifi and nfc u can use invocation...