Documentation
¶
Index ¶
- Constants
- func ClearECEventQueue(ctx context.Context) error
- func DPSLSendMessage(ctx context.Context, msgName string, in, out descriptor.Message) error
- func ReadECEvent(ctx context.Context) ([]byte, error)
- func StartSupportd(ctx context.Context) error
- func StartVM(ctx context.Context, config *VMConfig) error
- func StopSupportd(ctx context.Context) error
- func StopVM(ctx context.Context) error
- func SupportdPID(ctx context.Context) (pid int, err error)
- func TriggerECEvent() error
- func VMPID(ctx context.Context) (pid int, err error)
- func WaitForDDVDBus(ctx context.Context) error
- func WithHandleMessageFromUiResponse(response *dtcpb.HandleMessageFromUiResponse) option
- type DPSLMessageReceiver
- type RTC
- type VMConfig
Constants ¶
const ( // WilcoVMCID is the context ID for the VM WilcoVMCID = 512 DDVDbusTopic = "com.dell.ddv" )
Const values from /etc/init/wilco_dtc.conf on device
Variables ¶
This section is empty.
Functions ¶
func ClearECEventQueue ¶
ClearECEventQueue will read all of the currently available events in the wilco EC device node queue. These events are discarded.
func DPSLSendMessage ¶
DPSLSendMessage is a helper function that creates and runs a diagnostics_dpsl_test_requester command over vsh. It accepts the name of command, the proto message to send, and a proto message to hold the output. See https://crrev.com/c/1767044 for a description of the diagnostics_dpsl_test_requester.
func ReadECEvent ¶
ReadECEvent reads an EC event from the EC event device node. The event payload will be returned.
func StartSupportd ¶
StartSupportd starts the upstart process wilco_dtc_supportd.
func StopSupportd ¶
StopSupportd stops the upstart process wilco_dtc_supportd.
func SupportdPID ¶
SupportdPID gets the process id of wilco_dtc_supportd.
func TriggerECEvent ¶
func TriggerECEvent() error
TriggerECEvent writes data to the EC event trigger path and triggers a fake EC event.
func WaitForDDVDBus ¶
WaitForDDVDBus blocks until the ddv dbus service to be available.
func WithHandleMessageFromUiResponse ¶
func WithHandleMessageFromUiResponse(response *dtcpb.HandleMessageFromUiResponse) option
WithHandleMessageFromUiResponse sets the --ui_response_body flag, making the listener reply with that value to HandleMessageFromUi requests.
Types ¶
type DPSLMessageReceiver ¶
type DPSLMessageReceiver struct {
// contains filtered or unexported fields
}
DPSLMessageReceiver contains the necessary components to run the DPSL listening utility and parse its output.
func NewDPSLMessageReceiver ¶
func NewDPSLMessageReceiver(ctx context.Context, opts ...option) (*DPSLMessageReceiver, error)
NewDPSLMessageReceiver will start a utility inside of the Wilco VM listening for DPSL messages. It will return a DPSLMessageReceiver struct that decodes and buffers the JSON. It will immediately start consuming messages from the stdout of the dpsl test listener.
func (*DPSLMessageReceiver) Stop ¶
func (rec *DPSLMessageReceiver) Stop(ctx context.Context)
Stop will stop the DPSLMessageReceiver gracefully by interrupting the DPSL listening program and exiting the goroutine.
func (*DPSLMessageReceiver) WaitForMessage ¶
func (rec *DPSLMessageReceiver) WaitForMessage(ctx context.Context, out descriptor.Message) error
WaitForMessage listens for events sent to the VM and attempt to parse them into the descriptor.Message. The function will block until the correct message type is found or the context timeout is reached. Messages that do not match the provided descriptor.Message will be ignored and discarded.
type RTC ¶
RTC (wilco) is a thin wrapper around the rtc.RTC and implements the RTC features specific to the wilco devices.
type VMConfig ¶
type VMConfig struct { // StartProcesses will determine if the init processes of the Wilco DTC VM are run (DDV and SA). StartProcesses bool // TestDBusConfig will start the dbus-daemon with a test configuration. TestDBusConfig bool }
VMConfig contains different configuration options for starting the WilcoVM.
func DefaultVMConfig ¶
func DefaultVMConfig() *VMConfig
DefaultVMConfig creates and returns a VMConfig with the default values. These default values are the ones used for the production VM.