Skip to content

Commit

Permalink
fix a return logic in ReadEeprom, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoirier committed Nov 23, 2015
1 parent 6c7188e commit e201649
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rtlsdr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e201649

Please sign in to comment.