From e2016492fe4552791e6d6e51682f56ffb4d8a828 Mon Sep 17 00:00:00 2001 From: Joseph Poirier Date: Mon, 23 Nov 2015 01:04:58 -0600 Subject: [PATCH] fix a return logic in ReadEeprom, bump version --- rtlsdr.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rtlsdr.go b/rtlsdr.go index f2123f1..b3f7320 100644 --- a/rtlsdr.go +++ b/rtlsdr.go @@ -34,7 +34,7 @@ static inline rtlsdr_read_async_cb_t get_go_cb() { import "C" // Current version. -var PackageVersion = "v2.9.9" +var PackageVersion = "v2.9.10" // ReadAsyncCbT defines a user callback function type. type ReadAsyncCbT func([]byte) @@ -292,15 +292,15 @@ func (dev *Context) ReadEeprom(data []uint8, offset uint8, leng uint16) (err err C.uint8_t(offset), C.uint16_t(leng))) switch { - case i == 0: - return + default: + err = nil case i == -1: err = errors.New("device handle is invalid") case i == -2: err = errors.New("EEPROM size exceeded") case i == -3: err = errors.New("no EEPROM was found") - default: + case i < -4: err = errors.New("unknown error") } return