Documentation ¶
Overview ¶
* * RhinoPi 硬件接口相关管理 * 警告:此处会随着硬件不同而不兼容,要移植的时候记得统一一下目标硬件的端口 *
Index ¶
- func CheckSerialBusy(serialDevice string) error
- func FreeInterfaceBusy(name string)
- func RefreshPort(Port RhinoH3HwPort)
- func SetHwPort(Port RhinoH3HwPort)
- func SetInterfaceBusy(name string, OccupyBy HwPortOccupy)
- type HardwarePort
- type HardwarePortClass
- type HwPortOccupy
- type HwPortsManager
- type RhinoH3HwPort
- type UartConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSerialBusy ¶ added in v0.6.7
检查串口设备是否被系统进程占用
func RefreshPort ¶
func RefreshPort(Port RhinoH3HwPort)
Types ¶
type HardwarePort ¶ added in v0.6.7
type HardwarePort struct { UUID int64 `json:"uuid"` // ID Name string `json:"name"` // 名称 Alias string `json:"alias"` // 别名 Type string `json:"type"` // 类型,主要有 USER、SYSTEM两种 Path string `json:"path"` // 路径 Description string `json:"description"` // 额外信息 }
* * 硬件设备上的端口 *
type HardwarePortClass ¶ added in v0.6.7
type HardwarePortClass struct { Audio HardwarePort `json:"audio"` Can HardwarePort `json:"can"` Di HardwarePort `json:"di"` Do HardwarePort `json:"do"` Hdmi HardwarePort `json:"hdmi"` Ir HardwarePort `json:"ir"` Relay HardwarePort `json:"relay"` Rs232 HardwarePort `json:"rs232"` Rs485 HardwarePort `json:"rs485"` Uart HardwarePort `json:"uart"` Video HardwarePort `json:"video"` }
* * 统一管理不同型号设备的硬件端口 *
type HwPortOccupy ¶
type HwPortsManager ¶
func InitHwPortsManager ¶
func InitHwPortsManager(rulex typex.RuleX) *HwPortsManager
type RhinoH3HwPort ¶
type RhinoH3HwPort struct { UUID string `json:"uuid"` // 接口名称 Name string `json:"name"` // 接口名称 Alias string `json:"alias"` // 别名 Busy bool `json:"busy"` // 运行时数据,是否被占 OccupyBy HwPortOccupy `json:"occupyBy"` // 运行时数据,被谁占用了 UUID Type string `json:"type"` // 接口类型, UART(串口),USB(USB),FD(通用文件句柄) Description string `json:"description"` // 额外备注 Config interface{} `json:"config"` // 配置, 串口配置、或者网卡、USB等 }
func (RhinoH3HwPort) String ¶
func (v RhinoH3HwPort) String() string
Click to show internal directories.
Click to hide internal directories.