fota

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Overview

Package fota implements Flash Over The Air utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitForSDcard

func WaitForSDcard(dev stm.Interface, sdcard string, retryCount int) error

WaitForSDcard checks if an SDcard is present in the system and returns. If card is not found it restarts it by DUT -> TS switch and tries again until number of retryCount is exceeded (then it returns an error).

Types

type FOTA

type FOTA struct {

	// SDcard is a path to block device images will be flashed to.
	// Example: "/dev/sda".
	SDcard string
	// PartMapping ".img" file -> partition number.
	// Example: {"boot.img":1}
	PartMapping map[string]string
	// contains filtered or unexported fields
}

FOTA provides methods to help in the process of flashing an image to sdcard.

func NewFOTA

func NewFOTA(dev stm.Interface, sdcard string, partMapping map[string]string) *FOTA

NewFOTA returns new instance of FOTA. It also opens connection to STM.

func (*FOTA) DownloadAndFlash

func (fota *FOTA) DownloadAndFlash(md5sums string, urls ...string) (err error)

DownloadAndFlash downloads images from URLs, uncompresses them, unpacks the archives and writes resulting ".img" files to proper partitions.

Files not mentioned in PartMapping are ignored.

MD5 checksum is calculated and error returned when mismatch occurs. If MD5SUMS URL is not specified or downloaded file is not mentioned in it, calculation results are ignored.

func (*FOTA) Flash

func (fota *FOTA) Flash(md5sumsPath string, paths ...string) (err error)

Flash works in a similar way to DownloadAndFlash except that it takes paths to files instead of HTTP addresses.

func (*FOTA) SetVerbose

func (fota *FOTA) SetVerbose()

SetVerbose increases logging of FOTA actions.

Jump to

Keyboard shortcuts

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