qrcode

package
v0.0.0-...-7a59755 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QRCode

type QRCode struct {
	// contains filtered or unexported fields
}

QRCode handles generating and parsing the data for the Robomaster connection qrcode that is used to associate the robot with an app ID and also to tell it about the network and password to use.

func New

func New(appID uint64,
	countryCode, ssID, password, bssID string) (*QRCode, error)

New creates a new QRCode instance with the given parameters.

func NewFromMessage

func NewFromMessage(message string) (*QRCode, error)

NewFromMessage parses the given message and returns a QRCode instance based on it. This message is what you got if you use a normal QRCode reader to read the Robomaster app generated QRCode.

func (*QRCode) AppID

func (q *QRCode) AppID() uint64

AppID returns the app ID for this QRCode.

func (*QRCode) BssID

func (q *QRCode) BssID() *net.HardwareAddr

BssID returns the BSSID for this QRCode.

func (*QRCode) CountryCode

func (q *QRCode) CountryCode() string

CountryCode returns the country code for this QRCode.

func (*QRCode) Image

func (q *QRCode) Image(size int) (image.Image, error)

Image returns an size X size image.Image that represents the QRCode instance. This image is readable by a Robomaster robot.

func (*QRCode) Message

func (q *QRCode) Message() string

Message returns the message for this QRCode. This is the result of encoding the QRCode instance into a string that can be used to generate an actual qr-code image that can be used by a Robomaster robot.

func (*QRCode) Password

func (q *QRCode) Password() string

Password returns the password for this QRCode.

func (*QRCode) SsID

func (q *QRCode) SsID() string

SSID returns the SSID for this QRCode.

func (*QRCode) String

func (q *QRCode) String() string

String returns a string representation of this QRCode.

func (*QRCode) Text

func (q *QRCode) Text() (string, error)

Text returns a string representation of the QRCode instance that can be printed to the console. This should be readable by a Robomaster robot.

Jump to

Keyboard shortcuts

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