You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
asyncfunctionscanBlePlxDevices(UUID: string){setUuid(UUID);returnnewPromise(async(resolve,reject)=>{letdevice: Device|null=null;// Start scanning for devicesconstscanSubscription=awaitbleManager.startDeviceScan(null,null,async(error,bleDevice)=>{if(error){awaitbleManager.stopDeviceScan();returnreject(newError("Device scan failed"));}// Check if a device with the desired prefix is foundif(bleDevice?.name){bleManager.stopDeviceScan();device=bleDevice;try{// Connect to the device and discover services/characteristicsawaitdevice.connect();awaitdevice.discoverAllServicesAndCharacteristics();constservices=awaitdevice.services();constcharacteristics=awaitservices[0].characteristics();// Decode and display characteristicsconstvalues=awaitPromise.all(characteristics.map(async(c)=>{try{returnc.value ? base64.decode(c.value).toString('utf8') : '';}catch(err){console.warn(`Error decoding characteristic: ${err.message}`);returnnull;}}));setCaps(values.filter(Boolean));// Store non-empty valuesresolve(device);}catch(err){returnreject(newError("Failed to connect or retrieve characteristics"));}finally{awaitbleManager.destroy();}}});// Stop scanning if no device is found within the timeoutsetTimeout(async()=>{awaitbleManager.stopDeviceScan();if(!device)reject(newError("No device found within timeout period"));},10000);// Adjust timeout duration as needed});}
Relevant log output
Additional information
I am trying to decode from base64
The text was updated successfully, but these errors were encountered:
Prerequisites
Expected Behavior
It should show device characterstics
Current Behavior
It not showing device characterstics
Library version
3.2.1
Device
iphone 14
Environment info
Steps to reproduce
1 - start device scan.
2 - read characteristics.
3- decode characteristics
Formatted code sample or link to a repository
Relevant log output
Additional information
I am trying to decode from base64
The text was updated successfully, but these errors were encountered: