You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`address` is the address where the CoAp module handles communication when it is a Server. If not set, the module can be used as a CoAp Client only.
92
-
*`port` is the port where the CoAp Server listens. If not set, the default CoAp UDP port is 5683.
92
+
*`port` is the port where the CoAp Server listens. If not set, the default CoAp UDP port 5683 is used if no PSK is given otherwise the default CoAp DTLS port 5684 is used.
93
93
*`service_discovery` is a Boolean argument that enables/disables service discovery. If enabled, the CoAp Server will listen on the CoAp multicast address: 224.0.1.187. This is disabled by default.
94
94
*`dynamic_resources` is a Boolean argument that enables/disables new resource creation via PUT operations. This is disabled by default.
95
+
*`psk` is a String representing the Pre-Shared Key to be used for the DTLS connection.
96
+
*`hint` is a String representing the hint value to be used for the DTLS connection.
95
97
96
98
When `dynamic_resources` is TRUE new resources can be created via PUT reqeusts, if the resource with the given URI does not already exist.
97
99
The new resource is created with default properties (no mediatype, no Max-Age and no ETAG is enabled) and with default value received in the PUT request. On the new resource by default all operations (GET, PUT, POST and DELETE) are enabled.
@@ -158,13 +160,14 @@ Registers a callback function which will be called when a new resource has been
158
160
*`callback` is the callback to be registered. The callback must have 1 argument:
159
161
*`resource` is the new resource which has been created
Creates a new CoAp Client Session which can be used to communicate with an external CoAp Server.
164
166
165
-
*`destination` is the IPv4 Address of the CoAp Server to join.
166
-
*`port` is the port of the CoAp Server to join. If not set, the default CoAp UDP port 5683 is used.
167
-
*`protocol` is the protocol to use to communicate with the CoAp Server. If not set the protocol UDP is used. Currently no other protocols than UDP is supported.
167
+
*`address` is the IPv4 Address of the CoAp Server to join.
168
+
*`port` is the port of the CoAp Server to join. If not set, the default CoAp UDP port 5683 is used if no PSK is given otherwise the default CoAp DTLS port 5684 is used.
169
+
*`psk` is a String representing the Pre-Shared Key to be used for the DTLS connection.
170
+
*`identity` is a String representing the identity value to be used for the DTLS connection.
@@ -173,7 +176,7 @@ Removes the specified CoAp Client Session.
173
176
174
177
*`destination` is the IPv4 Address of the CoAp Server where this CoAp Client Session has joined.
175
178
*`port` is the port of the CoAp Server where this CoAp Client Session has joined. If not set, the default CoAp UDP port 5683 is used.
176
-
*`protocol` is the protocol to use to communicate with the CoAp Server where this CoAp Client Session has joined. If not set the protocol UDP is used. Currently no other protocols than UDP is supported.
179
+
*`protocol` is the protocol to be used to communicate with the CoAp Server where this CoAp Client Session has joined. This value can be: `Coap.PROTOCOL_UDP`,`Coap.PROTOCOL_DTLS`, if not set the protocol UDP is used.
177
180
178
181
#### Coap.get_client_sessions()
179
182
@@ -275,3 +278,4 @@ Due to limitations of the underlying ESP-IDF/libcoap library, new resources cann
275
278
276
279
* Define the media type: `Coap.MEDIATYPE_TEXT_PLAIN`, `Coap.MEDIATYPE_APP_LINK_FORMAT`, `Coap.MEDIATYPE_APP_XML`, `Coap.MEDIATYPE_APP_OCTET_STREAM`, `Coap.MEDIATYPE_APP_RDF_XML`, `Coap.MEDIATYPE_APP_EXI`, `Coap.MEDIATYPE_APP_JSON`, `Coap.MEDIATYPE_APP_CBOR`
277
280
* Define the operation: `Coap.REQUEST_GET`, `Coap.REQUEST_PUT`, `Coap.REQUEST_POST`, `Coap.REQUEST_DELETE`
281
+
* Define the protocol: `Coap.PROTOCOL_UDP`,`Coap.PROTOCOL_DTLS`
0 commit comments