Update ds248x.go

pull/13/head
Audrius Paskevicius 5 years ago committed by GitHub
parent 622d9c519b
commit 53ce1fe535
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -161,7 +161,13 @@ func (d *Dev) Search(alarmOnly bool) ([]onewire.Address, error) {
return onewire.Search(d, alarmOnly) return onewire.Search(d, alarmOnly)
} }
// ChannelSelect ... // ChannelSelect function is for selecting one of eight 1-w channels on DS2482-800.
// On other chips it does nothing. Function silently limits channel selection between
// 0 and 7. It is expected that application keeps track of
// with 1-w device is connected to with channel.
//
// Communication error is returned if present.
//
func (d *Dev) ChannelSelect(ch int) (err error) { func (d *Dev) ChannelSelect(ch int) (err error) {
switch d.isDS248x { switch d.isDS248x {
case isDS2482x100: case isDS2482x100:
@ -186,8 +192,12 @@ func (d *Dev) ChannelSelect(ch int) (err error) {
return return
} }
// SelectedChannel ... // SelectedChannel function is to read with 1-w channel selected on DS2482-800.
// On other chips it always returns 0. It is expected that application keeps track of
// with 1-w device is connected to with channel.
//
// On error returns 255. // On error returns 255.
//
func (d *Dev) SelectedChannel() (ch int) { func (d *Dev) SelectedChannel() (ch int) {
ch = 0 ch = 0
switch d.isDS248x { switch d.isDS248x {
@ -422,3 +432,4 @@ const (
isDS2483 = 2 isDS2483 = 2
) )

Loading…
Cancel
Save