Skip to content

BLE connect on address #1500

@mauroForlimpopoli

Description

@mauroForlimpopoli

Good afternnon,
I'm using Moddable Six with IDF 5.3.0
To connect to a device I use the "quick" connect command inside the
"client = new UARTClient;"

let buffer = new ArrayBuffer(6); 
let view = new Uint8Array(buffer); 
view[0] = parseInt(bleName.slice(15,17), 16);
view[1] = parseInt(bleName.slice(12,14), 16);
view[2] = parseInt(bleName.slice(9,11), 16);
view[3] = parseInt(bleName.slice(6,8), 16);
view[4] = parseInt(bleName.slice(3,5), 16);
view[5] = parseInt(bleName.slice(0,2), 16);
this.connect({
	address: buffer,
	addressType: 0
});

If the BLE device is presene everithing works but if the device is not present I need to close and re-open the session arter 5 seconds with

if(client != null){
	client.close()
	client = null
}
.....
this.connect({
	address: buffer,
	addressType: 0
});
.....
client = new UARTClient;

and if the device is not present again when I repeat the session

	if(client != null){   <----- this is false
		client.close()
		client = null
	}
 client = new UARTClient;    <--- 

I get the error
....Projects\moddable\modules\network\ble\nimble\modBLEClient.c (236) # Break: BLE already initialized (in initialize)!

In a few words it seems that the command

this.connect({
	address: buffer,
	addressType: 0
});

can be close only once. the second cause the error above. If a connection is done I can close and re-open again
Is it possible?
regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy