ConnectSDK / Connect-SDK-Android-Core

Core source code for the Android Connect SDK project
Apache License 2.0
114 stars 79 forks source link

Moved ConnectableDevicePairingLevel static property to the DeviceService class https://github.com/ConnectSDK/Connect-SDK-Android/issues/121 #14

Closed khk624 closed 9 years ago

khk624 commented 9 years ago

Moved ConnectableDevicePairingLevel static property to the DeviceService class.

Now we can choose pairingType for webOSTV (PROMPT / PIN_CODE)

oleksii-frolov commented 9 years ago

It works fine. But I think it would be better to implement setPairingType() method in the ConnectableDevice as well. Because in current implementation usage of that method can be like that:

mTV.setPairingLevel(PairingLevel.ON);
WebOSTVService service = (WebOSTVService)mTV.getServiceByName(WebOSTVService.ID);
service.setPairingType(PairingType.PIN_CODE);

and the better case for a developer something like this:

mTV.setPairingLevel(PairingLevel.ON);
mTV.setPairingType(PairingType.PIN_CODE);

So in the ConnectableDevice method setPairingType should set pairing type for each service if it's supported by the service.

khk624 commented 9 years ago

I thought it may confuse users, because not every device supports every pairingType. I did it because pairingType is very service specific. If we have that in ConnectableDevice, what if users set FIRST_SCREEN for pairing type. We still need to show PIN Pairing for NetcastTV, etc.

oleksii-frolov commented 9 years ago

As we discussed with a team we can combine setPairingLevel and setPairingType methods into one method