Documentation ¶
Overview ¶
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func GetUSBSerialNumberForPort(port string) (string, error)
- type ChipType
- type DeviceControl
- type DeviceInfo
- type FileSignature
- type MACAddress
- type PartsByTypeAndName
- type ROMClient
- func (rc *ROMClient) EraseFile(fname string) error
- func (rc *ROMClient) ExecuteFromRAM() error
- func (rc *ROMClient) FormatSLFS(size int) error
- func (rc *ROMClient) GetDeviceInfo() (*DeviceInfo, error)
- func (rc *ROMClient) GetMACAddress() (MACAddress, error)
- func (rc *ROMClient) GetStatus() (romStatus, error)
- func (rc *ROMClient) GetStorageInfo(sid StorageID) (*StorageInfo, error)
- func (rc *ROMClient) GetStorageList() (StorageBitmap, error)
- func (rc *ROMClient) GetVersionInfo() (*VersionInfo, error)
- func (rc *ROMClient) RawEraseAndWrite(sid StorageID, offset int, data []byte) error
- func (rc *ROMClient) RawStorageEraseBlocks(sid StorageID, startBlock int, numBlocks int) error
- func (rc *ROMClient) RawStorageEraseBytes(sid StorageID, offset int, numBytes int) error
- func (rc *ROMClient) RawStorageWrite(sid StorageID, offset int, data []byte) error
- func (rc *ROMClient) SwitchToNWPLoader() error
- func (rc *ROMClient) SwitchUARTtoAppsMCU() error
- func (rc *ROMClient) UploadFile(fi *SLFSFileInfo) error
- func (rc *ROMClient) UploadImageFile(fname string) error
- type SLFSFileInfo
- type StorageBitmap
- type StorageID
- type StorageInfo
- type VersionInfo
Constants ¶
const ( StorageBitInvalid StorageBitmap = 0x00 StorageBitFlash = 0x02 StorageBitSFlash = 0x04 StorageBitRAM = 0x80 )
const ( StorageRAM StorageID = 0x00 StorageFlash = 0x01 StorageSFlash = 0x02 )
const ( BootFlashImgName = "/sys/mcuflashimg.bin" PartTypeServicePack = "service_pack" PartTypeCABundle = "cabundle" PartTypeCertificate = "cert" PartTypeSLFile = "slfile" PartTypeSLConfig = "slcfg" PartTypeBootLoader = "boot" PartTypeBootLoaderConfig = "boot_cfg" PartTypeApp = "app" PartTypeFSContainer = "fs" PartTypeSignature = "sig" )
const (
FileSignatureLength = 0x100
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DeviceControl ¶
type DeviceInfo ¶
type FileSignature ¶
type FileSignature []byte
type MACAddress ¶
type MACAddress [6]byte
func (MACAddress) String ¶
func (mac MACAddress) String() string
type PartsByTypeAndName ¶
type PartsByTypeAndName []*fwbundle.FirmwarePart
func (PartsByTypeAndName) Len ¶
func (pp PartsByTypeAndName) Len() int
func (PartsByTypeAndName) Less ¶
func (pp PartsByTypeAndName) Less(i, j int) bool
func (PartsByTypeAndName) Swap ¶
func (pp PartsByTypeAndName) Swap(i, j int)
type ROMClient ¶
type ROMClient struct {
// contains filtered or unexported fields
}
func NewROMClient ¶
func NewROMClient(s serial.Serial, dc DeviceControl) (*ROMClient, error)
func (*ROMClient) ExecuteFromRAM ¶
func (*ROMClient) FormatSLFS ¶
func (*ROMClient) GetDeviceInfo ¶
func (rc *ROMClient) GetDeviceInfo() (*DeviceInfo, error)
func (*ROMClient) GetMACAddress ¶
func (rc *ROMClient) GetMACAddress() (MACAddress, error)
func (*ROMClient) GetStorageInfo ¶
func (rc *ROMClient) GetStorageInfo(sid StorageID) (*StorageInfo, error)
func (*ROMClient) GetStorageList ¶
func (rc *ROMClient) GetStorageList() (StorageBitmap, error)
func (*ROMClient) GetVersionInfo ¶
func (rc *ROMClient) GetVersionInfo() (*VersionInfo, error)
func (*ROMClient) RawEraseAndWrite ¶
func (*ROMClient) RawStorageEraseBlocks ¶
func (*ROMClient) RawStorageEraseBytes ¶
func (*ROMClient) RawStorageWrite ¶
func (*ROMClient) SwitchToNWPLoader ¶
func (*ROMClient) SwitchUARTtoAppsMCU ¶
func (*ROMClient) UploadFile ¶
func (rc *ROMClient) UploadFile(fi *SLFSFileInfo) error
func (*ROMClient) UploadImageFile ¶
type SLFSFileInfo ¶
type SLFSFileInfo struct { Name string Data []byte AllocSize uint32 Signature FileSignature }
type StorageBitmap ¶
type StorageBitmap uint8
type StorageInfo ¶
type VersionInfo ¶
type VersionInfo struct { BootLoaderVersion uint32 NWPVersion uint32 MACVersion uint32 PHYVersion uint32 ChipTypeV uint32 }
func (*VersionInfo) BootLoaderVersionString ¶
func (vi *VersionInfo) BootLoaderVersionString() string
func (*VersionInfo) ChipType ¶
func (vi *VersionInfo) ChipType() (ChipType, error)
func (*VersionInfo) ChipTypeString ¶
func (vi *VersionInfo) ChipTypeString() string