mirror of
https://github.com/status-im/keycard-go.git
synced 2025-02-08 01:53:55 +00:00
handle pairing error when no available slots
This commit is contained in:
parent
00dc453676
commit
6b2868bd77
@ -12,6 +12,8 @@ import (
|
|||||||
"github.com/status-im/keycard-go/types"
|
"github.com/status-im/keycard-go/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var ErrNoAvailablePairingSlots = errors.New("no available pairing slots")
|
||||||
|
|
||||||
type CommandSet struct {
|
type CommandSet struct {
|
||||||
c types.Channel
|
c types.Channel
|
||||||
sc *SecureChannel
|
sc *SecureChannel
|
||||||
@ -93,6 +95,10 @@ func (cs *CommandSet) Pair(pairingPass string) error {
|
|||||||
|
|
||||||
cmd := NewCommandPairFirstStep(challenge)
|
cmd := NewCommandPairFirstStep(challenge)
|
||||||
resp, err := cs.c.Send(cmd)
|
resp, err := cs.c.Send(cmd)
|
||||||
|
if resp.Sw == SwNoAvailablePairingSlots {
|
||||||
|
return ErrNoAvailablePairingSlots
|
||||||
|
}
|
||||||
|
|
||||||
if err = cs.checkOK(resp, err); err != nil {
|
if err = cs.checkOK(resp, err); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user