示例#1
0
文件: usb.go 项目: thequux/gousb
// Can be called to shut down. Probably not required
func (ctx *Context) destroy() {
	if ctx.initialized {
		ctx.initialized = false
		C.libusb_exit(ctx.ctx)
		ctx.ctx = nil
	}
}
示例#2
0
文件: usb.go 项目: gonium/goairsensor
func (c *Context) Close() error {
	close(c.done)
	if c.ctx != nil {
		C.libusb_exit(c.ctx)
	}
	c.ctx = nil
	return nil
}
示例#3
0
文件: usb.go 项目: nkovacs/gousb
func (c *Context) Close() error {
	close(c.done)
	if c.ctx != nil {
		C.libusb_exit(c.ctx)
		c.cleanupCallbacks()
	}
	c.ctx = nil
	return nil
}
示例#4
0
func End(handle *C.struct_libusb_device_handle) {

	log.Print("Libusb goroutine exiting\n")

	C.libusb_release_interface(handle, 0)
	C.libusb_release_interface(handle, 1)
	C.libusb_attach_kernel_driver(handle, 0)
	C.libusb_attach_kernel_driver(handle, 1)
	C.libusb_exit(nil)

	log.Print("Libusb goroutine exited\n")
}
示例#5
0
文件: new.go 项目: acsellers/Go510
func main() {
	runtime.LockOSThread()
	rand.Seed(int64(time.Now().UnixNano()))
	C.libusb_init(nil)

	StartLibUsb()

	clr := color.RGBA{0xff, 0, 0, 0}
	SetColor(clr)
	EndLibUsb()

	go StartClock()
	signals := make(chan os.Signal)
	signal.Notify(signals)
	<-signals

	C.libusb_exit(nil)
}
示例#6
0
文件: usb.go 项目: hanwen/usb
func (c *Context) Exit() {
	C.libusb_exit(c.me())
}
示例#7
0
文件: usb.go 项目: karitra/mp707
func DesposeLib() {
	C.libusb_exit(nil)
}