# Device settings
Some technology-specific fields are essential for the agent when setting up a CoAP device (a.k.a., thing) in the IoTHub.
# Thing
A thing is a digital representation of a physical device (commonly termed "digital-twin").
# Configuration
The configuration defines connection-related settings for communicating with the device. Here, essential fields to set are:
endpoint
: The endpoint defines the devices address and listening port number. This information is used by the agent for establishing a connection with the device.multicast
: Optionally, you can define the multicast address and listening port number of your device.
# Attributes
The attributes define settings that do not directly affect the connection between agent-device but are still relevant for communication. Here, essential fields are:
sampling_interval
: The sampling interval defines a "best-effort" cyclic rate that the agent uses to sample data from the device. "Best-effort" in this context means that the agent does its best to sample data at the given time frame.
# Properties
Properties represent all items that the agent should monitor; this means reading or writing data from or into them, respectively.
# Attributes
Each property contains the following technology-specific fields:
path
: This defines the resource path you want to monitor (read or write). This path must contain a leading slash (/
) and the resource's name (e.g.,/sensor1
).
# Actions
Actions are interaction affordances that allow to invoke specific functions on the device or retrieve information from it. Here, essential actions are:
connect
: Use this action for connecting and subscribing to the CoAP server.disconnect
: Use this action for disconnecting and unsubscribing from the CoAP server.discover
: Use this action for retrieving all the paths from the CoAP server (by default, from the ones registered at/.well-known/core
) and optionally create their respective properties in the IoTHub.ping
: This action has been deprecated, and it will be removed in the near future.