// SetServices ... func (s *Server) SetServices(svcs []*ble.Service) error { s.Lock() defer s.Unlock() s.svcs = append(defaultServices("Gopher"), svcs...) s.db = att.NewDB(s.svcs, uint16(1)) // ble attrs start at 1 return nil }
// AddService ... func (s *Server) AddService(svc *ble.Service) error { s.Lock() defer s.Unlock() s.svcs = append(s.svcs, svc) s.db = att.NewDB(s.svcs, uint16(1)) // ble attrs start at 1 return nil }
// RemoveAllServices ... func (s *Server) RemoveAllServices() error { s.Lock() defer s.Unlock() s.svcs = defaultServices("Gopher") s.db = att.NewDB(s.svcs, uint16(1)) // ble attrs start at 1 return nil }
// NewServer ... func NewServer() (*Server, error) { return &Server{ svcs: defaultServices("Gopher"), db: att.NewDB(defaultServices("Gopher"), uint16(1)), }, nil }