출처 : http://blog.naver.com/PostView.nhn?blogId=oh4zzang&logNo=40111957130




안드로이드 블루투스를 사용하기 위해서 소켓 생성시 아래와 같은 메소드를 사용한다.

서버 소켓 - listenUsingRfcommWithServiceRecord()

클라이언트 소켓 - createRfcommSocketToServiceRecord()

 

해당 소켓을 생성할 떄 UUID 라는 것이 필요하다.

해당 프로토콜을 의미하는 id 인데.. 안드로이드 플랫폼위의 단말에서의 시리얼 통신은 아무 UUID 를 사용하여도 된다.

하지만 특정 프로토콜에 접근하기 위해서는 아래에 나와 있는 프로토콜 UUID 를 사용해야 한다.

예를 들어 단말 타겟 - 컴퓨터 연결이라던지, 단말 - 블루투스 헤드셋 등이 있다.

만약 어떤 디바이스에서 안드로이드 블루투스 연결이 되지 않는다면, 될때까지 uuid 를 하나씩 넣어보면서 찾는 즐거움(??)을 가져보도록 하자^^

 

현재 2.1까지는 헤드셋 연결 시 ACL 링크만 가능하다(up stream)

SCO 연결을 해볼려고 블루투스 라이브러리를 통째로 jni로 빌드해서 호출 해보았으나.. 생성 - 바인드 까지는 성공 했으나..

연결시 퍼미션 에러가 났다-_-;;

만약 2.1에서 블루투스 헤드셋 SCO 연결 성공한 사례가 나온다면 그분 대박 나실듯~ㅋ

현재는 bluetooth 쪽 회사와 device 작업중인데.. 디바이스 쪽에서 무언가 해결책이 나오기를 바래본다 ㅠ0ㅠ

 

 

rotocols UUID http://www.bluetooth.org/assigned-numbers/sdp.htm 

BASE UUID = '{00000000-0000-1000-8000-00805F9B34FB}'; 

SDP_PROTOCOL_UUID         = '{00000001-0000-1000-8000-00805F9B34FB}';
UDP_PROTOCOL_UUID         = '{00000002-0000-1000-8000-00805F9B34FB}';
RFCOMM_PROTOCOL_UUID      = '{00000003-0000-1000-8000-00805F9B34FB}';
TCP_PROTOCOL_UUID         = '{00000004-0000-1000-8000-00805F9B34FB}';
TCSBIN_PROTOCOL_UUID      = '{00000005-0000-1000-8000-00805F9B34FB}';
TCSAT_PROTOCOL_UUID       = '{00000006-0000-1000-8000-00805F9B34FB}';
OBEX_PROTOCOL_UUID        = '{00000008-0000-1000-8000-00805F9B34FB}';
IP_PROTOCOL_UUID          = '{00000009-0000-1000-8000-00805F9B34FB}';
FTP_PROTOCOL_UUID         = '{0000000A-0000-1000-8000-00805F9B34FB}';
HTTP_PROTOCOL_UUID        = '{0000000C-0000-1000-8000-00805F9B34FB}';
WSP_PROTOCOL_UUID         = '{0000000E-0000-1000-8000-00805F9B34FB}';
BNEP_PROTOCOL_UUID        = '{0000000F-0000-1000-8000-00805F9B34FB}';
UPNP_PROTOCOL_UUID        = '{00000010-0000-1000-8000-00805F9B34FB}';
HID_PROTOCOL_UUID         = '{00000011-0000-1000-8000-00805F9B34FB}';
HCCC_PROTOCOL_UUID        = '{00000012-0000-1000-8000-00805F9B34FB}';
HCDC_PROTOCOL_UUID        = '{00000014-0000-1000-8000-00805F9B34FB}';
HN_PROTOCOL_UUID          = '{00000016-0000-1000-8000-00805F9B34FB}';
AVCTP_PROTOCOL_UUID       = '{00000017-0000-1000-8000-00805F9B34FB}';
AVDTP_PROTOCOL_UUID       = '{00000019-0000-1000-8000-00805F9B34FB}';
CMPT_PROTOCOL_UUID        = '{0000001B-0000-1000-8000-00805F9B34FB}';
UDI_C_PLANE_PROTOCOL_UUID = '{0000001D-0000-1000-8000-00805F9B34FB}';
L2CAP_PROTOCOL_UUID       = '{00000100-0000-1000-8000-00805F9B34FB}';




Ref. Service class IDs http://www.bluetooth.org/assigned-numbers/sdp.htm 

ServiceDiscoveryServerServiceClassID_UUID       = '{00001000-0000-1000-8000-00805F9B34FB}';
BrowseGroupDescriptorServiceClassID_UUID        = '{00001001-0000-1000-8000-00805F9B34FB}';
PublicBrowseGroupServiceClass_UUID              = '{00001002-0000-1000-8000-00805F9B34FB}';
SerialPortServiceClass_UUID                     = '{00001101-0000-1000-8000-00805F9B34FB}';
LANAccessUsingPPPServiceClass_UUID              = '{00001102-0000-1000-8000-00805F9B34FB}';
DialupNetworkingServiceClass_UUID               = '{00001103-0000-1000-8000-00805F9B34FB}';
IrMCSyncServiceClass_UUID                       = '{00001104-0000-1000-8000-00805F9B34FB}';
OBEXObjectPushServiceClass_UUID                 = '{00001105-0000-1000-8000-00805F9B34FB}';
OBEXFileTransferServiceClass_UUID               = '{00001106-0000-1000-8000-00805F9B34FB}';
IrMCSyncCommandServiceClass_UUID                = '{00001107-0000-1000-8000-00805F9B34FB}';
HeadsetServiceClass_UUID                        = '{00001108-0000-1000-8000-00805F9B34FB}';
CordlessTelephonyServiceClass_UUID              = '{00001109-0000-1000-8000-00805F9B34FB}';
AudioSourceServiceClass_UUID                    = '{0000110A-0000-1000-8000-00805F9B34FB}';
AudioSinkServiceClass_UUID                      = '{0000110B-0000-1000-8000-00805F9B34FB}';
AVRemoteControlTargetServiceClass_UUID          = '{0000110C-0000-1000-8000-00805F9B34FB}';
AdvancedAudioDistributionServiceClass_UUID      = '{0000110D-0000-1000-8000-00805F9B34FB}';
AVRemoteControlServiceClass_UUID                = '{0000110E-0000-1000-8000-00805F9B34FB}';
VideoConferencingServiceClass_UUID              = '{0000110F-0000-1000-8000-00805F9B34FB}';
IntercomServiceClass_UUID                       = '{00001110-0000-1000-8000-00805F9B34FB}';
FaxServiceClass_UUID                            = '{00001111-0000-1000-8000-00805F9B34FB}';
HeadsetAudioGatewayServiceClass_UUID            = '{00001112-0000-1000-8000-00805F9B34FB}';
WAPServiceClass_UUID                            = '{00001113-0000-1000-8000-00805F9B34FB}';
WAPClientServiceClass_UUID                      = '{00001114-0000-1000-8000-00805F9B34FB}';
PANUServiceClass_UUID                           = '{00001115-0000-1000-8000-00805F9B34FB}';
NAPServiceClass_UUID                            = '{00001116-0000-1000-8000-00805F9B34FB}';
GNServiceClass_UUID                             = '{00001117-0000-1000-8000-00805F9B34FB}';
DirectPrintingServiceClass_UUID                 = '{00001118-0000-1000-8000-00805F9B34FB}';
ReferencePrintingServiceClass_UUID              = '{00001119-0000-1000-8000-00805F9B34FB}';
ImagingServiceClass_UUID                        = '{0000111A-0000-1000-8000-00805F9B34FB}';
ImagingResponderServiceClass_UUID               = '{0000111B-0000-1000-8000-00805F9B34FB}';
ImagingAutomaticArchiveServiceClass_UUID        = '{0000111C-0000-1000-8000-00805F9B34FB}';
ImagingReferenceObjectsServiceClass_UUID        = '{0000111D-0000-1000-8000-00805F9B34FB}';
HandsfreeServiceClass_UUID                      = '{0000111E-0000-1000-8000-00805F9B34FB}';
HandsfreeAudioGatewayServiceClass_UUID          = '{0000111F-0000-1000-8000-00805F9B34FB}';
DirectPrintingReferenceObjectsServiceClass_UUID = '{00001120-0000-1000-8000-00805F9B34FB}';
ReflectedUIServiceClass_UUID                    = '{00001121-0000-1000-8000-00805F9B34FB}';
BasicPringingServiceClass_UUID                  = '{00001122-0000-1000-8000-00805F9B34FB}';
PrintingStatusServiceClass_UUID                 = '{00001123-0000-1000-8000-00805F9B34FB}';
HumanInterfaceDeviceServiceClass_UUID           = '{00001124-0000-1000-8000-00805F9B34FB}';
HardcopyCableReplacementServiceClass_UUID       = '{00001125-0000-1000-8000-00805F9B34FB}';
HCRPrintServiceClass_UUID                       = '{00001126-0000-1000-8000-00805F9B34FB}';
HCRScanServiceClass_UUID                        = '{00001127-0000-1000-8000-00805F9B34FB}';
CommonISDNAccessServiceClass_UUID               = '{00001128-0000-1000-8000-00805F9B34FB}';
VideoConferencingGWServiceClass_UUID            = '{00001129-0000-1000-8000-00805F9B34FB}';
UDIMTServiceClass_UUID                          = '{0000112A-0000-1000-8000-00805F9B34FB}';
UDITAServiceClass_UUID                          = '{0000112B-0000-1000-8000-00805F9B34FB}';
AudioVideoServiceClass_UUID                     = '{0000112C-0000-1000-8000-00805F9B34FB}';
PnPInformationServiceClass_UUID                 = '{00001200-0000-1000-8000-00805F9B34FB}';
GenericNetworkingServiceClass_UUID              = '{00001201-0000-1000-8000-00805F9B34FB}';
GenericFileTransferServiceClass_UUID            = '{00001202-0000-1000-8000-00805F9B34FB}';
GenericAudioServiceClass_UUID                   = '{00001203-0000-1000-8000-00805F9B34FB}';
GenericAudioServiceClass_UUID                   = '{00001203-0000-1000-8000-00805F9B34FB}';
GenericTelephonyServiceClass_UUID               = '{00001204-0000-1000-8000-00805F9B34FB}';
UPnPServiceClass_UUID                           = '{00001205-0000-1000-8000-00805F9B34FB}';
UPnPIpServiceClass_UUID                         = '{00001206-0000-1000-8000-00805F9B34FB}';
ESdpUPnPIpPanServiceClass_UUID                  = '{00001300-0000-1000-8000-00805F9B34FB}';
ESdpUPnPIpLapServiceClass_UUID                  = '{00001301-0000-1000-8000-00805F9B34FB}';
EdpUPnpIpL2CAPServiceClass_UUID                 = '{00001302-0000-1000-8000-00805F9B34FB}';

 


Posted by Real_G