skku embedded software lab. 15 1 battery information 최완수 (2014711789) 김영훈 (2014711277)...

15
SKKU Embedded Software Lab. 15 1 https://github.com/batteryinfo Battery Information 최최최 (2014711789) 최최최 (2014711277) 최최최 (2014711645)

Upload: belinda-conley

Post on 24-Dec-2015

221 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

1

https://github.com/batteryinfo

Battery Information

최완수 (2014711789)김영훈 (2014711277)곽현호 (2014711645)

Page 2: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

2

• The need for batteries usage information in mobile environments – User

• Can check their use patterns• Can remove the application, there is a problem

– Developer• Can check possible errors related to power management• Can optimize app in power management

• Other mobile OS already supports the feature– Now need to provide that features in the Tizen

Provide Battery Usage Information

Page 3: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

3

• Two types of data– Battery remaining capacity/hardware device usage

information– Battery usage percentage for each app

Battery Information

Page 4: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

4

• Overall structure

Implementation

Data collection and processing

Service Daemon

Battery usage percentage for each apphardware device usage

Stat File

Existing Framework

Data Write

Display UI based on data

UI App

Communication

Page 5: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

5

• Obtain App list

Obtain Application Information [1/5]

Ecore Main Loop

소켓 통신 등록

Service Daemon

Appcore Framework

②Socket

Communica

tions

App [pid / name / state]

③Socket Communications

④App list configuration

①Socket Register

Page 6: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

6

• Inter-process communication same with a common socket socket programming – Use Ecore main loop & Socket register– Use ecore main loop in order not to create additional

loop thread

– Register socket for main loop

Obtain Application Information [2/5]

Init for custom service Ecore main loop example

Fd for socket communication call-back for socket communication

Page 7: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

7

• 5 Application State– When the state changes is needed, use app-core f/w – Edit App-core/src/appcore-efl.c

• Transfer the information to the service whenever changes occur to State

Obtain Application Information [3/5]

Change UI app state depending on event

Transfer Pid, name, state information

Page 8: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

8

• Organize usage information for the App in the List– Foreground state time in the app is the same as LCD on

time– Read CPU time for each App from proc filesystem

Obtain Application Information [4/5]

Service Daemon

Each hardware device usage updates for the App list

CPU usage time for each process

/proc/pid/stat read

Stat File

Calculate battery ratio for the App

Page 9: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

9

• Ratio calculation for each app

– Reflecting a 50% share for LCD & CPU usage time

• Can be extended to a more accurate result– Can reflect the power consumption of the real device– Can be added other hardware

Obtain Application Information[5/5]

Pid Name Percentage

Page 10: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

10

• Use Vconf– One of IPC

– Whenever the value in the vconf is changed, the corresponding f / w or app is operating

• Register call back

– Register notify for specific value of vconf

Hardware Information [1/2]

Brightness, battery, wifi state, other information exists

vconf_notify_key_changed(VCONFKEY_PM_STATE, _notify_pm_state_cb, NULL)

Page 11: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

11

• Used vconf value– VCONFKEY_PM_STATE

• LCD, power On/Off state

– VCONFKEY_WIFI_STATE• WiFi On/Off state

– VCONFKEY_SYSMAN_BATTERY_CAPACITY • Current battery capacity

Hardware Information[2/2]

Service Daemon

vconf_notify

RegisterNotify

Notify

Stat File

Time Value

Page 12: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

12

• Tizen::Graphics::Canvas– Using the Canvas to display a state change in the visual– Show battery usage graph and device on/off state– Use DrawLine for graph– Use FillRectangle for device on/off display

• Tizen::Ui::Controls::GroupedListView– Read the file and Show list by using GroupedListView– Add to the list as the number of app written in Applist– Display name and proportion of each App (%)

UI Implementation [1/2]

Page 13: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

13UI Implementation[2/2]

Battery capacityLCD On/OffWiFi On/Off

App listApp proportion (Based on CPU/LCD usage)

Page 14: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

14

Demo Movie

Demo

Page 15: SKKU Embedded Software Lab. 15 1  Battery Information 최완수 (2014711789) 김영훈 (2014711277) 곽현호 (2014711645)

SKKU Embedded Software Lab.

15

15

• https://github.com/batteryinfo

Git Hub

Service daemon code

Edited app-core code for transfer app state

UI Application

Example code for Ecore main loop and vconfnotify