mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-29 13:26:50 +01:00
Fix connection on GBX-100
This commit is contained in:
parent
2d96328d1b
commit
264b003809
@ -737,7 +737,8 @@ public class DiscoveryActivity extends AbstractGBActivity implements AdapterView
|
||||
intent.putExtra(DeviceCoordinator.EXTRA_DEVICE_CANDIDATE, deviceCandidate);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
if (coordinator.getBondingStyle() == DeviceCoordinator.BONDING_STYLE_NONE) {
|
||||
if (coordinator.getBondingStyle() == DeviceCoordinator.BONDING_STYLE_NONE ||
|
||||
coordinator.getBondingStyle() == DeviceCoordinator.BONDING_STYLE_LAZY) {
|
||||
LOG.info("No bonding needed, according to coordinator, so connecting right away");
|
||||
BondingUtil.connectThenComplete(this, deviceCandidate);
|
||||
return;
|
||||
|
@ -70,6 +70,11 @@ public interface DeviceCoordinator {
|
||||
*/
|
||||
int BONDING_STYLE_REQUIRE_KEY = 3;
|
||||
|
||||
/**
|
||||
* Lazy pairing, i.e. device initiated pairing is requested
|
||||
*/
|
||||
int BONDING_STYLE_LAZY = 4;
|
||||
|
||||
/**
|
||||
* Checks whether this coordinator handles the given candidate.
|
||||
* Returns the supported device type for the given candidate or
|
||||
|
@ -61,7 +61,7 @@ public class CasioGBX100DeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
|
||||
@Override
|
||||
public int getBondingStyle(){
|
||||
return BONDING_STYLE_NONE;
|
||||
return BONDING_STYLE_LAZY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -190,7 +190,8 @@ public class BondingUtil {
|
||||
*/
|
||||
public static void initiateCorrectBonding(final BondingInterface bondingInterface, final GBDeviceCandidate deviceCandidate) {
|
||||
int bondingStyle = DeviceHelper.getInstance().getCoordinator(deviceCandidate).getBondingStyle();
|
||||
if (bondingStyle == DeviceCoordinator.BONDING_STYLE_NONE) {
|
||||
if (bondingStyle == DeviceCoordinator.BONDING_STYLE_NONE ||
|
||||
bondingStyle == DeviceCoordinator.BONDING_STYLE_LAZY ) {
|
||||
// Do nothing
|
||||
return;
|
||||
} else if (bondingStyle == DeviceCoordinator.BONDING_STYLE_ASK) {
|
||||
|
Loading…
Reference in New Issue
Block a user