Languages

Menu
Sites
Language
WIFI_NETWORK signalStrength refresh rate

Gear S: SM-R750
Tizen 2.2.1.4: R750XXU1BOC1
Tizen SDK for Wearable 1.0.0

Description:

I'd like to receive the signalStrength of Wifi connection in a WebApp on a Samsung Gear S as fast as possible, but the value does not refresh. I'm using tizen.systeminfo.getProptertyValue("WIFI_NETWORK", ...) and tizen.systeminfo.addPropertyValueChangeListener("WIFI_NETWORK", ...). The value changes only after restarting Wifi (longpress button -> Wifi) and after connecting to a network. How often should the value be updated or is this bugged?

Code:

var refreshTimer = 100;
$(window).load(function(){
	document.addEventListener('tizenhwkey', function(e) {
		tizen.application.getCurrentApplication().exit();
	});
	
	function onSucc(wifi) {
		if (wifi.status === "ON")
			console.log(wifi.signalStrength);
		else
			console.log(OFF);
	}
	setInterval(function() {
		console.log("REQUEST:");
		tizen.systeminfo.getPropertyValue("WIFI_NETWORK", onSucc, onErr);
	}, refreshTimer);
	
	function onWifiChanged(wifi) {
		console.log("wifi changed:");
		console.log(wifi);
	}
	tizen.systeminfo.addPropertyValueChangeListener("WIFI_NETWORK", onWifiChanged);
});

Config:

<feature name="http://tizen.org/feature/screen.size.all"/>
<feature name="http://tizen.org/feature/network.wifi"/>
<feature name="http://tizen.org/feature/network.internet"/>
<tizen:privilege name="http://tizen.org/privilege/internet"/>

Expected:

Polled value should be updated.

Edited by: Philipp Dittmann on 14 Aug, 2015

Responses

3 Replies
pius lee

I think documentation of WIFI_NETWORK is not clear.

I search a code for clearity In web device API code.

This code is processed on you call addPropertyValueCahngeListener("WIFI_NETWORK", ...).

Yes callback of WIFI_NETWORK is called into another function from connection_set_ip_address_changed_cb

Ok let's explorer how connection_set_ip_address_changed_cb is working.

If you search where callback is called then you find this code.

Actually, callback is called at "VCONFKEY_NETWORK_IP vconf key" is changed.

but we don't know yet when it changed. but only guess maybe ip is changed? or network interface status is changed?

Anyway, it means WIFI_NETWORK callback is not called when strength of signal is changed.

I think API documentation should be reinforced in future, and indipendent signal strength function is more clear.

Philipp Dittmann

So the callback is only called, when something more meaningful like ip changes.

 

Is there any way to receive the strength of the signal more up to date?

 

pius lee

It's a bug of 2.3 web device api, I think it will be fix in 2.4.

There is no way to get signal strength in web application only.

But you can get rssi value from native API, I think you can make it like hybrid application. native service and web application UI.

Use wifi_set_rssi_level_changed_cb  for observing signal strength change.