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

Bluetooth API가 정의되어있다. More...

#include "Commnucation/Bluetooth.h"
#include <stdlib.h>
#include <stdbool.h>
#include <system_info.h>
#include <app_control.h>
#include <dlog.h>
#include <glib.h>
Include dependency graph for Bluetooth.c:

Functions

Bluetooth NewBluetooth (void)
 새로운 Bluetooth 객체를 생성한다. More...
 
void DestroyBluetooth (Bluetooth this_gen)
 생성한 Bluetooth 객체를 소멸 시킨다. More...
 
bool isBluetoothAccessible (Bluetooth this_gen)
 현재 Bluetooth 기능 지원 여부를 반환 한다. More...
 
bool onBluetoothConnect (Bluetooth this_gen)
 Bluetooth기기로 연결을 시도하며 이의 성공 여부를 반환한다. More...
 
bool isBluetoothConnected (Bluetooth this_gen)
 Bluetooth기기와의 연결 상태를 확인한다. More...
 
bool onBluetoothDisconnect (Bluetooth this_gen)
 Bluetooth기기로 연결을 해제하며 이의 성공 여부를 반환한다. More...
 
bool BluetoothFileRecv (Bluetooth this_gen, String *recvBuffer)
 Bluetooth기기로 부터 데이터를 수신한다. More...
 
bool BluetoothFileSend (Bluetooth this_gen, String sendbuffer)
 Bluetooth기기로 데이터를 송신한다. More...
 
const char * BluetoothErrorCheck (int errCode)
 Bluetooth API에서 발생하는 Error Code들을 확인 해준다. More...
 

Detailed Description

Bluetooth API가 정의되어있다.

Note
Bluetooth API가 정의되어있다.
See Also
Bluetooth.h

Function Documentation

const char* BluetoothErrorCheck ( int  errCode)

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

Parameters
[in]errCode확인 하고자 하는 Error Code
[out]null
Return values
BT_ERROR_NONE: Successful
BT_ERROR_CANCELLED: Operation cancelled
BT_ERROR_INVALID_PARAMETER: Invalid parameter
BT_ERROR_OUT_OF_MEMORY: Out of memory
BT_ERROR_RESOURCE_BUSY: Device or resource busy
BT_ERROR_TIMED_OUT: Timeout error
BT_ERROR_NOW_IN_PROGRESS: Operation now in progress
BT_ERROR_NOT_SUPPORTED: Not Supported
BT_ERROR_PERMISSION_DENIED: Permission denied
BT_ERROR_QUOTA_EXCEEDED: Quota exceeded
BT_ERROR_NOT_INITIALIZED: Local adapter not initialized
BT_ERROR_NOT_ENABLED: Local adapter not enabled
BT_ERROR_ALREADY_DONE: Operation already done
BT_ERROR_OPERATION_FAILED: Operation failed
BT_ERROR_NOT_IN_PROGRESS: Operation not in progress
BT_ERROR_REMOTE_DEVICE_NOT_BONDED: Remote device not bonded
BT_ERROR_AUTH_REJECTED: Authentication rejected
BT_ERROR_AUTH_FAILED: Authentication failed
BT_ERROR_REMOTE_DEVICE_NOT_FOUND: Remote device not found
BT_ERROR_SERVICE_SEARCH_FAILED: Service search failed
BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED: Remote device is not connected
BT_ERROR_AGAIN: Resource temporarily unavailable
BT_ERROR_SERVICE_NOT_FOUND: Service Not Found
BT_ERROR_UNKNWON: Unknown error occurred
Note
Bluetooth API에서 발생하는 Error Code들을 확인 해준다.
Error의 내용은 Log를 통해 출력 된다.
24가지의 Error Code들을 확인 가능 하다.
See Also
Tizen Native API Document - Bluetooth part

Here is the caller graph for this function:

bool BluetoothFileRecv ( Bluetooth  this_gen,
String *  recvBuffer 
)

Bluetooth기기로 부터 데이터를 수신한다.

Parameters
[in]this_gen데이터를 수신할 Bluetooth 객체
[in]recvBuffer수신할 데이터 주소
[out]recvBuffer수신한 데이터
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
Bluetooth기기로 부터 데이터를 수신한다.
See Also
NewBluetooth
DestroyBluetooth
isBluetoothAccessible
onBluetoothConnect
isBluetoothConnected
onBluetoothDisconnect
BluetoothFileSend
Precondition
feature

Here is the call graph for this function:

Here is the caller graph for this function:

bool BluetoothFileSend ( Bluetooth  this_gen,
String  sendbuffer 
)

Bluetooth기기로 데이터를 송신한다.

Parameters
[in]this_gen데이터를 송신할 Bluetooth 객체
[in]sendbuffer송신할 파일 path
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
Bluetooth기기로 데이터를 송신한다.
See Also
NewBluetooth
DestroyBluetooth
isBluetoothAccessible
onBluetoothConnect
isBluetoothConnected
onBluetoothDisconnect
BluetoothFileRecv
Precondition
feature

Here is the call graph for this function:

Here is the caller graph for this function:

void DestroyBluetooth ( Bluetooth  this_gen)

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

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool isBluetoothConnected ( Bluetooth  this_gen)

Bluetooth기기와의 연결 상태를 확인한다.

Parameters
[in]this_gen연결 상태를 확인할 Bluetooth 객체
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
Bluetooth기기와의 연결 상태를 확인한다.
연결되어 있다면 true, 연결되어 있지 않다면 false를 반환한다.
See Also
NewBluetooth
DestroyBluetooth
isBluetoothAccessible
onBluetoothConnect
onBluetoothDisconnect
BluetoothFileSend
BluetoothFileRecv
Precondition
feature

Here is the caller graph for this function:

Bluetooth NewBluetooth ( void  )

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

Parameters
[in]void
[out]null
Return values
Bluetooth
Note
새로운 Bluetooth 객체를 생성한다.
Bluetooth 객체를 사용하기 전에 반드시 호출해야 한다.
See Also
DestroyBluetooth
isBluetoothAccessible
onBluetoothConnect
isBluetoothConnected
onBluetoothDisconnect
BluetoothFileSend
BluetoothFileRecv
Precondition
feature
Warning
사용이 끝났을 때 DestroyBluetooth() 함수를 꼭 사용해야 한다.
Bluetooth NewBluetooth (void)
{
BluetoothExtends * this = malloc (sizeof (BluetoothExtends));
this->bluetooth.isAccessible = isBluetoothAccessible;
this->bluetooth.onConnect = onBluetoothConnect;
this->bluetooth.isConnected = isBluetoothConnected;
this->bluetooth.onDisconnect = onBluetoothDisconnect;
this->bluetooth.FileRecv = BluetoothFileRecv;
this->bluetooth.FileSend = BluetoothFileSend;
this->connected = false;
this->accessible = false;
this->remoteMACAddr = NULL;
return &this->bluetooth;
}

Here is the call graph for this function:

bool onBluetoothConnect ( Bluetooth  this_gen)

Bluetooth기기로 연결을 시도하며 이의 성공 여부를 반환한다.

Parameters
[in]this_gen연결 성공 여부를 확인할 Bluetooth 객체
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
Bluetooth기기로 연결을 시도하며 이의 성공 여부를 반환한다.
연결에 성공하면 true, 실패하면 false를 반환한다.
See Also
NewBluetooth
DestroyBluetooth
isBluetoothAccessible
isBluetoothConnected
onBluetoothDisconnect
BluetoothFileSend
BluetoothFileRecv
Precondition
feature

Here is the call graph for this function:

Here is the caller graph for this function:

bool onBluetoothDisconnect ( Bluetooth  this_gen)

Bluetooth기기로 연결을 해제하며 이의 성공 여부를 반환한다.

Parameters
[in]this_gen연결 해제 여부를 확인할 Bluetooth 객체
[out]null
Return values
bool
함수의 성공 여부를 반환한다.
실패시 false를 반환하며 상세한 원인을 Log로 출력한다.
Note
Bluetooth기기로 연결을 해제하며 이의 성공 여부를 반환한다.
연결 해제에 성공하면 true, 실패하면 false를 반환한다.
See Also
NewBluetooth
DestroyBluetooth
isBluetoothAccessible
onBluetoothConnect
isBluetoothConnected
BluetoothFileSend
BluetoothFileRecv
Precondition
feature

Here is the call graph for this function:

Here is the caller graph for this function: