OCSRM_SRC + 'base64.c',
#pbkdf2.c is required to PIN based OxM only.
#But we did not use a separate build options to prevent the build command becomes complicated.
- OCSRM_SRC + 'pbkdf2.c'
+ OCSRM_SRC + 'pbkdf2.c',
+ OCSRM_SRC + 'directpairing.c'
]
else:
libocsrm_src = [
OCSRM_SRC + 'srmresourcestrings.c',
OCSRM_SRC + 'srmutility.c',
OCSRM_SRC + 'iotvticalendar.c',
- OCSRM_SRC + 'base64.c'
+ OCSRM_SRC + 'base64.c',
+ OCSRM_SRC + 'directpairing.c'
]
if env.get('DTLS_WITH_X509') == '1' and env.get('SECURED') == '1':
crl_src = [OCSRM_SRC + 'crlresource.c']
libocsrm_src = libocsrm_src + crl_src
-if target_os != 'arduino':
- dp_src = [OCSRM_SRC + 'directpairing.c']
- libocsrm_src = libocsrm_src + dp_src
libocsrm = libocsrm_env.StaticLibrary('libocsrm', libocsrm_src)
#ifndef _POSIX_C_SOURCE\r
#define _POSIX_C_SOURCE 200112L\r
#endif\r
-\r
+#ifndef WITH_ARDUINO\r
#include <unistd.h>\r
-#include <string.h>\r
#include <time.h>\r
#include <sys/time.h>\r
+#endif\r
+#include <string.h>\r
\r
#include "ocstack.h"\r
#include "oic_malloc.h"\r
static DPairData_t *g_dp_proceed_ctx = NULL;\r
\r
\r
-const char *getResult(OCStackResult result) {\r
- switch (result) {\r
- case OC_STACK_OK:\r
- return "OC_STACK_OK";\r
- case OC_STACK_RESOURCE_CREATED:\r
- return "OC_STACK_RESOURCE_CREATED";\r
- case OC_STACK_RESOURCE_DELETED:\r
- return "OC_STACK_RESOURCE_DELETED";\r
- case OC_STACK_INVALID_URI:\r
- return "OC_STACK_INVALID_URI";\r
- case OC_STACK_INVALID_QUERY:\r
- return "OC_STACK_INVALID_QUERY";\r
- case OC_STACK_INVALID_IP:\r
- return "OC_STACK_INVALID_IP";\r
- case OC_STACK_INVALID_PORT:\r
- return "OC_STACK_INVALID_PORT";\r
- case OC_STACK_INVALID_CALLBACK:\r
- return "OC_STACK_INVALID_CALLBACK";\r
- case OC_STACK_INVALID_METHOD:\r
- return "OC_STACK_INVALID_METHOD";\r
- case OC_STACK_NO_MEMORY:\r
- return "OC_STACK_NO_MEMORY";\r
- case OC_STACK_COMM_ERROR:\r
- return "OC_STACK_COMM_ERROR";\r
- case OC_STACK_INVALID_PARAM:\r
- return "OC_STACK_INVALID_PARAM";\r
- case OC_STACK_NOTIMPL:\r
- return "OC_STACK_NOTIMPL";\r
- case OC_STACK_NO_RESOURCE:\r
- return "OC_STACK_NO_RESOURCE";\r
- case OC_STACK_RESOURCE_ERROR:\r
- return "OC_STACK_RESOURCE_ERROR";\r
- case OC_STACK_SLOW_RESOURCE:\r
- return "OC_STACK_SLOW_RESOURCE";\r
- case OC_STACK_NO_OBSERVERS:\r
- return "OC_STACK_NO_OBSERVERS";\r
- case OC_STACK_UNAUTHORIZED_REQ:\r
- return "OC_STACK_UNAUTHORIZED_REQ";\r
- #ifdef WITH_PRESENCE\r
- case OC_STACK_PRESENCE_STOPPED:\r
- return "OC_STACK_PRESENCE_STOPPED";\r
- #endif\r
- case OC_STACK_ERROR:\r
- return "OC_STACK_ERROR";\r
- default:\r
- return "UNKNOWN";\r
- }\r
-}\r
-\r
/**\r
* Function to search node in linked list that matches given IP and port.\r
*\r
}\r
\r
break;\r
+#ifndef WITH_ARDUINO\r
// TODO: We need to verify tinyDTLS in below cases\r
case CT_ADAPTER_GATT_BTLE:\r
case CT_ADAPTER_RFCOMM_BTEDR:\r
OIC_LOG(ERROR, TAG, "Not supported connectivity adapter.");\r
return false;\r
break;\r
+#endif\r
default:\r
OIC_LOG(ERROR, TAG, "Unknown connectivity adapter.");\r
return false;\r
(void)UNUSED;\r
if (clientResponse)\r
{\r
- OIC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));\r
+ OIC_LOG_V(INFO, TAG, "StackResult: %s", clientResponse->result);\r
OIC_LOG_V(INFO, TAG,\r
"Device =============> Discovered @ %s:%d",\r
clientResponse->devAddr.addr,\r
if(wr_len <= 0 || (size_t)wr_len >= sizeof(rsrc_uri))\r
{\r
OIC_LOG(ERROR, TAG, "rsrc_uri_string_print failed");\r
- return OC_STACK_ERROR;\r
+ return OC_STACK_KEEP_TRANSACTION;\r
}\r
\r
//Try to the unicast discovery to getting secure port\r
\r
return OC_STACK_DELETE_TRANSACTION;\r
}\r
-\r
+#ifndef WITH_ARDUINO\r
/**\r
* Discover direct-pairing devices in the same IP subnet. .\r
*\r
OIC_LOG(DEBUG, TAG, "OUT DPDeviceDiscovery");\r
return ret;\r
}\r
+#endif\r