Example #1
0
File: device.go Project: harikb/nfc
// Close an NFC device.
func (d Device) Close() error {
	if *d.d == nil {
		// closing a closed device is a nop
		return nil
	}

	*d.d = nil
	C.nfc_close(*d.d)

	return nil
}
Example #2
0
File: device.go Project: harikb/nfc
// Close an NFC device.
func (d *Device) Close() error {
	if d.d == nil {
		// closing a closed device is a nop
		return nil
	}

	C.nfc_close(d.d)
	d.d = nil

	return nil
}