Commit 9898fb04 authored by Kevin Seidel's avatar Kevin Seidel
Browse files

More linting...

parent bb20df5f
# bt
# ble
--
[![GoDoc](https://godoc.org/github.com/go-ble/ble?status.svg)](https://godoc.org/github.com/go-ble/ble)
[![Go Report Card](https://goreportcard.com/badge/go-ble/ble)](https://goreportcard.com/report/go-ble/ble)
[![codebeat badge](https://codebeat.co/badges/ba9fae6e-77d2-4173-8587-36ac8756676b)](https://codebeat.co/projects/github-com-go-ble-ble-master)
**ble** is a [Bluetooth Low Energy](https://en.wikipedia.org/wiki/Bluetooth_Low_Energy) package for Linux and macOS.
bt is a Bluetooth library for Go; its API is still under active development, and may change without warning.
package ble
// ContextKey is a type used for keys of a context
type ContextKey string
var (
// ContextKeySig for SigHandler context
ContextKeySig = ContextKey("sig")
// ContextKeyCCC for per connection contexts
ContextKeyCCC = ContextKey("ccc")
)
......@@ -47,17 +47,17 @@ func (cln *Client) DiscoverProfile(force bool) (*ble.Profile, error) {
}
ss, err := cln.DiscoverServices(nil)
if err != nil {
return nil, fmt.Errorf("can't discover services: %s\n", err)
return nil, fmt.Errorf("can't discover services: %s", err)
}
for _, s := range ss {
cs, err := cln.DiscoverCharacteristics(nil, s)
if err != nil {
return nil, fmt.Errorf("can't discover characteristics: %s\n", err)
return nil, fmt.Errorf("can't discover characteristics: %s", err)
}
for _, c := range cs {
_, err := cln.DiscoverDescriptors(nil, c)
if err != nil {
return nil, fmt.Errorf("can't discover descriptors: %s\n", err)
return nil, fmt.Errorf("can't discover descriptors: %s", err)
}
}
}
......
......@@ -66,17 +66,17 @@ func (p *Client) DiscoverProfile(force bool) (*ble.Profile, error) {
}
ss, err := p.DiscoverServices(nil)
if err != nil {
return nil, fmt.Errorf("can't discover services: %s\n", err)
return nil, fmt.Errorf("can't discover services: %s", err)
}
for _, s := range ss {
cs, err := p.DiscoverCharacteristics(nil, s)
if err != nil {
return nil, fmt.Errorf("can't discover characteristics: %s\n", err)
return nil, fmt.Errorf("can't discover characteristics: %s", err)
}
for _, c := range cs {
_, err := p.DiscoverDescriptors(nil, c)
if err != nil {
return nil, fmt.Errorf("can't discover descriptors: %s\n", err)
return nil, fmt.Errorf("can't discover descriptors: %s", err)
}
}
}
......
......@@ -8,7 +8,7 @@ import (
"github.com/go-ble/ble/linux/att"
)
// NewServer ...
// NewServerWithName creates a new Server with the specified name
func NewServerWithName(name string) (*Server, error) {
return &Server{
name: name,
......
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