mojo

package
v0.0.0-...-9474aff Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package mojo provides functions to access the bluetooth mojo interface defined in cros_bluetooth_config.mojom

Index

Constants

View Source
const BTConfigJS = `` /* 806-byte string literal not displayed */

BTConfigJS is javascript code that initializes the config object and defines some additional functions

Variables

This section is empty.

Functions

func PollForBluetoothSystemState

func PollForBluetoothSystemState(ctx context.Context, btmojo chrome.JSObject, exp BluetoothSystemState) error

PollForBluetoothSystemState polls BluetoothSystemProperties until expected SystemState is received or timeout occurs.

func SetBluetoothEnabledState

func SetBluetoothEnabledState(ctx context.Context, btmojo chrome.JSObject, enabled bool) error

SetBluetoothEnabledState sets Bluetooth state to on/off

Types

type BTConn

type BTConn struct {
	Crconn *chrome.Conn
	Js     *chrome.JSObject
}

BTConn hold the chrome connection and the Mojo JS object

func (*BTConn) PostTest

func (*BTConn) PostTest(ctx context.Context, s *testing.FixtTestState)

func (*BTConn) PreTest

func (*BTConn) PreTest(ctx context.Context, s *testing.FixtTestState)

func (*BTConn) Reset

func (m *BTConn) Reset(ctx context.Context) error

func (*BTConn) SetUp

func (m *BTConn) SetUp(ctx context.Context, s *testing.FixtState) interface{}

func (*BTConn) TearDown

func (m *BTConn) TearDown(ctx context.Context, s *testing.FixtState)

type BluetoothModificationState

type BluetoothModificationState int32

BluetoothModificationState represents the state of whether Bluetooth can be modified.

const (
	// the current session may belong to a secondary user, or the screen is locked.
	CannotModifyBluetooth BluetoothModificationState = iota

	// CanModifyBluetooth means Bluetooth settings can be modified as part of the current session.
	CanModifyBluetooth
)

type BluetoothSystemProperties

type BluetoothSystemProperties struct {
	SystemState       BluetoothSystemState
	ModificationState BluetoothModificationState
}

BluetoothSystemProperties describes the high-level status of system Bluetooth.

type BluetoothSystemState

type BluetoothSystemState int32

BluetoothSystemState represents the state of Bluetooth on the device.

const (
	// Unavailable means device does not have access to Bluetooth.
	Unavailable BluetoothSystemState = iota
	// Disabled means Bluetooth is turned off.
	Disabled
	// Disabling means Bluetooth is in the process of turning off.
	Disabling
	// Enabled means Bluetooth is turned on.
	Enabled BluetoothSystemState = 3
	// Enabling means Bluetooth is in the process of turning on.
	Enabling
)

Jump to

Keyboard shortcuts

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