示例#1
0
文件: device.go 项目: qmsk/onewire
func (self *Device) fromUdev(ptr *C.struct_udev_device) error {
	self.DevPath = C.GoString(C.udev_device_get_devpath(ptr))
	self.Subsystem = C.GoString(C.udev_device_get_subsystem(ptr))
	self.DevType = C.GoString(C.udev_device_get_devtype(ptr))
	self.SysPath = C.GoString(C.udev_device_get_syspath(ptr))
	self.SysName = C.GoString(C.udev_device_get_sysname(ptr))
	self.SysNum = C.GoString(C.udev_device_get_sysnum(ptr))
	self.DevNode = C.GoString(C.udev_device_get_devnode(ptr))

	return nil
}
示例#2
0
文件: udev.go 项目: jessta/udev
func (d Device) Subsystem() string {
	return C.GoString(C.udev_device_get_subsystem(d.ptr))
}
示例#3
0
// Subsystem returns the subsystem string of the udev device.
// The string does not contain any "/".
func (d *Device) Subsystem() string {
	d.lock()
	defer d.unlock()
	return C.GoString(C.udev_device_get_subsystem(d.ptr))
}