1 //******************************************************************
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //******************************************************************
25 * This file contains the definition, types and APIs for resource(s) be implemented.
31 #include "iotivity_config.h"
32 #include "ocstackconfig.h"
42 #include "ocpresence.h"
44 // TODO : need for secure psi
45 #if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
46 #define __SECURE_PSI__
49 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
53 #define IOTIVITY_VERSION "1.2.1"
56 * OIC Virtual resources supported by every OIC device.
59 * Default discovery mechanism using '/oic/res' is supported by all OIC devices
60 * That are Discoverable.
62 #define OC_RSRVD_WELL_KNOWN_URI "/oic/res"
65 #define OC_RSRVD_DEVICE_URI "/oic/d"
68 #define OC_RSRVD_PLATFORM_URI "/oic/p"
71 #define OC_RSRVD_RESOURCE_TYPES_URI "/oic/res/types/d"
74 #define OC_RSRVD_GATEWAY_URI "/oic/gateway"
77 #define OC_RSRVD_WELL_KNOWN_MQ_URI "/oic/ps"
80 #define OC_RSRVD_KEEPALIVE_URI "/oic/ping"
85 /** Presence URI through which the OIC devices advertise their presence.*/
86 #define OC_RSRVD_PRESENCE_URI "/oic/ad"
87 #endif // WITH_PRESENCE
89 /** Presence URI through which the OIC devices advertise their device presence.*/
90 #define OC_RSRVD_DEVICE_PRESENCE_URI "/oic/prs"
92 /** For multicast Discovery mechanism.*/
93 #define OC_MULTICAST_DISCOVERY_URI "/oic/res"
95 /** Separator for multiple query string.*/
96 #define OC_QUERY_SEPARATOR "&;"
100 * OC_DEFAULT_PRESENCE_TTL_SECONDS sets the default time to live (TTL) for presence.
102 #define OC_DEFAULT_PRESENCE_TTL_SECONDS (60)
105 * OC_MAX_PRESENCE_TTL_SECONDS sets the maximum time to live (TTL) for presence.
106 * NOTE: Changing the setting to a longer duration may lead to unsupported and untested
108 * 60 sec/min * 60 min/hr * 24 hr/day
110 #define OC_MAX_PRESENCE_TTL_SECONDS (60 * 60 * 24)
114 * Presence "Announcement Triggers".
118 #define OC_RSRVD_TRIGGER_CREATE "create"
121 #define OC_RSRVD_TRIGGER_CHANGE "change"
124 #define OC_RSRVD_TRIGGER_DELETE "delete"
126 #endif // WITH_PRESENCE
129 * Attributes used to form a proper OIC conforming JSON message.
132 #define OC_RSRVD_OC "oic"
137 #define OC_RSRVD_PAYLOAD "payload"
139 /** To represent href */
140 #define OC_RSRVD_HREF "href"
142 /** To represent property*/
143 #define OC_RSRVD_PROPERTY "prop"
145 /** For representation.*/
146 #define OC_RSRVD_REPRESENTATION "rep"
148 /** To represent content type.*/
149 #define OC_RSRVD_CONTENT_TYPE "ct"
151 /** To represent resource type.*/
152 #define OC_RSRVD_RESOURCE_TYPE "rt"
155 /** To represent resource type with presence.*/
156 #define OC_RSRVD_RESOURCE_TYPE_PRESENCE "oic.wk.ad"
159 /** To represent resource type with device.*/
160 #define OC_RSRVD_RESOURCE_TYPE_DEVICE "oic.wk.d"
162 /** To represent resource type with platform.*/
163 #define OC_RSRVD_RESOURCE_TYPE_PLATFORM "oic.wk.p"
165 /** To represent resource type with collection.*/
166 #define OC_RSRVD_RESOURCE_TYPE_COLLECTION "oic.wk.col"
168 /** To represent resource type with RES.*/
169 #define OC_RSRVD_RESOURCE_TYPE_RES "oic.wk.res"
171 /** To represent content type with MQ Broker.*/
172 #define OC_RSRVD_RESOURCE_TYPE_MQ_BROKER "oic.wk.ps"
174 /** To represent content type with MQ Topic.*/
175 #define OC_RSRVD_RESOURCE_TYPE_MQ_TOPIC "oic.wk.ps.topic"
178 /** To represent interface.*/
179 #define OC_RSRVD_INTERFACE "if"
181 /** To indicate how long RD should publish this item.*/
182 #define OC_RSRVD_DEVICE_TTL "lt"
184 /** To represent time to live.*/
185 #define OC_RSRVD_TTL "ttl"
187 /** To represent non*/
188 #define OC_RSRVD_NONCE "non"
190 /** To represent trigger type.*/
191 #define OC_RSRVD_TRIGGER "trg"
193 /** To represent links.*/
194 #define OC_RSRVD_LINKS "links"
196 /** To represent default interface.*/
197 #define OC_RSRVD_INTERFACE_DEFAULT "oic.if.baseline"
199 /** To represent read-only interface.*/
200 #define OC_RSRVD_INTERFACE_READ "oic.if.r"
202 /** To represent ll interface.*/
203 #define OC_RSRVD_INTERFACE_LL "oic.if.ll"
205 /** To represent batch interface.*/
206 #define OC_RSRVD_INTERFACE_BATCH "oic.if.b"
208 /** To represent interface group.*/
209 #define OC_RSRVD_INTERFACE_GROUP "oic.mi.grp"
211 /** To represent MFG date.*/
212 #define OC_RSRVD_MFG_DATE "mndt"
214 /** To represent FW version.*/
215 #define OC_RSRVD_FW_VERSION "mnfv"
217 /** To represent host name.*/
218 #define OC_RSRVD_HOST_NAME "hn"
220 /** To represent policy.*/
221 #define OC_RSRVD_POLICY "p"
223 /** To represent bitmap.*/
224 #define OC_RSRVD_BITMAP "bm"
227 #define OC_RSRVD_SECURE "sec"
230 #define OC_RSRVD_HOSTING_PORT "port"
233 #define OC_RSRVD_TCP_PORT "x.org.iotivity.tcp"
236 #define OC_RSRVD_TLS_PORT "x.org.iotivity.tls"
238 /** For Server instance ID.*/
239 #define OC_RSRVD_SERVER_INSTANCE_ID "sid"
246 #define OC_RSRVD_PLATFORM_ID "pi"
248 /** Platform MFG NAME. */
249 #define OC_RSRVD_MFG_NAME "mnmn"
252 #define OC_RSRVD_MFG_URL "mnml"
255 #define OC_RSRVD_MODEL_NUM "mnmo"
257 /** Platform MFG Date.*/
258 #define OC_RSRVD_MFG_DATE "mndt"
260 /** Platform versio.n */
261 #define OC_RSRVD_PLATFORM_VERSION "mnpv"
263 /** Platform Operating system version. */
264 #define OC_RSRVD_OS_VERSION "mnos"
266 /** Platform Hardware version. */
267 #define OC_RSRVD_HARDWARE_VERSION "mnhw"
269 /**Platform Firmware version. */
270 #define OC_RSRVD_FIRMWARE_VERSION "mnfv"
272 /** Support URL for the platform. */
273 #define OC_RSRVD_SUPPORT_URL "mnsl"
275 /** System time for the platform. */
276 #define OC_RSRVD_SYSTEM_TIME "st"
278 /** VID for the platform. */
279 #define OC_RSRVD_VID "vid"
285 #define OC_RSRVD_DEVICE_ID "di"
288 #define OC_RSRVD_DEVICE_NAME "n"
290 /** Device specification version.*/
291 #define OC_RSRVD_SPEC_VERSION "icv"
293 /** Device data model.*/
294 #define OC_RSRVD_DATA_MODEL_VERSION "dmv"
296 /** Device specification version.*/
297 #define OC_SPEC_VERSION "core.1.1.0"
299 /** Device Data Model version.*/
300 #define OC_DATA_MODEL_VERSION "res.1.1.0,sh.1.1.0"
302 * These provide backward compatibility - their use is deprecated.
306 /** Multicast Prefix.*/
307 #define OC_MULTICAST_PREFIX "224.0.1.187:5683"
309 /** Multicast IP address.*/
310 #define OC_MULTICAST_IP "224.0.1.187"
312 /** Multicast Port.*/
313 #define OC_MULTICAST_PORT (5683)
316 /** Max Device address size. */
318 #define MAX_ADDR_STR_SIZE (256)
320 /** Max Address could be
321 * "coaps+tcp://[xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:yyy.yyy.yyy.yyy]:xxxxx"
322 * +1 for null terminator.
324 #define MAX_ADDR_STR_SIZE (66)
327 /** Length of MAC address */
328 #define MAC_ADDR_STR_SIZE (17)
330 /** Blocks of MAC address */
331 #define MAC_ADDR_BLOCKS (6)
333 /** Max identity size. */
334 #define MAX_IDENTITY_SIZE (37)
336 /** Universal unique identity size. */
337 #define UUID_IDENTITY_SIZE (128/8)
339 /** Resource Directory */
341 /** Resource Directory URI used to Discover RD and Publish resources.*/
342 #define OC_RSRVD_RD_URI "/oic/rd"
344 /** To represent resource type with rd.*/
345 #define OC_RSRVD_RESOURCE_TYPE_RD "oic.wk.rd"
347 /** RD Discovery bias factor type. */
348 #define OC_RSRVD_RD_DISCOVERY_SEL "sel"
350 /** Resource URI used to discover Proxy */
351 #define OC_RSRVD_PROXY_URI "/oic/chp"
353 /** Resource URI used to discover Proxy */
354 #define OC_RSRVD_PROXY_OPTION_ID 35
357 #define OC_RSRVD_BASE_URI "baseURI"
359 /** Unique value per collection/link. */
360 #define OC_RSRVD_INS "ins"
362 /** Allowable resource types in the links. */
363 #define OC_RSRVD_RTS "rts"
365 /** Default relationship. */
366 #define OC_RSRVD_DREL "drel"
368 /** Defines relationship between links. */
369 #define OC_RSRVD_REL "rel"
371 /** Defines title. */
372 #define OC_RSRVD_TITLE "title"
375 #define OC_RSRVD_URI "anchor"
377 /** Defines media type. */
378 #define OC_RSRVD_MEDIA_TYPE "type"
380 /** To represent resource type with Publish RD.*/
381 #define OC_RSRVD_RESOURCE_TYPE_RDPUBLISH "oic.wk.rdpub"
386 #define OC_RSRVD_ACCOUNT_URI "/oic/account"
388 /** Account user URI.*/
389 #define OC_RSRVD_ACCOUNT_SEARCH_URI "/oic/account/search"
391 /** Account session URI.*/
392 #define OC_RSRVD_ACCOUNT_SESSION_URI "/oic/account/session"
394 /** Account token refresh URI.*/
395 #define OC_RSRVD_ACCOUNT_TOKEN_REFRESH_URI "/oic/account/tokenrefresh"
398 #define OC_RSRVD_ACL_GROUP_URI "/oic/acl/group"
400 /** ACL invite URI.*/
401 #define OC_RSRVD_ACL_INVITE_URI "/oic/acl/invite"
403 /** Defines auth provider. */
404 #define OC_RSRVD_AUTHPROVIDER "authprovider"
406 /** Defines auth code. */
407 #define OC_RSRVD_AUTHCODE "authcode"
409 /** Defines access token. */
410 #define OC_RSRVD_ACCESS_TOKEN "accesstoken"
412 /** Defines login. */
413 #define OC_RSRVD_LOGIN "login"
415 /** Defines search. */
416 #define OC_RSRVD_SEARCH "search"
418 /** Defines grant type. */
419 #define OC_RSRVD_GRANT_TYPE "granttype"
421 /** Defines refresh token. */
422 #define OC_RSRVD_REFRESH_TOKEN "refreshtoken"
424 /** Defines user UUID. */
425 #define OC_RSRVD_USER_UUID "uid"
427 /** Defines group ID. */
428 #define OC_RSRVD_GROUP_ID "gid"
430 /** Defines member of group ID. */
431 #define OC_RSRVD_MEMBER_ID "mid"
433 /** Defines invite. */
434 #define OC_RSRVD_INVITE "invite"
436 /** Defines accept. */
437 #define OC_RSRVD_ACCEPT "accept"
439 /** Defines operation. */
440 #define OC_RSRVD_OPERATION "op"
443 #define OC_RSRVD_ADD "add"
445 /** Defines delete. */
446 #define OC_RSRVD_DELETE "delete"
448 /** Defines owner. */
449 #define OC_RSRVD_OWNER "owner"
451 /** Defines members. */
452 #define OC_RSRVD_MEMBERS "members"
454 /** To represent grant type with refresh token. */
455 #define OC_RSRVD_GRANT_TYPE_REFRESH_TOKEN "refresh_token"
458 #define OC_RSRVD_PROV_CRL_URL "/oic/credprov/crl"
460 #define OC_RSRVD_LAST_UPDATE "lu"
462 #define OC_RSRVD_THIS_UPDATE "tu"
464 #define OC_RSRVD_NEXT_UPDATE "nu"
466 #define OC_RSRVD_SERIAL_NUMBERS "rcsn"
468 #define OC_RSRVD_CRL "crl"
470 #define OC_RSRVD_CRL_ID "crlid"
473 #define OC_RSRVD_GROUP_URL "/oic/group"
475 #define OC_RSRVD_ACL_GROUP_URL "/oic/acl/group"
477 #define OC_RSRVD_ACL_INVITE_URL "/oic/acl/invite"
479 #define OC_RSRVD_ACL_VERIFY_URL "/oic/acl/verify"
481 #define OC_RSRVD_ACL_ID_URL "/oic/acl/id"
483 #define OC_RSRVD_MEMBER_ID "mid"
485 #define OC_RSRVD_GROUP_ID "gid"
487 #define OC_RSRVD_OWNER_ID "oid"
489 #define OC_RSRVD_ACL_ID "aclid"
491 #define OC_RSRVD_ACE_ID "aceid"
493 #define OC_RSRVD_DEVICE_ID "di"
495 #define OC_RSRVD_SUBJECT_ID "sid"
497 #define OC_RSRVD_REQUEST_METHOD "rm"
499 #define OC_RSRVD_REQUEST_URI "uri"
501 #define OC_RSRVD_GROUP_MASTER_ID "gmid"
503 #define OC_RSRVD_GROUP_TYPE "gtype"
505 #define OC_RSRVD_SUBJECT_TYPE "stype"
507 #define OC_RSRVD_GROUP_ID_LIST "gidlist"
509 #define OC_RSRVD_MEMBER_ID_LIST "midlist"
511 #define OC_RSRVD_DEVICE_ID_LIST "dilist"
513 #define OC_RSRVD_ACCESS_CONTROL_LIST "aclist"
515 #define OC_RSRVD_RESOURCES "resources"
517 #define OC_RSRVD_VALIDITY "validity"
519 #define OC_RSRVD_PERIOD "period"
521 #define OC_RSRVD_RECURRENCE "recurrence"
523 #define OC_RSRVD_INVITE "invite"
525 #define OC_RSRVD_INVITED "invited"
527 #define OC_RSRVD_ENCODING "encoding"
529 #define OC_OIC_SEC "oic.sec"
531 #define OC_RSRVD_BASE64 "base64"
533 #define OC_RSRVD_DER "der"
535 #define OC_RSRVD_PEM "pem"
537 #define OC_RSRVD_RAW "raw"
539 #define OC_RSRVD_UNKNOWN "unknown"
541 #define OC_RSRVD_DATA "data"
543 #define OC_RSRVD_RESOURCE_OWNER_UUID "rowneruuid"
545 #define OC_RSRVD_SUBJECT_UUID "subjectuuid"
547 #define OC_RSRVD_PERMISSION_MASK "permission"
549 #define OC_RSRVD_GROUP_PERMISSION "gp"
551 #define OC_RSRVD_GROUP_ACL "gacl"
553 /** Certificete Sign Request */
554 #define OC_RSRVD_PROV_CERT_URI "/oic/credprov/cert"
556 #define OC_RSRVD_CSR "csr"
558 #define OC_RSRVD_CERT "cert"
560 #define OC_RSRVD_CACERT "certchain"
562 #define OC_RSRVD_TOKEN_TYPE "tokentype"
564 #define OC_RSRVD_EXPIRES_IN "expiresin"
566 #define OC_RSRVD_REDIRECT_URI "redirecturi"
568 #define OC_RSRVD_CERTIFICATE "certificate"
570 * Mark a parameter as unused. Used to prevent unused variable compiler warnings.
571 * Used in three cases:
572 * 1. in callbacks when one of the parameters are unused
573 * 2. when due to code changes a functions parameter is no longer
574 * used but must be left in place for backward compatibility
576 * 3. a variable is only used in the debug build variant and would
577 * give a build warning in release mode.
579 #define OC_UNUSED(x) (void)(x)
582 * These enums (OCTransportAdapter and OCTransportFlags) must
583 * be kept synchronized with OCConnectivityType (below) as well as
584 * CATransportAdapter and CATransportFlags (in CACommon.h).
588 /** value zero indicates discovery.*/
589 OC_DEFAULT_ADAPTER = 0,
591 /** IPv4 and IPv6, including 6LoWPAN.*/
592 OC_ADAPTER_IP = (1 << 0),
594 /** GATT over Bluetooth LE.*/
595 OC_ADAPTER_GATT_BTLE = (1 << 1),
597 /** RFCOMM over Bluetooth EDR.*/
598 OC_ADAPTER_RFCOMM_BTEDR = (1 << 2),
600 /**Remote Access over XMPP.*/
601 OC_ADAPTER_REMOTE_ACCESS = (1 << 3),
604 OC_ADAPTER_TCP = (1 << 4),
606 /** NFC Transport for Messaging.*/
607 OC_ADAPTER_NFC = (1 << 5)
608 } OCTransportAdapter;
612 OC_DEFAULT_BT_FLAGS = 0,
613 // flags for BLE transport
614 OC_LE_ADV_DISABLE = 0x1, // disable BLE advertisement.
615 OC_LE_ADV_ENABLE = 0x2, // enable BLE advertisement.
616 OC_LE_SERVER_DISABLE = (1 << 4), // disable gatt server.
617 // flags for EDR transport
618 OC_EDR_SERVER_DISABLE = (1 << 7) // disable rfcomm server.
619 } OCTransportBTFlags_t;
622 * Log level to print can be controlled through this enum.
623 * And privacy logs contained uid, Token, Device id, etc can also disable.
624 * This enum (OCLogLevel) must be kept synchronized with
625 * CAUtilLogLevel_t (in CACommon.h).
629 OC_LOG_LEVEL_ALL = 1, // all logs.
630 OC_LOG_LEVEL_INFO, // debug level is disabled.
634 * Enum layout assumes some targets have 16-bit integer (e.g., Arduino).
638 /** default flag is 0*/
639 OC_DEFAULT_FLAGS = 0,
641 /** Insecure transport is the default (subject to change).*/
642 /** secure the transport path*/
643 OC_FLAG_SECURE = (1 << 4),
645 /** IPv4 & IPv6 auto-selection is the default.*/
646 /** IP & TCP adapter only.*/
647 OC_IP_USE_V6 = (1 << 5),
649 /** IP & TCP adapter only.*/
650 OC_IP_USE_V4 = (1 << 6),
652 /** Multicast only.*/
653 OC_MULTICAST = (1 << 7),
655 /** Link-Local multicast is the default multicast scope for IPv6.
656 * These are placed here to correspond to the IPv6 multicast address bits.*/
658 /** IPv6 Interface-Local scope (loopback).*/
659 OC_SCOPE_INTERFACE = 0x1,
661 /** IPv6 Link-Local scope (default).*/
664 /** IPv6 Realm-Local scope. */
665 OC_SCOPE_REALM = 0x3,
667 /** IPv6 Admin-Local scope. */
668 OC_SCOPE_ADMIN = 0x4,
670 /** IPv6 Site-Local scope. */
673 /** IPv6 Organization-Local scope. */
676 /**IPv6 Global scope. */
677 OC_SCOPE_GLOBAL = 0xE,
681 /** Bit mask for scope.*/
682 #define OC_MASK_SCOPE (0x000F)
684 /** Bit mask for Mods.*/
685 #define OC_MASK_MODS (0x0FF0)
686 #define OC_MASK_FAMS (OC_IP_USE_V6|OC_IP_USE_V4)
688 typedef struct OCStringLL
690 struct OCStringLL *next;
695 * End point identity.
699 /** Identity Length */
702 /** Array of end point identity.*/
703 unsigned char id[MAX_IDENTITY_SIZE];
707 * Universally unique identifier.
711 /** identitifier string.*/
712 unsigned char id[UUID_IDENTITY_SIZE];
716 * Data structure to encapsulate IPv4/IPv6/Contiki/lwIP device addresses.
717 * OCDevAddr must be the same as CAEndpoint (in CACommon.h).
722 OCTransportAdapter adapter;
724 /** transport modifiers.*/
725 OCTransportFlags flags;
730 /** address for all adapters.*/
731 char addr[MAX_ADDR_STR_SIZE];
733 /** usually zero for default interface.*/
736 /** destination GatewayID:ClientId.*/
737 char routeData[MAX_ADDR_STR_SIZE];
739 /** device ID of remote.*/
740 char remoteId[MAX_IDENTITY_SIZE];
744 * This enum type includes elements of both ::OCTransportAdapter and ::OCTransportFlags.
745 * It is defined conditionally because the smaller definition limits expandability on 32/64 bit
746 * integer machines, and the larger definition won't fit into an enum on 16-bit integer machines
749 * This structure must directly correspond to ::OCTransportAdapter and ::OCTransportFlags.
753 /** use when defaults are ok. */
756 /** IPv4 and IPv6, including 6LoWPAN.*/
757 CT_ADAPTER_IP = (1 << 16),
759 /** GATT over Bluetooth LE.*/
760 CT_ADAPTER_GATT_BTLE = (1 << 17),
762 /** RFCOMM over Bluetooth EDR.*/
763 CT_ADAPTER_RFCOMM_BTEDR = (1 << 18),
766 /** Remote Access over XMPP.*/
767 CT_ADAPTER_REMOTE_ACCESS = (1 << 19),
770 CT_ADAPTER_TCP = (1 << 20),
773 CT_ADAPTER_NFC = (1 << 21),
775 /** Insecure transport is the default (subject to change).*/
777 /** secure the transport path.*/
778 CT_FLAG_SECURE = (1 << 4),
780 /** IPv4 & IPv6 autoselection is the default.*/
782 /** IP adapter only.*/
783 CT_IP_USE_V6 = (1 << 5),
785 /** IP adapter only.*/
786 CT_IP_USE_V4 = (1 << 6),
788 /** Link-Local multicast is the default multicast scope for IPv6.
789 * These are placed here to correspond to the IPv6 address bits.*/
791 /** IPv6 Interface-Local scope(loopback).*/
792 CT_SCOPE_INTERFACE = 0x1,
794 /** IPv6 Link-Local scope (default).*/
797 /** IPv6 Realm-Local scope.*/
798 CT_SCOPE_REALM = 0x3,
800 /** IPv6 Admin-Local scope.*/
801 CT_SCOPE_ADMIN = 0x4,
803 /** IPv6 Site-Local scope.*/
806 /** IPv6 Organization-Local scope.*/
809 /** IPv6 Global scope.*/
810 CT_SCOPE_GLOBAL = 0xE,
811 } OCConnectivityType;
813 /** bit shift required for connectivity adapter.*/
814 #define CT_ADAPTER_SHIFT 16
817 #define CT_MASK_FLAGS 0xFFFF
820 #define CT_MASK_ADAPTER 0xFFFF0000
823 * OCDoResource methods to dispatch the request
827 OC_REST_NOMETHOD = 0,
830 OC_REST_GET = (1 << 0),
833 OC_REST_PUT = (1 << 1),
836 OC_REST_POST = (1 << 2),
839 OC_REST_DELETE = (1 << 3),
841 /** Register observe request for most up date notifications ONLY.*/
842 OC_REST_OBSERVE = (1 << 4),
844 /** Register observe request for all notifications, including stale notifications.*/
845 OC_REST_OBSERVE_ALL = (1 << 5),
848 /** Subscribe for all presence notifications of a particular resource.*/
849 OC_REST_PRESENCE = (1 << 7),
852 /** Allows OCDoResource caller to do discovery.*/
853 OC_REST_DISCOVER = (1 << 8)
857 * Formats for payload encoding.
864 OC_FORMAT_UNSUPPORTED,
868 * Host Mode of Operation.
875 OC_GATEWAY /**< Client server mode along with routing capabilities.*/
879 * Quality of Service attempts to abstract the guarantees provided by the underlying transport
880 * protocol. The precise definitions of each quality of service level depend on the
881 * implementation. In descriptions below are for the current implementation and may changed
886 /** Packet delivery is best effort.*/
889 /** Packet delivery is best effort.*/
892 /** Acknowledgments are used to confirm delivery.*/
895 /** No Quality is defined, let the stack decide.*/
897 } OCQualityOfService;
900 * Resource Properties.
901 * The value of a policy property is defined as bitmap.
902 * The LSB represents OC_DISCOVERABLE and Second LSB bit represents OC_OBSERVABLE and so on.
903 * Not including the policy property is equivalent to zero.
908 /** When none of the bits are set, the resource is non-discoverable &
909 * non-observable by the client.*/
910 OC_RES_PROP_NONE = (0),
912 /** When this bit is set, the resource is allowed to be discovered by clients.*/
913 OC_DISCOVERABLE = (1 << 0),
915 /** When this bit is set, the resource is allowed to be observed by clients.*/
916 OC_OBSERVABLE = (1 << 1),
918 /** When this bit is set, the resource is initialized, otherwise the resource
919 * is 'inactive'. 'inactive' signifies that the resource has been marked for
920 * deletion or is already deleted.*/
921 OC_ACTIVE = (1 << 2),
923 /** When this bit is set, the resource has been marked as 'slow'.
924 * 'slow' signifies that responses from this resource can expect delays in
925 * processing its requests from clients.*/
928 #if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
929 /** When this bit is set, the resource is a secure resource.*/
930 OC_SECURE = (1 << 4),
935 /** When this bit is set, the resource is allowed to be discovered only
936 * if discovery request contains an explicit querystring.
937 * Ex: GET /oic/res?rt=oic.sec.acl */
938 OC_EXPLICIT_DISCOVERABLE = (1 << 5)
941 /** When this bit is set, the resource is allowed to be published */
942 ,OC_MQ_PUBLISHER = (1 << 6)
946 /** When this bit is set, the resource is allowed to be notified as MQ broker.*/
947 ,OC_MQ_BROKER = (1 << 7)
949 } OCResourceProperty;
952 * Transport Protocol IDs.
956 /** For invalid ID.*/
957 OC_INVALID_ID = (1 << 0),
960 OC_COAP_ID = (1 << 1)
961 } OCTransportProtocolID;
964 * Declares Stack Results & Errors.
968 /** Success status code - START HERE.*/
970 OC_STACK_RESOURCE_CREATED,
971 OC_STACK_RESOURCE_DELETED,
973 OC_STACK_RESOURCE_CHANGED,
974 /** Success status code - END HERE.*/
976 /** Error status code - START HERE.*/
977 OC_STACK_INVALID_URI = 20,
978 OC_STACK_INVALID_QUERY,
980 OC_STACK_INVALID_PORT,
981 OC_STACK_INVALID_CALLBACK,
982 OC_STACK_INVALID_METHOD,
984 /** Invalid parameter.*/
985 OC_STACK_INVALID_PARAM,
986 OC_STACK_INVALID_OBSERVE_PARAM,
990 OC_STACK_ADAPTER_NOT_ENABLED,
993 /** Resource not found.*/
994 OC_STACK_NO_RESOURCE,
996 /** e.g: not supported method or interface.*/
997 OC_STACK_RESOURCE_ERROR,
998 OC_STACK_SLOW_RESOURCE,
999 OC_STACK_DUPLICATE_REQUEST,
1001 /** Resource has no registered observers.*/
1002 OC_STACK_NO_OBSERVERS,
1003 OC_STACK_OBSERVER_NOT_FOUND,
1004 OC_STACK_VIRTUAL_DO_NOT_HANDLE,
1005 OC_STACK_INVALID_OPTION,
1007 /** The remote reply contained malformed data.*/
1008 OC_STACK_MALFORMED_RESPONSE,
1009 OC_STACK_PERSISTENT_BUFFER_REQUIRED,
1010 OC_STACK_INVALID_REQUEST_HANDLE,
1011 OC_STACK_INVALID_DEVICE_INFO,
1012 OC_STACK_INVALID_JSON,
1014 /** Request is not authorized by Resource Server. */
1015 OC_STACK_UNAUTHORIZED_REQ,
1016 OC_STACK_TOO_LARGE_REQ,
1018 /** Error code from PDM */
1019 OC_STACK_PDM_IS_NOT_INITIALIZED,
1020 OC_STACK_DUPLICATE_UUID,
1021 OC_STACK_INCONSISTENT_DB,
1022 OC_STACK_SVR_DB_NOT_EXIST,
1025 * Error code from OTM
1026 * This error is pushed from DTLS interface when handshake failure happens
1028 OC_STACK_AUTHENTICATION_FAILURE,
1029 OC_STACK_NOT_ALLOWED_OXM,
1031 /** Insert all new error codes here!.*/
1032 #ifdef WITH_PRESENCE
1033 OC_STACK_PRESENCE_STOPPED = 128,
1034 OC_STACK_PRESENCE_TIMEOUT,
1035 OC_STACK_PRESENCE_DO_NOT_HANDLE,
1038 /** Request is denied by the user*/
1039 OC_STACK_USER_DENIED_REQ,
1040 OC_STACK_NOT_ACCEPTABLE,
1041 OC_STACK_METHOD_NOT_ALLOWED,
1043 /** ERROR code from server */
1044 OC_STACK_FORBIDDEN_REQ, /** 403*/
1045 OC_STACK_TOO_MANY_REQUESTS, /** 429*/
1046 OC_STACK_INTERNAL_SERVER_ERROR, /** 500*/
1047 OC_STACK_NOT_IMPLEMENTED, /** 501*/
1048 OC_STACK_BAD_GATEWAY, /** 502*/
1049 OC_STACK_SERVICE_UNAVAILABLE, /** 503*/
1050 OC_STACK_GATEWAY_TIMEOUT, /** 504*/
1051 OC_STACK_PROXY_NOT_SUPPORTED, /** 505*/
1053 /** ERROR in stack.*/
1054 OC_STACK_ERROR = 255
1055 /** Error status code - END HERE.*/
1059 * Handle to an OCDoResource invocation.
1061 typedef void * OCDoHandle;
1064 * Handle to an OCResource object owned by the OCStack.
1066 typedef void * OCResourceHandle;
1069 * Handle to an OCRequest object owned by the OCStack.
1071 typedef uint32_t OCRequestHandle;
1074 * Unique identifier for each observation request. Used when observations are
1075 * registered or de-registered. Used by entity handler to signal specific
1076 * observers to be notified of resource changes.
1077 * There can be maximum of 256 observations per server.
1079 typedef uint8_t OCObservationId;
1082 * Sequence number is a 24 bit field,
1083 * per https://tools.ietf.org/html/rfc7641.
1085 #define MAX_SEQUENCE_NUMBER (0xFFFFFF)
1088 * Action associated with observation.
1093 OC_OBSERVE_REGISTER = 0,
1095 /** To Deregister. */
1096 OC_OBSERVE_DEREGISTER = 1,
1099 OC_OBSERVE_NO_OPTION = 2,
1105 * Persistent storage handlers. An APP must provide OCPersistentStorage handler pointers
1106 * when it calls OCRegisterPersistentStorageHandler.
1107 * Persistent storage open handler points to default file path.
1108 * It should check file path and whether the file is symbolic link or no.
1109 * Application can point to appropriate SVR database path for it's IoTivity Server.
1112 /** Persistent storage file path.*/
1113 FILE* (* open)(const char *path, const char *mode);
1115 /** Persistent storage read handler.*/
1116 size_t (* read)(void *ptr, size_t size, size_t nmemb, FILE *stream);
1118 /** Persistent storage write handler.*/
1119 size_t (* write)(const void *ptr, size_t size, size_t nmemb, FILE *stream);
1121 /** Persistent storage close handler.*/
1122 int (* close)(FILE *fp);
1124 /** Persistent storage unlink handler.*/
1125 int (* unlink)(const char *path);
1127 /** Persistent Storage Handler for Encryption.*/
1128 int (* encrypt)(const unsigned char *pt, size_t size,
1129 unsigned char**ct, size_t *ct_len);
1131 /**Persistent Storage Handler for Decryption.*/
1132 int (* decrypt)(const unsigned char *ct, size_t size,
1133 unsigned char**pt, size_t *pt_len);
1134 } OCPersistentStorage;
1137 * Possible returned values from entity handler.
1141 /** Action associated with observation request.*/
1142 OCObserveAction action;
1144 /** Identifier for observation being registered/deregistered.*/
1145 OCObservationId obsId;
1146 } OCObservationInfo;
1149 * Possible returned values from entity handler.
1156 OC_EH_RESOURCE_CREATED = 201,
1157 OC_EH_RESOURCE_DELETED = 202,
1159 OC_EH_CHANGED = 204,
1160 OC_EH_CONTENT = 205,
1161 OC_EH_BAD_REQ = 400,
1162 OC_EH_UNAUTHORIZED_REQ = 401,
1163 OC_EH_BAD_OPT = 402,
1164 OC_EH_FORBIDDEN = 403,
1165 OC_EH_RESOURCE_NOT_FOUND = 404,
1166 OC_EH_METHOD_NOT_ALLOWED = 405,
1167 OC_EH_NOT_ACCEPTABLE = 406,
1168 OC_EH_TOO_LARGE = 413,
1169 OC_EH_UNSUPPORTED_MEDIA_TYPE = 415,
1170 OC_EH_TOO_MANY_REQUESTS = 429,
1171 OC_EH_INTERNAL_SERVER_ERROR = 500,
1172 OC_EH_NOT_IMPLEMENTED = 501,
1173 OC_EH_BAD_GATEWAY = 502,
1174 OC_EH_SERVICE_UNAVAILABLE = 503,
1175 OC_EH_RETRANSMIT_TIMEOUT = 504,
1176 OC_EH_PROXY_NOT_SUPPORTED = 505
1177 } OCEntityHandlerResult;
1180 * This structure will be used to define the vendor specific header options to be included
1181 * in communication packets.
1183 typedef struct OCHeaderOption
1185 /** The protocol ID this option applies to.*/
1186 OCTransportProtocolID protocolID;
1188 /** The header option ID which will be added to communication packets.*/
1191 /** its length 191.*/
1192 uint16_t optionLength;
1194 /** pointer to its data.*/
1195 uint8_t optionData[MAX_HEADER_OPTION_DATA_LENGTH];
1197 #ifdef SUPPORTS_DEFAULT_CTOR
1198 OCHeaderOption() = default;
1199 OCHeaderOption(OCTransportProtocolID pid,
1202 const uint8_t* optData)
1205 optionLength(optlen)
1208 // parameter includes the null terminator.
1209 optionLength = optionLength < MAX_HEADER_OPTION_DATA_LENGTH ?
1210 optionLength : MAX_HEADER_OPTION_DATA_LENGTH;
1211 memcpy(optionData, optData, optionLength);
1212 optionData[optionLength - 1] = '\0';
1218 * This structure describes the platform properties. All non-Null properties will be
1219 * included in a platform discovery request.
1220 * @deprecated: Use OCSetPropertyValue to set platform value.
1227 /** Manufacturer name.*/
1228 char *manufacturerName;
1230 /** Manufacturer URL for platform property.*/
1231 char *manufacturerUrl;
1236 /** Manufacturer date.*/
1237 char *dateOfManufacture;
1239 /** Platform version.*/
1240 char *platformVersion;
1242 /** Operating system version.*/
1243 char *operatingSystemVersion;
1246 char *hardwareVersion;
1249 char *firmwareVersion;
1251 /** Platform support URL.*/
1260 * This structure is expected as input for device properties.
1261 * device name is mandatory and expected from the application.
1262 * device id of type UUID will be generated by the stack.
1263 * @deprecated: Use OCSetPropertyValue to set device value.
1267 /** Pointer to the device name.*/
1269 /** Pointer to the types.*/
1271 /** Pointer to the device specification version.*/
1273 /** Pointer to the device data model versions (in CSV format).*/
1274 OCStringLL *dataModelVersions;
1279 * callback for bound JID
1281 typedef void (*jid_bound_cb)(char *jid);
1284 * CA Remote Access information for XMPP Client
1289 char *hostname; /**< XMPP server hostname */
1290 uint16_t port; /**< XMPP server serivce port */
1291 char *xmpp_domain; /**< XMPP login domain */
1292 char *username; /**< login username */
1293 char *password; /**< login password */
1294 char *resource; /**< specific resource for login */
1295 char *user_jid; /**< specific JID for login */
1296 jid_bound_cb jidbound; /**< callback when JID bound */
1298 #endif /* RA_ADAPTER */
1301 /** Enum to describe the type of object held by the OCPayload object.*/
1304 /** Contents of the payload are invalid */
1305 PAYLOAD_TYPE_INVALID,
1306 /** The payload is an OCDiscoveryPayload */
1307 PAYLOAD_TYPE_DISCOVERY,
1308 /** The payload of the device */
1309 PAYLOAD_TYPE_DEVICE,
1310 /** The payload type of the platform */
1311 PAYLOAD_TYPE_PLATFORM,
1312 /** The payload is an OCRepPayload */
1313 PAYLOAD_TYPE_REPRESENTATION,
1314 /** The payload is an OCSecurityPayload */
1315 PAYLOAD_TYPE_SECURITY,
1316 #ifdef WITH_PRESENCE
1317 /** The payload is an OCPresencePayload */
1318 PAYLOAD_TYPE_PRESENCE
1323 * A generic struct representing a payload returned from a resource operation
1325 * A pointer to OCPayLoad can be cast to a more specific struct to access members
1330 /** The type of message that was received */
1341 OCREP_PROP_BYTE_STRING,
1344 }OCRepPayloadPropType;
1346 /** This structure will be used to represent a binary string for CBOR payloads.*/
1349 /** pointer to data bytes.*/
1352 /** number of data bytes.*/
1356 #define MAX_REP_ARRAY_DEPTH 3
1359 OCRepPayloadPropType type;
1360 size_t dimensions[MAX_REP_ARRAY_DEPTH];
1369 /** pointer to ByteString array.*/
1370 OCByteString* ocByteStrArray;
1372 struct OCRepPayload** objArray;
1374 } OCRepPayloadValueArray;
1376 typedef struct OCRepPayloadValue
1379 OCRepPayloadPropType type;
1387 /** ByteString object.*/
1388 OCByteString ocByteStr;
1390 struct OCRepPayload* obj;
1391 OCRepPayloadValueArray arr;
1393 struct OCRepPayloadValue* next;
1395 } OCRepPayloadValue;
1397 // used for get/set/put/observe/etc representations
1398 typedef struct OCRepPayload
1403 OCStringLL* interfaces;
1404 OCRepPayloadValue* values;
1405 struct OCRepPayload* next;
1408 // used inside a discovery payload
1409 typedef struct OCResourcePayload
1413 OCStringLL* interfaces;
1420 struct OCResourcePayload* next;
1421 } OCResourcePayload;
1423 typedef struct OCDiscoveryPayload
1430 /** A special case for handling RD address. */
1436 /** Resource Type */
1442 /** This structure holds the old /oic/res response. */
1443 OCResourcePayload *resources;
1445 /** Holding address of the next DiscoveryPayload. */
1446 struct OCDiscoveryPayload *next;
1448 } OCDiscoveryPayload;
1453 uint8_t* securityData;
1455 } OCSecurityPayload;
1457 #ifdef WITH_PRESENCE
1461 uint32_t sequenceNumber;
1463 OCPresenceTrigger trigger;
1465 } OCPresencePayload;
1469 * Incoming requests handled by the server. Requests are passed in as a parameter to the
1470 * OCEntityHandler callback API.
1471 * The OCEntityHandler callback API must be implemented in the application in order
1472 * to receive these requests.
1476 /** Associated resource.*/
1477 OCResourceHandle resource;
1479 /** Associated request handle.*/
1480 OCRequestHandle requestHandle;
1482 /** the REST method retrieved from received request PDU.*/
1485 /** description of endpoint that sent the request.*/
1488 /** resource query send by client.*/
1491 /** Information associated with observation - valid only when OCEntityHandler flag includes
1492 * ::OC_OBSERVE_FLAG.*/
1493 OCObservationInfo obsInfo;
1495 /** Number of the received vendor specific header options.*/
1496 uint8_t numRcvdVendorSpecificHeaderOptions;
1498 /** Pointer to the array of the received vendor specific header options.*/
1499 OCHeaderOption * rcvdVendorSpecificHeaderOptions;
1504 /** the payload from the request PDU.*/
1507 } OCEntityHandlerRequest;
1511 * Response from queries to remote servers. Queries are made by calling the OCDoResource API.
1515 /** Address of remote server.*/
1518 /** backward compatibility (points to devAddr).*/
1521 /** backward compatibility.*/
1522 OCConnectivityType connType;
1524 /** the security identity of the remote server.*/
1525 OCIdentity identity;
1527 /** the is the result of our stack, OCStackResult should contain coap/other error codes.*/
1528 OCStackResult result;
1530 /** If associated with observe, this will represent the sequence of notifications from server.*/
1531 uint32_t sequenceNumber;
1534 const char * resourceUri;
1536 /** the payload for the response PDU.*/
1539 /** Number of the received vendor specific header options.*/
1540 uint8_t numRcvdVendorSpecificHeaderOptions;
1542 /** An array of the received vendor specific header options.*/
1543 OCHeaderOption *rcvdVendorSpecificHeaderOptions;
1547 * Request handle is passed to server via the entity handler for each incoming request.
1548 * Stack assigns when request is received, server sets to indicate what request response is for.
1552 /** Request handle.*/
1553 OCRequestHandle requestHandle;
1555 /** Resource handle.*/
1556 OCResourceHandle resourceHandle;
1558 /** Allow the entity handler to pass a result with the response.*/
1559 OCEntityHandlerResult ehResult;
1561 /** This is the pointer to server payload data to be transferred.*/
1564 /** number of the vendor specific header options .*/
1565 uint8_t numSendVendorSpecificHeaderOptions;
1567 /** An array of the vendor specific header options the entity handler wishes to use in response.*/
1568 OCHeaderOption sendVendorSpecificHeaderOptions[MAX_HEADER_OPTIONS];
1570 /** URI of new resource that entity handler might create.*/
1571 char resourceUri[MAX_URI_LENGTH];
1573 /** Server sets to true for persistent response buffer,false for non-persistent response buffer*/
1574 uint8_t persistentBufferFlag;
1575 } OCEntityHandlerResponse;
1582 /** Request state.*/
1583 OC_REQUEST_FLAG = (1 << 1),
1584 /** Observe state.*/
1585 OC_OBSERVE_FLAG = (1 << 2)
1586 } OCEntityHandlerFlag;
1589 * Possible return values from client application callback
1591 * A client application callback returns an OCStackApplicationResult to indicate whether
1592 * the stack should continue to keep the callback registered.
1596 /** Make no more calls to the callback and call the OCClientContextDeleter for this callback */
1597 OC_STACK_DELETE_TRANSACTION = 0,
1598 /** Keep this callback registered and call it if an apropriate event occurs */
1599 OC_STACK_KEEP_TRANSACTION
1600 } OCStackApplicationResult;
1603 //#ifdef DIRECT_PAIRING
1605 * @brief direct pairing Method Type.
1607 * 1: pre-configured pin
1612 DP_NOT_ALLOWED = 0x0,
1613 DP_PRE_CONFIGURED = (0x1 << 0),
1614 DP_RANDOM_PIN = (0x1 << 1),
1618 * Device Information of discoverd direct pairing device(s).
1620 typedef struct OCDPDev
1623 OCConnectivityType connType;
1624 uint16_t securePort;
1628 OCUUIdentity deviceID;
1629 OCUUIdentity rowner;
1630 struct OCDPDev *next;
1632 //#endif // DIRECT_PAIRING
1635 * -------------------------------------------------------------------------------------------
1636 * Callback function definitions
1637 * -------------------------------------------------------------------------------------------
1641 * Client applications implement this callback to consume responses received from Servers.
1643 typedef OCStackApplicationResult (* OCClientResponseHandler)(void *context, OCDoHandle handle,
1644 OCClientResponse * clientResponse);
1647 * Client applications using a context pointer implement this callback to delete the
1648 * context upon removal of the callback/context pointer from the internal callback-list.
1650 typedef void (* OCClientContextDeleter)(void *context);
1653 * This info is passed from application to OC Stack when initiating a request to Server.
1655 typedef struct OCCallbackData
1657 /** Pointer to the context.*/
1660 /** The pointer to a function the stack will call to handle the requests.*/
1661 OCClientResponseHandler cb;
1663 /** A pointer to a function to delete the context when this callback is removed.*/
1664 OCClientContextDeleter cd;
1666 #ifdef SUPPORTS_DEFAULT_CTOR
1667 OCCallbackData() = default;
1668 OCCallbackData(void* ctx, OCClientResponseHandler callback, OCClientContextDeleter deleter)
1669 :context(ctx), cb(callback), cd(deleter){}
1674 * Application server implementations must implement this callback to consume requests OTA.
1675 * Entity handler callback needs to fill the resPayload of the entityHandlerRequest.
1677 * When you set specific return value like OC_EH_CHANGED, OC_EH_CONTENT,
1678 * OC_EH_SLOW and etc in entity handler callback,
1679 * ocstack will be not send response automatically to client
1680 * except for error return value like OC_EH_ERROR.
1682 * If you want to send response to client with specific result,
1683 * OCDoResponse API should be called with the result value.
1687 * OCEntityHandlerResponse response;
1691 * response.ehResult = OC_EH_CHANGED;
1695 * OCDoResponse(&response)
1701 typedef OCEntityHandlerResult (*OCEntityHandler)
1702 (OCEntityHandlerFlag flag, OCEntityHandlerRequest * entityHandlerRequest, void* callbackParam);
1705 * Device Entity handler need to use this call back instead of OCEntityHandler.
1707 * When you set specific return value like OC_EH_CHANGED, OC_EH_CONTENT,
1708 * OC_EH_SLOW and etc in entity handler callback,
1709 * ocstack will be not send response automatically to client
1710 * except for error return value like OC_EH_ERROR.
1712 * If you want to send response to client with specific result,
1713 * OCDoResponse API should be called with the result value.
1717 * OCEntityHandlerResponse response;
1721 * response.ehResult = OC_EH_CHANGED;
1725 * OCDoResponse(&response)
1731 typedef OCEntityHandlerResult (*OCDeviceEntityHandler)
1732 (OCEntityHandlerFlag flag, OCEntityHandlerRequest * entityHandlerRequest, char* uri, void* callbackParam);
1734 //#ifdef DIRECT_PAIRING
1736 * Callback function definition of direct-pairing
1738 * @param[OUT] ctx - user context returned in the callback.
1739 * @param[OUT] peer - pairing device info.
1740 * @param[OUT] result - It's returned with 'OC_STACK_XXX'. It will return 'OC_STACK_OK'
1741 * if D2D pairing is success without error
1743 typedef void (*OCDirectPairingCB)(void *ctx, OCDPDev_t *peer, OCStackResult result);
1744 //#endif // DIRECT_PAIRING
1745 #if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
1747 * Callback function definition for Change in TrustCertChain
1749 * @param[IN] ctx - user context returned in the callback.
1750 * @param[IN] credId - trustCertChain changed for this ID
1751 * @param[IN] trustCertChain - trustcertchain binary blob.
1752 * @param[IN] chainSize - size of trustchain
1754 typedef void (*TrustCertChainChangeCB)(void *ctx, uint16_t credId, uint8_t *trustCertChain,
1758 * certChain context structure.
1760 typedef struct trustCertChainContext
1762 TrustCertChainChangeCB callback;
1764 } trustCertChainContext_t;
1779 * Callback function to receive the OTM event on server side.
1781 * @param[in] ctx user context returned in the callback
1782 * @param[in] addr PT's address (address can be NULL in case of init state)
1783 * @param[in] port PT's port (It is meaningless in case of init state & BLE)
1784 * @param[in] uuid PT's UUID (UUID can be NULL in case of init state & coap reqest)
1785 * @param[in] event OTM state (@ref OCOtmEvent_t)
1787 typedef void (*OCOtmEventHandler)(void *ctx, const char *addr, uint16_t port,
1788 const char *ownerId, OCOtmEvent_t event);
1792 #endif // __cplusplus
1794 #endif /* OCTYPES_H_ */