contrib/iotivity.git
7 years agoAdd support for application/vnd.ocf+cbor to resource directory.
Todd Malsbary [Wed, 1 Mar 2017 19:52:54 +0000 (11:52 -0800)]
Add support for application/vnd.ocf+cbor to resource directory.

- Add support to RD for publishing and storing endpoints.  Only
  publish secure or non-secure eps depending on resource properties.
- When creating application/cbor response to discovery, create
  separate links with the fully-qualified URI containing the supported
  endpoints.

Change-Id: Ifc370825103a73335eddccb4bbde4225d0a0a736
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17631
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoupdate Doxygen comment for cautilinterface
jihwan.seo [Fri, 24 Mar 2017 06:44:19 +0000 (15:44 +0900)]
update Doxygen comment for cautilinterface

Change-Id: If43415acd3dbb12f090a06d8848ad398b2bf45be
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18157
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoAdd support for application/ocf.vnd+ocf discovery payloads.
Todd Malsbary [Wed, 1 Mar 2017 01:10:38 +0000 (17:10 -0800)]
Add support for application/ocf.vnd+ocf discovery payloads.

- Remove baseURI and add anchor property.
- Plumb content format through to parsing/converting payloads.

Change-Id: I05d2a9263b085dec3683f6345190a4b4574ff2dc
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17575
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years ago[IOT-1921] Remove compiler warning
Dan Mihai [Wed, 15 Mar 2017 23:10:46 +0000 (16:10 -0700)]
[IOT-1921] Remove compiler warning

Some of the compilers complain about static functions that are unused.

Change-Id: I8850112903e8e8e6d55d2465f96fedd4e792a69b
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17949
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
7 years agoresource-encapsulation: Remove exec permission on sources
Philippe Coval [Mon, 6 Mar 2017 15:40:25 +0000 (16:40 +0100)]
resource-encapsulation: Remove exec permission on sources

Change-Id: Iabb87176a2a6d13fe74e7b92697a3273e8bf9f0c
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17697
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mats Wichmann <mats@linux.com>
7 years agoFix result of static analyzer in primitive service.
KIM JungYong [Wed, 22 Mar 2017 11:37:31 +0000 (20:37 +0900)]
Fix result of static analyzer in primitive service.

In this patch, unhandled exception in the RC and RE was handled.

Change-Id: If6337a3fa9e9cc2c3a3b055bffe384f90d6b555c
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18091
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
7 years agodocs: Update Doxyfiles for c-doc
George Nash [Thu, 23 Mar 2017 16:01:14 +0000 (09:01 -0700)]
docs: Update Doxyfiles for c-doc

- Only the cautilinterface.h from connectivity is currently
  intended as a public API. The documentation directly
  references values defined in cacommon.h. So cacommon.h
  is also included to prevent documentation errors.
- OPTIMIZE_OUTPUT_FOR_C has been changed to yes. This prevents
  the documentation adding things about classes and other
  documentation that does not make since in C only code.
- Updated the Home.txt. The page linked to no longer contains
  getting started guides.

Change-Id: I1bb5d42fcd1287bb0f5614ceb204b1e56f79aa2d
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18137
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
7 years agoFix defects detected by static code analyzer
Jihun Ha [Thu, 23 Mar 2017 01:39:24 +0000 (10:39 +0900)]
Fix defects detected by static code analyzer

Checking if a OICMalloc is failed is added.
Calling OICFree to prevent a memory leak is added.

Follow coding convention padding after condition "if ("

Change-Id: Ifdd2ba5f747758bd0120ff396f7441b77a444b81
Signed-off-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17971
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
7 years agoIPCA: Temporarily disable all unit tests + run.bat revert.
Soemin Tjong [Sat, 25 Mar 2017 00:28:49 +0000 (17:28 -0700)]
IPCA: Temporarily disable all unit tests + run.bat revert.

Observed a few cases of inexplainable unit tests failures today (all
with error 1033).

One example below where all unit tests were completed but scons reported
a failure.

https://build.iotivity.org/ci/job/iotivity-verify-windows-vs2015/11704/consoleText

[----------] 1 test from ElevatorServerStop
[ RUN      ] ElevatorServerStop.Stop
[       OK ] ElevatorServerStop.Stop (1 ms)
[----------] 1 test from ElevatorServerStop (1 ms total)

[----------] Global test environment tear-down
[==========] 31 tests from 6 test cases ran. (311 ms total)
[  PASSED  ] 31 tests.
scons: *** [out\windows\amd64\debug\resource\IPCA\unittests\utresource\ipca\unittests\ipcatests] Error 1033
scons: building terminated because of errors.
Build step 'Execute Windows batch command' marked build as failure

Change-Id: Ic9082e043b70e73e7d7eca20598e4500db5e364d
Signed-off-by: Soemin Tjong <stjong@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18179
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years ago[IOT-1520] Allow MOT to be disabled after it is enabled.
Alex Kelley [Tue, 21 Mar 2017 21:54:23 +0000 (14:54 -0700)]
[IOT-1520] Allow MOT to be disabled after it is enabled.

These changes do the following:
1. Fix updateWriteableProperty to honor the 'mom'
   property any time that it is changed.
2. Rename updateWriteableProperty to
   DoxmUpdateWriteableProperty to clarify its usage.
3. Fix an invalid check in the ProvisioningClient.
4. Added tests to ensure that mom can be enabled
   and disabled when MOT is available.

Change-Id: I97c01a9dc8f44bcf5a6aeac3bf459777c97e19b0
Signed-off-by: Alex Kelley <alexke@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18109
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
7 years ago[IOT-1640] [IOT-1641] Fix MOT invalid pin handling
Alex Kelley [Thu, 16 Mar 2017 20:42:13 +0000 (13:42 -0700)]
[IOT-1640] [IOT-1641] Fix MOT invalid pin handling

These changes do the following:
1. Set up PDM for each MOT attempt.
2. Clean up invalid PDM entries on failure.
3. Clean up invalid credentials on failure.
4. Break out success and failure paths for
   MOTDtlsHandshakeCB to simplify code.
5. Update SubownerClient to allow a user to
   provide a preconfigured pin instead of using
   the default preconfigured pin.

Change-Id: I9c4e9b802e6fe6e68da18c34e9150c43ba01c445
Signed-off-by: Alex Kelley <alexke@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18029
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
7 years agoRemoved unused function declarations
Jaewook Jung [Fri, 17 Mar 2017 05:03:17 +0000 (14:03 +0900)]
Removed unused function declarations

Removed unused function declarations
 - DeleteActionSets() in oicgroup.h
 - OCRepPayloadAddModelVersion() in ocpayload.h

Change-Id: Ia3109df490f47f6506b3a1a95d23f1017c443648
Signed-off-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17969
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years ago[IOT-1763] Implemented device onboarding state CR 23
Nathan Heldt-Sheller [Sun, 19 Mar 2017 04:17:19 +0000 (21:17 -0700)]
[IOT-1763] Implemented device onboarding state CR 23

Added oic.r.pstat Property "dos" as made mandatory by
OCF Security Specification CR 23.

patch set 2: Functional cbor marshalling.

patch set 3: Updated json2cbor tool and every svr.json and
.dat file I could find to use the new pstat.dos property.

patch set 4: Updated json2cbor tool to support oic 1.1 format
but print warning if .dos property not found.

patch set 5: Added better handling for .dat files that don't
contain "dos" Property, to aid in legacy app migration.

patch set 6: Rebase.

patch set 7: Fixed unittest issue that appeared after re-base,
and addressed misc comments on patch set 5.

patch set 8: commit msg fix.

patch set 9: added "TODO" items for UPDATE handling once
other CRs are done.

patch set 10: addressed a few of Kevin's comments.

patch set 11: rebase

patch set 12: addressed Greg's request for specific JIRA numbers.

Change-Id: I6d9751ff1e6d7d88789e1462819736b38f176a53
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17993
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
7 years agoFix crash issue related string reference in std::thread exec
jihwan.seo [Mon, 20 Mar 2017 11:56:52 +0000 (20:56 +0900)]
Fix crash issue related string reference in std::thread exec

Change-Id: I24947070a50e787dabeadb8e15192eb68b687944
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18005
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years ago[IOT-1955] Notification service fails to load libca-interface.so
Poovizhi [Thu, 23 Mar 2017 12:37:29 +0000 (18:07 +0530)]
[IOT-1955] Notification service fails to load libca-interface.so

Changes are made to add libca-interface.so to service/notification. This library
requires libresource_directory.so and hence added that.
Changes added in build.gradle to avoid duplicates.

Change-Id: I0a40aa9fdb726fb7a1e778ff63155d78ffde21f6
Signed-off-by: Poovizhi <poovizhi.a@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18133
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
7 years agoFix in EnableRemoteService for Notification Service via Cloud
jake [Thu, 23 Mar 2017 07:44:42 +0000 (16:44 +0900)]
Fix in EnableRemoteService for Notification Service via Cloud

When notification message is sent thru cloud, consumer cannot receive.

It worked well from initial development environment
but others reported it does not worked well in some environment.
Initially, to call NSSetRemoteServerAddress(char *serverAddress)
resolves issue by testing but, logic perspective, this is not solution.

MSCacheSubData has messageObserverID, syncObserverID for local and
remote consumer respectively and this structure brings fundamental
complexity inspite they are not handled separately.
This patch remove remote set for these observerIDs member from struct.

Change-Id: I7e5e52487d71cba0cb3c9772fd0436d8e323285e
Signed-off-by: jake <jaehong2.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17959
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: JungYong KIM <jyong2.kim@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
7 years agoFix stopCaching logic in the RE client.
KIM JungYong [Thu, 23 Mar 2017 08:59:45 +0000 (17:59 +0900)]
Fix stopCaching logic in the RE client.

When caught exception at calling stopCaching(),
can not start caching again, reason that IsCaching boolean does not changed in RE client.

In this patch,
exception handling and disable IsCaching flag.

Change-Id: I80f4629d21ea16799f945c90d56f70f81bc38e90
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18125
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-1846] Resolved unittest failure on provisioning
js126.lee [Tue, 21 Mar 2017 04:27:13 +0000 (13:27 +0900)]
[IOT-1846] Resolved unittest failure on provisioning

Resolved unittest failure of SRPSaveTrustCertChainDER and SRPSaveTrustCertChainPEM.

Change-Id: I9252c6718da1fa0be5942f296b391c49b7905c5f
Signed-off-by: js126.lee <js126.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18035
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
7 years agoInitial commit of IPCA.
Soemin Tjong [Wed, 22 Feb 2017 09:17:52 +0000 (01:17 -0800)]
Initial commit of IPCA.

IPCA stands for IoTivity Procedural Client Api, which implements C APIs
for accessing IoTivity RESTful CRUDN APIs.

IPCA uses the C++ APIs provided by OCPlatform and OCResource.
It is intended to be used by application developers, or by code
generated from swagger, to develop IoTivity client apps.

IPCA supports APIs for Discovery of IoTivity devices, Create, Delete
and Observe resources, Get and Set property values, and security
related APIs for password display (typically used in Onboarding
Tool case) and password input (typically used in Multiple Ownership
Transfer case).

Please find more info in: https://wiki.iotivity.org/ipca.
And more info in code:
inc\IPCA.h for API documentation.
src for the implementation of IPCA.
samples\ElevatorClient for sample application that uses the IPCA api.
samples\ipcaapp for sample application that discovers any IoTivity
devices on the network.

Change-Id: I683b02786d4df32b2feacdd9f1674350214b0618
Signed-off-by: Soemin Tjong <stjong@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17449
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoTemporarily disable multithreaded on Jenkins for Windows.
Soemin Tjong [Wed, 22 Mar 2017 00:31:54 +0000 (17:31 -0700)]
Temporarily disable multithreaded on Jenkins for Windows.

This is to address random crashes with error 1033 like the following:
scons: *** [out\windows\amd64\debug\resource\IPCA\unittests\utresource\ipca\unittests\ipcatests] Error 1033

Change-Id: I4d2d47b495091fe325a7fe82b26fdf3a0e438ccb
Signed-off-by: Soemin Tjong <stjong@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18099
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agoMake format and versioing number independent from each other.
Ziran Sun [Wed, 15 Feb 2017 15:21:08 +0000 (15:21 +0000)]
Make format and versioing number independent from each other.

Change-Id: I68138694d59a00aedf0eef36fc135e57ebc6c661
Signed-off-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17301
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 4)
Pawel Winogrodzki [Wed, 22 Feb 2017 02:31:11 +0000 (18:31 -0800)]
IOT-1583: Removing /W3 warnings inside connectivity/ (part 4)

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: I0a6eb91c6c2cd940e9939f54a454aab2a01ec954
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17551
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agologger: Fix missing include for size_t
Philippe Coval [Thu, 16 Mar 2017 13:13:05 +0000 (14:13 +0100)]
logger: Fix missing include for size_t

Observed issue on Tizen:Common:

  resource/csdk/logger/include/trace.h:60:65:\
   error: unknown type name 'size_t'
  resource/csdk/logger/src/trace.c:29:65:\
   error: unknown type name 'size_t'

Change-Id: Ic4c4a492d238b4f9d7860720fa10c92dfca051f8
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17963
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
7 years agoFix for Jira [IOT-1424]
Veeraj Khokale [Mon, 10 Oct 2016 08:34:54 +0000 (14:04 +0530)]
Fix for Jira [IOT-1424]

1. Modified CHPGetOCContentType() and CHPGetOptionID() to
internally duplicate the string parameter passed and
work on this copy, thereby maintaining const correctness.
2. Also modified unit test to pass "application/cbor" as
http content type.

Change-Id: Ic0ea5704ddff20dc67086296e54775ef8d677d69
Signed-off-by: Veeraj Khokale <veeraj.sk@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13013
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
(cherry picked from commit cac65bc77127b61056783bdd1178263518682912)
Reviewed-on: https://gerrit.iotivity.org/gerrit/15275
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
7 years agoFixed memory leak on cablockwisetransfer.c
Jaewook Jung [Mon, 20 Mar 2017 23:41:19 +0000 (08:41 +0900)]
Fixed memory leak on cablockwisetransfer.c

Fixed memory leak on cablockwisetransfer.c detected by static analysis

Change-Id: I9de4b7ba8abffd53fe1659d4d1a504e623d8bbd5
Signed-off-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18027
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Mike Fenelon <mike.fenelon@microsoft.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agoupdate logs before callback in InProcClientWapper.
jihwan.seo [Tue, 21 Mar 2017 04:44:02 +0000 (13:44 +0900)]
update logs before callback in InProcClientWapper.

Change-Id: I1b1976908ed8d5054fe63a46953005330c76855d
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18039
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agodocs: Update file paths for devdocs.doxyfile
George Nash [Tue, 14 Mar 2017 19:15:08 +0000 (12:15 -0700)]
docs: Update file paths for devdocs.doxyfile

Fixed the paths for the input files. Added additional
paths that were missing.

Adds a log output file when doxygen was run

This only updates the doxyfile it does not fix any
warnings produced.

Change-Id: Ic566e8ec728a72cc059e66cafdcece396897cd98
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17923
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agoFix defects detected by static code analyzer
Parkhi [Thu, 23 Mar 2017 02:22:17 +0000 (11:22 +0900)]
Fix defects detected by static code analyzer

- When using the strncpy function, modified it to include a null termination

Change-Id: Ibb47c2737c13558e5d18f809673300d2f8a0e8a7
Signed-off-by: Parkhi <h_w.park@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18107
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
7 years agoSSL adapter unit tests update
ol.beketov [Thu, 9 Mar 2017 12:59:31 +0000 (14:59 +0200)]
SSL adapter unit tests update

Unit tests for various cipher suites updated in
correspondence to changes from the patch 16251
"Support for multiple ciphersuites".

Change-Id: Ie65bb0df79cb9a17d88d41fde9f791c75a04db17
Signed-off-by: ol.beketov <ol.beketov@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17861
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
7 years agonotification: Reordering libs for linker on examples and tests
Philippe Coval [Tue, 28 Feb 2017 13:20:17 +0000 (14:20 +0100)]
notification: Reordering libs for linker on examples and tests

Reordering libs by dependencies is solving observed issue on yocto:

  ld: warning: liboc.so, \
  needed by out/yocto/i586/release/libresource_directory.so, not found \
  (try using -rpath or -rpath-link)
  libresource_directory.so: \
  undefined reference to `OC::MessageContainer::representations() const'
  (...)

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I8622e0efbdad18236cb04fb14f8d01bcef7b8879
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17563
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
7 years agobuild: Prepare building by installing dependencies libs
Philippe Coval [Mon, 29 Aug 2016 14:59:34 +0000 (16:59 +0200)]
build: Prepare building by installing dependencies libs

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: I63e713c8531f0eea698277993cf21c3d55c80270
Origin: https://gerrit.iotivity.org/gerrit/#/c/11699/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12477
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
(cherry picked from commit 10c5f532f85a2e97dbbe91c94276fc9bfff5d016)
Reviewed-on: https://gerrit.iotivity.org/gerrit/11699
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agocsdk: Fixed compiler warnings in ocstack.c
George Nash [Thu, 9 Mar 2017 22:37:55 +0000 (14:37 -0800)]
csdk: Fixed compiler warnings in ocstack.c

-Wformat= warning fixed by changing the ssanf %lld flag to SCNd64
-Wunused-function fixed by removing the OCSetNetworkMonitorHandler
 function. Since the function is not used it is also not maintained
 it is best to remove the code.

Change-Id: Ib82e6e77a561ac8713cc77bdecc44a5ce42cefff
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17813
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 agoEnable GetNetworkInformationTest on windows
Dave Thaler [Thu, 2 Mar 2017 22:46:18 +0000 (14:46 -0800)]
Enable GetNetworkInformationTest on windows

Change-Id: Ic5f6449adb5ead85a2b5022a830397e3bb766a7a
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17635
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agodocs: Removed unused Doxyfile
George Nash [Tue, 14 Mar 2017 16:55:29 +0000 (09:55 -0700)]
docs: Removed unused Doxyfile

There are two Doxyfiles for generating C API documentation
1. ./resource/docs/c-doc/Doxyfile
2. ./resource/csdk/doc/Doxyfile

The first file is listed in the wiki and appears to be
better maintained than the second. To avoid confusion
the second is removed by this commit.

Change-Id: I5fe1f688bbd9930de623fad26494a880bac35244
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17909
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
7 years agogtest: Test presence of source on existing file
Philippe Coval [Fri, 10 Mar 2017 17:29:56 +0000 (18:29 +0100)]
gtest: Test presence of source on existing file

configure is not in upstream's repo
because, it's intended to be generated from configure.ac.

So to avoid ambiguity, we test if CMake file is present instead.

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: Ia2e7c8c4d0c827b300b9345c9cb7811a193cfd9e
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17855
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 agoAdd making post payload in occlient sample app
ChaJiWon [Wed, 22 Mar 2017 10:41:02 +0000 (19:41 +0900)]
Add making post payload in occlient sample app

This patch add making post payload logic when client performs POST request.

Change-Id: I58e96b2c7cc325116409720c56a6e12046ecdfa5
Signed-off-by: ChaJiWon <jw_wonny.cha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18087
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agoremove duplicate code in caleadapter
jihwan.seo [Mon, 20 Mar 2017 03:53:08 +0000 (12:53 +0900)]
remove duplicate code in caleadapter

Change-Id: I40ad527a8500b272d9c4660dfcded966e374d006
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17997
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agodocs: Update the list of of Doxyfile input files
George Nash [Fri, 17 Mar 2017 22:25:58 +0000 (15:25 -0700)]
docs: Update the list of of Doxyfile input files

The default Doxyfile should only produce documentation
for public APIs.
.
For internal developer APIs the devdocs.doxyfile should
be used.

Change-Id: I6bce824095b33f3e2a51a960eb6c0b1f7e0a36d1
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17991
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agoresource: Use global LIBPATH
Philippe Coval [Fri, 10 Mar 2017 16:53:14 +0000 (17:53 +0100)]
resource: Use global LIBPATH

As set in shared file:
resource/c_common/SConscript

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: Id5fce812c8da866305647308919bced90397cc5d
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17829
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agoFix for the issue reported in [IOT-1923]
Poovizhi [Tue, 21 Mar 2017 13:03:20 +0000 (18:33 +0530)]
Fix for the issue reported in [IOT-1923]

There are invalid signed vs. unsigned checks in cainterfacecontroller. Those needs to be fixed.

Change-Id: I780203e68d66e170714356192ea2469dece4c5ed
Signed-off-by: Poovizhi <poovizhi.a@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18055
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
7 years agoDisable Unit test of notificaiton service.
KIM JungYong [Wed, 22 Mar 2017 02:27:34 +0000 (11:27 +0900)]
Disable Unit test of notificaiton service.

Change-Id: I5a89207f4897accacf4683b0561277bf0638cc2c
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18077
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
7 years agoFixed bug in compared WILDCARD_SUBJECT_ID
js126.lee [Tue, 21 Mar 2017 06:43:06 +0000 (15:43 +0900)]
Fixed bug in compared WILDCARD_SUBJECT_ID

Issue : If the first character of deviceuuid generated ramdomly is *(2a) in PT,
        subjectuuid of cred is set to * wrongly instead of actual deviceuuid
        during generating cred payload during OT.

Change-Id: Idc6587d71456a1eb7a816bd083bfcbb5c94e9c34
Signed-off-by: js126.lee <js126.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18041
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
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 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 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 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-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>