Working on a Test App to Control, via Bluetooth, Lego Power Functions Motors using the SBrick.
The BLE2 library v1.35 is used to connect and control the SBrick (Device).
Got a first B4A prototype up-and-running, resulting in several questions:
Question Manager Scan
After Manager.Scan(Null) is initiated whilst the Device is turned off, scan keeps on running.
Is there a way to limit the scan duration e.g. stop f.e. after 10 scanning cycles?
Question WriteData B4J IDE Logentry Retries
When sending data to the Device, the method WriteData logs the number of retries (have checked the BLE2.jar, public void WriteData, entry BA.Log("retries...").
Is it possible to remove the BA.Log entry and use a method to log the number of retries (if required)?
Question WriteData Max Retries
Is it possible to set the number of retries via Manager property instead of the hardcoded max 5 retries?
Question WriteData Max Retries Thread Sleep
Observed that when WriteData max retries (5) is reached, the Thread.sleep(150 * (5 - retries)); results in a disconnect from the device.
Is it possible to set a property to keep connected or disconnect if WriteData fails.
Question WriteData concurrent to the Device
If a motor is running, writedata is called over-and-over again (in Manager_WriteComplete) with the motor parameter (speed, direction). At the same time, seeking for a way to writedata requesting the Device Voltage & Parameter.
Should this be handled via a seperate service to avoid classing several writedata requests?
Note: Initially using resumable subs to request V&T sequentially - this is working great.
The BLE2 library v1.35 is used to connect and control the SBrick (Device).
Got a first B4A prototype up-and-running, resulting in several questions:
Question Manager Scan
After Manager.Scan(Null) is initiated whilst the Device is turned off, scan keeps on running.
Is there a way to limit the scan duration e.g. stop f.e. after 10 scanning cycles?
Question WriteData B4J IDE Logentry Retries
When sending data to the Device, the method WriteData logs the number of retries (have checked the BLE2.jar, public void WriteData, entry BA.Log("retries...").
Is it possible to remove the BA.Log entry and use a method to log the number of retries (if required)?
Question WriteData Max Retries
Is it possible to set the number of retries via Manager property instead of the hardcoded max 5 retries?
Question WriteData Max Retries Thread Sleep
Observed that when WriteData max retries (5) is reached, the Thread.sleep(150 * (5 - retries)); results in a disconnect from the device.
Is it possible to set a property to keep connected or disconnect if WriteData fails.
Question WriteData concurrent to the Device
If a motor is running, writedata is called over-and-over again (in Manager_WriteComplete) with the motor parameter (speed, direction). At the same time, seeking for a way to writedata requesting the Device Voltage & Parameter.
Should this be handled via a seperate service to avoid classing several writedata requests?
Note: Initially using resumable subs to request V&T sequentially - this is working great.