Commit 3b3c40cd authored by Kevin Seidel's avatar Kevin Seidel
Browse files

Fix typos

parent ec888814
......@@ -12,7 +12,7 @@ type Client interface {
// Profile returns discovered profile.
Profile() *Profile
// DiscoverProfile discovers the whole hierachy of a server.
// DiscoverProfile discovers the whole hierarchy of a server.
DiscoverProfile(force bool) (*Profile, error)
// DiscoverServices finds all the primary services on a server. [Vol 3, Part G, 4.4.1]
......
......@@ -40,7 +40,7 @@ func (cln *Client) Profile() *ble.Profile {
return cln.profile
}
// DiscoverProfile discovers the whole hierachy of a server.
// DiscoverProfile discovers the whole hierarchy of a server.
func (cln *Client) DiscoverProfile(force bool) (*ble.Profile, error) {
if cln.profile != nil && !force {
return cln.profile, nil
......
......@@ -50,7 +50,7 @@ func (e ATTError) Error() string {
case i >= 0xE0 && i <= 0xFF: // Common profile and service error codes.
return "profile or service error"
}
return "unkown error"
return "unknown error"
}
var errName = map[ATTError]string{
......
......@@ -498,7 +498,7 @@ func (c *Client) sendReq(b []byte) (rsp []byte, err error) {
logger.Debug("client", "req", fmt.Sprintf("% X", b))
_, err := c.l2c.Write(errRsp)
if err != nil {
return nil, errors.Wrap(err, "unexpected ATT response recieved")
return nil, errors.Wrap(err, "unexpected ATT response received")
}
case err := <-c.chErr:
return nil, errors.Wrap(err, "ATT request failed")
......
......@@ -18,7 +18,7 @@ type conn struct {
in map[uint16]ble.Notifier
}
// Server implementas an ATT (Attribute Protocol) server.
// Server implements an ATT (Attribute Protocol) server.
type Server struct {
conn *conn
db *DB
......@@ -33,7 +33,7 @@ type Server struct {
dummyRspWriter ble.ResponseWriter
// Store a write handler for defer execute once receving ExecuteWriteRequest
// Store a write handler for defer execute once receiving ExecuteWriteRequest
prepareWriteRequestAttr *attr
prepareWriteRequestData bytes.Buffer
}
......@@ -143,7 +143,7 @@ func (s *Server) Loop() {
select {
case s.chConfirm <- true:
default:
logger.Error("server", "recieved a spurious confirmation", nil)
logger.Error("server", "received a spurious confirmation", nil)
}
continue
}
......
......@@ -59,7 +59,7 @@ func (p *Client) Profile() *ble.Profile {
return p.profile
}
// DiscoverProfile discovers the whole hierachy of a server.
// DiscoverProfile discovers the whole hierarchy of a server.
func (p *Client) DiscoverProfile(force bool) (*ble.Profile, error) {
if p.profile != nil && !force {
return p.profile, nil
......
......@@ -121,7 +121,7 @@ func (c *Conn) Read(sdu []byte) (n int, err error) {
return 0, errors.Wrap(io.ErrClosedPipe, "input channel closed")
}
if len(p) == 0 {
return 0, errors.Wrap(io.ErrUnexpectedEOF, "recieved empty packet")
return 0, errors.Wrap(io.ErrUnexpectedEOF, "received empty packet")
}
// Assume it's a B-Frame.
......@@ -133,7 +133,7 @@ func (c *Conn) Read(sdu []byte) (n int, err error) {
data = leFrameHdr(p).payload()
}
if cap(sdu) < slen {
return 0, errors.Wrapf(io.ErrShortBuffer, "payload recieved exceeds sdu buffer")
return 0, errors.Wrapf(io.ErrShortBuffer, "payload received exceeds sdu buffer")
}
buf := bytes.NewBuffer(sdu)
buf.Reset()
......
......@@ -88,9 +88,9 @@ type HCI struct {
// adHist and adLast track the history of past scannable advertising packets.
// Controller delivers AD(Advertising Data) and SR(Scan Response) separately
// through HCI. Upon recieving an AD, no matter it's scannable or not, we
// pass a Advertisment (AD only) to advHandler immediately.
// Upon recieving a SR, we search the AD history for the AD from the same
// through HCI. Upon receiving an AD, no matter it's scannable or not, we
// pass a Advertisement (AD only) to advHandler immediately.
// Upon receiving a SR, we search the AD history for the AD from the same
// device, and pass the Advertisiement (AD+SR) to advHandler.
// The adHist and adLast are allocated in the Scan().
advHandler ble.AdvHandler
......@@ -381,9 +381,9 @@ func (h *HCI) handleLEAdvertisingReport(b []byte) error {
break
}
}
// Got a SR without having recieved an associated AD before?
// Got a SR without having received an associated AD before?
if a == nil {
return fmt.Errorf("recieved scan response %s with no associated Advertising Data packet", sr.Addr())
return fmt.Errorf("received scan response %s with no associated Advertising Data packet", sr.Addr())
}
default:
a = newAdvertisement(e, i)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment