Gluon Mobile: Bluetooth Low Energy, ¿cómo conectarse a un dispositivo con una dirección mac determinada después de escanear?

CorePress2024-01-24  10

Tengo un problema para conectarme a un arduino nano sense 33 BLE. El módulo arduino contiene un perfil que tiene un UUID.

¿Es posible conectarse al arduino desde la dirección mac para obtener perfiles UUID, luego características y finalmente leer las características encontradas?

Así es como procedo:

        BleDevice device = new BleDevice();
        device.setAddress("E4:38:4F:DA:9F:94"); // MAC ADDRESS of arduino
        BleService bleService = BleService.create().get();
        bleService.connect(device); // Connect to device
        List<BleProfile> list_of_profiles = device.getProfiles(); // Get list of profiles 

        for(BleProfile profile : list_of_profiles){
            System.out.println(profile.getUuid());// display uuid of profiles
            //Then get characteristics from profile
            //Then read characteristics
        }

EDITAR: Función de escaneo actualizada: así es como procedo para escanear dispositivos:

public void scan_4_devices(){

        long t= System.currentTimeMillis();
        long end = t+5000;
        System.out.println("searching for devices ...");
        BleService.create().ifPresent(ble -> {
            ObservableList<BleDevice> ble_list_device = ble.startScanningDevices();
            System.out.println("SIZE BEFORE while loop : "+ble_list_device.size());
            ble_list_device.addListener((ListChangeListener<BleDevice>) c -> {
                while (c.next() && System.currentTimeMillis() < end ) {
                    System.out.println("SIZE IN while loop : "+ble_list_device.size());
                    if (c.wasAdded()) {
                        for (BleDevice device : c.getAddedSubList()) {
                            System.out.println("Device found: " + device.getName());
                        }
                    }
                }
                ble.stopScanningDevices();
            });
        });
    }

Lo que estoy intentando hacer es una búsqueda de dispositivos durante 5 segundos, si se excede el tiempo, detengo la búsqueda de dispositivos. Pero la aplicación sigue fallando, este es el seguimiento de la pila después del fallo.

[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] V/GraalActivity(27191): Activity, get touch event, pcount = 1
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] E/GraalGluon(27191): Native Dalvik layer got touch event, pass to native Graal layer...
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] E/GraalGluon(27191): Native Dalvik layer got touch event, passed to native Graal layer...
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): traceEvent: Pushing TouchState[1,TouchState.Point[id=0,x=688,y=28]] to TouchPipeline[SmallMove]
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): traceEvent: Applying SmallMove to TouchState[1,TouchState.Point[id=0,x=688,y=28]]
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): traceEvent: Set TouchState[1,TouchState.Point[id=0,x=688,y=28]]
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): traceEvent: Set MouseState[x=688,y=28,wheel=0,buttonsPressed=IntSet[212]]
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): PPSRenderer: scenario.effect - createShader: Blend_SRC_IN
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] V/GraalActivity(27191): Activity, get touch event, pcount = 1
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] E/GraalGluon(27191): Native Dalvik layer got touch event, pass to native Graal layer...
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] E/GraalGluon(27191): Native Dalvik layer got touch event, passed to native Graal layer...
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] V/GraalActivity(27191): Activity, get touch event, pcount = 1
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] E/GraalGluon(27191): Native Dalvik layer got touch event, pass to native Graal layer...
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): don't add points, primary = -1
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] E/GraalGluon(27191): Native Dalvik layer got touch event, passed to native Graal layer...
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): traceEvent: Pushing TouchState[1,TouchState.Point[id=0,x=688,y=28]] to TouchPipeline[SmallMove]
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): traceEvent: Applying SmallMove to TouchState[1,TouchState.Point[id=0,x=688,y=28]]
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): traceEvent: Set TouchState[1,TouchState.Point[id=0,x=688,y=28]]
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): traceEvent: Pushing TouchState[0] to TouchPipeline[SmallMove]
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): traceEvent: Applying SmallMove to TouchState[0]
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): traceEvent: Set TouchState[0]
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): traceEvent: Set MouseState[x=688,y=28,wheel=0,buttonsPressed=IntSet[]]
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): searching for devices ...
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] I/GluonAttach(27191): JNI_OnLoad_ble called
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GluonAttach(27191): [BLESERVICE] Initializing native BLE from OnLoad
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalGluon(27191): ATTACH_DALVIK, tid = 27218, existed? 0, dalvikEnv at 0x7db4883200
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GluonAttach(27191): Util :: Load className com/gluonhq/helloandroid/DalvikBleService
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalGluon(27191): ATTACH_DALVIK, tid = 27218, existed? 1, dalvikEnv at 0x7db4883200
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] V/GluonAttach(27191): DalvikBle, init
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] V/GluonAttach(27191): Util <init>
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GluonAttach(27191): Calling Verify Permissions from Attach::Util
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] V/GraalActivity(27191): PermissionRequestActivity::Calling verifyPermissions
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] V/GraalActivity(27191): All requested permissions are granted
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GluonAttach(27191): Verify Permissions from native Attach::Util done
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalGluon(27191): DETACH_DALVIK, tid = 27218, existed = 1, env at 0x7db4883200
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GluonAttach(27191): Initializing native Ble done
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalGluon(27191): ATTACH_DALVIK, tid = 27218, existed? 1, dalvikEnv at 0x7db4883200
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] V/GluonAttach(27191): BLE startScanningPeripherals
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalGluon(27191): DETACH_DALVIK, tid = 27218, existed = 1, env at 0x7db4883200
[mar. mars 30 10:05:13 CEST 2021][INFO] [SUB] D/GraalCompiled(27191): SIZE BEFORE while loop : 0
[mar. mars 30 10:06:21 CEST 2021][INFO] [SUB] --------- beginning of crash
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867): ANR in com.hacare.ehacarebox (com.hacare.ehacarebox/com.gluonhq.helloandroid.MainActivity)
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867): PID: 27191
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867): Reason: Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago.  Wait queue length: 34.  Wait queue head age: 27397.5ms.)
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867): Load: 7.93 / 7.95 / 7.83
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867): CPU usage from 126795ms to 0ms ago (2021-03-30 10:04:15.526 to 2021-03-30 10:06:22.321):
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   11% 2867/system_server: 4% user + 7% kernel / faults: 21744 minor 78 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   4% 707/[email protected]: 1.3% user + 2.6% kernel / faults: 21 minor 5 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   2.4% 623/logd: 0.7% user + 1.7% kernel / faults: 539 minor 1 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   1.8% 23194/kworker/u16:11: 0% user + 1.8% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   2.1% 12638/com.android.bluetooth: 1.2% user + 0.9% kernel / faults: 2319 minor 6 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   2% 3318/com.android.systemui: 1.5% user + 0.5% kernel / faults: 7928 minor 376 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   1.7% 26869/kworker/u16:3: 0% user + 1.7% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   1.6% 23173/kworker/u16:9: 0% user + 1.6% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   1.3% 23196/kworker/u16:14: 0% user + 1.3% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.6% 24530/kworker/u16:0: 0% user + 0.6% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.9% 10811/com.sec.phone: 0.5% user + 0.3% kernel / faults: 171 minor
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.8% 20538/kworker/u16:4: 0% user + 0.8% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.8% 732/surfaceflinger: 0.5% user + 0.3% kernel / faults: 308 minor 16 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.6% 702/[email protected]: 0.2% user + 0.3% kernel / faults: 96 minor 2 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.5% 695/[email protected]: 0.1% user + 0.3% kernel / faults: 15 minor
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.4% 401/cfinteractive: 0% user + 0.4% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.3% 20184/com.google.android.googlequicksearchbox:search: 0.3% user + 0% kernel / faults: 3639 minor 16 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.3% 3/ksoftirqd/0: 0% user + 0.3% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.3% 80/smem_native_rpm: 0% user + 0.3% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.2% 13990/logcat: 0% user + 0.1% kernel / faults: 29 minor
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 1//init: 0.1% user + 0% kernel / faults: 221 minor
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 23078/mdss_fb0: 0% user + 0.1% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 29022/com.google.android.gms.persistent: 0.1% user + 0% kernel / faults: 543 minor 1 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 15/ksoftirqd/1: 0% user + 0.1% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 29/ksoftirqd/3: 0% user + 0.1% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 123/kswapd0: 0% user + 0.1% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 710/[email protected]: 0% user + 0.1% kernel / faults: 14 minor
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 273/kgsl_worker_thr: 0% user + 0.1% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 25576/kworker/0:1: 0% user + 0.1% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 7/rcu_preempt: 0% user + 0.1% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 3096/cds_mc_thread: 0% user + 0.1% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 89/kcompactd0: 0% user + 0.1% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 26744/kworker/1:0: 0% user + 0.1% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 3307/com.sec.android.inputmethod: 0% user + 0% kernel / faults: 134 minor 5 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 3927/iod: 0% user + 0% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 10/rcuop/0: 0% user + 0.1% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 95/system: 0% user + 0.1% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0.1% 624/servicemanager: 0% user + 0% kernel / faults: 4 minor
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 26753/kworker/3:2: 0% user + 0% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 22/ksoftirqd/2: 0% user + 0% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 348/irq/305-fts_tou: 0% user + 0% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 25/rcuop/2: 0% user + 0% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 31420/adbd: 0% user + 0% kernel / faults: 642 minor 2 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 701/[email protected]: 0% user + 0% kernel / faults: 57 minor
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 717/healthd: 0% user + 0% kernel / faults: 7 minor
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 4187/com.sec.android.app.launcher: 0% user + 0% kernel / faults: 2727 minor 3 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 191/msm_serial_hs_0: 0% user + 0% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 2660/cnss-daemon: 0% user + 0% kernel / faults: 33 minor
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 20087/com.google.android.gms: 0% user + 0% kernel / faults: 875 minor
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 910/wlan_logging_th: 0% user + 0% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 27044/kworker/2:4: 0% user + 0% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 23224/com.android.vending: 0% user + 0% kernel / faults: 910 minor 3 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 18/rcuop/1: 0% user + 0% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 407/irq/181-spdm_bw: 0% user + 0% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 705/[email protected]: 0% user + 0% kernel / faults: 12 minor
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 5231/com.samsung.cmh:CMH: 0% user + 0% kernel / faults: 207 minor 3 major
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 26472/com.google.android.apps.docs: 0% user + 0% kernel / faults: 57 minor
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 79/dsps_smem_glink: 0% user + 0% kernel
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] E/ActivityManager( 2867):   0% 83/msm_wa
[mar. mars 30 10:06:25 CEST 2021][INFO] [SUB] W/ActivityManager( 2867): anr : com.hacare.ehacarebox,0

Como puede ver el tamaño de la lista ObservableList<BleDevice> ble_list_device = ble.startScanningDevices(); es 0. Esto puede provocar que la aplicación falle

Este es el mayon código fuente de clase:

package com.hacare;

import com.gluonhq.attach.util.Constants;
import com.hacare.views.PrimaryView;
import com.hacare.views.SecondaryView;
import com.gluonhq.charm.glisten.application.MobileApplication;
import com.gluonhq.charm.glisten.visual.Swatch;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;



public class Main extends MobileApplication {

    public static final String PRIMARY_VIEW = HOME_VIEW;
    public static final String SECONDARY_VIEW = "test";
    
    @Override
    public void init() {
        addViewFactory(PRIMARY_VIEW, () -> new PrimaryView().getView());
        addViewFactory(SECONDARY_VIEW, () -> new SecondaryView().getView());
        DrawerManager.buildDrawer(this);

    }

    @Override
    public void postInit(Scene scene) {
        Swatch.BLUE.assignTo(scene);
        scene.getStylesheets().add(Main.class.getResource("style.css").toExternalForm());
        ((Stage) scene.getWindow()).getIcons().add(new Image(Main.class.getResourceAsStream("/icon.png")));
    }

    public static void main(String[] args) {
        System.setProperty(Constants.ATTACH_DEBUG,"true");
        launch(args);
    }
}

¿Cómo se relaciona esto con javafx?

- Cleopatra

26/03/2021 a las 16:03

Lo siento, puse la etiqueta equivocada, la eliminaré @kleopatra

- Ridha Kchouk

26/03/2021 a las 16:06

gracias por limpiar :)

- Cleopatra

26/03/2021 a las 16:27



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

Lo ideal es que una vez que te conectes esperes el estado de la conexión, antes de empezar a pedir la lista de perfiles.

Estos son algunos fragmentos de código que podrías utilizar:

Descubrimiento de dispositivos

BleService.create().ifPresent(ble -> {
    ObservableList<BleDevice> devices = ble.startScanningDevices();
    ...
    ble.stopScanningDevices();   
});

Conexión del dispositivo

BleService.create().ifPresent(ble -> {
    device.stateProperty().addListener(new InvalidationListener() {
        @Override
        public void invalidated(Observable observable) {
            if (State.STATE_CONNECTED.equals(device.getState())) {
                // device connected, get profiles:
                ObservableList<BleProfile> profiles = device.getProfiles();
                ...   
                device.stateProperty().removeListener(this);
            }
        }
    });
    ble.connect(device);
});

Características del perfil

ObservableList<BleCharacteristic> characteristics = profile.getCharacteristics();
...
// read characteristic
BleService.create().ifPresent(ble -> 
    ble.readCharacteristic(device, profile.getUuid(), characteristic.getUuid());
// subscribe characteristic
BleService.create().ifPresent(ble -> 
    ble.subscribeCharacteristic(device, profile.getUuid(), characteristic.getUuid());

// write characteristic
BleService.create().ifPresent(ble -> 
    ble.writeCharacteristic(device, profile.getUuid(), characteristic.getUuid(), bytes));
...

27

Gracias por su respuesta. He editado el fragmento de código (descubrimiento de dispositivo) que me proporcionó. El problema es que tengo la sensación de que mi programa no se detiene cuando hago el descubrimiento del dispositivo agregando devices.addListerner((ListChangeListener<BleDevice>) c -> .... Como en este ejemplo de fragmento de descubrimiento de dispositivo. Incluso si Agrego ble.stopScanningDevices(); Después del ciclo while mi aplicación sigue fallando. También fuerzo a mi programa a salir del ciclo while agregando un límite de tiempo.

- Ridha Kchouk

30 de marzo de 2021 a las 7:26

Si tiene un bloqueo, publique el seguimiento de la pila para que podamos ver qué está causando el error.

– José Pereda

30 de marzo de 2021 a las 7:28

¿Puedes ejecutar tu aplicación, mientras que desde una terminal también ejecutas adb logcat -v threadtime? Eso le dará un seguimiento de pila más detallado. ¿Publicar un enlace? adb está en la carpeta Android sdk/platform-tools.

– José Pereda

30 de marzo de 2021 a las 8:13

Aquí hay un debug.txt de seguimiento de pila más detallado

- Ridha Kchouk

30 de marzo de 2021 a las 9:47

1

Vale, es bueno saberlo. La solución está aquí y ya puedes probarla usando Adjuntar 4.0.12-SNAPSHOT, agregando este repositorio: <repository> <id>Instantáneas</id> <url>https://oss.sonatype.org/repositorios de contenido/instantáneas/</url> </repositorio>

– José Pereda

31 de marzo de 2021 a las 22:33



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

Algo ha cambiado en Android BLE Framework, por el momento la solución para solucionar este problema es cambiar primero la versión adjunta a 4.0.12-SNAPSHOT en el archivo pom.xml.

<attach.version>4.0.12-INSTANTÁNEA</attach.version>

Luego agregando el siguiente repositorio:

<repositorio> <id>Instantáneas</id> <url>https://oss.sonatype.org/content/repositories/snapshots/</url> </repositorio>

Tgracias a José Pereda

Su guía para un futuro mejor - libreflare
Su guía para un futuro mejor - libreflare