While a BLE socket is open over Scratch Link, it is possible to send multiple 'discover' requests on a single socket session (i.e. during an existing discovery state). While over a BT socket, attempting to do so returns an error: {"code":-32601,"message":"Method Not Found","data":"Cannot call discover in discovery state"}.
The Scratch Link documentation states that Scratch Link automatically handles scan renewal during discovery, and may terminate discovery if too much time has elapsed. This suggests that discovery should only be requested once per Scratch Link session, and that the observed BT behavior is correct.
Therefore, BLE should possibly also return an error when multiple 'discover' requests are sent on a single session.
While a BLE socket is open over Scratch Link, it is possible to send multiple 'discover' requests on a single socket session (i.e. during an existing discovery state). While over a BT socket, attempting to do so returns an error:
{"code":-32601,"message":"Method Not Found","data":"Cannot call discover in discovery state"}
.The Scratch Link documentation states that Scratch Link automatically handles scan renewal during discovery, and may terminate discovery if too much time has elapsed. This suggests that discovery should only be requested once per Scratch Link session, and that the observed BT behavior is correct.
Therefore, BLE should possibly also return an error when multiple 'discover' requests are sent on a single session.
See https://github.com/LLK/scratch-vm/issues/1671#issuecomment-432731064
This was tested with: