Files
slate32/test/ble.lua
T
evan 1aa3a59ca9 feat: give /.lua/main.lua the whole screen and the app contract
The firmware knew where apps, data and modules lived, called four globals,
and painted a status bar into a strip it clipped every app out of. None of
that was its business, and the viewport made the bar something an app could
neither compose with nor replace.

It now loads one file. main.lua mounts the route inside its own node tree,
so the bar is a sibling of the app rather than chrome painted over it: one
layout, one hit test, no inset arithmetic and no invalidation flags on the
C++ side. Apps and main.lua are tables -- they share a lua_State, so globals
would collide -- and a screen changes by rebuilding from node().
2026-08-04 21:15:21 -04:00

37 lines
949 B
Lua

-- Run: lua test/ble.lua
package.path = "sdcard/.lua/lib/?.lua;test/?.lua;" .. package.path
local device = require "fake_device"
device.bleDevices = { { name = "Sensor", address = "aa:bb:cc:dd:ee:ff", rssi = -42 } }
device.install()
local app = device.start "sdcard/.lua/apps/Settings/main.lua"
device.tap "BLE"
assert(device.labelled "off")
assert(not device.find "disconnect")
device.tap "turn on"
assert(device.bleName == "Slate32 BLE")
device.tap "scan devices"
assert(device.labelled "scanning BLE")
app.tick()
assert(device.labelled "Sensor")
device.tap "Sensor"
assert(device.labelled "connecting BLE")
app.tick()
assert(device.bleConnected == "aa:bb:cc:dd:ee:ff")
assert(device.find "disconnect")
device.tap "disconnect"
device.tap "start advertising"
assert(device.bleAdvertising == "Slate32 BLE")
device.tap "stop advertising"
assert(device.bleAdvertising == nil)
device.tap "turn off"
assert(not device.bleInitialized)
print "ok"