sbp-0.50.3: SwiftNav's SBP Library

CopyrightCopyright (C) 2015 Swift Navigation, Inc.
LicenseLGPL-3
MaintainerMark Fine <dev@swiftnav.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

SwiftNav.SBP.FileIo

Description

Messages for using device's onboard flash filesystem functionality. This allows data to be stored persistently in the device's program flash with wear-levelling using a simple filesystem interface. The file system interface (CFS) defines an abstract API for reading directories and for reading and writing files. These are in the implementation-defined range (0x0000-0x00FF), and intended for internal-use only. Note that some of these messages share the same message type ID for both the host request and the device response.

Synopsis

Documentation

data MsgFileioReadReq Source

SBP class for message MSG_FILEIO_READ_REQ (0x00A8).

The file read message reads a certain length (up to 255 bytes) from a given offset into a file, and returns the data in a MSG_FILEIO_READ_RESP message where the message length field indicates how many bytes were succesfully read.The sequence number in the request will be returned in the response.

Constructors

MsgFileioReadReq 

Fields

msgFileioReadReqSequence :: Word32

Read sequence number

msgFileioReadReqOffset :: Word32

File offset

msgFileioReadReqChunkSize :: Word8

Chunk size to read

msgFileioReadReqFilename :: ByteString

Name of the file to read from

data MsgFileioReadResp Source

SBP class for message MSG_FILEIO_READ_RESP (0x00A3).

The file read message reads a certain length (up to 255 bytes) from a given offset into a file, and returns the data in a message where the message length field indicates how many bytes were succesfully read. The sequence number in the response is preserved from the request.

Constructors

MsgFileioReadResp 

Fields

msgFileioReadRespSequence :: Word32

Read sequence number

msgFileioReadRespContents :: [Word8]

Contents of read file

data MsgFileioReadDirReq Source

SBP class for message MSG_FILEIO_READ_DIR_REQ (0x00A9).

The read directory message lists the files in a directory on the device's onboard flash file system. The offset parameter can be used to skip the first n elements of the file list. Returns a MSG_FILEIO_READ_DIR_RESP message containing the directory listings as a NULL delimited list. The listing is chunked over multiple SBP packets. The sequence number in the request will be returned in the response.

Constructors

MsgFileioReadDirReq 

Fields

msgFileioReadDirReqSequence :: Word32

Read sequence number

msgFileioReadDirReqOffset :: Word32

The offset to skip the first n elements of the file list

msgFileioReadDirReqDirname :: ByteString

Name of the directory to list

data MsgFileioReadDirResp Source

SBP class for message MSG_FILEIO_READ_DIR_RESP (0x00AA).

The read directory message lists the files in a directory on the device's onboard flash file system. Message contains the directory listings as a NULL delimited list. The listing is chunked over multiple SBP packets and the end of the list is identified by an entry containing just the character 0xFF. The sequence number in the response is preserved from the request.

Constructors

MsgFileioReadDirResp 

Fields

msgFileioReadDirRespSequence :: Word32

Read sequence number

msgFileioReadDirRespContents :: [Word8]

Contents of read directory

data MsgFileioRemove Source

SBP class for message MSG_FILEIO_REMOVE (0x00AC).

The file remove message deletes a file from the file system.

Constructors

MsgFileioRemove 

Fields

msgFileioRemoveFilename :: ByteString

Name of the file to delete

data MsgFileioWriteReq Source

SBP class for message MSG_FILEIO_WRITE_REQ (0x00AD).

The file write message writes a certain length (up to 255 bytes) of data to a file at a given offset. Returns a copy of the original MSG_FILEIO_WRITE_RESP message to check integrity of the write. The sequence number in the request will be returned in the response.

Constructors

MsgFileioWriteReq 

Fields

msgFileioWriteReqSequence :: Word32

Write sequence number

msgFileioWriteReqOffset :: Word32

Offset into the file at which to start writing in bytes

msgFileioWriteReqFilename :: ByteString

Name of the file to write to

msgFileioWriteReqData :: [Word8]

Variable-length array of data to write

data MsgFileioWriteResp Source

SBP class for message MSG_FILEIO_WRITE_RESP (0x00AB).

The file write message writes a certain length (up to 255 bytes) of data to a file at a given offset. The message is a copy of the original MSG_FILEIO_WRITE_REQ message to check integrity of the write. The sequence number in the response is preserved from the request.

Constructors

MsgFileioWriteResp 

Fields

msgFileioWriteRespSequence :: Word32

Write sequence number