dfu

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Default_InitCommand_IsDebug = bool(false)
)

Default values for InitCommand fields.

Variables

View Source
var (
	OpCode_name = map[int32]string{
		0: "RESET",
		1: "INIT",
	}
	OpCode_value = map[string]int32{
		"RESET": 0,
		"INIT":  1,
	}
)

Enum value maps for OpCode.

View Source
var (
	FwType_name = map[int32]string{
		0: "APPLICATION",
		1: "SOFTDEVICE",
		2: "BOOTLOADER",
		3: "SOFTDEVICE_BOOTLOADER",
		4: "EXTERNAL_APPLICATION",
	}
	FwType_value = map[string]int32{
		"APPLICATION":           0,
		"SOFTDEVICE":            1,
		"BOOTLOADER":            2,
		"SOFTDEVICE_BOOTLOADER": 3,
		"EXTERNAL_APPLICATION":  4,
	}
)

Enum value maps for FwType.

View Source
var (
	HashType_name = map[int32]string{
		0: "NO_HASH",
		1: "CRC",
		2: "SHA128",
		3: "SHA256",
		4: "SHA512",
	}
	HashType_value = map[string]int32{
		"NO_HASH": 0,
		"CRC":     1,
		"SHA128":  2,
		"SHA256":  3,
		"SHA512":  4,
	}
)

Enum value maps for HashType.

View Source
var (
	ValidationType_name = map[int32]string{
		0: "NO_VALIDATION",
		1: "VALIDATE_GENERATED_CRC",
		2: "VALIDATE_SHA256",
		3: "VALIDATE_ECDSA_P256_SHA256",
	}
	ValidationType_value = map[string]int32{
		"NO_VALIDATION":              0,
		"VALIDATE_GENERATED_CRC":     1,
		"VALIDATE_SHA256":            2,
		"VALIDATE_ECDSA_P256_SHA256": 3,
	}
)

Enum value maps for ValidationType.

View Source
var (
	SignatureType_name = map[int32]string{
		0: "ECDSA_P256_SHA256",
		1: "ED25519",
	}
	SignatureType_value = map[string]int32{
		"ECDSA_P256_SHA256": 0,
		"ED25519":           1,
	}
)

Enum value maps for SignatureType.

View Source
var File_dfu_cc_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type BootValidation

type BootValidation struct {
	Type  *ValidationType `protobuf:"varint,1,req,name=type,enum=dfu.ValidationType" json:"type,omitempty"`
	Bytes []byte          `protobuf:"bytes,2,req,name=bytes" json:"bytes,omitempty"`
	// contains filtered or unexported fields
}

func (*BootValidation) Descriptor deprecated

func (*BootValidation) Descriptor() ([]byte, []int)

Deprecated: Use BootValidation.ProtoReflect.Descriptor instead.

func (*BootValidation) GetBytes

func (x *BootValidation) GetBytes() []byte

func (*BootValidation) GetType

func (x *BootValidation) GetType() ValidationType

func (*BootValidation) ProtoMessage

func (*BootValidation) ProtoMessage()

func (*BootValidation) ProtoReflect

func (x *BootValidation) ProtoReflect() protoreflect.Message

func (*BootValidation) Reset

func (x *BootValidation) Reset()

func (*BootValidation) String

func (x *BootValidation) String() string

type Command

type Command struct {
	OpCode *OpCode       `protobuf:"varint,1,opt,name=op_code,json=opCode,enum=dfu.OpCode" json:"op_code,omitempty"`
	Init   *InitCommand  `protobuf:"bytes,2,opt,name=init" json:"init,omitempty"`
	Reset_ *ResetCommand `protobuf:"bytes,3,opt,name=reset" json:"reset,omitempty"`
	// contains filtered or unexported fields
}

Command type

func (*Command) Descriptor deprecated

func (*Command) Descriptor() ([]byte, []int)

Deprecated: Use Command.ProtoReflect.Descriptor instead.

func (*Command) GetInit

func (x *Command) GetInit() *InitCommand

func (*Command) GetOpCode

func (x *Command) GetOpCode() OpCode

func (*Command) GetReset_

func (x *Command) GetReset_() *ResetCommand

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) ProtoReflect

func (x *Command) ProtoReflect() protoreflect.Message

func (*Command) Reset

func (x *Command) Reset()

func (*Command) String

func (x *Command) String() string

type FwType

type FwType int32
const (
	FwType_APPLICATION           FwType = 0 // default, compatible with proto3
	FwType_SOFTDEVICE            FwType = 1
	FwType_BOOTLOADER            FwType = 2
	FwType_SOFTDEVICE_BOOTLOADER FwType = 3
	FwType_EXTERNAL_APPLICATION  FwType = 4
)

func (FwType) Descriptor

func (FwType) Descriptor() protoreflect.EnumDescriptor

func (FwType) Enum

func (x FwType) Enum() *FwType

func (FwType) EnumDescriptor deprecated

func (FwType) EnumDescriptor() ([]byte, []int)

Deprecated: Use FwType.Descriptor instead.

func (FwType) Number

func (x FwType) Number() protoreflect.EnumNumber

func (FwType) String

func (x FwType) String() string

func (FwType) Type

func (FwType) Type() protoreflect.EnumType

func (*FwType) UnmarshalJSON deprecated

func (x *FwType) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type Hash

type Hash struct {
	HashType *HashType `protobuf:"varint,1,req,name=hash_type,json=hashType,enum=dfu.HashType" json:"hash_type,omitempty"`
	Hash     []byte    `protobuf:"bytes,2,req,name=hash" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

func (*Hash) Descriptor deprecated

func (*Hash) Descriptor() ([]byte, []int)

Deprecated: Use Hash.ProtoReflect.Descriptor instead.

func (*Hash) GetHash

func (x *Hash) GetHash() []byte

func (*Hash) GetHashType

func (x *Hash) GetHashType() HashType

func (*Hash) ProtoMessage

func (*Hash) ProtoMessage()

func (*Hash) ProtoReflect

func (x *Hash) ProtoReflect() protoreflect.Message

func (*Hash) Reset

func (x *Hash) Reset()

func (*Hash) String

func (x *Hash) String() string

type HashType

type HashType int32
const (
	HashType_NO_HASH HashType = 0
	HashType_CRC     HashType = 1
	HashType_SHA128  HashType = 2
	HashType_SHA256  HashType = 3
	HashType_SHA512  HashType = 4
)

func (HashType) Descriptor

func (HashType) Descriptor() protoreflect.EnumDescriptor

func (HashType) Enum

func (x HashType) Enum() *HashType

func (HashType) EnumDescriptor deprecated

func (HashType) EnumDescriptor() ([]byte, []int)

Deprecated: Use HashType.Descriptor instead.

func (HashType) Number

func (x HashType) Number() protoreflect.EnumNumber

func (HashType) String

func (x HashType) String() string

func (HashType) Type

func (*HashType) UnmarshalJSON deprecated

func (x *HashType) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type InitCommand

type InitCommand struct {
	FwVersion      *uint32           `protobuf:"varint,1,opt,name=fw_version,json=fwVersion" json:"fw_version,omitempty"`
	HwVersion      *uint32           `protobuf:"varint,2,opt,name=hw_version,json=hwVersion" json:"hw_version,omitempty"`
	SdReq          []uint32          `protobuf:"varint,3,rep,packed,name=sd_req,json=sdReq" json:"sd_req,omitempty"` // packed option is default in proto3
	Type           *FwType           `protobuf:"varint,4,opt,name=type,enum=dfu.FwType" json:"type,omitempty"`
	SdSize         *uint32           `protobuf:"varint,5,opt,name=sd_size,json=sdSize" json:"sd_size,omitempty"`
	BlSize         *uint32           `protobuf:"varint,6,opt,name=bl_size,json=blSize" json:"bl_size,omitempty"`
	AppSize        *uint32           `protobuf:"varint,7,opt,name=app_size,json=appSize" json:"app_size,omitempty"`
	Hash           *Hash             `protobuf:"bytes,8,opt,name=hash" json:"hash,omitempty"`
	IsDebug        *bool             `protobuf:"varint,9,opt,name=is_debug,json=isDebug,def=0" json:"is_debug,omitempty"`
	BootValidation []*BootValidation `protobuf:"bytes,10,rep,name=boot_validation,json=bootValidation" json:"boot_validation,omitempty"`
	// contains filtered or unexported fields
}

Commands data

func (*InitCommand) Descriptor deprecated

func (*InitCommand) Descriptor() ([]byte, []int)

Deprecated: Use InitCommand.ProtoReflect.Descriptor instead.

func (*InitCommand) GetAppSize

func (x *InitCommand) GetAppSize() uint32

func (*InitCommand) GetBlSize

func (x *InitCommand) GetBlSize() uint32

func (*InitCommand) GetBootValidation

func (x *InitCommand) GetBootValidation() []*BootValidation

func (*InitCommand) GetFwVersion

func (x *InitCommand) GetFwVersion() uint32

func (*InitCommand) GetHash

func (x *InitCommand) GetHash() *Hash

func (*InitCommand) GetHwVersion

func (x *InitCommand) GetHwVersion() uint32

func (*InitCommand) GetIsDebug

func (x *InitCommand) GetIsDebug() bool

func (*InitCommand) GetSdReq

func (x *InitCommand) GetSdReq() []uint32

func (*InitCommand) GetSdSize

func (x *InitCommand) GetSdSize() uint32

func (*InitCommand) GetType

func (x *InitCommand) GetType() FwType

func (*InitCommand) ProtoMessage

func (*InitCommand) ProtoMessage()

func (*InitCommand) ProtoReflect

func (x *InitCommand) ProtoReflect() protoreflect.Message

func (*InitCommand) Reset

func (x *InitCommand) Reset()

func (*InitCommand) String

func (x *InitCommand) String() string

type OpCode

type OpCode int32

Definition of enums and types

const (
	OpCode_RESET OpCode = 0
	OpCode_INIT  OpCode = 1
)

func (OpCode) Descriptor

func (OpCode) Descriptor() protoreflect.EnumDescriptor

func (OpCode) Enum

func (x OpCode) Enum() *OpCode

func (OpCode) EnumDescriptor deprecated

func (OpCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use OpCode.Descriptor instead.

func (OpCode) Number

func (x OpCode) Number() protoreflect.EnumNumber

func (OpCode) String

func (x OpCode) String() string

func (OpCode) Type

func (OpCode) Type() protoreflect.EnumType

func (*OpCode) UnmarshalJSON deprecated

func (x *OpCode) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type Packet

type Packet struct {
	Command       *Command       `protobuf:"bytes,1,opt,name=command" json:"command,omitempty"`
	SignedCommand *SignedCommand `protobuf:"bytes,2,opt,name=signed_command,json=signedCommand" json:"signed_command,omitempty"`
	// contains filtered or unexported fields
}

Parent packet type

func (*Packet) Descriptor deprecated

func (*Packet) Descriptor() ([]byte, []int)

Deprecated: Use Packet.ProtoReflect.Descriptor instead.

func (*Packet) GetCommand

func (x *Packet) GetCommand() *Command

func (*Packet) GetSignedCommand

func (x *Packet) GetSignedCommand() *SignedCommand

func (*Packet) ProtoMessage

func (*Packet) ProtoMessage()

func (*Packet) ProtoReflect

func (x *Packet) ProtoReflect() protoreflect.Message

func (*Packet) Reset

func (x *Packet) Reset()

func (*Packet) String

func (x *Packet) String() string

type ResetCommand

type ResetCommand struct {
	Timeout *uint32 `protobuf:"varint,1,req,name=timeout" json:"timeout,omitempty"`
	// contains filtered or unexported fields
}

func (*ResetCommand) Descriptor deprecated

func (*ResetCommand) Descriptor() ([]byte, []int)

Deprecated: Use ResetCommand.ProtoReflect.Descriptor instead.

func (*ResetCommand) GetTimeout

func (x *ResetCommand) GetTimeout() uint32

func (*ResetCommand) ProtoMessage

func (*ResetCommand) ProtoMessage()

func (*ResetCommand) ProtoReflect

func (x *ResetCommand) ProtoReflect() protoreflect.Message

func (*ResetCommand) Reset

func (x *ResetCommand) Reset()

func (*ResetCommand) String

func (x *ResetCommand) String() string

type SignatureType

type SignatureType int32

Signed command types

const (
	SignatureType_ECDSA_P256_SHA256 SignatureType = 0
	SignatureType_ED25519           SignatureType = 1
)

func (SignatureType) Descriptor

func (SignatureType) Enum

func (x SignatureType) Enum() *SignatureType

func (SignatureType) EnumDescriptor deprecated

func (SignatureType) EnumDescriptor() ([]byte, []int)

Deprecated: Use SignatureType.Descriptor instead.

func (SignatureType) Number

func (SignatureType) String

func (x SignatureType) String() string

func (SignatureType) Type

func (*SignatureType) UnmarshalJSON deprecated

func (x *SignatureType) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type SignedCommand

type SignedCommand struct {
	Command       *Command       `protobuf:"bytes,1,req,name=command" json:"command,omitempty"`
	SignatureType *SignatureType `protobuf:"varint,2,req,name=signature_type,json=signatureType,enum=dfu.SignatureType" json:"signature_type,omitempty"`
	Signature     []byte         `protobuf:"bytes,3,req,name=signature" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

func (*SignedCommand) Descriptor deprecated

func (*SignedCommand) Descriptor() ([]byte, []int)

Deprecated: Use SignedCommand.ProtoReflect.Descriptor instead.

func (*SignedCommand) GetCommand

func (x *SignedCommand) GetCommand() *Command

func (*SignedCommand) GetSignature

func (x *SignedCommand) GetSignature() []byte

func (*SignedCommand) GetSignatureType

func (x *SignedCommand) GetSignatureType() SignatureType

func (*SignedCommand) ProtoMessage

func (*SignedCommand) ProtoMessage()

func (*SignedCommand) ProtoReflect

func (x *SignedCommand) ProtoReflect() protoreflect.Message

func (*SignedCommand) Reset

func (x *SignedCommand) Reset()

func (*SignedCommand) String

func (x *SignedCommand) String() string

type ValidationType

type ValidationType int32
const (
	ValidationType_NO_VALIDATION              ValidationType = 0
	ValidationType_VALIDATE_GENERATED_CRC     ValidationType = 1
	ValidationType_VALIDATE_SHA256            ValidationType = 2
	ValidationType_VALIDATE_ECDSA_P256_SHA256 ValidationType = 3
)

func (ValidationType) Descriptor

func (ValidationType) Enum

func (x ValidationType) Enum() *ValidationType

func (ValidationType) EnumDescriptor deprecated

func (ValidationType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ValidationType.Descriptor instead.

func (ValidationType) Number

func (ValidationType) String

func (x ValidationType) String() string

func (ValidationType) Type

func (*ValidationType) UnmarshalJSON deprecated

func (x *ValidationType) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

Jump to

Keyboard shortcuts

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