Documentation ¶
Index ¶
- Constants
- Variables
- func GetPayloadByHeader(hdr Header) interface{}
- func Marshal(payload interface{}) ([]byte, error)
- func Unmarshal(data []byte, payload interface{}) error
- type AudioCommand
- type AudioData
- type AudioFormat
- type BluetoothAddress
- type BluetoothDeviceName
- type BluetoothPIN
- type BluetoothPairedList
- type CarPlay
- type CarPlayType
- type DecodeType
- type Header
- type Heartbeat
- type ManufacturerInfo
- type MultiTouch
- type NullTermString
- type Open
- type Plugged
- type SendFile
- type SoftwareVersion
- type Touch
- type TouchAction
- type Unknown
- type Unplugged
- type VideoData
- type WifiDeviceName
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) 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{}
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 ¶
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 ManufacturerInfo ¶
type MultiTouch ¶
type MultiTouch struct { }
type NullTermString ¶
type NullTermString string
func (NullTermString) GoString ¶
func (s NullTermString) GoString() string
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 WifiDeviceName ¶
type WifiDeviceName struct {
Data NullTermString `struc:"skip"`
}
Click to show internal directories.
Click to hide internal directories.