You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not too familiar with this library but I saw this question on SO, which highlight an issue in the function
func (c*Cmd) SendAndCheckResp(cpCmdParam, exp []byte) error {
rsp, err:=c.Send(cp)
iferr!=nil {
returnerr
}
// Don't care about the responseiflen(exp) ==0 {
returnnil
}
// Check the if status is one of the expected valueif!bytes.Contains(exp, rsp[0:1]) {
returnfmt.Errorf("HCI command: '0x%04x' return 0x%02X, expect: [%X] ", cp.Opcode(), rsp[0], exp)
}
returnnil
}
when the rsp is empty, or have capacity zero. The problem seems to be when trying to access the first two elements on rsp on line
if!bytes.Contains(exp, rsp[0:1]) {
....
I think this issue could be avoided just checking if len(rsp) == 0, and respond appropriately, but again I'm not familiar with the library so a better solution could be suggested by another person. I just thought is worth to report the issue.
The text was updated successfully, but these errors were encountered:
I'm not too familiar with this library but I saw this question on SO, which highlight an issue in the function
when the rsp is empty, or have capacity zero. The problem seems to be when trying to access the first two elements on rsp on line
I think this issue could be avoided just checking if
len(rsp) == 0
, and respond appropriately, but again I'm not familiar with the library so a better solution could be suggested by another person. I just thought is worth to report the issue.The text was updated successfully, but these errors were encountered: