schema

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package schema provides the data structures for internal use of nb1 app.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceDetail

type DeviceDetail struct {
	// DeviceInfo is the general HID device information of the device.
	*hid.DeviceInfo
	// IsBlink1 is true if the device is a blink(1) device.
	IsBlink1 bool
	// FirmwareVersion is the blink(1) firmware version of the device.
	FirmwareVersion int
}

DeviceDetail is a struct that contains the device info and extra information.

type PatternSet

type PatternSet struct {
	Name        string           `json:"name,omitempty"` // Name of the pattern
	RepeatTimes uint             `json:"repeat"`         // How many times to repeat, 0 means infinite
	Sequence    b1.StateSequence `json:"seq,omitempty"`  // Slice of states to execute in pattern, non-empty patterns will be set to the device automatically
	Length      uint             `json:"len"`            // Length of the sequence, it's not necessary to set this field, it will be set automatically
}

PatternSet is a set of patterns to execute.

func (*PatternSet) AutoFill

func (ps *PatternSet) AutoFill()

AutoFill fills the length of the sequence automatically.

func (*PatternSet) Validate

func (ps *PatternSet) Validate() error

Validate validates the pattern set.

Jump to

Keyboard shortcuts

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