Documentation
¶
Overview ¶
Package lotuslantern is a Go client for "Lotus Lantern" / BLEDOM-clone LED strip controllers. The protocol is reverse-engineered from the official Android app (wl.smartled). See docs/PROTOCOL.md.
Index ¶
- Constants
- func Discover(timeout time.Duration) (addr, name string, err error)
- type Lamp
- func (l *Lamp) ChangeBrightness(brightness, lightMode int) error
- func (l *Lamp) ChangeColor(rgb int) error
- func (l *Lamp) ChangeColorRGB(r, g, b int) error
- func (l *Lamp) ChangeColorTemperature(warm, cold int) error
- func (l *Lamp) ChangeCountDown(hourMinute, weeks, timingMode int) error
- func (l *Lamp) ChangeExternalMicEqMode(mode int) error
- func (l *Lamp) ChangeExternalMicOnOff(on bool) error
- func (l *Lamp) ChangeExternalMicSensitive(level int) error
- func (l *Lamp) ChangeLaser(laser int) error
- func (l *Lamp) ChangeLaserMode(mode int) error
- func (l *Lamp) ChangeLaserSpeed(speed int) error
- func (l *Lamp) ChangeMode(mode int) error
- func (l *Lamp) ChangeModeSpeed(speed int) error
- func (l *Lamp) ChangePinSequence(seq int) error
- func (l *Lamp) ChangeRGBWStatus(rgbwOn, lightMode int) error
- func (l *Lamp) ChangeSingleColor(color int) error
- func (l *Lamp) Close() error
- func (l *Lamp) LightOn(on bool) error
- func (l *Lamp) MusicAmplitude(color, brightness int) error
- func (l *Lamp) SendBatch(frames [][]byte, interDelay time.Duration) error
- func (l *Lamp) SendSystemTime(hourMinute, weeks int) error
- func (l *Lamp) SendTimingStatus(hourMinute, timingMode, weeks int) error
Constants ¶
const ( NameFilter = "ELK-" NameWavyFilter = "ELK~" NameLEDLightStrip = "LED LIGHT STRIP" NameNewStrength = "XSL-" EncryptionMarker = "ELK-*" // BluetoothLEService.isEncryptedDevice )
Supported device-name prefixes (Global.java).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Lamp ¶
type Lamp struct {
// contains filtered or unexported fields
}
Lamp is an active connection to a single LED controller.
func Connect ¶
Connect scans briefly to refresh Windows' BLE cache, then connects to the given lamp. BLEDOM clones drop GATT after a few writes; sendCommand will auto-reconnect on failure.
func (*Lamp) ChangeBrightness ¶
ChangeBrightness sets brightness 0..255 with optional lightMode (0 default).
func (*Lamp) ChangeColor ¶
ChangeColor takes a packed 0xRRGGBB int.
func (*Lamp) ChangeColorRGB ¶
ChangeColorRGB sets a static RGB color.
func (*Lamp) ChangeColorTemperature ¶
ChangeColorTemperature sets warm/cold balance for color-temperature mode.
func (*Lamp) ChangeCountDown ¶
func (*Lamp) ChangeExternalMicEqMode ¶
func (*Lamp) ChangeExternalMicOnOff ¶
func (*Lamp) ChangeExternalMicSensitive ¶
func (*Lamp) ChangeLaser ¶
func (*Lamp) ChangeLaserMode ¶
func (*Lamp) ChangeLaserSpeed ¶
func (*Lamp) ChangeMode ¶
ChangeMode picks one of the built-in dynamic modes (the device adds 0x80).
func (*Lamp) ChangeModeSpeed ¶
ChangeModeSpeed sets dynamic mode speed (0..255).
func (*Lamp) ChangePinSequence ¶
ChangePinSequence reorders the RGB output pins. Default = 0x010203.
func (*Lamp) ChangeRGBWStatus ¶
ChangeRGBWStatus toggles individual RGBW channels — port of Android logic.
func (*Lamp) ChangeSingleColor ¶
ChangeSingleColor sets a single-color preset by index byte.
func (*Lamp) MusicAmplitude ¶
MusicAmplitude is used by the app's music-react mode.