Documentation ¶
Index ¶
- func GenerateSDKIdentityCertificate(ctx context.Context, sign SignFunc, sdkDeviceID string) (tls.Certificate, []*x509.Certificate, error)
- func GenerateSDKManufacturerCertificate(ctx context.Context, sign SignFunc, id string) (tls.Certificate, []*x509.Certificate, error)
- func NewDeviceOwnershipBackendFromConfig(app ApplicationCallback, dialTLS core.DialTLS, dialDTLS core.DialDTLS, ...) (*deviceOwnershipBackend, error)
- func NewDeviceOwnershipNone() *deviceOwnershipNone
- func NewDeviceOwnershipSDK(app ApplicationCallback, sdkDeviceID string, dialTLS core.DialTLS, ...) (*deviceOwnershipSDK, error)
- func NewDeviceOwnershipSDKFromConfig(app ApplicationCallback, dialTLS core.DialTLS, dialDLTS core.DialDTLS, ...) (*deviceOwnershipSDK, error)
- func TokenFromOutgoingMD(ctx context.Context) (string, error)
- type ApplicationCallback
- type Client
- func (c *Client) Close(ctx context.Context) error
- func (c *Client) CoreClient() *core.Client
- func (c *Client) CreateResource(ctx context.Context, deviceID string, href string, request interface{}, ...) error
- func (c *Client) DeleteDevice(ctx context.Context, deviceID string) bool
- func (c *Client) DeleteDevices(ctx context.Context, deviceIDFilter []string) []string
- func (c *Client) DeleteResource(ctx context.Context, deviceID string, href string, response interface{}, ...) error
- func (c *Client) DisownDevice(ctx context.Context, deviceID string, opts ...CommonCommandOption) error
- func (c *Client) FactoryReset(ctx context.Context, deviceID string, opts ...CommonCommandOption) error
- func (c *Client) GetAllDeviceIDsFoundByIP() map[string]string
- func (c *Client) GetDevice(ctx context.Context, deviceID string, opts ...GetDeviceOption) (*core.Device, schema.ResourceLinks, error)
- func (c *Client) GetDeviceByIP(ctx context.Context, ip string, opts ...GetDeviceByIPOption) (DeviceDetails, error)
- func (c *Client) GetDeviceByIPWithLinks(ctx context.Context, ip string) (*core.Device, schema.ResourceLinks, error)
- func (c *Client) GetDeviceByMulticast(ctx context.Context, deviceID string, opts ...GetDeviceOption) (DeviceDetails, error)
- func (c *Client) GetDevices(ctx context.Context, opts ...GetDevicesOption) (map[string]DeviceDetails, error)
- func (c *Client) GetDevicesWithHandler(ctx context.Context, handler core.DeviceHandlerV2, ...) error
- func (c *Client) GetIdentityCACerts() ([]*x509.Certificate, error)
- func (c *Client) GetIdentityCertificate() (tls.Certificate, error)
- func (c *Client) GetRefDevice(ctx context.Context, deviceID string, opts ...GetDeviceOption) (*RefDevice, schema.ResourceLinks, error)
- func (c *Client) GetRefDeviceByIP(ctx context.Context, ip string) (*RefDevice, schema.ResourceLinks, error)
- func (c *Client) GetResource(ctx context.Context, deviceID string, href string, response interface{}, ...) error
- func (c *Client) Initialization(ctx context.Context) (err error)
- func (c *Client) ObserveDeviceResources(ctx context.Context, deviceID string, ...) (string, error)
- func (c *Client) ObserveDevices(ctx context.Context, handler DevicesObservationHandler, ...) (string, error)
- func (c *Client) ObserveResource(ctx context.Context, deviceID string, href string, ...) (observationID string, _ error)
- func (c *Client) OffboardDevice(ctx context.Context, deviceID string, opts ...CommonCommandOption) error
- func (c *Client) OnboardDevice(ctx context.Context, ...) error
- func (c *Client) OwnDevice(ctx context.Context, deviceID string, opts ...OwnOption) (string, error)
- func (c *Client) Reboot(ctx context.Context, deviceID string, opts ...CommonCommandOption) error
- func (c *Client) StopObservingDeviceResources(ctx context.Context, observationID string) (bool, error)
- func (c *Client) StopObservingDevices(ctx context.Context, observationID string) bool
- func (c *Client) StopObservingResource(ctx context.Context, observationID string) (bool, error)
- func (c *Client) UpdateResource(ctx context.Context, deviceID string, href string, request interface{}, ...) error
- type CodecOption
- type CommonCommandOption
- type Config
- type CreateOption
- type DeleteOption
- type DeviceCache
- func (c *DeviceCache) Close(ctx context.Context) error
- func (c *DeviceCache) GetDevice(deviceID string) (*core.Device, bool)
- func (c *DeviceCache) GetDeviceByFoundIP(ip string) *core.Device
- func (c *DeviceCache) GetDeviceExpiration(deviceID string) (time.Time, bool)
- func (c *DeviceCache) GetDevicesFoundByIP() map[string]string
- func (c *DeviceCache) LoadAndDeleteDevice(deviceID string) (*core.Device, bool)
- func (c *DeviceCache) LoadAndDeleteDevices(deviceIDFilter []string) []*core.Device
- func (c *DeviceCache) TryToChangeDeviceExpirationToDefault(deviceID string) bool
- func (c *DeviceCache) UpdateOrStoreDevice(device *core.Device) (*core.Device, bool)
- func (c *DeviceCache) UpdateOrStoreDeviceWithExpiration(device *core.Device) (*core.Device, bool)
- type DeviceDetails
- type DeviceOwner
- type DeviceOwnershipBackendConfig
- type DeviceOwnershipSDKConfig
- type DeviceResourcesObservationEvent
- type DeviceResourcesObservationEvent_type
- type DeviceResourcesObservationHandler
- type DevicesObservationEvent
- type DevicesObservationEvent_type
- type DevicesObservationHandler
- type DiscoveryConfigurationOption
- type ErrorOption
- type GetDetailsFunc
- type GetDetailsOption
- type GetDeviceByIPOption
- type GetDeviceOption
- type GetDevicesOption
- type GetDevicesWithHandlerOption
- type GetOption
- type OTMType
- type ObserveDevicesOption
- type ObserveOption
- type OwnOption
- type OwnershipStatus
- type RefDevicedeprecated
- func (d *RefDevice) Acquire()
- func (d *RefDevice) DeleteResourceWithCodec(ctx context.Context, link schema.ResourceLink, codec coap.Codec, ...) error
- func (d *RefDevice) Device() *core.Device
- func (d *RefDevice) DeviceID() string
- func (d *RefDevice) Disown(ctx context.Context, links schema.ResourceLinks) error
- func (d *RefDevice) FactoryReset(ctx context.Context, links schema.ResourceLinks) error
- func (d *RefDevice) GetDeviceDetails(ctx context.Context, links schema.ResourceLinks, getDetails GetDetailsFunc) (out DeviceDetails, _ error)
- func (d *RefDevice) GetEndpoints() []schema.Endpoint
- func (d *RefDevice) GetOwnership(ctx context.Context, links schema.ResourceLinks) (doxm.Doxm, error)
- func (d *RefDevice) GetResourceLinks(ctx context.Context, endpoints []schema.Endpoint, options ...coap.OptionFunc) (schema.ResourceLinks, error)
- func (d *RefDevice) GetResourceWithCodec(ctx context.Context, link schema.ResourceLink, codec coap.Codec, ...) error
- func (d *RefDevice) IsSecured() bool
- func (d *RefDevice) ObserveResource(ctx context.Context, link schema.ResourceLink, handler core.ObservationHandler, ...) (observationID string, _ error)
- func (d *RefDevice) ObserveResourceWithCodec(ctx context.Context, link schema.ResourceLink, codec coap.Codec, ...) (observationID string, _ error)
- func (d *RefDevice) Own(ctx context.Context, links schema.ResourceLinks, otmClient []otm.Client, ...) error
- func (d *RefDevice) Provision(ctx context.Context, links schema.ResourceLinks) (*core.ProvisioningClient, error)
- func (d *RefDevice) Reboot(ctx context.Context, links schema.ResourceLinks) error
- func (d *RefDevice) Release(ctx context.Context) error
- func (d *RefDevice) StopObservingResource(ctx context.Context, observationID string) (bool, error)
- func (d *RefDevice) UpdateResource(ctx context.Context, link schema.ResourceLink, request interface{}, ...) error
- func (d *RefDevice) UpdateResourceWithCodec(ctx context.Context, link schema.ResourceLink, codec coap.Codec, ...) error
- type ResourceInterfaceOption
- type ResourceTypesOption
- type SignFunc
- type Signer
- type UpdateOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSDKIdentityCertificate ¶
func GenerateSDKIdentityCertificate(ctx context.Context, sign SignFunc, sdkDeviceID string) (tls.Certificate, []*x509.Certificate, error)
func GenerateSDKManufacturerCertificate ¶
func GenerateSDKManufacturerCertificate(ctx context.Context, sign SignFunc, id string) (tls.Certificate, []*x509.Certificate, error)
func NewDeviceOwnershipBackendFromConfig ¶
func NewDeviceOwnershipBackendFromConfig(app ApplicationCallback, dialTLS core.DialTLS, dialDTLS core.DialDTLS, cfg *DeviceOwnershipBackendConfig, errorsFunc func(err error), ) (*deviceOwnershipBackend, error)
func NewDeviceOwnershipNone ¶
func NewDeviceOwnershipNone() *deviceOwnershipNone
func NewDeviceOwnershipSDK ¶
func NewDeviceOwnershipSDK(app ApplicationCallback, sdkDeviceID string, dialTLS core.DialTLS, dialDTLS core.DialDTLS, signerCert *tls.Certificate, validFrom string, certExpiry time.Duration, createSigner func(caCert []*x509.Certificate, caKey crypto.PrivateKey, validNotBefore time.Time, validNotAfter time.Time) core.CertificateSigner, ) (*deviceOwnershipSDK, error)
func NewDeviceOwnershipSDKFromConfig ¶
func NewDeviceOwnershipSDKFromConfig(app ApplicationCallback, dialTLS core.DialTLS, dialDLTS core.DialDTLS, cfg *DeviceOwnershipSDKConfig, ) (*deviceOwnershipSDK, error)
Types ¶
type ApplicationCallback ¶
type ApplicationCallback = interface { GetRootCertificateAuthorities() ([]*x509.Certificate, error) GetManufacturerCertificateAuthorities() ([]*x509.Certificate, error) GetManufacturerCertificate() (tls.Certificate, error) }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client uses the underlying OCF local client.
func NewClient ¶
func NewClient( app ApplicationCallback, deviceOwner DeviceOwner, cacheExpiration time.Duration, observerPollingInterval time.Duration, errors func(error), opt ...core.OptionFunc, ) (*Client, error)
NewClient constructs a new local client.
func NewClientFromConfig ¶
func NewClientFromConfig(cfg *Config, app ApplicationCallback, errors func(error)) (*Client, error)
NewClientFromConfig constructs a new local client from the proto configuration.
func (*Client) CoreClient ¶
func (*Client) CreateResource ¶
func (*Client) DeleteDevice ¶ added in v1.3.0
func (*Client) DeleteDevices ¶ added in v1.3.2
DeleteDevices deletes a device from the cache. If deviceIDFilter is empty, all devices are deleted.
func (*Client) DeleteResource ¶
func (*Client) DisownDevice ¶
func (c *Client) DisownDevice(ctx context.Context, deviceID string, opts ...CommonCommandOption) error
DisownDevice disowns a device. For unsecure device it calls factory reset. For secure device it disowns.
func (*Client) FactoryReset ¶
func (*Client) GetAllDeviceIDsFoundByIP ¶ added in v1.3.0
func (*Client) GetDevice ¶ added in v1.3.0
func (c *Client) GetDevice(ctx context.Context, deviceID string, opts ...GetDeviceOption, ) (*core.Device, schema.ResourceLinks, error)
GetDevice gets the device via multicast.
func (*Client) GetDeviceByIP ¶
func (c *Client) GetDeviceByIP(ctx context.Context, ip string, opts ...GetDeviceByIPOption) (DeviceDetails, error)
GetDeviceByIP gets the device directly via IP address and multicast listen port 5683.
func (*Client) GetDeviceByIPWithLinks ¶ added in v1.3.0
func (c *Client) GetDeviceByIPWithLinks( ctx context.Context, ip string, ) (*core.Device, schema.ResourceLinks, error)
GetDeviceByIP gets the device directly via IP address and multicast listen port 5683.
func (*Client) GetDeviceByMulticast ¶
func (c *Client) GetDeviceByMulticast(ctx context.Context, deviceID string, opts ...GetDeviceOption) (DeviceDetails, error)
func (*Client) GetDevices ¶
func (c *Client) GetDevices( ctx context.Context, opts ...GetDevicesOption, ) (map[string]DeviceDetails, error)
GetDevices discovers devices in the local mode. The deviceResourceType is applied on the client side, because len(deviceResourceType) > 1 does not work with Iotivity 1.3.
func (*Client) GetDevicesWithHandler ¶
func (c *Client) GetDevicesWithHandler(ctx context.Context, handler core.DeviceHandlerV2, opts ...GetDevicesWithHandlerOption) error
GetDevicesWithHandler discovers devices using a CoAP multicast request via UDP. Device resources can be queried in DeviceHandler using device.Client,
func (*Client) GetIdentityCACerts ¶
func (c *Client) GetIdentityCACerts() ([]*x509.Certificate, error)
func (*Client) GetIdentityCertificate ¶
func (c *Client) GetIdentityCertificate() (tls.Certificate, error)
GetIdentityCertificate returns certificate for connection
func (*Client) GetRefDevice ¶
func (c *Client) GetRefDevice( ctx context.Context, deviceID string, opts ...GetDeviceOption, ) (*RefDevice, schema.ResourceLinks, error)
GetRefDevice returns device, after using call device.Release to free resources. Deprecated: use GetDevice instead
func (*Client) GetRefDeviceByIP ¶
func (c *Client) GetRefDeviceByIP( ctx context.Context, ip string, ) (*RefDevice, schema.ResourceLinks, error)
GetRefDeviceByIP gets the device directly via IP address and multicast listen port 5683. After using it, call device.Release to free resources. Deprecated: use GetDeviceByIPWithLinks instead
func (*Client) GetResource ¶
func (*Client) ObserveDeviceResources ¶
func (*Client) ObserveDevices ¶
func (c *Client) ObserveDevices(ctx context.Context, handler DevicesObservationHandler, opts ...ObserveDevicesOption) (string, error)
func (*Client) ObserveResource ¶
func (c *Client) ObserveResource( ctx context.Context, deviceID string, href string, handler core.ObservationHandler, opts ...ObserveOption, ) (observationID string, _ error)
func (*Client) OffboardDevice ¶
func (*Client) OnboardDevice ¶
func (*Client) StopObservingDeviceResources ¶
func (*Client) StopObservingDevices ¶
func (*Client) StopObservingResource ¶
func (*Client) UpdateResource ¶
type CodecOption ¶
type CodecOption struct {
// contains filtered or unexported fields
}
func WithCodec ¶
func WithCodec(codec coap.Codec) CodecOption
type CommonCommandOption ¶ added in v1.1.0
type CommonCommandOption = interface {
// contains filtered or unexported methods
}
CommonCommandOption option definition.
type Config ¶
type Config struct { DeviceCacheExpirationSeconds int64 ObserverPollingIntervalSeconds uint64 // 0 means 3 seconds KeepAliveConnectionTimeoutSeconds uint64 // 0 means keepalive is disabled MaxMessageSize uint32 DisablePeerTCPSignalMessageCSMs bool DefaultTransferDurationSeconds uint64 // 0 means 15 seconds // specify one of: DeviceOwnershipSDK *DeviceOwnershipSDKConfig `yaml:",omitempty"` DeviceOwnershipBackend *DeviceOwnershipBackendConfig `yaml:",omitempty"` }
type CreateOption ¶
type CreateOption = interface {
// contains filtered or unexported methods
}
CreateOption option definition.
type DeleteOption ¶
type DeleteOption = interface {
// contains filtered or unexported methods
}
UpdateOption option definition.
type DeviceCache ¶ added in v1.3.0
type DeviceCache struct {
// contains filtered or unexported fields
}
func NewDeviceCache ¶ added in v1.3.0
func NewDeviceCache(deviceExpiration, pollInterval time.Duration, errors func(error)) *DeviceCache
Creates a new cache for devices. - deviceExpiration: default expiration time for the device in the cache, 0 means infinite. The device expiration is refreshed by getting or updating the device. - pollInterval: pool interval for cleaning expired devices from the cache - errors: function for logging errors
func (*DeviceCache) GetDevice ¶ added in v1.3.0
func (c *DeviceCache) GetDevice(deviceID string) (*core.Device, bool)
func (*DeviceCache) GetDeviceByFoundIP ¶ added in v1.3.0
func (c *DeviceCache) GetDeviceByFoundIP(ip string) *core.Device
func (*DeviceCache) GetDeviceExpiration ¶ added in v1.3.0
func (c *DeviceCache) GetDeviceExpiration(deviceID string) (time.Time, bool)
func (*DeviceCache) GetDevicesFoundByIP ¶ added in v1.3.0
func (c *DeviceCache) GetDevicesFoundByIP() map[string]string
func (*DeviceCache) LoadAndDeleteDevice ¶ added in v1.3.0
func (c *DeviceCache) LoadAndDeleteDevice(deviceID string) (*core.Device, bool)
This function loads the device from the cache and deletes it from the cache. To cleanup the device you have to call device.Close.
func (*DeviceCache) LoadAndDeleteDevices ¶ added in v1.3.2
func (c *DeviceCache) LoadAndDeleteDevices(deviceIDFilter []string) []*core.Device
func (*DeviceCache) TryToChangeDeviceExpirationToDefault ¶ added in v1.3.0
func (c *DeviceCache) TryToChangeDeviceExpirationToDefault(deviceID string) bool
Try to change the expiration time for the device in cache to default expiration.
func (*DeviceCache) UpdateOrStoreDevice ¶ added in v1.3.0
This function stores the device without timeout into the cache. The device can be removed from the cache only by invoking LoadAndDeleteDevice function and device.Close to cleanup connections. If a device with the same deviceID is already in the cache, the previous reference will be updated in the cache and it's expiration time will be set to infinite.
func (*DeviceCache) UpdateOrStoreDeviceWithExpiration ¶ added in v1.3.0
This function stores the device with the default timeout into the cache. If a device with the same deviceID is already in the cache the device will be updated and the expiration time will be reset only when the device has it set.
type DeviceDetails ¶
type DeviceDetails struct { // ID of the device ID string // IP used to find this device FoundByIP string // Details result of function which can be set via option WithGetDetails(), by default it is nil. Details interface{} // IsSecured is secured. IsSecured bool // Ownership describes ownership of the device, for unsecure device it is nil. Ownership *doxm.Doxm // Resources list of the device resources. Resources []schema.ResourceLink // Resources list of the device endpoints. Endpoints []schema.Endpoint // Ownership status OwnershipStatus OwnershipStatus }
DeviceDetails describes a device.
type DeviceOwner ¶
type DeviceOwner interface { Initialization(ctx context.Context) error OwnDevice(ctx context.Context, deviceID string, otmTypes []OTMType, discoveryConfiguration core.DiscoveryConfiguration, own ownFunc, opts ...core.OwnOption) (string, error) GetIdentityCertificate() (tls.Certificate, error) GetIdentityCACerts() ([]*x509.Certificate, error) }
func NewDeviceOwnerFromConfig ¶
func NewDeviceOwnerFromConfig(cfg *Config, dialTLS core.DialTLS, dialDTLS core.DialDTLS, app ApplicationCallback, errors func(error)) (DeviceOwner, error)
type DeviceOwnershipSDKConfig ¶
type DeviceOwnershipSDKConfig struct { ID string Cert string CertKey string ValidFrom string // RFC3339, or now-1m, empty means now-1m CertExpiry *string CreateSignerFunc func(caCert []*x509.Certificate, caKey crypto.PrivateKey, validNotBefore time.Time, validNotAfter time.Time) core.CertificateSigner }
type DeviceResourcesObservationEvent ¶
type DeviceResourcesObservationEvent struct { Link schema.ResourceLink Event DeviceResourcesObservationEvent_type }
type DeviceResourcesObservationEvent_type ¶
type DeviceResourcesObservationEvent_type uint8
const ( DeviceResourcesObservationEvent_ADDED DeviceResourcesObservationEvent_type = 0 DeviceResourcesObservationEvent_REMOVED DeviceResourcesObservationEvent_type = 1 )
type DeviceResourcesObservationHandler ¶
type DeviceResourcesObservationHandler = interface { Handle(ctx context.Context, event DeviceResourcesObservationEvent) error OnClose() Error(err error) }
type DevicesObservationEvent ¶
type DevicesObservationEvent struct { DeviceID string Event DevicesObservationEvent_type }
type DevicesObservationEvent_type ¶
type DevicesObservationEvent_type uint8
const ( DevicesObservationEvent_ONLINE DevicesObservationEvent_type = 0 DevicesObservationEvent_OFFLINE DevicesObservationEvent_type = 1 )
type DevicesObservationHandler ¶
type DevicesObservationHandler = interface { Handle(ctx context.Context, event DevicesObservationEvent) error OnClose() Error(err error) }
type DiscoveryConfigurationOption ¶ added in v1.1.0
type DiscoveryConfigurationOption struct {
// contains filtered or unexported fields
}
func WithDiscoveryConfiguration ¶ added in v1.1.0
func WithDiscoveryConfiguration(cfg core.DiscoveryConfiguration) DiscoveryConfigurationOption
WithDiscoveryConfiguration allows to setup multicast request. By default it is send to ipv4 and ipv6.
type ErrorOption ¶
type ErrorOption struct {
// contains filtered or unexported fields
}
func WithError ¶
func WithError(err func(error)) ErrorOption
type GetDetailsFunc ¶
type GetDetailsOption ¶
type GetDetailsOption struct {
// contains filtered or unexported fields
}
func WithGetDetails ¶
func WithGetDetails(getDetails func(ctx context.Context, d *core.Device, links schema.ResourceLinks) (interface{}, error)) GetDetailsOption
type GetDeviceByIPOption ¶
type GetDeviceByIPOption = interface {
// contains filtered or unexported methods
}
GetDeviceByIPOption option definition.
type GetDeviceOption ¶
type GetDeviceOption = interface {
// contains filtered or unexported methods
}
GetDeviceOption option definition.
type GetDevicesOption ¶
type GetDevicesOption = interface {
// contains filtered or unexported methods
}
GetDevicesOption option definition.
type GetDevicesWithHandlerOption ¶
type GetDevicesWithHandlerOption = interface {
// contains filtered or unexported methods
}
type GetOption ¶
type GetOption = interface {
// contains filtered or unexported methods
}
GetOption option definition.
type ObserveDevicesOption ¶
type ObserveDevicesOption = interface {
// contains filtered or unexported methods
}
type ObserveOption ¶
type ObserveOption = interface {
// contains filtered or unexported methods
}
ObserveOption option definition.
type OwnOption ¶
type OwnOption = interface {
// contains filtered or unexported methods
}
OwnOption option definition.
func WithActionAftersOwn ¶ added in v1.2.0
func WithActionAftersOwn(actionAfterOwn func(ctx context.Context, client *coap.ClientCloseHandler) error) OwnOption
WithActionAfterOwn allows initialize configuration at the device via DTLS connection with preshared key. For example setup time / NTP. if it returns error device will be disowned.
func WithActionDuringOwn ¶
func WithActionDuringOwn(actionDuringOwn func(ctx context.Context, client *coap.ClientCloseHandler) (string, error)) OwnOption
WithActionDuringOwn allows to set deviceID of owned device and other staff over owner TLS. returns new deviceID, if it returns error device will be disowned.
func WithOTMs ¶ added in v1.3.0
WithOTMs allows to set ownership transfer methods, by default it is []OTMType{manufacturer}. For owning, the first match in order of OTMType with the device will be used.
func WithPresharedKey ¶ added in v1.2.1
WithPresharedKey allows to set preshared key for owner. It is not set, it will be randomized.
type OwnershipStatus ¶
type OwnershipStatus string
OwnershipStatus describes ownership status of the device
const ( // OwnershipStatus_ReadyToBeOwned the device is ready to be owned. OwnershipStatus_ReadyToBeOwned OwnershipStatus = "readytobeowned" // OwnershipStatus_Owned the device is owned. OwnershipStatus_Owned OwnershipStatus = "owned" // OwnershipStatus_OwnedByOther the device is owned by another user. OwnershipStatus_OwnedByOther OwnershipStatus = "ownedbyother" // OwnershipStatus_Unknown the device is unsecure or cannot obtain his status. OwnershipStatus_Unknown OwnershipStatus = "unknown" )
type RefDevice
deprecated
type RefDevice struct {
// contains filtered or unexported fields
}
Deprecated: use Device
func NewRefDevice ¶
func (*RefDevice) DeleteResourceWithCodec ¶
func (d *RefDevice) DeleteResourceWithCodec( ctx context.Context, link schema.ResourceLink, codec coap.Codec, response interface{}, options ...coap.OptionFunc, ) error
func (*RefDevice) FactoryReset ¶
func (*RefDevice) GetDeviceDetails ¶
func (d *RefDevice) GetDeviceDetails(ctx context.Context, links schema.ResourceLinks, getDetails GetDetailsFunc) (out DeviceDetails, _ error)
func (*RefDevice) GetEndpoints ¶
func (*RefDevice) GetOwnership ¶
func (*RefDevice) GetResourceLinks ¶
func (d *RefDevice) GetResourceLinks(ctx context.Context, endpoints []schema.Endpoint, options ...coap.OptionFunc) (schema.ResourceLinks, error)
func (*RefDevice) GetResourceWithCodec ¶
func (d *RefDevice) GetResourceWithCodec( ctx context.Context, link schema.ResourceLink, codec coap.Codec, response interface{}, options ...coap.OptionFunc, ) error
func (*RefDevice) ObserveResource ¶
func (d *RefDevice) ObserveResource( ctx context.Context, link schema.ResourceLink, handler core.ObservationHandler, options ...coap.OptionFunc, ) (observationID string, _ error)
func (*RefDevice) ObserveResourceWithCodec ¶
func (d *RefDevice) ObserveResourceWithCodec( ctx context.Context, link schema.ResourceLink, codec coap.Codec, handler core.ObservationHandler, options ...coap.OptionFunc, ) (observationID string, _ error)
func (*RefDevice) Provision ¶
func (d *RefDevice) Provision(ctx context.Context, links schema.ResourceLinks) (*core.ProvisioningClient, error)
func (*RefDevice) StopObservingResource ¶
func (*RefDevice) UpdateResource ¶
func (d *RefDevice) UpdateResource( ctx context.Context, link schema.ResourceLink, request interface{}, response interface{}, options ...coap.OptionFunc, ) error
func (*RefDevice) UpdateResourceWithCodec ¶
func (d *RefDevice) UpdateResourceWithCodec( ctx context.Context, link schema.ResourceLink, codec coap.Codec, request interface{}, response interface{}, options ...coap.OptionFunc, ) error
type ResourceInterfaceOption ¶
type ResourceInterfaceOption struct {
// contains filtered or unexported fields
}
func WithInterface ¶
func WithInterface(resourceInterface string) ResourceInterfaceOption
WithInterface updates/gets resource with interface directly from a device.
type ResourceTypesOption ¶
type ResourceTypesOption struct {
// contains filtered or unexported fields
}
func WithResourceTypes ¶
func WithResourceTypes(resourceTypes ...string) ResourceTypesOption
type UpdateOption ¶
type UpdateOption = interface {
// contains filtered or unexported methods
}
UpdateOption option definition.
Source Files ¶
- client.go
- createResource.go
- deleteDevices.go
- deleteResource.go
- deviceCache.go
- deviceOwnershipBackend.go
- deviceOwnershipNone.go
- deviceOwnershipSDK.go
- disownDevice.go
- getDevice.go
- getDevices.go
- getResource.go
- initialization.go
- maitenance.go
- observeDeviceResources.go
- observeDevices.go
- observeResource.go
- offboardDevice.go
- onboardDevice.go
- options.go
- ownDevice.go
- patchResourceLinksEndpoints.go
- refDevice.go
- updateResource.go