+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.oc.ub.sampleclient"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="16"
- android:targetSdkVersion="16" />
-
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.oc.ub.sampleclient.OCClient"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<lint>
-</lint>
\ No newline at end of file
+++ /dev/null
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
+++ /dev/null
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-16
-android.library.reference.1=../OCLib
+++ /dev/null
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="com.oc.ub.sampleclient.OCClient"
- tools:ignore="MergeRootFrame" />
+++ /dev/null
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.oc.ub.sampleclient.OCClient$PlaceholderFragment" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/hello_world" />
-
-</RelativeLayout>
+++ /dev/null
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- tools:context="com.oc.ub.sampleclient.OCClient" >
-
- <item
- android:id="@+id/action_settings"
- android:orderInCategory="100"
- android:showAsAction="never"
- android:title="@string/action_settings"/>
-
-</menu>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
- <!-- API 14 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Example customization of dimensions originally defined in res/values/dimens.xml
- (such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
- -->
- <dimen name="activity_horizontal_margin">64dp</dimen>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="app_name">OCClient</string>
- <string name="hello_world">Hello world!</string>
- <string name="action_settings">Settings</string>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc.ub.sample;
-
-import com.oc.OCObserver;
-import com.oc.annotations.OCInterface;
-import com.oc.annotations.OCProperty;
-
-/**
- * APPLICATION NOTE: This interface is exposed to via the framework because of the @OCInterface
- * annotation. Without the annotation, this interface would be ignored by the framework.
- *
- * APPLICATION NOTE: This interface needs to be accessible on the client and the server as the
- * contract for operation.
- *
- */
-@OCInterface
-public interface LightControl {
- /**
- * APPLICATION NOTE: This is a synchronous request. It will throw immediately if the stack is down
- * or the network is otherwise not available. It may throw is the remote side does not responds or
- * returns an error.
- *
- * @param powered - The new power state of this implemented interface.
- */
- @OCProperty(name = "powered")
- void setPowered(boolean powered);
-
- /**
- * APPLICATION NOTE: This is a synchronous request. It will throw immediately if the stack is down
- * or the network is otherwise not available. It may throw is the remote side does not responds or
- * returns an error.
- *
- * @return Returns power state of this implemented interface.
- */
- @OCProperty(name = "powered")
- boolean isPowered();
-
- /**
- * APPLICATION NOTE: It is the objects responsibility to throw an exception (TBD) if it cannot
- * handle an additional observers which will in turn return an error to the requestor.
- *
- * @param observer the observer that will be notified when a change to the power property has
- * occurred.
- */
- @OCProperty(name = "powered")
- void addPoweredObserver(OCObserver<Boolean> observer);
-
- /**
- * APPLICATION NOTE: Even properties (or methods) that are not annotated are exposed, by default,
- * via the framework. Getter and setter methods are assumed to be properties unless annotated
- * otherwise.
- *
- * @param level - Sets the power level of this implemented interface.
- */
- void setLevel(int level);
-
- int getLevel();
-
- /**
- * APPLICATION NOTE: This is an example of a method. The annotation is not required except to
- * override the defaults.
- */
- void flash();
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc.ub.sample;
-
-import com.oc.OCDiscovery;
-import com.oc.OCObserver;
-import com.oc.OCResource;
-import com.oc.OCResourceResultHandler;
-import com.oc.OCServer;
-import com.oc.ub.sampleclient.R;
-
-import android.app.Activity;
-import android.app.Fragment;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-
-public class OCClient extends Activity {
- private static String TAG = "OCCLIENT";
- private OCServer ocServer = null;
- private OCDiscovery ocDiscovery = null;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_occlient);
-
- if (savedInstanceState == null) {
- getFragmentManager().beginTransaction().add(R.id.container, new PlaceholderFragment())
- .commit();
- }
-
- ocServer = new OCServer();
- ocServer.start();
- ocDiscovery = ocServer.getDiscoverySingleton();
-
- /*
- * APPLICATION NOTE: All callbacks will come through on a new thread and will not interfere with
- * the UI thread or the Framework Thread (i.e. Networking Thread) which means that you need to
- * use a Handler() to post back to the UI.
- */
- ocDiscovery.findResourceByType(null, null, new OCResourceResultHandler() {
- @Override
- public void onResourcesFound(String serviceURL, OCResource[] resources) {
- // NOTE: This means that a service is reporting back zero or more resources
- // During the callback, lets check to see if the resource supports the
- // light control interface and turn the light on and then subscribe to any changes in the
- // light's power state.
- for (OCResource resource : resources) {
- try {
- LightControl control = resource.getInterface(LightControl.class);
-
- if (control != null) {
- control.setPowered(true);
- control.isPowered();
- /*
- * APPLICATION NOTE: All callbacks will come through on a new thread and will not
- * interfere with the UI thread or the Framework Thread (i.e. Networking Thread) which
- * means that you need to use a Handler() to post back to the UI.
- */
- control.addPoweredObserver(new OCObserver<Boolean>() {
- @Override
- public void onChanged(Boolean data) {
- // TODO: Tell the UI! The state of the Light has changed.
-
- }
-
- @Override
- public void onFailed(Throwable throwable) {
- // TODO: Tell the UI! We are no longer subscribed to events for the Light's power
- // state.
- }
- });
- }
- } catch (Exception exception) {
- // TODO: Ooops
- }
- }
-
- }
-
- @Override
- public void onFailed(Throwable throwable) {
- // TODO: Handle the error. The request to find resources has failed.
- }
-
- @Override
- public void onCompleted() {
- // Nothing to do here... we are just done finding resources is all.
- }
- });
- }
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
-
- // Inflate the menu; this adds items to the action bar if it is present.
- getMenuInflater().inflate(R.menu.occlient, menu);
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- // Handle action bar item clicks here. The action bar will automatically handle clicks on the
- // Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
- int id = item.getItemId();
- if (id == R.id.action_settings) {
- return true;
- }
- return super.onOptionsItemSelected(item);
- }
-
- @Override
- protected void onDestroy() {
- super.onDestroy();
-
- ocServer.stop();
- }
-
- /**
- * A placeholder fragment containing a simple view.
- */
- public static class PlaceholderFragment extends Fragment {
-
- public PlaceholderFragment() {}
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- View rootView = inflater.inflate(R.layout.fragment_occlient, container, false);
- return rootView;
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
- <storageModule moduleId="org.eclipse.cdt.core.settings">
- <cconfiguration id="com.android.toolchain.gcc.575561395">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.575561395" moduleId="org.eclipse.cdt.core.settings" name="Default">
- <externalSettings/>
- <extensions>
- <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
- </extensions>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.575561395" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
- <folderInfo id="com.android.toolchain.gcc.575561395.1582318103" name="/" resourcePath="">
- <toolChain id="com.android.toolchain.gcc.1302176685" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
- <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.1922697366" isAbstract="false" superClass="com.android.targetPlatform"/>
- <builder id="com.android.builder.1865026421" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
- <outputEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
- </outputEntries>
- </builder>
- <tool id="com.android.gcc.compiler.1723447420" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
- <inputType id="com.android.gcc.inputType.182436521" superClass="com.android.gcc.inputType"/>
- </tool>
- </toolChain>
- </folderInfo>
- <sourceEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
- </sourceEntries>
- </configuration>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
- </cconfiguration>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="OCCoap.null.1195553815" name="OCCoap"/>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
- <storageModule moduleId="scannerConfiguration">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- <scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.575561395;com.android.toolchain.gcc.575561395.1582318103;com.android.gcc.compiler.1723447420;com.android.gcc.inputType.182436521">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
- </scannerConfigBuildInfo>
- </storageModule>
-</cproject>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.oc.coap"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="16"
- android:targetSdkVersion="16" />
-
- <application
- android:allowBackup="true"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.oc.coap.MainActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
+++ /dev/null
-# OCCOAP #
-LOCAL_PATH := $(call my-dir)
-
-ifeq ($(CCFL_CORE), )
-CCFL_CORE := $(HOME)/peg_ccfl-core
-endif
-
-ifeq ($(LOGGER_OBJ), )
-LOGGER_OBJ := $(CCFL_CORE)/logger
-endif
-
-ifeq ($(COAP_OBJ), )
-COAP_OBJ := $(CCFL_CORE)/libcoap-4.1.1
-endif
-
-ifeq ($(OCCOAP_OBJ), )
-OCCOAP_OBJ := $(CCFL_CORE)/occoap
-endif
-
-ifeq ($(TB_OBJ), )
-TB_OBJ := $(CCFL_CORE)/stack
-endif
-
-ifeq ($(SOCKET_OBJ), )
-SOCKET_OBJ := $(CCFL_CORE)/ocsocket
-endif
-
-ifeq ($(ANDROID_OBJ), )
-ANDROID_OBJ := $(CCFL_CORE)/android
-endif
-
-#
-# OCSocket
-#
-
-#
-# OCLogger
-#
-include $(CLEAR_VARS)
-TARGET_PLATFORM := android-16
-LOCAL_MODULE := oclogger
-LOCAL_SRC_FILES := $(ANDROID_OBJ)/OCLogger/obj/local/$(TARGET_ARCH_ABI)/libOCLogger.a
-include $(PREBUILT_STATIC_LIBRARY)
-
-# ==============================================================
-# OCCoap - Android
-# ==============================================================
-include $(CLEAR_VARS)
-
-TARGET_PLATFORM := android-16
-
-LOCAL_CPPFLAGS += -D_GLIBCXX__PTHREADS
-LOCAL_CPPFLAGS += -D_THREAD_SAFE
-LOCAL_CPPFLAGS += -D_REENTRANT
-LOCAL_CPPFLAGS += -std=gnu++11
-LOCAL_CPPFLAGS += -s
-LOCAL_CPPFLAGS += -DHAVE_SOCKET_ERRNO
-
-LOCAL_CFLAGS += -DWITH_POSIX
-
-ifneq ($(TARGET_ARCH), $(X86_ARCH))
- LOCAL_CPPFLAGS += -D__arm__
-endif
-
-X86_ARCH := x86
-
-LOCAL_MODULE := OCCoap
-
-LOCAL_SRC_FILES := $(COAP_OBJ)/async.c
-LOCAL_SRC_FILES += $(COAP_OBJ)/block.c
-LOCAL_SRC_FILES += $(COAP_OBJ)/coap_list.c
-LOCAL_SRC_FILES += $(COAP_OBJ)/debug.c
-LOCAL_SRC_FILES += $(COAP_OBJ)/encode.c
-LOCAL_SRC_FILES += $(COAP_OBJ)/hashkey.c
-LOCAL_SRC_FILES += $(COAP_OBJ)/net.c
-LOCAL_SRC_FILES += $(COAP_OBJ)/option.c
-LOCAL_SRC_FILES += $(COAP_OBJ)/pdu.c
-LOCAL_SRC_FILES += $(COAP_OBJ)/resource.c
-LOCAL_SRC_FILES += $(COAP_OBJ)/str.c
-LOCAL_SRC_FILES += $(COAP_OBJ)/subscribe.c
-LOCAL_SRC_FILES += $(COAP_OBJ)/uri.c
-
-LOCAL_C_INCLUDES := $(COAP_OBJ)
-
-#==
-#== OC STUFF -> Consumes LibCoap stuff
-LOCAL_SRC_FILES += $(OCCOAP_OBJ)/src/occoap.c
-
-LOCAL_C_INCLUDES := $(OCCOAP_OBJ)/include
-LOCAL_C_INCLUDES += $(LOGGER_OBJ)/include
-LOCAL_C_INCLUDES += $(TB_OBJ)/include/
-LOCAL_C_INCLUDES += $(TB_OBJ)/include/internal
-LOCAL_C_INCLUDES += $(SOCKET_OBJ)/include
-
-LOCAL_STATIC_LIBRARIES := oclogger
-#==
-#==
-include $(BUILD_STATIC_LIBRARY)
\ No newline at end of file
+++ /dev/null
-APP_STL := gnustl_static #stlport_static
-APP_PLATFORM := android-16
-APP_ABI := armeabi armeabi-v7a x86
-APP_OPTIM := release
-#APP_OPTIM := debug
-APP_CPPFLAGS += -fno-strict-aliasing
-APP_CPPFLAGS += -std=gnu++11
-APP_CPPFLAGS += -D_GLIBCXX_USE_WCHAR_T
-APP_CPPFLAGS += -fexceptions
-APP_CPPFLAGS += -frtti
-#NDK_TOOLCHAIN_VERSION=4.8
\ No newline at end of file
+++ /dev/null
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
+++ /dev/null
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-16
+++ /dev/null
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- tools:context="com.oc.coap.MainActivity" >
-
- <item
- android:id="@+id/action_settings"
- android:orderInCategory="100"
- android:showAsAction="never"
- android:title="@string/action_settings"/>
-
-</menu>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
- <!-- API 14 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Example customization of dimensions originally defined in res/values/dimens.xml
- (such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
- -->
- <dimen name="activity_horizontal_margin">64dp</dimen>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="app_name">OCCoap</string>
- <string name="hello_world">Hello world!</string>
- <string name="action_settings">Settings</string>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.oc.sdk"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="16"
- android:targetSdkVersion="16" />
-
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.oc.DoNotUseUI"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
+++ /dev/null
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
+++ /dev/null
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-16
-android.library=true
+++ /dev/null
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- tools:context="com.oc.sdk.DoNotUseUI" >
-
- <item
- android:id="@+id/action_settings"
- android:orderInCategory="100"
- android:showAsAction="never"
- android:title="@string/action_settings"/>
-
-</menu>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
- <!-- API 14 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Example customization of dimensions originally defined in res/values/dimens.xml
- (such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
- -->
- <dimen name="activity_horizontal_margin">64dp</dimen>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="app_name">OCLib</string>
- <string name="hello_world">Hello world!</string>
- <string name="action_settings">Settings</string>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc;
-
-import java.util.HashMap;
-
-public class OCDiscovery {
- static private native void jniFindResource(String host, HashMap<String, String> filter,
- OCResourceResultHandler handler);
-
- /**
- * Internal API for Service and Resource Discovery
- *
- * @param host - Host IP Address of a service to direct resource discovery query. If null or
- * empty, performs service discovery OR resource discovery query to ALL group members.
- * @param filter<String FilterType, String Value> - Filter Type - Can be one of two of the link
- * format equivalent attribute types declared in table 7 of the
- * OC-Lite-Product-Specification-V1 Document. Either "n" (i.e. Resource Name) or "rt"
- * (i.e. Resource Type). Value - Can be any valid String that's defined to work with CoRE
- * Link Attributes as defined in the RFC6690.
- * @param handler - Handles callbacks, success states and failure states.
- *
- * Four modes of discovery defined as follows:
- * (NULL/Empty, NULL/Empty) - Performs ALL service discovery AND ALL resource discovery.
- * (NULL/Empty, Not Empty) - Performs query for a filtered/scoped/particular resource(s)
- * from ALL services.
- * (Not Empty, NULL/Empty) - Performs ALL resource discovery on a particular service.
- * (Not Empty, Not Empty) - Performs query for a filtered/scoped/particular resource(s)
- * from a particular service.
- *
- * Thread-Safety: TODO Determine if it is going to be safe to call in a UI thread
- */
- private void findResource(String host, HashMap<String, String> filter,
- OCResourceResultHandler handler) {
- /*** Have to make sure all values are valid so the pass down to JNI runs smoothly. ***/
- String tempHost = host;
- HashMap<String, String> tempFilter = filter;
- if (host == null) {
- tempHost = "";
- }
- if (filter == null) {
- tempFilter = new HashMap<String, String>();
- tempFilter.put("", ""); // TODO: NOt sure if putting an empty key is necessary if the hashmap is empty.
- }
- // Todo: Throw exception if handler is invalid (i.e. null).
- /*** Done ensuring all values are valid. ***/
- jniFindResource(tempHost, tempFilter, handler);
- }
-
- /**
- * Queries the network for available resources.
- *
- * NOTE: This gets posted to a new thread so it doesn't hold the UI or network thread.
- *
- * @param serviceURL - The URL to the service. NULL for a broadcast/multicast.
- * @param resourceType - The resource type filter. NULL for match any.
- *
- * @throws This may throw if the service is not started, network is bad, etc.
- *
- * Thread-Safety: TODO Determine if it is going to be safe to call in a UI thread
- */
- public void findResourceByType(String serviceURL, String resourceType,
- OCResourceResultHandler handler) {
- HashMap<String, String> filteredMap = new HashMap<String, String>();
- filteredMap.put("rt", resourceType);
- findResource(serviceURL, filteredMap, handler);
- }
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc;
-
-/**
- *
- * Represents a basic local resource to be offered to remote services.
- *
- */
-public interface OCObject {
- /**
- * Determines if the resource should be listed in the well-known core list.
- *
- * NOTE: This may be better handled at a different location.
- *
- * @return Returns true if resource should be listed.
- */
- boolean isVisible();
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc;
-
-import java.util.UUID;
-
-/**
- *
- * TODO: Consider including Attachment like java.nio.CompletionHandler
- *
- * @param <T>
- */
-public class OCObserver<T> implements Comparable<OCObserver<T>> {
- private static UUID observerId = UUID.randomUUID();
-
- /**
- *
- * The OC service calls this at intervals n until the expired callback occurs.
- *
- */
- public void onChanged(T data) {}
-
- /**
- * Called if a failure occurred. No more events will occur after this is callback.
- *
- * @param throwable - The error that caused this callback sequence to fail.
- */
- public void onFailed(Throwable throwable) {}
-
- @Override
- public int compareTo(OCObserver<T> another) {
- return observerId.compareTo(another.getObserverId());
- }
-
- /**
- *
- * @return observerId associated with this OCObserver object.
- */
- UUID getObserverId() {
- return observerId;
- }
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc;
-
-import java.net.URI;
-import java.util.ArrayList;
-
-/**
- * Static methods allow you to call to the OC stack, while non-static methods provide traversal
- * through the tree of hierarchical resources. Non-static methods also retrieve properties of the
- * current OCResource object.
- */
-public class OCResource {
- private OCResource _parent = null;
- private ArrayList<OCResource> _children = null;
- private boolean _isContainer = false;
-
- public OCResource(OCResource parent, ArrayList<OCResource> children, boolean isContainer) {
- _parent = parent;
- _children = children;
- _isContainer = isContainer;
- }
-
- OCResource getParent() {
- return _parent;
- }
-
- ArrayList<OCResource> getChildren() {
- return _children;
- }
-
- /**
- * Recursively gets all the operable resources below this in the tree to a depth of 2.
- *
- * @return Returns an ArrayList of operable OCResource objects below this OCResource's position in
- * the tree.
- */
- ArrayList<OCResource> getResource() {
- return getResources(2);
- }
-
- /**
- * Recursively gets all the operable resources below this in the tree.
- *
- * @param depth - The depth to traverse the tree downward.
- * @return Returns an ArrayList of operable OCResource objects below this OCResource's position in
- * the tree.
- */
- ArrayList<OCResource> getResources(int depth) {
- if (depth - 1 <= 0) {
- return null;
- }
- ArrayList<OCResource> retRes = new ArrayList<OCResource>();
- if (_isContainer == true) { // If this is a resource container, add all the resources below me
- // in my tree.
- for (OCResource child : getChildren()) {
- retRes.addAll(child.getResources(depth - 1));
- }
- } else {
- retRes.add(OCResource.this);
- }
- return retRes;
- }
-
- /**
- * Recursively gets all the container (i.e. inoperable) resources below this in the tree to a
- * depth of 2.
- *
- * @return Returns an ArrayList of inoperable OCResource objects below this OCResource's position
- * in the tree.
- */
- ArrayList<OCResource> getResourceContainers() {
- return getResourceContainers(2);
- }
-
- /**
- * Recursively gets all the container (i.e. inoperable) resources below this in the tree.
- *
- * @param depth - The depth to traverse the tree downward.
- *
- * @return Returns an ArrayList of inoperable OCResource objects below this OCResource's position
- * in the tree.
- */
- ArrayList<OCResource> getResourceContainers(int depth) {
- if (depth - 1 <= 0) {
- return null;
- }
- ArrayList<OCResource> retRes = new ArrayList<OCResource>();
- if (_isContainer == true) {
- for (OCResource child : getChildren()) {
- retRes.addAll(child.getResourceContainers(depth - 1));
- }
- retRes.add(OCResource.this);
- }
- return retRes;
- }
- /**
- * Recursively gets all the resources (operable & inoperable) resources below this in the tree
- * to a depth of 2.
- *
- * @return Returns an ArrayList of operable & inoperable OCResource objects below this
- * OCResource's position in the tree.
- */
- ArrayList<OCResource> getAllResources() {
- return getAllResources(2);
- }
-
- /**
- * Recursively gets all the resources (operable & inoperable) resources below this in the tree.
- *
- * @param depth - The depth to traverse the tree downward.
- *
- * @return Returns an ArrayList of operable & inoperable OCResource objects below this
- * OCResource's position in the tree.
- */
- ArrayList<OCResource> getAllResources(int depth) {
- if (depth - 1 <= 0) {
- return null;
- }
- ArrayList<OCResource> retRes = new ArrayList<OCResource>();
- if (_isContainer == true) {
- for (OCResource child : getChildren()) {
- retRes.addAll(child.getAllResources(depth - 1));
- }
- retRes.add(OCResource.this);
- } else {
- retRes.add(OCResource.this);
- }
- return retRes;
- }
-
- /**
- *
- * @return Returns the resource URI to address this Resource. You can determine the service that
- * is hosting this resource by parsing this URI.
- */
- URI getURI() {
- return null;
- }
-
- /**
- * Returns the requested interface for this resource
- *
- * @param interfaceClass - The interface that is desired.
- *
- * @return The interface requested or NULL if not supported.
- */
- public <T> T getInterface(java.lang.Class<T> interfaceClass) {
- return null;
- }
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc;
-
-import java.io.Serializable;
-
-/**
- *
- * When a request or command is issued to a resource, an OCResourceResultHandler object must be
- * passed as a parameter to handle the callback(s).
- *
- */
-public interface OCResourceResultHandler extends Serializable {
- /**
- *
- * The OC service calls this repeatedly until completed() or failed() is called.
- *
- * @param serviceURI - The URI of the reporting service.
- * @param resources - The list of resources found on the remote service.
- */
- void onResourcesFound(String serviceURI, OCResource[] resources);
-
- /**
- * Called after all of the found resource(s) are reported.
- */
- void onCompleted();
-
- /**
- * Called if a failure occurred. No resources will be reported after this callback.
- *
- * @param throwable - The error that caused this callback sequence to fail.
- */
- void onFailed(Throwable throwable);
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc;
-
-import java.net.URI;
-
-/**
- *
- * This class (or interface) provides methods to determine whether a remote request is allowed to a
- * resource.
- *
- */
-public class OCSecurityModel {
-
- public OCSecurityModel() {
- // TODO Auto-generated constructor stub
- }
-
- public void checkAccess(URI sourceURI, URI destinationURI, int encryptionLevel, int remoteIdentity) {
- // TODO: Need to define...
- }
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc;
-
-/**
- * This represents a running open connection server.
- *
- * WARNING: This may change to an interface so that we may transition to a factory pattern
- *
- */
-public class OCServer {
- private native void jniRegisterResource(OCObject object, String url);
-
- private native void jniUnregisterResource(OCObject object);
-
- private native void jniStartOCServer();
-
- private native void jniStopOCServer();
-
- private native OCDiscovery jniGetDiscoverySingleton();
-
- /**
- * Constructor for OCService.
- */
- public OCServer() {}
-
- /**
- * This registers a security model for access control to resources under this service.
- *
- * @param model - Security Model required for access to this service and control/view of it's
- * services.
- */
- public void setSecurityModel(OCSecurityModel model) {
- // Todo: Pat, What will we do here?
- }
-
- /**
- * Registers a resource with the service.
- *
- * @param object - The OCObject that handles the resource requests
- * @param url - The URL under the resource.
- * @param accessControl - The access control handler that determines whether the remote device is
- * allowed to access this resource. If NULL, all access is granted.
- */
- public void registerResource(OCObject object, String url/* TODO: , AccessControl accessControl */) {
- jniRegisterResource(object, url);
- }
-
- /**
- * Unregisters a resource with the service.
- *
- * @param object - The OCObject to be unregistered.
- */
- public void unregisterResource(OCObject object) {
- jniUnregisterResource(object);
- }
-
- /**
- * Starts the open connectivity service.
- *
- * Thread-Safety: TODO Determine if it is going to be safe to call in a UI thread
- */
- public void start() {
- jniStartOCServer();
- }
-
- /**
- * Stops the open connectivity service.
- *
- * Thread-Safety: TODO Determine if it is going to be safe to call in a UI thread
- */
- public void stop() {
- jniStopOCServer();
- }
-
- /**
- * Retrieves access to discovery APIs via the Discovery Singleton delegated by the SDK. Delegation
- * is limited to just one singleton per OCServer object.
- *
- * @return Returns an object which permits access to the open connectivity discovery APIs to just
- * one discovery singleton object.
- *
- * @throws //TODO throws an exception when the discovery singleton has already been checked out.
- */
- public OCDiscovery getDiscoverySingleton() {
- return jniGetDiscoverySingleton();
- }
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc.annotations;
-
-/**
- *
- * Base OCInterface Interface. Integral piece used to describe a resource's functionality OTA.
- *
- */
-public @interface OCInterface {
- String name() default "";
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc.annotations;
-
-/**
- *
- * Base OCMethod Interface. Integral piece used to describe a resource's functionality OTA.
- *
- */
-public @interface OCMethod {
- String name() default "";
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc.annotations;
-
-/**
- *
- * Base OCProperty Interface. Integral piece used to describe a resource's functionality OTA.
- *
- */
-public @interface OCProperty {
- String name() default "";
-
- String type() default "";
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
- <storageModule moduleId="org.eclipse.cdt.core.settings">
- <cconfiguration id="com.android.toolchain.gcc.1440046252">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.1440046252" moduleId="org.eclipse.cdt.core.settings" name="Default">
- <externalSettings/>
- <extensions>
- <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
- </extensions>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.1440046252" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
- <folderInfo id="com.android.toolchain.gcc.1440046252.1314584192" name="/" resourcePath="">
- <toolChain id="com.android.toolchain.gcc.1881071196" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
- <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.1013766009" isAbstract="false" superClass="com.android.targetPlatform"/>
- <builder id="com.android.builder.1764929546" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
- <outputEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
- </outputEntries>
- </builder>
- <tool id="com.android.gcc.compiler.1727775847" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
- <inputType id="com.android.gcc.inputType.352036501" superClass="com.android.gcc.inputType"/>
- </tool>
- </toolChain>
- </folderInfo>
- <sourceEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
- </sourceEntries>
- </configuration>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
- </cconfiguration>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="OCLogger.null.1557157764" name="OCLogger"/>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
- <storageModule moduleId="scannerConfiguration">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- <scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.1440046252;com.android.toolchain.gcc.1440046252.1314584192;com.android.gcc.compiler.1727775847;com.android.gcc.inputType.352036501">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
- </scannerConfigBuildInfo>
- </storageModule>
-</cproject>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.oc.logger"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="16"
- android:targetSdkVersion="16" />
-
- <application
- android:allowBackup="true"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.oc.logger.MainActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
+++ /dev/null
-# LOGGER #
-LOCAL_PATH := $(call my-dir)
-
-ifeq ($(CCFL_CORE), )
-CCFL_CORE := $(HOME)/peg_ccfl-core
-endif
-
-ifeq ($(LOGGER_OBJ), )
-LOGGER_OBJ := $(CCFL_CORE)/logger
-endif
-
-# ==============================================================
-# OCLogger - Android
-# ==============================================================
-include $(CLEAR_VARS)
-
-TARGET_PLATFORM := android-16
-
-LOCAL_CPPFLAGS += -D_GLIBCXX__PTHREADS
-LOCAL_CPPFLAGS += -D_THREAD_SAFE
-LOCAL_CPPFLAGS += -D_REENTRANT
-LOCAL_CPPFLAGS += -std=gnu++11
-LOCAL_CPPFLAGS += -s
-LOCAL_CPPFLAGS += -DHAVE_SOCKET_ERRNO
-
-ifneq ($(TARGET_ARCH), $(X86_ARCH))
- LOCAL_CPPFLAGS += -D__arm__
-endif
-
-X86_ARCH := x86
-
-LOCAL_MODULE := OCLogger
-
-LOCAL_SRC_FILES := $(LOGGER_OBJ)/src/logger.c
-
-LOCAL_C_INCLUDES := $(LOGGER_OBJ)/include
-
-LOCAL_STATIC_LIBRARIES += tbstack
-
-include $(BUILD_STATIC_LIBRARY)
\ No newline at end of file
+++ /dev/null
-APP_STL := gnustl_static #stlport_static
-APP_PLATFORM := android-16
-APP_ABI := armeabi armeabi-v7a x86
-APP_OPTIM := release
-#APP_OPTIM := debug
-APP_CPPFLAGS += -fno-strict-aliasing
-APP_CPPFLAGS += -std=gnu++11
-APP_CPPFLAGS += -D_GLIBCXX_USE_WCHAR_T
-APP_CPPFLAGS += -fexceptions
-APP_CPPFLAGS += -frtti
-#NDK_TOOLCHAIN_VERSION=4.8
\ No newline at end of file
+++ /dev/null
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
+++ /dev/null
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-16
+++ /dev/null
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- tools:context="com.oc.logger.MainActivity" >
-
- <item
- android:id="@+id/action_settings"
- android:orderInCategory="100"
- android:showAsAction="never"
- android:title="@string/action_settings"/>
-
-</menu>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
- <!-- API 14 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Example customization of dimensions originally defined in res/values/dimens.xml
- (such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
- -->
- <dimen name="activity_horizontal_margin">64dp</dimen>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="app_name">OCLogger</string>
- <string name="hello_world">Hello world!</string>
- <string name="action_settings">Settings</string>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.oc.ub.sampleclient"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="16"
- android:targetSdkVersion="16" />
-
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.oc.ub.sample.OCService"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<lint>
-</lint>
\ No newline at end of file
+++ /dev/null
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
+++ /dev/null
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-16
-android.library.reference.1=../OCLib
+++ /dev/null
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="com.oc.ub.sample.OCService"
- tools:ignore="MergeRootFrame" />
+++ /dev/null
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.oc.ub.sample.OCClient$PlaceholderFragment" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/hello_world" />
-
-</RelativeLayout>
+++ /dev/null
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- tools:context="com.oc.ub.sampleclient.OCClient" >
-
- <item
- android:id="@+id/action_settings"
- android:orderInCategory="100"
- android:showAsAction="never"
- android:title="@string/action_settings"/>
-
-</menu>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
- <!-- API 14 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Example customization of dimensions originally defined in res/values/dimens.xml
- (such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
- -->
- <dimen name="activity_horizontal_margin">64dp</dimen>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="app_name">OCClient</string>
- <string name="hello_world">Hello world!</string>
- <string name="action_settings">Settings</string>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc.ub.sample;
-
-import com.oc.OCObserver;
-import com.oc.annotations.OCInterface;
-import com.oc.annotations.OCProperty;
-
-/**
- * APPLICATION NOTE: This interface is exposed to via the framework because of the @OCInterface
- * annotation. Without the annotation, this interface would be ignored by the framework.
- *
- * APPLICATION NOTE: This interface needs to be accessible on the client and the server as the
- * contract for operation.
- *
- */
-@OCInterface
-public interface LightControl {
- /**
- * APPLICATION NOTE: This is a synchronous request. It will throw immediately if the stack is down
- * or the network is otherwise not available. It may throw is the remote side does not responds or
- * returns an error.
- *
- * @param powered - The new power state of this implemented interface.
- */
- @OCProperty(name = "powered")
- void setPowered(boolean powered);
-
- /**
- * APPLICATION NOTE: This is a synchronous request. It will throw immediately if the stack is down
- * or the network is otherwise not available. It may throw is the remote side does not responds or
- * returns an error.
- *
- * @return Returns power state of this implemented interface.
- */
- @OCProperty(name = "powered")
- boolean isPowered();
-
- /**
- * APPLICATION NOTE: It is the objects responsibility to throw an exception (TBD) if it cannot
- * handle an additional observers which will in turn return an error to the requestor.
- *
- * @param observer the observer that will be notified when a change to the power property has
- * occurred.
- */
- @OCProperty(name = "powered")
- void addPoweredObserver(OCObserver<Boolean> observer);
-
- /**
- *
- * @param observer the observer that will be no longer notified when a change to the power
- * property has occurred.
- */
- @OCProperty(name = "powered")
- void removePoweredObserver(OCObserver<Boolean> observer);
-
- /**
- * APPLICATION NOTE: Even properties (or methods) that are not annotated are exposed, by default,
- * via the framework. Getter and setter methods are assumed to be properties unless annotated
- * otherwise.
- *
- * @param level - Sets the power level of this implemented interface.
- */
- void setLevel(int level);
-
- int getLevel();
-
- /**
- * APPLICATION NOTE: This is an example of a method. The annotation is not required except to
- * override the defaults.
- */
- void flash();
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc.ub.sample;
-
-import com.oc.OCObject;
-import com.oc.OCObserver;
-
-public class MyLight implements OCObject, LightControl {
-
- public MyLight() {
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public boolean isVisible() {
- return true;
- }
-
- @Override
- public void setPowered(boolean powered) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public boolean isPowered() {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public void setLevel(int level) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public int getLevel() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public void flash() {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void addPoweredObserver(OCObserver<Boolean> observer) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void removePoweredObserver(OCObserver<Boolean> observer) {
- // TODO Auto-generated method stub
-
- }
-
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc.ub.sample;
-
-import com.oc.OCSecurityModel;
-import com.oc.OCServer;
-import com.oc.ub.sampleclient.R;
-
-import android.app.Activity;
-import android.app.Fragment;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-
-public class OCService extends Activity {
- private static String TAG = "OCCLIENT";
- private OCServer service = null;
- private MyLight resource = null;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_occlient);
-
- if (savedInstanceState == null) {
- getFragmentManager().beginTransaction().add(R.id.container, new PlaceholderFragment())
- .commit();
- }
-
- // NOTE: We throw exceptions for the bad errors... so no return codes
- try {
- // In a complete example, the MyLight class should have callback to
- // update the UI
- resource = new MyLight();
- service = new OCServer();
- service.setSecurityModel(new OCSecurityModel());
- // TODO: Mats, will we allow one resource to be mapped to two URLs???
- service.registerResource(resource, "/light/a");
- // TODO: Mats, will we allow one resource to be mapped to two URLs???
- // service.registerResource(resource, "/light/b", new OCAccessHandler());
- service.start();
- } catch (Exception exception) {
- finish();
- }
- }
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
-
- // Inflate the menu; this adds items to the action bar if it is present.
- getMenuInflater().inflate(R.menu.occlient, menu);
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- // Handle action bar item clicks here. The action bar will automatically handle clicks on the
- // Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
- int id = item.getItemId();
- if (id == R.id.action_settings) {
- return true;
- }
- return super.onOptionsItemSelected(item);
- }
-
- @Override
- protected void onDestroy() {
- super.onDestroy();
-
- try {
- service.unregisterResource(resource);
- service.stop();
- } catch (Exception exception) {
- // TODO: Handle exception
- }
- }
-
- /**
- * A placeholder fragment containing a simple view.
- */
- public static class PlaceholderFragment extends Fragment {
-
- public PlaceholderFragment() {}
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- View rootView = inflater.inflate(R.layout.fragment_occlient, container, false);
- return rootView;
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
- <storageModule moduleId="org.eclipse.cdt.core.settings">
- <cconfiguration id="com.android.toolchain.gcc.1426311490">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.1426311490" moduleId="org.eclipse.cdt.core.settings" name="Default">
- <externalSettings/>
- <extensions>
- <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
- </extensions>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.1426311490" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
- <folderInfo id="com.android.toolchain.gcc.1426311490.1733532201" name="/" resourcePath="">
- <toolChain id="com.android.toolchain.gcc.352787744" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
- <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.337072217" isAbstract="false" superClass="com.android.targetPlatform"/>
- <builder id="com.android.builder.1915838722" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
- <outputEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
- </outputEntries>
- </builder>
- <tool id="com.android.gcc.compiler.1402101219" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
- <inputType id="com.android.gcc.inputType.1695670066" superClass="com.android.gcc.inputType"/>
- </tool>
- </toolChain>
- </folderInfo>
- <sourceEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
- </sourceEntries>
- </configuration>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
- </cconfiguration>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="OCSocket.null.794191193" name="OCSocket"/>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
- <storageModule moduleId="scannerConfiguration">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- <scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.1426311490;com.android.toolchain.gcc.1426311490.1733532201;com.android.gcc.compiler.1402101219;com.android.gcc.inputType.1695670066">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
- </scannerConfigBuildInfo>
- </storageModule>
-</cproject>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.oc.socket"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="16"
- android:targetSdkVersion="16" />
-
- <application
- android:allowBackup="true"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.oc.socket.MainActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
+++ /dev/null
-# LOGGER #
-LOCAL_PATH := $(call my-dir)
-
-ifeq ($(CCFL_CORE), )
-CCFL_CORE := $(HOME)/peg_ccfl-core
-endif
-
-ifeq ($(LOGGER_OBJ), )
-LOGGER_OBJ := $(CCFL_CORE)/logger
-endif
-
-ifeq ($(SOCKET_OBJ), )
-SOCKET_OBJ := $(CCFL_CORE)/ocsocket
-endif
-
-ifeq ($(ANDROID_OBJ), )
-ANDROID_OBJ := $(CCFL_CORE)/android
-endif
-
-#
-# OCLogger
-#
-include $(CLEAR_VARS)
-TARGET_PLATFORM := android-16
-LOCAL_MODULE := oclogger
-LOCAL_SRC_FILES := $(ANDROID_OBJ)/OCLogger/obj/local/$(TARGET_ARCH_ABI)/libOCLogger.a
-include $(PREBUILT_STATIC_LIBRARY)
-
-# ==============================================================
-# OCLogger - Android
-# ==============================================================
-include $(CLEAR_VARS)
-
-TARGET_PLATFORM := android-16
-
-LOCAL_CPPFLAGS += -D_GLIBCXX__PTHREADS
-LOCAL_CPPFLAGS += -D_THREAD_SAFE
-LOCAL_CPPFLAGS += -D_REENTRANT
-LOCAL_CPPFLAGS += -std=gnu++11
-LOCAL_CPPFLAGS += -s
-LOCAL_CPPFLAGS += -DHAVE_SOCKET_ERRNO
-
-ifneq ($(TARGET_ARCH), $(X86_ARCH))
- LOCAL_CPPFLAGS += -D__arm__
-endif
-
-X86_ARCH := x86
-
-LOCAL_MODULE := OCSocket
-
-LOCAL_SRC_FILES := $(SOCKET_OBJ)/src/ocsocket.c
-
-LOCAL_C_INCLUDES := $(SOCKET_OBJ)/include
-LOCAL_C_INCLUDES += $(LOGGER_OBJ)/include
-
-LOCAL_STATIC_LIBRARIES := oclogger
-
-include $(BUILD_STATIC_LIBRARY)
\ No newline at end of file
+++ /dev/null
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
+++ /dev/null
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-16
+++ /dev/null
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="com.oc.socket.MainActivity"
- tools:ignore="MergeRootFrame" />
+++ /dev/null
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.oc.socket.MainActivity$PlaceholderFragment" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/hello_world" />
-
-</RelativeLayout>
+++ /dev/null
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- tools:context="com.oc.socket.MainActivity" >
-
- <item
- android:id="@+id/action_settings"
- android:orderInCategory="100"
- android:showAsAction="never"
- android:title="@string/action_settings"/>
-
-</menu>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
- <!-- API 14 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Example customization of dimensions originally defined in res/values/dimens.xml
- (such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
- -->
- <dimen name="activity_horizontal_margin">64dp</dimen>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="app_name">OCSocket</string>
- <string name="hello_world">Hello world!</string>
- <string name="action_settings">Settings</string>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
- <storageModule moduleId="org.eclipse.cdt.core.settings">
- <cconfiguration id="com.android.toolchain.gcc.349996057">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.349996057" moduleId="org.eclipse.cdt.core.settings" name="Default">
- <externalSettings/>
- <extensions>
- <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
- </extensions>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.349996057" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
- <folderInfo id="com.android.toolchain.gcc.349996057.1780633097" name="/" resourcePath="">
- <toolChain id="com.android.toolchain.gcc.125309616" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
- <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.1214096925" isAbstract="false" superClass="com.android.targetPlatform"/>
- <builder id="com.android.builder.835771544" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
- <outputEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
- </outputEntries>
- </builder>
- <tool id="com.android.gcc.compiler.1899262912" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
- <inputType id="com.android.gcc.inputType.525348316" superClass="com.android.gcc.inputType"/>
- </tool>
- </toolChain>
- </folderInfo>
- <sourceEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
- </sourceEntries>
- </configuration>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
- </cconfiguration>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="OCTBStack.null.2079343911" name="OCTBStack"/>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
- <storageModule moduleId="scannerConfiguration">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- <scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.349996057;com.android.toolchain.gcc.349996057.1780633097;com.android.gcc.compiler.1899262912;com.android.gcc.inputType.525348316">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
- </scannerConfigBuildInfo>
- </storageModule>
-</cproject>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.oc.tbstack"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="16"
- android:targetSdkVersion="16" />
-
- <application
- android:allowBackup="true"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.oc.tbstack.MainActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
+++ /dev/null
-# TBSTACK #
-LOCAL_PATH := $(call my-dir)
-
-ifeq ($(CCFL_CORE), )
-CCFL_CORE := $(HOME)/peg_ccfl-core
-endif
-
-ifeq ($(OCCOAP_OBJ), )
-OCCOAP_OBJ := $(CCFL_CORE)/occoap
-endif
-
-ifeq ($(TB_OBJ), )
-TB_OBJ := $(CCFL_CORE)/stack
-endif
-
-ifeq ($(LOGGER_OBJ), )
-LOGGER_OBJ := $(CCFL_CORE)/logger
-endif
-
-ifeq ($(ANDROID_OBJ), )
-ANDROID_OBJ := $(CCFL_CORE)/android
-endif
-
-#
-# OCCoap
-#
-include $(CLEAR_VARS)
-TARGET_PLATFORM := android-16
-LOCAL_MODULE := occoap
-LOCAL_SRC_FILES := $(ANDROID_OBJ)/OCCoap/obj/local/$(TARGET_ARCH_ABI)/libOCCoap.a
-include $(PREBUILT_STATIC_LIBRARY)
-
-# ==============================================================
-# OCLib - Android
-# ==============================================================
-include $(CLEAR_VARS)
-
-TARGET_PLATFORM := android-16
-
-LOCAL_CPPFLAGS += -D_GLIBCXX__PTHREADS
-LOCAL_CPPFLAGS += -D_THREAD_SAFE
-LOCAL_CPPFLAGS += -D_REENTRANT
-LOCAL_CPPFLAGS += -std=gnu++11
-LOCAL_CPPFLAGS += -s
-LOCAL_CPPFLAGS += -DHAVE_SOCKET_ERRNO
-
-ifneq ($(TARGET_ARCH), $(X86_ARCH))
- LOCAL_CPPFLAGS += -D__arm__
-endif
-
-X86_ARCH := x86
-
-LOCAL_MODULE := TBStack
-
-LOCAL_SRC_FILES := $(TB_OBJ)/src/ocstack.c
-
-LOCAL_C_INCLUDES := $(TB_OBJ)/include/
-LOCAL_C_INCLUDES += $(TB_OBJ)/include/internal
-LOCAL_C_INCLUDES += $(OCCOAP_OBJ)/include
-LOCAL_C_INCLUDES += $(LOGGER_OBJ)/include
-
-LOCAL_STATIC_LIBRARIES += occoap
-
-include $(BUILD_STATIC_LIBRARY)
\ No newline at end of file
+++ /dev/null
-APP_STL := gnustl_static #stlport_static
-APP_PLATFORM := android-16
-APP_ABI := armeabi armeabi-v7a x86
-APP_OPTIM := release
-#APP_OPTIM := debug
-APP_CPPFLAGS += -fno-strict-aliasing
-APP_CPPFLAGS += -std=gnu++11
-APP_CPPFLAGS += -D_GLIBCXX_USE_WCHAR_T
-APP_CPPFLAGS += -fexceptions
-APP_CPPFLAGS += -frtti
-#NDK_TOOLCHAIN_VERSION=4.8
\ No newline at end of file
+++ /dev/null
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
+++ /dev/null
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-16
+++ /dev/null
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- tools:context="com.oc.tbstack.MainActivity" >
-
- <item
- android:id="@+id/action_settings"
- android:orderInCategory="100"
- android:showAsAction="never"
- android:title="@string/action_settings"/>
-
-</menu>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
- <!-- API 14 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Example customization of dimensions originally defined in res/values/dimens.xml
- (such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
- -->
- <dimen name="activity_horizontal_margin">64dp</dimen>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="app_name">OCTBStack</string>
- <string name="hello_world">Hello world!</string>
- <string name="action_settings">Settings</string>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
- <storageModule moduleId="org.eclipse.cdt.core.settings">
- <cconfiguration id="com.android.toolchain.gcc.381295911">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.381295911" moduleId="org.eclipse.cdt.core.settings" name="Default">
- <externalSettings/>
- <extensions>
- <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
- </extensions>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.381295911" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
- <folderInfo id="com.android.toolchain.gcc.381295911.1997622459" name="/" resourcePath="">
- <toolChain id="com.android.toolchain.gcc.151998350" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
- <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.290641337" isAbstract="false" superClass="com.android.targetPlatform"/>
- <builder id="com.android.builder.304245466" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
- <outputEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
- </outputEntries>
- </builder>
- <tool id="com.android.gcc.compiler.452595244" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
- <inputType id="com.android.gcc.inputType.1076381239" superClass="com.android.gcc.inputType"/>
- </tool>
- </toolChain>
- </folderInfo>
- <sourceEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
- </sourceEntries>
- </configuration>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
- </cconfiguration>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="OCUBStack.null.1393135280" name="OCUBStack"/>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
- <storageModule moduleId="scannerConfiguration">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- <scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.381295911;com.android.toolchain.gcc.381295911.1997622459;com.android.gcc.compiler.452595244;com.android.gcc.inputType.1076381239">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
- </scannerConfigBuildInfo>
- </storageModule>
-</cproject>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.oc.ubstack"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="16"
- android:targetSdkVersion="16" />
-
- <application
- android:allowBackup="true"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.oc.ubstack.MainActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
+++ /dev/null
-# UBSTACK #
-LOCAL_PATH := $(call my-dir)
-
-ifeq ($(CCFL_CORE), )
-CCFL_CORE := $(HOME)/peg_ccfl-core
-endif
-
-ifeq ($(UB_OBJ), )
-UB_OBJ := $(CCFL_CORE)/ubstack
-endif
-
-ifeq ($(TB_OBJ), )
-TB_OBJ := $(CCFL_CORE)/stack
-endif
-
-ifeq ($(ANDROID_OBJ), )
-ANDROID_OBJ := $(CCFL_CORE)/android
-endif
-
-ifeq ($(LOGGER_OBJ), )
-LOGGER_OBJ := $(CCFL_CORE)/logger
-endif
-
-ifeq ($(BOOST_OBJ), )
-BOOST_OBJ := $(HOME)/android-dev/boost/android
-endif
-
-#
-# TBStack
-#
-include $(CLEAR_VARS)
-TARGET_PLATFORM := android-16
-LOCAL_MODULE := tbstack
-LOCAL_SRC_FILES := $(ANDROID_OBJ)/OCTBStack/obj/local/$(TARGET_ARCH_ABI)/libTBStack.a
-include $(PREBUILT_STATIC_LIBRARY)
-
-#
-# OCCoap
-#
-include $(CLEAR_VARS)
-TARGET_PLATFORM := android-16
-LOCAL_MODULE := occoap
-LOCAL_SRC_FILES := $(ANDROID_OBJ)/OCCoap/obj/local/$(TARGET_ARCH_ABI)/libOCCoap.a
-include $(PREBUILT_STATIC_LIBRARY)
-
-#
-# OCLogger
-#
-include $(CLEAR_VARS)
-TARGET_PLATFORM := android-16
-LOCAL_MODULE := oclogger
-LOCAL_SRC_FILES := $(ANDROID_OBJ)/OCLogger/obj/local/$(TARGET_ARCH_ABI)/libOCLogger.a
-include $(PREBUILT_STATIC_LIBRARY)
-
-#
-# Boost
-#
-include $(CLEAR_VARS)
-TARGET_PLATFORM := android-16
-LOCAL_MODULE := boost_thread
-LOCAL_SRC_FILES := $(BOOST_OBJ)/$(TARGET_ARCH_ABI)/lib/libboost_thread-gcc-mt-1_49.a
-include $(PREBUILT_STATIC_LIBRARY)
-
-# ==============================================================
-# UBStack - Android
-# ==============================================================
-include $(CLEAR_VARS)
-
-TARGET_PLATFORM := android-16
-
-LOCAL_CPPFLAGS += -D_GLIBCXX__PTHREADS
-LOCAL_CPPFLAGS += -D_THREAD_SAFE
-LOCAL_CPPFLAGS += -D_REENTRANT
-LOCAL_CPPFLAGS += -std=gnu++11
-LOCAL_CPPFLAGS += -s
-LOCAL_CPPFLAGS += -DHAVE_SOCKET_ERRNO
-
-ifneq ($(TARGET_ARCH), $(X86_ARCH))
- LOCAL_CPPFLAGS += -D__arm__
-endif
-
-X86_ARCH := x86
-
-LOCAL_MODULE := UBStack
-
-LOCAL_SRC_FILES := $(UB_OBJ)/src/ocmodelimpl.cpp
-
-LOCAL_C_INCLUDES := $(UB_OBJ)/src
-LOCAL_C_INCLUDES += $(UB_OBJ)/include
-LOCAL_C_INCLUDES += $(TB_OBJ)/include
-LOCAL_C_INCLUDES += $(TB_OBJ)/internal
-LOCAL_C_INCLUDES += $(LOGGER_OBJ)/include
-
-LOCAL_C_INCLUDES += $(BOOST_OBJ)/include
-
-LOCAL_STATIC_LIBRARIES := tbstack
-LOCAL_STATIC_LIBRARIES += oclogger
-LOCAL_STATIC_LIBRARIES += boost_thread
-LOCAL_STATIC_LIBRARIES += occoap
-
-include $(BUILD_SHARED_LIBRARY)
\ No newline at end of file
+++ /dev/null
-APP_STL := gnustl_static #stlport_static
-APP_PLATFORM := android-16
-APP_ABI := armeabi armeabi-v7a x86
-APP_OPTIM := release
-#APP_OPTIM := debug
-APP_CPPFLAGS += -fno-strict-aliasing
-APP_CPPFLAGS += -std=gnu++11
-APP_CPPFLAGS += -D_GLIBCXX_USE_WCHAR_T
-APP_CPPFLAGS += -fexceptions
-APP_CPPFLAGS += -frtti
-#NDK_TOOLCHAIN_VERSION=4.8
\ No newline at end of file
+++ /dev/null
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
+++ /dev/null
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-16
+++ /dev/null
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- tools:context="com.oc.ubstack.MainActivity" >
-
- <item
- android:id="@+id/action_settings"
- android:orderInCategory="100"
- android:showAsAction="never"
- android:title="@string/action_settings"/>
-
-</menu>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
- <!-- API 14 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Example customization of dimensions originally defined in res/values/dimens.xml
- (such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
- -->
- <dimen name="activity_horizontal_margin">64dp</dimen>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="app_name">OCUBStack</string>
- <string name="hello_world">Hello world!</string>
- <string name="action_settings">Settings</string>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.oc.unittests"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="16"
- android:targetSdkVersion="16" />
-
-
- <instrumentation android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="com.oc.unittests"
- android:label="All Unit Tests" />
-
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <uses-library android:name="android.test.runner" />
- </application>
-
-</manifest>
+++ /dev/null
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
+++ /dev/null
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-16
-android.library.reference.1=../OCLib
+++ /dev/null
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="com.oc.unittests.UnitTestsActivity"
- tools:ignore="MergeRootFrame" />
+++ /dev/null
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.oc.unittests.UnitTestsActivity$PlaceholderFragment" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/hello_world" />
-
-</RelativeLayout>
+++ /dev/null
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- tools:context="com.oc.unittests.UnitTestsActivity" >
-
- <item
- android:id="@+id/action_settings"
- android:orderInCategory="100"
- android:showAsAction="never"
- android:title="@string/action_settings"/>
-
-</menu>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
- <!-- API 14 theme customizations can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Example customization of dimensions originally defined in res/values/dimens.xml
- (such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
- -->
- <dimen name="activity_horizontal_margin">64dp</dimen>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
-
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="app_name">UnitTests</string>
- <string name="hello_world">Hello world!</string>
- <string name="action_settings">Settings</string>
-
-</resources>
+++ /dev/null
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
-</resources>
+++ /dev/null
-To run this project as a unit test:
-
-Right-click on project->Run As->JUnit Test (Do not select "Android JUnit Test"!!!!!!)
\ No newline at end of file
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc.unittests;
-
-import static org.junit.Assert.*;
-import junit.framework.Assert;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.oc.OCDiscovery;
-import com.oc.OCObserver;
-import com.oc.OCResource;
-import com.oc.OCResourceResultHandler;
-import com.oc.OCSecurityModel;
-import com.oc.OCServer;
-
-public class UnitTest {
- private OCServer clientService = null;
- private OCServer serverService = null;
- private OCDiscovery ocDiscovery = null;
- private UnitTestResource serverResource = null;
-
- @Before
- public void init() throws Exception {
- clientService = new OCServer();
- clientService.start();
- ocDiscovery = clientService.getDiscoverySingleton();
- }
-
- @After
- public void destroy() throws Exception {
- try {
- clientService.stop();
- clientService = null;
- serverService.unregisterResource(serverResource);
- serverService.stop();
- } catch (Exception exception) {
- // TODO: Handle exception
- }
- }
-
- @Test
- public void findMyself() {
- client();
- server();
- }
-
- @SuppressWarnings("serial")
- public void client() {
- assertNotNull(clientService);
-
- /*
- * APPLICATION NOTE: All callbacks will come through on a new thread and will not interfere with
- * the UI thread or the Framework Thread (i.e. Networking Thread) which means that you need to
- * use a Handler() to post back to the UI.
- */
- ocDiscovery.findResourceByType(null, null, new OCResourceResultHandler() {
- @Override
- public void onResourcesFound(String serviceURL, OCResource[] resources) {
- // NOTE: This means that a service is reporting back zero or more resources
- // During the callback, lets check to see if the resource supports the
- // light control interface and turn the light on and then subscribe to any changes in the
- // light's power state.
- for (OCResource resource : resources) {
- try {
- UnitTestControlItf control = resource.getInterface(UnitTestControlItf.class);
- assertNotNull(control);
- if (control != null) {
- control.setState(true);
- control.isTrue();
-
- Assert.assertEquals(true, control.isTrue());
-
- /*
- * APPLICATION NOTE: All callbacks will come through on a new thread and will not
- * interfere with the UI thread or the Framework Thread (i.e. Networking Thread) which
- * means that you need to use a Handler() to post back to the UI.
- */
- control.addMyUnitTestObserver(new OCObserver<Boolean>() {
- @Override
- public void onChanged(Boolean data) {
- // TODO: Tell the UI! The state of the Light has changed.
-
- }
-
- @Override
- public void onFailed(Throwable throwable) {
- // TODO: Tell the UI! We are no longer subscribed to events for the Light's power
- // state.
- }
- });
- }
- } catch (Exception exception) {
- // TODO: Ooops
- }
- }
-
- }
-
- @Override
- public void onFailed(Throwable throwable) {
- // TODO: Handle the error. The request to find resources has failed.
- }
-
- @Override
- public void onCompleted() {
- // Nothing to do here... we are just done finding resources is all.
- }
- });
- }
-
- public void server() {
- // NOTE: We throw exceptions for the bad errors... so no return codes
- try {
- // In a complete example, the MyLight class should have callback to
- // update the UI
- serverResource = new UnitTestResource();
- serverService = new OCServer();
- serverService.setSecurityModel(new OCSecurityModel());
- // TODO: Mats, will we allow one resource to be mapped to two URLs???
- serverService.registerResource(serverResource, "/ResourceTypeGoesHere/a");
- // TODO: Mats, will we allow one resource to be mapped to two URLs???
- // service.registerResource(resource, "/light/b", new OCAccessHandler());
- serverService.start();
- } catch (Exception exception) {
- // finish();
- return; // End the application.
- }
- }
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc.unittests;
-
-import com.oc.OCObserver;
-import com.oc.annotations.OCInterface;
-import com.oc.annotations.OCProperty;
-
-@OCInterface
-public interface UnitTestControlItf {
- /**
- * APPLICATION NOTE: This is a synchronous request. It will throw immediately if the stack is down
- * or the network is otherwise not available. It may throw if the remote side does not responds or
- * returns an error.
- *
- * @param state - The new state of this implemented interface.
- */
- @OCProperty(name = "UnitTestName")
- void setState(boolean state);
-
- /**
- * APPLICATION NOTE: This is a synchronous request. It will throw immediately if the stack is down
- * or the network is otherwise not available. It may throw is the remote side does not responds or
- * returns an error.
- *
- * @return Returns state of this implemented interface.
- */
- @OCProperty(name = "UnitTestName")
- boolean isTrue();
-
- /**
- * APPLICATION NOTE: It is the objects responsibility to throw an exception if it cannot handle
- * any additional observers which will in turn return an error to the requestor.
- *
- * @param observer the observer that will be notified when a change to the state property has
- * occurred.
- */
- @OCProperty(name = "UnitTestName")
- void addMyUnitTestObserver(OCObserver<Boolean> observer);
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-package com.oc.unittests;
-
-import com.oc.OCObject;
-import com.oc.OCObserver;
-
-public class UnitTestResource implements OCObject, UnitTestControlItf {
-
- @Override
- public void setState(boolean state) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public boolean isTrue() {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public void addMyUnitTestObserver(OCObserver<Boolean> observer) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public boolean isVisible() {
- // TODO Auto-generated method stub
- return false;
- }
-
-}
+++ /dev/null
-2014-02-25 Doug Hudson
-Created core subdir for C++ API and CCFL Core. Makefile builds a test Linux executable.
-
-2014-02-14 Doug Hudson
-Added current C++ source files for remoting. The remoting controller code interfaces to the
-CCF Stack. The remoting code compiles in CCF, but have not yet added the ability to build in
-the CCF-Lite repo.
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef CHARACTERISTIC_H_
-#define CHARACTERISTIC_H_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <string>
-#include <memory>
-#include <functional>
-#include <stdint.h>
-#include "Core.h"
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace Intel {
-namespace CCFL {
-namespace API {
-
-// ============================================================================
-// Class
-// ============================================================================
-class PropertyGetResult {
- // ============================================================
- // Destructor
- // ============================================================
- public:
- virtual ~PropertyGetResult() {}
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
- virtual QueryResultType getResult() const = 0;
- virtual const std::string& getName() const = 0;
- virtual const std::string& getValue() const = 0;
-};
-
-typedef std::function<void (const PropertyGetResult&)> PropertyGetFunction;
-
-// ============================================================================
-// Class
-// ============================================================================
-class PropertySetResult {
- // ============================================================
- // Destructor
- // ============================================================
- public:
- virtual ~PropertySetResult() {}
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
- virtual QueryResultType getResult() const = 0;
- virtual const std::string& getName() const = 0;
- virtual const std::string& getValue() const = 0;
-};
-
-typedef std::function<void (const PropertySetResult&)> PropertySetFunction;
-
-// ============================================================================
-// Class
-// ============================================================================
-
-class Characteristic {
- // ============================================================
- // Type Definition(s)
- // ============================================================
- public:
- typedef std::shared_ptr<Characteristic> SharedPtr;
- typedef std::weak_ptr<Characteristic> WeakPtr;
-
- // ============================================================
- // Destructor
- // ============================================================
- public:
- virtual ~Characteristic() {}
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
- virtual const std::string& getName() const = 0;
- virtual bool isReadable() const = 0;
- virtual bool isWritable() const = 0;
- virtual bool isConstant() const = 0;
-};
-
-}
-}
-}
-
-#endif
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef CORE_H_
-#define CORE_H_
-
-#include <boost/uuid/uuid.hpp>
-typedef boost::uuids::uuid UUID_t;
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace Intel {
-namespace CCFL {
-namespace API {
-
-// ============================================================================
-// Enums
-// ============================================================================
-enum QueryResultType {
- SUCCESS,
- FAILURE
-};
-
-}
-}
-}
-
-#ifdef CPPV11
-#include <mutex>
- namespace Intel {
- namespace CCFL {
- namespace API {
- typedef std::mutex mutex;
- typedef std::lock_guard<std::mutex> mutex_lock_guard;
- }
- }
- }
-#else
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/locks.hpp>
- namespace Intel {
- namespace CCFL {
- namespace API {
- typedef boost::mutex mutex;
- typedef boost::lock_guard<boost::mutex> mutex_lock_guard;
- }
- }
- }
-#endif
-
-#endif /* CORE_H_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef DESCRIPTION_H_
-#define DESCRIPTION_H_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <string>
-#include <memory>
-#include <functional>
-#include "Service.hpp"
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace Intel {
-namespace CCFL {
-namespace API {
-
-// ============================================================================
-// Class
-// ============================================================================
-class DescriptionGetResult {
- // ============================================================
- // Destructor
- // ============================================================
- public:
- virtual ~DescriptionGetResult() {}
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
- virtual QueryResultType getResult() const = 0;
- virtual const std::set<Service::SharedPtr>& getServices() const = 0;
-};
-
-typedef std::function<void (const DescriptionGetResult&)> DescriptionGetFunction;
-
-// ============================================================================
-// Class
-// ============================================================================
-class Description {
- // ============================================================
- // Type Definition(s)
- // ============================================================
- public:
- typedef std::shared_ptr<Description> SharedPtr;
- typedef std::weak_ptr<Description> WeakPtr;
-
- // ============================================================
- // Destructor
- // ============================================================
- public:
- virtual ~Description() {}
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
- virtual const std::set<Service::SharedPtr>& getServices() const = 0;
-};
-
-}
-}
-}
-
-#endif /* DESCRIPTION_H_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef DEVICE_H_
-#define DEVICE_H_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <string>
-#include <list>
-#include <cassert>
-#include <stdint.h>
-
-#include "Core.h"
-#include "UUIDLess.hpp"
-#include "Link.hpp"
-#include "SimpleLogger.h"
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace Intel {
-namespace CCFL {
-namespace API {
-
-static const char DEVICE_TAG[] = "Device";
-
-class Device {
- // ============================================================
- // Type Definition(s)
- // ============================================================
-public:
- typedef std::shared_ptr<Device> SharedPtr;
- typedef std::weak_ptr<Device> WeakPtr;
- typedef std::list<Link::SharedPtr> LinkList;
-
-public:
- Device(const UUID_t& deviceId) {
- deviceId_ = deviceId;
- name_ = "";
- }
- virtual ~Device() {
- linkList_.clear();
- };
-
-public:
- const UUID_t& getId() {
- mutex_lock_guard lock(deviceMutex_);
- return deviceId_;
- };
-
- const std::string& getName() {
- mutex_lock_guard lock(deviceMutex_);
- return name_;
- };
-
- void setName(const std::string& name) {
- mutex_lock_guard lock(deviceMutex_);
- name_ = name;
- };
-
- void addLink(const Link::SharedPtr& link) {
- logDebug(DEVICE_TAG, "Entering Link::addLink");
- assert(link);
- mutex_lock_guard lock(deviceMutex_);
-
- // If list is empty, go ahead and add
- if (linkList_.empty())
- {
- logDebug(DEVICE_TAG, "Link::addLink, linkList empty, adding");
- linkList_.push_back(link);
- return;
- }
-
- // Search list for the link. If already in list, return
- for (auto iter = linkList_.begin(); iter != linkList_.end(); ++iter) {
- if (*iter == link) {
- logDebug(DEVICE_TAG, "Link::addLink, link already in linkList");
- return;
- }
- }
-
- // Not already in list, so add
- logDebug(DEVICE_TAG, "Link::addLink, adding link");
- linkList_.push_back(link);
- }
-
- bool removeLink(const Link::SharedPtr& link) {
- logDebug(DEVICE_TAG, "Entering Link::removeLink");
- assert(link);
-
- mutex_lock_guard lock(deviceMutex_);
- // Return immediately if the list is empty
- if (linkList_.empty()) {
- logDebug(DEVICE_TAG, "Link::removeLink, linkList empty");
- return false;
- }
-
- // Search list for the link. If in the list, return
- for (auto iter = linkList_.begin(); iter != linkList_.end(); ++iter) {
- if (*iter == link) {
- linkList_.erase(iter);
- logDebug(DEVICE_TAG, "Link::removeLink, removing link");
- return true;
- }
- }
-
- return false;
- }
-
- LinkList getLinks() {
- mutex_lock_guard lock(deviceMutex_);
- return linkList_;
- }
-
- uint32_t getLinkCount() {
- mutex_lock_guard lock(deviceMutex_);
- return (uint32_t)linkList_.size();
- }
-
-private:
- UUID_t deviceId_;
- std::string name_;
- LinkList linkList_;
- mutex deviceMutex_;
-};
-
-}
-}
-}
-
-
-
-#endif /* DEVICE_H_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef INTERNALAPI_H_
-#define INTERNALAPI_H_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <memory>
-#include <functional>
-#include <string>
-#include <list>
-#include "Core.h"
-#include "Description.hpp"
-#include "Characteristic.hpp"
-#include "Protocol.hpp"
-#include "Device.hpp"
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace Intel {
-namespace CCFL {
-namespace API {
-
-
-// ============================================================================
-// Device Class(es)
-// ============================================================================
-
-#if 0
-// ============================================================================
-// Class
-// ============================================================================
-class DeviceIdsGetResult {
- // ============================================================
- // Destructor
- // ============================================================
- public:
- virtual ~DeviceIdsGetResult() {}
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
- virtual QueryResultType getResult() const = 0;
- virtual const std::set<UUID_t>& getDeviceIds() const = 0;
-};
-
-typedef std::function<void (const DeviceIdsGetResult&)> DeviceIdsGetFunction;
-
-// ============================================================================
-// Class
-// ============================================================================
-class DeviceGetInfoResult {
- // ============================================================
- // Destructor
- // ============================================================
- public:
- virtual ~DeviceGetInfoResult() {}
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
- virtual QueryResultType getResult() const = 0;
- virtual const std::string& getName() const = 0;
- virtual const Description::SharedPtr& getDescription() const = 0;
- virtual bool isLocal() = 0;
-};
-
-typedef std::function<void (const DeviceGetInfoResult&)> DeviceGetInfoFunction;
-#endif
-
-// ============================================================================
-// Class
-// ============================================================================
-class GetDevicesResult {
- // ============================================================
- // Destructor
- // ============================================================
- public:
- virtual ~GetDevicesResult() {}
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
- virtual QueryResultType getResult() const = 0;
- virtual const std::list<Device::SharedPtr>& getDeviceList() const = 0;
-};
-
-typedef std::function<void (const GetDevicesResult&)> GetDevicesFunction;
-
-
-// ============================================================================
-// Class
-// ============================================================================
-typedef uint32_t DeviceObserverHandle;
-const DeviceObserverHandle INVALID_DEVICE_OBSERVER_HANDLE = (DeviceObserverHandle)0;
-
-class DeviceEvent {
-public:
- enum DeviceChange {
- DEVICE_CURRENT_COLLECTION,
- DEVICE_ADDED,
- DEVICE_REMOVED
- };
-
- struct DeviceEventInfo {
- UUID_t deviceId;
- DeviceChange deviceChange;
- };
- // ============================================================
- // Destructor
- // ============================================================
- public:
- virtual ~DeviceEvent() {}
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
- virtual QueryResultType getResult() const = 0;
- virtual DeviceObserverHandle getObserverHandle() const = 0;
- virtual const std::list<DeviceEventInfo>& getDeviceIdList() const = 0;
-};
-
-typedef std::function<void (const DeviceEvent&)> DeviceEventFunction;
-
-
-// ============================================================================
-// Class
-// ============================================================================
-class Model : public std::enable_shared_from_this<Model> {
- // ============================================================
- // Type Definition(s)
- // ============================================================
- public:
- typedef std::shared_ptr<Model> SharedPtr;
- typedef std::weak_ptr<Model> WeakPtr;
-
- // ============================================================
- // Factory
- // ============================================================
- public:
- static SharedPtr createModel();
-
- // ============================================================
- // Destructor
- // ============================================================
- public:
- virtual ~Model() {}
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
- virtual void getDevices(GetDevicesFunction& asyncReturnFunc) = 0;
-
- // Add/remove device observer
- virtual void removeDeviceObserver(DeviceObserverHandle observerHandle) = 0;
- virtual void setDeviceObserver(DeviceEventFunction& asyncEventFunction) = 0;
-
- // Register/unregister a protocol
- virtual const Protocols::Protocol::Handle registerProtocol(const Protocols::Protocol::SharedPtr& protocol) = 0;
- virtual bool unregisterProtocol(const Protocols::Protocol::Handle protocolHandle) = 0;
- virtual Device::SharedPtr getDevice(const UUID_t& deviceId) = 0;
- virtual void signalDeviceChange(const UUID_t& deviceId, DeviceEvent::DeviceChange deviceEvent) = 0;
-
-};
-
-
-}
-}
-}
-
-#endif /* INTERNALAPI_H_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef LINK_HPP_
-#define LINK_HPP_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <string>
-#include <memory>
-#include "Description.hpp"
-#include "Service.hpp"
-#include "Characteristic.hpp"
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace Intel {
-namespace CCFL {
-namespace API {
-
-class Link {
- // ============================================================
- // Type Definition(s)
- // ============================================================
-public:
- typedef std::shared_ptr<Link> SharedPtr;
- typedef std::weak_ptr<Link> WeakPtr;
-
- typedef std::function<void (const std::string& propertyName, const PropertyGetFunction& asyncReturnFunc)> RegisteredGetPropFunction;
- typedef std::function<void (const std::string& propertyName, const std::string& propertyValue, const PropertySetFunction& asyncReturnFunc)> RegisteredSetPropFunction;
- typedef std::function<void (const DescriptionGetFunction& asyncReturnFunc)> RegisteredGetDescriptionFunction;
-
-public:
- Link() {
- name_ = "unknown link name";
- registeredGetPropFunction_ = nullptr;
- registeredSetPropFunction_ = nullptr;
- registeredGetDescriptionFunction_ = nullptr;
- };
-
- virtual ~Link() {};
-
- virtual const std::string& getName() {
- return name_;
- }
-
- virtual void setName(const std::string name) {
- name_ = name;
- }
-
- // Used at application interface
- virtual void getProperty(const std::string& propertyName, PropertyGetFunction& asyncReturnFunc) {
- // Call registered function
- if (nullptr != registeredGetPropFunction_) {
- registeredGetPropFunction_(propertyName, asyncReturnFunc);
- }
- }
-
- virtual void setProperty(const std::string& propertyName, const std::string& propertyValue, PropertySetFunction& asyncReturnFunc) {
- if (nullptr != registeredSetPropFunction_) {
- registeredSetPropFunction_(propertyName, propertyValue, asyncReturnFunc);
- }
- }
-
- virtual void getDescription(DescriptionGetFunction& asyncReturnFunc) {
- if (nullptr != registeredGetDescriptionFunction_) {
- registeredGetDescriptionFunction_(asyncReturnFunc);
- }
- }
-
- // Used at protocol interface
- virtual void registerGetPropertyFunction(RegisteredGetPropFunction& registeredGetPropFunction) {
- registeredGetPropFunction_ = registeredGetPropFunction;
- }
-
- virtual void registerSetPropertyFunction(RegisteredSetPropFunction& registeredSetPropFunction) {
- registeredSetPropFunction_ = registeredSetPropFunction;
- }
-
- virtual void registerGetDescriptionFunction(RegisteredGetDescriptionFunction& registeredGetDescriptionFunction) {
- registeredGetDescriptionFunction_ = registeredGetDescriptionFunction;
- }
-
-private:
- std::string name_;
- RegisteredGetPropFunction registeredGetPropFunction_;
- RegisteredSetPropFunction registeredSetPropFunction_;
- RegisteredGetDescriptionFunction registeredGetDescriptionFunction_;
-};
-
-}
-}
-}
-
-#endif /* LINK_HPP_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef PROTOCOL_H_
-#define PROTOCOL_H_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <string>
-#include <set>
-#include <memory>
-#include <stdint.h>
-#include "Device.hpp"
-
-// ============================================================================
-// Forward declaration
-// ============================================================================
-namespace Intel {
- namespace CCFL {
- namespace API {
- class Model;
- }
- }
-}
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace Intel {
-namespace CCFL {
-namespace Protocols {
-
-class Protocol
-{
-public:
- typedef std::shared_ptr<Protocol> SharedPtr;
- typedef std::weak_ptr<Protocol> WeakPtr;
- typedef uint32_t Handle;
-
- static const Handle INVALID_HANDLE = (Handle)0;
-public:
- virtual ~Protocol() {};
-
-public:
- virtual void setModel(const std::shared_ptr<Intel::CCFL::API::Model>& model) = 0;
- virtual const Handle getHandle() = 0;
- virtual void setHandle(const Handle handle) = 0;
- virtual const std::string& getName() = 0;
- virtual void forceDeviceDiscovery() = 0;
-};
-
-}
-}
-}
-
-#endif /* PROTOCOL_H_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef SERVICE_H_
-#define SERVICE_H_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <string>
-#include <memory>
-#include <set>
-#include "Characteristic.hpp"
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace Intel {
-namespace CCFL {
-namespace API {
-
-class Service {
- // ============================================================
- // Type Definition(s)
- // ============================================================
- public:
- typedef std::shared_ptr<Service> SharedPtr;
- typedef std::weak_ptr<Service> WeakPtr;
-
- // ============================================================
- // Destructor
- // ============================================================
- public:
- virtual ~Service() {}
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
-
- virtual const std::string& getName() const = 0;
- virtual const std::set<Characteristic::SharedPtr>& getCharacteristics() const = 0;
-};
-
-}
-}
-}
-
-
-#endif /* SERVICE_H_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-
-/*
- * SimpleLogger.cpp
- *
- * Created on: Mar 27, 2014
- * Author: dkhudson
- */
-#include "SimpleLogger.h"
-
-#ifdef __ANDROID__
- #include <android/log.h>
-#endif
-
-namespace Intel {
-namespace CCFL {
-
-void LOG(const char * format, ...) {
-#ifdef __ANDROID__
- va_list args;
- va_start (args, format);
- __android_log_vprint(ANDROID_LOG_INFO, "CCF-Lite-ANDROID", format, args);
- va_end (args);
-#elif defined __linux__
- printf("INFO: CCF-Lite-LINUX: ");
- va_list args;
- va_start (args, format);
- vprintf(format, args);
- va_end (args);
- printf("\n");
-#endif
-}
-
-void logDebug(const char * tag, const char * format, ...) {
-#ifdef __ANDROID__
- va_list args;
- va_start (args, format);
- __android_log_vprint(ANDROID_LOG_DEBUG, tag, format, args);
- va_end (args);
-#elif defined __linux__
- printf("DEBUG: %s: ", tag);
- va_list args;
- va_start (args, format);
- vprintf(format, args);
- va_end (args);
- printf("\n");
-#endif
-}
-void logInfo(const char * tag, const char * format, ...) {
-#ifdef __ANDROID__
- va_list args;
- va_start (args, format);
- __android_log_vprint(ANDROID_LOG_INFO, tag, format, args);
- va_end (args);
-#elif defined __linux__
- printf("INFO: %s: ", tag);
- va_list args;
- va_start (args, format);
- vprintf(format, args);
- va_end (args);
- printf("\n");
-#endif
-}
-
-void logWarn(const char * tag, const char * format, ...) {
-#ifdef __ANDROID__
- va_list args;
- va_start (args, format);
- __android_log_vprint(ANDROID_LOG_WARN, tag, format, args);
- va_end (args);
-#elif defined __linux__
- printf("WARN: %s: ", tag);
- va_list args;
- va_start (args, format);
- vprintf(format, args);
- va_end (args);
- printf("\n");
-#endif
-}
-
-void logError(const char * tag, const char * format, ...) {
-#ifdef __ANDROID__
- va_list args;
- va_start (args, format);
- __android_log_vprint(ANDROID_LOG_ERROR, tag, format, args);
- va_end (args);
-#elif defined __linux__
- printf("ERROR: %s: ", tag);
- va_list args;
- va_start (args, format);
- vprintf(format, args);
- va_end (args);
- printf("\n");
-#endif
-}
-
-void logFatal(const char * tag, const char * format, ...) {
-#ifdef __ANDROID__
- va_list args;
- va_start (args, format);
- __android_log_vprint(ANDROID_LOG_FATAL, tag, format, args);
- va_end (args);
-#elif defined __linux__
- printf("FATAL: %s: ", tag);
- va_list args;
- va_start (args, format);
- vprintf(format, args);
- va_end (args);
- printf("\n");
-#endif
-}
-
-}
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef LOGGER_H_
-#define LOGGER_H_
-
-#include <stdint.h>
-#include <stdio.h>
-#include <stdarg.h>
-
-namespace Intel {
-namespace CCFL {
-
-void logDebug(const char * tag, const char * format, ...);
-void logInfo(const char * tag, const char * format, ...);
-void logWarn(const char * tag, const char * format, ...);
-void logError(const char * tag, const char * format, ...);
-void logFatal(const char * tag, const char * format, ...);
-
-
-//#ifndef NDEBUG
-//#if 0
-// #ifdef __linux__
-// #include <stdio.h>
-// #define LOG(...) printf(__VA_ARGS__); printf("\n");
-// #elif __ANDROID__
-// #include <android/log.h>
-// #define LOG(...) _android_log_print(ANDROID_LOG_INFO, "LOG_TAG", __VA_ARGS__);
-// #elif _WIN64
-// #define LOG(...)
-// #elif _WIN32
-// #define LOG(...)
-// #elif __APPLE__
-// #define LOG(...)
-// #else
-// #endif
-//#else
-// #define LOG(...)
-//#endif
-
-}
-}
-
-#endif /* LOGGER_H_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef UUIDLESS_HPP_
-#define UUIDLESS_HPP_
-
-// ============================================================================
-// Includes
-// ============================================================================
-
-#include <cstring>
-#include "Core.h"
-
- // ============================================================================
- // Namespace
- // ============================================================================
- namespace Intel {
- namespace CCFL {
-
- class UUIDLess
- {
- public:
- bool operator()(const UUID_t &uuid1, const UUID_t &uuid2) const
- {
- return memcmp(&uuid1, &uuid2, sizeof(uuid1))<0;
- }
- };
-
-}
-}
-
-
-#endif /* UUIDLESS_HPP_ */
+++ /dev/null
-# //******************************************************************
-# //
-# // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-# //
-# //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-# //
-# // Licensed under the Apache License, Version 2.0 (the "License");
-# // you may not use this file except in compliance with the License.
-# // You may obtain a copy of the License at
-# //
-# // http://www.apache.org/licenses/LICENSE-2.0
-# //
-# // Unless required by applicable law or agreed to in writing, software
-# // distributed under the License is distributed on an "AS IS" BASIS,
-# // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# // See the License for the specific language governing permissions and
-# // limitations under the License.
-# //
-# //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#
-# override with `make BUILD=release`
-# default to debug build
-BUILD := debug
-
-CC := g++
-
-PROG := core
-
-SRC_DIR := ./src
-TEST_DIR := ./test
-TEMP_DIR := ./include/core
-
-CC_FLAGS.debug := -O0 -g3 -Wall -c -fmessage-length=0 -std=c++0x -pedantic -fpic
-CC_FLAGS.release := -O0 -g3 -Wall -c -fmessage-length=0 -std=c++0x -fpic
-CC_FLAGS := $(CC_FLAGS.$(BUILD))
-
-INC := -I$(SRC_DIR)
-INC += -I./include/core
-INC += -I$(TEST_DIR)
-INC += -I../include/controller
-
-LIBS :=
-#LIBS := -lpthread
-#LIBS += -lboost_thread-mt
-#LIBS += -lboost_thread
-
-# using make's computed variables to select object and bin folders
-# depending on the build type
-OBJ_DIR.debug := ./obj/debug
-OBJ_DIR.release := ./obj/release
-OBJ_DIR := $(OBJ_DIR.$(BUILD))
-
-BIN_DIR.debug := ./bin/debug
-BIN_DIR.release := ./bin/release
-BIN_DIR := $(BIN_DIR.$(BUILD))
-
-CPP_FILES := $(wildcard $(SRC_DIR)/*.cpp)
-CPP_FILES += $(wildcard $(TEST_DIR)/*.cpp)
-CPP_FILES += $(wildcard $(TEMP_DIR)/*.cpp)
-OBJ_FILES := $(addprefix $(OBJ_DIR)/,$(notdir $(CPP_FILES:.cpp=.o)))
-H_FILES := $(wildcard ./include/core/*.hpp)
-H_FILES += $(wildcard ./include/core/*.h)
-H_FILES += $(wildcard $(TEST_DIR)/*.h)
-LD_FLAGS := -L/usr/lib
-
-
-all: $(PROG)
-
-$(PROG): $(OBJ_FILES)
- $(CC) -o $@ $^ $(LD_FLAGS) $(LIBS)
- mv ./$(PROG) ./$(BIN_DIR)
-
-
-$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h $(H_FILES)
- $(CC) $(CC_FLAGS) $(INC) -c -o $@ $<
-
-$(OBJ_DIR)/%.o: $(TEST_DIR)/%.cpp $(H_FILES)
- $(CC) $(CC_FLAGS) $(INC) -c -o $@ $<
-
-$(OBJ_DIR)/%.o: $(TEMP_DIR)/%.cpp $(H_FILES)
- $(CC) $(CC_FLAGS) $(INC) -c -o $@ $<
-
-.PHONY: clean
-clean :
- rm -rf ./obj/debug/*
- rm -rf ./obj/release/*
- rm -rf ./bin/debug/*
- rm -rf ./bin/release/*
-
-
-.PHONY: print_vars
-
-print_vars:
- @echo ""
- @echo 'BUILD = '$(value BUILD)
- @echo 'INC = '$(value INC)
- @echo 'CPP_FILES = '$(value CPP_FILES)
- @echo 'LIBS = '$(value LIBS)
-
-
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include "ModelImpl.h"
-//#include "DeviceImpl.h"
-#include "SimpleLogger.h"
-#include <stdlib.h>
-#include <time.h>
-#include <cstdlib>
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace Intel {
-namespace CCFL {
-namespace API {
-
-static const char TAG[] = "ModelImpl";
-
-// ============================================================================
-// GetDevicesResult Implementation Class
-// ============================================================================
-class GetDeviceSuccess : public GetDevicesResult {
-public:
- virtual ~GetDeviceSuccess() {}
-
-// ============================================================
-// Public Method(s)
-// ============================================================
-public:
- virtual QueryResultType getResult() const {
- return SUCCESS;
- }
-
- virtual const std::list<Device::SharedPtr>& getDeviceList() const {
- return deviceList_;
- }
-
-public:
- std::list<Device::SharedPtr> deviceList_;
-};
-
-// ============================================================================
-// DeviceEvent Implementation Class
-// ============================================================================
-class DeviceEventSuccess : public DeviceEvent {
-// ============================================================
-// Constructor & Destructor
-// ============================================================
-public:
- DeviceEventSuccess() {
- deviceObserverHandle_ = INVALID_DEVICE_OBSERVER_HANDLE;
- }
- virtual ~DeviceEventSuccess() {}
-
-// ============================================================
-// Public Method(s)
-// ============================================================
-public:
- virtual QueryResultType getResult() const {
- return SUCCESS;
- }
-
- virtual DeviceObserverHandle getObserverHandle() const {
- return deviceObserverHandle_;
- }
-
- virtual const std::list<DeviceEventInfo>& getDeviceIdList() const {
- return deviceInfoList_;
- }
-
-public:
- DeviceObserverHandle deviceObserverHandle_;
- std::list<DeviceEventInfo> deviceInfoList_;
-};
-
-// ============================================================================
-// Model Factory
-// ============================================================================
-Model::SharedPtr Model::createModel() {
- logDebug(TAG, "Entering Model::createModel");
- return ModelImpl::createModel();
-}
-
-ModelImpl::SharedPtr ModelImpl::createModel() {
- // Get singleton of ModelImpl.
- logDebug(TAG, "Entering ModelImpl::createModel");
- static SharedPtr instance = std::make_shared<ModelImpl>();
-
- return instance;
-}
-// ============================================================================
-// Constructors & Destructors
-// ============================================================================
-ModelImpl::ModelImpl() {
- logDebug(TAG, "Entering ModelImpl::ModelImpl");
-
- // initialize random seed for use with random protocol handles
- srand(time(NULL));
-}
-
-ModelImpl::~ModelImpl() {
- logDebug(TAG, "Entering ModelImpl::~ModelImpl");
- protocolMap_.clear();
- deviceList_.clear();
- deviceObserverMap_.clear();
-}
-
-// ============================================================================
-// Public methods
-// ============================================================================
-
-void ModelImpl::getDevices(GetDevicesFunction& asyncReturnFunc) {
- logDebug(TAG, "Entering ModelImpl::getDevices");
-
- mutex_lock_guard lock(deviceListMutex_);
-
- GetDeviceSuccess result;
- // Insert from the model device list to the result device list
- result.deviceList_.insert(result.deviceList_.end(), deviceList_.begin(), deviceList_.end());
-
- // Invoke the callback
- asyncReturnFunc(result);
-}
-
-// Add/remove device observer
-void ModelImpl::removeDeviceObserver(DeviceObserverHandle observerHandle) {
- logDebug(TAG, "Entering ModelImpl::removeDeviceObserver");
-
- mutex_lock_guard lock(deviceObserverMapMutex_);
- for (auto iter = deviceObserverMap_.begin(); iter != deviceObserverMap_.end(); ++iter) {
- if (iter->first == observerHandle) {
- // Remove protocol
- deviceObserverMap_.erase(iter);
- logDebug(TAG, "ModelImpl::removeDeviceObserver, removed observer handle %d", (uint32_t)observerHandle);
- return;
- }
- }
-}
-
-void ModelImpl::setDeviceObserver(DeviceEventFunction& asyncEventFunction) {
- // TODO: anyway to ensure that asyncEventFunction is valid? nullptr check?
- logDebug(TAG, "Entering ModelImpl::setDeviceObserver");
-
- // Create a local scope here so that the mutex will be released at the end of the scope
- {
- mutex_lock_guard lock(deviceObserverMapMutex_);
- // Get a handle that is not already in use
- DeviceObserverHandle observerHandle;
- do {
- observerHandle = generateDeviceObserverHandle();
- } while (isDeviceObserverHandleInUse(observerHandle));
-
- // Add observer to the map.
- // Insert returns a pair with the second a bool set to true if a new element
- // was inserted or false if an equivalent key already existed.
- if (deviceObserverMap_.insert(DeviceObserverMap::value_type(observerHandle, asyncEventFunction)).second) {
- logDebug(TAG, "Entering ModelImpl::setDeviceObserver, observer added");
- }
- else {
- logDebug(TAG, "ModelImpl::setDeviceObserver: Error inserting observer");
- }
- }
-
- // Notify the observers
- DeviceIdList deviceIdList = getDeviceIdList();
- notifyDeviceObservers(DeviceEvent::DeviceChange::DEVICE_CURRENT_COLLECTION, deviceIdList);
-}
-
-const Protocols::Protocol::Handle ModelImpl::registerProtocol(const Protocols::Protocol::SharedPtr& protocol) {
- logDebug(TAG, "Entering ModelImpl::registerProtocol");
-
- // Validate protocol
- assert(protocol);
-
- logDebug(TAG, "ModelImpl::registerProtocol, trying to register protocol %s", protocol->getName().c_str());
-
- // Iterate through map and ensure that the protocol is not already registered
- Protocols::Protocol::Handle handle = Protocols::Protocol::INVALID_HANDLE;
- bool protocolRegistered = false;
-
- mutex_lock_guard lock(protocolMapMutex_);
-
- for (auto iter = protocolMap_.begin(); iter != protocolMap_.end(); ++iter) {
- // TODO: need to handle a protocol that no longer is in scope.
- // Remove from map and maybe notify apps that devices and/or connections are no longer present
- Protocols::Protocol::SharedPtr sharedProtocol = iter->second.lock();
- if (sharedProtocol) {
- if (sharedProtocol->getName() == protocol->getName()) {
- logDebug(TAG, "ModelImpl::registerProtocol, protocol %s already registered", protocol->getName().c_str());
- protocolRegistered = true;
- break;
- }
- }
- }
-
- // If the protocol isn't registered, create a new handle and add
- // the protocol to the map
- if (!protocolRegistered) {
-
- // Get a handle that is not already in use
- do {
- handle = generateProtocolHandle();
- } while (isHandleInUse(handle));
-
- // Add protocol to the map.
- // Insert returns a pair with the second a bool set to true if a new element
- // was inserted or false if an equivalent key already existed.
- Protocols::Protocol::WeakPtr weakProtocol = protocol;
- if (!protocolMap_.insert(ProtocolMap::value_type(handle, weakProtocol)).second) {
- logDebug(TAG, "ModelImpl::registerProtocol: Error inserting protocol %s", protocol->getName().c_str());
- handle = Protocols::Protocol::INVALID_HANDLE;
- }
- else {
- logDebug(TAG, "ModelImpl::registerProtocol: registered protocol = %s", protocol->getName().c_str());
- protocol->setHandle(handle);
- }
- }
-
- return handle;
-}
-
-bool ModelImpl::unregisterProtocol(const Protocols::Protocol::Handle protocolHandle) {
- logDebug(TAG, "Entering ModelImpl::unregisterProtocol");
-
- bool handleFound = false;
-
- mutex_lock_guard lock(protocolMapMutex_);
-
- for (auto iter = protocolMap_.begin(); iter != protocolMap_.end(); ++iter) {
- if (iter->first == protocolHandle) {
- handleFound = true;
- // Remove protocol
- protocolMap_.erase(iter);
- logDebug(TAG, "ModelImpl::unregisterProtocol, unregistering protocol handle %d", (uint32_t)protocolHandle);
- break;
- }
- }
-
- return handleFound;
-}
-
-Device::SharedPtr ModelImpl::getDevice(const UUID_t& deviceId) {
- logDebug(TAG, "Entering ModelImpl::getDevice");
-
- // Get a device from the device list. If the device already exists, return that
- // device. If not, create a new device with the specified device id, add it to
- // the device list, and then return the device
- mutex_lock_guard lock(deviceListMutex_);
- if (deviceList_.empty())
- {
- logDebug(TAG, "ModelImpl::getDevice, device list empty, adding device");
- return addDeviceToList(deviceId);
- }
-
- // Search list for the device based on device id
- for (auto iter = deviceList_.begin(); iter != deviceList_.end(); ++iter) {
- Device::SharedPtr device = *iter;
- if (device->getId() == deviceId) {
- logDebug(TAG, "ModelImpl::getDevice, device found in list");
- return device;
- }
- }
-
- // If here, device not found in list, so add and return
- logDebug(TAG, "ModelImpl::getDevice, device not found in list, adding device");
- return addDeviceToList(deviceId);
-}
-
-void ModelImpl::signalDeviceChange(const UUID_t& deviceId, DeviceEvent::DeviceChange deviceEvent) {
-
- uint32_t linkCount;
- DeviceIdList deviceIdList;
- bool sendNotification = false;
-
- // Create a local scope so that the deviceListMutex_ will be released at the end
- // of the local scope
- {
- mutex_lock_guard lock(deviceListMutex_);
- // Search list for the device based on device id
- for (auto iter = deviceList_.begin(); iter != deviceList_.end(); ++iter) {
- Device::SharedPtr device = *iter;
- if (device->getId() == deviceId) {
- linkCount = device->getLinkCount();
- logDebug(TAG, "ModelImpl::signalDeviceChange, device found, number of links = %d", linkCount);
-
- if (deviceEvent == DeviceEvent::DeviceChange::DEVICE_ADDED) {
- // If DEVICE_ADDED and only one link, then that indicates that this is the first
- // time that the device was found by a protocol, so a notification must be sent.
- // Multiple links in the device indicate that that the device was previously found
- // by other protocols, so a notification is not required
- if (linkCount == 1) {
- deviceIdList.push_back(deviceId);
- sendNotification = true;
- }
- }
- else if (deviceEvent == DeviceEvent::DeviceChange::DEVICE_REMOVED) {
- // If DEVICE_REMOVED and no links remain in the device, then the
- // device needs to be removed from the device list and
- // a device removal notification must be sent.
- if (linkCount == 0) {
- deviceIdList.push_back(deviceId);
- deviceList_.erase(iter);
- sendNotification = true;
- }
- }
- break;
- }
- }
- }
-
- // Since a device was added or removed, notify the device observers
- if (sendNotification) {
- notifyDeviceObservers(deviceEvent, deviceIdList);
- }
-}
-
-// ============================================================================
-// Private methods
-// ============================================================================
-const Protocols::Protocol::Handle ModelImpl::generateProtocolHandle() {
- // Handle between 1 and (RAND_MAX -1)
- Protocols::Protocol::Handle handle = (Protocols::Protocol::Handle)(rand() % (RAND_MAX - 1) + 1);
-
- return handle;
-}
-
-bool ModelImpl::isHandleInUse(Protocols::Protocol::Handle handle) {
- bool handleFound = false;
-
- for (auto iter = protocolMap_.begin(); iter != protocolMap_.end(); ++iter) {
- if (iter->first == handle) {
- handleFound = true;
- break;
- }
- }
- return handleFound;
-}
-
-Device::SharedPtr ModelImpl::addDeviceToList(const UUID_t& deviceId) {
- logDebug(TAG, "Entering ModelImpl::addDeviceToList");
-
- deviceList_.push_back(std::make_shared<Device>(deviceId));
- return deviceList_.back();
-}
-
-DeviceObserverHandle ModelImpl::generateDeviceObserverHandle() {
- // Handle between 1 and (RAND_MAX -1)
- DeviceObserverHandle handle = (DeviceObserverHandle)(rand() % (RAND_MAX - 1) + 1);
-
- return handle;
-}
-
-bool ModelImpl::isDeviceObserverHandleInUse(DeviceObserverHandle observerHandle) {
- bool handleFound = false;
-
- for (auto iter = deviceObserverMap_.begin(); iter != deviceObserverMap_.end(); ++iter) {
- if (iter->first == observerHandle) {
- handleFound = true;
- break;
- }
- }
- return handleFound;
-}
-
-void ModelImpl::notifyDeviceObservers(DeviceEvent::DeviceChange event, const DeviceIdList& deviceIdList) {
- logDebug(TAG, "Entering ModelImpl::notifyDeviceObservers");
-
- // Iterate through the device id list that was passed to the notifier
- // and create a list of DeviceEvent::DeviceEventInfo objects.
- // Set the device id and the event in the DeviceEvent::DeviceEventInfo object
- std::list<DeviceEvent::DeviceEventInfo> deviceEventInfoList;
- DeviceEvent::DeviceEventInfo info;
- for (auto iter = deviceIdList.begin(); iter != deviceIdList.end(); ++iter) {
- info.deviceId = *iter;
- info.deviceChange = event;
-
- deviceEventInfoList.push_back(info);
- }
-
- mutex_lock_guard lock(deviceObserverMapMutex_);
-
- // Nothing to do if there are no observers
- if (deviceObserverMap_.empty()) {
- return;
- }
-
- DeviceObserverHandle observerHandle;
- DeviceEventFunction eventFunction;
-
- // For every observer in the observer map:
- for (auto iter = deviceObserverMap_.begin(); iter != deviceObserverMap_.end(); ++iter) {
- observerHandle = iter->first;
- eventFunction = iter->second;
-
- // 1. Create a DeviceEventSuccess object and set the observer handle
- DeviceEventSuccess deviceEventSuccess;
- deviceEventSuccess.deviceObserverHandle_ = observerHandle;
-
- // 2. Insert the deviceEventInfoList into the DeviceEventSuccess object list
- deviceEventSuccess.deviceInfoList_.insert(deviceEventSuccess.deviceInfoList_.end(), deviceEventInfoList.begin(), deviceEventInfoList.end());
-
- // 3. Invoke the observer's callback function
- eventFunction(deviceEventSuccess);
- }
-
-}
-
-ModelImpl::DeviceIdList ModelImpl::getDeviceIdList() {
-
- mutex_lock_guard lock(deviceListMutex_);
-
- DeviceIdList deviceIdList;
-
- // Search list for the device based on device id
- for (auto iter = deviceList_.begin(); iter != deviceList_.end(); ++iter) {
- Device::SharedPtr device = *iter;
- deviceIdList.push_back(device->getId());
- }
-
- return deviceIdList;
-}
-
-}
-}
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef MODELIMPL_H_
-#define MODELIMPL_H_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <memory>
-#include <map>
-#include <list>
-#include <stdint.h>
-
-#include "Protocol.hpp"
-#include "UUIDLess.hpp"
-#include "InternalApi.h"
-#include "Core.h"
-
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace Intel {
-namespace CCFL {
-namespace API {
-
-class ModelImpl : public Model
-{
-public:
- typedef std::shared_ptr<ModelImpl> SharedPtr;
- typedef std::weak_ptr<ModelImpl> WeakPtr;
-
-public:
- // Factory
- static SharedPtr createModel();
-
-public:
- // Constructor & Destructor
- ModelImpl();
- virtual ~ModelImpl();
-
- // Get the device list
- virtual void getDevices(GetDevicesFunction& asyncReturnFunc);
-
- // Add/remove device observer
- virtual void removeDeviceObserver(DeviceObserverHandle observerHandle);
- virtual void setDeviceObserver(DeviceEventFunction& asyncEventFunction);
-
- // Register/unregister a protocol
- virtual const Protocols::Protocol::Handle registerProtocol(const Protocols::Protocol::SharedPtr& protocol);
- virtual bool unregisterProtocol(const Protocols::Protocol::Handle protocolHandle);
- virtual Device::SharedPtr getDevice(const UUID_t& deviceId);
- virtual void signalDeviceChange(const UUID_t& deviceId, DeviceEvent::DeviceChange deviceEvent);
-
-private:
- typedef std::map<Protocols::Protocol::Handle, Protocols::Protocol::WeakPtr> ProtocolMap;
- typedef std::list<Device::SharedPtr> DeviceList;
- typedef std::map<DeviceObserverHandle, DeviceEventFunction> DeviceObserverMap;
- typedef std::list<UUID_t> DeviceIdList;
-private:
- const Protocols::Protocol::Handle generateProtocolHandle();
- bool isHandleInUse(Protocols::Protocol::Handle handle);
- Device::SharedPtr addDeviceToList(const UUID_t& deviceId);
-
- DeviceObserverHandle generateDeviceObserverHandle();
- bool isDeviceObserverHandleInUse(DeviceObserverHandle observerHandle);
- DeviceIdList getDeviceIdList();
- void notifyDeviceObservers(DeviceEvent::DeviceChange event, const DeviceIdList& deviceIdList);
-
-private:
- ProtocolMap protocolMap_;
- DeviceList deviceList_;
- DeviceObserverMap deviceObserverMap_;
-
- mutex protocolMapMutex_;
- mutex deviceListMutex_;
- mutex deviceObserverMapMutex_;
-};
-
-}
-}
-}
-#endif /* MODELIMPL_H_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-//#include <iostream>
-#include <string.h>
-#include <stdint.h>
-
-#ifdef __linux__
- #include <thread>
- #include <pthread.h>
- #include <chrono>
-#endif
-
-
-#include <functional>
-#include "InternalApi.h"
-#include "SimpleLogger.h"
-#include "MockProtocol.h"
-#include "Core.h"
-#include "Description.hpp"
-
-#include <boost/uuid/uuid.hpp>
-#include <boost/uuid/uuid_generators.hpp>
-#include <boost/uuid/uuid_io.hpp>
-
-const std::string MOCK_DEVICE_ID0 = "7c34ad16-ae8c-415b-94cc-d8053f4f9f8e";
-const std::string MOCK_DEVICE_ID1 = "646344d0-271c-49dd-8b13-3a7bec1237bd";
-const std::string MOCK_DEVICE_ID2 = "74c406ca-1cfb-4106-a82f-6123e3fe3555";
-
-static const char TAG[] = "CCFL-CoreTest.cpp";
-
-UUID_t toUuid(const std::string& uuidStr) {
- boost::uuids::string_generator gen;
- return gen(uuidStr);
-}
-
-using namespace std;
-
-void setPropertyAsync(const Intel::CCFL::API::PropertySetResult& result) {
- Intel::CCFL::logDebug(TAG, "\t********entering main::setPropertyAsync********");
- if (result.getResult() == Intel::CCFL::API::QueryResultType::SUCCESS) {
- Intel::CCFL::logDebug(TAG, "\t QueryResultType::SUCCESS");
- Intel::CCFL::logDebug(TAG, "\t property:");
- Intel::CCFL::logDebug(TAG, "\t\t name = %s", result.getName().c_str());
- Intel::CCFL::logDebug(TAG, "\t\t value = %s", result.getValue().c_str());
- }
- Intel::CCFL::logDebug(TAG, "\t********leaving main::setPropertyAsync********");
-}
-
-void getPropertyAsync(const Intel::CCFL::API::PropertyGetResult& result) {
- Intel::CCFL::logDebug(TAG, "\t********entering main::getPropertyAsync********");
- if (result.getResult() == Intel::CCFL::API::QueryResultType::SUCCESS) {
- Intel::CCFL::logDebug(TAG, "\t QueryResultType::SUCCESS");
- Intel::CCFL::logDebug(TAG, "\t property:");
- Intel::CCFL::logDebug(TAG, "\t\t name = %s", result.getName().c_str());
- Intel::CCFL::logDebug(TAG, "\t\t value = %s", result.getValue().c_str());
- }
- Intel::CCFL::logDebug(TAG, "\t********leaving main::getPropertyAsync********");
-}
-
-void getDescriptionAsync(const Intel::CCFL::API::DescriptionGetResult& result) {
- Intel::CCFL::logDebug(TAG, "\t********entering main::getDescriptionAsync********");
-
- if (result.getResult() == Intel::CCFL::API::QueryResultType::SUCCESS) {
- Intel::CCFL::logDebug(TAG, "\t QueryResultType::SUCCESS");
- std::set<Intel::CCFL::API::Service::SharedPtr> serviceSet = result.getServices();
-
- for (auto iter = serviceSet.begin(); iter != serviceSet.end(); ++iter) {
- Intel::CCFL::API::Service::WeakPtr serviceWeak = *iter;
- Intel::CCFL::API::Service::SharedPtr service = serviceWeak.lock();
- if (service) {
- Intel::CCFL::logDebug(TAG, "\t service = %s", service->getName().c_str());
-
- std::set<Intel::CCFL::API::Characteristic::SharedPtr> characteristicSet = service->getCharacteristics();
- for (auto iter = characteristicSet.begin(); iter != characteristicSet.end(); ++iter) {
- Intel::CCFL::API::Characteristic::WeakPtr characteristicWeak = *iter;
- Intel::CCFL::API::Characteristic::SharedPtr characteristic = characteristicWeak.lock();
- if (characteristic) {
- Intel::CCFL::logDebug(TAG, "\t\t characteristic = %s", characteristic->getName().c_str());
- Intel::CCFL::logDebug(TAG, "\t\t readable = %d", characteristic->isReadable());
- Intel::CCFL::logDebug(TAG, "\t\t writable = %d", characteristic->isWritable());
- Intel::CCFL::logDebug(TAG, "\t\t constant = %d", characteristic->isConstant());
- }
- }
- }
- }
- }
- Intel::CCFL::logDebug(TAG, "\t********leaving main::getDescriptionAsync********");
-}
-
-void getDevicesAsync(const Intel::CCFL::API::GetDevicesResult& result) {
- Intel::CCFL::logDebug(TAG, "Entering main::getDevicesAsync");
-
- if (result.getResult() == Intel::CCFL::API::QueryResultType::SUCCESS) {
- Intel::CCFL::logDebug(TAG, "main::getDevicesAsync, QueryResultType::SUCCESS");
- std::list<Intel::CCFL::API::Device::SharedPtr> deviceList = result.getDeviceList();
- // Search list for the device based on device id
- if (deviceList.size() > 0) {
- for (auto iter = deviceList.begin(); iter != deviceList.end(); ++iter) {
- Intel::CCFL::API::Device::WeakPtr deviceWeak = *iter;
- Intel::CCFL::API::Device::SharedPtr device = deviceWeak.lock();
- if (device) {
- Intel::CCFL::logDebug(TAG, "\tDevice:");
- Intel::CCFL::logDebug(TAG, "\t name = %s", device->getName().c_str());
- Intel::CCFL::logDebug(TAG, "\t UUID = %s", to_string(device->getId()).c_str());
-
- // Test characteristic stuff
- if (device->getName() == "MockDevice0") {
- if (device->getLinkCount() > 0) {
- Intel::CCFL::API::Device::LinkList linkList = device->getLinks();
- Intel::CCFL::API::Link::WeakPtr linkWeak = linkList.front();
- Intel::CCFL::API::Link::SharedPtr linkShared = linkWeak.lock();
- if (linkShared) {
- // Test set/get properties
- Intel::CCFL::API::DescriptionGetFunction descriptionGetFunction = getDescriptionAsync;
- linkShared->getDescription(descriptionGetFunction);
- Intel::CCFL::API::PropertyGetFunction propertyGetFunction = getPropertyAsync;
- linkShared->getProperty("CHARACTERISTIC_0", propertyGetFunction);
- linkShared->getProperty("CHARACTERISTIC_1", propertyGetFunction);
-
- Intel::CCFL::API::PropertySetFunction propertySetFunction = setPropertyAsync;
- linkShared->setProperty("CHARACTERISTIC_0", "new_CHARACTERISTIC_0_Value", propertySetFunction);
- linkShared->setProperty("CHARACTERISTIC_1", "new_CHARACTERISTIC_1_Value", propertySetFunction);
-
- linkShared->getProperty("CHARACTERISTIC_0", propertyGetFunction);
- linkShared->getProperty("CHARACTERISTIC_1", propertyGetFunction);
- }
- }
- }
- }
- }
- }
- else {
- Intel::CCFL::logDebug(TAG, "\t No devices found");
- }
- }
-}
-
-#ifdef __ANDROID__
- int android_jni_entry() {
-#elif defined __linux__
- int main() {
-#endif
-
- Intel::CCFL::logDebug(TAG, "Starting CCFL Core Test");
-
- // Create MockProtocols. Two are created to make sure that multiples are registered and unregistered correctly
- std::shared_ptr<Intel::CCFL::Protocols::MockProtocol> mockProtocol = std::make_shared<Intel::CCFL::Protocols::MockProtocol>();
- mockProtocol->setName("MockProtocol");
-
- // Get a model from the CCFL API so that we can access the API interface
- Intel::CCFL::API::Model::WeakPtr modelWeak = Intel::CCFL::API::Model::createModel();
- Intel::CCFL::API::Model::SharedPtr modelShared = modelWeak.lock();
- if (modelShared) {
-
- mockProtocol->setModel(modelShared);
-
- // Register the MockProtocol
- Intel::CCFL::Protocols::Protocol::Handle handle;
- handle = modelShared->registerProtocol(mockProtocol);
- Intel::CCFL::logDebug(TAG, "Protocol %s handle = %d", mockProtocol->getName().c_str(), (uint32_t)handle);
-
- Intel::CCFL::API::GetDevicesFunction deviceFunc = getDevicesAsync;
- modelShared->getDevices(deviceFunc);
-
- mockProtocol->testAddDevice(toUuid(MOCK_DEVICE_ID0), "MockDevice0");
- modelShared->getDevices(deviceFunc);
-
- Intel::CCFL::API::DeviceEventFunction deviceEventLambda = [](const Intel::CCFL::API::DeviceEvent& result)->void {
- Intel::CCFL::logDebug(TAG, "main::deviceEventAsyncLambda");
- if (result.getResult() == Intel::CCFL::API::QueryResultType::SUCCESS) {
- Intel::CCFL::API::DeviceObserverHandle handle = result.getObserverHandle();
- Intel::CCFL::logDebug(TAG, "main::deviceEventAsyncLambda, observer handle = %ld", (uint32_t)handle);
- std::list<Intel::CCFL::API::DeviceEvent::DeviceEventInfo> infoList = result.getDeviceIdList();
- for (auto iter = infoList.begin(); iter != infoList.end(); ++iter) {
- Intel::CCFL::API::DeviceEvent::DeviceEventInfo info = *iter;
- Intel::CCFL::logDebug(TAG, "\t Device UUID = %s", to_string(info.deviceId).c_str());
- switch (info.deviceChange) {
- case Intel::CCFL::API::DeviceEvent::DeviceChange::DEVICE_CURRENT_COLLECTION:
- Intel::CCFL::logDebug(TAG, "\t Event = DEVICE_CURRENT_COLLECTION");
- break;
- case Intel::CCFL::API::DeviceEvent::DeviceChange::DEVICE_ADDED:
- Intel::CCFL::logDebug(TAG, "\t Event = DEVICE_ADDED");
- break;
- case Intel::CCFL::API::DeviceEvent::DeviceChange::DEVICE_REMOVED:
- Intel::CCFL::logDebug(TAG, "\t Event = DEVICE_REMOVED");
- break;
- default:
- Intel::CCFL::logDebug(TAG, "\t Event = unknown");
- break;
- }
- }
- }
- };
- modelShared->setDeviceObserver(deviceEventLambda);
-
- mockProtocol->testAddDevice(toUuid(MOCK_DEVICE_ID1), "MockDevice1");
- modelShared->getDevices(deviceFunc);
- mockProtocol->testAddDevice(toUuid(MOCK_DEVICE_ID2), "MockDevice2");
- modelShared->getDevices(deviceFunc);
- mockProtocol->testRemoveDevice(toUuid(MOCK_DEVICE_ID0));
- modelShared->getDevices(deviceFunc);
-
- Intel::CCFL::logDebug(TAG, "Sleep for 5 sec");
- std::this_thread::sleep_for(std::chrono::seconds(5));
- modelShared->unregisterProtocol(handle);
- Intel::CCFL::logDebug(TAG, "Sleep for 5 sec");
- }
-
-
- Intel::CCFL::logDebug(TAG, "Exiting CCFL Core Test");
- return 0;
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include "MockProtocol.h"
-#include "SimpleLogger.h"
-#include "InternalApi.h"
-#include "Link.hpp"
-#include "Description.hpp"
-#include "Service.hpp"
-#include "Characteristic.hpp"
-#include <set>
-
-#include <boost/uuid/uuid.hpp>
-#include <boost/uuid/uuid_generators.hpp>
-#include <boost/uuid/uuid_io.hpp>
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace Intel {
-namespace CCFL {
-namespace Protocols {
-
-static const char TAG[] = "MockProtocol";
-
-const std::string MockProtocol::MOCK_DEVICE_ID = "7c34ad16-ae8c-415b-94cc-d8053f4f9f8e";
-static std::string characteristic0Value = "CHARACTERISTIC_0_VALUE";
-
-// ============================================================================
-// PropertyGetResult Implementation Class
-// ============================================================================
-class PropertyGetResultImpl : public API::PropertyGetResult {
-public:
- PropertyGetResultImpl() {
- name_ = "";
- value_ = "";
- }
- virtual ~PropertyGetResultImpl() {}
-
-public:
- virtual API::QueryResultType getResult() const {
- return API::QueryResultType::SUCCESS;
- }
-
- virtual const std::string& getName() const {
- return name_;
- }
-
- virtual const std::string& getValue() const {
- return value_;
- }
-
-public:
- std::string name_;
- std::string value_;
-};
-
-// ============================================================================
-// PropertySetResult Implementation Class
-// ============================================================================
-class PropertySetResultImpl : public API::PropertySetResult {
-public:
- PropertySetResultImpl() {
- name_ = "";
- value_ = "";
- }
- virtual ~PropertySetResultImpl() {}
-
-public:
- virtual API::QueryResultType getResult() const {
- return API::QueryResultType::SUCCESS;
- }
-
- virtual const std::string& getName() const {
- return name_;
- }
-
- virtual const std::string& getValue() const {
- return value_;
- }
-
-public:
- std::string name_;
- std::string value_;
-
-};
-
-// ============================================================================
-// Characteristic Implementation Class
-// ============================================================================
-class CharacteristicImpl : public API::Characteristic {
-public:
- CharacteristicImpl() {
- name_ = "";
- isReadable_ = true;
- isWritable_ = true;
- isConstant_ = false;
- }
- virtual ~CharacteristicImpl() {}
-
-public:
- virtual const std::string& getName() const {
- return name_;
- }
- virtual bool isReadable() const {
- return isReadable_;
- }
- virtual bool isWritable() const {
- return isWritable_;
- }
- virtual bool isConstant() const {
- return isConstant_;
- }
-
-public:
- std::string name_;
- bool isReadable_;
- bool isWritable_;
- bool isConstant_;
-};
-
-// ============================================================================
-// Service Implementation Class
-// ============================================================================
-class ServiceImpl : public API::Service {
-public:
- ServiceImpl() {
- name_ = "";
- }
-
- virtual ~ServiceImpl() {}
-
-public:
-
- virtual const std::string& getName() const {
- return name_;
- }
-
- virtual const std::set<API::Characteristic::SharedPtr>& getCharacteristics() const {
- return characteristicSet_;
- }
-public:
- std::string name_;
- std::set<API::Characteristic::SharedPtr> characteristicSet_;
-};
-// ============================================================================
-// DescriptionGetResult Implementation Class
-// ============================================================================
-class DescriptionGetResultImpl : public API::DescriptionGetResult {
-public:
- virtual ~DescriptionGetResultImpl() {}
-
-public:
- virtual API::QueryResultType getResult() const {
- return API::QueryResultType::SUCCESS;
- };
-
- virtual const std::set<API::Service::SharedPtr>& getServices() const {
- return serviceSet_;
- }
-
-public:
- std::set<API::Service::SharedPtr> serviceSet_;
-};
-
-// ============================================================================
-// RegisteredSetPropFunction
-// ============================================================================
-void setPropertyFunction(const std::string& propertyName, const std::string& propertyValue, const API::PropertySetFunction& asyncReturnFunc) {
- logDebug(TAG, "Entering MockProtocol::setPropertyFunction");
-
- PropertySetResultImpl result;
-
- if (propertyName == "CHARACTERISTIC_0") {
- // CHARACTERISTIC_0 is read/write, non-constant, so allow it to be set to new value
- result.name_ = "CHARACTERISTIC_0";
- characteristic0Value = propertyValue;
- result.value_ = characteristic0Value;
- }
- else if (propertyName == "CHARACTERISTIC_1") {
- // CHARACTERISTIC_1 is constant, so ignore new value
- result.name_ = "CHARACTERISTIC_1";
- result.value_ = "CHARACTERISTIC_1_VALUE";
- }
-
- asyncReturnFunc(result);
-}
-// ============================================================================
-// RegisteredGetPropFunction
-// ============================================================================
-void getPropertyFunction(const std::string& propertyName, const API::PropertyGetFunction& asyncReturnFunc) {
- logDebug(TAG, "Entering MockProtocol::getPropertyFunction");
-
- PropertyGetResultImpl result;
-
- if (propertyName == "CHARACTERISTIC_0") {
- result.name_ = "CHARACTERISTIC_0";
- result.value_ = characteristic0Value;
- }
- else if (propertyName == "CHARACTERISTIC_1") {
- result.name_ = "CHARACTERISTIC_1";
- result.value_ = "CHARACTERISTIC_1_VALUE";
- }
-
- asyncReturnFunc(result);
-}
-
-// ============================================================================
-// RegisteredGetDescriptionFunction
-// ============================================================================
-void getDescriptionFunction(const API::DescriptionGetFunction& asyncReturnFunc) {
- logDebug(TAG, "Entering MockProtocol::getDescriptionFunction");
-
- DescriptionGetResultImpl result;
-
- std::shared_ptr<ServiceImpl> service = std::make_shared<ServiceImpl>();
- if (service) {
- service->name_ = "SERVICE_A";
- std::shared_ptr<CharacteristicImpl> characteristic0 = std::make_shared<CharacteristicImpl>();
- if (characteristic0) {
- characteristic0->name_ = "CHARACTERISTIC_0";
- service->characteristicSet_.insert(characteristic0);
- }
- std::shared_ptr<CharacteristicImpl> characteristic1 = std::make_shared<CharacteristicImpl>();
- if (characteristic1) {
- characteristic1->name_ = "CHARACTERISTIC_1";
- characteristic1->isReadable_ = true;
- characteristic1->isWritable_ = false;
- characteristic1->isConstant_ = true;
-
- service->characteristicSet_.insert(characteristic1);
- }
-
- result.serviceSet_.insert(service);
- }
-
-
- // Invoke the callback
- asyncReturnFunc(result);
-}
-
-// ============================================================================
-// Class
-// ============================================================================
-MockProtocol::MockProtocol()
-{
- logDebug(TAG, "Entering MockProtocol::MockProtocol");
-
- name_ = "Mock Protocol";
- handle_ = Protocol::INVALID_HANDLE;
-}
-
-MockProtocol::~MockProtocol()
-{
- logDebug(TAG, "Entering MockProtocol::~MockProtocol");
-}
-
-void MockProtocol::setModel(const std::shared_ptr<Intel::CCFL::API::Model>& model) {
- logDebug(TAG, "Entering MockProtocol::setModel");
- model_ = model;
-}
-
-const Intel::CCFL::Protocols::Protocol::Handle MockProtocol::getHandle() {
- logDebug(TAG, "Entering MockProtocol::getHandle");
- return 0;
-}
-
-void MockProtocol::setHandle(const Handle handle) {
- logDebug(TAG, "Entering MockProtocol::setHandle");
- handle_ = handle;
-}
-
-const std::string& MockProtocol::getName() {
-// logDebug(TAG, "Entering MockProtocol::getName");
- return name_;
-}
-
-void MockProtocol::setName(const std::string& name)
-{
- logDebug(TAG, "Entering MockProtocol::setName, name = %s", name.c_str());
- name_ = name;
-}
-
-void MockProtocol::forceDeviceDiscovery() {
- logDebug(TAG, "Entering MockProtocol::forceDeviceDiscovery");
-}
-
-// Test interface
-void MockProtocol::testAddDevice(const UUID_t& deviceId, const std::string deviceName) {
- logDebug(TAG, "Entering MockProtocol::testAddDevice, device name = %s, device UUID = %s", deviceName.c_str(), to_string(deviceId).c_str());
-
- std::shared_ptr<API::Model> sharedModel = model_.lock();
- if (sharedModel) {
- API::Device::SharedPtr device = sharedModel->getDevice(deviceId);
- if (device) {
- device->setName(deviceName);
- // Add a link to the device
- API::Link::SharedPtr link = std::make_shared<API::Link>();
-
- // Register property functions for the link
- API::Link::RegisteredGetDescriptionFunction regGetDescriptionFunction = getDescriptionFunction;
- link->registerGetDescriptionFunction(regGetDescriptionFunction);
- API::Link::RegisteredGetPropFunction regGetPropFunction = getPropertyFunction;
- link->registerGetPropertyFunction(regGetPropFunction);
- API::Link::RegisteredSetPropFunction regSetPropFunction = setPropertyFunction;
- link->registerSetPropertyFunction(regSetPropFunction);
-
- // Add the link to the device and signal the model that the device changed
- device->addLink(link);
- sharedModel->signalDeviceChange(deviceId, API::DeviceEvent::DeviceChange::DEVICE_ADDED);
- }
- }
-}
-
-void MockProtocol::testRemoveDevice(const UUID_t& deviceId) {
- logDebug(TAG, "Entering MockProtocol::testRemoveDevice, device UUID = %s", to_string(deviceId).c_str());
-
- std::shared_ptr<API::Model> sharedModel = model_.lock();
- if (sharedModel) {
- API::Device::SharedPtr device = sharedModel->getDevice(deviceId);
- if (device) {
- // Remove the link
- uint32_t linkCnt = device->getLinkCount();
- logDebug(TAG, "MockProtocol::testRemoveDevice, link count = %d", linkCnt);
- if (linkCnt > 0) {
- API::Device::LinkList linkList = device->getLinks();
- API::Link::SharedPtr link = linkList.front();
- if (link) {
- logDebug(TAG, "MockProtocol::testRemoveDevice, removing link");
- if (device->removeLink(link)) {
- logDebug(TAG, "MockProtocol::testRemoveDevice, link removed, signaling device change");
- sharedModel->signalDeviceChange(deviceId, API::DeviceEvent::DeviceChange::DEVICE_REMOVED);
- }
- }
- }
- }
- }
-}
-
-}
-}
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef MOCKPROTOCOL_H_
-#define MOCKPROTOCOL_H_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <memory>
-#include <string>
-#include <functional>
-#include "Protocol.hpp"
-#include "Core.h"
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace Intel {
-namespace CCFL {
-namespace Protocols {
-
-// ============================================================================
-// Class
-// ============================================================================
-class MockProtocol : public Protocol
-{
-public:
- MockProtocol();
- virtual ~MockProtocol();
-public:
- virtual void setModel(const std::shared_ptr<Intel::CCFL::API::Model>& model);
- virtual const Handle getHandle();
- virtual void setHandle(const Handle handle);
- virtual const std::string& getName();
- virtual void setName(const std::string& name);
- virtual void forceDeviceDiscovery();
-
-private:
- std::string name_;
- Handle handle_;
- std::weak_ptr<API::Model> model_;
-
-// Test interface
-public:
- void testAddDevice(const UUID_t& deviceId, const std::string deviceName);
- void testRemoveDevice(const UUID_t& deviceId);
-private:
- static const std::string MOCK_DEVICE_ID;
-
-};
-
-
-}
-}
-}
-
-#endif /* MOCKPROTOCOL_H_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include "LiteConnection.h"
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace remoting {
-
- // ============================================================================
- // Constructor/Destructor
- // ============================================================================
- //---------------------------------------------------------------------------
- // Constructor
- //---------------------------------------------------------------------------
- LiteConnection::LiteConnection(int socket) : socket_(socket)
- {
-
- }
-
- //---------------------------------------------------------------------------
- // Destructor
- //---------------------------------------------------------------------------
- LiteConnection::~LiteConnection()
- {
- }
-
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef LITECONNECTION_H_
-#define LITECONNECTION_H_
-
-// ============================================================================
-// Includes
-// ============================================================================
-
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace remoting {
-
- // ==========================================================================
- // Class
- // ==========================================================================
-
- class LiteConnection {
- public:
- // TODO: socket parameter is faked with an int for now until I know how the connection info will be conveyed
- LiteConnection(int socket);
- virtual ~LiteConnection();
-
- private:
- int socket_;
- };
-
-}
-
-#endif /* LITECONNECTION_H_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include "LiteRemoting.h"
-
-#include <boost/make_shared.hpp>
-#include <boost/bind.hpp>
-#include <functional>
-#include <stdexcept>
-
-#ifdef DEBUG
-#include <android/log.h>
-#endif
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace remoting {
-
- // ============================================================================
- // Macros
- // ============================================================================
- // TODO: Need application ID for Remoting
- const std::string LiteRemoting::APPLICATION_UUID_STRING = "7A1B397B-B576-44C4-943F-000000000001";
-
-// ============================================================================
-// Macros
-// ============================================================================
-#ifdef DEBUG
- #define LOG_PRINT(X) __android_log_print(ANDROID_LOG_VERBOSE, "LiteRemoting", (X));
-#else
- #define LOG_PRINT(X)
-#endif
-
-// ============================================================================
-// Constructor/Destructor/getInstance
-// ============================================================================
- //---------------------------------------------------------------------------
- // Constructor
- // Called by getInstance method (Singleton patter)
- //---------------------------------------------------------------------------
- LiteRemoting::LiteRemoting(PrivateConstructKey key) {
-
- apiResultReady_ = false;
-
-// public static final String applicationId = "7A1B397B-B576-44C4-943F-000000000001";
-// public static final UUID applicationUUID = UUID.fromString(applicationId);
-
- // Begin CCF API interaction
- pCCFService_ = API::Service::createService();
- if (pCCFService_)
- {
- pCCFService_->registerApplication();
-
- UUID_t applicationId;
- StringToUuid(APPLICATION_UUID_STRING.c_str(), &applicationId);
-
- pCCFContext_ = pCCFService_->createContext(applicationId);
-
- if (pCCFContext_)
- {
- doStartup();
- }
- }
- }
-
- //---------------------------------------------------------------------------
- // Destructor
- //---------------------------------------------------------------------------
- LiteRemoting::~LiteRemoting() {
- // Empty containers
- sessionMap_.clear();
- targetDeviceProxyMap_.clear();
-
- // Turn off observer callbacks
- pCCFContext_->setSessionObserver();
- pCCFContext_->setUserObserver();
-
- // CCF APP interaction
- if (pCCFService_)
- {
- pCCFService_->deregisterApplication();
- }
- }
-
- //---------------------------------------------------------------------------
- // getInstance (Singleton pattern
- //---------------------------------------------------------------------------
- // Get singleton instance of LiteRemoting
- boost::shared_ptr<LiteRemoting> LiteRemoting::getInstance() {
- LOG_PRINT("LiteRemoting::getInstance()");
-
- static boost::shared_ptr<LiteRemoting> instance = boost::make_shared<LiteRemoting>(PrivateConstructKey());
-
- return instance;
- }
-
-// ============================================================================
-// Methods
-// ============================================================================
- void LiteRemoting::doStartup() {
-
- // Get the local session id
- boost::unique_lock<boost::mutex> lock(mutex_);
- queryMySessionId();
- while (!apiResultReady_)
- {
- // TODO: maybe do cond_.timed_wait() ???
- cond_.wait(lock);
- }
-
- // Get local session info
- lock.lock();
- queryMySessionInfo();
- while (!apiResultReady_)
- {
- // TODO: maybe do cond_.timed_wait() ???
- cond_.wait(lock);
- }
-
- // Now that we have local session info, set the session observer
- pCCFContext_->setSessionObserver(boost::bind(&LiteRemoting::sessionObserver, this, _1));
-
- // TODO: set up connection observer
-
- // TODO: set up device observer
-
- }
-
- void LiteRemoting::addSessionToMap(UUID_t sessionId) {
- // Add session to the sessionMap
- auto iter = sessionMap_.find(sessionId);
- if (iter == sessionMap_.end() )
- {
- // sessionUUID not found, so add session
- sessionMap_[sessionId] = boost::make_shared<LiteSessionImpl>(pCCFContext_, sessionId);
- }
- }
-
- boost::shared_ptr<LiteSessionImpl> LiteRemoting::getSessionFromMap(UUID_t sessionId) {
- boost::shared_ptr<LiteSessionImpl> pSession;
- try {
- pSession = sessionMap_.at(sessionId);
- }
- catch (const std::out_of_range& oor) {
- // sessionId not found, so add session
- sessionMap_[sessionId] = boost::make_shared<LiteSessionImpl>(pCCFContext_, sessionId);
- }
-
- return sessionMap_[sessionId];
- }
-
- void LiteRemoting::addTargetDeviceToMap(UUID_t targetDeviceId) {
- // A LiteTargetDeviceProxy with this targetDeviceId was not found, so add
- // Add target device to the targetDeviceProxyMap_
- auto iter = targetDeviceProxyMap_.find(targetDeviceId);
- if (iter == targetDeviceProxyMap_.end() )
- {
- // targetDeviceId not found, so add session
- targetDeviceProxyMap_[targetDeviceId] = boost::make_shared<LiteTargetDeviceProxy>(targetDeviceId);
- }
-
- }
-
- boost::shared_ptr<LiteTargetDeviceProxy> LiteRemoting::getTargetDeviceFromMap(UUID_t targetDeviceId) {
- boost::shared_ptr<LiteTargetDeviceProxy> pTargetDevice;
- try {
- pTargetDevice = targetDeviceProxyMap_.at(targetDeviceId);
- }
- catch (const std::out_of_range& oor) {
- // sessionId not found, so add session
- targetDeviceProxyMap_[targetDeviceId] = boost::make_shared<LiteTargetDeviceProxy>(targetDeviceId);
- }
-
- return targetDeviceProxyMap_[targetDeviceId];
-
- }
-
- void LiteRemoting::handleNewTargetDevice(UUID_t targetDeviceId) {
- addTargetDeviceToMap(targetDeviceId);
- //session.sendDeviceArrival(device);
- }
-
- // TODO: socket parameter is faked with an int for now until I know how the connection info will be conveyed
- void LiteRemoting::handleNewConnection(UUID_t sessionId, int socket) {
- // Validate socket
- if (socket == 0) {
- return;
- }
-
- // Get the specified session and a new connection
- boost::shared_ptr<LiteSessionImpl> pSession = getSessionFromMap(sessionId);
- boost::shared_ptr<LiteConnection> pConnection = boost::make_shared<LiteConnection>(socket);
- // TODO: add device info to connection
-
- // List<LiteDeviceProxy> deviceProxyList = new ArrayList<LiteDeviceProxy>();
- // synchronized (deviceProxySet) {
- // for(LiteDeviceProxy device : deviceProxySet) {
- // if (device.isLocal()) {
- // deviceProxyList.add(device);
- // }
- // }
- // }
- // for(LiteDeviceProxy device : deviceProxyList) {
- // try {
- // connection.sendDeviceArrival(device);
- // } catch (IOException e) {
- // e.printStackTrace();
- // }
- // }
-
- // Add the new connection to the session
- pSession->addConnection(pConnection);
- }
-
- void LiteRemoting::queryMySessionId() {
- apiResultReady_ = false;
-
- pCCFContext_->querySessionId([this](const API::SessionIdResult& sessionIdResult) -> void {
-
- API::SessionIdResult::ResultType queryResult = sessionIdResult.getResult();
- boost::lock_guard<boost::mutex> lock(mutex_);
- switch (queryResult) {
- case API::SessionIdResult::ResultType::Success:
- LOG_PRINT("LiteRemoting::queryMySessionId() - queryResult == Success");
- mySessionId_ = sessionIdResult.getSessionId();
- apiResultReady_ = true;
- break;
- case API::SessionIdResult::ResultType::InternalError:
- LOG_PRINT("LiteRemoting::queryMySessionId() - queryResult == InternalError");
- break;
- case API::SessionIdResult::ResultType::InvalidLocalSession:
- LOG_PRINT("LiteRemoting::queryMySessionId() - queryResult == InvalidLocalSession");
- break;
- default:
- LOG_PRINT("LiteRemoting::queryMySessionId() - queryResult == unknown");
- break;
- }
- cond_.notify_one();
- });
- }
-
- void LiteRemoting::queryMySessionInfo()
- {
- apiResultReady_ = false;
-
-// pCCFContext_->querySession(sessionUUID, std::bind(&LiteRemoting::querySessionObserver, this, _1));
- pCCFContext_->querySession(mySessionId_, [this](const API::SessionQueryResult& sessionQueryResult) -> void {
-
- API::QueryResultType queryResult = sessionQueryResult.getResult();
- boost::lock_guard<boost::mutex> lock(mutex_);
- switch (queryResult) {
- case API::QueryResultType::Success:
- LOG_PRINT("LiteRemoting::queryMySessionInfo() - queryResult == Success");
- // TODO: verify that CCF application is in the session application set?
-
- // Add my local session to the sessionMap
- addSessionToMap(mySessionId_);
- sessionMap_[mySessionId_]->setPublicAvatarId(sessionQueryResult.getPublicAvatarId());
- sessionMap_[mySessionId_]->setPrivateAvatarId(sessionQueryResult.getPrivateAvatarId());
- sessionMap_[mySessionId_]->setPublicAvatarId(sessionQueryResult.getPublicAvatarId());
- sessionMap_[mySessionId_]->setUserId(sessionQueryResult.getUserId());
- sessionMap_[mySessionId_]->setIssuer(sessionQueryResult.getIssuer());
- sessionMap_[mySessionId_]->setName(sessionQueryResult.getName());
- sessionMap_[mySessionId_]->setStatusText(sessionQueryResult.getStatusText());
- sessionMap_[mySessionId_]->setSecurityCode(sessionQueryResult.getSecurityCode());
- sessionMap_[mySessionId_]->setApplicationSet(sessionQueryResult.getApplicationSet());
-
- // TODO: add more conditions before inviting to join session?
- if (!sessionMap_[mySessionId_]->isConnected() && !sessionMap_[mySessionId_]->isInvited()) {
- sessionMap_[mySessionId_]->invite();
- }
-
- apiResultReady_ = true;
- break;
- case API::QueryResultType::NotFound:
- LOG_PRINT("LiteRemoting::queryMySessionInfo() - queryResult == NotFound");
- break;
- default:
- LOG_PRINT("LiteRemoting::queryMySessionInfo() - queryResult == unknown");
- break;
- }
- cond_.notify_one();
- });
- }
-
-// ============================================================================
-// Observers
-// ============================================================================
- void LiteRemoting::sessionObserver(const API::SessionEvent& sessionEvent)
- {
-
- UUID_t sessionId = sessionEvent.getSessionId();
-
- // TODO: Need to put in logic for seeing what's changed. Added, dropped, paused?
-// int changeMask = sessionEvent.getWhatChanged();
-
- // See if we already have the session in the map. If not, create and add
- addSessionToMap(sessionId);
- }
-
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef LITEREMOTING_H_
-#define LITEREMOTING_H_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <boost/shared_ptr.hpp>
-#include <boost/thread.hpp>
-#include <uuid.h>
-#include <map>
-#include <set>
-#include "api.h"
-using namespace Intel::STC;
-
-#include "LiteSessionImpl.h"
-#include "LiteUUIDLess.hpp"
-#include "LiteTargetDevice.hpp"
-#include "LiteTargetDeviceProxy.h"
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace remoting {
-
- // ==========================================================================
- // Class
- // ==========================================================================
- class LiteRemoting {
- // ============================================================
- // Constants
- // ============================================================
- public:
- static const std::string APPLICATION_UUID_STRING;
-
- // ============================================================
- // Type Definition
- // ============================================================
- public:
- typedef boost::shared_ptr<LiteRemoting> Ptr;
-
- // ============================================================
- // Singleton
- // ============================================================
- public:
- static boost::shared_ptr<LiteRemoting> getInstance();
-
- // ============================================================
- // Private key for Singleton with shared_ptr
- // LiteRemoting ctor must be public for make_ptr.
- // But since we are a singleton, we don't want to allow clients
- // to call the ctor. Since client can't access
- // PrivateConstructKey, it can't call the public ctor.
- // ============================================================
- private:
- struct PrivateConstructKey {};
-
- // ============================================================
- // Constructor and Destructor
- // ============================================================
- public:
- LiteRemoting(PrivateConstructKey key);
- virtual ~LiteRemoting();
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
-
-
- // ============================================================
- // Private copy constructor for Singleton
- // ============================================================
- private:
- LiteRemoting(const LiteRemoting&);
-
- // ============================================================
- // Private Attributes
- // ============================================================
- private:
- // CCF API Interface
- API::Service::SharedPtr pCCFService_;
- API::Context::SharedPtr pCCFContext_;
-
- UUID_t mySessionId_;
- std::map <UUID_t, boost::shared_ptr<LiteSessionImpl>, LiteUUIDLess> sessionMap_;
- std::map <UUID_t, boost::shared_ptr<LiteTargetDeviceProxy>, LiteUUIDLess> targetDeviceProxyMap_;
- boost::condition_variable cond_;
- boost::mutex mutex_;
- bool apiResultReady_;
-
- // ============================================================
- // Private Methods
- // ============================================================
- private:
- void doStartup();
- void queryMySessionId();
- void queryMySessionInfo();
- void addSessionToMap(UUID_t sessionId);
- boost::shared_ptr<LiteSessionImpl> getSessionFromMap(UUID_t sessionId);
- void addTargetDeviceToMap(UUID_t targetDeviceId);
- boost::shared_ptr<LiteTargetDeviceProxy> getTargetDeviceFromMap(UUID_t targetDeviceId);
- void handleNewConnection(UUID_t sessionId, int socket);
- void handleNewTargetDevice(UUID_t targetDeviceId);
-
- // ============================================================
- // Observers
- // ============================================================
- private:
- void sessionObserver(const API::SessionEvent& sessionEvent);
-
- };
-}
-#endif /* LITEREMOTING_H_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef LITESESSION_HPP_
-#define LITESESSION_HPP_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <string>
-#include <uuid.h>
-#include <set>
-#include <boost/shared_ptr.hpp>
-#include "api.h"
-using namespace Intel::STC;
-
-#include "LiteConnection.h"
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace remoting {
-
- class LiteSession
- {
-
- public:
- LiteSession(API::Context::SharedPtr pCCFContext, UUID_t uuid) : pCCFContext_(pCCFContext), sessionId_(uuid) {};
- virtual ~LiteSession() { connectionSet_.clear(); };
-
- virtual void invite() = 0;
- virtual void disconnect() = 0;
-
- public:
- bool isInvited() {
- return isInvited_;
- }
-
- bool isConnected() {
- return isConnected_;
- }
-
- void setPublicAvatarId(const UUID_t& avatarId) {
- publicAvatarId_ = avatarId;
- }
-
- void setPrivateAvatarId(const UUID_t& avatarId) {
- privateAvatarId_ = avatarId;
- }
-
- void setUserId(const UUID_t& userId) {
- userId_ = userId;
- }
-
- void setIssuer(const std::string& issuer) {
- issuer_ = issuer;
- }
-
- void setName(const std::string& name) {
- sessionName_ = name;
- }
-
- void setStatusText(const std::string& text) {
- statusText_ = text;
- }
-
- void setSecurityCode(const std::string& code) {
- securityCode_ = code;
- }
-
- void setApplicationSet(const std::set<UUID_t>& applicationSet) {
- applicationSet_ = applicationSet;
- }
-
- const UUID_t& getPublicAvatarId() {
- return publicAvatarId_;
- }
-
- const UUID_t& getPrivateAvatarId() {
- return privateAvatarId_;
- }
-
- const UUID_t& getUserId() {
- return userId_;
- }
-
- const std::string& getIssuer() {
- return issuer_;
- }
-
- const std::string& getName() {
- return sessionName_;
- }
-
- const std::string& getStatusText() {
- return statusText_;
- }
-
- const std::string& getSecurityCode() {
- return securityCode_;
- }
- const std::set<UUID_t>& getApplicationSet() {
- return applicationSet_;
- }
-
- void addConnection(boost::shared_ptr<LiteConnection> connection) {
- connectionSet_.insert(connection);
- }
-
- void removeConnection(boost::shared_ptr<LiteConnection> connection) {
- connectionSet_.erase(connection);
- }
-
- protected:
- bool onLocalNetwork_;
- bool onCloudNetwork_;
- bool isController_;
- bool isInvited_;
- bool isConnected_;
-
- API::Context::SharedPtr pCCFContext_;
- API::InvitationBuilder::SharedPtr pInvitationBuilder_;
-
- UUID_t sessionId_;
- UUID_t publicAvatarId_;
- UUID_t privateAvatarId_;
- UUID_t userId_;
- std::string issuer_;
- std::string sessionName_;
- std::string statusText_;
- std::string securityCode_;
- std::set <UUID_t> applicationSet_;
-
- std::set<boost::shared_ptr<LiteConnection>> connectionSet_;
-
-
- };
-
-}
-
-
-#endif /* LITESESSION_HPP_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#include <string>
-#include "LiteSessionImpl.h"
-
-#ifdef DEBUG
-#include <android/log.h>
-#endif
-
-namespace remoting {
-
- LiteSessionImpl::LiteSessionImpl(API::Context::SharedPtr pCCFContext, UUID_t uuid) : LiteSession(pCCFContext, uuid)
- {
-#ifdef DEBUG
- __android_log_print(ANDROID_LOG_VERBOSE, tag, "LiteSessionImpl::LiteSessionImpl()");
-#endif
-
- if (pCCFContext_)
- {
- // Set callbacks
- using namespace std::placeholders;
-
- pCCFContext_->querySession(sessionId_, std::bind(&LiteSessionImpl::querySessionObserver, this, _1));
- }
- }
-
- LiteSessionImpl::~LiteSessionImpl()
- {
- applicationSet_.clear();
- }
-
-
- void LiteSessionImpl::invite() {
- if (!isConnected_ && !isInvited_) {
- if (pCCFContext_) {
- pInvitationBuilder_ = pCCFContext_->createInvitationBuilder();
- isInvited_ = true;
- }
- }
- }
-
- void LiteSessionImpl::disconnect() {
- // TODO: implement
- }
-
- void LiteSessionImpl::querySessionObserver(const API::SessionQueryResult& sessionQueryResult)
- {
-
- }
-}
-
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef LITESESSIONIMPL_H_
-#define LITESESSIONIMPL_H_
-
-#include "LiteSession.hpp"
-#include "api.h"
-using namespace Intel::STC;
-
-namespace remoting {
-
- class LiteSessionImpl : public LiteSession
- {
- public:
- LiteSessionImpl(API::Context::SharedPtr pCCFContext, UUID_t uuid);
- virtual ~LiteSessionImpl();
-
- virtual void invite();
- virtual void disconnect();
-
- private:
- // Listeners
- void querySessionObserver(const API::SessionQueryResult& sessionQueryResult);
- };
-}
-
-
-#endif /* LITESESSIONIMPL_H_ */
-
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef LITETARGETDEVICE_HPP_
-#define LITETARGETDEVICE_HPP_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <string>
-#include <uuid.h>
-
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace remoting {
-
- // ==========================================================================
- // Class
- // ==========================================================================
- class LiteTargetDevice
- {
- public:
- LiteTargetDevice(UUID_t uuid) : deviceId_(uuid), name_("Unknown target device"), isLocal_(false) {};
- virtual ~LiteTargetDevice() {};
-
- const UUID_t& getDeviceUUID() {
- return deviceId_;
- }
-
- const std::string& getName() {
- return name_;
- }
-
- bool isLocal() {
- return isLocal_;
- }
-
- void setName(const std::string& name) {
- name_ = name;
- }
-
- void setLocal(bool isLocal) {
- isLocal_ = isLocal;
- }
-
- protected:
- UUID_t deviceId_;
- std::string name_;
- bool isLocal_;
- };
-
-}
-
-#endif /* LITETARGETDEVICE_HPP_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include "LiteTargetDeviceProxy.h"
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace remoting {
-
- // ============================================================================
- // Constructor/Destructor
- // ============================================================================
- //---------------------------------------------------------------------------
- // Constructor
- //---------------------------------------------------------------------------
- LiteTargetDeviceProxy::LiteTargetDeviceProxy(UUID_t uuid) : LiteTargetDevice(uuid)
- {
- }
-
- LiteTargetDeviceProxy::~LiteTargetDeviceProxy()
- {
- }
-
-
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef LITETARGETDEVICEPROXY_H_
-#define LITETARGETDEVICEPROXY_H_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <set>
-
-#include "LiteTargetDevice.hpp"
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace remoting {
-
- // ==========================================================================
- // Class
- // ==========================================================================
-
-class LiteTargetDeviceProxy: public LiteTargetDevice
-{
-public:
- // Methods
- LiteTargetDeviceProxy(UUID_t uuid);
- virtual ~LiteTargetDeviceProxy();
-
-
-private:
-};
-
-}
-
-#endif /* LITETARGETDEVICEPROXY_H_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef LITEUUIDLESS_HPP_
-#define LITEUUIDLESS_HPP_
-
-#include <uuid.h>
-
-namespace remoting {
-
- class LiteUUIDLess
- {
- public:
- bool operator()(const UUID_t &uuid1, const UUID_t &uuid2) const
- {
- return memcmp(&uuid1, &uuid2, sizeof(uuid1))<0;
- }
- };
-
-}
-
-
-#endif /* LITEUUIDLESS_HPP_ */
+++ /dev/null
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by libcoap configure 4.1.1, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- $ ./configure --host=avr CC=avr-gcc C_EXTRA_FLAGS=-mmcu=atmega2560 -DATMEGA2560
-
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = precious
-uname -m = x86_64
-uname -r = 3.8.0-37-generic
-uname -s = Linux
-uname -v = #53~precise1-Ubuntu SMP Wed Feb 19 21:37:54 UTC 2014
-
-/usr/bin/uname -p = unknown
-/bin/uname -X = unknown
-
-/bin/arch = unknown
-/usr/bin/arch -k = unknown
-/usr/convex/getsysinfo = unknown
-/usr/bin/hostinfo = unknown
-/bin/machine = unknown
-/usr/bin/oslevel = unknown
-/bin/universe = unknown
-
-PATH: /tmp/automake/home/sachin/jdk1.7.0_51/bin
-PATH: /usr/lib/lightdm/lightdm
-PATH: /usr/local/sbin
-PATH: /usr/local/bin
-PATH: /usr/sbin
-PATH: /usr/bin
-PATH: /sbin
-PATH: /bin
-PATH: /usr/games
-PATH: /home/sachin/android/adt-bundle-linux-x86_64-20131030/sdk/tools
-PATH: /home/sachin/android/adt-bundle-linux-x86_64-20131030/sdk/platform-tools
-PATH: /var/tmp/android-14/bin
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-configure:2175: checking whether make sets $(MAKE)
-configure:2197: result: yes
-configure:2214: checking for avr-gcc
-configure:2241: result: avr-gcc
-configure:2510: checking for C compiler version
-configure:2519: avr-gcc --version >&5
-avr-gcc (GCC) 4.5.3
-Copyright (C) 2010 Free Software Foundation, Inc.
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-configure:2530: $? = 0
-configure:2519: avr-gcc -v >&5
-Using built-in specs.
-COLLECT_GCC=avr-gcc
-COLLECT_LTO_WRAPPER=/usr/lib/gcc/avr/4.5.3/lto-wrapper
-Target: avr
-Configured with: ../src/configure -v --enable-languages=c,c++ --prefix=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man --bindir=/usr/bin --libexecdir=/usr/lib --libdir=/usr/lib --enable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-libssp --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=avr
-Thread model: single
-gcc version 4.5.3 (GCC)
-configure:2530: $? = 0
-configure:2519: avr-gcc -V >&5
-avr-gcc: '-V' option must have argument
-configure:2530: $? = 1
-configure:2519: avr-gcc -qversion >&5
-avr-gcc: unrecognized option '-qversion'
-avr-gcc: no input files
-configure:2530: $? = 1
-configure:2550: checking whether the C compiler works
-configure:2572: avr-gcc conftest.c >&5
-configure:2576: $? = 0
-configure:2624: result: yes
-configure:2627: checking for C compiler default output file name
-configure:2629: result: a.out
-configure:2635: checking for suffix of executables
-configure:2642: avr-gcc -o conftest conftest.c >&5
-configure:2646: $? = 0
-configure:2668: result:
-configure:2690: checking whether we are cross compiling
-configure:2698: avr-gcc -o conftest conftest.c >&5
-conftest.c: In function 'main':
-conftest.c:13:11: warning: initialization makes pointer from integer without a cast
-/tmp/ccBLEQG0.o: In function `main':
-conftest.c:(.text+0x16): undefined reference to `fopen'
-/usr/lib/gcc/avr/4.5.3/../../../avr/lib/libc.a(malloc.o): In function `malloc':
-/build/buildd/avr-libc-1.7.1/avr/lib/avr2/../../../libc/stdlib/malloc.c:80: undefined reference to `__heap_end'
-collect2: ld returned 1 exit status
-configure:2702: $? = 1
-configure:2709: ./conftest
-./configure: line 2711: ./conftest: No such file or directory
-configure:2713: $? = 127
-configure:2728: result: yes
-configure:2733: checking for suffix of object files
-configure:2755: avr-gcc -c conftest.c >&5
-configure:2759: $? = 0
-configure:2780: result: o
-configure:2784: checking whether we are using the GNU C compiler
-configure:2803: avr-gcc -c conftest.c >&5
-configure:2803: $? = 0
-configure:2812: result: yes
-configure:2821: checking whether avr-gcc accepts -g
-configure:2841: avr-gcc -c -g conftest.c >&5
-configure:2841: $? = 0
-configure:2882: result: yes
-configure:2899: checking for avr-gcc option to accept ISO C89
-configure:2962: avr-gcc -c -g -O2 conftest.c >&5
-configure:2962: $? = 0
-configure:2975: result: none needed
-configure:2998: checking for avr-ranlib
-configure:3014: found /usr/bin/avr-ranlib
-configure:3025: result: avr-ranlib
-configure:3089: checking for doxygen
-configure:3107: found /usr/bin/doxygen
-configure:3120: result: /usr/bin/doxygen
-configure:3130: checking for etags
-configure:3161: result: /bin/false
-configure:3176: checking how to run the C preprocessor
-configure:3207: avr-gcc -E conftest.c
-configure:3207: $? = 0
-configure:3221: avr-gcc -E conftest.c
-conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory
-compilation terminated.
-configure:3221: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| /* end confdefs.h. */
-| #include <ac_nonexistent.h>
-configure:3246: result: avr-gcc -E
-configure:3266: avr-gcc -E conftest.c
-configure:3266: $? = 0
-configure:3280: avr-gcc -E conftest.c
-conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory
-compilation terminated.
-configure:3280: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| /* end confdefs.h. */
-| #include <ac_nonexistent.h>
-configure:3309: checking for grep that handles long lines and -e
-configure:3367: result: /bin/grep
-configure:3372: checking for egrep
-configure:3434: result: /bin/grep -E
-configure:3439: checking for ANSI C header files
-configure:3459: avr-gcc -c -g -O2 conftest.c >&5
-configure:3459: $? = 0
-configure:3543: result: yes
-configure:3556: checking for sys/types.h
-configure:3556: avr-gcc -c -g -O2 conftest.c >&5
-conftest.c:44:23: fatal error: sys/types.h: No such file or directory
-compilation terminated.
-configure:3556: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-|
-| #include <sys/types.h>
-configure:3556: result: no
-configure:3556: checking for sys/stat.h
-configure:3556: avr-gcc -c -g -O2 conftest.c >&5
-conftest.c:44:22: fatal error: sys/stat.h: No such file or directory
-compilation terminated.
-configure:3556: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-|
-| #include <sys/stat.h>
-configure:3556: result: no
-configure:3556: checking for stdlib.h
-configure:3556: avr-gcc -c -g -O2 conftest.c >&5
-configure:3556: $? = 0
-configure:3556: result: yes
-configure:3556: checking for string.h
-configure:3556: avr-gcc -c -g -O2 conftest.c >&5
-configure:3556: $? = 0
-configure:3556: result: yes
-configure:3556: checking for memory.h
-configure:3556: avr-gcc -c -g -O2 conftest.c >&5
-conftest.c:46:20: fatal error: memory.h: No such file or directory
-compilation terminated.
-configure:3556: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-|
-| #include <memory.h>
-configure:3556: result: no
-configure:3556: checking for strings.h
-configure:3556: avr-gcc -c -g -O2 conftest.c >&5
-conftest.c:46:21: fatal error: strings.h: No such file or directory
-compilation terminated.
-configure:3556: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-|
-| #include <strings.h>
-configure:3556: result: no
-configure:3556: checking for inttypes.h
-configure:3556: avr-gcc -c -g -O2 conftest.c >&5
-configure:3556: $? = 0
-configure:3556: result: yes
-configure:3556: checking for stdint.h
-configure:3556: avr-gcc -c -g -O2 conftest.c >&5
-configure:3556: $? = 0
-configure:3556: result: yes
-configure:3556: checking for unistd.h
-configure:3556: avr-gcc -c -g -O2 conftest.c >&5
-conftest.c:48:20: fatal error: unistd.h: No such file or directory
-compilation terminated.
-configure:3556: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-|
-| #include <unistd.h>
-configure:3556: result: no
-configure:3568: checking whether byte ordering is bigendian
-configure:3583: avr-gcc -c -g -O2 conftest.c >&5
-conftest.c:15:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
-configure:3583: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| /* end confdefs.h. */
-| #ifndef __APPLE_CC__
-| not a universal capable compiler
-| #endif
-| typedef int dummy;
-|
-configure:3628: avr-gcc -c -g -O2 conftest.c >&5
-conftest.c:14:23: fatal error: sys/types.h: No such file or directory
-compilation terminated.
-configure:3628: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| /* end confdefs.h. */
-| #include <sys/types.h>
-| #include <sys/param.h>
-|
-| int
-| main ()
-| {
-| #if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
-| bogus endian macros
-| #endif
-|
-| ;
-| return 0;
-| }
-configure:3672: avr-gcc -c -g -O2 conftest.c >&5
-conftest.c: In function 'main':
-conftest.c:20:8: error: 'bogus' undeclared (first use in this function)
-conftest.c:20:8: note: each undeclared identifier is reported only once for each function it appears in
-conftest.c:20:14: error: expected ';' before 'endian'
-configure:3672: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| /* end confdefs.h. */
-| #include <limits.h>
-|
-| int
-| main ()
-| {
-| #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
-| bogus endian macros
-| #endif
-|
-| ;
-| return 0;
-| }
-configure:3728: avr-gcc -c -g -O2 conftest.c >&5
-configure:3728: $? = 0
-configure:3774: result: no
-configure:3794: checking for coap_new_pdu in -lcoap
-configure:3819: avr-gcc -o conftest -g -O2 conftest.c -lcoap >&5
-/usr/lib/gcc/avr/4.5.3/../../../avr/bin/ld: cannot find -lcoap
-collect2: ld returned 1 exit status
-configure:3819: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| /* end confdefs.h. */
-|
-| /* Override any GCC internal prototype to avoid an error.
-| Use char because int might match the return type of a GCC
-| builtin and then its argument prototype would still apply. */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| char coap_new_pdu ();
-| int
-| main ()
-| {
-| return coap_new_pdu ();
-| ;
-| return 0;
-| }
-configure:3828: result: no
-configure:3840: checking for library containing gethostbyname
-configure:3871: avr-gcc -o conftest -g -O2 conftest.c >&5
-/tmp/cc5dRuvo.o: In function `main':
-/home/sachin/gitrepos/peg_ccfl-core/libcoap-4.1.1/conftest.c:25: undefined reference to `gethostbyname'
-collect2: ld returned 1 exit status
-configure:3871: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| /* end confdefs.h. */
-|
-| /* Override any GCC internal prototype to avoid an error.
-| Use char because int might match the return type of a GCC
-| builtin and then its argument prototype would still apply. */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| char gethostbyname ();
-| int
-| main ()
-| {
-| return gethostbyname ();
-| ;
-| return 0;
-| }
-configure:3871: avr-gcc -o conftest -g -O2 conftest.c -lnsl >&5
-/usr/lib/gcc/avr/4.5.3/../../../avr/bin/ld: cannot find -lnsl
-collect2: ld returned 1 exit status
-configure:3871: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| /* end confdefs.h. */
-|
-| /* Override any GCC internal prototype to avoid an error.
-| Use char because int might match the return type of a GCC
-| builtin and then its argument prototype would still apply. */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| char gethostbyname ();
-| int
-| main ()
-| {
-| return gethostbyname ();
-| ;
-| return 0;
-| }
-configure:3888: result: no
-configure:3896: checking for library containing socket
-configure:3927: avr-gcc -o conftest -g -O2 conftest.c >&5
-/tmp/cczRzsqr.o: In function `main':
-/home/sachin/gitrepos/peg_ccfl-core/libcoap-4.1.1/conftest.c:25: undefined reference to `socket'
-collect2: ld returned 1 exit status
-configure:3927: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| /* end confdefs.h. */
-|
-| /* Override any GCC internal prototype to avoid an error.
-| Use char because int might match the return type of a GCC
-| builtin and then its argument prototype would still apply. */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| char socket ();
-| int
-| main ()
-| {
-| return socket ();
-| ;
-| return 0;
-| }
-configure:3927: avr-gcc -o conftest -g -O2 conftest.c -lsocket >&5
-/usr/lib/gcc/avr/4.5.3/../../../avr/bin/ld: cannot find -lsocket
-collect2: ld returned 1 exit status
-configure:3927: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| /* end confdefs.h. */
-|
-| /* Override any GCC internal prototype to avoid an error.
-| Use char because int might match the return type of a GCC
-| builtin and then its argument prototype would still apply. */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| char socket ();
-| int
-| main ()
-| {
-| return socket ();
-| ;
-| return 0;
-| }
-configure:3944: result: no
-configure:4011: checking assert.h usability
-configure:4011: avr-gcc -c -g -O2 -DWITH_POSIX conftest.c >&5
-configure:4011: $? = 0
-configure:4011: result: yes
-configure:4011: checking assert.h presence
-configure:4011: avr-gcc -E -DWITH_POSIX conftest.c
-configure:4011: $? = 0
-configure:4011: result: yes
-configure:4011: checking for assert.h
-configure:4011: result: yes
-configure:4011: checking arpa/inet.h usability
-configure:4011: avr-gcc -c -g -O2 -DWITH_POSIX conftest.c >&5
-conftest.c:48:23: fatal error: arpa/inet.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| #include <arpa/inet.h>
-configure:4011: result: no
-configure:4011: checking arpa/inet.h presence
-configure:4011: avr-gcc -E -DWITH_POSIX conftest.c
-conftest.c:15:23: fatal error: arpa/inet.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| /* end confdefs.h. */
-| #include <arpa/inet.h>
-configure:4011: result: no
-configure:4011: checking for arpa/inet.h
-configure:4011: result: no
-configure:4011: checking limits.h usability
-configure:4011: avr-gcc -c -g -O2 -DWITH_POSIX conftest.c >&5
-configure:4011: $? = 0
-configure:4011: result: yes
-configure:4011: checking limits.h presence
-configure:4011: avr-gcc -E -DWITH_POSIX conftest.c
-configure:4011: $? = 0
-configure:4011: result: yes
-configure:4011: checking for limits.h
-configure:4011: result: yes
-configure:4011: checking netdb.h usability
-configure:4011: avr-gcc -c -g -O2 -DWITH_POSIX conftest.c >&5
-conftest.c:49:19: fatal error: netdb.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| #include <netdb.h>
-configure:4011: result: no
-configure:4011: checking netdb.h presence
-configure:4011: avr-gcc -E -DWITH_POSIX conftest.c
-conftest.c:16:19: fatal error: netdb.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| /* end confdefs.h. */
-| #include <netdb.h>
-configure:4011: result: no
-configure:4011: checking for netdb.h
-configure:4011: result: no
-configure:4011: checking netinet/in.h usability
-configure:4011: avr-gcc -c -g -O2 -DWITH_POSIX conftest.c >&5
-conftest.c:49:24: fatal error: netinet/in.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| #include <netinet/in.h>
-configure:4011: result: no
-configure:4011: checking netinet/in.h presence
-configure:4011: avr-gcc -E -DWITH_POSIX conftest.c
-conftest.c:16:24: fatal error: netinet/in.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| /* end confdefs.h. */
-| #include <netinet/in.h>
-configure:4011: result: no
-configure:4011: checking for netinet/in.h
-configure:4011: result: no
-configure:4011: checking for stdlib.h
-configure:4011: result: yes
-configure:4011: checking for string.h
-configure:4011: result: yes
-configure:4011: checking for strings.h
-configure:4011: result: no
-configure:4011: checking sys/socket.h usability
-configure:4011: avr-gcc -c -g -O2 -DWITH_POSIX conftest.c >&5
-conftest.c:51:24: fatal error: sys/socket.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| #include <sys/socket.h>
-configure:4011: result: no
-configure:4011: checking sys/socket.h presence
-configure:4011: avr-gcc -E -DWITH_POSIX conftest.c
-conftest.c:18:24: fatal error: sys/socket.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <sys/socket.h>
-configure:4011: result: no
-configure:4011: checking for sys/socket.h
-configure:4011: result: no
-configure:4011: checking sys/time.h usability
-configure:4011: avr-gcc -c -g -O2 -DWITH_POSIX conftest.c >&5
-conftest.c:51:22: fatal error: sys/time.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| #include <sys/time.h>
-configure:4011: result: no
-configure:4011: checking sys/time.h presence
-configure:4011: avr-gcc -E -DWITH_POSIX conftest.c
-conftest.c:18:22: fatal error: sys/time.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <sys/time.h>
-configure:4011: result: no
-configure:4011: checking for sys/time.h
-configure:4011: result: no
-configure:4011: checking time.h usability
-configure:4011: avr-gcc -c -g -O2 -DWITH_POSIX conftest.c >&5
-conftest.c:51:18: fatal error: time.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| #include <time.h>
-configure:4011: result: no
-configure:4011: checking time.h presence
-configure:4011: avr-gcc -E -DWITH_POSIX conftest.c
-conftest.c:18:18: fatal error: time.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <time.h>
-configure:4011: result: no
-configure:4011: checking for time.h
-configure:4011: result: no
-configure:4011: checking for unistd.h
-configure:4011: result: no
-configure:4011: checking sys/unistd.h usability
-configure:4011: avr-gcc -c -g -O2 -DWITH_POSIX conftest.c >&5
-conftest.c:51:24: fatal error: sys/unistd.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| #include <sys/unistd.h>
-configure:4011: result: no
-configure:4011: checking sys/unistd.h presence
-configure:4011: avr-gcc -E -DWITH_POSIX conftest.c
-conftest.c:18:24: fatal error: sys/unistd.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <sys/unistd.h>
-configure:4011: result: no
-configure:4011: checking for sys/unistd.h
-configure:4011: result: no
-configure:4011: checking syslog.h usability
-configure:4011: avr-gcc -c -g -O2 -DWITH_POSIX conftest.c >&5
-conftest.c:51:20: fatal error: syslog.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| #include <syslog.h>
-configure:4011: result: no
-configure:4011: checking syslog.h presence
-configure:4011: avr-gcc -E -DWITH_POSIX conftest.c
-conftest.c:18:20: fatal error: syslog.h: No such file or directory
-compilation terminated.
-configure:4011: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <syslog.h>
-configure:4011: result: no
-configure:4011: checking for syslog.h
-configure:4011: result: no
-configure:4023: checking for size_t
-configure:4023: avr-gcc -c -g -O2 -DWITH_POSIX conftest.c >&5
-configure:4023: $? = 0
-configure:4023: avr-gcc -c -g -O2 -DWITH_POSIX conftest.c >&5
-conftest.c: In function 'main':
-conftest.c:54:21: error: expected expression before ')' token
-configure:4023: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| int
-| main ()
-| {
-| if (sizeof ((size_t)))
-| return 0;
-| ;
-| return 0;
-| }
-configure:4023: result: yes
-configure:4034: checking for ssize_t
-configure:4034: avr-gcc -c -g -O2 -DWITH_POSIX conftest.c >&5
-conftest.c: In function 'main':
-conftest.c:54:13: error: 'ssize_t' undeclared (first use in this function)
-conftest.c:54:13: note: each undeclared identifier is reported only once for each function it appears in
-configure:4034: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| /* end confdefs.h. */
-| #include <stdio.h>
-| #ifdef HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #ifdef HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #ifdef STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # ifdef HAVE_STDLIB_H
-| # include <stdlib.h>
-| # endif
-| #endif
-| #ifdef HAVE_STRING_H
-| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-| # include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #ifdef HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #ifdef HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #endif
-| #ifdef HAVE_STDINT_H
-| # include <stdint.h>
-| #endif
-| #ifdef HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| int
-| main ()
-| {
-| if (sizeof (ssize_t))
-| return 0;
-| ;
-| return 0;
-| }
-configure:4034: result: no
-configure:4049: checking for stdlib.h
-configure:4049: result: yes
-configure:4059: checking for GNU libc compatible malloc
-configure:4093: result: no
-configure:4117: checking for memset
-configure:4117: avr-gcc -o conftest -g -O2 -DWITH_POSIX conftest.c >&5
-conftest.c:45:6: warning: conflicting types for built-in function 'memset'
-configure:4117: $? = 0
-configure:4117: result: yes
-configure:4117: checking for select
-configure:4117: avr-gcc -o conftest -g -O2 -DWITH_POSIX conftest.c >&5
-/tmp/ccgkOSk6.o: In function `main':
-/home/sachin/gitrepos/peg_ccfl-core/libcoap-4.1.1/conftest.c:57: undefined reference to `select'
-collect2: ld returned 1 exit status
-configure:4117: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define ssize_t int
-| #define HAVE_STDLIB_H 1
-| #define HAVE_MALLOC 0
-| #define malloc rpl_malloc
-| #define HAVE_MEMSET 1
-| /* end confdefs.h. */
-| /* Define select to an innocuous variant, in case <limits.h> declares select.
-| For example, HP-UX 11i <limits.h> declares gettimeofday. */
-| #define select innocuous_select
-|
-| /* System header to define __stub macros and hopefully few prototypes,
-| which can conflict with char select (); below.
-| Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-| <limits.h> exists even on freestanding compilers. */
-|
-| #ifdef __STDC__
-| # include <limits.h>
-| #else
-| # include <assert.h>
-| #endif
-|
-| #undef select
-|
-| /* Override any GCC internal prototype to avoid an error.
-| Use char because int might match the return type of a GCC
-| builtin and then its argument prototype would still apply. */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| char select ();
-| /* The GNU C library defines this for functions which it implements
-| to always fail with ENOSYS. Some functions are actually named
-| something starting with __ and the normal name is an alias. */
-| #if defined __stub_select || defined __stub___select
-| choke me
-| #endif
-|
-| int
-| main ()
-| {
-| return select ();
-| ;
-| return 0;
-| }
-configure:4117: result: no
-configure:4117: checking for socket
-configure:4117: avr-gcc -o conftest -g -O2 -DWITH_POSIX conftest.c >&5
-/tmp/ccZCmbb9.o: In function `main':
-/home/sachin/gitrepos/peg_ccfl-core/libcoap-4.1.1/conftest.c:57: undefined reference to `socket'
-collect2: ld returned 1 exit status
-configure:4117: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define ssize_t int
-| #define HAVE_STDLIB_H 1
-| #define HAVE_MALLOC 0
-| #define malloc rpl_malloc
-| #define HAVE_MEMSET 1
-| /* end confdefs.h. */
-| /* Define socket to an innocuous variant, in case <limits.h> declares socket.
-| For example, HP-UX 11i <limits.h> declares gettimeofday. */
-| #define socket innocuous_socket
-|
-| /* System header to define __stub macros and hopefully few prototypes,
-| which can conflict with char socket (); below.
-| Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-| <limits.h> exists even on freestanding compilers. */
-|
-| #ifdef __STDC__
-| # include <limits.h>
-| #else
-| # include <assert.h>
-| #endif
-|
-| #undef socket
-|
-| /* Override any GCC internal prototype to avoid an error.
-| Use char because int might match the return type of a GCC
-| builtin and then its argument prototype would still apply. */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| char socket ();
-| /* The GNU C library defines this for functions which it implements
-| to always fail with ENOSYS. Some functions are actually named
-| something starting with __ and the normal name is an alias. */
-| #if defined __stub_socket || defined __stub___socket
-| choke me
-| #endif
-|
-| int
-| main ()
-| {
-| return socket ();
-| ;
-| return 0;
-| }
-configure:4117: result: no
-configure:4117: checking for strcasecmp
-configure:4117: avr-gcc -o conftest -g -O2 -DWITH_POSIX conftest.c >&5
-conftest.c:46:6: warning: conflicting types for built-in function 'strcasecmp'
-configure:4117: $? = 0
-configure:4117: result: yes
-configure:4117: checking for strrchr
-configure:4117: avr-gcc -o conftest -g -O2 -DWITH_POSIX conftest.c >&5
-conftest.c:47:6: warning: conflicting types for built-in function 'strrchr'
-configure:4117: $? = 0
-configure:4117: result: yes
-configure:4117: checking for getaddrinfo
-configure:4117: avr-gcc -o conftest -g -O2 -DWITH_POSIX conftest.c >&5
-/tmp/cca8ULN8.o: In function `main':
-/home/sachin/gitrepos/peg_ccfl-core/libcoap-4.1.1/conftest.c:59: undefined reference to `getaddrinfo'
-collect2: ld returned 1 exit status
-configure:4117: $? = 1
-configure: failed program was:
-| /* confdefs.h */
-| #define PACKAGE_NAME "libcoap"
-| #define PACKAGE_TARNAME "libcoap"
-| #define PACKAGE_VERSION "4.1.1"
-| #define PACKAGE_STRING "libcoap 4.1.1"
-| #define PACKAGE_BUGREPORT ""
-| #define PACKAGE_URL ""
-| #define STDC_HEADERS 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_ASSERT_H 1
-| #define HAVE_LIMITS_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define ssize_t int
-| #define HAVE_STDLIB_H 1
-| #define HAVE_MALLOC 0
-| #define malloc rpl_malloc
-| #define HAVE_MEMSET 1
-| #define HAVE_STRCASECMP 1
-| #define HAVE_STRRCHR 1
-| /* end confdefs.h. */
-| /* Define getaddrinfo to an innocuous variant, in case <limits.h> declares getaddrinfo.
-| For example, HP-UX 11i <limits.h> declares gettimeofday. */
-| #define getaddrinfo innocuous_getaddrinfo
-|
-| /* System header to define __stub macros and hopefully few prototypes,
-| which can conflict with char getaddrinfo (); below.
-| Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-| <limits.h> exists even on freestanding compilers. */
-|
-| #ifdef __STDC__
-| # include <limits.h>
-| #else
-| # include <assert.h>
-| #endif
-|
-| #undef getaddrinfo
-|
-| /* Override any GCC internal prototype to avoid an error.
-| Use char because int might match the return type of a GCC
-| builtin and then its argument prototype would still apply. */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| char getaddrinfo ();
-| /* The GNU C library defines this for functions which it implements
-| to always fail with ENOSYS. Some functions are actually named
-| something starting with __ and the normal name is an alias. */
-| #if defined __stub_getaddrinfo || defined __stub___getaddrinfo
-| choke me
-| #endif
-|
-| int
-| main ()
-| {
-| return getaddrinfo ();
-| ;
-| return 0;
-| }
-configure:4117: result: no
-configure:4117: checking for strnlen
-configure:4117: avr-gcc -o conftest -g -O2 -DWITH_POSIX conftest.c >&5
-configure:4117: $? = 0
-configure:4117: result: yes
-configure:4250: creating ./config.status
-
-## ---------------------- ##
-## Running config.status. ##
-## ---------------------- ##
-
-This file was extended by libcoap config.status 4.1.1, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- CONFIG_FILES =
- CONFIG_HEADERS =
- CONFIG_LINKS =
- CONFIG_COMMANDS =
- $ ./config.status
-
-on precious
-
-config.status:814: creating Makefile
-config.status:814: creating doc/Makefile
-config.status:814: creating doc/Doxyfile
-config.status:800: error: cannot find input file: `examples/Makefile.in'
-
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-
-ac_cv_c_bigendian=no
-ac_cv_c_compiler_gnu=yes
-ac_cv_env_CC_set=set
-ac_cv_env_CC_value=avr-gcc
-ac_cv_env_CFLAGS_set=
-ac_cv_env_CFLAGS_value=
-ac_cv_env_CPPFLAGS_set=
-ac_cv_env_CPPFLAGS_value=
-ac_cv_env_CPP_set=
-ac_cv_env_CPP_value=
-ac_cv_env_LDFLAGS_set=
-ac_cv_env_LDFLAGS_value=
-ac_cv_env_LIBS_set=
-ac_cv_env_LIBS_value=
-ac_cv_env_build_alias_set=
-ac_cv_env_build_alias_value=
-ac_cv_env_host_alias_set=set
-ac_cv_env_host_alias_value=avr
-ac_cv_env_target_alias_set=
-ac_cv_env_target_alias_value=
-ac_cv_func_getaddrinfo=no
-ac_cv_func_malloc_0_nonnull=no
-ac_cv_func_memset=yes
-ac_cv_func_select=no
-ac_cv_func_socket=no
-ac_cv_func_strcasecmp=yes
-ac_cv_func_strnlen=yes
-ac_cv_func_strrchr=yes
-ac_cv_header_arpa_inet_h=no
-ac_cv_header_assert_h=yes
-ac_cv_header_inttypes_h=yes
-ac_cv_header_limits_h=yes
-ac_cv_header_memory_h=no
-ac_cv_header_netdb_h=no
-ac_cv_header_netinet_in_h=no
-ac_cv_header_stdc=yes
-ac_cv_header_stdint_h=yes
-ac_cv_header_stdlib_h=yes
-ac_cv_header_string_h=yes
-ac_cv_header_strings_h=no
-ac_cv_header_sys_socket_h=no
-ac_cv_header_sys_stat_h=no
-ac_cv_header_sys_time_h=no
-ac_cv_header_sys_types_h=no
-ac_cv_header_sys_unistd_h=no
-ac_cv_header_syslog_h=no
-ac_cv_header_time_h=no
-ac_cv_header_unistd_h=no
-ac_cv_lib_coap_coap_new_pdu=no
-ac_cv_objext=o
-ac_cv_path_DOXYGEN=/usr/bin/doxygen
-ac_cv_path_EGREP='/bin/grep -E'
-ac_cv_path_ETAGS=/bin/false
-ac_cv_path_GREP=/bin/grep
-ac_cv_prog_CC=avr-gcc
-ac_cv_prog_CPP='avr-gcc -E'
-ac_cv_prog_RANLIB=avr-ranlib
-ac_cv_prog_cc_c89=
-ac_cv_prog_cc_g=yes
-ac_cv_prog_make_make_set=yes
-ac_cv_search_gethostbyname=no
-ac_cv_search_socket=no
-ac_cv_type_size_t=yes
-ac_cv_type_ssize_t=no
-
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-
-BUILD_SO=''
-CC='avr-gcc'
-CFLAGS='-g -O2'
-CPP='avr-gcc -E'
-CPPFLAGS=' -DWITH_POSIX'
-DEFS='-DHAVE_CONFIG_H'
-DOXYGEN='/usr/bin/doxygen'
-ECHO_C=''
-ECHO_N='-n'
-ECHO_T=''
-EGREP='/bin/grep -E'
-ETAGS='/bin/false'
-EXEEXT=''
-GREP='/bin/grep'
-LDFLAGS=''
-LIBOBJS=' ${LIBOBJDIR}malloc$U.o'
-LIBS=''
-LTLIBOBJS=' ${LIBOBJDIR}malloc$U.lo'
-OBJEXT='o'
-PACKAGE_BUGREPORT=''
-PACKAGE_NAME='libcoap'
-PACKAGE_STRING='libcoap 4.1.1'
-PACKAGE_TARNAME='libcoap'
-PACKAGE_URL=''
-PACKAGE_VERSION='4.1.1'
-PATH_SEPARATOR=':'
-RANLIB='avr-ranlib'
-SET_MAKE=''
-SHELL='/bin/bash'
-TESTS=''
-ac_ct_CC=''
-bindir='${exec_prefix}/bin'
-build_alias=''
-datadir='${datarootdir}'
-datarootdir='${prefix}/share'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-dvidir='${docdir}'
-exec_prefix='${prefix}'
-host_alias='avr'
-htmldir='${docdir}'
-includedir='${prefix}/include'
-infodir='${datarootdir}/info'
-libdir='${exec_prefix}/lib'
-libexecdir='${exec_prefix}/libexec'
-localedir='${datarootdir}/locale'
-localstatedir='${prefix}/var'
-mandir='${datarootdir}/man'
-oldincludedir='/usr/include'
-pdfdir='${docdir}'
-prefix='/usr/local'
-program_transform_name='s,x,x,'
-psdir='${docdir}'
-sbindir='${exec_prefix}/sbin'
-sharedstatedir='${prefix}/com'
-sysconfdir='${prefix}/etc'
-target_alias=''
-
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-
-/* confdefs.h */
-#define PACKAGE_NAME "libcoap"
-#define PACKAGE_TARNAME "libcoap"
-#define PACKAGE_VERSION "4.1.1"
-#define PACKAGE_STRING "libcoap 4.1.1"
-#define PACKAGE_BUGREPORT ""
-#define PACKAGE_URL ""
-#define STDC_HEADERS 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STRING_H 1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H 1
-#define HAVE_ASSERT_H 1
-#define HAVE_LIMITS_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STRING_H 1
-#define ssize_t int
-#define HAVE_STDLIB_H 1
-#define HAVE_MALLOC 0
-#define malloc rpl_malloc
-#define HAVE_MEMSET 1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRNLEN 1
-
-configure: exit 1
+++ /dev/null
-#! /bin/bash
-# Generated by configure.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=${CONFIG_SHELL-/bin/bash}
-export SHELL
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by libcoap $as_me 4.1.1, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-# Files that config.status was made for.
-config_files=" Makefile doc/Makefile doc/Doxyfile examples/Makefile tests/Makefile"
-config_headers=" config.h"
-
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Report bugs to the package provider."
-
-ac_cs_config="'--host=avr' 'CC=avr-gcc' 'C_EXTRA_FLAGS=-mmcu=atmega2560 -DATMEGA2560' 'host_alias=avr'"
-ac_cs_version="\
-libcoap config.status 4.1.1
-configured by ./configure, generated by GNU Autoconf 2.69,
- with options \"$ac_cs_config\"
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='/home/sachin/gitrepos/peg_ccfl-core/libcoap-4.1.1'
-srcdir='.'
-test -n "$AWK" || AWK=awk
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- as_fn_append CONFIG_HEADERS " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
- --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-if $ac_cs_recheck; then
- set X /bin/bash './configure' '--host=avr' 'CC=avr-gcc' 'C_EXTRA_FLAGS=-mmcu=atmega2560 -DATMEGA2560' 'host_alias=avr' $ac_configure_extra_args --no-create --no-recursion
- shift
- $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6
- CONFIG_SHELL='/bin/bash'
- export CONFIG_SHELL
- exec "$@"
-fi
-
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
- "doc/Doxyfile") CONFIG_FILES="$CONFIG_FILES doc/Doxyfile" ;;
- "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
- "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-cat >>"$ac_tmp/subs1.awk" <<\_ACAWK &&
-S["LTLIBOBJS"]=" ${LIBOBJDIR}malloc$U.lo"
-S["BUILD_SO"]=""
-S["TESTS"]=""
-S["LIBOBJS"]=" ${LIBOBJDIR}malloc$U.o"
-S["EGREP"]="/bin/grep -E"
-S["GREP"]="/bin/grep"
-S["CPP"]="avr-gcc -E"
-S["ETAGS"]="/bin/false"
-S["DOXYGEN"]="/usr/bin/doxygen"
-S["RANLIB"]="avr-ranlib"
-S["OBJEXT"]="o"
-S["EXEEXT"]=""
-S["ac_ct_CC"]=""
-S["CPPFLAGS"]=" -DWITH_POSIX"
-S["LDFLAGS"]=""
-S["CFLAGS"]="-g -O2"
-S["CC"]="avr-gcc"
-S["SET_MAKE"]=""
-S["target_alias"]=""
-S["host_alias"]="avr"
-S["build_alias"]=""
-S["LIBS"]=""
-S["ECHO_T"]=""
-S["ECHO_N"]="-n"
-S["ECHO_C"]=""
-S["DEFS"]="-DHAVE_CONFIG_H"
-S["mandir"]="${datarootdir}/man"
-S["localedir"]="${datarootdir}/locale"
-S["libdir"]="${exec_prefix}/lib"
-S["psdir"]="${docdir}"
-S["pdfdir"]="${docdir}"
-S["dvidir"]="${docdir}"
-S["htmldir"]="${docdir}"
-S["infodir"]="${datarootdir}/info"
-S["docdir"]="${datarootdir}/doc/${PACKAGE_TARNAME}"
-S["oldincludedir"]="/usr/include"
-S["includedir"]="${prefix}/include"
-S["localstatedir"]="${prefix}/var"
-S["sharedstatedir"]="${prefix}/com"
-S["sysconfdir"]="${prefix}/etc"
-S["datadir"]="${datarootdir}"
-S["datarootdir"]="${prefix}/share"
-S["libexecdir"]="${exec_prefix}/libexec"
-S["sbindir"]="${exec_prefix}/sbin"
-S["bindir"]="${exec_prefix}/bin"
-S["program_transform_name"]="s,x,x,"
-S["prefix"]="/usr/local"
-S["exec_prefix"]="${prefix}"
-S["PACKAGE_URL"]=""
-S["PACKAGE_BUGREPORT"]=""
-S["PACKAGE_STRING"]="libcoap 4.1.1"
-S["PACKAGE_VERSION"]="4.1.1"
-S["PACKAGE_TARNAME"]="libcoap"
-S["PACKAGE_NAME"]="libcoap"
-S["PATH_SEPARATOR"]=":"
-S["SHELL"]="/bin/bash"
-_ACAWK
-cat >>"$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = "\a"
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-D["PACKAGE_NAME"]=" \"libcoap\""
-D["PACKAGE_TARNAME"]=" \"libcoap\""
-D["PACKAGE_VERSION"]=" \"4.1.1\""
-D["PACKAGE_STRING"]=" \"libcoap 4.1.1\""
-D["PACKAGE_BUGREPORT"]=" \"\""
-D["PACKAGE_URL"]=" \"\""
-D["STDC_HEADERS"]=" 1"
-D["HAVE_STDLIB_H"]=" 1"
-D["HAVE_STRING_H"]=" 1"
-D["HAVE_INTTYPES_H"]=" 1"
-D["HAVE_STDINT_H"]=" 1"
-D["HAVE_ASSERT_H"]=" 1"
-D["HAVE_LIMITS_H"]=" 1"
-D["HAVE_STDLIB_H"]=" 1"
-D["HAVE_STRING_H"]=" 1"
-D["ssize_t"]=" int"
-D["HAVE_STDLIB_H"]=" 1"
-D["HAVE_MALLOC"]=" 0"
-D["malloc"]=" rpl_malloc"
-D["HAVE_MEMSET"]=" 1"
-D["HAVE_STRCASECMP"]=" 1"
-D["HAVE_STRRCHR"]=" 1"
-D["HAVE_STRNLEN"]=" 1"
- for (key in D) D_is_set[key] = 1
- FS = "\a"
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t (]|$)/ {
- line = $ 0
- split(line, arg, " ")
- if (arg[1] == "#") {
- defundef = arg[2]
- mac1 = arg[3]
- } else {
- defundef = substr(arg[1], 2)
- mac1 = arg[2]
- }
- split(mac1, mac2, "(") #)
- macro = mac2[1]
- prefix = substr(line, 1, index(line, defundef) - 1)
- if (D_is_set[macro]) {
- # Preserve the white space surrounding the "#".
- print prefix "define", macro P[macro] D[macro]
- next
- } else {
- # Replace #undef with comments. This is necessary, for example,
- # in the case of _POSIX_SOURCE, which is predefined and required
- # on some systems where configure will not decide to define it.
- if (defundef == "undef") {
- print "/*", prefix defundef, macro, "*/"
- next
- }
- }
-}
-{ print }
-_ACAWK
- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS "
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
- fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
-
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
- ac_datarootdir_hack='
- s&@datadir@&${datarootdir}&g
- s&@docdir@&${datarootdir}/doc/${PACKAGE_TARNAME}&g
- s&@infodir@&${datarootdir}/info&g
- s&@localedir@&${datarootdir}/locale&g
- s&@mandir@&${datarootdir}/man&g
- s&\${datarootdir}&${prefix}/share&g' ;;
-esac
-ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}
-
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
- if test x"$ac_file" != x-; then
- {
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
- } >"$ac_tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f "$ac_file"
- mv "$ac_tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- fi
- else
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
- fi
- ;;
-
-
- esac
-
-done # for ac_tag
-
-
-as_fn_exit 0
+++ /dev/null
-Build notes
-
-//-------------------------------------------------
-// Linux
-//-------------------------------------------------
-To build, run
-make
-
-To enable logging, ensure that
--D TB_LOG
-is set in the compiler flags
-
-//-------------------------------------------------
-// Android
-//-------------------------------------------------
-To enable logging for Android, TB_LOG should be defined in the ./jni/Android.mk file as
-
-LOCAL_CFLAGS := -DTB_LOG
-
-
+++ /dev/null
-//******************************************************************
-///
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef OCCORE_H_
-#define OCCORE_H_
-
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace oc {
-namespace ub {
-
-// ============================================================================
-// Enums
-// ============================================================================
-enum OCQueryResultType {
- SUCCESS,
- FAILURE
-};
-
-enum OCStackMode {
- OC_CLIENT = 0,
- OC_SERVER,
- OC_CLIENT_SERVER
-};
-
-}
-}
-
-#ifdef CPPV11
-#include <mutex>
- namespace oc {
- namespace ub {
- typedef std::mutex mutex;
- typedef std::lock_guard<std::mutex> mutex_lock_guard;
- }
- }
-#else
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/locks.hpp>
- namespace oc {
- namespace ub {
- typedef boost::mutex mutex;
- typedef boost::lock_guard<boost::mutex> mutex_lock_guard;
- }
- }
-#endif
-
-#endif /* OCCORE_H_ */
+++ /dev/null
-//******************************************************************
-///
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef INTERNALUBAPI_H_
-#define INTERNALUBAPI_H_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <memory>
-#include <functional>
-#include <string>
-#include <list>
-#include <stdint.h>
-#include "occore.h"
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace oc {
-namespace ub {
-
-
-// ============================================================================
-// Class
-// ============================================================================
-class OCDiscoverServicesResult {
- // ============================================================
- // Destructor
- // ============================================================
- public:
- virtual ~OCDiscoverServicesResult() {}
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
- virtual OCQueryResultType getResult() const = 0;
- virtual const std::list<std::string>& getServiceList() const = 0;
-};
-
-typedef std::function<void (const OCDiscoverServicesResult&)> OCDiscoverServicesFunction;
-
-// ============================================================================
-// Class
-// ============================================================================
-class OCModel : public std::enable_shared_from_this<OCModel> {
- // ============================================================
- // Type Definition(s)
- // ============================================================
- public:
- typedef std::shared_ptr<OCModel> SharedPtr;
- typedef std::weak_ptr<OCModel> WeakPtr;
-
- // ============================================================
- // Factory
- // ============================================================
- public:
- static SharedPtr createModel();
-
- // ============================================================
- // Destructor
- // ============================================================
- public:
- virtual ~OCModel() {}
-
- // ============================================================
- // Public Method(s)
- // ============================================================
- public:
- /**
- * Start the OC Stack.
- *
- * @param ipAddr
- * IP Address of host device
- * @param port
- * Port of host device
- * @param mode
- * Host device is client, server, or client-server
- *
- * @return
- * true - successfully started the OC Stack
- * false - error starting the OC Stack
- */
- virtual bool start(const std::string ipAddr, int16_t port, OCStackMode mode) = 0;
-
- /**
- * Get all services that have been discovered at time of call
- *
- * @param asyncReturnFunc - asynchronous callback function that is invoked
- * by the OCModel when service discovery
- * is complete. The callback will include
- * status and a list of all discovered services
- */
- virtual void discoverServices(OCDiscoverServicesFunction& asyncReturnFunc) = 0;
-
- /**
- * Add a service to the OCModel
- *
- * @param url
- * URL of the service
- *
- * @return
- * Total number of services in the OCModel
- */
- virtual uint16_t addService(const std::string url) = 0;
-
-};
-
-
-}
-}
-
-#endif /* INTERNALUBAPI_H_ */
+++ /dev/null
-# //******************************************************************
-# //
-# // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-# //
-# //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-# //
-# // Licensed under the Apache License, Version 2.0 (the "License");
-# // you may not use this file except in compliance with the License.
-# // You may obtain a copy of the License at
-# //
-# // http://www.apache.org/licenses/LICENSE-2.0
-# //
-# // Unless required by applicable law or agreed to in writing, software
-# // distributed under the License is distributed on an "AS IS" BASIS,
-# // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# // See the License for the specific language governing permissions and
-# // limitations under the License.
-# //
-# //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#
-# override with `make BUILD=release`
-# default to release build
-BUILD := release
-
-# You must create the file "local.properties" on your local machine which contains any local paths, etc
-# local_settings.mk should NOT be committed to repo
-include ./local.properties
-# GTEST_DIR contains the path to Google Test libs and must be defined in local.properties
-# Example:
-# GTEST_DIR := /home/johndoe/utils/gtest-1.7.0
-
-# NOTE: to run app, make sure that LD_LIBRARY_PATH env variable
-# contains $(GTEST_DIR)/lib/.libs
-
-CC := gcc
-CXX := g++
-
-PROG := ubstacktest
-
-SRC_DIR := ./src
-TEST_DIR:= ./test
-INC_DIR := ./include
-LOG_DIR := ../logger
-COAP_DIR := ../occoap
-STACK_DIR := ../stack
-
-CC_FLAGS.debug := -O0 -g3 -Wall -c -fmessage-length=0 -pedantic -std=c99 -fpic -DTB_LOG
-CC_FLAGS.release := -Os -Wall -c -fmessage-length=0 -std=c99 -fpic
-CC_FLAGS := $(CC_FLAGS.$(BUILD))
-
-CXX_FLAGS.debug := -O0 -g3 -Wall -c -fmessage-length=0 -pedantic -std=c++0x -fpic -DTB_LOG
-CXX_FLAGS.release := -Os -Wall -c -fmessage-length=0 -std=c++0x -fpic
-CXX_FLAGS := $(CXX_FLAGS.$(BUILD))
-
-INC := -I$(SRC_DIR)
-INC += -I$(TEST_DIR)
-INC += -I$(INC_DIR)
-INC += -I$(LOG_DIR)/include
-INC += -I$(COAP_DIR)/include
-INC += -I$(STACK_DIR)/include
-INC += -I$(STACK_DIR)/include/internal
-INC += -I$(GTEST_DIR)/include
-
-
-# using make's computed variables to select object and bin folders
-# depending on the build type
-OBJ_DIR.debug := ./obj/debug
-OBJ_DIR.release := ./obj/release
-OBJ_DIR := $(OBJ_DIR.$(BUILD))
-
-BIN_DIR.debug := ./bin/debug
-BIN_DIR.release := ./bin/release
-BIN_DIR := $(BIN_DIR.$(BUILD))
-
-C_FILES := $(wildcard $(LOG_DIR)/src/*.c)
-C_FILES += $(wildcard $(COAP_DIR)/src/*.c)
-C_FILES += $(wildcard $(STACK_DIR)/src/*.c)
-CPP_FILES := $(wildcard $(SRC_DIR)/*.cpp)
-CPP_FILES += $(wildcard $(TEST_DIR)/*.cpp)
-CPP_FILES += $(wildcard $(TEST_DIR)/*.cpp)
-
-OBJ_FILES := $(addprefix $(OBJ_DIR)/,$(notdir $(CPP_FILES:.cpp=.o) $(C_FILES:.c=.o)))
-H_FILES := $(wildcard $(TEST_DIR)/*.h)
-H_FILES += $(wildcard $(INC_DIR)/*.h)
-H_FILES += $(wildcard $(LOG_DIR)/include/*.h)
-LD_FLAGS := -L/usr/lib
-LD_FLAGS += -L$(GTEST_DIR)/lib/.libs
-
-
-LIBS := -lpthread
-LIBS += -lgtest
-LIBS += -lgtest_main
-
-
-all: $(PROG)
- mkdir -p ./$(OBJ_DIR)
- mkdir -p ./$(BIN_DIR)
-
-
-$(PROG): $(OBJ_FILES)
- $(CXX) -o $@ $^ $(LD_FLAGS) $(LIBS)
- mkdir -p ./$(BIN_DIR)
- mv ./$(PROG) ./$(BIN_DIR)
-
-# UB Stack
-$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h $(H_FILES)
- mkdir -p ./$(OBJ_DIR)
- $(CXX) $(CXX_FLAGS) $(INC) -c -o $@ $<
-
-# UB Stack
-$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(INC_DIR)/%.h $(H_FILES)
- mkdir -p ./$(OBJ_DIR)
- $(CXX) $(CXX_FLAGS) $(INC) -c -o $@ $<
-
-# UB Stack unit test
-$(OBJ_DIR)/%.o: $(TEST_DIR)/%.cpp $(H_FILES)
- mkdir -p ./$(OBJ_DIR)
- $(CXX) $(CXX_FLAGS) $(INC) -c -o $@ $<
-
-# Logger
-$(OBJ_DIR)/%.o: $(LOG_DIR)/src/%.c $(LOG_DIR)/include/%.h $(H_FILES)
- mkdir -p ./$(OBJ_DIR)
- $(CC) $(CC_FLAGS) $(INC) -c -o $@ $<
-
-# Stack
-$(OBJ_DIR)/%.o: $(STACK_DIR)/src/%.c $(STACK_DIR)/include/%.h $(H_FILES)
- mkdir -p ./$(OBJ_DIR)
- $(CC) $(CC_FLAGS) $(INC) -c -o $@ $<
-
-# OCCoAP
-$(OBJ_DIR)/%.o: $(COAP_DIR)/src/%.c $(COAP_DIR)/include/%.h $(H_FILES)
- mkdir -p ./$(OBJ_DIR)
- $(CC) $(CC_FLAGS) $(INC) -c -o $@ $<
-
-.PHONY: clean
-clean :
- rm -rf ./obj/debug/*
- rm -rf ./obj/release/*
- rm -rf ./lib/*
- rm -rf ./bin/debug/*
- rm -rf ./bin/release/*
-
-
-.PHONY: print_vars
-
-print_vars:
- @echo ""
- @echo 'BUILD = '$(value BUILD)
- @echo 'INC = '$(value INC)
- @echo 'CPP_FILES = '$(value CPP_FILES)
- @echo 'LIBS = '$(value LIBS)
-
-
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include "ocmodelimpl.h"
-extern "C" {
- #include "logger.h"
-}
-
-#include <stdlib.h>
-#include <time.h>
-#include <cstdlib>
-
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace oc {
-namespace ub {
-
-static const char TAG[] = "OCModelImpl";
-
-// Global variable used by friend async callback function to access the OCModelImpl instance
-OCModelImpl *pModelImpl = 0;
-
-/**
- * Asynchronous callback friend function invoked by the OC Stack upon service discovery
- *
- * @param result - OC stack result
- * @param representation - handle to the representation of the resource
- */
-void asyncDoResourcesCallback(OCStackResult result, OCRepresentationHandle representation) {
- OC_LOG(INFO, TAG, "Entering asyncDoResourcesCallback");
-
- if (representation && (result == OC_STACK_OK)) {
- OCResource *resource = (OCResource *)representation;
- OC_LOG_V(INFO, TAG, "URI = %s", resource->uri);
-
- // If the pointer is valid, make a call to the OCModelImpl instance method
- if (pModelImpl) {
- pModelImpl->addService(resource->uri);
- }
- }
-}
-
-// ============================================================================
-// OCDiscoverServicesResult Implementation Class
-// ============================================================================
-class OCDiscoverServicesSuccess : public OCDiscoverServicesResult {
-public:
- virtual ~OCDiscoverServicesSuccess() {}
-
-// ============================================================
-// Public Method(s)
-// ============================================================
-public:
- virtual OCQueryResultType getResult() const {
- return SUCCESS;
- }
-
- virtual const std::list<std::string>& getServiceList() const {
- return serviceList;
- }
-
-public:
- std::list<std::string> serviceList;
-};
-
-
-// ============================================================================
-// Model Factory
-// ============================================================================
-OCModel::SharedPtr OCModel::createModel() {
- OC_LOG(INFO, TAG, "Entering OCModel::createModel");
- return OCModelImpl::createModel();
-}
-
-OCModelImpl::SharedPtr OCModelImpl::createModel() {
- // Get singleton of ModelImpl.
- OC_LOG(INFO, TAG, "Entering OCModelImpl::createModel");
- static SharedPtr instance = std::make_shared<OCModelImpl>();
-
- return instance;
-}
-// ============================================================================
-// Constructors & Destructors
-// ============================================================================
-OCModelImpl::OCModelImpl() {
- OC_LOG(INFO, TAG, "Entering OCModel::OCModelImpl");
-
- pModelImpl = this;
- discoverCallback = 0;
-}
-
-OCModelImpl::~OCModelImpl() {
- OC_LOG(INFO, TAG, "Entering OCModel::~OCModelImpl");
- // Call OCStack layer
- if (OCStop() != OC_STACK_OK) {
- OC_LOG(ERROR, TAG, "Stack shutdown error");
- }
-
- discoverCallback = 0;
- serviceList.clear();
-}
-
-// ============================================================================
-// Public methods
-// ============================================================================
-/**
- * Start the OC Stack.
- *
- * @param ipAddr
- * IP Address of host device
- * @param port
- * Port of host device*
- * @param mode
- * Host device is client, server, or client-server
- *
- * @return
- * true - successfully started the OC Stack
- * false - error starting the OC Stack
- */
-bool OCModelImpl::start(const std::string ipAddr, int16_t port, OCStackMode mode) {
- OC_LOG_V(INFO, TAG, "Entering OCModelImpl::start, IP = %s, port = %d", ipAddr.c_str(), (int)port);
-
- // Call OCStack layer - initialize stack
- if (OCInit(ipAddr.c_str(), port, (OCMode)mode) != OC_STACK_OK) {
- OC_LOG(ERROR, TAG, "Stack initialization error");
- return false;
- }
-
- // Call OCStack layer - enable device discovery and provide a callback
- if (OCDoResource(OC_REST_GET, OC_EXPLICIT_DEVICE_DISCOVERY_URI, 0, 0, asyncDoResourcesCallback) != OC_STACK_OK) {
- OC_LOG(ERROR, TAG, "Stack discovery error");
- return false;
- }
- return true;
-}
-
-/**
- * Get all services that have been discovered at time of call
- *
- * @param asyncReturnFunc - asynchronous callback function that is invoked
- * by the OCModelImpl when service discovery
- * is complete. The callback will include
- * status and a list of all discovered services
- */
-void OCModelImpl::discoverServices(OCDiscoverServicesFunction& asyncReturnFunc) {
- OC_LOG(INFO, TAG, "Entering OCModelImpl::discoverServices");
-
- mutex_lock_guard lock(serviceListMutex);
-
- // Save the callback
- discoverCallback = asyncReturnFunc;
-
- // Invoke the callback immediately
- invokeDiscoverCallback();
-}
-
-/**
- * Add a service to the OCModelImpl
- *
- * @param url - URL of the service
- * @return Total number of services in the OCModelImpl
- */
-uint16_t OCModelImpl::addService(const std::string url) {
- OC_LOG_V(INFO, TAG, "Entering OCModelImpl::addService, service = %s", url.c_str());
- serviceList.push_back(url);
-
- invokeDiscoverCallback();
- return (uint16_t)serviceList.size();
-}
-
-/**
- * Internal methods that invokes the client callback (if it was previously set via discoverServices)
- * Called when a new service is discovered.
- */
-void OCModelImpl::invokeDiscoverCallback() {
- OC_LOG(INFO, TAG, "Entering OCModelImpl::invokeDiscoverCallback");
- // Only invoke the callback if it has been set and and at least one service has been added
- // to the service list
- if (discoverCallback && (serviceList.size() > 0)) {
- OC_LOG(INFO, TAG, "Invoking callback");
-
- OCDiscoverServicesSuccess result;
- // Insert from the model device list to the result device list
- result.serviceList.insert(result.serviceList.end(), serviceList.begin(), serviceList.end());
-
- // Invoke the callback
- discoverCallback(result);
- }
-}
-
-}
-}
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-
-#ifndef OCMODELIMPL_H_
-#define OCMODELIMPL_H_
-
-// ============================================================================
-// Includes
-// ============================================================================
-#include <memory>
-#include <map>
-#include <stdint.h>
-
-#include "ocinternalapi.h"
-
-extern "C" {
- #include "ocstack.h"
-}
-// ============================================================================
-// Namespace
-// ============================================================================
-namespace oc {
-namespace ub {
-
-class OCModelImpl : public OCModel {
-public:
- typedef std::shared_ptr<OCModelImpl> SharedPtr;
- typedef std::weak_ptr<OCModelImpl> WeakPtr;
-
-public:
- /**
- * Factory pattern to create a OCModel singleton
- * @return Shared pointer to the OCModel
- */
- static SharedPtr createModel();
-
-public:
- /**
- * Constructor
- */
- OCModelImpl();
-
- /**
- * Destructor
- */
- virtual ~OCModelImpl();
-
- /**
- * Start the OC Stack.
- *
- * @param ipAddr
- * IP Address of host device
- * @param port
- * Port of host device*
- * @param mode
- * Host device is client, server, or client-server
- *
- * @return
- * true - successfully started the OC Stack
- * false - error starting the OC Stack
- */
- virtual bool start(const std::string ipAddr, int16_t port, OCStackMode mode);
-
- /**
- * Get all services that have been discovered at time of call
- *
- * @param asyncReturnFunc - asynchronous callback function that is invoked
- * by the OCModelImpl when service discovery
- * is complete. The callback will include
- * status and a list of all discovered services
- */
- virtual void discoverServices(OCDiscoverServicesFunction& asyncReturnFunc);
-
- /**
- * Add a service to the OCModelImpl
- *
- * @param url - URL of the service
- * @return Total number of services in the OCModelImpl
- */
- virtual uint16_t addService(const std::string url);
-
-private:
- typedef std::list<std::string> ServiceList;
-
-private:
- /**
- * Internal methods that invokes the client callback (if it was previously set via discoverServices)
- * Called when a new service is discovered.
- */
- virtual void invokeDiscoverCallback();
-
- /**
- * Asynchronous callback friend function invoked by the OC Stack upon service discovery
- *
- * @param result - OC stack result
- * @param representation - handle to the representation of the resource
- */
- friend void asyncDoResourcesCallback(OCStackResult result, OCRepresentationHandle representation);
-private:
- ServiceList serviceList;
- mutex serviceListMutex;
- OCDiscoverServicesFunction discoverCallback;
-};
-
-}
-}
-#endif /* OCMODELIMPL_H_ */
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-
-#include "ocinternalapi.h"
-extern "C" {
- #include "logger.h"
- #include "ocstack.h"
- #include "ocstackinternal.h"
-}
-
-#include "gtest/gtest.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <iostream>
-#include <stdint.h>
-using namespace std;
-
-
-static const char TAG[] = "TestHarness";
-static const std::string SERVICE_URI_1 = "coap://127.0.0.1:5683/";
-static const std::string SERVICE_URI_2 = "coap://127.0.0.2:5683/";
-static const std::string SERVICE_URI_3 = "coap://127.0.0.3:5683/";
-
-void discoverServicesAsync(const oc::ub::OCDiscoverServicesResult& result) {
- OC_LOG(INFO, TAG, "Entering discoverServicesAsync");
-
- EXPECT_EQ(oc::ub::OCQueryResultType::SUCCESS, result.getResult());
-
- if (result.getResult() == oc::ub::OCQueryResultType::SUCCESS) {
- OC_LOG(INFO, TAG, "discoverServicesAsync, OCQueryResultType::SUCCESS");
-
- std::list<std::string> serviceList = result.getServiceList();
- EXPECT_GE((int)serviceList.size(), 1);
-
- if (serviceList.size() > 0) {
- for (auto iter = serviceList.begin(); iter != serviceList.end(); ++iter) {
- OC_LOG_V(INFO, TAG, "discoverServicesAsync, Service = %s", iter->c_str());
- }
- }
- }
-}
-//-----------------------------------------------------------------------------
-// Tests
-//-----------------------------------------------------------------------------
-TEST(UBStackTest, ServiceDiscovery) {
- OC_LOG(INFO, TAG, "Running ServiceDiscovery");
-
- oc::ub::OCModel::WeakPtr modelWeak = oc::ub::OCModel::createModel();
- oc::ub::OCModel::SharedPtr modelShared = modelWeak.lock();
- EXPECT_TRUE((modelShared != 0));
- if (modelShared) {
- // Start model
- EXPECT_TRUE(modelShared->start("127.0.0.1", 5683, oc::ub::OC_CLIENT));
-
- // Create an async discovery function
- oc::ub::OCDiscoverServicesFunction serviceFunction = discoverServicesAsync;
-
- // Discover
- modelShared->discoverServices(serviceFunction);
-
- // Add service
- EXPECT_EQ(1, (int)modelShared->addService(SERVICE_URI_1));
-
- // Add service
- EXPECT_EQ(2, (int)modelShared->addService(SERVICE_URI_2));
-
- // Add service via OC Stack
- OCUpdateResources(SERVICE_URI_3.c_str());
- }
-}
-
-