D.I.T. ( Do It Tizen! )  1.0.0
Samsung Software Membership
 All Data Structures Files Functions Macros Pages
Data Structures | Functions
DeviceStatus.h File Reference

Device Status API 를 사용하기 위해 포함해야 하는 헤더이다. More...

#include <stdbool.h>
#include <stdalign.h>
#include "dit.h"
#include <device/display.h>
#include <device/haptic.h>
Include dependency graph for DeviceStatus.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  Vibration
 Vibration 모듈에 대한 구조체이다. Vibration 모듈은 다양한 방식으로 진동을 조절 할 수 있다. More...
 
struct  VibrationExtend
 
struct  Display
 Display 모듈에 대한 구조체이다. Display 모듈은 다양한 방식으로 화면을 조절 할 수 있다. More...
 
struct  DisplayExtend
 
struct  Battery
 Battery 모듈에 대한 구조체이다. Battery 모듈은 배터리의 정보를 읽어 올 수 있다. More...
 
struct  BatteryExtend
 
struct  Flash
 Flash 모듈에 대한 구조체이다. Flash 모듈은 Device의 플래시를 제어 할 수 있다. More...
 

Functions

const char * DeviceStatusErrorCheck (int errCode)
 Device Status API에서 발생하는 Error Code들을 확인 해준다. More...
 
Vibration NewVibration (void)
 새로운 Vibration 객체를 생성한다. More...
 
void DestroyVibration (Vibration this_gen)
 생성한 Vibration 객체를 소멸 시킨다. More...
 
bool VibrationCustom (Vibration this_gen, int period)
 사용자가 정의한 시간만큼 device를 진동 시킨다. More...
 
bool VibrationShort (Vibration this_gen)
 짧은 시간만큼 device를 진동 시킨다. (0.1초) More...
 
bool VibrationMiddle (Vibration this_gen)
 중간 시간만큼 device를 진동 시킨다. (0.5초) More...
 
bool VibrationLong (Vibration this_gen)
 긴 시간만큼 device를 진동 시킨다. (1.5초) More...
 
Display NewDisplay (void)
 새로운 Display 객체를 생성한다. More...
 
void DestroyDisplay (Display this_gen)
 생성한 Display 객체를 소멸 시킨다. More...
 
bool DisplayLock (Display this_gen)
 Device의 화면을 강제로 끈다.(잠금) More...
 
bool DisplayUnlock (Display this_gen)
 Device의 꺼진 화면을 다시 켠다. More...
 
bool DisplayDim (Display this_gen)
 Device의 화면을 어둡게 한다. More...
 
int getDisplayBrightLevel (Display this_gen)
 현재 화면의 밝기 값을 반환 한다. More...
 
bool setDisplayBrightLevel (Display this_gen, int brightLevel)
 현재 화면의 밝기 값을 설정 한다. More...
 
Battery NewBattery (void)
 새로운 Battery 객체를 생성한다. More...
 
void DestoryBattery (Battery this_gen)
 생성한 Battery 객체를 소멸 시킨다. More...
 
int getBatteryRemainsPercent (Battery this_gen)
 현재 배터리의 잔량을 반환 한다. More...
 
bool isBatteryCharging (Battery this_gen)
 현재 배터리의 충전 상태 여부를 반환 한다. More...
 
Flash NewFlash (void)
 새로운 Flash 객체를 생성한다. More...
 
void DestoryFlash (Flash this_gen)
 생성한 Flash 객체를 소멸 시킨다. More...
 
bool onFlash (void)
 후면 카메라의 플래시를 켠다. More...
 
bool offFlash (void)
 후면 카메라의 플래시를 끈다. More...
 

Detailed Description

Device Status API 를 사용하기 위해 포함해야 하는 헤더이다.

Note
Device의 Vibration / Display / Battery / Flash 관련 API를 제공한다.
See Also
Tizen Native API

Data Structure Documentation

struct VibrationExtend
Collaboration diagram for VibrationExtend:
Collaboration graph
Data Fields
haptic_device_h handle
struct _Vibration vibration
struct DisplayExtend
Collaboration diagram for DisplayExtend:
Collaboration graph
Data Fields
int brightLevel
struct _Display display
display_state_e state
struct BatteryExtend
Collaboration diagram for BatteryExtend:
Collaboration graph
Data Fields
struct _Battery battery
int batteryLevel
bool charging

Function Documentation

void DestoryBattery ( Battery  this_gen)

생성한 Battery 객체를 소멸 시킨다.

Parameters
[in]this_gen소멸시킬 Battery 객체
[out]null
Return values
void
Note
생성한 Battery 객체를 소멸 시킨다.
Battery 객체를 사용한 후 반드시 호출해야 한다.
See Also
NewBattery
void DestoryFlash ( Flash  this_gen)

생성한 Flash 객체를 소멸 시킨다.

Parameters
[in]this_gen소멸시킬 Flash 객체
[out]null
Return values
void
Note
생성한 Flash 객체를 소멸 시킨다.
Flash 객체를 사용한 후 반드시 호출해야 한다.
See Also
NewFlash
Precondition
feature
priviledge
void DestroyDisplay ( Display  this_gen)

생성한 Display 객체를 소멸 시킨다.

Parameters
[in]this_gen소멸시킬 Display 객체
[out]null
Return values
void
Note
생성한 Display 객체를 소멸 시킨다.
Display 객체를 사용한 후 반드시 호출해야 한다.
See Also
NewDisplay
Precondition
privilege
void DestroyVibration ( Vibration  this_gen)

생성한 Vibration 객체를 소멸 시킨다.

Parameters
[in]this_gen소멸시킬 Vibration 객체
[out]null
Return values
void
Note
생성한 Vibration 객체를 소멸 시킨다.
Vibration 객체를 사용한 후 반드시 호출해야 한다.
See Also
NewVibration
Precondition
privilege
const char * DeviceStatusErrorCheck ( int  errCode)

Device Status API에서 발생하는 Error Code들을 확인 해준다.

Parameters
[in]errCode확인 하고자 하는 Error Code
[out]null
Return values
DEVICE_ERROR_NONE: Successful
DEVICE_ERROR_OPERATION_FAILED: Operation not permitted
DEVICE_ERROR_PERMISSION_DENIED: Permission denied
DEVICE_ERROR_INVALID_PARAMETER: Invalid parameter
DEVICE_ERROR_ALREADY_IN_PROGRESS: Operation already in progress
DEVICE_ERROR_NOT_SUPPORTED: Not supported in this device
DEVICE_ERROR_NOT_INITIALIZED: Not initialized
DEVICE_ERROR_UNKNOWN: Unknown error occurred
Note
Device Status API에서 발생하는 Error Code들을 확인 해준다.
Error의 내용은 Log를 통해 출력 된다.
8가지의 Error Code들을 확인 가능 하다.
See Also
Tizen Native API Document - Device Error

Here is the caller graph for this function:

bool DisplayDim ( Display  this_gen)

Device의 화면을 어둡게 한다.

Parameters
[in]this_gen어둡게 할 Display 객체
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
Device의 화면을 어둡게 한다.
이 때의 화면 밝기는 10% 이다.
See Also
NewDisplay
DisplayLock
DisplayUnlock
getDisplayBrightLevel
setDisplayBrightLevel
Precondition
privilege

Here is the call graph for this function:

Here is the caller graph for this function:

bool DisplayLock ( Display  this_gen)

Device의 화면을 강제로 끈다.(잠금)

Parameters
[in]this_gen강제로 끌 Display 객체
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
Device의 화면을 강제로 끈다.
See Also
NewDisplay
DisplayUnlock
DisplayDim
getDisplayBrightLevel
setDisplayBrightLevel
Precondition
privilege

Here is the call graph for this function:

Here is the caller graph for this function:

bool DisplayUnlock ( Display  this_gen)

Device의 꺼진 화면을 다시 켠다.

Parameters
[in]this_gen다시 켤 Display 객체
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
Device의 꺼진 화면을 다시 켠다.
See Also
NewDisplay
DisplayLock
DisplayDim
getDisplayBrightLevel
setDisplayBrightLevel
Precondition
privilege

Here is the call graph for this function:

Here is the caller graph for this function:

int getBatteryRemainsPercent ( Battery  this_gen)

현재 배터리의 잔량을 반환 한다.

Parameters
[in]this_gen배터리 잔량을 반환 할 Battery 객체
[out]null
Return values
int배터리 잔량은 % 단위로 0 ~ 100의 값을 가진다.
Note
현재 배터리의 잔량을 반환 한다.
See Also
NewBattery
isBatteryCharging

Here is the call graph for this function:

Here is the caller graph for this function:

int getDisplayBrightLevel ( Display  this_gen)

현재 화면의 밝기 값을 반환 한다.

Parameters
[in]this_gen밝기 값을 반환 할 Display 객체
[out]null
Return values
int현재 화면 밝기(%)
Note
현재 화면의 밝기 값을 반환 한다.
밝기 값은 % 단위로 0 ~ 100의 값을 가진다.
See Also
NewDisplay
DisplayLock
DisplayUnlock
DisplayDim
setDisplayBrightLevel
Precondition
privilege

Here is the call graph for this function:

Here is the caller graph for this function:

bool isBatteryCharging ( Battery  this_gen)

현재 배터리의 충전 상태 여부를 반환 한다.

Parameters
[in]this_gen충전 상태 여부를 반환 할 Battery 객체
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
현재 배터리의 충전 상태 여부를 반환 한다.
충전 중 이라면 true, 충전 중이 아니라면 false를 반환한다.
See Also
NewBattery
getBatteryRemainsPercent

Here is the call graph for this function:

Here is the caller graph for this function:

Battery NewBattery ( void  )

새로운 Battery 객체를 생성한다.

Parameters
[in]void
[out]null
Return values
Battery
Note
새로운 Battery 객체를 생성한다.
Battery 객체를 사용하기 전에 반드시 호출해야 한다.
See Also
DestoryBattery
getBatteryRemainsPercent
isBatteryCharging
Warning
사용이 끝났을 때 DestoryBattery() 함수를 꼭 사용해야 한다.
Battery NewBattery (void)
{
BatteryExtend * this = (BatteryExtend *)malloc (sizeof (BatteryExtend));
this->battery.getLevel = getBatteryRemainsPercent;
this->battery.isCharging = isBatteryCharging;
return &this->battery;
}

Here is the call graph for this function:

Display NewDisplay ( void  )

새로운 Display 객체를 생성한다.

Parameters
[in]void
[out]null
Return values
Display
Note
새로운 Display 객체를 생성한다.
Display 객체를 사용하기 전에 반드시 호출해야 한다.
See Also
DestroyDisplay
DisplayLock
DisplayUnlock
DisplayDim
getDisplayBrightLevel
setDisplayBrightLevel
Precondition
privilege
Warning
사용이 끝났을 때 DestroyDisplay() 함수를 꼭 사용해야 한다.
Display NewDisplay (void)
{
DisplayExtend * this = (DisplayExtend *)malloc (sizeof (DisplayExtend));
this->display.Lock = DisplayLock;
this->display.Unlock = DisplayUnlock;
this->display.Dim = DisplayDim;
this->display.getBright = getDisplayBrightLevel;
this->display.setBright = setDisplayBrightLevel;
return &this->display;
}

Here is the call graph for this function:

Flash NewFlash ( void  )

새로운 Flash 객체를 생성한다.

Parameters
[in]void
[out]null
Return values
Flash
Note
새로운 Flash 객체를 생성한다.
Display 객체를 사용하기 전에 반드시 호출해야 한다.
See Also
DestoryFlash
onFlash
offFlash
Precondition
feature
priviledge
Warning
사용이 끝났을 때 DestoryFlash() 함수를 꼭 사용해야 한다.
Flash NewFlash (void)
{
Flash this = (Flash)malloc (sizeof (struct _Flash));
this->On = onFlash;
this->Off = offFlash;
return this;
}

Here is the call graph for this function:

Vibration NewVibration ( void  )

새로운 Vibration 객체를 생성한다.

Parameters
[in]void
[out]null
Return values
Vibration
Note
새로운 Vibration 객체를 생성한다.
Vibration 객체를 사용하기 전에 반드시 호출해야 한다.
See Also
DestroyVibration
VibrationCustom
VibrationShort
VibrationMiddle
VibrationLong
Precondition
privilege
Warning
사용이 끝났을 때 DestroyVibration() 함수를 꼭 사용해야 한다.
Vibration NewVibration (void)
{
VibrationExtend * this = (VibrationExtend *)malloc (sizeof (VibrationExtend));
this->vibration.Custom = VibrationCustom;
this->vibration.Short = VibrationShort;
this->vibration.Middle = VibrationMiddle;
this->vibration.Long = VibrationLong;
device_haptic_open (0, &this->handle);
return &this->vibration;
}

Here is the call graph for this function:

void offFlash ( void  )

후면 카메라의 플래시를 끈다.

Parameters
[in]void
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
후면 카메라의 플래시를 끈다.
See Also
NewFlash
onFlash
Precondition
feature
priviledge

Here is the call graph for this function:

Here is the caller graph for this function:

void onFlash ( void  )

후면 카메라의 플래시를 켠다.

Parameters
[in]void
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
후면 카메라의 플래시를 켠다.
이 때의 밝기는 최대 밝기로 켜진다.
See Also
NewFlash
offFlash
Precondition
feature
priviledge

Here is the call graph for this function:

Here is the caller graph for this function:

bool setDisplayBrightLevel ( Display  this_gen,
int  brightLevel 
)

현재 화면의 밝기 값을 설정 한다.

Parameters
[in]this_gen밝기 값을 설정 할 Display 객체
[in]brightLevel밝기 값 (0 ~ 100)
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
현재 화면의 밝기 값을 설정 한다.
brightLevel은 % 단위로 0 ~ 100의 값을 가진다.
See Also
NewDisplay
DisplayLock
DisplayUnlock
DisplayDim
getDisplayBrightLevel
Precondition
privilege

Here is the call graph for this function:

Here is the caller graph for this function:

bool VibrationCustom ( Vibration  this_gen,
int  period 
)

사용자가 정의한 시간만큼 device를 진동 시킨다.

Parameters
[in]this_gen진동 시킬 Vibration 객체
[in]period진동 시킬 시간 (Millisecond)
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
사용자가 정의한 period 만큼 device를 진동시킨다.
시간 단위는 Millisecond 이다.
See Also
NewVibration
VibrationShort
VibrationMiddle
VibrationLong
Precondition
privilege

Here is the call graph for this function:

Here is the caller graph for this function:

bool VibrationLong ( Vibration  this_gen)

긴 시간만큼 device를 진동 시킨다. (1.5초)

Parameters
[in]this_gen진동 시킬 Vibration 객체
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
긴 시간만큼 device를 진동 시킨다. (1.5초)
See Also
NewVibration
VibrationCustom
VibrationShort
VibrationMiddle
Precondition
privilege

Here is the call graph for this function:

Here is the caller graph for this function:

bool VibrationMiddle ( Vibration  this_gen)

중간 시간만큼 device를 진동 시킨다. (0.5초)

Parameters
[in]this_gen진동 시킬 Vibration 객체
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
중간 시간만큼 device를 진동 시킨다. (0.5초)
See Also
NewVibration
VibrationCustom
VibrationShort
VibrationLong
Precondition
privilege

Here is the call graph for this function:

Here is the caller graph for this function:

bool VibrationShort ( Vibration  this_gen)

짧은 시간만큼 device를 진동 시킨다. (0.1초)

Parameters
[in]this_gen진동 시킬 Vibration 객체
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
짧은 시간만큼 device를 진동 시킨다. (0.1초)
See Also
NewVibration
VibrationCustom
VibrationMiddle
VibrationLong
Precondition
privilege

Here is the call graph for this function:

Here is the caller graph for this function: