언어 설정

Menu
Sites
Language
기어와 페어링되어 있는 폰이 블루투스 통신이 가능한가요?

 

기어에 타이젠 wearable 앱을 개발해서 핸드폰과 블루투스 통신을 하고 싶습니다.

기어를 Peripheral로 폰을 central로 사용하고 .Net과 Xamrain.Forms를 사용를 사용해 개발할 예정입니다.

 

페어링되어 있는 폰이기 때문에 bluetooth connection이 되어 있는 상태에서

1. 새로 기어에서 advertising을 하면 폰에서 scan을 하고 connection을 할 수 있는지,

2. 불가능하다면 기존의 connection을 가지고 통신이 가능한지,

3. 혹은 위에 방법이 모두 안된다면 Bluetooth로 통신할 수 있는 다른 방법이 있는지 알고 싶습니다.

 

1번에 대해서는 이미 connection된 상태이기 때문에 새로운 connection이 안될 것이라고 생각되고

 

2번으로 시도해본 것으로 android 폰에서 gear와 연결중임에도 불구하고 gear의 connection 유무가 나오지 않아서

bondedList에 무조건 connect해본 결과 Gatt 통신이 되는듯 보이기는 했습니다.

기어에서는 connection된 모든 기기에 service를 주입하고 connection를 끊었다 다시 연결해서

android폰에서 connection후에 service를 찾아 통신하는 방법을 생각하고 있습니다.

하지만 side effect가 발생할 것이라 예상되고 기어부분에서 connectionList를 찾아 disconnect가 가능한지 알고 싶습니다.

Edited by: steve yang on 23 3월, 2019

Responses

2 댓글
Juwon(Julia) Ahn

안녕하세요. 

기본적으로 폰과 기어 기기간의 통신은 SAP(Samsung Accessory Protocol)을  사용하시면 될 것 같습니다.

https://developer.samsung.com/galaxy-watch/develop/creating-your-first-app/net-companion/setup-sdk

https://img-developer.samsung.com/onlinedocs/gear/Tizen_SAP/namespaceSamsung_1_1Sap.html

https://developer.samsung.com/galaxy-watch/develop/tech-doc/tizen-wearable-extension-programming-guide/net/programming-NET

https://img-developer.samsung.com/onlinedocs/sms/accessory/index.html

관련된 샘플은 아래를 참고하시면 될 것 같습니다.

https://developer.samsung.com/galaxy-watch/develop/samples/companion

감사합니다.

 

steve yang

Tizen App Developer 메일링 리스트에 질문하고 답변받은 내용입니다.

혹시 도움이 될 분들이 있을까 올립니다.

 

------------------------------------------------------------------------------------------------------------------------------------

Hello,

 

I will answer your question regarding GATT communication on Tizen wearable with android phone.

 

1. I want to know if additional advertising is possible in gear and if scan and connect are possible in Android phone.

-> It is possible. We can advertising on gear even if your gear device was paid with galaxy (In Watch manager).

The bluetooth's connection establish using each socket based on UUID. So if the UUID is different, several conneciton can be estabilshed.

 

2. If it is not possible, can i have communication with existing connections?

If all of the above is not possible, I would like to know if there is another way to communicate via Bluetooth.

-> You can't use the existing connection in your application. Galaxy Watch(Gear) and android's galaxy use the pre-assigned UUID to communicate.

And it used BT RFCOMM channel - not GATT. So if you want to use GATT communication between tizen wearable and galaxy phone, you create

custom GATT service in your wearable app and connect it via mobile galaxy app.

 

although the connection with the gear in the android phone did not show the connection of the gear

But when I tried connecting unconditionally to bondedList, it seemed to be Gatt communication.

In Gears, I am thinking of injecting service into all connected devices, disconnecting and reconnecting android phones to find service after connection.

However, I am expecting a side effect, and I want to know if it is possible to find connectionList in the gear section and disconnect.

-> As I said, the communication between galaxy phone and watch is using RFCOMM socket. So if you check the GATT connected status, no connected for GATT.

If you check BT RFCOMM connection in android phone, the connection info will be shown.

"when I tried connecting unconditionally to bondedList, it seemed to be Gatt communication." - Even if the connection is made, we can't send / recieve the data in android phone side.

Because the service UUID already be reserved by other application.

 

To communicate with galaxy phone on tizen wearable, you can use next method.

 

* Tizen Wearable (Galaxy Watch)

1. Create custom GATT server (Custom GATT service and charicteristic)

2. Advertise including custom GATT service

3. Wait the connection from galaxy mobile

4. If the GATT is connected, you can write / recieve the data to the remote galaxy phone)

 

* Android mobile (Galaxy phone)

1. LE Scan and search the custom GATT UUID in advertisement packet

2. If the custom UUID is found, connect GATT.

3. Select Custom GATT service you want to communicate

4. And write / recieve the data

 

--- If you search play store in google, you can use the application for scan / connect / transfer data to remote GATT server.

(I am using "nRFconnect" app for LE scan and GATT connect. But I am not sure the data transfer funtion provide in this app.)

 

Thanks,

Pyun