Commit Graph

6 Commits

Author SHA1 Message Date
Shin'ichiro Kawasaki
8c42fc04b7 scratch_link.py, gencert.sh: Separate certification and private key
Now gencert.sh generates private key and certificate for the Secure WSS
server in a single file. This is not good to automate certification
addition to NSS databases. Generate them separately into two files and
initialize the Secure WSS server specifying them.

Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
2020-04-18 17:48:28 +09:00
Chris Glencross
6b7619ebeb Add Lego Mindstorms functionality 2020-02-24 19:48:12 +00:00
Shin'ichiro Kawasaki
2240de0085 BLESession.matches: Check service adtypes both 16 bits and 128 bits
LEGO Boost communicates with a Scratch extension through Scratch-link.
It was reported that bluepy-scratch-link fails to connect to LEGO Boost.
LEGO Boost advertises adtype 0x7 "Complete List of 128-bit Service Class
UUIDs". However, bluepy-scratch-link checks only adtype 0x3 "Complete
List of 16-bit Service Class UUIDs" which is valid for micro:bit.

To allow bluepy-scratch-link, check both adtypes 0x7 and 0x3. Introduce
constants to note those two adtype values.

Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
2020-01-25 18:58:35 +09:00
MDE
865c613890 filter: Removed UUID conversion
Scratch 3.0 sends full UUID for LEGO Boost Extension.
If other extensions don't do this, a classifier
will be needed.
2020-01-25 18:58:35 +09:00
MDE
cea2723a0b BLESession.__del__: Fixed NameError exception on exit because of error
Message was:
NameError: name 'close' is not defined
2020-01-25 18:58:35 +09:00
Shin'ichiro Kawasaki
402f79936f scratch_link.py: Initial commit
Implemented Scratch-link[1] feature as a small python script. Confirmed
it is working with Scratch 3.0[2] using a micro:bit as the BLE device to
link. This allows Linux PCs to connect Scratch and micro:bit.

Utilized bluez[3] and bluepy[4] to handle Bluetooth Low Energy connection.
Utilized Websocket module for Secure Web Socket server.

[1] https://github.com/LLK/scratch-link
[2] https://scratch.mit.edu/
[3] http://www.bluez.org/
[4] https://github.com/IanHarvey/bluepy

This is a minimal implementation to support micro:bit. Some of
Scratch-link features are not implemented. For example, Bluetooth (not
BLE) devices are not supported. BLE device support is confirmed only with
micro:bit.

Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
2019-09-15 20:37:37 +09:00