23 months ago[IOT-2746][ES] Static analysis warning fix. 19/22819/2
Harry [Fri, 13 Oct 2017 10:54:11 +0000 (16:24 +0530)]
[IOT-2746][ES] Static analysis warning fix.

Fixed all the static analyzer reported issues in
ES native code.

Change-Id: Ida916ed651fcdf4f02f3549ce987511ca8d5eaa0
Signed-off-by: Harry <>
23 months ago[IOT-2811][ES] Fix mediator android app crash. 41/22841/2
Senthil Kumar G S [Sat, 14 Oct 2017 13:11:53 +0000 (18:41 +0530)]
[IOT-2811][ES] Fix mediator android app crash.

Reason for crash:-
OcProvisioning.provisionClose() should be called only
when iotivity stack is built with security. But mediator android
app invoked it without checking whether the stack is built with security.

Change-Id: Ic2af9d649a4dce79d2bfd9daebc2c80b7dfaa2eb
Signed-off-by: Senthil Kumar G S <>
23 months agoLet Linux build upstream libcoap again 99/22699/2
Mats Wichmann [Tue, 3 Oct 2017 20:39:24 +0000 (14:39 -0600)]
Let Linux build upstream libcoap again

Cherry pick from master

Two problems:
(1) in a debug build, Linux builds with gcov options. Linux options
(build_common/linux/SConscript) add --coverage to build, -lgcov to link.
However before the two places that do configure checks for functions start
doing so, they clone an environment with LIBS cleared.  Thus when built
in debug mode, all of the links of the generated configure test programs
-lgcov is missing and the binaries don't link, so the tests report
fail. Fix is to add --coverage to link instead, that implies adding the
library at link time, but is not affected by the clearing of the LIBS var.

(2) upstream libcoap was depending on ipv6 features that only are included
if __GNU_SOURCE is defined, change the define from __DEFAULT_SOURCE to
__GNU_SOURCE only for the coap build environment.

This is like Bug IOT-2334 but since that one reports a windows problem
and thus can't be gcov related, it's not a direct linkage.

Change-Id: I5cab20eeeb10ccefe74d403dd204b33b39ed9a26
Signed-off-by: Mats Wichmann <>
23 months agoIOT-2539 ignore warnings for older compilers 43/22743/11
George Nash [Thu, 27 Jul 2017 01:03:54 +0000 (18:03 -0700)]
IOT-2539 ignore warnings for older compilers

Ignore 'missing-field-initializers' warning  if gcc version
is older than 5.0. This is due to a bug in how older
versions of gcc handles C++11 code.

Ignore 'missing-braces' waring if gcc version is older
than 5.0 this is also due to a bug in how older versions
of gcc handles C++11 code.

This is in preperation to enable the -Werror build flag.

Change-Id: Ia098c273bdbcda485fd02d73941207f502ed861a
Signed-off-by: George Nash <>
23 months ago[IOT-2632] Callback to check peer's CN 31/22231/20 1.3.1-RC3
Oleksii Beketov [Thu, 12 Oct 2017 10:33:15 +0000 (13:33 +0300)]
[IOT-2632] Callback to check peer's CN

Added callback to check peer's certificate Common Name field.

Change-Id: Idb316438a76d70fcc7a91a2e119aadd0c771bde6
Signed-off-by: akk0rd <>
Signed-off-by: Oleksii Beketov <>
23 months ago[IOT-2709] MOT fix 21/22621/8
Oleksii Beketov [Thu, 12 Oct 2017 11:19:55 +0000 (14:19 +0300)]
[IOT-2709] MOT fix

sampleserver_randompin and sampleserver_preconfpin MOT fix

Change-Id: Iadb02e4370604c33b8070ea45f2d8a42ecfafae1
Signed-off-by: Oleksii Beketov <>
23 months ago[IOT-2714][ES] Adding Error Codes as per OCF 1.3. 85/22785/3
Senthil Kumar G S [Fri, 13 Oct 2017 09:29:45 +0000 (14:59 +0530)]
[IOT-2714][ES] Adding Error Codes as per OCF 1.3.

i) Added error codes to represent invalid auth type and enc type.
ii) Added logic to send OC_EH_BAD_REQUEST(400) without payload
if POST request comes to "/WiFiConfResURI" or "/EasySetupResURI"
with invalid auth type or enc type.

Also updated the comments for existing error codes.

Change-Id: I246af9a777f1aba1f18474ded74e38c4a5ed9b2c
Signed-off-by: Senthil Kumar G S <>
23 months ago[Easy Setup] Handling POST on batch with null URI 03/22703/4
Abhishek Pandey [Fri, 6 Oct 2017 04:37:05 +0000 (10:07 +0530)]
[Easy Setup] Handling POST on batch with null URI

JIRA IOT-2797:

Change-Id: I1e2a1b7d4edb4971be616a2563227e1bc55a80d9
Signed-off-by: Abhishek Pandey <>
23 months agoresource-encapsulation: use OICFree for query 97/22297/4
Philippe Coval [Fri, 25 Aug 2017 08:24:35 +0000 (10:24 +0200)]
resource-encapsulation: use OICFree for query

Track memory allocations using oic_malloc, oic_string.

This will suppress valgrind warning about using delete on C string,
previously, ocEntityHandlerRequest.query was allocated using C strdup,
so free should be used not C++ delete[].


Change-Id: I86a3a3dfee8492656ee89de5913617369bf1fbb3
Signed-off-by: Philippe Coval <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Mats Wichmann <>
Reviewed-by: Ashok Babu Channa <>
23 months agoIOT-2539 Clean unused code warnnings 39/22739/4
George Nash [Mon, 9 Oct 2017 21:48:05 +0000 (14:48 -0700)]
IOT-2539 Clean unused code warnnings

Removed the [-Wunused-const-variable=] warning
The CRED_EMPTY_ROOT_MAP_SIZE was used in the past but is no longer
referenced anywhere in the code.

Removed the [-Wunused-const-variable=] warning
The SUPPORTED_PRMS array was used in the past but is no longer
referenced anywhere in the code.

Removed the [-Wunused-variable] warning
Looking at the logs a instance that gDeviceUUID was used could not
be found at any point in time.

Removed the [-Wunused-variable] warnings
Variables peer, pinNumber, and pmSel were only used in Direct Pairing
related unit tests which were removed as part of IOT-2306.

Removed the [-Wunused-function] warning
The InputPdACL function was only used by the Direct Pairing code
that was removed as part of IOT-2306.

Change-Id: I80f52619a04ee7eafc83b79b886c1121f61a6ba1
Signed-off-by: George Nash <>
23 months ago[IOT-2806] RESET clears all bits 93/22793/2
Nathan Heldt-Sheller [Thu, 12 Oct 2017 05:32:14 +0000 (22:32 -0700)]
[IOT-2806] RESET clears all bits

The RESET state should clear all the cm and tm bits before
setting the two lsbs (RESET and TAKE_OWNER bits) to 0b01 for
cm and 0b10 for tm.

Change-Id: I2b602153ea806d51bb1367514463ac590d4353db
Signed-off-by: Nathan Heldt-Sheller <>
23 months agoCheck for required properties in POST request. 19/22719/3
Todd Malsbary [Fri, 6 Oct 2017 18:11:19 +0000 (11:11 -0700)]
Check for required properties in POST request.

Change-Id: I0f7ff269693e50dee3c2ad870febdddcd5c69d8e
Signed-off-by: Todd Malsbary <>
23 months ago[IOT-2710] improve pstat logging 77/22777/2
Nathan Heldt-Sheller [Wed, 11 Oct 2017 05:25:45 +0000 (22:25 -0700)]
[IOT-2710] improve pstat logging

Help debug issue where CTT Updates /pstat.dos = SRESET and
tm is not being correctly set by IUT.

Change-Id: I2b598b21e3dd30c27b165ff7cdd033727d5b0858
Signed-off-by: Nathan Heldt-Sheller <>
23 months ago[IOT-2764] Fix issue in GetObserverUsingId() 99/22599/5
Sushil Yadav [Tue, 26 Sep 2017 05:40:35 +0000 (11:10 +0530)]
[IOT-2764] Fix issue in GetObserverUsingId()

The GetObserverUsingId() function should not assumes that observeId > 0.
For presenceResource the observeId = 0 when it is added as observer in
OCStartPresence() calls AddObserver() for presenceResource.

Change-Id: I6dceba0e2e8415c8e9d6b42339f30612b626cb0b
Signed-off-by: Sushil Yadav <>
23 months ago[IOT-2741] Static Analysis warning fixes. 29/22329/7
arya.k [Wed, 6 Sep 2017 05:10:24 +0000 (10:40 +0530)]
[IOT-2741] Static Analysis warning fixes.

Indentation fixes.

Change-Id: I44a6d21a70fba9d8bdb40972c93d78a778c2ee41
Signed-off-by: arya.k <>
23 months ago[IOT-2801] Allow /cred change 89/22789/3
Aleksey Volkov [Wed, 11 Oct 2017 17:10:18 +0000 (20:10 +0300)]
[IOT-2801] Allow /cred change

This patch allows /cred updates originating from internal stack.

Change-Id: If9dec4776770d96f740118b4dc2ef595c9433e8b
Signed-off-by: Aleksey Volkov <>
23 months agorapidjson: Remove patch from copied scriptlet 35/22735/2
Philippe Coval [Thu, 5 Oct 2017 09:43:23 +0000 (11:43 +0200)]
rapidjson: Remove patch from copied scriptlet

Change-Id: I13331bffd125faddcc053b70f4a01d718282d4bb
Signed-off-by: Philippe Coval <>
(cherry picked from commit ce6ab8b19d14e570fedf51ac73a37981e7ee4a6e)

23 months agocoap-http-proxy: cast size_t type in test 81/22081/5
Philippe Coval [Thu, 20 Jul 2017 11:17:59 +0000 (13:17 +0200)]
coap-http-proxy: cast size_t type in test

Suppress a warning using clang-3.5

  CoAPHttpUnitTest.cpp:277:60: error: \
  non-constant-expression cannot be narrowed from \
  type 'unsigned long' to 'uint16_t' (aka 'unsigned short') \
  in initializer list [-Wc++11-narrowing]

Change-Id: I8c740970a536a3bbc0d3d6d16cd4fe1dc81df6be
Signed-off-by: Philippe Coval <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Dan Mihai <>
(cherry picked from commit a7468c261b3f59090ad49d09c690be45b94c8f9c)

23 months agoIOT-2539 Clean switch compiler warning 41/22741/4
George Nash [Mon, 9 Oct 2017 22:44:14 +0000 (15:44 -0700)]
IOT-2539 Clean switch compiler warning

Remove the [-Wswitch] warning
were not in the Swtich in OCException and were added.

Change-Id: Idcd4e325f666a5b38a468f22f598336622cd951f
Signed-off-by: George Nash <>
23 months agoplugins: Avoid unsupported empty structs 59/22059/5
Philippe Coval [Tue, 28 Mar 2017 08:23:26 +0000 (10:23 +0200)]
plugins: Avoid unsupported empty structs

Observed issue on clang-3.5:
  plugins/include/plugintypes.h:52:9: \
  error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]

It might help MSC compiler too

Change-Id: Ib7cea3d37001ba1256478c1895972d519353feb2
Credit-to: Pawel Winogrodzki <>
Signed-off-by: Philippe Coval <>
Reviewed-by: Dan Mihai <>
Reviewed-by: Rick Bell <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Dave Thaler <>
(cherry picked from commit 9a779130a2e3c7fe21f981646efe6beaaf7ed9f5)

23 months agoFix OTM 15/22715/5
Oleksii Beketov [Fri, 6 Oct 2017 13:13:58 +0000 (16:13 +0300)]

Set DOS state RF_OTM before OTM start and RF_NOP after finish.

Change-Id: Iafa4315f034cf9e0e09b7d2663131fd26c06ff54
Signed-off-by: Oleksii Beketov <>
23 months agoservice: Removing redundant env configuration 45/21945/7
Pawel Winogrodzki [Tue, 15 Aug 2017 21:40:29 +0000 (14:40 -0700)]
service: Removing redundant env configuration

Moving global environment configuration common for all
platforms into build_common/SConscript and removing repeated
lines from service/*.

Change-Id: I9af112e943a9b31792ec40191efc6e248871532b
Signed-off-by: Pawel Winogrodzki <>
23 months agoIOT-2795 Android context for PlatformConfig 37/22737/2
George Nash [Mon, 9 Oct 2017 18:40:31 +0000 (11:40 -0700)]
IOT-2795 Android context for PlatformConfig

PlatformConfig on android should set context and activity
when the PlatformConfig was added to support introspection
the context and activity were missed due to developing and
testing using generic java code.

Change-Id: I208bde482977d88d750a2628691be81683f261bd
Signed-off-by: George Nash <>
23 months agoIOT-2796 prevent sprintf writing past array 25/22725/3
George Nash [Fri, 6 Oct 2017 21:46:49 +0000 (14:46 -0700)]
IOT-2796 prevent sprintf writing past array

tmp is not large enough to hold the two characters
appended to it and the terminating null character.

To make room for the terminating null character the
arrays were increased in size by 1.

Change-Id: I53683401a581cef89c8d32088b47d87448140ca2
Signed-off-by: George Nash <>
23 months agosecurity: Add tinycbor include path 61/22661/3
Philippe Coval [Fri, 18 Aug 2017 18:27:13 +0000 (20:27 +0200)]
security: Add tinycbor include path

Problem was observed using: scons install
(without scons building step)

Change-Id: I863f496d9a76ac3b5a7b69476aa76bdee66213ec
Signed-off-by: Philippe Coval <>
(cherry picked from commit 510dadf84e7866182136b58ef4e0f43801927f3b)

23 months agomodify repositories for tizen 2.4 mobile 11/21611/7
Youngman [Wed, 19 Jul 2017 05:11:54 +0000 (14:11 +0900)]
modify repositories for tizen 2.4 mobile

currently, 2.4-base repository is for release,
while 2.4-mobile repository is for snapshot.
(mismatch between both repositories)
Both repositories shall be for release.

Change-Id: I94c6eaaba9fba56ca81f56d7973ec4c3f847626a
Signed-off-by: Youngman <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Phil Coval <>
(cherry picked from commit d10a6a50ad786e102c08bf36720648f9f404e0ea)

23 months agoTransate OC_EH codes as documented. 27/22327/2
Todd Malsbary [Tue, 5 Sep 2017 19:03:17 +0000 (12:03 -0700)]
Transate OC_EH codes as documented.

The octypes.h header file defines what over-the-air codes should
result from the given OC_EH codes returned by an entity handler.  This
patch makes the code match the documentation.

Change-Id: I2a069310aff6557d1e1b11404099befe442bb159
Signed-off-by: Todd Malsbary <>
23 months agoconnectivity: Check on g_errorHandler pointer 91/22091/8
Veeraj Khokale [Mon, 29 May 2017 11:55:08 +0000 (17:25 +0530)]
connectivity: Check on g_errorHandler pointer

[IOT-2346] Accessing 'g_errorHandler' without NULL check

Add null checks before accessing
g_errorHandler in le adapter.

Change-Id: I9285ca29f91e99eefb0f8db23ccc7e31dca7e702
Signed-off-by: Veeraj Khokale <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Ashok Babu Channa <>
(cherry picked from commit 515372a4f92c7e620c8b246819618f8bfeb04c37)

23 months agobridging: Avoid to include unistd.h if unsupported 21/21821/7
Philippe Coval [Mon, 15 May 2017 15:27:03 +0000 (17:27 +0200)]
bridging: Avoid to include unistd.h if unsupported

Change-Id: I4732cfda0a7aea527d4ab012695e476428b3dec1
Signed-off-by: Philippe Coval <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Dan Mihai <>
(cherry picked from commit 101a28c3e7644a073c6bd8a7b561ec1ac83a28f9)

23 months agoIOT-2773 Add Introspection to Java 89/22689/3
George Nash [Wed, 4 Oct 2017 23:36:35 +0000 (16:36 -0700)]
IOT-2773 Add Introspection to Java

This adds the ability to register the introspection file
to java applications.

The client_open callback function is miss named as
JniOcSecurity. This should probably be renamed
JniOcPersistantStorage or something similar.

The class was not renamed to avoid causing an
unforseen bug due to name change.

Change-Id: Ifd19ee4c4bfa91e6596d64976008b8d471e4f87a
Signed-off-by: George Nash <>
23 months agoignore: Ignore pulled wksxmppxep module 85/22685/2
Philippe Coval [Thu, 17 Aug 2017 11:56:36 +0000 (13:56 +0200)]
ignore: Ignore pulled wksxmppxep module

Change-Id: I75a76a4a77af492a04e1e503ec3fb643b6f5ab05
Signed-off-by: Philippe Coval <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Larry Sachs <>
Reviewed-by: Mats Wichmann <>
(cherry picked from commit 519bae0918f3c05f72915792a3ab47ab680eabb8)

23 months agoprovisioning: Relocate Valgrind filename to topdir 69/22669/2
Philippe Coval [Tue, 22 Aug 2017 14:01:10 +0000 (16:01 +0200)]
provisioning: Relocate Valgrind filename to topdir

Align file to executable's name.

Note for future it would make sense put them in variant dir
or outdir at least to compare with different configuration.

Change-Id: Ia2c3443f44c80136d930e1ffd5600d57a8aadaad
Signed-off-by: Philippe Coval <>
23 months ago[IOT-2741] Static analysis warning fixes set-2. 85/22385/8
arya.k [Mon, 18 Sep 2017 04:37:35 +0000 (10:07 +0530)]
[IOT-2741] Static analysis warning fixes set-2.

1. Assign default values
2. Remove constants from decision making statements.
3. Add return by values.
4. Remove duplicate lines.
5. Indentations.

Change-Id: I8b3ba896bf72600bc9ee4fcbdc844506bdabf38f
Signed-off-by: arya.k <>
23 months ago[IOT-1977] Removal of dead code in ocstack 87/22687/2
Harry [Mon, 24 Apr 2017 12:16:29 +0000 (17:46 +0530)]
[IOT-1977] Removal of dead code in ocstack

Change-Id: Iafabb0b25d141bb8486d759d1c96a8046af58968
Signed-off-by: Harry <>
23 months agobuild: Support other archs for coverify report 63/22663/2
Philippe Coval [Thu, 7 Sep 2017 17:40:10 +0000 (19:40 +0200)]
build: Support other archs for coverify report

Change-Id: I36626c2180a0fc5e4ce8b77b22a5f9776aa62ea8
Signed-off-by: Philippe Coval <>
(cherry picked from commit 10aefe01381d264cb8c3593b8172dacba547f7aa)

23 months agoIOT-2539 remove parentheses and empty-body warning 15/22615/2
George Nash [Thu, 21 Sep 2017 21:23:18 +0000 (14:23 -0700)]
IOT-2539 remove parentheses and empty-body warning

In this case the if statment was not even needed
and was removed.

Removing the if statment cleaned both the parentheses
and empty-body warning.

Change-Id: Ia06fd44f070a66984a71db85d256dc76e61a9bc8
Signed-off-by: George Nash <>
(cherry picked from commit 7e59508a8a3f90fdfe3a1c4762e9005519f9a4e9)

23 months agoMinor resource leaks in security test for valgrind 51/22451/2
Mats Wichmann [Thu, 7 Sep 2017 14:29:03 +0000 (08:29 -0600)]
Minor resource leaks in security test for valgrind

(this is a cherry pick of a change in master)

These two valgrind reports are quieted (last line of each trace is
the file where the fix was made)

2 bytes in 1 blocks are definitely lost in loss record 1 of 270
   at 0x4C2EB6B: malloc (vg_replace_malloc.c:299)
   by 0x5B3576: OICMalloc (oic_malloc.c:82)
   by 0x5B363B: OICRealloc (oic_malloc.c:113)
   by 0x522520: GetDerCrl (crlresource.c:839)
   by 0x4721E1: CRLResourceTest_GetDerCrl_Test::TestBody() (crlresourcetest.cpp:90)

2,048 bytes in 1 blocks are definitely lost in loss record 268 of 270
   at 0x4C30A1E: calloc (vg_replace_malloc.c:711)
   by 0x5B35EC: OICCalloc (oic_malloc.c:102)
   by 0x4F0245: CredToCBORPayload (credresource.c:695)
   by 0x448AE9: CredResourceTest_CredToCBORPayloadNULL_Test::TestBody() (credentialresource.cpp:221)

Change-Id: I5ecfbc68103a62ec69513edb4cb68bb5d9297392
Signed-off-by: Mats Wichmann <>
(cherry picked from commit 8f1c432a9ca6074295ab65ddff3a80d44eb6dfae)

23 months ago[IOT-2726] /cred fix for CT1.7.8.11 65/22665/4
Aleksey Volkov [Tue, 3 Oct 2017 10:35:25 +0000 (13:35 +0300)]
[IOT-2726] /cred fix for CT1.7.8.11

This patch fixes `4.00 Bad Request` error on
/oic/sec/cred CON UPDATE request in CT1.7.8.11

This adds an additional check of the incoming credential
subjectid for OwnerPSK generation. Before, credresource
tried to generate owner psk for any subjectid in case if
doxm->owner value already saved, but doxm->owned flag
not yet set in true.
This led to an error at the POST handler return.

Change-Id: If2b683ee417bb058f954734ff0c1b64e145c9a6b
Signed-off-by: Aleksey Volkov <>
23 months ago[IOT-2726] Add pstat.dos check in AddCredential 29/22529/2
Aleksey Volkov [Wed, 20 Sep 2017 13:33:27 +0000 (16:33 +0300)]
[IOT-2726] Add pstat.dos check in AddCredential

This change adds /pstat.dos state check to protect credentials modifications in read-only states.

Change-Id: I9a3402e458db8c5fa62a5a0fa0e08c1dd432ceaf
Signed-off-by: Aleksey Volkov <>
23 months agoMfg crash 35/22535/6
Vadym Riznyk [Wed, 20 Sep 2017 18:02:29 +0000 (21:02 +0300)]
Mfg crash

1. Added generations certificates for mfg
2. deleted compilations warning

Change-Id: Idfca6974f2436a06d2d5d7676b8b11396cf1803b
Signed-off-by: Vadym Riznyk <>
23 months agobuild: Drop pretty option to support older gcovr 03/22403/3
Philippe Coval [Thu, 7 Sep 2017 17:40:21 +0000 (19:40 +0200)]
build: Drop pretty option to support older gcovr

If using gcovr 2.4 (r2774) just use --xml for reporting
on Ubuntu 14.04

Change-Id: Ib9c55ff2efcc90105305b3dcf7af8698a8e022a9
Signed-off-by: Philippe Coval <>
23 months agoeasy-setup: Removing redundant test configuration 39/21939/6
Pawel Winogrodzki [Tue, 15 Aug 2017 19:15:11 +0000 (12:15 -0700)]
easy-setup: Removing redundant test configuration

Moving global environment configuration common for all
platforms into build_common/SConscript and removing repeated
lines from service/easy-setup/*.


Change-Id: I578d7147ca731ec83599a260510fdcbc9b308ddd
Signed-off-by: Pawel Winogrodzki <>
23 months agogtest: Update path in 71/22671/2
Philippe Coval [Tue, 3 Oct 2017 12:22:22 +0000 (14:22 +0200)]
gtest: Update path in

It was not updated when it was relocated to new upstream

Change-Id: I4b8c2d4e6f398fc5941bff55ac3ab74b376e5e7a
Signed-off-by: Philippe Coval <>
23 months ago[IOT-2680] Remove WITH_RA option from code script 93/22393/5
koushik.girijala [Fri, 8 Sep 2017 12:23:20 +0000 (17:53 +0530)]
[IOT-2680] Remove WITH_RA option from code script

as RA related build option is not valid anymore

Change-Id: I9b197b258c575e0f00c443bee5d28c09e1876bb4
Signed-off-by: koushik.girijala <>
23 months agoDo not ignore return value of request callback. 97/22597/4
Todd Malsbary [Mon, 25 Sep 2017 21:13:50 +0000 (14:13 -0700)]
Do not ignore return value of request callback.

Change-Id: I6a3056db8fce56ac615729de9c8e4747c83446bc
Signed-off-by: Todd Malsbary <>
23 months agoIOT-2618 remove href prop in introspection res 73/22473/3
Srikrishna Gurugubelli [Thu, 14 Sep 2017 18:10:44 +0000 (11:10 -0700)]
IOT-2618 remove href prop in introspection res

Also made rt and if properties conditional based on whether the query
interface was baseline or not.

Signed-off-by: Srikrishna Gurugubelli <>
Change-Id: I620d422ebc4442a34fa9de8623221de6f341a342

23 months agoRe-enable 32-bit builds on linux 91/22591/6
Mats Wichmann [Mon, 25 Sep 2017 14:25:16 +0000 (08:25 -0600)]
Re-enable 32-bit builds on linux

During various rework of build scripts, a trick which let
32-bit linux builds proceed was lost.  The build wants to
call the 32-bit x86 build 'x86', but Python's platform.machine()
returns a more specific value (as obtained from the operating
system): 'i586' or 'i686'.

Fix from Geoffroy VanCutsem remaps the calculation of a default
value for TARGET_ARCH from platform.machine() to 'x86'.

Also taught {resource,service}/third_party_libs.scons that
in this scenario, cross building is not taking place.

Note this scenario is not built by Jenkins, so will depend
on affected developers affirming this works.

Change-Id: Ieb77a8734a9d17091c396fc8f1bc90e1a3bedb16
Signed-off-by: Mats Wichmann <>
23 months ago[IOT-2483, 2529] Incorrect IPv6 addr in endpoints 15/22515/2 1.3.1-RC2
Veeraj Khokale [Tue, 19 Sep 2017 05:59:14 +0000 (11:29 +0530)]
[IOT-2483, 2529] Incorrect IPv6 addr in endpoints

As per RFC 6874, the zone id of the ipv6 address
in a URI should be preceded by %25 and not just %.
Make this change while creating the ipv6 endpoint

Change-Id: I2e3ec53b16212d374c7ab2ecf6bfd5700c4e62ce
Signed-off-by: Veeraj Khokale <>
23 months ago[IOT-IOT-2739] Simulator plugin crash 85/22585/4
Harry [Mon, 25 Sep 2017 07:06:30 +0000 (12:36 +0530)]
[IOT-IOT-2739] Simulator plugin crash

Simulator server plugin crashed due to heap corruption.
Observe option being added for cancel observe response
where space for observe option will not be allocated in case
of observe cancel.

Change-Id: I29aa321e37070e490b7c3c3ec5d09c34be977cc6
Signed-off-by: Harry <>
23 months agoSimulator:Fix for static analyzer reported issues 01/21501/6
Harry [Tue, 4 Jul 2017 16:33:18 +0000 (22:03 +0530)]
Simulator:Fix for static analyzer reported issues

1. Removal of unused variables.
2. Using Map.empty() than Map.size() for optimization.
3. New API simulator_remote_resource::observe added to accept
   query parameters.

Change-Id: I3e8a4ebf3d03694f4f075a5345f1343d9ea453f8
Signed-off-by: Harry <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Senthil Kumar G S <>
Reviewed-by: Uze Choi <>
(cherry picked from commit 543d59f964c8b16db34897a4440b74fb9b83a2f3)

23 months ago[IOT-2745][Java][1.3.1-RC1] Static Analysis fix. 27/22627/2
Senthil Kumar G S [Wed, 27 Sep 2017 14:54:34 +0000 (20:24 +0530)]
[IOT-2745][Java][1.3.1-RC1] Static Analysis fix.

Java static analysis fix for easy-setup module.
1. Removed unused imports.
2. Updated log to include error info.
3. Avoided multiple statements in single line.
4. Removed unused methods/code.
5. Proper order of java modifiers, etc.

Change-Id: Ida08e2084246aca7c5f1528bb2efe4c57682c85c
Signed-off-by: Senthil Kumar G S <>
23 months ago[IOT-2638] Remove Deprecated API 99/22399/2
akk0rd [Fri, 8 Sep 2017 15:00:42 +0000 (18:00 +0300)]
[IOT-2638] Remove Deprecated API

MOTSendPostDoxmCB is using a deprecated function OCDoResource

Change-Id: Ibeb8f5a57011f832765a7994194d1da98e572d09
Signed-off-by: akk0rd <>
23 months agobuild: Use global RPATH value 55/22355/6
Philippe Coval [Fri, 21 Jul 2017 11:52:38 +0000 (13:52 +0200)]
build: Use global RPATH value

Also introduce ORIGIN for crosscompiler.

RPATH can be convenient to avoid developer to deal with environment variables
(LD_LIBRARY_PATH or PATH on windows), as we're using them for now.

In longer term, this can be replaced by relative pathes,
once the installation process is fixed
(at least on systems supporting ORIGIN).

It was tested on yocto poky master.

Change-Id: Ibaabc31b8dc744267e4c6c1c682d2090da9ada96
Signed-off-by: Philippe Coval <>

23 months ago[IOT-2752] Update invalid cert chain handling 79/22579/3
Alex Kelley [Fri, 22 Sep 2017 00:05:54 +0000 (17:05 -0700)]
[IOT-2752] Update invalid cert chain handling

Update the handling of an invalid cert chain so that we move to the
next chain before cleaning up the invalid chain.

Change-Id: I95e4e410a9bca81a698f2c074cfca18b203e5133
Signed-off-by: Alex Kelley <>
23 months agoresource-directory: Check links before free 27/22127/5
Philippe Coval [Thu, 24 Aug 2017 14:23:51 +0000 (16:23 +0200)]
resource-directory: Check links before free

In case if pointer has not been assigned

This is also suppressing a valgrind warning
when running test resource/csdk/stack/test/stacktests:

  2,208 bytes in 1 blocks \
  are possibly lost in loss record 0 if 0

Change-Id: Ifd44172a1f7755ec253748f6f02fbfd1dcacdd39
Signed-off-by: Philippe Coval <>
Tested-by: jenkins-iotivity <>
Reviewed-by: George Nash <>
Reviewed-by: Mats Wichmann <>
Reviewed-by: Ashok Babu Channa <>
(cherry picked from commit 2c926be5e04dd982316c05c461c9a95fd0beae9a)

23 months agoRename macro VERIFY_CBOR_SUCCESS 63/22563/2
Steven Saunders [Thu, 21 Sep 2017 23:43:32 +0000 (17:43 -0600)]


Change-Id: I5ee8795a21d8d84708737f83957fe260cf1234d2
Signed-off-by: Steven Saunders <>
23 months ago[IOT-2539] Remove maybe-uninitialized warning 83/22083/5
George Nash [Tue, 1 Aug 2017 18:21:09 +0000 (11:21 -0700)]
[IOT-2539] Remove maybe-uninitialized warning

The compiler was indicating that the request.len and
request.bytes maybe used uninitialized. Best I can
tell the OCByteString is initilaized in the GenerateCSR
function. The compiler can not tell that it is
initilaized so it is zero initialized at creation.

Change-Id: I19dd9818b1485ec0da64b48dc2510c8e939c6c0f
Signed-off-by: George Nash <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Dan Mihai <>
(cherry picked from commit 88ce2816c8cca2f775927a03b2843446cc743e6d)

23 months agonotification: Removing redundant configuration 27/21327/12
Pawel Winogrodzki [Fri, 28 Apr 2017 04:21:50 +0000 (21:21 -0700)]
notification: Removing redundant configuration

Moving global environment configuration common for all
platforms into build_common/SConscript and removing repeated
lines from service/notification/*.

Change-Id: I696f93a0fde5fcbe7ed8f3509b4de1747825d5fd
Signed-off-by: Pawel Winogrodzki <>
23 months agoFix build error: WITH_MQ 09/22509/3
Ziran Sun [Mon, 18 Sep 2017 15:12:30 +0000 (16:12 +0100)]
Fix build error: WITH_MQ

Change-Id: If4249e5cf198fcb1dad4969d2cb7b141adb687b4
Signed-off-by: Ziran Sun <>
23 months agoCorrect wrong settings on format. 71/22571/3
Ziran Sun [Fri, 22 Sep 2017 11:36:30 +0000 (12:36 +0100)]
Correct wrong settings on format.

Change-Id: Icde3607a38559598d91902c57d159b6784fecea1
Signed-off-by: Ziran Sun <>
23 months ago[IOT-2724] ES Mediator Android Sample Crash. 55/22555/5
Senthil Kumar G S [Thu, 21 Sep 2017 16:32:13 +0000 (22:02 +0530)]
[IOT-2724] ES Mediator Android Sample Crash.

Updated JNI file to add iotivity stack version in EnrolleeConfig representation.
Updated sample to parse wifi modes and frequencies based on the version.

Change-Id: I1580823bdf3309369eb747dca4d3ce1bc3087158
Signed-off-by: Senthil Kumar G S <>
23 months ago[IOT-2748] Fix OCProvisionSymmetricRoleCredentials 11/22611/2
Alex Kelley [Mon, 25 Sep 2017 22:54:10 +0000 (15:54 -0700)]
[IOT-2748] Fix OCProvisionSymmetricRoleCredentials

This chanage updates OCProvisionSymmetricRoleCredentials to use internal
APIs that change the DOS state before and after updating credentials.

Change-Id: I351ee00c9a1a182d8ffe41f73c5eaf4eda4dfb52
Signed-off-by: Alex Kelley <>
23 months ago[IOT-2756] Handle empty cert chain in role entry 95/22595/2
Alex Kelley [Fri, 22 Sep 2017 21:36:11 +0000 (14:36 -0700)]
[IOT-2756] Handle empty cert chain in role entry

Update HandleDeleteRequest to return OC_EH_RESOURCE_DELETED when the role
entry does not contain any cert chains.

Change-Id: Id393a67da10c4f18f8fb69ed15de7782bdac9c70
Signed-off-by: Alex Kelley <>
23 months agoUpdate IoTivity version to 1.3.1 09/22409/3
Philippe Coval [Fri, 8 Sep 2017 17:22:15 +0000 (19:22 +0200)]
Update IoTivity version to 1.3.1

Change-Id: Idf208ace8c533da9d7587cd1a56aeca81edee9d2
Signed-off-by: Philippe Coval <>
23 months agonotification: Fix wrong NULL affectation 27/22027/2
Philippe Coval [Thu, 20 Jul 2017 11:17:59 +0000 (13:17 +0200)]
notification: Fix wrong NULL affectation

To numbers or pthread type

Change-Id: Id0e1354608f83553cc84cc855becf46ced3d0cd2
Signed-off-by: Philippe Coval <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Dan Mihai <>
(cherry picked from commit a389836e1991a57f7cb74198209dc8a375654a36)

23 months agoEasySetup:Fix for static analyzer reported issues 19/21519/11
Harry [Tue, 4 Jul 2017 13:07:48 +0000 (18:37 +0530)]
EasySetup:Fix for static analyzer reported issues

Removal of never used methods and catching exceptions by reference.

Change-Id: I10d3c83ce5b14174b6f82a49897738c98a461af7
Signed-off-by: Harry <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Senthil Kumar G S <>
Reviewed-by: Phil Coval <>
(cherry picked from commit e450d10699a504c90cb37fba3e9a551d93278e25)

23 months ago[IOT-2729] Update role resource and certhelpers 57/22557/2
Alex Kelley [Tue, 19 Sep 2017 19:30:36 +0000 (12:30 -0700)]
[IOT-2729] Update role resource and certhelpers

1. Update OCInternalVerifyRoleCertificate to add the issuer as the
   authority if the role certificate IoTivity received does not
   contain an authority in the subject alternative name.
2. Update GetEndpointRoles to check for OC_STACK_NO_RESOURCE and
   OC_STACK_INVALID_PARAM so it can fall back to symmetric key role
   handling when the connection is not secured with a certificate.

Change-Id: Ieba2bfbbf5edfb32d74c24b5f668a8ee9d530354
Signed-off-by: Alex Kelley <>
23 months agocsdk: Avoid to overlap memcheck files for UT 67/22067/10
Philippe Coval [Wed, 23 Aug 2017 15:03:35 +0000 (17:03 +0200)]
csdk: Avoid to overlap memcheck files for UT

From now on, it's better to align executable name


Change-Id: I8c8fd9ee68b01dfcc62d8a250c26649a82ba116e
Signed-off-by: Philippe Coval <>
Tested-by: jenkins-iotivity <>
Reviewed-by: George Nash <>
Reviewed-by: Alex Kelley <>
Reviewed-by: Mats Wichmann <>
(cherry picked from commit 52da664568c4071151dfb6bcf506163ebaba2957)

23 months agoIPCA: Install libipca dir to libdir 77/22077/2
Philippe Coval [Mon, 7 Aug 2017 07:08:33 +0000 (09:08 +0200)]
IPCA: Install libipca dir to libdir

It needs to be install to variant dir along other libs then
dependency libs will be also be found using RPATH.

Change-Id: I4e9ff5ad8b72850f5ef79a093502edf53c8e64d7
Signed-off-by: Philippe Coval <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Dan Mihai <>
(cherry picked from commit 811ad50df741db60420cd2415ad8c94378cd79f1)

23 months agoIPCA: Convert JSON file to UNIX format 39/22139/2
Philippe Coval [Fri, 18 Aug 2017 12:02:40 +0000 (14:02 +0200)]
IPCA: Convert JSON file to UNIX format

Change-Id: I4e95cda451f0ec2ba3f0363de748fe68c15869a4
Signed-off-by: Philippe Coval <>
23 months agoTransform OC_EH_OK into 2.02 for DELETE. 81/22281/3
Todd Malsbary [Wed, 30 Aug 2017 21:24:27 +0000 (14:24 -0700)]
Transform OC_EH_OK into 2.02 for DELETE.

Currently OC_EH_OK is turned into 2.04 for POST or PUT.  This change
does the equivalent for DELETE.

Change-Id: I3b64d9c3a9471cdff25160ffab96928e0512fc33
Signed-off-by: Todd Malsbary <>
23 months agoList child resource eps instead of parent. 77/22277/6
Todd Malsbary [Wed, 30 Aug 2017 19:10:37 +0000 (12:10 -0700)]
List child resource eps instead of parent.

Change-Id: I90917f5fd965fd0e811326d3674cb751e5ac989e
Signed-off-by: Todd Malsbary <>
23 months agoStack sample client fix 15/21615/3
Oleksandr Dmytrenko [Tue, 25 Jul 2017 11:09:52 +0000 (14:09 +0300)]
Stack sample client fix

Stack sample client support old servers

Change-Id: Id9fffc3b9e73c68820b99e5fd197d742d0b19418
Signed-off-by: Oleksandr Dmytrenko <>
23 months agoprovisioning: Use .tmp suffix for test file 57/22057/10
Philippe Coval [Fri, 18 Aug 2017 12:36:45 +0000 (14:36 +0200)]
provisioning: Use .tmp suffix for test file

We can use .tmp suffix for generated files to be ignored in git repo

Change-Id: I70d109e590784777a0ce2a87fa7451676bad20e8
Signed-off-by: Philippe Coval <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Mats Wichmann <>
Reviewed-by: Dan Mihai <>
Reviewed-by: Randeep Singh <>
(cherry picked from commit a8abd0026c9fc8c8e6679202168f79c6206eff72)

23 months ago[IOT-2539] clean switch warning 11/22211/2
George Nash [Mon, 31 Jul 2017 20:00:55 +0000 (13:00 -0700)]
[IOT-2539] clean switch warning

The file deviceonboardingstate.c produced a warning:
enumeration value 'DOS_STATE_COUNT' not handled in switch

This is a result of adding the the DOS_STATE_COUNT as an
enum value. This is a common programming pattern but will
result in the -Wswitch warning if the enum values are
used in a case statement without a default state.

There are multiple ways to handle this warning.
- add an empty case for the unhandled count state
- add a default case to the switch statement
- move the count out of the enum

For this fix the unhandled count state was added
to the switch statment with an assert if that case
is ever encountered.

Change-Id: I14c390b34d33db9a82a3bd055dd513a96c941733
Signed-off-by: George Nash <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Dan Mihai <>
(cherry picked from commit b76529cbc0004b40b8142fb6721deff67eddb0e4)

23 months agoservice: clean up compiler warning 21/22221/2
George Nash [Fri, 14 Jul 2017 20:36:08 +0000 (13:36 -0700)]
service: clean up compiler warning

Clean up the implicit-function-declaration warning in
CoapHttpHandler.c. The compiler is not finding the
OCParsePayload function so it is interpreting it as a
function that takes 4 parameters and returns an int.
This is a result of how old C compilers handle

The fact that OCParsePayload was used incorrectly was hidden
it should have 5 parameters not 4.  The code now includes the
internal header ocpayloadcbor.h and fixes the call to

Change-Id: I894e3d423617c15c1ce2cf35825637984d1babd8
Signed-off-by: George Nash <>
Reviewed-by: Larry Sachs <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Phil Coval <>
Reviewed-by: Dan Mihai <>
Reviewed-by: Rick Bell <>
(cherry picked from commit 35bcc24dde8e62832360092fa4da44b60e24305f)

23 months agoIOT-2539 Cleanup unused-parameter warning 95/22195/2
George Nash [Mon, 7 Aug 2017 21:40:26 +0000 (14:40 -0700)]
IOT-2539 Cleanup unused-parameter warning

This is a set of code that will sometimes have a warning
depending on what is defined. To prevent the
unused-parameter warning the parameters are cast to void.
A empty operation that will be compiled out but prevents
the warning.

Change-Id: I08c73fb565b62d3a760956976a012331863a6c73
Signed-off-by: George Nash <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Dan Mihai <>
(cherry picked from commit 598e8c5b7e7ad9cfc6fab77f5843e5e390509728)

23 months ago[IOT-2539] remove the -Wcpp warning from octimer.c 87/22187/2
George Nash [Thu, 27 Jul 2017 17:49:05 +0000 (10:49 -0700)]
[IOT-2539] remove the -Wcpp warning from octimer.c

This warning comes from teh glibc library. The library
has a # warning in the code if _BSD_SOURCE or _SVID_SOURCE
are defined in the code. The code that was enabled using
the two macros has been depricated. The new _DEFAULT_SOURCE
macro should be used to enable the features that were
enabled by the old macros.

If you need to build with old and newer versions of glibc
the glibc release notes recomend using both the old and
new macros.

Change-Id: I000d3bbfe4fdc473066d8c50862070c8b49788ca
Signed-off-by: George Nash <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Dan Mihai <>
Reviewed-by: Mats Wichmann <>
Reviewed-by: Phil Coval <>
(cherry picked from commit 97bc6dcae86b4d97953a66abee12ad09acb02d00)

23 months agoIOT-2678 Change Java back to dynamic linking 37/22537/4
George Nash [Wed, 20 Sep 2017 19:32:12 +0000 (12:32 -0700)]
IOT-2678 Change Java back to dynamic linking

Java was changed to use static linking for most of
the libraries. This was done to enable building Java
on Windows which does not contain the same dynamic
libraries as are avalible to Linux and Android.

See IOT-2405

Unfortanatly this change caused an issue in the Android
serivces. It caused multiple instances of the IoTivity
stack to be included in different libraries used by
the Android services.

This reverts the key elements of IOT-2405 without
reverting the entier change.


This is being done till we can figure out how to
enable the build on windows so it does not cause
multiple copies of the oc stack.

Windows java will no longer build if this commit
is accepted. However, Android is considered a
higher priority OS when it comes to the Java

Change-Id: I54e9e65b00a199151395542d9e4629cef4efe516
Signed-off-by: George Nash <>
23 months agoSvrdbeditor print certs 17/22517/2
Oleksii Beketov [Tue, 19 Sep 2017 11:37:33 +0000 (14:37 +0300)]
Svrdbeditor print certs

Add print certificates

Change-Id: I92092c96ed467877bad8517c02d2d936b25f038b
Signed-off-by: Oleksii Beketov <>
23 months ago[IOT-2306] Remove Direct Pairing 49/21449/18
v.riznyk [Fri, 14 Jul 2017 08:51:47 +0000 (11:51 +0300)]
[IOT-2306] Remove Direct Pairing

Remove direct pairing and pconfresource

Change-Id: Ia71db37f0c2ecbf2d7a62a8363c0949ada7e0f9e
Signed-off-by: v.riznyk <>
23 months ago[IOT-2475] Remove direct pairing from Java layer 81/21781/9
saurabh.s9 [Tue, 8 Aug 2017 09:59:34 +0000 (15:29 +0530)]
[IOT-2475] Remove direct pairing from Java layer

Removed build failure issue for android
Change-Id: I3519cf8a8efff806f9a53aebc608150acc7d4427
Signed-off-by: saurabh.s9 <>
23 months agoiOS build fix 07/22507/2
Mats Wichmann [Mon, 18 Sep 2017 10:18:41 +0000 (04:18 -0600)]
iOS build fix

recent change dropped some characters which broke iOS build (which is
not tested by Jenkins), restoring them here.

Change-Id: Ic44e6239f11094ccebf9eb891805d28bf02aeee7
Signed-off-by: Mats Wichmann <>
23 months ago[IOT-2737] Fix build warning in routing layer. 27/22527/2
Senthil Kumar G S [Fri, 18 Aug 2017 13:07:11 +0000 (18:37 +0530)]
[IOT-2737] Fix build warning in routing layer.

Warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing].

Change-Id: I19a851e0bf16e4b46ba6b7ed1167cb50c4502f18
Signed-off-by: Senthil Kumar G S <>

23 months ago[IOT-2718] Update Roles resource 21/22521/1
Alex Kelley [Mon, 18 Sep 2017 20:33:21 +0000 (13:33 -0700)]
[IOT-2718] Update Roles resource

1. Update RolesToCBORPayload to handle large role certificate chains
that require allocating more memory.
2. Update GetEndpointRoles to fix AV when adding multiples roles to the
list of roles to return.

Change-Id: I08de68eb0b2757bd17eb9ffe4e304ee378165266
Signed-off-by: Alex Kelley <>
23 months ago[IOT-2617] Enable Anon Ciphersuite after RESET 99/22499/2
Nathan Heldt-Sheller [Fri, 15 Sep 2017 23:25:06 +0000 (16:25 -0700)]
[IOT-2617] Enable Anon Ciphersuite after RESET

The Anon Ciphersuite should be enabled after RESET if the Device
by default has the oxmsel == JUSTWORKS, so that a Client isn't
required to re-select the JUSTWORKS OTM in order to enable the

Change-Id: I6ab06b958959b1cad5e04f0bc63e90c8c4202785
Signed-off-by: Nathan Heldt-Sheller <>
23 months agoprovisioning: Fixed memory leak 23/22223/7
George Nash [Mon, 28 Aug 2017 23:25:21 +0000 (16:25 -0700)]
provisioning: Fixed memory leak

Fixed memory leak found using valgrind. The memory
leak was due to the provisionInit function calling
sqlite3_open_v2 without calling sqlite3_close

There was not provisionClose method in the C++ so it was
added to the OCSecure class. To do this OCClosePM was
also added to that the code could be used in Windows.

The provisioningClose call was added to all of the samples
that are currently calling provisioningInit(dbfile)

While updating the some of the android samples the
tab depth was cleaned.

Note the unit tests are not following one of the most
basic rules of unit testing. Tests should be isolated
and independent. When the cleanup code was added to the
unit tests it broke tests that run later. Each individual
unit test should be able to run independent of all the
other unit tests order should not matter. This commit
does a little to break the dependency tests have on other
tests, but it did not fix it completely. Many tests rely
on the DB being left in a state by another test as well as
passing test state to global variables that hold information
outside the individual test.

Change-Id: Id2c05ecc611516a5cf892ae70bb4e0cd0c115752
Signed-off-by: George Nash <>
23 months agotizen: Remove RPATH info on install 97/22097/4
Philippe Coval [Fri, 11 Aug 2017 14:44:28 +0000 (16:44 +0200)]
tizen: Remove RPATH info on install

Libraries will be install to regular system path (/usr/lib),
so RPATH info is no more relevent.

Change-Id: I7492b772ab5b2a43f5d493c9334202617b7f0282
Signed-off-by: Philippe Coval <>
Reviewed-by: Dave Thaler <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Mats Wichmann <>
Reviewed-by: George Nash <>
Reviewed-by: Dan Mihai <>
Reviewed-by: Rick Bell <>
Reviewed-by: Ziran Sun <>
(cherry picked from commit f0950b65d934fca41c4252dd198480696f61eb2b)

23 months agoIOT-2539 Fix write-strings warning 93/22193/3
George Nash [Fri, 4 Aug 2017 18:57:02 +0000 (11:57 -0700)]
IOT-2539 Fix write-strings warning

The write-strings warning comes from assigning
the a const string to a char* that is not const.
From everything I see in this example the string
is not changed so simply using const_cast will
remove the warning.

If these values are always expected to be constant
we may want to consider changing the strutures
to hold const char * not char *. Without further
investigation I did not feel safe making that

Change-Id: Ib9053a1041b72b1fd05329999efc7a7ff28aab94
Signed-off-by: George Nash <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Mats Wichmann <>
Reviewed-by: Phil Coval <>
Reviewed-by: Rick Bell <>
(cherry picked from commit ff88390c2889d3e20bdbdcf73e10ada7584ab8e8)

23 months agoIOT-2539 Fix return-type warning 79/22179/2
George Nash [Wed, 2 Aug 2017 22:59:06 +0000 (15:59 -0700)]
IOT-2539 Fix return-type warning

The _worker function expects a void * return type
only functions with return type of void do not have
to have a return.

Since the return value does not appear to be used
simply return NULL.

Change-Id: I3cee6f7a491320d21b1d70f9a8df0f7b4538087b
Signed-off-by: George Nash <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Phil Coval <>
Reviewed-by: Mats Wichmann <>
Reviewed-by: Rick Bell <>
(cherry picked from commit 9a55ebdaefd544b37c7534b479ceff33ccc9f123)

23 months ago[IOT-2539] clean implicit-function-declaration 89/22189/2
George Nash [Mon, 31 Jul 2017 16:55:14 +0000 (09:55 -0700)]
[IOT-2539] clean implicit-function-declaration

The pdu.c file was producing an implicit-function-declaration
warning for the ntohs() function. The ntohs function is part
of the arpa/inet.h header.  This is conditionally included
based on the HAVE_ARPA_INET_H macro. The HAVE_ARPA_INET_H
macro is defined in the iotivity_config.h header. So
iotivity_config.h must be included in pdu.c to properly detect
the macro.

It looks like some systems may supply the ntohs() function
without arpa/inet.h. So it is unclear if the call to the
function its self needs some added macros.

Change-Id: I7e19d65e1371d46b35d70a5ecdf06fb0b73152ff
Signed-off-by: George Nash <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Dan Mihai <>
(cherry picked from commit 9b704e02253b181f88c00aad98083bfeb55328ae)

23 months ago[IOT-2268] cleanup unused-local-typedefs warning 13/22213/2
George Nash [Tue, 25 Jul 2017 16:38:19 +0000 (09:38 -0700)]
[IOT-2268] cleanup unused-local-typedefs warning

The definition used for the OC_STATIC_ASSERT created
an unused typedef with an array of an invalid size
if the assert condition was not met. This resulted
in an unused-local-typedef warning every time
OC_STATIC_ASSERT was used even if it did not cause
a static assert.

The macro was updated to create an enum of 1/condition
if the condition is false this will create a compiler
warning because 1/0 is an invalid value. Its supprisingly
difficult to find a macro that will satisfy C, and C++
for most standard compilers. With out producing a warning.

Also when possible the __COUNTER__ macro is used to create
the unique identifier for the OC_STATIC_ASSERT this
addresses the problem of using the static ASSERT on the
same line. This would have been an issue with the original
way the code was written.

Change-Id: I4a9cc8d61702eacaddfd1ae5679126af02208f5e
Signed-off-by: George Nash <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Rick Bell <>
(cherry picked from commit db426b113862fddd2241029dd8f7ee4bed01e39a)

23 months agoIOT-2539 Fixed incompatible-pointer-types warning 05/22205/3
George Nash [Tue, 15 Aug 2017 19:50:20 +0000 (12:50 -0700)]
IOT-2539 Fixed incompatible-pointer-types warning

The function GetResourceFromHandle was returning a PIResource**. When
the actual code was inspected it was returning a PIResourceBase** that
was being cast to a PIResource**. That value was then used as a
PIResource**. The only reason this code worked is because the way C
lays out structs in memory is sequential Since the first element of the
PIResoruceBase is a PIResource treating the the PIResourceBase like
a PIResource worked only by virtue of the memory layout rules for C

Later in the zigbee_wapper.c it relies again on the memory layout
rules for structs to assign PIResource** to a PIResource_Zigbee**.

This relies too much on internal knowledge of memory layout and is
a potential management problem. The code tied 3 structs together
based on there memory layout.

To fix the issue. The GetResourceFromHandle now returns PIResourceBase**
which was the actual type returned. In the cleanup code the pointer
is change from PIResource* to PIResourceBase*. Now when the value is
passed into the DeleteResource function it no longer generates the
incompatible-pointer-types warning.

In zigbee_wrapper.c we no longer cast the PIResource_Zigbee* to
PIResource* we now pass in the part of the PIResource_Zigbee that is
actually the PIResourceBase.

Change-Id: I6b147a52c522d036d016e2cd15e2900e6fc06249
Signed-off-by: George Nash <>
Tested-by: jenkins-iotivity <>
Reviewed-by: Mats Wichmann <>
Reviewed-by: Dan Mihai <>
Reviewed-by: Larry Sachs <>
Reviewed-by: Rick Bell <>
(cherry picked from commit 25898d822bea23ec7f19b6858026de493031c70e)

23 months agoUse path in persistent storage open callback. 25/22425/3
Todd Malsbary [Mon, 11 Sep 2017 23:22:36 +0000 (16:22 -0700)]
Use path in persistent storage open callback.

Change-Id: Ia72de1fd70d5b7b665e56661e53c5b97c51c375e
Signed-off-by: Todd Malsbary <>
23 months ago[Easy Setup] Memory leak fix 87/22487/2
Abhishek Pandey [Fri, 15 Sep 2017 13:00:29 +0000 (18:30 +0530)]
[Easy Setup] Memory leak fix

JIRA IOT-2721:

Change-Id: Ie9309fc6830b5473e8b7482b798d59bb2aed2e13
Signed-off-by: Abhishek Pandey <>
23 months agojava: Fix doxygen mistakes in doc 65/22365/4
Philippe Coval [Fri, 25 Aug 2017 07:50:53 +0000 (09:50 +0200)]
java: Fix doxygen mistakes in doc

Change-Id: I7ca840a000fcd22366123c87a0f5b086806be9ec
Signed-off-by: Philippe Coval <>
2 years ago[IOT-2419] Update the samples to run with security 37/22437/4
George Nash [Tue, 12 Sep 2017 22:37:54 +0000 (15:37 -0700)]
[IOT-2419] Update the samples to run with security

This uses the same acl files that were introduced in
The simple server was updated to default to a secure interface.

Tested by running against each other and the C++
simpleserver simpleclient samples.

Change-Id: I623fc40759a6382568de572cedf9aa8f52fbfbe9
Signed-off-by: George Nash <>
2 years agosecurity: Example support SVR ACL v2 and fix PS 89/21489/9
Philippe Coval [Tue, 29 Aug 2017 15:11:59 +0000 (17:11 +0200)]
security: Example support SVR ACL v2 and fix PS

Update json file to support ACL from CSDK, inspired by:

Also add persistent storage to overload security dat file.

Make example working again using:

  ./simpleserver 2

  Observe registration action is successful
        SequenceNumber: 0
        state: true
        power: 55
        name: John's light

Note those .dat files were generated from master branch
using json2cbor tool automatically,
1.3-rel does not have the scanner generator yet.

Change-Id: Id457fedd74bf7540c2a223e4ab079076af1f2134
Signed-off-by: Philippe Coval <>
2 years agobuild: Preserve target_os change 53/22353/4
Philippe Coval [Wed, 6 Sep 2017 17:10:05 +0000 (19:10 +0200)]
build: Preserve target_os change

Yocto sets target_os variable to 'linux', we want to keep it.

help_vars.Update(env) from 03f23f37 is introducing a regression.

Change-Id: I688a1a613691a5005bb3c019202466b85d725a4c
Signed-off-by: Philippe Coval <>
2 years ago[IOT-2678] Adding Null check to fix crash 55/22455/2 1.3.1-RC1
Sushil Yadav [Thu, 14 Sep 2017 11:42:48 +0000 (17:12 +0530)]
[IOT-2678] Adding Null check to fix crash

Change-Id: I360d5ffbe468f16e40a1f1f3171edd1c0d23e94d
Signed-off-by: Sushil Yadav <>