contrib/iotivity.git
7 years agoMerge branch 'master' into iot-1785
Kevin Kane [Wed, 22 Mar 2017 02:26:26 +0000 (19:26 -0700)]
Merge branch 'master' into iot-1785

Change-Id: If30ba205d4fcb0b5dc969f83d464509a8059ef3f
Signed-off-by: Kevin Kane <kkane@microsoft.com>
7 years agoFix unused warning error in ACL resource
Kevin Kane [Tue, 21 Mar 2017 20:44:20 +0000 (13:44 -0700)]
Fix unused warning error in ACL resource

Remove fetching of subjectCborType into its own variable, which
ends up being unused if LOGGING is not defined and causes a warning
that breaks the build; instead, fetch the value as part of the
logging call so it also gets compiled out if LOGGING is not defined.

Change-Id: Iee950abe0d7c160d2feb50138df5fe39c69addf4
Signed-off-by: Kevin Kane <kkane@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18063
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Way Vadhanasin <wayvad@microsoft.com>
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
Reviewed-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
7 years agombedtls: remove Tizen specific case
Philippe Coval [Wed, 8 Mar 2017 10:40:38 +0000 (11:40 +0100)]
mbedtls: remove Tizen specific case

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I74ab383626672ec37287514b37826b23135b2f64
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17857
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agoRemoved easy-setup TC associated with
Parkhi [Tue, 21 Mar 2017 04:31:56 +0000 (13:31 +0900)]
Removed easy-setup TC associated with
 https://gerrit.iotivity.org/gerrit/#/c/17995/

 - ThrowExceptionWhenProvisionDeviceProperiesFailedWithoutSSID

Change-Id: I59058bdbf5e585979dae643d66279adc9886c65a
Signed-off-by: Parkhi <h_w.park@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18037
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
7 years agoAdded Software Version Validation and Update oic.sec.dpmtype bits (CR-24)
Craig Pratt [Mon, 27 Feb 2017 00:47:30 +0000 (16:47 -0800)]
Added Software Version Validation and Update oic.sec.dpmtype bits (CR-24)

Added oic.sec.dpmtype bitfield definitions and pstat.tm change
 detection logic.

Changed the SVR enum declarations to uints instead of enums to avoid
 C++ type conversion errors and enable bitfield operations on these fields.
 This was causing compilation errors on arduino builds when doing
 bitfield operations on pstat.tm/.cm.

Change-Id: I31b07cc040a2d22296d6cd75897b69a0d06b5eb4
Author: Craig Pratt <craig@ecaspia.com>
Signed-off-by: Craig Pratt <craig@ecaspia.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17521
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
7 years ago[IOT-1880] Adding Fixes for issues generated from static analyzer tool in Notificatio...
Poovizhi [Fri, 3 Mar 2017 10:24:09 +0000 (15:54 +0530)]
[IOT-1880] Adding Fixes for issues generated from static analyzer tool in Notification service c++ , JNI layer

1) In JNINotificationConsumer.cpp, Getting native Provider object is common code for all the native methods.
   Added a separate method ' getNativeProvider' to do this, so that method size and complexity will be reduced.

2) JNiNotificationConsumer.cpp Line 1379, and NSTopicslist.cpp Line 59 has changes to fix the issue of Unreachable code.

3) Copy constructor and copy assignment operator are added  in class 'NSAcceptedProviders' & 'NSAcceptedConsumers'  which has dynamically allocated data members

4) In NSAcceptedProviders class, getProviders() method is changed to const since it is being used by the copy constructors and hence
   modified the member variable 'm_mutex' to be mutable.

5) In NSAcceptedConsumers class, getConsumers() method is changed to const since it is being used by the copy constructors
   and hence modified the member variable 'm_mutex' to be mutable.

6) In  NotiListener.java, the NULL check for mProviderSample is moved above the first instance where mProviderSample is beig used.

Change-Id: Ic18c3d9797a02a73f5397192b21e7dda5926119e
Signed-off-by: Poovizhi <poovizhi.a@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17653
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
7 years agobuild: Add stack and logger pathes to pkg-config
Philippe Coval [Fri, 10 Mar 2017 18:07:29 +0000 (19:07 +0100)]
build: Add stack and logger pathes to pkg-config

This will prevent errors, like:

/usr/include/iotivity/resource/octypes.h:32:27: \
 fatal error: ocstackconfig.h: No such file or directory

It was tested on Debian

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I8a4f06cd05158e8659628a654dfdbe7e1784e4bc
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17845
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agoUpdate Readme.scons for LOG_LEVEL build option
jihwan.seo [Wed, 15 Mar 2017 10:29:26 +0000 (19:29 +0900)]
Update Readme.scons for LOG_LEVEL build option

Change-Id: I07b98f7bb0e89addf9fafa496aea78061085707d
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17935
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agoRemove a condition of device provisioning
Jihun Ha [Mon, 20 Mar 2017 00:42:31 +0000 (09:42 +0900)]
Remove a condition of device provisioning

There would be a case where user wants to provision only device configuration
without any wifi configuration. In this case, a condition to filter a case of
empty ssid should be removed.

Change-Id: Ib135d40d7f59f1ef0ee1bf7fe24a5a54d737aa96
Signed-off-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17995
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
7 years ago[IOT-1905] Fix for Unit test in Notification service in C++ layer
Poovizhi [Wed, 8 Mar 2017 13:00:33 +0000 (18:30 +0530)]
[IOT-1905] Fix for Unit test in Notification service in C++ layer

Dependency of hippomocks is removed in notificaiton service

Change-Id: I9705e2d92a4eec4addecb5a51893a7898d056867
Signed-off-by: Poovizhi <poovizhi.a@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17779
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
7 years agoFix a wrong return if an user does not set a MOT configuration
Jihun Ha [Fri, 17 Mar 2017 08:20:44 +0000 (17:20 +0900)]
Fix a wrong return if an user does not set a MOT configuration

If an user does not set any MOT configuration and ownership transfer is
successfully done, then a result should be ES_OK.
If ESOwnershipTransferData->getMOTMethod() is OIC_OXM_COUNT, it means user
does not set the configuration.

Change-Id: I055beed8e893ae0754a4f5ea467cbe99f649ca4d
Signed-off-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17973
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
7 years agoFix defects detected by static code analyzer
Parkhi [Fri, 17 Mar 2017 08:20:07 +0000 (17:20 +0900)]
Fix defects detected by static code analyzer

Change-Id: I63dbeed58bae6c943ce8374685bcdaea867ec57e
Signed-off-by: Parkhi <h_w.park@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17975
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Jihun Ha <jihun.ha@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
7 years ago[IOT-1849] fixed null subject ID comparison logic
Nathan Heldt-Sheller [Fri, 24 Feb 2017 19:11:20 +0000 (11:11 -0800)]
[IOT-1849] fixed null subject ID comparison logic

Issue description:
CTT sends requests over coap, but isRequestOverSecureChannel incorrectly concludes
that these requests arrived over a secured channel. That's because here:

if(memcmp(context->requestInfo->info.identity.id,
nullSubjectId.id, sizeof(context->requestInfo->info.identity.id)) != 0)

sizeof(context->requestInfo->info.identity.id) is larger than sizeof(nullSubjectId.id).

So, that compares a bunch of random bytes from the stack with the bytes from
context->requestInfo->info.identity.id.

This changes logic to compare like-sized objects.

patchset 2: resolved IOT-1849; created new IOT-1894 "Determine appropriate CA_MAX_ENDPOINT_IDENTITY_LEN" (see "TODO IOT-1894" comment).

patchset 3: comment typo fix

patchset 4: self review fixes

patchset 5: addressed Dan's feedback

patchset 6: addressed Phil's feedback

patchset 7: replaced if( with if ( throughout

Change-Id: I2781357c74a1e0c47a534bc6df2f2b790c0caae7
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17503
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
7 years ago[IOT-1785] Cache computed roles
Kevin Kane [Tue, 14 Mar 2017 22:32:56 +0000 (15:32 -0700)]
[IOT-1785] Cache computed roles

Only recompute roles for a peer when the list of certificates
changes, or when one of the certificates expires.

Change-Id: Ifb25af82fcaa412b46d7612f024deced667456b9
Signed-off-by: Kevin Kane <kkane@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17945
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Way Vadhanasin <wayvad@microsoft.com>
Reviewed-by: Soemin Tjong <stjong@microsoft.com>
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
7 years ago[IOT-1785] Use a CBOR map for roles in ACL resource
Kevin Kane [Mon, 13 Mar 2017 21:44:25 +0000 (14:44 -0700)]
[IOT-1785] Use a CBOR map for roles in ACL resource

Previous solution used a temporary custom string format to
differentiate UUID-based and role-based subjects. Change this
to using a proper map inside the CBOR for a role, and
differentiate based on whether the subject value is a text string
(in which case it's a UUID type) or a map (in which case a role).

Plug another couple memory leaks found along the way.

Change-Id: Ic592d3538685c9a9ce664619099cfe2ac4889033
Signed-off-by: Kevin Kane <kkane@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17927
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
7 years agoAdd an error code, "ES_ERRCODE_UNSUPPORTED_WIFI_FREQUENCY", in easy setup
Jihun Ha [Fri, 10 Mar 2017 02:10:13 +0000 (11:10 +0900)]
Add an error code, "ES_ERRCODE_UNSUPPORTED_WIFI_FREQUENCY", in easy setup

Added error code:
- ES_ERRCODE_UNSUPPORTED_WIFI_FREQUENCY = 13
- An Enrollee can not connect to a target WiFi AP because the AP resides in
  an unsupported WiFi frequency

Change-Id: Ia233e0e5e0bf8bee6dfa4f4b8a0660be325b363f
Signed-off-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17819
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
7 years agoIOT-1907: Fixing PMCloneOCProvisionDev,
Pawel Winogrodzki [Thu, 9 Mar 2017 21:57:05 +0000 (13:57 -0800)]
IOT-1907: Fixing PMCloneOCProvisionDev,

Fixing PMCloneOCProvisionDev to perform a proper deep copy
of the internal doxm::subOwners and doxm::mom fields, so that
they no longer point to the same structs as the original.

Change-Id: I5b30e4e7012934b9a17a4f8d7cecd6d2b65b1055
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17843
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mike Fenelon <mike.fenelon@microsoft.com>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
7 years ago[IOT-1920] Fix logic in PS to encode and map unmodified resources
Alex Kelley [Wed, 15 Mar 2017 04:51:31 +0000 (21:51 -0700)]
[IOT-1920] Fix logic in PS to encode and map unmodified resources

Change-Id: Ifbcc174efebd666d05f4134974267142a01c9f5f
Signed-off-by: Alex Kelley <alexke@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17937
Reviewed-by: Mike Fenelon <mike.fenelon@microsoft.com>
Reviewed-by: Way Vadhanasin <wayvad@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Tested-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
7 years agocsdk: Remove exec permission of stack headers
Philippe Coval [Mon, 20 Feb 2017 16:35:48 +0000 (17:35 +0100)]
csdk: Remove exec permission of stack headers

Change-Id: Ie8ef6699fc8a999579fe3e1e8474d3133a179ef9
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17383
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
7 years ago[IOT-1919] Fix pstat's map size
Dan Mihai [Wed, 15 Mar 2017 00:27:29 +0000 (17:27 -0700)]
[IOT-1919] Fix pstat's map size

Recent change d10c4a88ae458d3d067d74edf8287b08cee14857 removed
the writeable deviceuuid (a.k.a. OIC_JSON_DEVICE_ID_NAME) property.

Change-Id: Iee4ca533c29a77461603a97fadc7ad2207a40411
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17925
Reviewed-by: Kevin Kane <kkane@microsoft.com>
7 years agoCrash fix for Notification provider sample.
Harry [Thu, 2 Mar 2017 09:32:20 +0000 (15:02 +0530)]
Crash fix for Notification provider sample.

Change-Id: I9596008496042ca00890f93bc87f121bcbc7c7bd
Signed-off-by: Harry <h.marappa@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17613
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-by: Chihyun Cho <ch79.cho@samsung.com>
Reviewed-by: JungYong KIM <jyong2.kim@samsung.com>
Reviewed-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Habib Virji <habib.virji@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
7 years agoAdd following wrapper macros for convenience.
Kihyuck Shin [Fri, 10 Mar 2017 05:16:13 +0000 (14:16 +0900)]
Add following wrapper macros for convenience.

- OIC_TRACE_MARK, OIC_TRACE_BUFFER

Add and modify trace point positions for clarification.

Change-Id: I3996b38d71d3a2cfe4abff2353f8aef66e6ceb8a
Signed-off-by: Kihyuck Shin <kihyuck.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17821
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agoAndroid RC: jar bundles correctly loaded
Zoltan Kuscsik [Wed, 8 Mar 2017 10:36:13 +0000 (11:36 +0100)]
Android RC: jar bundles correctly loaded

Fixing the issue when jar bundles are never gets loaded.

Change-Id: I0e068f39b95434a21c1481244a79a444659aa430
Signed-off-by: Zoltan Kuscsik <kuscsik@gmail.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17773
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
7 years agoRC-Android: fix AndroidBundle build
Zoltan Kuscsik [Mon, 6 Mar 2017 13:25:07 +0000 (14:25 +0100)]
RC-Android: fix AndroidBundle build

Added dummy implementations of
deactivateResource for sample BundleResource

Change-Id: I68527a2bad7f113164b9a631aca0608542fa9e09
Signed-off-by: Zoltan Kuscsik <kuscsik@gmail.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17693
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
7 years ago[IOT-1911] Make resource/csdk/stack W4 compliant.
Alex Kelley [Thu, 9 Mar 2017 16:48:49 +0000 (08:48 -0800)]
[IOT-1911] Make resource/csdk/stack W4 compliant.

These changes include the following:
- Fix W4 warnings under resource/csdk/stack.
- Fix W4 warnings under resource/csdk/stack/test.
- Enable /W4 /WX on resource/csdk/stack.
- Enable /W4 /WX on resource/csdk/stack/test.
- Move disabling warnings from resource/csdk/security
  to build_common/Windows.

Change-Id: Ifed02e4e339093e49b6d174dfe3e3d52469f24ac
Signed-off-by: Alex Kelley <alexke@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17831
Reviewed-by: George Nash <george.nash@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
7 years agoAdded dataLen check in CALESecureReceiveDataCB()
junghun kim [Thu, 9 Mar 2017 06:42:32 +0000 (15:42 +0900)]
Added dataLen check in CALESecureReceiveDataCB()

Change-Id: I659d9e88f2d189de15d9817e304fd7d939a73765
Signed-off-by: junghun kim <jhun1105.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17799
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dmitriy Zhuravlev <d.zhuravlev@samsung.com>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agoFix unit test of notification service.
KIM JungYong [Tue, 21 Feb 2017 12:28:52 +0000 (21:28 +0900)]
Fix unit test of notification service.

Unit test of notification service sometimes failures due to time delay.
In this patch, network related procedure(including multicast discovery)
was removed on the c layer of notification service.

Patch #2
Resolve build error in previous unittest.

Patch #3
Apply changes about changed CA interface APIs.
Remove checking resource type on the Presence callback.

Change-Id: Ifa46c346fa6236266dc2a73a2f8d948c57d2f736
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17397
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
7 years agoconnectivity: Add linked libs and sort dependencies
Philippe Coval [Tue, 28 Feb 2017 13:20:17 +0000 (14:20 +0100)]
connectivity: Add linked libs and sort dependencies

csdk: Link to oc as used

Observed issue is when building with yocto (master):
  libresource_directory.so: \
  undefined reference to \
  `OC::MessageContainer::representations() const

Note, Targets supporting RD are aligned to:
resource/csdk/resource-directory/SConscript
( https://gerrit.iotivity.org/gerrit/14059 )
And it would worth to extent platform support in later patches.

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I930bc6bcbbf052eddb679ffea9eb822300000001
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17655
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agocsdk: Fix implicit-function-declaration warning in ocrandom
George Nash [Thu, 9 Mar 2017 22:31:37 +0000 (14:31 -0800)]
csdk: Fix implicit-function-declaration warning in ocrandom

The -Wimplicit-function-delaration waring was caused by the
compiler not seeing the isxdigit function. The function is
part of the ctype.h header.

Change-Id: Idc3498110082c55554b4a032aa945ba0082a6f98
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17811
Reviewed-by: Mike Fenelon <mike.fenelon@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years ago[IOT-1906] Disable only /oic/res response under OCStopMulticastServer.
Todd Malsbary [Thu, 2 Mar 2017 22:14:03 +0000 (14:14 -0800)]
[IOT-1906] Disable only /oic/res response under OCStopMulticastServer.

The intent of this API is to stop responding to /oic/res responses
when resources are registered with a resource directory.  Stopping all
multicast reception prevents ownership transfer from working.

Bug: https://jira.iotivity.org/browse/IOT-1906
Change-Id: I01e183b6f5a249a4d0e32baf14f542774a3ca0cb
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17633
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoenable LOG_LEVEL build option which can filter log in build time.
jihwan.seo [Thu, 16 Feb 2017 04:39:59 +0000 (13:39 +0900)]
enable LOG_LEVEL build option which can filter log in build time.

Lite Device has always requirement to reduce memory size.
Also LOGGING build option is not enough for the requirement.
Thru, we need to provide to select log which can include in binary.

ex)
LOGGING=true -> about 2267kbyte (libconnectivity_abstraction,
                                 liboctbstack, libocsrm,
                                 libroutingmanager)
LOGGING=true LOG_LEVEL=ERROR -> 2184kbyte

=> about 82kbyte saving

Change-Id: I1158de8739b2cd8fa961ad6fc3ff8899c410cbce
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17719
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agocsdk: Fix compiler warnings in ocresource.c
George Nash [Thu, 9 Mar 2017 23:12:14 +0000 (15:12 -0800)]
csdk: Fix compiler warnings in ocresource.c

-Wunused-parameter - fixed using the OC_UNUSED macro
-Wtype-limits - the statment `if (dimensions[0] >= 0)` is
always true because the `dimensions` param  is size_t
which is never negative. Since its always true the if
statment was removed.

Change-Id: I08c9e68e9c688cd9f31bee8d9368a4eec6c8cc01
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17815
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mike Fenelon <mike.fenelon@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoprovisioning: Use global LIBPATH
Philippe Coval [Wed, 8 Mar 2017 16:23:57 +0000 (17:23 +0100)]
provisioning: Use global LIBPATH

As set in shared file:
resource/c_common/SConscript

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I19502dec6cfbafc20cf9cfc8ef392174811992dd
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17783
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoFix OcPlatform.Configure() to ensure start() is called properly
Larry Sachs [Thu, 9 Mar 2017 22:11:40 +0000 (14:11 -0800)]
Fix OcPlatform.Configure() to ensure start() is called properly

Fixes [IOT-1908].

The recent commit of https://gerrit.iotivity.org/gerrit/#/c/17685/
requires OcPlatform.start() be called after OcPlatform.configure()

Change-Id: I5b721ff24c4b673b5741c14f4c7ed3331b9e536d
Signed-off-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17809
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
7 years agoconnectivity: Fix discovery+blockwise regression
Philippe Coval [Fri, 10 Mar 2017 15:14:16 +0000 (16:14 +0100)]
connectivity: Fix discovery+blockwise regression

A regression has been reported on discovery when large payloads are used.

After investigation in blockwise feature,
it appeared that regression occurred with this change:

https://gerrit.iotivity.org/gerrit/#/c/17419/

Author assumed that payload should fit into CoAP PDU (1400c),
which is against the blockwise feature's design.

Adjusting those tests, seems to fix the problem.

Bug: https://jira.iotivity.org/browse/IOT-1902
Change-Id: I0aa6d97de0987d13c54b426b537b5d83235517b7
Thanks-to: Pawel Winogrodzki <pawelwi@microsoft.com>
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17827
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoIOT-1877 : start presence issue
ChaJiWon [Thu, 2 Mar 2017 12:06:00 +0000 (21:06 +0900)]
IOT-1877 : start presence issue

When called OCStartPresence() second, OCStartPresence() returns error.
Fixed presenceState variable to OC_PRESENCE_UNINITIALIZED.

Change-Id: I089c826f4105eb3aaf835a8feda4c10b848ebd5d
Signed-off-by: ChaJiWon <jw_wonny.cha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17623
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Way Vadhanasin <wayvad@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 2f11e9592a7374ce28082a523b0c367a6d31baee)
Reviewed-on: https://gerrit.iotivity.org/gerrit/17775

7 years agorapidjson: Add prepare scriptlet
Philippe Coval [Mon, 27 Feb 2017 13:24:03 +0000 (14:24 +0100)]
rapidjson: Add prepare scriptlet

It is strongly recommended to rely on scons,
if not possible, this can be done differently using this script.

For more details about building IoTivity please check:

https://wiki.iotivity.org/build

The main purpose of prep.sh, is for continuous integration experiments
 for Tizen platform, but could be used for others too.

Bug: https://jira.iotivity.org/browse/IOT-1600
Change-Id: I8b07fdc4762baf403079c8816fc3017372627ef7
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17537
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agobe more pythonic: 4-space indent, no tabs, some pep8 changes
Mats Wichmann [Tue, 27 Dec 2016 15:51:29 +0000 (08:51 -0700)]
be more pythonic: 4-space indent, no tabs, some pep8 changes

Change-Id: I6c2b42a0b3a411c7d9693eaeeb6ae05eb06ef9c8
Signed-off-by: Mats Wichmann <mats@linux.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15961
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
7 years agoMerge branch 'master' into iot-1785
Kevin Kane [Fri, 10 Mar 2017 18:36:02 +0000 (10:36 -0800)]
Merge branch 'master' into iot-1785

Conflicts:
  Restore OIC_JSON_SUBJECT_NAME definition in srmresourcestrings.{c,h}
  Warning settings in resource/csdk/security/SConscript

Change-Id: Iabb48389b8aaa1ffa480287979df264e30bfac89
Signed-off-by: Kevin Kane <kkane@microsoft.com>
7 years ago[IOT-1785] Roles: /oic/sec/acl2 resource and policy changes
Kevin Kane [Tue, 28 Feb 2017 22:03:10 +0000 (14:03 -0800)]
[IOT-1785] Roles: /oic/sec/acl2 resource and policy changes

This also starts writing the ACL resource to persistent storage
in the ACL2 format, but either the ACL or ACL2 format can still
be read.

Change-Id: I0a324aec906aef23e3681fc2401b44fcab205618
Signed-off-by: Kevin Kane <kkane@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17785
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
7 years ago[IOT-1785] [IOT-1870] Implement /oic/sec/roles resource
Kevin Kane [Tue, 21 Feb 2017 17:57:21 +0000 (09:57 -0800)]
[IOT-1785] [IOT-1870] Implement /oic/sec/roles resource

Also change "ret == 0" to "0 == ret" for IOT-1870; opened
from a previous code review.

Change-Id: I829192698b9a8fed920e865f9cd4c2b968f8c951
Signed-off-by: Kevin Kane <kkane@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17707
Reviewed-by: Way Vadhanasin <wayvad@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
7 years agocore: Update DMV and ICV value as per the Spec
Philippe Coval [Tue, 7 Mar 2017 14:14:23 +0000 (15:14 +0100)]
core: Update DMV and ICV value as per the Spec

Bug: https://jira.iotivity.org/browse/IOT-1797
Change-Id: Ic818d571ddade00fc9d5d6b31f78bdefb81247cf
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17737
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Habib Virji <habib.virji@samsung.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
7 years agobuild: Add build dir to LIBPATH globally
Philippe Coval [Wed, 8 Mar 2017 15:41:08 +0000 (16:41 +0100)]
build: Add build dir to LIBPATH globally

Cleanup patches might follow.

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I930bc6bcbbf052eddb679ffea9eb8223422f66d0
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17559
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoprovide timeout error of server(504) value in ocstack.
jihwan.seo [Thu, 23 Feb 2017 13:43:08 +0000 (22:43 +0900)]
provide timeout error of server(504) value in ocstack.

Change-Id: I5ad6b44c188b97fd60e65dc7d47259058520e2f7
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17731
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agobuild: Disable EDR for yocto like linux as not supported yet
Philippe Coval [Tue, 28 Feb 2017 13:20:17 +0000 (14:20 +0100)]
build: Disable EDR for yocto like linux as not supported yet

Problem was observed when building on yocto's Poky (master)

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I2e977fdb5ec4811874ab8d9d2a931ea659317c25
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17557
Reviewed-by: Dmitriy Zhuravlev <d.zhuravlev@samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
7 years agocsdk: prevent release build compiler warning from log tags
George Nash [Tue, 7 Mar 2017 21:30:45 +0000 (13:30 -0800)]
csdk: prevent release build compiler warning from log tags

Changed `static char const TAG[]` used for logging to `#define TAG`
to prevent -Wunused-const-variable= warning when building code
in release mode.

Change-Id: Idaebfb26863a3a812573c8c40065ad9ff6ea356d
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17753
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agofix timing issue for mutex access in ble
jihwan.seo [Wed, 15 Feb 2017 10:21:37 +0000 (19:21 +0900)]
fix timing issue for mutex access in ble

Change-Id: I95917e8788bf3abce8c8cc143c5cf645286a5d5e
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17733
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoIOT-1583: Removing /W3 warnings inside connectivity/ (part 3)
Pawel Winogrodzki [Tue, 28 Feb 2017 02:47:30 +0000 (18:47 -0800)]
IOT-1583: Removing /W3 warnings inside connectivity/ (part 3)

Removing the /W3 warnings in order to add the /WX option to prevent new
ones from being added inside the resource/csdk/connectivity/ directory.

Change-Id: Ie1bce977c027e985cd5ba14458d2026b5d391d4f
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17549
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years ago[IOT-1785] First version of end-to-end certificate test suite
Greg Zaverucha [Thu, 9 Mar 2017 01:46:04 +0000 (17:46 -0800)]
[IOT-1785] First version of end-to-end certificate test suite

Unit testing certificate provisioning and interop requires multiple
processes. This change adds autoprovisioningclient, a headless
version of provisioningclient, that can run a test. A new python
script is added to set up a fresh instance of sampleserver_justworks
and start the autoprovisioningclient for each test.

Change-Id: I3da9eb29b19094a05164827a5b974e7ec3c531cd
Signed-off-by: Greg Zaverucha <gregz@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17743
Reviewed-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
7 years agocsdk: cleanup compiler warnings in occlient and occlientcoll
George Nash [Tue, 7 Mar 2017 20:45:32 +0000 (12:45 -0800)]
csdk: cleanup compiler warnings in occlient and occlientcoll

warnings -Wconversion-null and -Wmissing-field-initializers were
caused by trying to set a char array to NULL. Its now set to an
empty string. It is not removed so the entry count in the queryInterface
is the same as the number of test casses. The value is no longer used out
of the queryInterface.

If the TEST_GET_NULL test case is used it is special cased to use the
new InitGetRequestOnNullResource.

OC_UNUSED macro has been added to prevent the -Wunused-parameter warning.

Change-Id: I4a32e663bca574a6735f3efad2de42046328cc57
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17749
Reviewed-by: Joseph Morrow <joseph.l.morrow@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
7 years agocsdk: fixed compiler warnings in stacktests.cpp
George Nash [Tue, 7 Mar 2017 00:08:49 +0000 (16:08 -0800)]
csdk: fixed compiler warnings in stacktests.cpp

-Wsign-compare fixed using the `u` suffix on hardcoded
values so the compiler knows they are unsigned values.

Change-Id: Ic5261e816e477e90f089ddc468606b710115bded
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17715
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Way Vadhanasin <wayvad@microsoft.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
7 years agoAdd properties for smoketest to run
Larry Sachs [Wed, 8 Mar 2017 20:06:49 +0000 (12:06 -0800)]
Add properties for smoketest to run

Recent changes have added new properties.
PROJECT_VERSION and MULTIPLE_OWNER are now required.

Change-Id: Iae140a0d9c09f9604f6a50a04320b5f5d47cbde1
Signed-off-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17789
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
7 years agoRemove incorrect error message
Dan Mihai [Tue, 7 Mar 2017 11:40:06 +0000 (03:40 -0800)]
Remove incorrect error message

Fix typo resulting in incorrect error message.

Change-Id: I0ffee0c873e6f1c08e510a48961d27d1a37a630f
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17727
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Reviewed-by: Mike Fenelon <mike.fenelon@microsoft.com>
7 years ago[IOT-1785] Support for Certificate Provisioning
Greg Zaverucha [Wed, 8 Mar 2017 20:41:34 +0000 (12:41 -0800)]
[IOT-1785] Support for Certificate Provisioning

- Shell script to create IoTivity identity certificates using
OpenSSL command line tools.
- Partial unit test for providing credentails to the CA adapter
layer.  Tests loading of PEM cert and key.
- Misc changes and fixes to the cred resource
- updated provisioning client to provision certs
- helper code to create certs from CSRs

Change-Id: I7d3ab4810c7f7d6247ed90420cb97cbdb5f829a4
Signed-off-by: Greg Zaverucha <gregz@microsoft.com>
Signed-off-by: Kevin Kane <kkane@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17509
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years ago[IOT-1884] Allow IoTivity to generate and persist PIID
Alex Kelley [Mon, 13 Feb 2017 19:57:20 +0000 (11:57 -0800)]
[IOT-1884] Allow IoTivity to generate and persist PIID

 1. Generate a PIID for the device so that one is always available.
 2. Add the ability to store and retrieve the PIID from a new .dat
    file so it remains persistent across reboots of the device.
    - This .dat file can be updated to handle other information
      relevant to the device in the future.
 3. Update the PIID in the .dat file if the application wants to
    use a specific PIID.
 4. Update PSInterface to handle different databases instead of
    just the security database.
 5. Update the json2cbor tool to make it easy for developers to
    generate .dat files to specify PIID.
 6. Add example JSON and .dat files for specifying a PIID.

Change-Id: Ic556508ea0fb053386d76b2578721debea8ac046
Signed-off-by: Alex Kelley <alexke@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17667
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoFormat the two Apple-related SConscripts to Python coding standards
Mats Wichmann [Wed, 1 Mar 2017 15:51:33 +0000 (08:51 -0700)]
Format the two Apple-related SConscripts to Python coding standards

No functional changes.  Change is made preparatory to pushing a
patch for iot-1862 for a problem in darwin/SConscript

Change-Id: I8a8e492b352871252641d6ffa032c4f2b9f76f15
Signed-off-by: Mats Wichmann <mats@linux.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17583
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
7 years agoresource-directory: Fix libs dependencies and order
Philippe Coval [Fri, 3 Mar 2017 00:04:22 +0000 (01:04 +0100)]
resource-directory: Fix libs dependencies and order

Problem was observed when building on yocto

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I1246cd5bb83738a14fa0aa9e68cf35c4fbc8cbac
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17651
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoIOT-1868 [C++ layer] Make OCPlatform start and stop reliably
Way Vadhanasin [Tue, 7 Mar 2017 00:09:50 +0000 (16:09 -0800)]
IOT-1868 [C++ layer] Make OCPlatform start and stop reliably

This change adds reference count to OCPlatform's static start and
stop functions and synchronizes them. It does the following:

1. Ensures that calls to the "C" APIs OCInit and OCStop are balanced.
2. Maintains backward compatibility by introducing new PlatformConfig
   constructor and deprecate the old ones.
3. Updates the existing unit tests and samples.

Because this change allows the framework to stop properly, it exposes
some existing IoTivity leaks in Jenkins (Valgrind validation). Thus
the following leaks are fixed in this change to allow successful
Jenkins runs:

1. caipadapter.c: endpoint cache leak in UDP (no issue for TCP).
- https://build.iotivity.org/ci/job/iotivity-verify-unit_tests/
10907/valgrindResult/pid=24498,0x3fe

2. psinterface.c: CBOR buffer leaks in CreateResetProfile.
- https://build.iotivity.org/ci/job/iotivity-verify-unit_tests/
10922/valgrindResult/pid=2316,0x3ad

3. ocstack.c & securityResourceManager.cpp: persistent storage buffer
leaks as a result of restarting and switching OCPlatform
configuration after shutdown (e.g., between tests).
https://build.iotivity.org/ci/job/iotivity-verify-unit_tests/
10922/valgrindResult/pid=2316,0x3ad

4. OCRepresentationEncodingTest.cpp: representation value leaks.
- https://build.iotivity.org/ci/job/iotivity-verify-unit_tests/
10922/valgrindResult/pid=2316,0x3a9

5. runtest.py: change Valgrind callstack size from the default value
of 12 to 24 so that the test name is visible in the report. Helpful
for reproducibility.

Change-Id: I79406f2cf4282efbb29a69c14e42aae928f54bae
Signed-off-by: Way Vadhanasin <wayvad@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17685
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoFix a defect detected by static code analyzer
Jihun Ha [Wed, 8 Mar 2017 13:33:41 +0000 (22:33 +0900)]
Fix a defect detected by static code analyzer

A logic to check a failure of malloc is added.

Change-Id: I1414673e0745fa11c4358e39ea6fedc9e26277ad
Signed-off-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17601
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
7 years agoSecurity and connectivity defects fix
Oleksii Beketov [Thu, 16 Feb 2017 10:59:27 +0000 (12:59 +0200)]
Security and connectivity defects fix

Some minor defects (NULL checks and double frees) fixed.

Change-Id: I066a238a9379d45d1f377cc5a144c0bc0a97ccb7
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17039
Reviewed-by: Dmitriy Zhuravlev <d.zhuravlev@samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17319

7 years agoAdd API to set a MOT status.
Chul Lee [Thu, 9 Mar 2017 02:08:46 +0000 (11:08 +0900)]
Add API to set a MOT status.

Change-Id: I08ab5b4c0d07034d71429ac8698e5ed4763ced2c
Signed-off-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16585
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit 60153a2e8d029a9b0280f4b47d615919b73b1519)
Reviewed-on: https://gerrit.iotivity.org/gerrit/17217

7 years agoUpdate PDM
Chul Lee [Wed, 8 Mar 2017 23:13:39 +0000 (08:13 +0900)]
Update PDM

This patch addresses the following exceptional cases :
 1. The PT terminates unexpectedly.
    - Start the OTM process
    - Device information will be changed to INIT state.
    - PT terminated while OTM.
    - Restart the PT process.
    - Retry the OTM process.
    * OTM start will be failed due to device info already save as INIT state.

  2. Timeout is occured PT side while OTM.
    - Start the OTM process
    - Device information will be changed to INIT state.
    - OTM timeout is occured at the application side.
    - PT retry the OTM.
    * OTM start will be failed due to device info already save as INIT state.

I've added defence code and
added cleanup API that can be used when timeout occurs.

Patch #1 : Initial upload
Patch #2 : Retrigger
Patch #3 : Fix the bug for incorrect PIN inputed while random PIN OxM.
Patch #4-5 : Retrigger
Patch #6 : minor bug fix
Patch #7-8 : Retrigger
Patch #9 : Fix the incorrect log
Patch #10 : Retrigger
Patch #12 : Retrigger

Change-Id: I7781c0d864db6fdac93fa41acbcbf1ac123d15da
Signed-off-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16187
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17309

7 years agoFix build break on -release builds
Mike Fenelon [Tue, 7 Mar 2017 23:56:12 +0000 (15:56 -0800)]
Fix build break on -release builds

The OC_UNUSED macro is defined in octypes.h which is not included
by the source file. Switching to (void) to minimize the amount of
changes required to fix.

Change-Id: I76c13d448eb568b7f55dcd3974b8ee8891b01098
Signed-off-by: Mike Fenelon <mike.fenelon@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17757
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years ago[IOT-1888] Fix /W4 warnings present when building with -noSecurity or -release
Alex Kelley [Tue, 7 Mar 2017 01:03:44 +0000 (17:03 -0800)]
[IOT-1888] Fix /W4 warnings present when building with -noSecurity or -release

Change-Id: I70ff36b675418f7e441b1af594d922c231430918
Signed-off-by: Alex Kelley <alexke@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17755
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoClean up compiler warnings found in provisioningclient
George Nash [Tue, 21 Feb 2017 23:40:57 +0000 (15:40 -0800)]
Clean up compiler warnings found in provisioningclient

Compiler warnings fixed are:
 - unused-parameter fixed by using OC_UNUSED macro
 - type-limits fixed by changing the return type from size_t to off_t
   that is returned by the ftello function.
 - sign-compare fixed by replacing int with size_t where needed
 - format= fixed by replacing %d in printf and scanf with PRIuPTR or SCNuPTR
   from the cinttypes header.

Change-Id: I070ea24193b95ed65d8e3ea914ba8f5b69986f84
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17447
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
7 years agoIOT-1583: Removing IoTivity libs from scons Check* calls.
Pawel Winogrodzki [Wed, 15 Feb 2017 01:19:01 +0000 (17:19 -0800)]
IOT-1583: Removing IoTivity libs from scons Check* calls.

Due to a scons bug (http://scons.tigris.org/issues/show_bug.cgi?id=3036)
part of the build failures were being silently ignored and led
to cases where failing code ended up being merged.

Additionally, scons weren't picking up changes in files influenced
by the mentioned bug, so it required doing a clean build every time.

Change-Id: Ib63fb1105bceafae59573aa0c15af279e8ffdb6d
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17641
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Mike Fenelon <mike.fenelon@microsoft.com>
7 years agoIOT-1583: Disabling harmless /W4 warnings.
Pawel Winogrodzki [Thu, 2 Mar 2017 10:23:23 +0000 (02:23 -0800)]
IOT-1583: Disabling harmless /W4 warnings.

In preparation for libcoap /W4 fixes we're disabling warnings,
which do not cause any potential issues.

Change-Id: I136b34f2d5824efcc052b2c7f3a0b8315c8f3f23
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17639
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Mike Fenelon <mike.fenelon@microsoft.com>
7 years agoIOT-1583: Adding /W4 and /WX to timer build.
Pawel Winogrodzki [Wed, 15 Feb 2017 03:22:57 +0000 (19:22 -0800)]
IOT-1583: Adding /W4 and /WX to timer build.

Making sure any version changes of timer don't introduce
level 4 warnings.

I'm also changing the return value of StartRetransmit() inside
ca_adapter_net_ssl.c, since it's being used as a timer callback,
which doesn't return any values. Nowhere in the code was the returned
value of that function read.

Change-Id: Ic401ae27c5af46b05a21868dfa0c020ee6429f20
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17513
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Reviewed-by: Mike Fenelon <mike.fenelon@microsoft.com>
7 years ago[IOT-1873] Implement OCF Security CR50
Dan Mihai [Wed, 1 Mar 2017 03:28:30 +0000 (19:28 -0800)]
[IOT-1873] Implement OCF Security CR50

1. Removed entire resource:

/oic/sec/svc

2. Removed resource properties:
    a. From /oic/sec/amacl:
        rowneruuid
        ams
        amsuuid
    b. From /oic/sec/pstat:
        deviceuuid

Change-Id: I7bbe344feb0a99ca2f8d5e77eef64f840164bc20
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17607
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
7 years agoApply Java API which can start transport type in initialization
jihwan.seo [Fri, 24 Feb 2017 07:01:24 +0000 (16:01 +0900)]
Apply Java API which can start transport type in initialization

this patch is related to https://gerrit.iotivity.org/gerrit/#/c/16433/

Change-Id: I405306ef94add209e8743fc4636855a5263df58c
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17687
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
7 years agofix build failure related implicit typecasting with X86 in bridging.
jihwan.seo [Tue, 7 Mar 2017 10:08:23 +0000 (19:08 +0900)]
fix build failure related implicit typecasting with X86 in bridging.

[Error Message]
bridging/plugins/lifx_plugin/lifx_objects/lifx.cpp:219:9: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'std::vector<std::shared_ptr<LifxLight> >::size_type {aka unsigned int}' [-Werror=format]
bridging/plugins/hue_plugin/hue_resource.cpp: In function 'OCEntityHandlerResult processGetRequest(OCRepPayload*, HueLightSharedPtr, std::string)':
bridging/plugins/hue_plugin/hue_resource.cpp:842:9: error: format '%d' expects argument of type 'int', but argument 4 has type 'uint64_t {aka long long unsigned int}' [-Werror=format]
bridging/plugins/hue_plugin/hue_resource.cpp:842:9: error: format '%d' expects argument of type 'int', but argument 5 has type 'uint64_t {aka long long unsigned int}' [-Werror=format]
bridging/plugins/hue_plugin/hue_resource.cpp: In function 'OCEntityHandlerResult processPutRequest(OCEntityHandlerRequest*, HueLightSharedPtr, std::string, OCRepPayload*)':
bridging/plugins/hue_plugin/hue_resource.cpp:897:9: error: format '%d' expects argument of type 'int', but argument 4 has type 'int64_t {aka long long int}' [-Werror=format]
bridging/plugins/hue_plugin/hue_resource.cpp:932:13: error: format '%d' expects argument of type 'int', but argument 4 has type 'uint64_t {aka long long unsigned int}' [-Werror=format]
bridging/plugins/hue_plugin/hue_resource.cpp:943:13: error: format '%d' expects argument of type 'int', but argument 4 has type 'uint64_t {aka long long unsigned int}' [-Werror=format]

Change-Id: I39977d75810b4eb9b4bc0fc008825330fd12c0af
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17725
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Joseph Morrow <joseph.l.morrow@intel.com>
Reviewed-by: Todd Malsbary <todd.malsbary@intel.com>
7 years agoSupport for partial chroma resource updation in hue plugin
vijendrx [Tue, 7 Mar 2017 12:14:40 +0000 (17:44 +0530)]
Support for partial chroma resource updation in hue plugin

Added support for updating hue and saturation attributes of
chroma resource in hue plugin on an individual basis.

Change-Id: Ia07e9a858cc3190d0cd4df77f566ef6abc5bd539
Signed-off-by: vijendrx <vijendrax.kumar@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17751
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Joseph Morrow <joseph.l.morrow@intel.com>
Tested-by: Joseph Morrow <joseph.l.morrow@intel.com>
Reviewed-by: Todd Malsbary <todd.malsbary@intel.com>
7 years ago[IOT-1903] Change to set single adapter flag for cloud notification
ch79.cho [Wed, 8 Mar 2017 07:22:30 +0000 (16:22 +0900)]
[IOT-1903] Change to set single adapter flag for cloud notification

Fixed to set sindle adapter flag such as OC_ADAPTER_IP and OC_ADAPTER_TCP
during address parsing because multiple set of adapters caused an error
from base layer to handle it.

Change-Id: I7754d9d305d8c29f8d775d802164f5ccd761614b
Signed-off-by: ch79.cho <ch79.cho@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17761
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: JungYong KIM <jyong2.kim@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
7 years agoremove unneccessary brace code in NS logger.
jihwan.seo [Tue, 7 Mar 2017 08:11:04 +0000 (17:11 +0900)]
remove unneccessary brace code in NS logger.

since we can't enclose a block in C in braces (()).
it is better to remove in NS logger

Change-Id: I33a721155916f4c0eb17e6d34f3e7fbf8440625e
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17721
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: JungYong KIM <jyong2.kim@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
7 years agoAdded deprecated method for backward compatibility
Randeep Singh [Mon, 6 Feb 2017 09:07:17 +0000 (14:37 +0530)]
Added deprecated method for backward compatibility

setOwnerTransferCallbackData was removed and new api setInputPinCallback
was introduced. In this patch setOwnerTransferCallbackData is added as
deprecated API to maintain backward compatibility.

Change-Id: I0b5fffa476d466c526e2e5bf63ba9186b7dbdf9c
Signed-off-by: Randeep Singh <randeep.s@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17065
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Youngman Jung <yman.jung@samsung.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
7 years agoChanged callbackwrapper visibility to private
Youngman [Wed, 8 Feb 2017 00:56:26 +0000 (09:56 +0900)]
Changed callbackwrapper visibility to private

currently callbackWrapper is public api but is used only internally, so changed its visibility to private

Change-Id: Ic39128dca13a1342103c5cfc8276abfa806f31d4
Signed-off-by: Randeep Singh <randeep.s@samsung.com>
Signed-off-by: Youngman <yman.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17091
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
7 years agoResolved svace issues
amar [Wed, 1 Feb 2017 08:49:18 +0000 (14:19 +0530)]
Resolved svace issues

Change-Id: Id3aa9a857756a0cda216a12dbef42d9e326998c2
Signed-off-by: amar srivastava <amar.sri@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17041
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit 2046a5e2643b54a29ee39ce67677b7d574baa832)
Reviewed-on: https://gerrit.iotivity.org/gerrit/17259
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
7 years ago[IOT-1829] findResourceList is not implemented in Java API
Larry Sachs [Mon, 6 Mar 2017 23:02:40 +0000 (15:02 -0800)]
[IOT-1829] findResourceList is not implemented in Java API

Added jni calls to support new c sdk api to return a list of resources.

OcPlatform.java now has findResources() methods that take a
OnResourcesFoundListener as a callback which has a method for the
returned array of found resources.

Change-Id: Ia874294d0a73b35f7bd23b15d9c122df2622cfdc
Signed-off-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17713
Reviewed-by: George Nash <george.nash@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
7 years agosecurity: Link test to oc lib for yocto
Philippe Coval [Tue, 28 Feb 2017 13:20:17 +0000 (14:20 +0100)]
security: Link test to oc lib for yocto

Problem was observed when building with yocto (master)

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: Ie0c6e692972ca10142a074c3d099a76284774c26
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17561
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
7 years ago[IOT-1887] Android apps fail to run
Larry Sachs [Mon, 6 Mar 2017 22:47:49 +0000 (14:47 -0800)]
[IOT-1887] Android apps fail to run

Changed java/iotivity-android/build.gradle to copy libresource_directory.so
into the sample app apk files.

As a result of that change, the service/notification builds need to specfically
exclude that library.

Tested with running simple server/client apps on nexus 9.

Change-Id: I2143c37d424614e50a877f0c8c5153387f0a2b09
Signed-off-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17711
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
7 years agoIntegrated the version info of IoTivity
Jaewook Jung [Wed, 18 Jan 2017 10:09:20 +0000 (19:09 +0900)]
Integrated the version info of IoTivity

The version of IoTivity is hard-coded in several files
and it is hard to manage.
So I integrated some of them except spec files for tizen.

The version info will be handled in octypes.h and
/build_common/SConscript.

And made applications can get the version info.
 - C/C++ : 'IOTIVITY_VERSION' in octype.h
 - Java  : 'OCPlatform.getIoTivityVersion()'

Change-Id: Ief7a7ba104faaa9397c314e4efa9426c81a7c0ed
Signed-off-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16527
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoUse os.rename for renaming
Dan Mihai [Mon, 6 Mar 2017 16:37:37 +0000 (08:37 -0800)]
Use os.rename for renaming

'mv' is not a valid Windows system command.

Change-Id: I25116d6a22e8b664c99ca251231e05af2c97aeb2
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17703
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Gaganpreet Kaur <gaganpreetx.kaur@intel.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
7 years agoAdding Android wrapper to set a seed value for UUID generation
saurabh.s9 [Tue, 17 Jan 2017 11:33:51 +0000 (17:03 +0530)]
Adding Android wrapper to set a seed value for UUID generation

Change-Id: Id123f745b4409bebbd5cccf9b0d7d8b7e3b7a08d
Signed-off-by: saurabh.s9 <saurabh.s9@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16493
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16875
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
7 years agoMerge branch 'master' into iot-1785
Kevin Kane [Mon, 6 Mar 2017 23:06:02 +0000 (15:06 -0800)]
Merge branch 'master' into iot-1785

Change-Id: I387fe3c1c6dace44fa25a22c999ec6498576a8d8
Signed-off-by: Kevin Kane <kkane@microsoft.com>
7 years agoDisable warning 4429 in test code
Greg Zaverucha [Mon, 6 Mar 2017 18:24:13 +0000 (10:24 -0800)]
Disable warning 4429 in test code

This warning was being produced incorrectly, and causing a build break.

Change-Id: Ifcd71e471fd4fa92ca080006149b1f218fcbaa71
Signed-off-by: Greg Zaverucha <gregz@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17679
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
7 years agoHandle security test failures
Pawel Winogrodzki [Fri, 24 Feb 2017 01:28:17 +0000 (17:28 -0800)]
Handle security test failures

Disable SRPSaveTrustCertChain* which always fail (IOT-1846)
Fix typo in "TLSAdaper"
Disable TLSAdapter tests that have socket bugs (IOT-1848)
Change exit() calls to EXPECT calls so tests continue gracefully
Make socketOpen_server() work on Windows

Change-Id: Ie2b027a4539845975667709ef60497c345fae2b0
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17489
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Oleksii Beketov <ol.beketov@samsung.com>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
7 years agoLog message ID in host byte order
Dan Mihai [Wed, 22 Feb 2017 22:56:07 +0000 (14:56 -0800)]
Log message ID in host byte order

Both libcoap and CTT use the host byte order, so this change helps
correlate their log contents with the IoTivity logs.

Change-Id: If8b91a35017329a1a2a5bbe2770c71122c2f382a
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17455
Reviewed-by: Mike Fenelon <mike.fenelon@microsoft.com>
Tested-by: Mike Fenelon <mike.fenelon@microsoft.com>
7 years agoFix WITH_RA build break
Dan Mihai [Mon, 6 Mar 2017 15:42:49 +0000 (07:42 -0800)]
Fix WITH_RA build break

Type mismatched introduced by change
ea63cd55d8ade049d37bb3cfb7b7b27b4bce0b6d.

Change-Id: Ifbfed6ceb59dcaa7e6bf6cecf54219da5331cf8c
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17695
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
7 years agoFixed memory leak on cablockwisetransfer.c
Jaewook Jung [Tue, 28 Feb 2017 09:50:20 +0000 (18:50 +0900)]
Fixed memory leak on cablockwisetransfer.c

Fixed memory leak on cablockwisetransfer.c detected by static analysis

Change-Id: I4cf2d20bf1303b2a9727494a4d2f0718b2d91330
Signed-off-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17555
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoIOT-1583: Disabling rebuild of config headers with every scons run.
Pawel Winogrodzki [Fri, 3 Mar 2017 02:15:14 +0000 (18:15 -0800)]
IOT-1583: Disabling rebuild of config headers with every scons run.

I'm changing the scons behavior to only rebuild the config headers
if they don't exist, so scons wouldn't rebuild everything, what depends
on these headers.

I'm also making small fixes to make sure the generated headers are removed
when scons is run with "-c".

Change-Id: I4b8cf9cafac26e8d619280dccb1c14dab7c437cc
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17415
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoIOT-1583: Removing /W3 warnings inside connectivity/ (part 2)
Pawel Winogrodzki [Tue, 28 Feb 2017 02:37:57 +0000 (18:37 -0800)]
IOT-1583: Removing /W3 warnings inside connectivity/ (part 2)

Removing the /W3 warnings in order to add the /WX option to prevent new
ones from being added inside the resource/csdk/connectivity/ directory.

Change-Id: I13cd0b6058693432e3eb57f4bf7a1bfa0fa6f015
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17547
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
7 years agoFixed documentation warnings for cpp-docs
George Nash [Tue, 28 Feb 2017 18:28:35 +0000 (10:28 -0800)]
Fixed documentation warnings for cpp-docs

Fixed all of the documentation warnings found when running
Doxygen for C++ documentation.

Most of the warnings were due to @param tag not matching
the actual param.

For the copydoc warning foun in OCPlatform the @copydoc
tag was removed because it was not properly copying the
documentation. No clear fix other than actually copying
the documentation.

Change-Id: Ic861ff7dbeb9c7f17d7f39dace05da92f3bb43d1
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17569
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoFixed compilar warning in ocserver
George Nash [Thu, 2 Mar 2017 18:59:22 +0000 (10:59 -0800)]
Fixed compilar warning in ocserver

The -Wformat= warning was fixed by replacing
the %lld flag with the PRId64 or SCNd64 macro
from the inttypes.

Change-Id: I79b289d79ee2b918ec0947815f2dc6e6d3c07f3c
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17629
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
7 years agoFixed typo on OCInit1()
Jaewook Jung [Mon, 27 Feb 2017 10:51:13 +0000 (19:51 +0900)]
Fixed typo on OCInit1()

Change-Id: I3cdf6ec363a7ba6b77c49011be6a417f1359049b
Signed-off-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17529
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoFixed documentation warnings for c-docs
George Nash [Tue, 28 Feb 2017 00:00:02 +0000 (16:00 -0800)]
Fixed documentation warnings for c-docs

Fixed all of the documentation warnings found when running
Doxygen for the C documentation.

All of the documentation warnings fell into 3 areas:
1. Error using the @param[in,out] syntax
2. @param did not match the actual parameter name
3. Paramerter was missing documentation all together

For  case 3 an attempt to provide the best documentation
was done based on context. In a few situations the parameter
documentation is just restating the type of parameter being
passed in.

Change-Id: I06797a471dcefaaa2d9b50dc44ca4228cfafb941
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17543
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoIOT-1867 Add reference count to OCInit and OCStop
Way Vadhanasin [Sat, 4 Mar 2017 07:16:04 +0000 (23:16 -0800)]
IOT-1867 Add reference count to OCInit and OCStop

This change adds reference count to OCStack and synchronizes the two
C APIs.

The change also introduces ocatomic.h, which defines some useful
atomic utility functions.

Change-Id: I2ea4023ab1d1dfda882a0d289db6d8ffdac1bdc4
Signed-off-by: Way Vadhanasin <wayvad@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17625
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoIOT-1583: Removing /W3 warnings inside connectivity/ (part 1)
Pawel Winogrodzki [Wed, 22 Feb 2017 02:29:14 +0000 (18:29 -0800)]
IOT-1583: Removing /W3 warnings inside connectivity/ (part 1)

Removing the /W3 warnings in order to add the /WX option to prevent new
ones from being added inside the resource/csdk/connectivity/ directory.

Change-Id: Ibd53ad378b5d960ea59f2e2c61254a9257d03a3e
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17419
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years ago[IOT-1861] Fix self-deadlock during OT
Dan Mihai [Thu, 2 Mar 2017 02:14:57 +0000 (18:14 -0800)]
[IOT-1861] Fix self-deadlock during OT

Avoid acquiring g_sslContextMutex recursively during Ownership
Transfer. Instead, make it a requirement that the caller must
own this lock.

Finding a better solution for this old problem is now tracked
by IOT-1876.

Change-Id: I25ce19a5c48c5adab70e2287288833e40c4db213
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17605
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
7 years agobuild: Apply OCF patch if needed
Philippe Coval [Wed, 1 Feb 2017 12:53:41 +0000 (13:53 +0100)]
build: Apply OCF patch if needed

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I2928fed0a97b51f358a0f87f35b164317b4d7b9d
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Origin: https://gerrit.iotivity.org/gerrit/#/c/16967/
Reviewed-on: https://gerrit.iotivity.org/gerrit/16967
Reviewed-by: Mats Wichmann <mats@linux.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Reviewed-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
7 years agoMerge branch 'master' into iot-1785
Kevin Kane [Fri, 3 Mar 2017 20:59:10 +0000 (12:59 -0800)]
Merge branch 'master' into iot-1785

Build breaks fixed.
occertutility.{c,h} moved back into security subtree.

Change-Id: I348dbe5d2133b57a49d4cdef05ce6e747af5eea0
Signed-off-by: Kevin Kane <kkane@microsoft.com>