});
}
- function subscribeEvents(event_callback) {
- wsAPI.subscribeEvents(event_callback);
- }
-
- function unsubscribeEvents(event_callback) {
- wsAPI.unsubscribeEvents(event_callback);
- }
-
function getDefaultAdapter() {
try {
if (tizen.bluetooth.getDefaultAdapter() == null) {
return {
BluetoothAdapter: BluetoothAdapter,
BluetoothDevice: BluetoothDevice,
- subscribeEvents: subscribeEvents,
- unsubscribeEvents: unsubscribeEvents,
getDefaultAdapter: getDefaultAdapter
};
})();
\ No newline at end of file
wsAPI.sendRequest(WS_REQUEST_TYPE.WIFI, 'disconnect', this.id, success_cb, error_cb);
};
- /* global functions */
- function subscribeEvents(callback) {
- wsAPI.subscribeEvents(callback);
- }
-
- function unsubscribeEvents(callback) {
- wsAPI.unsubscribeEvents(callback);
- }
-
function getTechnologies(success_cb, error_cb) {
wsAPI.sendRequest('connman', 'getTechnologies', null, function(results) {
success_cb(results);
return {
ConnmanTechnology: ConnmanTechnology,
ConnmanService: ConnmanService,
- subscribeEvents: subscribeEvents,
- unsubscribeEvents: unsubscribeEvents,
getTechnologies: getTechnologies,
getServices: getServices,
scan: scan
/* TODO: unsubscribe events if neccessary */
if (data.prevPage.attr('id') === 'page_connman') {
console.log('Connman settings exited');
- settings.connman.unsubscribeEvents(connmanEventReceived);
+ wsAPI.unsubscribeEvents(connmanEventReceived);
} else if (data.prevPage.attr('id') === 'page_bluetooth') {
console.log('Bluetooth settings exited');
- settings.bluetooth.unsubscribeEvents(bluetoothEventReceived);
+ wsAPI.unsubscribeEvents(bluetoothEventReceived);
} else if (data.prevPage.attr('id') === 'page_datetime') {
console.log('Date and Time settings exited');
}
$('#page_bluetooth').on('pageshow', function(event, data) {
if (data.prevPage.attr('id') === 'page_bluetooth_detail') return;
- settings.bluetooth.subscribeEvents(bluetoothEventReceived);
+ wsAPI.subscribeEvents(bluetoothEventReceived);
var adapter = settings.bluetooth.getDefaultAdapter();
if (adapter === null) {
showMsg('Error', 'Bluetooth adapter not found');
$('#page_connman').on('pageshow', function(event, data) {
if (data.prevPage.attr('id') === 'page_connman_service') return;
- settings.connman.subscribeEvents(connmanEventReceived);
+ wsAPI.subscribeEvents(connmanEventReceived);
console.log('Get all the available technologies');
$('#connman_technologies').html('');