Search code examples
vue.jsbluetooth-lowenergycapacitorquasar-frameworkcapacitor-plugin

Set custom timeout to Bluetooth-le write with Quasar-Framework/Capacitor


I'm using the Bluetooth-LE community plugin in a Quasar/Capacitor project.

Since version 1.7.0, we can make timeouts configurable. But how? I need help with the syntax. Can someone give me a fonctionnal example with a custom timeout.

Thank you.


Solution

  • I was also looking for that information. Haven't found any details on the documention but the file 'definitions.d.ts' inside the Bluetooth-LE module.

    Try this :

        const writeFlag = await BleClient.write(
            device.deviceId, 
            SERV_SYSTEM_SETTINGS, 
            CHAR_RTC, 
            dvDateTime,
            {timeout:(10000)}    //  <---- this is what you need
        );