fwbundle

package
v0.0.0-...-b44964e Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

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.

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

View Source
const (
	FSPartType = "fs"
)
View Source
const (
	ManifestFileName = "manifest.json"
)

Variables

This section is empty.

Functions

func WriteSignedZipFirmwareBundle

func WriteSignedZipFirmwareBundle(fwb *FirmwareBundle, fname string, compress bool, signers []crypto.Signer, extraAttrs map[string]interface{}) error

func WriteSignedZipFirmwareBytes

func WriteSignedZipFirmwareBytes(fwb *FirmwareBundle, buf *bytes.Buffer, compress bool, signers []crypto.Signer, extraAttrsUser map[string]interface{}) error

func WriteZipFirmwareBundle

func WriteZipFirmwareBundle(fwb *FirmwareBundle, fname string, compress bool, extraAttrs map[string]interface{}) error

func WriteZipFirmwareBytes

func WriteZipFirmwareBytes(fwb *FirmwareBundle, buf *bytes.Buffer, compress bool, extraAttrs map[string]interface{}) error

Types

type DataProvider

type DataProvider func(name, src string) ([]byte, error)

type FirmwareBundle

type FirmwareBundle struct {
	FirmwareManifest
	// contains filtered or unexported fields
}

func NewBundle

func NewBundle() *FirmwareBundle

func ReadZipFirmwareBundle

func ReadZipFirmwareBundle(fname string) (*FirmwareBundle, error)

func (*FirmwareBundle) AddPart

func (fwb *FirmwareBundle) AddPart(p *FirmwarePart) error

func (*FirmwareBundle) Cleanup

func (fw *FirmwareBundle) Cleanup()

func (*FirmwareBundle) GetPartData

func (fw *FirmwareBundle) GetPartData(name string) ([]byte, error)

func (*FirmwareBundle) GetPartDataFile

func (fw *FirmwareBundle) GetPartDataFile(name string) (string, int, error)

func (*FirmwareBundle) GetTempDir

func (fw *FirmwareBundle) GetTempDir() (string, error)

func (*FirmwareBundle) PartsByAddr

func (fwb *FirmwareBundle) PartsByAddr() []*FirmwarePart

func (*FirmwareBundle) RemovePart

func (fwb *FirmwareBundle) RemovePart(name string) error

func (*FirmwareBundle) SetAttr

func (fwb *FirmwareBundle) SetAttr(attr string, value interface{})

type FirmwareManifest

type FirmwareManifest firmwareManifest

func ReadManifest

func ReadManifest(fname string) (*FirmwareManifest, error)

func (*FirmwareManifest) MarshalJSON

func (fwm *FirmwareManifest) MarshalJSON() ([]byte, error)

func (*FirmwareManifest) UnmarshalJSON

func (fwm *FirmwareManifest) UnmarshalJSON(b []byte) error

type FirmwarePart

type FirmwarePart firmwarePart

func PartFromString

func PartFromString(ps string) (string, *FirmwarePart, error)

func PartsFromHex

func PartsFromHex(hexData []byte, baseName string, fill byte, maxGapSize int) ([]*FirmwarePart, error)

func PartsFromHexFile

func PartsFromHexFile(fname string, baseName string, fill byte, maxGapSize int) ([]*FirmwarePart, error)

func (*FirmwarePart) CalcChecksum

func (p *FirmwarePart) CalcChecksum() error

func (*FirmwarePart) GetData

func (p *FirmwarePart) GetData() ([]byte, error)

func (*FirmwarePart) MarshalJSON

func (p *FirmwarePart) MarshalJSON() ([]byte, error)

func (*FirmwarePart) SetData

func (p *FirmwarePart) SetData(data []byte)

func (*FirmwarePart) SetDataProvider

func (p *FirmwarePart) SetDataProvider(dp DataProvider)

func (*FirmwarePart) UnmarshalJSON

func (p *FirmwarePart) UnmarshalJSON(b []byte) error

type HexBundle

type HexBundle struct {
	Parts []*HexPart
	Start uint32
}

func ParseHexBundle

func ParseHexBundle(hexData []byte, fill byte, maxGapSize int) (*HexBundle, error)

type HexPart

type HexPart struct {
	Addr uint32
	Data []byte
}

Jump to

Keyboard shortcuts

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