Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
brilliant-monocle-driver
Advanced tools
A driver to connect to and control a Brilliant Labs Monocle peripheral
brilliant-monocle-driver
is a simple Python library that uses
Bleak to connect to and control a Brilliant Labs Monocle display device.
pip install brilliant-monocle-driver
import asyncio
from brilliant_monocle_driver import Monocle
def callback(channel, text_in):
"""
Callback to handle incoming text from the Monocle.
"""
print(text_in)
# Simple MicroPython command that prints battery level for five seconds
# and then blanks the screen
COMMAND = """
import display
import device
import time
from brilliant_monocle_driver import Monocle
def show_battery(count):
batLvl = str(device.battery_level())
display.fill(0x000066)
display.text("bat: {} {}".format(batLvl, count), 5, 5, 0xffffff)
display.show()
count = 0
while (count < 5):
show_battery(count)
time.sleep(1)
count += 1
display.fill(0x000000)
display.show()
print("Done")
"""
async def execute():
mono = Monocle(callback)
async with mono:
await mono.send(COMMAND)
asyncio.run(execute())
import asyncio
from brilliant_monocle_driver import Monocle
def a_touch():
print("A touch!")
def b_touch():
print("B touch!")
async def execute():
mono = Monocle()
async with mono:
await mono.install_touch_events()
mono.set_a_touch_callback(a_touch)
mono.set_b_touch_callback(b_touch)
await asyncio.sleep(30000)
asyncio.run(execute())
brilliant-monocle-driver
attaches to a Monocle via the UART characteristics exposed over
BLE in Monocle's default firmware, as specified in the
Monocle documentation. Once
connection is established, commands can be sent directly to the Monocle as
MicroPython. The driver avoids MTU overflow and does some convenience /
correction massaging (sending Ctrl-C
to stop any running command and wrapping
the incoming command in Ctrl-A | Ctrl-D
to avoid interference from the REPL's
echo and auto-formatting convenience behaviors).
FAQs
A driver to connect to and control a Brilliant Labs Monocle peripheral
We found that brilliant-monocle-driver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.