mask

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptAes128Ecb

func DecryptAes128Ecb(data []byte) []byte

Len must be divsiable by 16 AES-ECB

func EncodeBitmapForMask

func EncodeBitmapForMask(bitmap [][]byte) ([]byte, error)

EncodeBitmapForMask converts a bitmap to the custom mask format. Height must be 16 pixel.

func EncodeColorArrayForMask

func EncodeColorArrayForMask(columns int) []byte

EncodeColorArrayForMask envodes a white color array

func EncryptAes128

func EncryptAes128(data []byte) []byte

Len must be divsiable by 16 AES-ECB

func EncryptAes128Hex

func EncryptAes128Hex(hexstring string) []byte

Takes hex string, len must be divsiable by 16

func GetTextImage

func GetTextImage(text string) [][]byte

GetTextImage generates a bitmap out of a text using the font NotoSans

func InitAndConnect

func InitAndConnect(MoreLogging bool) error

InitAndConnect searches and connects to a mask over BLE BLE must be enabled Blocking until a mask is found MoreLogging is showing debug output

func InitUpload

func InitUpload(bitmap []byte, colorArray []byte) error

InitUpload starts the bitmap upload process

func IsConnected

func IsConnected() bool

IsConnected checks if a mask is connected

func SendDataToBtChar

func SendDataToBtChar(device *bluetooth.DeviceCharacteristic, sendbuf []byte) error

SendRawData sends a byte buffer to the specifed char, breaking it up if the buffer is to big

func SendRawData

func SendRawData(sendbuf []byte) error

SendRawData sends a byte buffer to genralBtChar (UUID 0x9600)

func SetAnimation

func SetAnimation(image byte) error

Sets static predefined animation

func SetDIYImage

func SetDIYImage(image byte) error

Sets DIY iamge

func SetImage

func SetImage(image byte) error

Sets a static predefined image

func SetLight

func SetLight(brightness byte) error

Sets how bright the thing is

func SetMode

func SetMode(mode byte) error

Sets the scroll mode 01 = steady 02 = blink 03 = scroll left 04 = scroll right 05 = steady

func SetText

func SetText(text string) error

Comfort function that generates an image/bitmap from an string and starts the upload to the mask Text Color=White

func SetTextBackgroundColor

func SetTextBackgroundColor(enable byte, r byte, g byte, b byte) error

Sets a background text color in RGB

func SetTextColorMode

func SetTextColorMode(enable byte, mode byte) error

For text mode: sets special backgrounds mode: 00-03= text gradients () 04-07= background image (4 = x mask, 5 = christmas, 6 = love, 7 = scream)

func SetTextFrontColor

func SetTextFrontColor(enable byte, r byte, g byte, b byte) error

Sets a foreground text color in RGB

func SetTextSpeed

func SetTextSpeed(speed byte) error

Sets speed, range 0-255

func Shutdown

func Shutdown()

disconnects the bt device

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL