dsp

package
v0.0.0-...-4e9ec18 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnwrapData

func UnwrapData(fileName string) ([]byte, error)

UnwrapData unwraps the data in the DSP file pointed by filename. Returns the data and a nil error on success or nil and an error on failure.

func WrapData

func WrapData(fileName string) ([]byte, error)

WrapData wraps the data in the file pointed by filename in a DSP container. Returns the container wrapped data and a nil error on success or nil and an error on failure.

Types

type File

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

File is the representation of a RoboMaster S1 program file (.dsp). It can be used to create, read, modify or write them.

func Load

func Load(fileName string) (*File, error)

Load loads a RoboMaster S1 program file (.dsp) from disk. Returns a pointer to a File instance and a nil error on success or nil and a non-nil error on failure.

func New

func New(creator, title string) (*File, error)

New creates a new File instance with the given creator and title. Returns a pointer to a File instance and a nil error on success or nil and a non-nil error on failure.

func NewWithPythonCode

func NewWithPythonCode(creator, title, pythonCode string) (*File, error)

NewWithPythonCode creates a new File instance with the given creator, title and pythonCode. Returns a pointer to a File instance and a nil error on success or nil and a non-nil error on failure.

func (*File) PythonCode

func (f *File) PythonCode() string

PythonCode returns the Python code associated with the given File.

func (*File) Save

func (f *File) Save(path string) error

Save serializes and saves the File instance to disk at the given path as an encrypted RoboMaster S1 program file (.dsp). Returns a nil error on success or a non-nil error on failure.

func (*File) SetPythonCode

func (f *File) SetPythonCode(pythonCode string)

SetPythonCode associates the given pythonCode with the given File.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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