语言

Menu
Sites
Language
Facing Issues while reading Sensor Data in a Service App

 

I'm trying to get laocation in the Service Application, but I'm facing a lot of errors instead of location data. I'm wondering why the same code works fine in a simple UI Application, I'm sorry about the lengthy post but some of the Errors (from the log file) which I think related to the location tracking, are given below to get an idea about what's going on:

//Location Related

E 2672	SLP_LBSPLUGIN	gps_plugin_brcm.c: brcm_gps_request(5819) > [PLGN] SAP DISCONNECTED. ignor result

E 2672	LBS_SERVER_GPS	dump_log.c: gps_dump_log(302) > Add dump log [lbs_server_status [0] = TRUE

E 2672	LBS_SERVER_GPS	server.c: _gps_server_gps_event_cb(2339) > Failed get reference time

E 2672	LBS_SERVER_GPS	dump_log.c: gps_dump_log(302) > Add dump log [GPS_EVENT_GET_REF_LOCATION(0x300) from [GPS Plugin]

W 2672	LBS_SERVER_GPS	server.c: _gps_server_gps_event_cb(2249) > Request(GPS_EVENT_GET_REF_LOCATION) from GPS Plugin > get reference location with Timeout[20] from LBS Provider

E 2672	LBS_SERVER_GPS	dump_log.c: gps_dump_log(302) > Add dump log [START COMPANION-WPS from [lbs-server/get_ref_location]

W 2750	STARTER	hw_key.c: _powerkey_timer_cb(754) > [_powerkey_timer_cb:754] _powerkey_timer_cb, powerkey count[1]

W 2750	STARTER	hw_key.c: _powerkey_timer_cb(906) > [_powerkey_timer_cb:906] clock visibility[0] pressed lcd status[1], current lcd status[1] pressed pm state[1]

W 2750	STARTER	dbus-util.c: dbus_util_get_call_status(324) > [dbus_util_get_call_status:324] call status[0] type[1]

E 2674	TRM_SERVER	Add_Trace_Log :: AppLaunchHomeLock

W 2750	AUL	launch.c: app_request_to_launchpad_for_uid(301) > request cmd(0) : appid(com.samsung.w-home), target_uid(5001)

W 2179	AMD	amd_product_safemode.c: _amd_get_safe_mode(34) > Safe mode value = 0

W 2750	STARTER	pkg-monitor.c: __app_status_resume_cb(471) > [__app_status_resume_cb:471] Resume request [2774]

W 2774	W_HOME	HomeApp.cpp: onAppControl(193) > firstLaunch:0

W 2774	CAPI_APPFW_APP_CONTROL	app_control.c: app_control_error(116) > [app_control_get_extra_data] KEY_NOT_FOUND(0xffffff82)

W 2774	CAPI_APPFW_APP_CONTROL	app_control.c: app_control_error(116) > [app_control_get_extra_data] KEY_NOT_FOUND(0xffffff82)

W 2774	W_HOME	HomeApp.cpp: _onAppControl(238) > app operation:http://tizen.org/appcontrol/operation/main

W 2774	W_HOME	HomeApp.cpp: _onAppControl(242) > home operation:powerkey

E 2672	LBS_SERVER_COMPANION	server.c: _consumer_event_cb(983) > Start Session, error : -200

W 2774	W_HOME	HomeMainCtrl.cpp: handleAppControl(345) > command:powerkey

E 2672	LBS_CONSUMER_PLUGIN	lbs_plugin_consumer_main.c: _start_session(698) > lbs consumer plugin failed to send [start session]:[-4]

E 2674	TRM_SERVER	Add_Trace_Log :: AppLaunchLock


//Other Errors
W 8335	MESSAGE_PORT	message_port_common.c: read_socket(153) > read_socket: 11 , sleep and retry ...

E 2889	CAPI_MEDIA_CONTROLLER	media_controller_main.c: __mc_main_check_connection(37) > [No-error] Timer is Called but there is working Process, connection_cnt = 3

E 114	WMS	wms_event_handler.c: _wms_event_handler_cb_nomove_detector(18100) > _wms_event_handler_cb_nomove_detector is called

 

Here's some information about the project:

 

I followed this tutorial to launch a service app from the host app. Both the host and service applications have the following privileges:

  • http://tizen.org/privilege/appmanager.launch
  • http://tizen.org/privilege/location
  • http://tizen.org/privilege/healthinfo

Using the MessagePort, Both applications communicate with each other like this: 

  • Host App sends a message to Service App about executing a required method.
  • Service App executes that particular method and sends feedback to the host app (e.g. Location Tracking Started).
  • Host App recieves the feedback and then updates the UI accordingly.

Here's the sample code which I manipulated for the Location Tracking in my Service App.

响应

7 回复
Tizen .NET

Hi,

CAPI_APPFW_APP_CONTROL	app_control.c: app_control_error(116) > [app_control_get_extra_data] KEY_NOT_FOUND(0xffffff82)

Could you check if key-value pair is passed properly  for appcontrol's ExtraData? (Please double-check it after uninstalling your apps.)

// In UI APP

    AppControl appcontrol = new AppControl() {
        ApplicationId = Utility.ServiceAppID,
    };
    appcontrol.ExtraData.Add("location", "start");
    Tizen.Log.Info(Program.LOG_TAG, "####   ExtraData : " + appcontrol.ExtraData.Count());
    if (appcontrol.ExtraData != null)
    {
        foreach (string s in appcontrol.ExtraData.GetKeys())
        {
            Tizen.Log.Info(Program.LOG_TAG, "####   key = : " + s);
        }
    }

// In Service App

protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
{
    base.OnAppControlReceived(e);
    
    Tizen.Log.Info(LogTag, "####   ExtraData : " + e.ReceivedAppControl.ExtraData.Count());
    if (e.ReceivedAppControl.ExtraData != null)
    {
        foreach (string s in e.ReceivedAppControl.ExtraData.GetKeys())
        {
            Tizen.Log.Info(LogTag, "####   key = : " + s);
        }
        string type = e.ReceivedAppControl.ExtraData.Get<string>("location");
        if (string.Compare(type, "start") == 0)
        {
            LocationService.Instance.StartLocationService();
        }
        else if (string.Compare(type, "stop") == 0)
        {
            LocationService.Instance.StopLocationService();
        }
    }
}

In addition, please check if  <background-category>  is declared in tizen-manifest.xml file to get location data even if the app is running in the background.

Please check out the sample code.

Thanks.

 

 

 

 

 

 

 

 
Itban Saeed

Hi,

Thank you so much for the detailed response along with the Sample Code. I'm sorry for being a bit late (was stuck somewhere else).

By following your guidelines about the background-category I'm getting the Heart Rate from the Service.

But I'm still getting some errors in getting Location from the Sensor.

I would be greateful if given some guidance on the log file data from your Sample Application:

In the following section:

  • I is for Info
  • W for Warning
  • E for Error

 

I 10979    10979	MyService	Task%20: OnAppControlReceived(36) > ####   OnAppControlReceived - ReceivedAppControlOperation :http://tizen.org/appcontrol/operation/stop_location_service

I 10979	10979	Tizen.Location	Locator.cs: Stop(354) > Stopping Location Manager
E 10873	10873	EFL	edje<10873> lib/edje/edje_calc.c:739 _edje_part_description_apply() Cannot find description "disabled" in part "event" from group "elm/button/base/default". Fallback to default description.

I 10979	10979	LOCATION	location-hybrid.c: location_hybrid_stop(1022) > location_hybrid_stop
W 10979	10979	LOCATION	location-gps.c: location_gps_set_property(1869) > Set prop>> requested_start_by_hybrid: 0
W 10979	10979	LOCATION	location-wps.c: location_wps_set_property(1338) > Set prop>> requested_start_by_hybrid: 0
I 10979	10979	LOCATION	location-gps.c: location_gps_stop(1311) > location_gps_stop
W 10979	10979	LOCATION	location-gps.c: location_gps_stop(1320) > GPS stop
I 10979	10979	LOCATION	location-gps.c: __reset_pos_data_from_priv(162) > __reset_pos_data_from_priv
W 10979	10979	LOCATION	location-gps.c: __reset_pos_data_from_priv(166) > reset
W 10979	10979	LOCATION	location-gps.c: __reset_pos_data_from_priv(199) > reset done
I 4639	4639	LBS_SERVER	lbs_server.c: update_gps_tracking_interval(1179) > update interval, type = 1, client = :1.856, method = 0, interval = 1, prev_interval = 0

E 4639	4639	LBS_SERVER_GPS	dump_log.c: gps_dump_log(302) > Add dump log [update interval, type = 1, client = :1.856, method = 0, interval = 1, prev_interval = 0

E 4639	4639	LBS_SERVER_GPS	dump_log.c: gps_dump_log(302) > Add dump log [STOP GPS from [10979/org.tizen.example.MyService]

E 4639	4639	LBS_SERVER_GPS	w_ext_main.c: energy_mon_log(461) > done
I 4639	4639	LBS_SERVER_GPS	lbs_server.c: gps_set_status(2603) > WAITING
W 4639	4639	libgps_d	GpsiHook: API: gpsStop(GpsiHookStateGps: e,c,g)
I 4639	4639	SLP_LBSPLUGIN	gps_plugin_brcm.c: brcm_gps_request(5687) > brcm_gps_request : 2
I 4639	4639	SLP_LBSPLUGIN	gps_plugin_brcm.c: gps_status_cb(298) > status->status = 2
W 4639	4639	libgps_d	GpsiHook: API: gpsStatusCb(GpsiHookStateGps: e,c,g)
I 4639	4639	SLP_LBSPLUGIN	gps_plugin_brcm.c: gps_status_cb(298) > status->status = 4
W 4639	4639	libgps_d	GpsiHook::deliverStatus() GPS_STATUS_SESSION_END
I 4639	4639	SLP_LBSPLUGIN	gps_plugin_brcm.c: gps_status_cb(385) > *****Engine off*****
W 4639	4639	libgps_d	GpsiHook: API: gpsStatusCb(GpsiHookStateGps: E,c,g)
I 4639	4639	SLP_LBSPLUGIN	gps_plugin_brcm.c: gps_status_cb(298) > status->status = 2
W 2556	2556	gpsd_d	HandleIncomingMessage() dest id:0, msg id:2
W 2556	2565	gpsd_d	ProcessEvent(fd4, bRead=1, bWrite=0, bError=0), handler=GpsiServerWriteSM, g_isOnChipPvtStarted=0
W 2556	2565	gpsd_d	ProcessEvent(fd4, bRead=1, bWrite=0, bError=0), handler=GpsiServerWriteSM, g_isOnChipPvtStarted=0
W 2556	2565	gpsd_d	ProcessEvent(fd4, bRead=1, bWrite=0, bError=0), handler=GpsiServerWriteSM, g_isOnChipPvtStarted=0
W 2556	2565	gpsd_d	ProcessEvent(fd4, bRead=1, bWrite=0, bError=0), handler=GpsiServerWriteSM, g_isOnChipPvtStarted=0
W 2556	2565	gpsd_d	ProcessEvent(fd4, bRead=1, bWrite=0, bError=0), handler=GpsiServerWriteSM, g_isOnChipPvtStarted=0
W 2556	2565	gpsd_d	ProcessEvent(fd4, bRead=1, bWrite=0, bError=0), handler=GpsiServerWriteSM, g_isOnChipPvtStarted=0
W 2556	2565	gpsd_d	ProcessEvent(fd4, bRead=1, bWrite=0, bError=0), handler=GpsiServerWriteSM, g_isOnChipPvtStarted=0
W 4639	4639	libgps_d	GpsiHookStateGps              : EXIT
W 4639	4639	libgps_d	GpsiHookStateIdle             : ENTRY
I 4639	4639	LBS_SERVER_GPS	lbs_server.c: shutdown(2166) > shutdown callback gps:1 nps:1, companion-gps:1 companion-wps:1
W 2556	2556	gpsd_d	ProcessEvent(fd18, bRead=1, bWrite=0, bError=0), handler=IpcInterface, g_isOnChipPvtStarted=0
W 2556	2556	gpsd_d	BrcmGpsLhdHal::OnIpcMessage [22]( A5 93 02 80 10 00 84 BD 08 00 E0 00 82 00 07 12 00 01 57 03 A5 68)
I 10979	10979	LOCATION_GPS	gps_module.c: stop(474) > stop gps interval [1]
W 10979	10979	LOCATION	location-gps.c: gps_status_cb(663) > enabled = 0, status = 0
I 10979	10979	LOCATION	location-wps.c: location_wps_stop(1058) > location_wps_stop
W 10979	10979	LOCATION	location-wps.c: location_wps_stop(1068) > WPS stop
W 2556	2556	gpsd_d	ProcessEvent(fd18, bRead=1, bWrite=0, bError=0), handler=IpcInterface, g_isOnChipPvtStarted=0
W 2556	2556	gpsd_d	BrcmGpsLhdHal::OnIpcMessage [42]( A5 93 02 80 24 00 85 BD 1B 00 0F 55 E0 03 17 80 06 2E E0 01 E0 00 83 00 07 12 00 01 0F 58 12 3C 35 1C 81 E0 01 1A F5 08 A5 68)
I 10979	10979	Tizen.Location	Locator.cs: ServiceStateChanged(614) > Callback removed
I 10979	10979	Tizen.Location	Locator.cs: ServiceStateChanged(619) > Calling function UnSetServiceStateChangedCallback
I 10979	10979	Tizen.Location	Locator.cs: UnSetServiceStateChangedCallback(647) > Calling Interop.LocatorEvent.UnSetServiceStateChangedCallback

I 10979	10979	Tizen.Location	Locator.cs: LocationChanged(878) > Removing LocationChanged EventHandler
I 10979	10979	Tizen.Location	Locator.cs: LocationChanged(890) > Calling function UnSetLocationChangedCallback
I 10979	10979	Tizen.Location	Locator.cs: UnSetLocationChangedCallback(921) > Calling UnSetLocationChangedCallback
I 10979	10979	Tizen.Location	Locator.cs: SettingChanged(744) > Removing SettingChanged EventHandler
I 10979	10979	Tizen.Location	Locator.cs: SettingChanged(749) > Calling function UnSetSettingChangedCallback
I 10979	10979	Tizen.Location	Locator.cs: UnSetSettingChangedCallback(777) > Calling UnSetSettingChangedCallback
W 10979	10979	CAPI_LOCATION_MANAGER	locations.c: location_manager_unset_setting_changed_cb(1288) > location_manager_unset_setting_changed_cb

W 10979	10979	LOCATION	location.c: location_ignore_setting_notify(1080) > Release cb, method = 0
E 10979	10979	LOCATION	location-setting.c: location_setting_ignore_notify(146) > vconf_ignore_key_changed failed on memory/private/weconn/ios_connected

I'm facing the following error in my Application as well:

LBS_SERVER_GPS    dump_log.c: gps_dump_log(302) > Add dump log [timestamp [1567547624], sat num [0] view num [0] used [0]

Following all your guidelines regarding privileges and background category, Is there any issue with my device behaviour ? I'm using Samsung Gear S3 Frontier.

Tizen .NET

Hi, 

LBS_SERVER_GPS    dump_log.c: gps_dump_log(302) > Add dump log [timestamp [1567547624], sat num [0] view num [0] used [0]

It is not an error log message. It is just a normal log to get information about some location parameters. 

Thanks.

Susnata Sovalin

Hello,

 LBS_SERVER_GPS    dump_log.c: gps_dump_log(302) > Add dump log [timestamp [1567547624], sat num [0] view num [0] used [0]

 

 This is not an error log message. It is just a normal log to get information about some location parameters.

 

 

Thanks

Itban Saeed

Hi,

 

Thanks a lot for the continous guidance. I thought it's an error because it's level is set as an "Error" in the logs and not "Info" or anything else.  I have checked again and noticed that I'm not getting the locaion because the service state is not being changed after the Locator has been started successfully.
 

  • The weird thing is that other sample apps which were working fine, Now also behaving the same way.
     
  • I have also reset the device but it didn't work.

A little R&D makes me believe that the GPS of Samsung Smart Watch is not efficient enough to work always and sometimes it behaves weird and sometimes any other issue can be faced.

Itban Saeed

I have found the following information about Location Framework in a white paper (Page 42):

 

The LBS plugin is implemented based on the Tizen LBS server for a vendor-specific GPS device.

The LBS plugin is implemented as a shared library and the lbs-server loads a specific LBS plugin at runtime. AnLBS plugin mustbe written with predefined interfaces. The lbs-server-plugin-dev source package is installed on OBS by adding the following command in the package spec file:

  • BuildRequires: pkgconfig(lbs-server-plugin)Within thelbs-server-plugin-dev package, thesource files are locatedin:
  • /usr/include/lbs-server-plugin/*.h
  • /usr/lib/pkgconfig/lbs-server-plugin.pcThe gps_plugin_intf.h

file includes the API interfaces for the communication between the lbs-server and its GPS plugin

 

This is the configuration for Native Application. Do we have any such packages to be configured for using Location as Service in Tizen .NET as well?

If yes, then how can I ensure that I've configured the lbs server kinds of things correctly in my .NET application ?

 

Susnata Sovalin

Hello

NET application internally use  Native APIs. 

Both Native and  .NET application use the same plugins.