// 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 } }
func (c *Context) Close() error { close(c.done) if c.ctx != nil { C.libusb_exit(c.ctx) } c.ctx = nil return nil }
func (c *Context) Close() error { close(c.done) if c.ctx != nil { C.libusb_exit(c.ctx) c.cleanupCallbacks() } c.ctx = nil return nil }
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") }
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) }
func (c *Context) Exit() { C.libusb_exit(c.me()) }
func DesposeLib() { C.libusb_exit(nil) }