contrib/iotivity.git
9 years agoDownload gtest-1.7.0 rather than depending on it being installed
William Dieter [Sat, 20 Dec 2014 18:46:44 +0000 (18:46 +0000)]
Download gtest-1.7.0 rather than depending on it being installed

Making the user download and install gtest-1.7.0 is inconvenient for the
user.  Also, we do not have direct access to the build machine to update
how and where gtest is stored.  Downloading to the extlibs directory in
project source tree removes the need for developers to download and build
gtest and removes the need to configure the build machine.

Change-Id: I3b163c09ecdd9f12e8004a69dfa8dbcaf4ae5615
Signed-off-by: William Dieter <william.r.dieter@intel.com>
9 years agoAdded Release notes for Dec 20th release 0.9.0-RC1
Sudarshan Prasad [Sat, 20 Dec 2014 06:05:08 +0000 (22:05 -0800)]
Added Release notes for Dec 20th release

Change-Id: I8f4e487b13fa118291803513bf8fc97cc0f1071c
Signed-off-by: Sudarshan Prasad <sudarshan.prasad@intel.com>
9 years agoMerge "Fixing delete issue in device discovery server sample"
sudarshan prasad [Sat, 20 Dec 2014 04:36:02 +0000 (20:36 -0800)]
Merge "Fixing delete issue in device discovery server sample"

9 years agoFixed Scons build Error.
heesung84.kim [Sat, 20 Dec 2014 01:05:54 +0000 (10:05 +0900)]
Fixed Scons build Error.

  Before scons build is not working because of cpluff build and mqtt build.
  It is resolved.

Remove null check point cpluff.
  PluginManger will pass the argument to plugins later.
  Currently it is not needed yet.
  Comment out related code.

Modify the readme file for scons build
  Before readme file is for makefile.

Comment Out Notification build in the Scons script.
  Because of scons build error.

Change-Id: I1d74179ee6439535f218bb45a2f93248fb731228
Signed-off-by: heesung84.kim <heesung84.kim@samsung.com>
9 years agoMerge "Replaced sprintf with snprintf in the sdk to avoid potential buffer overflows"
sudarshan prasad [Fri, 19 Dec 2014 22:38:52 +0000 (14:38 -0800)]
Merge "Replaced sprintf with snprintf in the sdk to avoid potential buffer overflows"

9 years agoMerge changes Ie4233a5c,I4d7aba08
Patrick Lankswert [Fri, 19 Dec 2014 21:14:41 +0000 (13:14 -0800)]
Merge changes Ie4233a5c,I4d7aba08

* changes:
  Ignore SCons generated files and directories.
  Removed execute permissions from non-executable files.

9 years agoUpdated sample apps to show use of multiple presence RT filters.
Joseph Morrow [Fri, 19 Dec 2014 18:59:12 +0000 (13:59 -0500)]
Updated sample apps to show use of multiple presence RT filters.

Updated C sample apps and C++ sample apps to display a simple multi-
resource presence use-case. This shows a few cases which automatically
generate presence notifications.

Change-Id: Id6e5a9de6d7ed06bd3a03291bb0eade74154b7f2
Signed-off-by: Joseph Morrow <joseph.l.morrow@intel.com>
9 years agoMerge "Make all multicast coap messages sent as Low_QoS/NON."
sudarshan prasad [Fri, 19 Dec 2014 18:56:39 +0000 (10:56 -0800)]
Merge "Make all multicast coap messages sent as Low_QoS/NON."

9 years agoMake all multicast coap messages sent as Low_QoS/NON.
Yamin Al-Mousa [Fri, 19 Dec 2014 18:44:34 +0000 (10:44 -0800)]
Make all multicast coap messages sent as Low_QoS/NON.

When a client in C++ is configured to use HighQoS,
then discovery request goes as CON to a multicast address.
However, responses/ACKs are coming from a unicast address.
This makes it impossible for clients to associate requests
with responses and stop retrying CON pdus.Now, CoAP layer is
making sure that all packets sent to multicast address are NON.

Change-Id: I41f351c5c9ce75fc4846d970514733bef5cdce61
Signed-off-by: Yamin Al-Mousa <yamin.s.al-mousa@intel.com>
Signed-off-by: Sudarshan Prasad <sudarshan.prasad@intel.com>
9 years agoMerge "Fixed Warning in OCException"
sudarshan prasad [Fri, 19 Dec 2014 18:33:39 +0000 (10:33 -0800)]
Merge "Fixed Warning in OCException"

9 years agoFixing delete issue in device discovery server sample
omkar [Fri, 19 Dec 2014 17:43:06 +0000 (09:43 -0800)]
Fixing delete issue in device discovery server sample

Earlier we were doing a new[] on device info and cleaning up using delete.
Changing "delete" to "delete[]".

Change-Id: I4684e0cdf4e1a38a45cd1bcc5820a980c3db14f9
Signed-off-by: omkar <omkar.m.hegde@intel.com>
9 years ago[service] Update service documents.
HyunJun Kim [Fri, 19 Dec 2014 08:30:45 +0000 (17:30 +0900)]
[service] Update service documents.

Change-Id: Ifc39cbee3321a43c45c004099b5ba36cd4b115ac
Signed-off-by: HyunJun Kim <hyunjun2.kim@samsung.com>
9 years agoMerge "Fix issues of Things Manager"
Uze Choi [Fri, 19 Dec 2014 08:12:11 +0000 (00:12 -0800)]
Merge "Fix issues of Things Manager"

9 years agoMerge "Add scons script and things manager samples."
Uze Choi [Fri, 19 Dec 2014 08:10:43 +0000 (00:10 -0800)]
Merge "Add scons script and things manager samples."

9 years agoMerge changes I9ccf4bec,Id22df7b5
Uze Choi [Fri, 19 Dec 2014 08:05:54 +0000 (00:05 -0800)]
Merge changes I9ccf4bec,Id22df7b5

* changes:
  [service] Update service documents
  [SSM] Add OIC namespace and cleanup description file

9 years agoMerge "[SSM] change soft sensor description folder path"
Uze Choi [Fri, 19 Dec 2014 08:04:30 +0000 (00:04 -0800)]
Merge "[SSM] change soft sensor description folder path"

9 years agoImplementation of response of group action (for remote resources)
HyunJun Kim [Fri, 19 Dec 2014 07:59:41 +0000 (16:59 +0900)]
Implementation of response of group action (for remote resources)

There is no response when resource client send message[POST]
to a group with GROUP_INTERFACE, so client cannot receive any message.

We provide logic about the aggregation of children' response.
Then, merged response will be delivered to client.

Additionally, regarding Sudarshan Prasad's comment of previous commit.
We change the definition of GROUP_INTERFACE.

Change-Id: I6c2550472d1e02cd2606317fcb1796e59e004b78
Signed-off-by: HyunJun Kim <hyunjun2.kim@samsung.com>
9 years agoMerge "[SSM] Reference & Trackee Thing release for arduino"
Uze Choi [Fri, 19 Dec 2014 07:00:38 +0000 (23:00 -0800)]
Merge "[SSM] Reference & Trackee Thing release for arduino"

9 years ago[service] Update service documents
jk13 [Fri, 19 Dec 2014 06:24:31 +0000 (15:24 +0900)]
[service] Update service documents

Change-Id: I9ccf4bec3ac95b9219f160a851186d431ff8b818
Signed-off-by: jk13 <jihyeok13.kim@samsung.com>
9 years ago[SSM] Add OIC namespace and cleanup description file
jk13 [Fri, 19 Dec 2014 06:05:40 +0000 (15:05 +0900)]
[SSM] Add OIC namespace and cleanup description file

1. Add OIC namespace at SSM interface header for application developers
2. Add description for scons build and run

Change-Id: Id22df7b59fd30d67a05703ccbafc845e94f05ff3
Signed-off-by: jk13 <jihyeok13.kim@samsung.com>
9 years ago[SSM] change soft sensor description folder path
jk13 [Fri, 19 Dec 2014 00:21:57 +0000 (09:21 +0900)]
[SSM] change soft sensor description folder path

1. Change folder path
2. Set release folder for documentation

Change-Id: I2c307c813f87631122eec7e867845192739937b5
Signed-off-by: jk13 <jihyeok13.kim@samsung.com>
9 years agoFix issues of Things Manager
Soyoung Youn [Fri, 19 Dec 2014 06:18:32 +0000 (15:18 +0900)]
Fix issues of Things Manager

 - Bug fix
   : Implementation of Things Manager feature
     https://oic-review.01.org/gerrit/495
 - Resolve issues detected by Prevent (static analysis tool)

Change-Id: I6a06aa5a688c75384248638b83337e1d1b2dbd56
Signed-off-by: Soyoung Youn <sy01.youn@samsung.com>
9 years agoAdd scons script and things manager samples.
Soyoung Youn [Fri, 19 Dec 2014 06:07:44 +0000 (15:07 +0900)]
Add scons script and things manager samples.

oic-resouce/Sconscript
 - Build for things manager SDK and all samples.

service/things-manager/sampleapp/
 - Build for all samples.
 - Sconscript

service/things-manager/sampleapp/linux/configuration
 - Sample application for Device Management.
 - Sconscript.

service/things-manager/sampleapp/linux/groupaction
 - Sample application for Group Action.
 - Sconscript.

service/things-manager/sampleapp/linux/groupsyncaction
 - Sample application for Group sync.
 - Sconscript.

Change-Id: I6c9975824a23deb5363b7157d64ad334bb11c915
Signed-off-by: Soyoung Youn <sy01.youn@samsung.com>
9 years agoMerge "[SSM] Apply OIC presence feature"
Uze Choi [Fri, 19 Dec 2014 02:51:08 +0000 (18:51 -0800)]
Merge "[SSM] Apply OIC presence feature"

9 years agoDevice Discovery - C & C++ SDK changes
omkar [Thu, 20 Nov 2014 18:55:35 +0000 (10:55 -0800)]
Device Discovery - C & C++ SDK changes

Adding API for setting device information.
Currently supports filtering of device information based on device id and
device name only.
Updated C and C++ sample applications

Change-Id: Ie2fbfac8c9444560633b9716e777d4697a146f66
Signed-off-by: omkar <omkar.m.hegde@intel.com>
9 years agoIgnore SCons generated files and directories.
Ossama Othman [Thu, 18 Dec 2014 22:56:46 +0000 (14:56 -0800)]
Ignore SCons generated files and directories.

Change-Id: Ie4233a5c36efa09a905074b3ab5c100d96bd5033
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
9 years agoRemoved execute permissions from non-executable files.
Ossama Othman [Thu, 18 Dec 2014 22:50:07 +0000 (14:50 -0800)]
Removed execute permissions from non-executable files.

C and C++ source files, Makefiles and non-executable
script files (e.g. those without a #!/bin/sh on the
first line) should have not execute permissions.

Change-Id: I4d7aba082041fb4da79a1ec24009460c52ac7135
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
9 years agoMerge "Fix prevent bug in the PluginManager. Fix bug in the sample app."
Uze Choi [Thu, 18 Dec 2014 09:20:16 +0000 (01:20 -0800)]
Merge "Fix prevent bug in the PluginManager. Fix bug in the sample app."

9 years agoMerge changes I21ded957,Ia1308e81,If6bccb8e,I6d548404
Uze Choi [Thu, 18 Dec 2014 09:19:26 +0000 (01:19 -0800)]
Merge changes I21ded957,Ia1308e81,If6bccb8e,I6d548404

* changes:
  [SSM] Fix static analysis tool issues and 64bit build support
  [SSM] Update SDK Api
  [SSM] Remove document folder
  [service] Publish service documents

9 years agoFix prevent bug in the PluginManager.
heesung84.kim [Thu, 18 Dec 2014 05:41:00 +0000 (14:41 +0900)]
Fix prevent bug in the PluginManager.
Fix bug in the sample app.

Change-Id: Ie1eca80ba41c768374229196b368c4fa070595b1
Signed-off-by: heesung84.kim <heesung84.kim@samsung.com>
9 years ago[SSM] Reference & Trackee Thing release for arduino
min7.choi [Thu, 18 Dec 2014 07:34:08 +0000 (16:34 +0900)]
[SSM] Reference & Trackee Thing release for arduino

1. Reference Thing code release for arduino
2. Trackee Thing code release for arduino

Change-Id: Ib05327af485289dba1b4a1d0ee2b143b5434ab15
Signed-off-by: min7.choi <min7.choi@samsung.com>
9 years ago[SSM] Fix static analysis tool issues and 64bit build support
jk13 [Thu, 18 Dec 2014 06:24:30 +0000 (15:24 +0900)]
[SSM] Fix static analysis tool issues and 64bit build support

1. Fix code that detected by prevent(static analysis)
2. Fix code to support 64bit build

Change-Id: I21ded9571d2b4fc257991a534171e1931e6ba344
Signed-off-by: jk13 <jihyeok13.kim@samsung.com>
9 years ago[SSM] Update SDK Api
jk13 [Thu, 18 Dec 2014 06:21:24 +0000 (15:21 +0900)]
[SSM] Update SDK Api

1. Release Java API
2. Separate into cpp, java folder

Change-Id: Ia1308e814a4cb79575b11bc24ddce69376f2074a
Signed-off-by: jk13 <jihyeok13.kim@samsung.com>
9 years ago[SSM] Remove document folder
jk13 [Thu, 18 Dec 2014 06:04:08 +0000 (15:04 +0900)]
[SSM] Remove document folder

Change-Id: If6bccb8e4cae72baf08b66c6febab8d40a8ac7bc
Signed-off-by: jk13 <jihyeok13.kim@samsung.com>
9 years ago[service] Publish service documents
jk13 [Thu, 18 Dec 2014 06:01:50 +0000 (15:01 +0900)]
[service] Publish service documents

Change-Id: I6d5484042e8cef41403511fe206167ff30974fd8
Signed-off-by: jk13 <jihyeok13.kim@samsung.com>
9 years ago[SSM] Apply OIC presence feature
minjii.park [Thu, 18 Dec 2014 05:18:46 +0000 (14:18 +0900)]
[SSM] Apply OIC presence feature

1. Apply OIC presence check feature to Soft Sensor Manager
2. Add OIC presence feature to Thin Device Server Example

Change-Id: Iaa65942fb7bea5d0954cb65757ccb35bb2c12708
Signed-off-by: minjii.park <minjii.park@samsung.com>
9 years agoMerge "Fixed build error"
Patrick Lankswert [Wed, 17 Dec 2014 20:24:16 +0000 (12:24 -0800)]
Merge "Fixed build error"

9 years agoMerge "Added code to send close_notify alert when OC stack shuts down."
sudarshan prasad [Wed, 17 Dec 2014 19:52:27 +0000 (11:52 -0800)]
Merge "Added code to send close_notify alert when OC stack shuts down."

9 years agoFixed build error
Sudarshan Prasad [Wed, 17 Dec 2014 19:44:02 +0000 (11:44 -0800)]
Fixed build error

Due to a previous merge, build was failing when scons was used.
Signed-off-by:Sudarshan Prasad <sudarshan.prasad@intel.com>

Change-Id: I26ad37273f91e61bd4afb49c9c4010cde32cb3b9

9 years agoMerge "OIC scons build patch for Yocto"
Patrick Lankswert [Wed, 17 Dec 2014 16:57:22 +0000 (08:57 -0800)]
Merge "OIC scons build patch for Yocto"

9 years agoMerge "Implementation of Things Manager feature."
Uze Choi [Wed, 17 Dec 2014 06:23:45 +0000 (22:23 -0800)]
Merge "Implementation of Things Manager feature."

9 years agoMerge "Implementation of Group action feature for Things Manager."
Uze Choi [Wed, 17 Dec 2014 06:16:01 +0000 (22:16 -0800)]
Merge "Implementation of Group action feature for Things Manager."

9 years agoOIC scons build patch for Yocto
Kishen Maloor [Wed, 17 Dec 2014 01:43:22 +0000 (17:43 -0800)]
OIC scons build patch for Yocto

Function:
Adds Yocto as a build target for OIC. Code is
executed ONLY when TARGET_OS=yocto.
It WILL NOT affect a build for any other target.

Background:
Yocto cross-toolchains for platforms would have
to be fetched, installed and configured in their
standard way. This configuration is done by
sourcing in an “environment setup” script that
comes with the toolchain. scons is run after this
step.

Details:
The code in this patch reads the variables set
by Yocto’s script and: 1) Learns of tool names and
build flags (varies by target and arch.), 2) Finds
absolute path of these tools (yocto’s script adds
these to PATH) by looking in PATH, 3) Modifies the
scons construction environment to point to tools
+ all their required flags, 4) Switches TARGET_OS
to Linux so that it uses the Linux build configuration
for OIC, 5) Elects to preserve debug symbols (using -g)
so that Yocto’s build process can generate both
DEBUG and RELEASE packages for OIC (This is the
default recommendation of Yocto’s BitBake)

Additional notes:
-The pre-existing TC_PREFIX/TC_PATH framework is
not sufficient to support Yocto’s cross-toolchain.
-Supported architectures for the yocto target are x86
and x86_64. These have been tested to work for Intel
Edison and Minnowboard platforms.

Usage:
From a user’s perspective, there are no unexpected
steps.
1) source <yocto-env-setup-script>
2) …/oic-resource$ scons TARGET_OS=yocto <regular options>
For eg. “scons TARGET_OS=yocto TARGET_ARCH=x86 RELEASE=1”
The results of a build will now go into “out/yocto/x86/…”.
If step 1) hasn’t been done before step 2), the build will
fail with an error message.

Change-Id: I55efab20f9c174f46446e9d59e3fca6eef3df7f2
Signed-off-by: Kishen Maloor <kishen.maloor@intel.com>
9 years agoMerge "Fixed usages of strtok to use strtok_r instead"
sudarshan prasad [Wed, 17 Dec 2014 00:24:49 +0000 (16:24 -0800)]
Merge "Fixed usages of strtok to use strtok_r instead"

9 years agoReplaced sprintf with snprintf in the sdk to avoid potential buffer overflows
Yuliya Kamatkova [Tue, 16 Dec 2014 23:25:30 +0000 (18:25 -0500)]
Replaced sprintf with snprintf in the sdk to avoid potential buffer overflows

Defect IOT-123 stated that unsafe API sprintf was previously used in SDK and
the recommendation was given to use snprintf rather than sprintf in order to
avoid buffer overflow.

As a result sprintf was replaced with safer snprintf in multiple sdk files

Change-Id: Ic739506f160176aaeb78927745ea67e61c1c0066
Signed-off-by: Yuliya Kamatkova <yuliya.kamatkova@intel.com>
9 years agoMerge "Fixed OCCreateResource return type when empty URI is passed"
sudarshan prasad [Tue, 16 Dec 2014 22:57:21 +0000 (14:57 -0800)]
Merge "Fixed OCCreateResource return type when empty URI is passed"

9 years agoMerge "Improve Buffer Size in occoaphelper"
sudarshan prasad [Tue, 16 Dec 2014 22:55:27 +0000 (14:55 -0800)]
Merge "Improve Buffer Size in occoaphelper"

9 years agoMerge "Fixed server crash on empty client payload"
sudarshan prasad [Tue, 16 Dec 2014 22:11:41 +0000 (14:11 -0800)]
Merge "Fixed server crash on empty client payload"

9 years agoFixed Warning in OCException
Erich Keane [Thu, 11 Dec 2014 22:02:57 +0000 (14:02 -0800)]
Fixed Warning in OCException

Added case statements for two new conditions in OCException that
were forgotten when we implemented this in the past.

Change-Id: I99ab3c2c8ad4f46d9ee35c639970ea93e69f9813
Signed-off-by: Erich Keane <erich.keane@intel.com>
9 years agoFixed compile error on 'empty' in OCRepresentation.cpp
Erich Keane [Tue, 16 Dec 2014 18:30:31 +0000 (10:30 -0800)]
Fixed compile error on 'empty' in OCRepresentation.cpp

The patch for fixing the 'empty' representation object issue
was incorrectly manually merged when it (review 633) was split from
the previous C++ unit test review.

Change-Id: Ib732e5dfcda6a6d34d072d5d93c363fd731912f6
Signed-off-by: Erich Keane <erich.keane@intel.com>
9 years agoMerge "Fixed UnitTest crash when getting JSON from blank object"
sudarshan prasad [Tue, 16 Dec 2014 18:11:36 +0000 (10:11 -0800)]
Merge "Fixed UnitTest crash when getting JSON from blank object"

9 years agoImplementation of Things Manager feature.
HyunJun Kim [Tue, 16 Dec 2014 07:50:07 +0000 (16:50 +0900)]
Implementation of Things Manager feature.

Add feature for Things Manager

 - Subscribe Collection Presence
 - CRUD function for ActionSet
 - Finding group
 - Creating group
 - Join the specific group
 - Let the other devices to join the specific group
 - Leave from the specific group
 - Delete the group
 - Get all group information
 - send configuration information to multiple things
 - send diagnostics information(i.e. factory reset, reboot)
 - Get the configuration parameter list
 - Get the diagnostics functionalities list

Fix Segmentation fault.
 - Bug fix : "Implementation of Things Manager feature."
             https://oic-review.01.org/gerrit/495
             OCPlatform_impl.cpp, InProcServerWrapper.cpp

Change-Id: I5b44fbdb034c924df4787a30a4d9c86ce4704aff
Signed-off-by: HyunJun Kim <hyunjun2.kim@samsung.com>
9 years agoFixed warning about incorrect initializer.
Erich Keane [Thu, 11 Dec 2014 22:10:16 +0000 (14:10 -0800)]
Fixed warning about incorrect initializer.

The ip_mreq initialization was generating a warning.  This
corrects the initializer to properly initialize it as far as
the compiler is concerned.

Change-Id: Iea663e7d198dd23f7e9f6ae1050e12d9017db053
Signed-off-by: Erich Keane <erich.keane@intel.com>
9 years agoImprove Buffer Size in occoaphelper
omkar [Wed, 10 Dec 2014 00:57:23 +0000 (16:57 -0800)]
Improve Buffer Size in occoaphelper

Previously, we had the BUF_SIZE set at 64. Changing it to be the
greater of MAX_URI_LENGTH and MAX_QUERY_LENGTH. So, if max length
needs to change, we need to change it only in ocstackconfig.

Change-Id: I18aeca83f82932896424d38389a872b581859860
Signed-off-by: omkar <omkar.m.hegde@intel.com>
9 years agoImplementation of Group action feature for Things Manager.
HyunJun Kim [Mon, 15 Dec 2014 06:55:14 +0000 (15:55 +0900)]
Implementation of Group action feature for Things Manager.

Add GROUP_INTERFACE and OC_RSRVD_INTERFACE_GROUP.
These interfaces are supported Group Action.

When DefaultCollectionEntityHandler is received an message
which Using GROUP_INTERFACE,
It is called BuildCollectionGroupActionJSONResponse.

PUT : Action Create and Delete
POST : Action Read and Execute

Change-Id: I14519fa85b5319c3e9df72fa27e85a5d8df6ea87
Signed-off-by: HyunJun Kim <hyunjun2.kim@samsung.com>
9 years agoMerge "Changed plugin public setValue API to private."
Uze Choi [Mon, 15 Dec 2014 05:08:09 +0000 (21:08 -0800)]
Merge "Changed plugin public setValue API to private."

9 years agoMerge "There are Two modifications. 1. Restucturing Notification Manager Class ...
Uze Choi [Mon, 15 Dec 2014 05:01:33 +0000 (21:01 -0800)]
Merge "There are Two modifications. 1. Restucturing Notification Manager Class   : Hosting feature is separated from Resource Manager Class into Hosting Handler, Hosting Interface, Hosting Config.     Corresponding Sample code modification. 2. Resource Hosting Control Point (in the Hosting Interface Class)   : Set up the Control Point for Resource Hosting.     User can control how to host Resource by timing and nodes"

9 years agoChanged plugin public setValue API to private.
heesung84.kim [Mon, 15 Dec 2014 04:55:06 +0000 (13:55 +0900)]
Changed plugin public setValue API to private.

    Application developer shoud not change the plugin infomation.
    remove unnecessary code.

Change-Id: Id1ca15282d0b6a4facb547a6b40250c1b61cbd13
Signed-off-by: heesung84.kim <heesung84.kim@samsung.com>
9 years agoMerge "[SSM] Fix build script"
Uze Choi [Mon, 15 Dec 2014 04:12:56 +0000 (20:12 -0800)]
Merge "[SSM] Fix build script"

9 years agoMerge "[SSM] Apply changed OIC API"
Uze Choi [Mon, 15 Dec 2014 04:11:06 +0000 (20:11 -0800)]
Merge "[SSM] Apply changed OIC API"

9 years agoMerge "Fixed IOT-110--Crash on destruction"
sudarshan prasad [Sat, 13 Dec 2014 01:20:04 +0000 (17:20 -0800)]
Merge "Fixed IOT-110--Crash on destruction"

9 years agoFixed OCCreateResource return type when empty URI is passed
Yuliya Kamatkova [Fri, 12 Dec 2014 17:59:53 +0000 (12:59 -0500)]
Fixed OCCreateResource return type when empty URI is passed

Defect IOT-109: OCCreateResource in the C SDK previously allowed empty URI.

The defect was fixed: OCCreateResource returns error status OC_STACK_INVALID_URI
if empty URI string is passed

Note: There are other places in code where only NULL check is performed
for URIs however empty string check is not performed.

Change-Id: Ia23fd2be20677614f267c73160ebefc56a5e6d71
Signed-off-by: Yuliya Kamatkova <yuliya.kamatkova@intel.com>
9 years agoAdded code to send close_notify alert when OC stack shuts down.
Sachin Agrawal [Fri, 12 Dec 2014 17:17:24 +0000 (09:17 -0800)]
Added code to send close_notify alert when OC stack shuts down.

When peers receive close_notify alert they clean up the DTLS
session state.

Change-Id: I56efabc3d73a428406cd0c1d5796f762d57f5089
Signed-off-by: Sachin Agrawal <sachin.agrawal@intel.com>
9 years ago[SSM] Fix build script
jk13 [Fri, 12 Dec 2014 10:51:19 +0000 (19:51 +0900)]
[SSM] Fix build script

1. Apply scons
2. Fix arduino makefile
3. Cleanup makefiles

Change-Id: I9f9c1597df21be96b4d40cfdd277649349dd742e
Signed-off-by: jk13 <jihyeok13.kim@samsung.com>
9 years ago[SSM] Apply changed OIC API
jk13 [Fri, 12 Dec 2014 10:49:10 +0000 (19:49 +0900)]
[SSM] Apply changed OIC API

1. Code cleanup with formatter
2. Change code to use changed OIC API style

Change-Id: I9f52091d62022575acfdd9dc97d19db361239c4e
Signed-off-by: jk13 <jihyeok13.kim@samsung.com>
9 years agoThere are Two modifications.
Heewon Park [Fri, 12 Dec 2014 08:51:08 +0000 (17:51 +0900)]
There are Two modifications.
1. Restucturing Notification Manager Class
  : Hosting feature is separated from Resource Manager Class into Hosting Handler, Hosting Interface, Hosting Config.
    Corresponding Sample code modification.
2. Resource Hosting Control Point (in the Hosting Interface Class)
  : Set up the Control Point for Resource Hosting.
    User can control how to host Resource by timing and nodes

Change-Id: I627eaff40f6a5c19a4297cafcf9ea9e3c739d520
Signed-off-by: Heewon Park <h_w.park@samsung.com>
9 years agoModify PPM makefile for using shared base library
heesung84.kim [Fri, 12 Dec 2014 07:53:35 +0000 (16:53 +0900)]
Modify PPM makefile for using shared base library

Change-Id: I278b182b18512103c620b5629d29687527309808
Signed-off-by: heesung84.kim <heesung84.kim@samsung.com>
9 years agoFixed IOT-110--Crash on destruction
Erich Keane [Wed, 10 Dec 2014 21:43:37 +0000 (13:43 -0800)]
Fixed IOT-110--Crash on destruction

A shared_ptr loop in callbacks for listen and a server destructor
were causing the stack to crash upon destruction of the Platform_impl.
Platform_impl would decrement the ClientWrapper shared_ptr (which would
still be >0 due to the callback having one).  When the OCStop was cleaning
up its resources, it would delete the client context, decrementing the
ClientWrapper ptr completely, resulting in OCStop being called inside
itself.

This bug was fixed in a few ways (each which are important, but would
have fixed this independently).

1- Changed OCStop to protect itself from re-entrance by using a guard-bool
to return immediately if it is being called as a child.

2- ListenContext now contains a weak_ptr to the clientWrapper instead of
a shared_ptr.  This makes it not destruct the clientWrapper upon callback
cleanup.

3- ClientWrapper no longer calls OCStop in the destructor when in BOTH
mode.  This is done to be consistent with the OCInit call in the constructor
as well as to correctly give the ServerWrapper ownership of the Init/Process/
Stop functionality in the BOTH case.

Change-Id: I77c4646938f586e24ac6642fdeeaf82391ab082c
Signed-off-by: Erich Keane <erich.keane@intel.com>
9 years agoFixed usages of strtok to use strtok_r instead
Erich Keane [Thu, 11 Dec 2014 19:37:33 +0000 (11:37 -0800)]
Fixed usages of strtok to use strtok_r instead

strtok is not thread safe and has a global state variable that
have serious side effects.  If any consumer of ours was to use
threads and strtok they could very easily corrupt the state on us
(or us on them!).  This fix replaces it with the non-side effect
POSIX version, which is strtok_r.  Note that in occollection.c
we are already using strtok_r.

Change-Id: Ie39a2a2ab35a0b1f13a82542ef6963662ac5c53e
Signed-off-by: Erich Keane <erich.keane@intel.com>
9 years agoMerge "Update build scripts"
Patrick Lankswert [Thu, 11 Dec 2014 14:20:55 +0000 (06:20 -0800)]
Merge "Update build scripts"

9 years agoMerge "Added Plugin Manager Configuration Feature - application developer can modify...
Uze Choi [Thu, 11 Dec 2014 07:34:31 +0000 (23:34 -0800)]
Merge "Added Plugin Manager Configuration Feature  - application developer can modify plugin manager configuration(xml) like plugin path, max number of plugins."

9 years agoMerge "Updated the .gitignore"
sudarshan prasad [Thu, 11 Dec 2014 07:27:22 +0000 (23:27 -0800)]
Merge "Updated the .gitignore"

9 years agoUpdated the .gitignore
Erich Keane [Fri, 5 Dec 2014 21:53:15 +0000 (13:53 -0800)]
Updated the .gitignore

Updated the gitignore to properly ignore things in the new folder
format, as well as added klocworks and some other missing ignores.

Change-Id: I75e7ac8497ae5a51f9bab00f90dc025190d68960
Signed-off-by: Erich Keane <erich.keane@intel.com>
9 years agoFixed UnitTest crash when getting JSON from blank object
Erich Keane [Wed, 10 Dec 2014 21:52:15 +0000 (13:52 -0800)]
Fixed UnitTest crash when getting JSON from blank object

Generating a JSON representation from a blank object is an error
condition, so we were crashing.  The unit tests validated this
situation, so this fix returns the correct value in that situation.

Additionally corrected a comment highlighted in a previous review.

Change-Id: I113bf0ad53bb939d90278928257ff7b56aa4959b
Signed-off-by: Erich Keane <erich.keane@intel.com>
9 years agoMerge "Fixed need of implementers to include cereal in their build path"
sudarshan prasad [Wed, 10 Dec 2014 21:38:36 +0000 (13:38 -0800)]
Merge "Fixed need of implementers to include cereal in their build path"

9 years agoAdded Plugin Manager Configuration Feature
heesung84.kim [Wed, 10 Dec 2014 05:00:13 +0000 (14:00 +0900)]
Added Plugin Manager Configuration Feature
 - application developer can modify plugin manager configuration(xml) like plugin path, max number of plugins.

Added More Plugin Manager APIs
 - int getState()
   getState API can get plugin's state
 - int rescanPlugin()
   Rescan the plugin folder

Removed Unnecessary Plugin Manager APIs
 - std::string getSupportedType(void)
 - int addSupportedType(const std::string rscType)

Disabled Auto Plugin Detection Feature
 - In previous version, PPM used iNotify to detect new Plugin detection.
   However, iNotify have platform porting issue and heavy. We will find better way in next version.

Change-Id: I0efac20efbc39b3fb0b2bcc1a34685acad1c7517
Signed-off-by: heesung84.kim <heesung84.kim@samsung.com>
9 years agoFixed server crash on empty client payload
Erich Keane [Tue, 9 Dec 2014 23:05:10 +0000 (15:05 -0800)]
Fixed server crash on empty client payload

Server would crash if given a blank string, so this will prevent
that from happening.  The resource request won't contain resources,
since it wasn't sent any, but that is a valid condition

Change-Id: I04a8ebbe0174f1025d924503ac66fad6c37e0582
Signed-off-by: Erich Keane <erich.keane@intel.com>
9 years agoMerge changes I56f29eac,Ic7530d44
sudarshan prasad [Tue, 9 Dec 2014 22:30:59 +0000 (14:30 -0800)]
Merge changes I56f29eac,Ic7530d44

* changes:
  Fixed usages of memset(..0..) to use Calloc/init'er
  Added OCCalloc functionality and Fixed Malloc Tests

9 years agoMerge "Send presence notification on stopping presence.(Multicast)"
sudarshan prasad [Tue, 9 Dec 2014 22:06:08 +0000 (14:06 -0800)]
Merge "Send presence notification on stopping presence.(Multicast)"

9 years agoMerge "Fixed klocwork issues in C++ Stack"
sudarshan prasad [Tue, 9 Dec 2014 21:09:02 +0000 (13:09 -0800)]
Merge "Fixed klocwork issues in C++ Stack"

9 years agoMerge "Fix klocwork issues in C samples"
sudarshan prasad [Tue, 9 Dec 2014 20:50:02 +0000 (12:50 -0800)]
Merge "Fix klocwork issues in C samples"

9 years agoFixed need of implementers to include cereal in their build path
Erich Keane [Wed, 3 Dec 2014 22:48:16 +0000 (14:48 -0800)]
Fixed need of implementers to include cereal in their build path

Previously we did a bit of implementation in the OCRepresentation.cpp
file because we thought we needed to (due to Template confusion).

It has been realized that this isn't necessary, so this fix removes that
need.

Change-Id: I5e022fe37b822eae83e164686c979ac6f474135c
Signed-off-by: Erich Keane <erich.keane@intel.com>
9 years agoFixed klocwork issues in C++ Stack
Erich Keane [Tue, 9 Dec 2014 19:02:03 +0000 (11:02 -0800)]
Fixed klocwork issues in C++ Stack

Ran klocwork 10 and fixed the issues that were highlighted.

fridgeclient:
return values from constructResourceObject weren't checked
for null.  Additionally, variables sent to getValue uninitialized.

presenceclient: presenceHandle used uninitialized.

threadingsample: variables sent to getValue uninitialized.

OicJsonSerializer.hpp:
Removed dead code that had a large number of klocwork issues
Methods that didn't return despite having a return type.

InProcClientWrapper.cpp:
Contexts deleted in cases where they aren't passed to the C stack.

InProcServerWrapper.cpp:
entityhandlerRequest was used without being checked for null

Many samples:
Replaced while(true) with a condition_variable
Ensured 'main' returned 0.  Despite being optional, KW shows this as
a warning
incorrect 'main' prototype (argv specified array length 1!)

Out of the 40+ issues found of all types, the following were skipped
due to being in an external library:

Review:
CWARN.MEM.NONPOD (4 issues)

Warning:
CL.MLK (2 issues)

NPD.FUNC.MUST(1 issue)

Change-Id: I1e9fa222cc27352075a1b8f5d53787bd3020b525
Signed-off-by: Erich Keane <erich.keane@intel.com>
9 years agoFixed usages of memset(..0..) to use Calloc/init'er
Erich Keane [Mon, 8 Dec 2014 20:15:29 +0000 (12:15 -0800)]
Fixed usages of memset(..0..) to use Calloc/init'er

Our code has a number of cases where we declare a struct then
immediately memset to all 0.  This uses the initializers which
are less prone to failure and are faster due to compiler optimizations.

Additionally, we have a number of cases where we OCMalloc a
struct, then immediately zero it.  This fix uses the new OCCalloc
in order to save unnecessary memset and reduce potential for accidental
error.

In a few of the cases, older compilers didn't handle the {0} initializer
correctly and gave errors (Arduino Mega).  Because of that, a few structs
were reordered to compile for that platform.

Change-Id: I56f29eac68240abea2fb8a69d888a09d61d4488a
Signed-off-by: Erich Keane <erich.keane@intel.com>
9 years agoFix klocwork issues in C samples
Sakthivel Samidurai [Fri, 5 Dec 2014 16:26:52 +0000 (13:26 -0300)]
Fix klocwork issues in C samples

Scan klocwork and fix all issues in c samples that were highlighted.

Change-Id: Id018abfd380c8723842a24f20c8f781dca177458
Signed-off-by: Sakthivel Samidurai <sakthivel.samidurai@intel.com>
9 years agoMerge "[SSM] Modify repo init method and fix Resource data reader"
Uze Choi [Tue, 9 Dec 2014 09:25:04 +0000 (01:25 -0800)]
Merge "[SSM] Modify repo init method and fix Resource data reader"

9 years agoMerge "[SSM] Reflect current OIC api style and add Tizen Inproc Sample"
Uze Choi [Tue, 9 Dec 2014 09:12:05 +0000 (01:12 -0800)]
Merge "[SSM] Reflect current OIC api style and add Tizen Inproc Sample"

9 years agoMerge "[SSM] Implement Inproc feature for Linux platform"
Uze Choi [Tue, 9 Dec 2014 09:02:35 +0000 (01:02 -0800)]
Merge "[SSM] Implement Inproc feature for Linux platform"

9 years agoMerge "Fix Unicast Presence Error"
sudarshan prasad [Tue, 9 Dec 2014 00:59:47 +0000 (16:59 -0800)]
Merge "Fix Unicast Presence Error"

9 years agoSend presence notification on stopping presence.(Multicast)
omkar [Tue, 9 Dec 2014 00:04:39 +0000 (16:04 -0800)]
Send presence notification on stopping presence.(Multicast)

Previously notifcation was not being sent on presence stopped.
Adding a check in case of multicast presence for presence stopped.

Change-Id: I774295b89fef607a3d1936d26071d79c41ec96b5
Signed-off-by: omkar <omkar.m.hegde@intel.com>
9 years agoFix Unicast Presence Error
omkar [Mon, 8 Dec 2014 22:32:28 +0000 (14:32 -0800)]
Fix Unicast Presence Error

Fix for IOT-95. Previously we had missed a "+1" when mallocing a char *

Change-Id: I96021ddce22c2fa7e3afa8f8d10e6da10b47ebbc
Signed-off-by: omkar <omkar.m.hegde@intel.com>
9 years agoAdded OCCalloc functionality and Fixed Malloc Tests
Erich Keane [Mon, 8 Dec 2014 20:00:18 +0000 (12:00 -0800)]
Added OCCalloc functionality and Fixed Malloc Tests

The OCMalloc tests didn't seem to be running correctly, so
this fixes that.  Additionally, added OCCalloc functionality so
that we can replace 'memset 0' in a number of places in the C Stack.

Change-Id: Ic7530d442c146724e91ec12646a4363de63f6874
Signed-off-by: Erich Keane <erich.keane@intel.com>
9 years agoImprove Presence Callback in C++ SDK
omkar [Tue, 25 Nov 2014 21:39:18 +0000 (13:39 -0800)]
Improve Presence Callback in C++ SDK

Passing the host address information to the application on receiving
presence Notification. Based on IOT-91.

Signed-off-by: omkar <omkar.m.hegde@intel.com>
Change-Id: Ie6bc5e20c71e14e2745da435a65de874d6f28742

9 years agoMerge "Added support to allow more than one presence resource type filter."
sudarshan prasad [Mon, 8 Dec 2014 20:48:50 +0000 (12:48 -0800)]
Merge "Added support to allow more than one presence resource type filter."

9 years agoAdded support to allow more than one presence resource type filter.
Joseph Morrow [Mon, 8 Dec 2014 20:15:31 +0000 (15:15 -0500)]
Added support to allow more than one presence resource type filter.

Where only one filter was supported before, resource type filters must
be added one at a time through use of the OCDoResource() API, therefore
a call to OCDoResource() for every amend is req'd with this add-on.

Change-Id: I54a1166ad6992a26f133ed6797730fcdb4e9cf73
Signed-off-by: Joseph Morrow <joseph.l.morrow@intel.com>
9 years agoMerge "Fix the name of the resource created in Arduino server to Light."
sudarshan prasad [Mon, 8 Dec 2014 07:05:52 +0000 (23:05 -0800)]
Merge "Fix the name of the resource created in Arduino server to Light."

9 years agoMerge "Fixed EntityHandlerRequest initialization to match other uses"
sudarshan prasad [Mon, 8 Dec 2014 07:00:53 +0000 (23:00 -0800)]
Merge "Fixed EntityHandlerRequest initialization to match other uses"

9 years agoMerge "Fixed OCSerialization NVP Header Reset"
sudarshan prasad [Mon, 8 Dec 2014 06:50:42 +0000 (22:50 -0800)]
Merge "Fixed OCSerialization NVP Header Reset"

9 years agoUpdate build scripts
Caiwen Zhang [Fri, 5 Dec 2014 08:00:57 +0000 (16:00 +0800)]
Update build scripts

1) Add build options to enviornment(env) to avoid export variables
2) Sync with the newest code
3) Update Readme(Readme.scons.txt)
4) Extend arduino supporting
5) Add build scripts for services
6) Add a doc(scons_script_how_to.txt) about how to write iotivity
    build script
7) change resource libs from static library to share library

Last sync and test with the newest code commit:
  e9403ce6d4d7a1a0ac8d12c5acc876af7f7a8f76

Note:
  Scripts for Service are provided but aren't enabled due to the
service code is too old it can't pass the build.

Change-Id: I06427cfe65e6fcf5837376f2f89d1e93c662f920
Signed-off-by: Caiwen Zhang<caiwen.zhang@intel.com>
9 years ago[SSM] Modify repo init method and fix Resource data reader
jk13 [Mon, 8 Dec 2014 04:58:12 +0000 (13:58 +0900)]
[SSM] Modify repo init method and fix Resource data reader

Modify Repository class init method to load local SoftSensors,

Fix OIC data reader to read correct data

Change-Id: I099d732ddf019deb79d2d88477556eacf2eb2078
Signed-off-by: jk13 <jihyeok13.kim@samsung.com>