Documentation
¶
Overview ¶
Package coap contains the domain concept definitions needed to support Mainflux CoAP adapter service functionality. All constant values are taken from RFC, and could be adjusted based on specific use case.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOption = errors.New("unable to set option")
ErrOption indicates an error when adding an option.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// In CoAP terminology, Token similar to the Session ID.
Token() string
Handle(subject string, m protomfx.Message) error
Cancel() error
Done() <-chan struct{}
}
Client wraps CoAP client.
type Service ¶
type Service interface {
// Publish Message
Publish(ctx context.Context, key domain.ThingKey, msg protomfx.Message) error
// Subscribe subscribes to profile with specified id, subtopic and adds subscription to
// service map of subscriptions under given ID.
Subscribe(ctx context.Context, key domain.ThingKey, subtopic string, c Client) error
// Unsubscribe method is used to stop observing resource.
Unsubscribe(ctx context.Context, key domain.ThingKey, subtopic, token string) error
// SendCommandToThing publishes a command to the specified thing, authorized by publisher thing key (M2M).
SendCommandToThing(ctx context.Context, key domain.ThingKey, thingID string, msg protomfx.Message) error
// SendCommandToGroup publishes a command to a group, authorized by publisher thing key (M2M).
SendCommandToGroup(ctx context.Context, key domain.ThingKey, groupID string, msg protomfx.Message) error
}
Service specifies CoAP service API.
Click to show internal directories.
Click to hide internal directories.