scratchfoundation / scratch-link

Device interoperability layer for Windows and MacOS
BSD 3-Clause "New" or "Revised" License
102 stars 83 forks source link

Allow extension to force to BLE write without response as well as with response #154

Closed terado0618 closed 4 years ago

terado0618 commented 4 years ago

Resolves

Resolves #150

Proposed Changes

Reason for Changes

In some cases, write with response causes a critical performance issue. Here is a comparison table of average elapsed time on my development PC with a bluetooth adapter.

BLE peripheral write with response write without response
micro:bit 161.9 ms 1.9 ms
LEGO BOOST 123.4 ms 3.6 ms

So, I am proposing this PR so that an extension forces to write without response to resolve the critical performance issue. As @cwillisf mentioned, any outcome should be the extension's response.

Please note that specifying with response has been already supported in #71.

This PR should be merged with https://github.com/LLK/scratch-vm/pull/2298.