Skip to content

Commit 2ac42e5

Browse files
committed
sd+hci: stub removing service method
1 parent 39f30a5 commit 2ac42e5

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

gatts_hci.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
package bluetooth
44

5+
import "errors"
6+
57
type Characteristic struct {
68
adapter *Adapter
79
handle uint16
@@ -79,6 +81,11 @@ func (a *Adapter) AddService(service *Service) error {
7981
return nil
8082
}
8183

84+
// RemoveService removes a previously added service.
85+
func (a *Adapter) RemoveService(s *Service) error {
86+
return errors.ErrUnsupported
87+
}
88+
8289
// Write replaces the characteristic value with a new value.
8390
func (c *Characteristic) Write(p []byte) (n int, err error) {
8491
if !(c.permissions.Write() || c.permissions.WriteWithoutResponse() ||

gatts_sd.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ static inline uint32_t sd_ble_gatts_value_set_noescape(uint16_t conn_handle, uin
2222
}
2323
*/
2424
import "C"
25-
import "unsafe"
25+
import (
26+
"errors"
27+
"unsafe"
28+
)
2629

2730
// Characteristic is a single characteristic in a service. It has an UUID and a
2831
// value.
@@ -91,6 +94,11 @@ func (a *Adapter) AddService(service *Service) error {
9194
return makeError(errCode)
9295
}
9396

97+
// RemoveService removes a service previously added with AddService.
98+
func (a *Adapter) RemoveService(s *Service) error {
99+
return errors.ErrUnsupported
100+
}
101+
94102
// charWriteHandler contains a handler->callback mapping for characteristic
95103
// writes.
96104
type charWriteHandler struct {

0 commit comments

Comments
 (0)