Created
October 26, 2025 01:27
-
-
Save dlech/fe887861c287bdf2d3e62ed21d319fce to your computer and use it in GitHub Desktop.
LEGO Education Science BLE reveng
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-License-Identifier: MIT | |
| import asyncio | |
| from bleak import BleakScanner | |
| from bleak.uuids import normalize_uuid_16 | |
| LEGO_SHORT_UUID = normalize_uuid_16(0xFD02) | |
| async def main(): | |
| async with BleakScanner() as scanner: | |
| async for _device, data in scanner.advertisement_data(): | |
| service_data = data.service_data.get(LEGO_SHORT_UUID) | |
| if service_data is None: | |
| continue | |
| print(service_data.hex(":")) | |
| if __name__ == "__main__": | |
| asyncio.run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment