示例#1
0
文件: udev.go 项目: jessta/udev
func DeviceFromDevNum(u Udev, t DeviceType, num DevNum) Device {
	return Device{C.udev_device_new_from_devnum(u.ptr, C.char(t), C.dev_t(num))}
}
示例#2
0
文件: udev.go 项目: jochenvg/go-udev
// NewDeviceFromDevnum returns a pointer to a new device identified by its Devnum, and nil on error
// deviceType is 'c' for a character device and 'b' for a block device
func (u *Udev) NewDeviceFromDevnum(deviceType uint8, n Devnum) *Device {
	u.lock()
	defer u.unlock()
	return u.newDevice(C.udev_device_new_from_devnum(u.ptr, C.char(deviceType), n.d))
}