Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
forks
ble
Commits
3b3c40cd
Commit
3b3c40cd
authored
Oct 17, 2017
by
Kevin Seidel
Browse files
Fix typos
parent
ec888814
Changes
8
Hide whitespace changes
Inline
Side-by-side
client.go
View file @
3b3c40cd
...
...
@@ -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 hiera
r
chy of a server.
DiscoverProfile
(
force
bool
)
(
*
Profile
,
error
)
// DiscoverServices finds all the primary services on a server. [Vol 3, Part G, 4.4.1]
...
...
darwin/client.go
View file @
3b3c40cd
...
...
@@ -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 hiera
r
chy of a server.
func
(
cln
*
Client
)
DiscoverProfile
(
force
bool
)
(
*
ble
.
Profile
,
error
)
{
if
cln
.
profile
!=
nil
&&
!
force
{
return
cln
.
profile
,
nil
...
...
error.go
View file @
3b3c40cd
...
...
@@ -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
"unk
n
own error"
}
var
errName
=
map
[
ATTError
]
string
{
...
...
linux/att/client.go
View file @
3b3c40cd
...
...
@@ -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 rec
i
eved"
)
return
nil
,
errors
.
Wrap
(
err
,
"unexpected ATT response rece
i
ved"
)
}
case
err
:=
<-
c
.
chErr
:
return
nil
,
errors
.
Wrap
(
err
,
"ATT request failed"
)
...
...
linux/att/server.go
View file @
3b3c40cd
...
...
@@ -18,7 +18,7 @@ type conn struct {
in
map
[
uint16
]
ble
.
Notifier
}
// Server implement
a
s 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 rece
i
ving ExecuteWriteRequest
prepareWriteRequestAttr
*
attr
prepareWriteRequestData
bytes
.
Buffer
}
...
...
@@ -143,7 +143,7 @@ func (s *Server) Loop() {
select
{
case
s
.
chConfirm
<-
true
:
default
:
logger
.
Error
(
"server"
,
"rec
i
eved a spurious confirmation"
,
nil
)
logger
.
Error
(
"server"
,
"rece
i
ved a spurious confirmation"
,
nil
)
}
continue
}
...
...
linux/gatt/client.go
View file @
3b3c40cd
...
...
@@ -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 hiera
r
chy of a server.
func
(
p
*
Client
)
DiscoverProfile
(
force
bool
)
(
*
ble
.
Profile
,
error
)
{
if
p
.
profile
!=
nil
&&
!
force
{
return
p
.
profile
,
nil
...
...
linux/hci/conn.go
View file @
3b3c40cd
...
...
@@ -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
,
"rec
i
eved empty packet"
)
return
0
,
errors
.
Wrap
(
io
.
ErrUnexpectedEOF
,
"rece
i
ved 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 rec
i
eved exceeds sdu buffer"
)
return
0
,
errors
.
Wrapf
(
io
.
ErrShortBuffer
,
"payload rece
i
ved exceeds sdu buffer"
)
}
buf
:=
bytes
.
NewBuffer
(
sdu
)
buf
.
Reset
()
...
...
linux/hci/hci.go
View file @
3b3c40cd
...
...
@@ -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 rec
i
eving an AD, no matter it's scannable or not, we
// pass a Advertisment (AD only) to advHandler immediately.
// Upon rec
i
eving a SR, we search the AD history for the AD from the same
// through HCI. Upon rece
i
ving an AD, no matter it's scannable or not, we
// pass a Advertis
e
ment (AD only) to advHandler immediately.
// Upon rece
i
ving 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 rec
i
eved an associated AD before?
// Got a SR without having rece
i
ved an associated AD before?
if
a
==
nil
{
return
fmt
.
Errorf
(
"rec
i
eved scan response %s with no associated Advertising Data packet"
,
sr
.
Addr
())
return
fmt
.
Errorf
(
"rece
i
ved scan response %s with no associated Advertising Data packet"
,
sr
.
Addr
())
}
default
:
a
=
newAdvertisement
(
e
,
i
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment