minSdkVersion 21\r
targetSdkVersion 21\r
versionCode 1\r
- versionName "1.1.1"\r
+ versionName "1.2.0"\r
buildConfigField 'int', 'SECURED', SECURED\r
buildConfigField 'int', 'WITH_CLOUD', WITH_CLOUD\r
buildConfigField "int", 'WITH_MQ_PUB', WITH_MQ_PUB\r
}
else
{
- result = OC_STACK_ERROR;
+ result = OC_STACK_INVALID_CALLBACK;
}
}
unit_tests()
elif str(sys.argv[1]) == "linux":
- build_all("true", "")
- build_all("false", "")
+ build_linux("true", "")
+ build_linux("false", "")
elif str(sys.argv[1]) == "linux_unsecured":
build_linux_unsecured("true", "")
import os
import platform
+project_version = '1.2.0'
+
# Map of host os and allowed target os (host: allowed target os)
host_target_map = {
'linux': ['linux', 'android', 'arduino', 'yocto', 'tizen'],
logging_default = (release_mode == False)
-
######################################################################
# Common build options (release, target os, target arch)
######################################################################
######################################################################
pc_file = env.get('SRC_DIR') + '/iotivity.pc.in'
-if env.get('ROUTING') == 'GW':
- routing_define = 'ROUTING_GATEWAY'
-elif env.get('ROUTING') == 'EP':
- routing_define = 'ROUTING_EP'
-
user_prefix = env.get('PREFIX')
user_lib = env.get('LIB_INSTALL_DIR')
+
+if not user_prefix:
+ user_prefix = env.get('BUILD_DIR').encode('string_escape')
+
if not user_lib:
- user_lib = '$${prefix}/lib'
-
-if user_prefix:
- pc_vars = {'\@PREFIX\@': user_prefix,
- '\@EXEC_PREFIX\@':user_prefix,
- '\@VERSION\@': '1.1.1',
- '\@LIB_INSTALL_DIR\@': user_lib,
- '\@ROUTING_DEFINE\@': routing_define
- }
-else:
- pc_vars = {'\@PREFIX\@': env.get('BUILD_DIR').encode('string_escape'),
- '\@EXEC_PREFIX\@': env.get('BUILD_DIR').encode('string_escape'),
- '\@VERSION\@': '1.1.1',
- '\@LIB_INSTALL_DIR\@': user_lib,
- '\@ROUTING_DEFINE\@': routing_define
- }
+ user_lib = '$${prefix}/lib'
+
+defines = []
+if env.get('LOGGING'):
+ defines.append('-DTB_LOG=1')
+
+if env.get('ROUTING') == 'GW':
+ defines.append('-DROUTING_GATEWAY=1')
+elif env.get('ROUTING') == 'EP':
+ defines.append('-DROUTING_EP=1')
+
+pc_vars = {
+ '\@VERSION\@': project_version,
+ '\@PREFIX\@': user_prefix,
+ '\@EXEC_PREFIX\@': user_prefix,
+ '\@LIB_INSTALL_DIR\@': user_lib,
+ '\@DEFINES\@': " ".join(defines)
+}
env.Substfile(pc_file, SUBST_DICT = pc_vars)
env.AppendUnique(LIBS = ['log', 'coap'])
if env.get('SECURED') == '1':
+ env.SConscript('#extlibs/tinydtls/SConscript')
env.AppendUnique(LIBS = ['tinydtls'])
if env.get('WITH_TCP'):
+ env.SConscript('#extlibs/mbedtls/SConscript')
env.AppendUnique(LIBS = ['mbedtls','mbedx509','mbedcrypto'])
# From android-5 (API > 20), all application must be built with flags '-fPIE' '-pie'.
+# -*- mode: python; python-indent-offset: 4; indent-tabs-mode: nil -*-
##
# 'googletest' script to check if Google Unit Test library is installed.
# If not, get it and install it
gtest_lib_dir = os.path.join(gtest_dir,'lib')
gtest_dotlib_dir = os.path.join(gtest_lib_dir, '.libs')
gtest_zip_file = os.path.join(src_dir, 'extlibs', 'gtest', 'gtest-1.7.0.zip')
-gtest_url = 'https://googletest.googlecode.com/files/gtest-1.7.0.zip'
+gtest_url = 'http://pkgs.fedoraproject.org/repo/pkgs/gtest/gtest-1.7.0.zip/2d6ec8ccdf5c46b05ba54a9fd1d130d7/gtest-1.7.0.zip'
if target_os in targets_need_gtest:
print '*** Checking for installation of google unit test 1.7.0 ***'
-I${svcincludedir}/resource-hosting \
-I${svcincludedir}/resource-directory \
-I${svcincludedir}/things-manager \
- -D@ROUTING_DEFINE@
+ @DEFINES@
randomtest_env.AppendUnique(LIBPATH = [randomtest_env.get('BUILD_DIR')])
randomtest_env.PrependUnique(LIBS = ['octbstack',
- 'uuid'])
+ 'connectivity_abstraction',
+ 'uuid'])
if target_os in ['linux']:
randomtest_env.AppendUnique(LIBS = ['m'])
if target_os in ['tizen', 'linux']:
liboctbstack_env.ParseConfig("pkg-config --cflags --libs uuid")
+if target_os in ['tizen']:
+ liboctbstack_env.ParseConfig('pkg-config --cflags --libs sqlite3')
if target_os == 'arduino':
liboctbstack_env.AppendUnique(CPPDEFINES = ['NDEBUG', 'WITH_ARDUINO'])
liboctbstack_src.extend(env['cbor_files'])
+# Insert a hack for Arduino, whose compiler may not support all defines expected
+# by tinycbor
+if target_os in ['arduino']:
+ liboctbstack_env.AppendUnique(CPPDEFINES = ['INT64_MAX=0x7FFFFFFFFFFFFFFF'])
+
if target_os in ['windows', 'msys_nt']:
# Avoid a name conflict with the octbstack.lib target of the SharedLibrary.
static_liboctbstack = liboctbstack_env.StaticLibrary('octbstack_static', liboctbstack_src)
Name: com-oic-ca
-Version: 1.1.1
+Version: 1.2.0
Release: 0
Summary: Tizen oicca application
URL: http://slp-source.sec.samsung.net
env.SConscript(os.path.join(root_dir, tls_path + '/SConscript'))
env.AppendUnique(CPPPATH = [os.path.join(root_dir, tls_path + '/' + tls_headers_path)])
else:
- env.SConscript('#' + tls_path + '/SConscript')
+ if ca_os != 'android':
+ env.SConscript('#' + tls_path + '/SConscript')
env.AppendUnique(CPPPATH = ['#' + tls_path + '/' + tls_headers_path])
env.AppendUnique(CA_SRC = [os.path.join(ca_path, 'adapter_util/ca_adapter_net_tls.c')])
return (int)retLen;
}
-//TODO add description
+/**
+ * Parse chain of X.509 certificates.
+ *
+ * @param[out] crt container for X.509 certificates
+ * @param[in] data buffer with X.509 certificates. Certificates may be in either in PEM
+ or DER format in a jumble. Each PEM certificate must be NULL-terminated.
+ * @param[in] buflen buffer length
+ *
+ * @return 0 on success, -1 on error
+ */
static int parseChain(mbedtls_x509_crt * crt, const unsigned char * buf, int buflen)
{
VERIFY_NON_NULL_RET(crt, NET_TLS_TAG, "Param crt is NULL" , -1);
VERIFY_NON_NULL_RET(buf, NET_TLS_TAG, "Param buf is NULL" , -1);
+ char pemCertHeader[] = {
+ 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52,
+ 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d
+ };
+ char pemCertFooter[] = {
+ 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49,
+ 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x00
+ };
+ size_t pemCertHeaderLen = sizeof(pemCertHeader);
+ size_t pemCertFooterLen = sizeof(pemCertFooter);
+
int pos = 0;
int len = 0;
int ret = 0;
len = (((int) buf[pos+2]) << 8) | buf[pos+3];
if (pos + len < buflen)
{
- ret = mbedtls_x509_crt_parse_der(crt, buf+pos, len+4);
+ ret = mbedtls_x509_crt_parse_der(crt, buf+pos, len + 4);
if( 0 != ret)
{
OIC_LOG_V(ERROR, NET_TLS_TAG, "mbedtls_x509_crt_parse returned -0x%x", -ret);
}
pos += len + 4;
}
+ else if (0 == memcmp(buf + pos, pemCertHeader, pemCertHeaderLen))
+ {
+ void * endPos = NULL;
+ endPos = memmem(&(buf[pos]), buflen - pos, pemCertFooter, pemCertFooterLen);
+ if (NULL == endPos)
+ {
+ OIC_LOG(ERROR, NET_TLS_TAG, "Error: end of PEM certificate not found.");
+ return -1;
+ }
+ len = (char*)endPos - ((char*)(buf + pos)) + pemCertFooterLen;
+ ret = mbedtls_x509_crt_parse(crt, buf, len);
+ pos += len;
+ }
else
{
OIC_LOG_V(ERROR, NET_TLS_TAG, "mbedtls_x509_crt_parse returned -0x%x", -ret);
#ifndef LOGGER_H_
#define LOGGER_H_
-#define IOTIVITY_VERSION "1.1.1"
+#define IOTIVITY_VERSION "1.2.0"
#include <stdint.h>
#include <stdio.h>
OCSRM_SRC + 'directpairing.c'
]
-if env.get('SECURED') == '1':
- libocsrm_src = libocsrm_src + [OCSRM_SRC + 'oxmpincommon.c', OCSRM_SRC + 'pbkdf2.c']
+if libocsrm_env.get('SECURED') == '1':
+ if target_os in ['tizen']:
+ libocsrm_env.ParseConfig('pkg-config --cflags --libs sqlite3')
+ else:
+ libocsrm_env.AppendUnique(CPPPATH = ['../../../extlibs/sqlite3'])
+ libocsrm_src = libocsrm_src + ['../../../extlibs/sqlite3/sqlite3.c']
+ libocsrm_src = libocsrm_src + [OCSRM_SRC + 'provisioningdatabasemanager.c']
+ libocsrm_src = libocsrm_src + [OCSRM_SRC + 'oxmpincommon.c', OCSRM_SRC + 'pbkdf2.c']
if target_os in ['windows', 'msys_nt']:
libocsrm_src = libocsrm_src + [OCSRM_SRC + 'strptime.c']
OCStackResult GetDoxmDeviceID(OicUuid_t *deviceID);
/**
+ * This method changes the SRM device ID for this device.
+ * This api will update device Id iff device is in unowned state.
+ * @return ::OC_STACK_OK for Success, otherwise some error value.
+ */
+OCStackResult SetDoxmDeviceID(const OicUuid_t *deviceID);
+
+
+/**
* Gets the OicUuid_t value for the owner of this device.
*
* @param devownerid a pointer to be assigned to the devownerid property
'src/secureresourceprovider.c',
'src/ocprovisioningmanager.c',
'src/oxmjustworks.c',
- 'src/oxmrandompin.c',
- 'src/provisioningdatabasemanager.c' ]
+ 'src/oxmrandompin.c' ]
if target_os != 'tizen':
provisioning_src = provisioning_src + [root_dir+'/extlibs/sqlite3/sqlite3.c' ]
if target_os == 'tizen':
provisioning_env.AppendUnique(CPPDEFINES = ['__TIZEN__'])
+ provisioning_env.ParseConfig('pkg-config --cflags --libs sqlite3')
######################################################################
# Source files and Targets
// display the CRED-provisioned result
printf(" > Provisioned Selected Pairwise Crendentials\n");
- printf(" > Please Check Device's Status for the Linked Result, with [33] Menu\n");
+ printf(" > Please Check Device's Status for the Linked Result, with [34] Menu\n");
return 0;
}
\r
switch(connType & CT_MASK_ADAPTER)\r
{\r
+// @todo: Remove this ifdef. On Arduino, CT_ADAPTER_TCP resolves to the same value\r
+// as CT_ADAPTER_IP, resulting in a compiler error.\r
+#ifdef WITH_TCP\r
+#ifndef WITH_ARDUINO\r
case CT_ADAPTER_TCP:\r
prefix = (isSecure == true) ? QPREFIX_COAPS_TCP : QPREFIX_COAP_TCP;\r
+#endif\r
+#endif\r
case CT_ADAPTER_IP:\r
switch(connType & CT_MASK_FLAGS & ~CT_FLAG_SECURE)\r
{\r
#include "credresource.h"
#include "srmutility.h"
#include "pinoxmcommon.h"
+#include "pmtypes.h"
+#include "provisioningdatabasemanager.h"
#define TAG "SRM-DOXM"
return OC_STACK_ERROR;
}
+OCStackResult SetDoxmDeviceID(const OicUuid_t *deviceID)
+{
+ bool isPT = false;
+
+ if(NULL == deviceID)
+ {
+ return OC_STACK_INVALID_PARAM;
+ }
+ if(NULL == gDoxm)
+ {
+ OIC_LOG(ERROR, TAG, "Doxm resource is not initialized.");
+ return OC_STACK_NO_RESOURCE;
+ }
+
+ //Check the device's OTM state
+
+#ifdef __WITH_DTLS__
+ //for PT.
+ if(true == gDoxm->owned &&
+ memcmp(gDoxm->deviceID.id, gDoxm->owner.id, sizeof(gDoxm->owner.id)) == 0)
+ {
+ OCUuidList_t* ownedDevices = NULL;
+ size_t* ownedDevNum = 0;
+
+ if(OC_STACK_OK == PDMGetOwnedDevices(&ownedDevices, &ownedDevNum))
+ {
+ OCUuidList_t* temp1 = NULL;
+ OCUuidList_t* temp2 = NULL;
+ LL_FOREACH_SAFE(ownedDevices, temp1, temp2)
+ {
+ LL_DELETE(ownedDevices, temp1);
+ OICFree(temp1);
+ }
+
+ if(0 != ownedDevNum)
+ {
+ OIC_LOG(ERROR, TAG, "This device has ownership for other device.");
+ OIC_LOG(ERROR, TAG, "Device UUID cannot be changed to guarantee the reliability of the connection.");
+ return OC_STACK_ERROR;
+ }
+ }
+
+ isPT = true;
+ }
+ //for normal device.
+ else if(true == gDoxm->owned)
+ {
+ OIC_LOG(ERROR, TAG, "This device owned by owner's device.");
+ OIC_LOG(ERROR, TAG, "Device UUID cannot be changed to guarantee the reliability of the connection.");
+ return OC_STACK_ERROR;
+ }
+#endif //__WITH_DTLS
+
+ //Save the previous UUID
+ OicUuid_t tempUuid;
+ memcpy(tempUuid.id, gDoxm->deviceID.id, sizeof(tempUuid.id));
+
+ //Change the UUID
+ memcpy(gDoxm->deviceID.id, deviceID->id, sizeof(deviceID->id));
+ if(isPT)
+ {
+ memcpy(gDoxm->owner.id, deviceID->id, sizeof(deviceID->id));
+ memcpy(gDoxm->rownerID.id, deviceID->id, sizeof(deviceID->id));
+ }
+
+ //Update PS
+ if(!UpdatePersistentStorage(gDoxm))
+ {
+ //revert UUID in case of update error
+ memcpy(gDoxm->deviceID.id, tempUuid.id, sizeof(tempUuid.id));
+ if(isPT)
+ {
+ memcpy(gDoxm->owner.id, tempUuid.id, sizeof(tempUuid.id));
+ memcpy(gDoxm->rownerID.id, tempUuid.id, sizeof(tempUuid.id));
+ }
+
+ OIC_LOG(ERROR, TAG, "Failed to update persistent storage");
+ return OC_STACK_ERROR;
+ }
+ return OC_STACK_OK;
+}
+
OCStackResult GetDoxmDevOwnerId(OicUuid_t *devownerid)
{
OCStackResult retVal = OC_STACK_ERROR;
%{!?VERBOSE: %define VERBOSE 1}
Name: com-oic-ri-sample
-Version: 1.1.1
+Version: 1.2.0
Release: 0
Summary: Tizen adapter interfacesample application
URL: http://slp-source.sec.samsung.net
%{!?VERBOSE: %define VERBOSE 1}
Name: com-oic-ri
-Version: 1.1.1
+Version: 1.2.0
Release: 0
Summary: Tizen oicri application
URL: http://slp-source.sec.samsung.net
if target_os in ['darwin', 'ios']:
examples_env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
+if target_os == 'tizen':
+ examples_env.AppendUnique(CPPDEFINES = ['__TIZEN__'])
+
######################################################################
# Source files and Targets
return OC_STACK_DELETE_TRANSACTION;
}
+ std::string resourceURI = clientResponse->resourceUri;
if (clientResponse->result != OC_STACK_OK)
{
oclog() << "listenMQCallback(): failed to create resource. clientResponse: "
<< std::flush;
std::thread exec(context->callback, clientResponse->result,
- std::string(clientResponse->resourceUri), nullptr);
+ resourceURI, nullptr);
exec.detach();
return OC_STACK_DELETE_TRANSACTION;
for (auto resource : container.Resources())
{
std::thread exec(context->callback, clientResponse->result,
- std::string(clientResponse->resourceUri), resource);
+ resourceURI, resource);
exec.detach();
}
}
if target_os == 'tizen':
oclib_env.AppendUnique(CPPDEFINES = ['__TIZEN__'])
+ oclib_env.ParseConfig('pkg-config --cflags --libs sqlite3')
if target_os in ['linux'] and oclib_env.get('SIMULATOR', False):
oclib_env.Append( RPATH = oclib_env.Literal('\\$$ORIGIN'))
easy_setup_env.AppendUnique(CPPPATH = [
env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include',
env.get('SRC_DIR') + '/resource/csdk/connectivity/api/',
+ env.get('SRC_DIR') + '/resource/csdk/security/include/internal',
env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include/internal',
env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include/oxm'])
if env.get('WITH_TCP') == True:
try
{
nativeRemoteEnrollee = EasySetup::getInstance()->createRemoteEnrollee(jniOcResource->getOCResource());
+ if (!nativeRemoteEnrollee)
+ {
+ ES_LOGE("Failed to create RemoteEnrollee object.");
+ return NULL;
+ }
+
//create the java object
jRemoteEnrollee = env->NewObject(g_cls_RemoteEnrollee, g_mid_RemoteEnrollee_ctor);
if (!jRemoteEnrollee)
Depends(cmdBuildEasysetup, env.get('baseAAR'))
+env.AppendUnique(easysetupAAR = cmdBuildEasysetup)
\ No newline at end of file
return false;
}
+
+ std::string EnrolleeSecurity::getUUID() const
+ {
+ return m_ocResource->sid();
+ };
+
+#if defined(__WITH_DTLS__) && defined(__WITH_TLS__)
void EnrolleeSecurity::provisionSecurityForCloudServer(
std::string cloudUuid, int credId)
{
return res;
}
- std::string EnrolleeSecurity::getUUID() const
- {
- return m_ocResource->sid();
- };
-
OicSecAcl_t* EnrolleeSecurity::createAcl(const OicUuid_t cloudUuid)
{
// allocate memory for |acl| struct
}
m_cond.notify_all();
}
+#endif //defined(__WITH_DTLS__) && defined(__WITH_TLS__)
}
}
const SecurityPinCb securityPinCb,
const SecProvisioningDbPathCb secProvisioningDbPathCb);
void provisionOwnership();
- void provisionSecurityForCloudServer(
- std::string cloudUuid, int credId);
std::string getUUID() const;
private:
std::atomic<bool> aclResult;
std::atomic<bool> certResult;
- ESResult performCertProvisioningForCloudServer(
- std::shared_ptr< OC::OCSecureResource > ownedDevice,
- int credId);
- ESResult performACLProvisioningForCloudServer(
- std::shared_ptr< OC::OCSecureResource > ownedDevice,
- std::string& cloudUuid);
-
std::shared_ptr< OC::OCSecureResource > m_securedResource;
std::shared_ptr< OC::OCSecureResource > findEnrolleeSecurityResource(
OC::DeviceList_t &list);
void convertUUIDToString(const uint8_t uuid[UUID_SIZE],
std::string& uuidString);
void convertStringToUUID(OicUuid_t& uuid, const std::string uuidString);
- OicSecAcl_t* createAcl(const OicUuid_t cloudUuid);
+#if defined(__WITH_DTLS__) && defined(__WITH_TLS__)
+ public:
+ void provisionSecurityForCloudServer(
+ std::string cloudUuid, int credId);
+ private:
+ ESResult performCertProvisioningForCloudServer(
+ std::shared_ptr< OC::OCSecureResource > ownedDevice,
+ int credId);
+ ESResult performACLProvisioningForCloudServer(
+ std::shared_ptr< OC::OCSecureResource > ownedDevice,
+ std::string& cloudUuid);
+ OicSecAcl_t* createAcl(const OicUuid_t cloudUuid);
void ACLProvisioningCb(PMResultList_t *result, int hasError);
void CertProvisioningCb(PMResultList_t *result, int hasError);
+#endif //defined(__WITH_DTLS__) && defined(__WITH_TLS__)
};
}
}
{
ESResult result = ES_ERROR;
- if (m_cloudResource != nullptr)
- {
- throw ESBadRequestException ("Already created");
- }
-
result = discoverResource();
if (result == ES_ERROR)
m_cloudPropProvStatusCb(provStatus);
return;
}
-#endif
+#endif //defined(__WITH_DTLS__) && defined(__WITH_TLS__)
if (m_cloudResource == nullptr)
{
help_vars.Add(BoolVariable('UPLOAD', 'Upload binary ? (For Arduino)', require_upload))
help_vars.Add(EnumVariable('ROUTING', 'Enable routing', 'EP', allowed_values=('GW', 'EP')))
help_vars.Add(EnumVariable('BUILD_SAMPLE', 'Build with sample', 'ON', allowed_values=('ON', 'OFF')))
-
+help_vars.Add(BoolVariable('WITH_TCP', 'Build with TCP adapter', False))
+help_vars.Add(BoolVariable('WITH_CLOUD', 'Build including AccountManager class and Cloud Client sample', False))
help_vars.AddVariables(('DEVICE_NAME', 'Network display name for device', 'OIC-DEVICE', None, None),)
#ES_TARGET_ENROLLEE is for specifying what is our target enrollee (Arduino or rest of platforms which support Multicast)
print "Given Transport is %s" % transport
print "Given OS is %s" % target_os
print "Given es_target_enrollee is %s" % es_target_enrollee
-
+print "Given tcp option is %s" % with_tcp
+print "Given cloud option is %s" %with_cloud
if target_os == 'tizen':
command = "sh service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/tizen/gbsbuild.sh %s %s %s %s %s %s %s %s" % (transport, secured, routing, release_mode, logging, es_target_enrollee, with_tcp, with_cloud)
%{!?VERBOSE: %define VERBOSE 1}
Name: com-oic-es-sample
-Version: 1.1.1
+Version: 1.2.0
Release: 0
Summary: Tizen adapter interfacesample application
URL: http://slp-source.sec.samsung.net
cmdBuildEasysetupApp=jdk_env.Gradle(target="EasySetup/app/apk",
source="EasySetup/app/src/main/java/org/iotivity/service/easysetup/EasysetupActivity.java")
-Depends(cmdBuildEasysetupApp, env.get('baseAAR'))
\ No newline at end of file
+Depends(cmdBuildEasysetupApp, env.get('easysetupAAR'))
\ No newline at end of file
#include <stdexcept>
#include <utility>
#include "InternalTypes.h"
+#include <string.h>
#define CONTAINER_TAG "RESOURCE_CONTAINER"
#define DISCOVER_TAG "DISCOVER_RESOURCE_UNIT"
TEST_F(DiscoverResourceUnitTest, startDiscover)
{
- std::string type = "Resource.Container";
+ std::string type = "resource.container";
std::string attributeName = "TestResourceContainer";
m_pDiscoverResourceUnit->startDiscover(
DiscoverResourceUnit::DiscoverResourceInfo("", type, attributeName), m_updatedCB);
- std::chrono::milliseconds interval(400);
+ std::chrono::milliseconds interval(ResourceContainerTestSimulator::DEFAULT_WAITTIME);
std::this_thread::sleep_for(interval);
}
TEST_F(DiscoverResourceUnitTest, onUpdateCalled)
{
- std::string type = "Resource.Container";
+ std::string type = "resource.container";
std::string attributeName = "TestResourceContainer";
m_pDiscoverResourceUnit->startDiscover(
DiscoverResourceUnit::DiscoverResourceInfo("", type, attributeName), m_updatedCB);
- std::chrono::milliseconds interval(400);
+ std::chrono::milliseconds interval(ResourceContainerTestSimulator::DEFAULT_WAITTIME);
std::this_thread::sleep_for(interval);
testObject->ChangeAttributeValue();
-
}
namespace
RCSResourceObject::Ptr server;
RCSRemoteResourceObject::Ptr remoteResource;
+ static constexpr int DEFAULT_WAITTIME = 3000;
+
private:
std::mutex mutexForDiscovery;
RESOURCEURI("/a/TempHumSensor/Container"),
RESOURCETYPE("resource.container"),
RESOURCEINTERFACE("oic.if.baseline"),
- ATTR_KEY("Temperature"),
+ ATTR_KEY("TestResourceContainer"),
ATTR_VALUE(0)
{ }
}
void waitForDiscovery()
{
- std::chrono::milliseconds interval(100);
+ std::chrono::milliseconds interval(DEFAULT_WAITTIME);
while (true)
{
if (mutexForDiscovery.try_lock())
void ChangeAttributeValue()
{
- std::chrono::milliseconds interval(100);
+ std::chrono::milliseconds interval(DEFAULT_WAITTIME);
if (server != nullptr)
server->setAttribute(ATTR_KEY, ATTR_VALUE + 10);
std::this_thread::sleep_for(interval);
void ChangeResourceState()
{
- std::chrono::milliseconds interval(400);
+ std::chrono::milliseconds interval(DEFAULT_WAITTIME);
if (server != nullptr)
server = nullptr;
std::this_thread::sleep_for(interval);
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name:'iotivity-armeabi-service-release', ext:'aar')
- compile(name:'iotivity-armeabi-base-release', ext:'aar')
+ compile(name:'iotivity-base-armeabi-release', ext:'aar')
}
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name:'iotivity-armeabi-service-release', ext:'aar')
- compile(name:'iotivity-armeabi-base-release', ext:'aar')
+ compile(name:'iotivity-base-armeabi-release', ext:'aar')
}
Name: iotivity
-Version: 1.1.1
+Version: 1.2.0
Release: 0
Summary: IoT Connectivity sponsored by the OCF
Group: Network & Connectivity/Other