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

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

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

Data Structures

struct  NDEF
 NFC통신에 필요한 NDEF (NFC Data Exchange Format)에 대한 구조체이다. More...
 
struct  NFC
 NFC모듈에 대한 구조체이다. More...
 
struct  NFCExtends
 

Functions

const char * NFCErrorChecker (int errorcode)
 NFCErrorChecker API에서 발생하는 Error Code들을 확인 해준다. More...
 
NDEF CreateNDEF (String tag, String msg)
 새로운 Bluetooth 객체를 생성한다. More...
 
void DeleteNDEF (NDEF *ndef)
 생성한 NDEF 객체를 소멸 시킨다. More...
 
NFC NewNFC (void)
 새로운 NFC 객체를 생성한다. More...
 
void DestroyNFC (NFC this_gen)
 생성한 NFC 객체를 소멸 시킨다. More...
 
bool isNFCAccessible (NFC this_gen)
 현재 NFC 기능 지원 여부를 반환 한다. More...
 
bool onNFCConnect (NFC this_gen)
 NFC 장치 활성화를 시도하며 이의 성공 여부를 반환한다. More...
 
bool onNFCDisconnect (NFC this_gen)
 NFC 장치 비활성화를 시도하며 이의 성공 여부를 반환한다. More...
 
bool NFCSend (NFC this_gen, NDEF message)
 NFC 장치에 생성한 NDEF를 기록한다. More...
 
NDEF NFCRecv (NFC this_gen)
 NFC 장치에서 NDEF를 읽어온다. More...
 

Detailed Description

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

Note
NFC의 CreateNDEF / DeleteNDEF / isAccessible / onConnect / isConnected / onDisconnect / Send / Recv API를 제공한다.
See Also
Tizen Native API

Data Structure Documentation

struct NDEF

NFC통신에 필요한 NDEF (NFC Data Exchange Format)에 대한 구조체이다.

Note
NFC통신에 필요한 NDEF (NFC Data Exchange Format)에 대한 구조체이다.
구조체를 사용하기 전에 CreateNDEF() 함수를 사용해야 하며 사용이 끝났을 때 DeleteNDEF() 함수를 꼭 사용해야 한다.
See Also
Tizen Native API Document - NDEF part
Precondition
feature
Collaboration diagram for NDEF:
Collaboration graph
Data Fields
String msg
String tag
struct NFCExtends
Collaboration diagram for NFCExtends:
Collaboration graph
Data Fields
bool access
NDEF ndefMessage
struct _NFC nfc

Function Documentation

NDEF CreateNDEF ( String  tag,
String  msg 
)

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

Parameters
[in]tagNDEF에 저장 할 태그
[in]msgNDEF에 저장 할 메세지
[out]null
Return values
NDEF
Note
새로운 NDEF 객체를 생성한다.
NDEF 객체를 사용하기 전에 반드시 호출해야 한다.
See Also
DeleteNDEF
Precondition
feature
Warning
사용이 끝났을 때 DeleteNDEF() 함수를 꼭 사용해야 한다.
void DeleteNDEF ( NDEF ndef)

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

Parameters
[in]ndef소멸시킬 NDEF 객체
[out]null
Return values
void
Note
생성한 NDEF 객체를 소멸 시킨다.
NDEF 객체를 사용한 후 반드시 호출해야 한다.
See Also
CreateNDEF
Precondition
feature
void DestroyNFC ( NFC  this_gen)

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

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

현재 NFC 기능 지원 여부를 반환 한다.

Parameters
[in]this_gen사용 가능 여부를 반환 할 NFC 객체
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
현재 NFC 기능 지원 여부를 반환 한다.
지원 가능 이라면 true, 지원 가능이 아니라면 false를 반환한다.
See Also
NewNFC
DestroyNFC
onNFCConnect
onNFCDisconnect
NFCSend
NFCRecv
Precondition
feature

Here is the caller graph for this function:

NFC NewNFC ( void  )

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

Parameters
[in]void
[out]null
Return values
NFC
Note
새로운 NFC 객체를 생성한다.
NFC 객체를 사용하기 전에 반드시 호출해야 한다.
See Also
DestroyNFC
isNFCAccessible
onNFCConnect
onNFCDisconnect
NFCSend
NFCRecv
Precondition
feature
Warning
사용이 끝났을 때 DestroyNFC()함수를 꼭 사용해야한다.
NFC NewNFC (void)
{
NFCExtends * this = (NFCExtends *)malloc (sizeof (NFCExtends));
this->nfc.isAccessible = isNFCAccessible;
this->nfc.onConnect = onNFCConnect;
this->nfc.onDisconnect = onNFCDisconnect;
this->nfc.Send = NFCSend;
this->nfc.Recv = NFCRecv;
return &this->nfc;
}

Here is the call graph for this function:

const char * NFCErrorChecker ( int  errCode)

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

Parameters
[in]errCode확인 하고자 하는 Error Code
[out]null
Return values
NFC_ERROR_NONE: Successful
NFC_ERROR_OUT_OF_MEMORY: Out of memory
NFC_ERROR_OPERATION_FAILED: Operation failed
NFC_ERROR_INVALID_PARAMETER: Invalid parameter
NFC_ERROR_INVALID_NDEF_MESSAGE: Invalid NDEF message
NFC_ERROR_INVALID_RECORD_TYPE: Invalid record type
NFC_ERROR_TIMED_OUT: Timeout error, no answer
NFC_ERROR_DEVICE_BUSY: Previous operation is not finished still busy
NFC_ERROR_NO_DEVICE: No device
NFC_ERROR_NOT_ACTIVATED: NFC is not activated
NFC_ERROR_NOT_SUPPORTED: Not supported
NFC_ERROR_ALREADY_ACTIVATED: Already activated
NFC_ERROR_ALREADY_DEACTIVATED: Already deactivated
NFC_ERROR_READ_ONLY_NDEF: Read only tag
NFC_ERROR_NO_SPACE_ON_NDEF: No enough space on tag
NFC_ERROR_NO_NDEF_MESSAGE: No NDEF Message on Tag
NFC_ERROR_NOT_NDEF_FORMAT: Not NDEF format Tag
NFC_ERROR_SECURITY_RESTRICTED: Restricted by access control
NFC_ERROR_PERMISSION_DENIED: Restricted by Smack
NFC_ERROR_ILLEGAL_STATE: The state is wrong
NFC_ERROR_NOT_INITIALIZED: NFC is not initialized
NFC_ERROR_TAG_NOT_SUPPORTED: Tag is not supported
NFC_ERROR_UNKNOWN: Unknown error occurred
Note
NFC API에서 발생하는 Error Code들을 확인 해준다.
Error의 내용은 Log를 통해 출력 된다.
23가지의 Error Code들을 확인 가능 하다.
See Also
Tizen Native API Document - NFC part

Here is the caller graph for this function:

NDEF NFCRecv ( NFC  this_gen)

NFC 장치에서 NDEF를 읽어온다.

Parameters
[in]this_genNDEF를 읽어 올 NFC 객체
[out]null
Return values
NDEF
Note
NFC 장치에서 NDEF를 읽어온다.
See Also
NewNFC
DestroyNFC
isNFCAccessible
onNFCConnect
onNFCDisconnect
NFCSend
Precondition
feature

Here is the caller graph for this function:

void NFCSend ( NFC  this_gen,
NDEF  message 
)

NFC 장치에 생성한 NDEF를 기록한다.

Parameters
[in]this_genNDEF를 기록할 NFC 객체
[in]message기록할 NDEF
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
NFC 장치에 생성한 NDEF를 기록한다.
See Also
NewNFC
DestroyNFC
isNFCAccessible
onNFCConnect
onNFCDisconnect
NFCRecv
Precondition
feature

Here is the call graph for this function:

Here is the caller graph for this function:

bool onNFCConnect ( NFC  this_gen)

NFC 장치 활성화를 시도하며 이의 성공 여부를 반환한다.

Parameters
[in]this_gen활성화 성공 여부를 확인할 NFC 객체
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
NFC 장치 활성화를 시도하며 이의 성공 여부를 반환한다.
연결에 성공하면 true, 실패하면 false를 반환한다.
See Also
NewNFC
DestroyNFC
isNFCAccessible
onNFCDisconnect
NFCSend
NFCRecv
Precondition
feature

Here is the caller graph for this function:

bool onNFCDisconnect ( NFC  this_gen)

NFC 장치 비활성화를 시도하며 이의 성공 여부를 반환한다.

Parameters
[in]this_gen비활성화 성공 여부를 확인할 NFC 객체
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
NFC 장치 비활성화를 시도하며 이의 성공 여부를 반환한다.
연결에 성공하면 true, 실패하면 false를 반환한다.
See Also
NewNFC
DestroyNFC
isNFCAccessible
onNFCConnect
NFCSend
NFCRecv
Precondition
feature

Here is the call graph for this function:

Here is the caller graph for this function: