brilliant_msg 4.3.0
brilliant_msg: ^4.3.0 copied to clipboard
Application-level library for passing rich objects between a host program and Brilliant Labs Frame such as images, streamed audio, IMU data and rasterized text.
4.3.0 #
camera.lua,audio.lua: photo and audio packets carry at most 240 data bytes (less if the MTU is smaller), so each notification fits one 251-byte Bluetooth link-layer packet, including over the EATT bearers Android uses. They were sized to the MTU (up to 508 bytes), taking two link-layer packets each. From a Halo dev kit at a 15 ms interval, photos arrived faster this way: iPhone 14 48 vs 42 kB/s, Pixel 7 Pro 80 vs 75 kB/s. Sizes are read per call;audio.luaread the MTU once when loadedcamera.lua: new non-blocking capture:start_capture(settings), thensend_pending(n)each loop pass until it returns false (is_sending()reports a capture in progress), so the loop can do other work between photo packets.capture_and_send()still blocks until the photo is sentRxPhotoaccumulates the image in aBytesBuilder; it rebuilt a list of the whole image so far for every packet received
4.2.0 #
- Added the device-side
text_page.lua/text_page.min.lualibrary. It rendersTxTextPagepages at their per-line x/y offsets, soCircularTextLayoutpages follow Halo's round display;text_sprite_block.luastacks lines byline_heightand ignores those offsets. Addpackages/brilliant_msg/lua/text_page.min.luato your app'sassets:to upload it. Device-side Lua is now identical across the Python, Flutter and WebBluetooth SDKs (tools/check_lua_parity.py) TxTextPage: when not even one line fits the layout,measureNextPage()now drops the text sohasMoreTextturns false; previously it stayed true and a paging loop never endeddata.lua: a message that finished arriving whileprocess_raw_items()was running could be lost. The item counter was reset after copying a fixed range, so an item queued by a receive callback during the copy was orphaned. With messages arriving back to back this dropped the last strip of about 1 image in 50. The queue now has a separate head and tail and never drops an itemdata.lua: the fullcollectgarbage('collect')after each batch of messages now runs on Frame only. On Halo it cost tens of milliseconds per image; Lua's incremental collector keeps the heap bounded (it peaked at 85 KB streaming 128x128 images, was 62 KB)- Progressive sprite examples: on Halo, draw only the strip that just arrived. Halo keeps its framebuffer between draws, so redrawing every strip received so far is only needed on Frame
4.1.0 #
True-up against Halo firmware 0.8.8.
- Added the missing
tap.lua/tap.min.luaandsprite_coords.lua/sprite_coords.min.luadevice libraries (present in the Python and webbluetooth SDKs) tap.luaforwards Halo's native tap kind ('single'/'double'/'triple') as a payload byte (1/2/3); on Frame the bare flag byte is still sent per tapRxTapemits the native kind directly when present (Halo 0.8.8 fires one callback per gesture, so timing aggregation would have under-counted); timing aggregation remains the Frame fallbackplain_text.luasynced with the Halo-aware version: on Halo the palette offset maps to the firmware default palette's RGB value (Halo'sframe.display.texttakes an RGB color)- Sprite wire-format comments corrected to include the
compressedbyte
4.0.0 #
- First release of
brilliant_msg, renamed fromframe_msg; replaceframe_msgwithbrilliant_msginpubspec.yamland update imports frompackage:frame_msg/topackage:brilliant_msg/ - Adds support for Brilliant Labs Halo in addition to Brilliant Labs Frame
3.0.0 #
- Added Halo device support across all message types and Lua libraries
Breaking changes #
TxSpritewire format: acompressedflag byte (0x00= uncompressed) is now inserted at header offset 5, shiftingbppto offset 6 andnum_colorsto offset 7. The correspondingsprite.lua,image_sprite_block.lua, andtext_sprite_block.luaLua libraries have been updated to match. This is a wire-format breaking change — host and device Lua must both be updated together.TxTextSpriteBlock:textremoved from constructor. CallcreateTextSprites(text)to obtain aList<TxSprite>— callers decide how many lines to send and when.pack()now emits a 6-byte header (widthuint16,lineHeightuint16,maxDisplayLinesuint8) — the previous header encoded per-line x/y offsets.maxDisplayRowsrenamed tomaxDisplayLines.RxIMU:IMUData,IMURawData, andSensorBufferall usedouble(wasint). The Lua library now packs 6 ×float32(was 6 ×int16); the Dart decoder reads them viaByteData.getFloat32starting at offset 2.data.lua— queue-based message ordering:process_raw_items()now returns an ordered list of(flag, raw_block)pairs, guaranteeing messages are processed in arrival order. Theapp_data_block,app_data, andparserstables have been removed. ACK bytes (\x01\x00\x00success /\x01\x00\x01error) are now sent back to the host after each message is enqueued, enabling receiver-paced flow control inFrameBle.sendData(awaitData: true). Existingframe_app.luafiles that dispatched viadata.app_dataor registereddata.parsersmust be updated.imu.lua: 6 ×float32instead of 6 ×int16; hardware-version-specific axis scaling and mapping for Frame vs Halo.
New additions #
- New
TxTextPagewithTextLayouthierarchy:RectangularTextLayout— standard rectangular text area for FrameCircularTextLayout— text constrained within a circle inscribed in the canvas, ideal for Halo's round 256×256 display; chord-width calculation positions each line within the circle boundary- Supports multi-page text, configurable font/size/alignment
- New
RxClickclass andClickTypeenum (single,double,long) for Halo button click events (msg code0x0B) - Fixed:
rx/click.dartandtx/text_sprite_block.dartwere accidentally missing fromframe_msg.dartbarrel — both are now exported sprite.lua/image_sprite_block.lua: palette assignment uses integer indices (0–15) on Halo and color-name strings on Frame, selected viaframe.HARDWARE_VERSIONtext_sprite_block.lua:lineHeightuint16 in header replaces per-sprite x/y offsets; simplified scrolling viatable.removeaudio.lua:MTUreduced by 1 byte to reserve space for the leading flag byteRxAudio: relaxed audio chunk length validation from a hardassertto a warning log entry
2.0.0 #
- Removed redundant
msgCodefrom TxMsg types.msgCodeis a transport detail provided to FrameBle at the time of message sending, and does not need to be coupled to the rich message object.
1.0.2 #
- README updates for package homepage
1.0.1 #
- Tweaked auto exposure and white balance settings / manual exposure settings / camera stdlua values further
1.0.0 #
- Updated auto exposure and white balance settings / manual exposure settings / camera stdlua to support
rgb_gain_limitparameter in updated firmware.
0.0.3 #
- Rethrow errors caught in the data handler. Errors are printed to stdout but still rethrown, which is particularly important to make sure we don't swallow the break signal - the running Lua code needs to terminate. Other errors can still be handled by the main application loop if desired.
0.0.2 #
- Wrapped data handler processing in protected calls to report errors e.g. out-of-memory back on stdout
0.0.1 #
- Initial release, split from
simple_frame_app 4.0.2.