protocol

package
v0.0.0-...-6cbb9e6 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Invalid           = CarPlayType(0)
	BtnSiri           = CarPlayType(5)
	CarMicrophone     = CarPlayType(7)
	BtnLeft           = CarPlayType(100)
	BtnRight          = CarPlayType(101)
	BtnSelectDown     = CarPlayType(104)
	BtnSelectUp       = CarPlayType(105)
	BtnBack           = CarPlayType(106)
	BtnDown           = CarPlayType(114)
	BtnHome           = CarPlayType(200)
	BtnPlay           = CarPlayType(201)
	BtnPause          = CarPlayType(202)
	BtnNextTrack      = CarPlayType(204)
	BtnPrevTrack      = CarPlayType(205)
	SupportWifi       = CarPlayType(1000)
	SupportWifiNeedKo = CarPlayType(1012)
)
View Source
const (
	AudioOutputStart    = AudioCommand(0x01)
	AudioOutputStop     = AudioCommand(0x02)
	AudioInputConfig    = AudioCommand(0x03)
	AudioPhonecallStart = AudioCommand(0x04)
	AudioPhonecallStop  = AudioCommand(0x05)
	AudioNaviStart      = AudioCommand(0x06)
	AudioNaviStop       = AudioCommand(0x07)
	AudioSiriStart      = AudioCommand(0x08)
	AudioSiriStop       = AudioCommand(0x09)
	AudioMediaStart     = AudioCommand(0x0a)
	AudioMediaStop      = AudioCommand(0x0b)
)
View Source
const (
	TouchDown = TouchAction(14)
	TouchMove = TouchAction(15)
	TouchUp   = TouchAction(16)
)

Variables

View Source
var AudioDecodeTypes = map[DecodeType]AudioFormat{
	0: {0, 0, 0},
	1: {44100, 2, 16},
	2: {48000, 2, 16},
	3: {8000, 1, 16},
	4: {48000, 2, 16},
	5: {16000, 1, 16},
	6: {24000, 1, 16},
	7: {16000, 2, 16},
}

Functions

func GetPayloadByHeader

func GetPayloadByHeader(hdr Header) interface{}

func Marshal

func Marshal(payload interface{}) ([]byte, error)

func Unmarshal

func Unmarshal(data []byte, payload interface{}) error

Types

type AudioCommand

type AudioCommand uint8

func (AudioCommand) GoString

func (c AudioCommand) GoString() string

type AudioData

type AudioData struct {
	DecodeType     DecodeType   `struc:"int32,little"`
	Volume         float32      `struc:"float32,little"`
	AudioType      int32        `struc:"int32,little"`
	Command        AudioCommand `struc:"skip"`
	VolumeDuration int32        `struc:"skip"`
	Data           []byte       `struc:"skip"`
}

type AudioFormat

type AudioFormat struct {
	Frequency, Channel, Bitrate uint16
}

type BluetoothAddress

type BluetoothAddress struct {
	Address NullTermString `struc:"[17]byte"`
}

type BluetoothDeviceName

type BluetoothDeviceName struct {
	Data NullTermString `struc:"skip"`
}

type BluetoothPIN

type BluetoothPIN struct {
	Address NullTermString `struc:"[4]byte"`
}

type BluetoothPairedList

type BluetoothPairedList struct {
	Data NullTermString `struc:"skip"`
}

type CarPlay

type CarPlay struct {
	Type CarPlayType `struc:"int32,little"`
}

type CarPlayType

type CarPlayType uint32

func (CarPlayType) GoString

func (c CarPlayType) GoString() string

type DecodeType

type DecodeType uint32
type Header struct {
	Magic  uint32 `struc:"uint32,little"`
	Length uint32 `struc:"uint32,little"`
	Type   uint32 `struc:"uint32,little"`
	TypeN  uint32 `struc:"uint32,little"`
}

Header is header structure of data protocol

type Heartbeat

type Heartbeat struct {
}

type ManufacturerInfo

type ManufacturerInfo struct {
	A int32 `struc:"int32,little"`
	B int32 `struc:"int32,little"`
}

type MultiTouch

type MultiTouch struct {
}

type NullTermString

type NullTermString string

func (NullTermString) GoString

func (s NullTermString) GoString() string

type Open

type Open struct {
	Width          int32 `struc:"int32,little"`
	Height         int32 `struc:"int32,little"`
	VideoFrameRate int32 `struc:"int32,little"`
	Format         int32 `struc:"int32,little"`
	PacketMax      int32 `struc:"int32,little"`
	IBoxVersion    int32 `struc:"int32,little"`
	PhoneWorkMode  int32 `struc:"int32,little"`
}

type Plugged

type Plugged struct {
	PhoneType int  `struc:"int32,little"`
	Wifi      bool `struc:"skip"`
}

type SendFile

type SendFile struct {
	FileNameSize int32 `struc:"int32,little,sizeof=FileName"`
	FileName     NullTermString
	ContentSize  int32 `struc:"int32,little,sizeof=Content"`
	Content      []byte
}

type SoftwareVersion

type SoftwareVersion struct {
	Version NullTermString `struc:"[32]byte"`
}

type Touch

type Touch struct {
	Action TouchAction `struc:"int32,little"`
	X      uint32      `struc:"uint32,little"`
	Y      uint32      `struc:"uint32,little"`
	Flags  uint32      `struc:"int32,little"`
}

type TouchAction

type TouchAction uint32

type Unknown

type Unknown struct {
	Type uint32 `struc:"skip"`
	Data []byte `struc:"skip"`
}

type Unplugged

type Unplugged struct {
}

type VideoData

type VideoData struct {
	Width    int32  `struc:"int32,little"`
	Height   int32  `struc:"int32,little"`
	Flags    int32  `struc:"int32,little"`
	Length   int32  `struc:"int32,little,sizeof=Data"`
	Unknown2 int32  `struc:"int32,little"`
	Data     []byte `struc:"[]byte"`
}

type WifiDeviceName

type WifiDeviceName struct {
	Data NullTermString `struc:"skip"`
}

Jump to

Keyboard shortcuts

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