Skip to content

Commit

Permalink
Added check for BLE avaliability
Browse files Browse the repository at this point in the history
  • Loading branch information
ataffanel committed Dec 8, 2014
1 parent 1fcbda0 commit 1585779
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/se/bitcraze/crazyfliecontrol2/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ private void linkConnect() {
try {
mLink = new CrazyradioLink(this, new CrazyradioLink.ConnectionData(radioChannel, radioDatarate));
} catch (IllegalArgumentException e) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) &&
getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)){
if (android.os.Build.MODEL.equals("Nexus 4")) {
Log.d(TAG, "Using bluetooth write with response");
mLink = new BleLink(this, true);
Expand Down

0 comments on commit 1585779

Please sign in to comment.