Move BleUtil.java into the ble package, update go.mod.
This commit is contained in:
parent
8576d3e4c5
commit
390086788f
35
BleUtil.java
35
BleUtil.java
|
@ -1,35 +0,0 @@
|
|||
package st.wow.git.ble;
|
||||
|
||||
import java.lang.Runnable;
|
||||
import android.util.Log;
|
||||
import java.lang.Class;
|
||||
import java.lang.ClassLoader;
|
||||
import java.lang.reflect.Constructor;
|
||||
import android.os.Handler;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
public class BleUtil {
|
||||
public void Enable(Context ctx) {
|
||||
Log.d("gio", "BleUtil Enable: manager");
|
||||
BluetoothManager manager = (BluetoothManager) ctx.getSystemService(ctx.BLUETOOTH_SERVICE);
|
||||
Log.d("gio", "BleUtil Enable: adapter");
|
||||
BluetoothAdapter ad = (BluetoothAdapter) manager.getAdapter();
|
||||
if (ad == null || !ad.isEnabled()) {
|
||||
Log.d("gio", "BleUtil Enable: handler");
|
||||
Handler handler = new Handler(ctx.getMainLooper());
|
||||
//BleEnabler en = new BleEnabler(ctx, ad);
|
||||
Log.d("gio", "BleUtil Enable: Intent");
|
||||
Intent enableBtIntent = new Intent(ad.ACTION_REQUEST_ENABLE);
|
||||
Log.d("gio", "BleUtil Enable: handler.post");
|
||||
handler.post(new Runnable() {
|
||||
public void run() {
|
||||
ctx.startActivity(enableBtIntent);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
4
go.mod
4
go.mod
|
@ -3,7 +3,7 @@ module git.wow.st/gmp/hrm
|
|||
go 1.13
|
||||
|
||||
require (
|
||||
gioui.org v0.0.0-20191028123051-439d3e652c8f
|
||||
git.wow.st/gmp/ble v0.0.0-20191028164333-f036c5e1346f
|
||||
gioui.org v0.0.0-20191101175813-af353822fa5e
|
||||
git.wow.st/gmp/ble v0.0.0-20191101185903-829baedeac2b
|
||||
gopkg.in/yaml.v2 v2.2.4
|
||||
)
|
||||
|
|
24
go.sum
24
go.sum
|
@ -1,18 +1,14 @@
|
|||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
gioui.org v0.0.0-20191024154924-88adc0ee1a0b h1:h+Ot0YwjtLHkFlLVbiS3R8gS0cyk6/xkKWNlWAcXtFs=
|
||||
gioui.org v0.0.0-20191024154924-88adc0ee1a0b/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||
gioui.org v0.0.0-20191028123051-439d3e652c8f h1:ezHtZUPYXzpRD47QOaAkpTTncWNhJvmUKS/+1yFLQUg=
|
||||
gioui.org v0.0.0-20191028123051-439d3e652c8f/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||
git.wow.st/gmp/ble v0.0.0-20191025130954-ec02bc7bcc2b h1:qttVD1iumDo7WWzyIJAUkis+Yh8QB07RXJcbAgCfEZI=
|
||||
git.wow.st/gmp/ble v0.0.0-20191025130954-ec02bc7bcc2b/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
|
||||
git.wow.st/gmp/ble v0.0.0-20191025185913-5955e369e4eb h1:vebHnxVY7EvVzafTGFKQWR0Q3uV4jaoOTL0qS/iDP9Y=
|
||||
git.wow.st/gmp/ble v0.0.0-20191025185913-5955e369e4eb/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
|
||||
git.wow.st/gmp/ble v0.0.0-20191028132523-2d4f106dd76c h1:GUCh9nytD5hEqw8B5/vXtY8cVCZTraJVs8mtncs10M0=
|
||||
git.wow.st/gmp/ble v0.0.0-20191028132523-2d4f106dd76c/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
|
||||
git.wow.st/gmp/ble v0.0.0-20191028152114-c911bbb547bc h1:wh2wjBt1/b+pH9PPP2TJZzv8HjpwsN0t+rN6dRwAfvY=
|
||||
git.wow.st/gmp/ble v0.0.0-20191028152114-c911bbb547bc/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
|
||||
git.wow.st/gmp/ble v0.0.0-20191028164333-f036c5e1346f h1:QcNTjwSAe+/+2jdeeKx3EjS3CPv4Ur8AVrVlFfMquck=
|
||||
git.wow.st/gmp/ble v0.0.0-20191028164333-f036c5e1346f/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
|
||||
gioui.org v0.0.0-20191031200634-4e71f195ab51 h1:Epxo/e6oPvbDMMB8rrpmUlBe6ELeDpRuLzFUGfT6kJM=
|
||||
gioui.org v0.0.0-20191031200634-4e71f195ab51/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||
gioui.org v0.0.0-20191101175813-af353822fa5e h1:8NpYJwhzVg0A34MikFWRS65/PoYcluBGWZ3fgy8iXIg=
|
||||
gioui.org v0.0.0-20191101175813-af353822fa5e/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||
git.wow.st/gmp/ble v0.0.0-20191030160916-4e4c07169707 h1:46SbpM1pnBe+VNUSohkKz16s/8BFY2+hzRLZEiRR1Y0=
|
||||
git.wow.st/gmp/ble v0.0.0-20191030160916-4e4c07169707/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
|
||||
git.wow.st/gmp/ble v0.0.0-20191101184817-0ab45a1d9d54 h1:Tdomh1qilIgDXWU+CksM6682BKomGKFyw3+JXcP0LLo=
|
||||
git.wow.st/gmp/ble v0.0.0-20191101184817-0ab45a1d9d54/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
|
||||
git.wow.st/gmp/ble v0.0.0-20191101185903-829baedeac2b h1:ccSukYa0YCYZEXaweXXf/103edYKBECsQjExQBTH0vE=
|
||||
git.wow.st/gmp/ble v0.0.0-20191101185903-829baedeac2b/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
|
|
Loading…
Reference in New Issue
Block a user