pb

package
v0.0.0-...-b6833b6 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_smartknob_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Ack

type Ack struct {
	Nonce uint32 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// contains filtered or unexported fields
}

* Lets the host know that a ToSmartknob message was received and should not be retried.

func (*Ack) Descriptor deprecated

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

Deprecated: Use Ack.ProtoReflect.Descriptor instead.

func (*Ack) GetNonce

func (x *Ack) GetNonce() uint32

func (*Ack) ProtoMessage

func (*Ack) ProtoMessage()

func (*Ack) ProtoReflect

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

func (*Ack) Reset

func (x *Ack) Reset()

func (*Ack) String

func (x *Ack) String() string

type FromSmartKnob

type FromSmartKnob struct {
	ProtocolVersion uint32 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"`
	// Types that are assignable to Payload:
	//
	//	*FromSmartKnob_Ack
	//	*FromSmartKnob_Log
	//	*FromSmartKnob_SmartknobState
	Payload isFromSmartKnob_Payload `protobuf_oneof:"payload"`
	// contains filtered or unexported fields
}

Message FROM the SmartKnob to the host

func (*FromSmartKnob) Descriptor deprecated

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

Deprecated: Use FromSmartKnob.ProtoReflect.Descriptor instead.

func (*FromSmartKnob) GetAck

func (x *FromSmartKnob) GetAck() *Ack

func (*FromSmartKnob) GetLog

func (x *FromSmartKnob) GetLog() *Log

func (*FromSmartKnob) GetPayload

func (m *FromSmartKnob) GetPayload() isFromSmartKnob_Payload

func (*FromSmartKnob) GetProtocolVersion

func (x *FromSmartKnob) GetProtocolVersion() uint32

func (*FromSmartKnob) GetSmartknobState

func (x *FromSmartKnob) GetSmartknobState() *SmartKnobState

func (*FromSmartKnob) ProtoMessage

func (*FromSmartKnob) ProtoMessage()

func (*FromSmartKnob) ProtoReflect

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

func (*FromSmartKnob) Reset

func (x *FromSmartKnob) Reset()

func (*FromSmartKnob) String

func (x *FromSmartKnob) String() string

type FromSmartKnob_Ack

type FromSmartKnob_Ack struct {
	Ack *Ack `protobuf:"bytes,2,opt,name=ack,proto3,oneof"`
}

type FromSmartKnob_Log

type FromSmartKnob_Log struct {
	Log *Log `protobuf:"bytes,3,opt,name=log,proto3,oneof"`
}

type FromSmartKnob_SmartknobState

type FromSmartKnob_SmartknobState struct {
	SmartknobState *SmartKnobState `protobuf:"bytes,4,opt,name=smartknob_state,json=smartknobState,proto3,oneof"`
}

type Log

type Log struct {
	Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*Log) Descriptor deprecated

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

Deprecated: Use Log.ProtoReflect.Descriptor instead.

func (*Log) GetMsg

func (x *Log) GetMsg() string

func (*Log) ProtoMessage

func (*Log) ProtoMessage()

func (*Log) ProtoReflect

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

func (*Log) Reset

func (x *Log) Reset()

func (*Log) String

func (x *Log) String() string

type MotorCalibration

type MotorCalibration struct {
	Calibrated           bool    `protobuf:"varint,1,opt,name=calibrated,proto3" json:"calibrated,omitempty"`
	ZeroElectricalOffset float32 `protobuf:"fixed32,2,opt,name=zero_electrical_offset,json=zeroElectricalOffset,proto3" json:"zero_electrical_offset,omitempty"`
	DirectionCw          bool    `protobuf:"varint,3,opt,name=direction_cw,json=directionCw,proto3" json:"direction_cw,omitempty"`
	PolePairs            uint32  `protobuf:"varint,4,opt,name=pole_pairs,json=polePairs,proto3" json:"pole_pairs,omitempty"`
	// contains filtered or unexported fields
}

func (*MotorCalibration) Descriptor deprecated

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

Deprecated: Use MotorCalibration.ProtoReflect.Descriptor instead.

func (*MotorCalibration) GetCalibrated

func (x *MotorCalibration) GetCalibrated() bool

func (*MotorCalibration) GetDirectionCw

func (x *MotorCalibration) GetDirectionCw() bool

func (*MotorCalibration) GetPolePairs

func (x *MotorCalibration) GetPolePairs() uint32

func (*MotorCalibration) GetZeroElectricalOffset

func (x *MotorCalibration) GetZeroElectricalOffset() float32

func (*MotorCalibration) ProtoMessage

func (*MotorCalibration) ProtoMessage()

func (*MotorCalibration) ProtoReflect

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

func (*MotorCalibration) Reset

func (x *MotorCalibration) Reset()

func (*MotorCalibration) String

func (x *MotorCalibration) String() string

type PersistentConfiguration

type PersistentConfiguration struct {
	Version uint32             `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	Motor   *MotorCalibration  `protobuf:"bytes,2,opt,name=motor,proto3" json:"motor,omitempty"`
	Strain  *StrainCalibration `protobuf:"bytes,3,opt,name=strain,proto3" json:"strain,omitempty"`
	// contains filtered or unexported fields
}

func (*PersistentConfiguration) Descriptor deprecated

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

Deprecated: Use PersistentConfiguration.ProtoReflect.Descriptor instead.

func (*PersistentConfiguration) GetMotor

func (*PersistentConfiguration) GetStrain

func (*PersistentConfiguration) GetVersion

func (x *PersistentConfiguration) GetVersion() uint32

func (*PersistentConfiguration) ProtoMessage

func (*PersistentConfiguration) ProtoMessage()

func (*PersistentConfiguration) ProtoReflect

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

func (*PersistentConfiguration) Reset

func (x *PersistentConfiguration) Reset()

func (*PersistentConfiguration) String

func (x *PersistentConfiguration) String() string

type RequestState

type RequestState struct {
	// contains filtered or unexported fields
}

func (*RequestState) Descriptor deprecated

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

Deprecated: Use RequestState.ProtoReflect.Descriptor instead.

func (*RequestState) ProtoMessage

func (*RequestState) ProtoMessage()

func (*RequestState) ProtoReflect

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

func (*RequestState) Reset

func (x *RequestState) Reset()

func (*RequestState) String

func (x *RequestState) String() string

type SmartKnobConfig

type SmartKnobConfig struct {

	// *
	// Set the integer position.
	//
	// Note: in order to make SmartKnobConfig apply idempotently, the current position
	// will only be set to this value when it changes compared to a previous config (and
	// NOT compared to the current state!). So by default, if you send a config position
	// of 5 and the current position is 3, the position may remain at 3 if the config
	// change to 5 was previously handled. If you need to force a position update, see
	// position_nonce.
	Position int32 `protobuf:"varint,1,opt,name=position,proto3" json:"position,omitempty"`
	// *
	// Set the fractional position. Typical range: (-snap_point, snap_point).
	//
	// Actual range is technically unbounded, but in practice this value will be compared
	// against snap_point on the next control loop, so any value beyond the snap_point will
	// generally result in an integer position change (unless position is already at a
	// limit).
	//
	// Note: idempotency implications noted in the documentation for `position` apply here
	// as well
	SubPositionUnit float32 `protobuf:"fixed32,2,opt,name=sub_position_unit,json=subPositionUnit,proto3" json:"sub_position_unit,omitempty"`
	// *
	// Position is normally only applied when it changes, but sometimes it's desirable
	// to reset the position to the same value, so a nonce change can be used to force
	// the position values to be applied as well.
	//
	// NOTE: Must be < 256
	PositionNonce uint32 `protobuf:"varint,3,opt,name=position_nonce,json=positionNonce,proto3" json:"position_nonce,omitempty"`
	// * Minimum position allowed.
	MinPosition int32 `protobuf:"varint,4,opt,name=min_position,json=minPosition,proto3" json:"min_position,omitempty"`
	// *
	// Maximum position allowed.
	//
	// If this is the same as min_position, there will only be one allowed position.
	//
	// If this is less than min_position, bounds will be disabled.
	MaxPosition int32 `protobuf:"varint,5,opt,name=max_position,json=maxPosition,proto3" json:"max_position,omitempty"`
	// * The angular "width" of each position/detent, in radians.
	PositionWidthRadians float32 `protobuf:"fixed32,6,opt,name=position_width_radians,json=positionWidthRadians,proto3" json:"position_width_radians,omitempty"`
	// *
	// Strength of detents to apply. Typical range: [0, 1].
	//
	// A value of 0 disables detents.
	//
	// Values greater than 1 are not recommended and may lead to unstable behavior.
	DetentStrengthUnit float32 `protobuf:"fixed32,7,opt,name=detent_strength_unit,json=detentStrengthUnit,proto3" json:"detent_strength_unit,omitempty"`
	// *
	// Strength of endstop torque to apply at min/max bounds. Typical range: [0, 1].
	//
	// A value of 0 disables endstop torque, but does not make position unbounded, meaning
	// the knob will not try to return to the valid region. For unbounded rotation, use
	// min_position and max_position.
	//
	// Values greater than 1 are not recommended and may lead to unstable behavior.
	EndstopStrengthUnit float32 `protobuf:"fixed32,8,opt,name=endstop_strength_unit,json=endstopStrengthUnit,proto3" json:"endstop_strength_unit,omitempty"`
	// *
	// Fractional (sub-position) threshold where the position will increment/decrement.
	// Typical range: (0.5, 1.5).
	//
	// This defines how hysteresis is applied to positions, which is why values >
	SnapPoint float32 `protobuf:"fixed32,9,opt,name=snap_point,json=snapPoint,proto3" json:"snap_point,omitempty"`
	// *
	// Arbitrary 50-byte string representing this "config". This can be used to identify major
	// config/mode changes. The value will be echoed back to the host via a future State's
	// embedded config field so the host can use this value to determine the mode that was
	// in effect at the time of the State snapshot instead of having to infer it from the
	// other config fields.
	Text string `protobuf:"bytes,10,opt,name=text,proto3" json:"text,omitempty"`
	// *
	// For a "magnetic" detent mode - where not all positions should have detents - this
	// specifies which positions (up to 5) have detents enabled. The knob will feel like it
	// is "magnetically" attracted to those positions, and will rotate smoothy past all
	// other positions.
	//
	// If you want to have more than 5 magnetic detent positions, you will need to dynamically
	// update this list as the knob is rotated. A recommended approach is to always send the
	// _nearest_ 5 detent positions, and send a new Config message whenever the list of
	// positions nearest the current position (as reported via State messages) changes.
	//
	// This approach enables effectively unbounded detent positions while keeping Config
	// bounded in size, and is resilient against tightly-packed detents with fast rotation
	// since multiple detent positions can be sent in advance; a full round-trip Config-State
	// isn't needed between each detent in order to keep up.
	DetentPositions []int32 `protobuf:"varint,11,rep,packed,name=detent_positions,json=detentPositions,proto3" json:"detent_positions,omitempty"`
	// *
	// Advanced feature for shifting the defined snap_point away from the center (position 0)
	// for implementing asymmetric detents. Typical value: 0 (symmetric detent force).
	//
	// This can be used to create detents that will hold the position when carefully released,
	// but can be easily disturbed to return "home" towards position 0.
	SnapPointBias float32 `protobuf:"fixed32,12,opt,name=snap_point_bias,json=snapPointBias,proto3" json:"snap_point_bias,omitempty"`
	// *
	// Hue (0-255) for all 8 ring LEDs, if supported. Note: this will likely be replaced
	// with more configurability in a future protocol version.
	LedHue int32 `protobuf:"varint,13,opt,name=led_hue,json=ledHue,proto3" json:"led_hue,omitempty"`
	// contains filtered or unexported fields
}

func (*SmartKnobConfig) Descriptor deprecated

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

Deprecated: Use SmartKnobConfig.ProtoReflect.Descriptor instead.

func (*SmartKnobConfig) GetDetentPositions

func (x *SmartKnobConfig) GetDetentPositions() []int32

func (*SmartKnobConfig) GetDetentStrengthUnit

func (x *SmartKnobConfig) GetDetentStrengthUnit() float32

func (*SmartKnobConfig) GetEndstopStrengthUnit

func (x *SmartKnobConfig) GetEndstopStrengthUnit() float32

func (*SmartKnobConfig) GetLedHue

func (x *SmartKnobConfig) GetLedHue() int32

func (*SmartKnobConfig) GetMaxPosition

func (x *SmartKnobConfig) GetMaxPosition() int32

func (*SmartKnobConfig) GetMinPosition

func (x *SmartKnobConfig) GetMinPosition() int32

func (*SmartKnobConfig) GetPosition

func (x *SmartKnobConfig) GetPosition() int32

func (*SmartKnobConfig) GetPositionNonce

func (x *SmartKnobConfig) GetPositionNonce() uint32

func (*SmartKnobConfig) GetPositionWidthRadians

func (x *SmartKnobConfig) GetPositionWidthRadians() float32

func (*SmartKnobConfig) GetSnapPoint

func (x *SmartKnobConfig) GetSnapPoint() float32

func (*SmartKnobConfig) GetSnapPointBias

func (x *SmartKnobConfig) GetSnapPointBias() float32

func (*SmartKnobConfig) GetSubPositionUnit

func (x *SmartKnobConfig) GetSubPositionUnit() float32

func (*SmartKnobConfig) GetText

func (x *SmartKnobConfig) GetText() string

func (*SmartKnobConfig) ProtoMessage

func (*SmartKnobConfig) ProtoMessage()

func (*SmartKnobConfig) ProtoReflect

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

func (*SmartKnobConfig) Reset

func (x *SmartKnobConfig) Reset()

func (*SmartKnobConfig) String

func (x *SmartKnobConfig) String() string

type SmartKnobState

type SmartKnobState struct {

	// * Current integer position of the knob. (Detent resolution is at integer positions)
	CurrentPosition int32 `protobuf:"varint,1,opt,name=current_position,json=currentPosition,proto3" json:"current_position,omitempty"`
	// *
	// Current fractional position. Typically will only range from (-snap_point, snap_point)
	// since further rotation will result in the integer position changing, but may exceed
	// those values if snap_point_bias is non-zero, or if the knob is at a bound. When the
	// knob is at a bound, this value can grow endlessly as the knob is rotated further past
	// the bound.
	//
	// When visualizing sub_position_unit, you will likely want to apply a rubber-band easing
	// function past the bounds; a sublinear relationship will help suggest that a bound has
	// been reached.
	SubPositionUnit float32 `protobuf:"fixed32,2,opt,name=sub_position_unit,json=subPositionUnit,proto3" json:"sub_position_unit,omitempty"`
	// *
	// Current SmartKnobConfig in effect at the time of this State snapshot.
	//
	// Beware that this config contains position and sub_position_unit values, not to be
	// confused with the top level current_position and sub_position_unit values in this State
	// message. The position values in the embedded config message will almost never be useful
	// to you; you probably want to be reading the top level values from the State message.
	Config *SmartKnobConfig `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"`
	// *
	// Value that changes each time the knob is pressed. Does not change when a press is released.
	//
	// Why this press state a "nonce" rather than a simple boolean representing the current
	// "pressed" state? It makes the protocol more robust to dropped/lost State messages; if
	// the knob was pressed/released quickly and State messages happened to be dropped during
	// that time, the press would be completely lost. Using a nonce allows the host to recognize
	// that a press has taken place at some point even if the State was lost during the press
	// itself. Is this overkill? Probably, let's revisit in future protocol versions.
	PressNonce uint32 `protobuf:"varint,4,opt,name=press_nonce,json=pressNonce,proto3" json:"press_nonce,omitempty"`
	// contains filtered or unexported fields
}

func (*SmartKnobState) Descriptor deprecated

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

Deprecated: Use SmartKnobState.ProtoReflect.Descriptor instead.

func (*SmartKnobState) GetConfig

func (x *SmartKnobState) GetConfig() *SmartKnobConfig

func (*SmartKnobState) GetCurrentPosition

func (x *SmartKnobState) GetCurrentPosition() int32

func (*SmartKnobState) GetPressNonce

func (x *SmartKnobState) GetPressNonce() uint32

func (*SmartKnobState) GetSubPositionUnit

func (x *SmartKnobState) GetSubPositionUnit() float32

func (*SmartKnobState) ProtoMessage

func (*SmartKnobState) ProtoMessage()

func (*SmartKnobState) ProtoReflect

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

func (*SmartKnobState) Reset

func (x *SmartKnobState) Reset()

func (*SmartKnobState) String

func (x *SmartKnobState) String() string

type StrainCalibration

type StrainCalibration struct {
	IdleValue  int32 `protobuf:"varint,1,opt,name=idle_value,json=idleValue,proto3" json:"idle_value,omitempty"`
	PressDelta int32 `protobuf:"varint,2,opt,name=press_delta,json=pressDelta,proto3" json:"press_delta,omitempty"`
	// contains filtered or unexported fields
}

func (*StrainCalibration) Descriptor deprecated

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

Deprecated: Use StrainCalibration.ProtoReflect.Descriptor instead.

func (*StrainCalibration) GetIdleValue

func (x *StrainCalibration) GetIdleValue() int32

func (*StrainCalibration) GetPressDelta

func (x *StrainCalibration) GetPressDelta() int32

func (*StrainCalibration) ProtoMessage

func (*StrainCalibration) ProtoMessage()

func (*StrainCalibration) ProtoReflect

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

func (*StrainCalibration) Reset

func (x *StrainCalibration) Reset()

func (*StrainCalibration) String

func (x *StrainCalibration) String() string

type ToSmartknob

type ToSmartknob struct {
	ProtocolVersion uint32 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"`
	Nonce           uint32 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// Types that are assignable to Payload:
	//
	//	*ToSmartknob_RequestState
	//	*ToSmartknob_SmartknobConfig
	Payload isToSmartknob_Payload `protobuf_oneof:"payload"`
	// contains filtered or unexported fields
}

Message TO the Smartknob from the host

func (*ToSmartknob) Descriptor deprecated

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

Deprecated: Use ToSmartknob.ProtoReflect.Descriptor instead.

func (*ToSmartknob) GetNonce

func (x *ToSmartknob) GetNonce() uint32

func (*ToSmartknob) GetPayload

func (m *ToSmartknob) GetPayload() isToSmartknob_Payload

func (*ToSmartknob) GetProtocolVersion

func (x *ToSmartknob) GetProtocolVersion() uint32

func (*ToSmartknob) GetRequestState

func (x *ToSmartknob) GetRequestState() *RequestState

func (*ToSmartknob) GetSmartknobConfig

func (x *ToSmartknob) GetSmartknobConfig() *SmartKnobConfig

func (*ToSmartknob) ProtoMessage

func (*ToSmartknob) ProtoMessage()

func (*ToSmartknob) ProtoReflect

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

func (*ToSmartknob) Reset

func (x *ToSmartknob) Reset()

func (*ToSmartknob) String

func (x *ToSmartknob) String() string

type ToSmartknob_RequestState

type ToSmartknob_RequestState struct {
	RequestState *RequestState `protobuf:"bytes,3,opt,name=request_state,json=requestState,proto3,oneof"`
}

type ToSmartknob_SmartknobConfig

type ToSmartknob_SmartknobConfig struct {
	SmartknobConfig *SmartKnobConfig `protobuf:"bytes,4,opt,name=smartknob_config,json=smartknobConfig,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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