Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnwrapData ¶
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.
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 ¶
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 ¶
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 ¶
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 ¶
PythonCode returns the Python code associated with the given File.
func (*File) Save ¶
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 ¶
SetPythonCode associates the given pythonCode with the given File.