pax_global_header00006660000000000000000000000064126226444450014523gustar00rootroot0000000000000052 comment=b37b2e5b19a2341a439acf9230b052c3632fbf3e base-15.09/000077500000000000000000000000001262264444500124535ustar00rootroot00000000000000base-15.09/.gitignore000066400000000000000000000004371262264444500144470ustar00rootroot00000000000000*.a *.class *.jar *.o *.so *~ .cproject .project .sconsign.dblite .settings/* */.settings/* */whitespace.db libs QA ajlite.nvram alljoyn-daemon bin !build_core/tools/bin build deploy docs/*.html docs/html/*.html gen lib local.properties obj* .DS_Store xcuserdata xccheckout xcshareddata base-15.09/README.md000066400000000000000000000024731262264444500137400ustar00rootroot00000000000000Notice of Export Control Law ============================ Cryptographic software is subject to the US government export control and economic sanctions laws ("US export laws") including the US Department of Commerce Bureau of Industry and Security's ("BIS") Export Administration Regulations ("EAR", 15 CFR 730 et seq., http://www.bis.doc.gov/). You may also be subject to US export laws, including the requirements of license exception TSU in accordance with part 740.13(e) of the EAR. Software and/or technical data subject to the US export laws may not be directly or indirectly exported, reexported, transferred, or released ("exported") to US embargoed or sanctioned destinations currently including Cuba, Iran, North Korea, Sudan, or Syria, but any amendments to this list shall apply. In addition, software and/or technical data may not be exported to any entity barred by the US government from participating in export activities. Denied persons or entities include those listed on BIS's Denied Persons and Entities Lists, and the US Department of Treasury's Office of Foreign Assets Control's Specially Designated Nationals List. The country in which you are currently located may have restrictions on the import, possession, use of encryption software. You are responsible for compliance with the laws where You are located. base-15.09/build_core/000077500000000000000000000000001262264444500145625ustar00rootroot00000000000000base-15.09/build_core/SConscript000066400000000000000000000250231262264444500165760ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import os import platform def CheckCXXFlag(context, flag): prog = "int main(void) { return 0; }" context.Message('Checking c++ compiler support for %s flag... ' % flag) prevCXXFLAGS = context.env.get('CXXFLAGS') context.env.Replace(CXXFLAGS = [ flag ]) r = context.TryCompile(prog, '.cc') if not r: context.env.Replace(CXXFLAGS = prevCXXFLAGS) context.Result(r) return r if platform.system() == 'Linux': default_target_os = 'linux' allowed_target_oss = ('linux', 'android', 'openwrt') if platform.machine() == 'x86_64': default_target_cpu = 'x86_64' else: default_target_cpu = 'x86' allowed_target_cpus = ('x86', 'x86_64', 'arm', 'openwrt') default_msvc_version = None default_crypto = 'openssl' # Override for OS=android is below allowed_crypto = ('openssl', 'builtin') elif platform.system() == 'Windows': default_target_os = 'win7' allowed_target_oss = ('win7', 'win10', 'android') if platform.machine() == 'x86_64': default_target_cpu = 'x86_64' else: default_target_cpu = 'x86' allowed_target_cpus = ('x86', 'x86_64', 'arm') default_msvc_version = '12.0' default_crypto = 'cng' allowed_crypto = ('cng', 'openssl', 'builtin') elif platform.system() == 'Darwin': default_target_os = 'darwin' allowed_target_oss = ('darwin', 'android', 'openwrt') # Darwin maps both 32-bit and 64-bit x86 CPUs to "x86" default_target_cpu = 'x86' allowed_target_cpus = ('x86', 'arm', 'armv7', 'armv7s', 'arm64', 'openwrt') default_msvc_version = None default_crypto = 'openssl' allowed_crypto = ('openssl',) vars = Variables() # Common build variables vars.Add('V', 'Build verbosity', '0') vars.Add(EnumVariable('OS', 'Target OS', default_target_os, allowed_values = allowed_target_oss)) vars.Add(EnumVariable('CPU', 'Target CPU', default_target_cpu, allowed_values = allowed_target_cpus)) vars.Add(EnumVariable('VARIANT', 'Build variant', 'debug', allowed_values=('debug', 'release'), ignorecase=2)) vars.Add(EnumVariable('BR', 'Have bundled router built-in for C++ test samples', 'on', allowed_values=('on', 'off'))) vars.Add(EnumVariable('DOCS', '''Output doc type. Setting the doc type to "dev" will produce HTML output that includes all developer files not just the public API. ''', 'none', allowed_values=('none', 'pdf', 'html', 'dev', 'chm', 'sandcastle'))) vars.Add(EnumVariable('WS', 'Whitespace Policy Checker', 'off', allowed_values=('check', 'detail', 'fix', 'off'))) vars.Add(PathVariable('GTEST_DIR', 'The path to Google Test (gTest) source code', os.environ.get('GTEST_DIR'), PathVariable.PathIsDir)) vars.Add(PathVariable('BULLSEYE_BIN', 'The path to Bullseye Code Coverage', os.environ.get('BULLSEYE_BIN'), PathVariable.PathIsDir)) vars.Add(EnumVariable('NDEBUG', 'Override NDEBUG default for release variant', 'defined', allowed_values=('defined', 'undefined'))) vars.Add('CXX', 'C++ compiler to use') if default_msvc_version: vars.Add(EnumVariable('MSVC_VERSION', 'MSVC compiler version - Windows', default_msvc_version, allowed_values=('11.0', '11.0Exp', '12.0', '12.0Exp', '14.0', '14.0Exp'))) # Standard variant directories build_dir = 'build/${OS}/${CPU}/${VARIANT}' vars.AddVariables(('OBJDIR', '', '#' + build_dir + '/obj'), ('DISTDIR', '', '#' + build_dir + '/dist'), ('TESTDIR', '', '#' + build_dir + '/test')) target_os = ARGUMENTS.get('OS', default_target_os) target_cpu = ARGUMENTS.get('CPU', default_target_cpu) if target_os == 'android': default_crypto = 'builtin' vars.Add(EnumVariable('CRYPTO', 'Crypto implementation', default_crypto, allowed_values = allowed_crypto)) if target_os in ['win10', 'win7']: # The Win7/Win10 MSI installation package takes a long time to build. Let it be optional. if target_os in ['win10', 'win7']: vars.Add(EnumVariable('WIN7_MSI', 'Build the .MSI installation package', 'false', allowed_values=('false', 'true'))) path = [] if os.environ.has_key('MIKTEX_HOME'): path = os.path.normpath(os.environ['MIKTEX_HOME'] + '/bin') msvc_version = ARGUMENTS.get('MSVC_VERSION') env = Environment(variables = vars, TARGET_ARCH=target_cpu, MSVC_VERSION=msvc_version, tools = ['default', 'jar'], ENV = {'PATH' : path}) else: env = Environment(variables = vars, tools = ['gnulink', 'gcc', 'g++', 'ar', 'as', 'javac', 'javah', 'jar', 'pdf', 'pdflatex']) if env['V'] == '0': env.Replace(CCCOMSTR = '\t[CC] $SOURCE', SHCCCOMSTR = '\t[CC-SH] $SOURCE', CXXCOMSTR = '\t[CXX] $SOURCE', SHCXXCOMSTR = '\t[CXX-SH] $SOURCE', LINKCOMSTR = '\t[LINK] $TARGET', SHLINKCOMSTR = '\t[LINK-SH] $TARGET', JAVACCOMSTR = '\t[JAVAC] $SOURCE', JARCOMSTR = '\t[JAR] $TARGET', ARCOMSTR = '\t[AR] $TARGET', RANLIBCOMSTR = '\t[RANLIB] $TARGET' ) # Some tools aren't in default path if os.environ.has_key('JAVA_HOME'): env.PrependENVPath('PATH', os.path.normpath(os.environ['JAVA_HOME'] + '/bin')) if os.environ.has_key('DOXYGEN_HOME'): env.PrependENVPath('PATH', os.path.normpath(os.environ['DOXYGEN_HOME'] + '/bin')) if os.environ.has_key('GRAPHVIZ_HOME'): env.PrependENVPath('PATH', os.path.normpath(os.environ['GRAPHVIZ_HOME'] + '/bin')) # Warn user about building stand alone daemon on unsupported platforms if env['OS'] not in ['android', 'linux', 'openwrt'] and env['BR'] != "on": print "Daemon is not supported on OS=%s, building with BR=on anyway" % (env['OS']) env['BR'] = "on" Help(vars.GenerateHelpText(env)) # Don't silently break people still building with BD in place of BR. We're adding the variable here # after generating the help text above so that it does not show up in the help. bd = Variables(); bd.Add(EnumVariable('BD', 'Have bundled router built-in for C++ test samples', 'invalid', allowed_values=('invalid', 'on', 'off'))) bd.Update(env) if 'invalid' != env['BD']: print 'BD has been replaced by BR, setting BR to ' + env['BD'] env['BR'] = env['BD'] # Validate build vars if env['OS'] == 'linux': env['OS_GROUP'] = 'posix' env['OS_CONF'] = 'linux' elif env['OS'] in ['win10', 'win7']: env['OS_GROUP'] = 'windows' env['OS_CONF'] = 'windows' elif env['OS'] == 'android': env['OS_GROUP'] = 'posix' env['OS_CONF'] = 'android' elif env['OS'] == 'darwin': env['OS_GROUP'] = 'posix' env['OS_CONF'] = 'darwin' elif env['OS'] == 'openwrt': env['OS_GROUP'] = 'posix' env['OS_CONF'] = 'openwrt' else: print 'Unsupported OS/CPU combination' if not GetOption('help'): Exit(1) if env['VARIANT'] == 'release' and env['NDEBUG'] == 'defined': env.Append(CPPDEFINES = 'NDEBUG') if env['BR'] == 'on': env.Append(CPPDEFINES = 'ROUTER') env.Append(CPPDEFINES = ['QCC_OS_GROUP_%s' % env['OS_GROUP'].upper()]) # "Standard" C/C++ header file include paths for all projects. env.Append(CPPPATH = ["$DISTDIR/cpp/inc", "$DISTDIR/c/inc"]) # "Standard" C/C++ library paths for all projects. env.Append(LIBPATH = ["$DISTDIR/cpp/lib", "$DISTDIR/c/lib"]) # Setup additional builders if os.path.exists('tools/scons/doxygen.py'): env.Tool('doxygen', toolpath=['tools/scons']) else: def dummy_emitter(target, source, env): return [], [] def dummy_action(target, source, env): pass dummyBuilder = Builder(action = dummy_action, emitter = dummy_emitter); env.Append(BUILDERS = {'Doxygen' : dummyBuilder}) env.Tool('genversion', toolpath=['tools/scons']) env.Tool('javadoc', toolpath=['tools/scons']) env.Tool('Csharp', toolpath=['tools/scons']) env.Tool('jsdoc3', toolpath=['tools/scons']) # Create the builder that generates Status.h from Status.xml import sys import SCons.Util sys.path.append('tools/bin') import make_status def status_emitter(target, source, env): base = SCons.Util.splitext(str(target[0]))[0] target.append(base + '.h') return target, source def status_action(target, source, env): base = os.path.dirname(os.path.dirname(SCons.Util.splitext(str(target[1]))[0])) cmdList = [] cmdList.append('--code=%s' % str(target[0])) cmdList.append('--header=%s' % str(target[1])) if env.has_key('STATUS_FLAGS'): cmdList.extend(env['STATUS_FLAGS']) cmdList.append(str(source[0])) return make_status.main(cmdList) statusBuilder = Builder(action = status_action, emitter = status_emitter, suffix = '.cc', src_suffix = '.xml') env.Append(BUILDERS = {'Status' : statusBuilder}) if env['OS'] in ['linux', 'openwrt']: env['LIBTYPE'] = 'both' else: env['LIBTYPE'] = 'static' # Read OS and CPU specific SConscript file Export('env', 'CheckCXXFlag') env.SConscript('conf/${OS_CONF}/SConscript') # Whitespace policy if env['WS'] != 'off' and not env.GetOption('clean'): import sys sys.path.append('tools/bin') import whitespace def wsbuild(target, source, env): print "Evaluating whitespace compliance..." curdir = os.path.abspath(os.path.dirname(wsbuild.func_code.co_filename)) version = whitespace.get_uncrustify_version() if (version == "0.57"): config = os.path.join(curdir, 'tools', 'conf', 'ajuncrustify.0.57.cfg') else: #use latest known version config = os.path.join(curdir, 'tools', 'conf', 'ajuncrustify.0.61.cfg') print "Config:", config print "Note: enter 'scons -h' to see whitespace (WS) options" return whitespace.main([env['WS'], config]) ws = env.Command('#/ws', Dir('$DISTDIR'), wsbuild) if env['WS'] != 'off': env.Clean(env.File('SConscript'), env.File('#/whitespace.db')) Return('env') base-15.09/build_core/conf/000077500000000000000000000000001262264444500155075ustar00rootroot00000000000000base-15.09/build_core/conf/android/000077500000000000000000000000001262264444500171275ustar00rootroot00000000000000base-15.09/build_core/conf/android/Android.mk000066400000000000000000000013421262264444500210400ustar00rootroot00000000000000include $(CLEAR_VARS) LOCAL_MODULE := aj-check include $(BUILD_SHARED_LIBRARY) $(info AJ> TOOLCHAIN_PREFIX = $(TOOLCHAIN_PREFIX)) $(info AJ> TOOLCHAIN_PREBUILT_ROOT = $(TOOLCHAIN_PREBUILT_ROOT)) $(info AJ> CFLAGS = $(TARGET_CFLAGS) $(TARGET_NO_EXECUTE_CFLAGS)) $(info AJ> CXXFLAGS = $(TARGET_CXXFLAGS) $(TARGET_NO_EXECUTE_CFLAGS)) $(info AJ> LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NO_EXECUTE_LDFLAGS) $(TARGET_NO_UNDEFINED_LDFLAGS)) $(info AJ> INCLUDES = $(TARGET_C_INCLUDES) $(__ndk_modules.$(APP_STL).EXPORT_C_INCLUDES)) $(info AJ> debug_FLAGS = $(TARGET_$(TARGET_ARCH)_debug_CFLAGS)) $(info AJ> release_FLAGS = $(TARGET_$(TARGET_ARCH)_release_CFLAGS)) $(info AJ> SYSROOT = $(NDK_PLATFORM_$(NDK_APP_PLATFORM)_$(TARGET_ARCH)_SYSROOT)) base-15.09/build_core/conf/android/SConscript000066400000000000000000000241171262264444500211460ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import os import string import subprocess import re # JellyBean is API level 16 min_api_level = 16 # Minimal required NDK version min_ndk_version = "r9b" # NDK should be equal to or lower as min_api_level ndk_level = min_api_level Import('env', 'CheckCXXFlag') env['ANDROID_STL'] = 'gnustl_static' # android specific vars vars = Variables() vars.Add(PathVariable('ANDROID_SRC', 'Base directory of Android source tree', os.environ.get('ANDROID_SRC'))) vars.Add(PathVariable('ANDROID_NDK', 'Base directory of Android NDK', os.environ.get('ANDROID_NDK'))) vars.Add(PathVariable('ANDROID_SDK', 'Base directory of Android SDK', os.environ.get('ANDROID_SDK'))) vars.Add('ANDROID_TARGET', 'Target to be used for the build', os.environ.get('ANDROID_TARGET')) # java 6 related vars.Add(PathVariable('JAVA6_BOOT', 'Base directory for Java 6 bootclass', os.environ.get('JAVA6_BOOT'))) vars.Update(env) Help(vars.GenerateHelpText(env)) # Verify dependencies if env.get('ANDROID_NDK', '') == '': print 'ANDROID_NDK variable is required' if not GetOption('help'): Exit(1) if env.get('ANDROID_SRC', '') == '' and env['CRYPTO'] == 'openssl': print 'ANDROID_SRC variable is required' if not GetOption('help'): Exit(1) if env.get('ANDROID_TARGET', '') == '': env['ANDROID_TARGET'] = 'generic' if env.get('ANDROID_SDK', '') != '': # Get the list of supported SDK platforms. # Use the latest one as compileSdkVersion (to define which android.jar to use). # It should be pretty safe always to compile with the latest one. # This should not be done for minSdkVersion or targetSdkVersion! api_levels = [ level for level in set([ int(d.split('-')[-1]) for d in os.listdir(env['ANDROID_SDK'] + '/platforms') ]) if level >= min_api_level ] api_levels.sort() vars2 = Variables() vars2.Add('ANDROID_API_LEVEL', 'Android API level', os.environ.get('ANDROID_API_LEVEL', str(api_levels[-1]))) vars2.Update(env) Help(vars2.GenerateHelpText(env)) #take ndk_level same as SDK level ndk_platform_path = env['ANDROID_NDK'] + '/platforms/android-' + str(ndk_level) if not os.path.exists(ndk_platform_path) and not GetOption('help'): print "Android NDK level not found" Exit(1) # Read NDK RELEASE.TXT and check if the version is ok ndk_release = '' with open(env['ANDROID_NDK'] + '/RELEASE.TXT', 'r') as f: ndk_release = f.read() f.closed ndk_version_required = re.match("^r(\d+)([a-z])", min_ndk_version) ndk_version_found = re.match("^r(\d+)([a-z])", ndk_release) if ndk_version_found == None or ndk_version_required == None: print "WARNING: can't parse NDK release version" else: # check if version is higher or equal to the required version. if (int(ndk_version_found.group(1)) < int(ndk_version_required.group(1)) or (int(ndk_version_found.group(1)) == int(ndk_version_required.group(1)) and ord(ndk_version_found.group(2)) < ord(ndk_version_required.group(2)))): if not GetOption('help'): print "ERROR: This Android NDK is too old. Minimal required: \"" + min_ndk_version + "\", found \"" + ndk_version_found.group(0) + "\"" Exit(1) # Override MSVC build settings when building on windows. if 'win32' == env.subst('$HOST_OS'): env['OBJPREFIX'] = '' env['OBJSUFFIX'] = '.o' env['SHOBJPREFIX'] = '$OBJPREFIX' env['SHOBJSUFFIX'] = '.os' # SCons uses ".os" for shared object files on Linux env['PROGPREFIX'] = '' env['PROGSUFFIX'] = '' env['LIBPREFIX'] = 'lib' env['LIBSUFFIX'] = '.a' env['SHLIBPREFIX'] = '$LIBPREFIX' env['SHLIBSUFFIX'] = '.so' env['LIBPREFIXES'] = [ '$LIBPREFIX' ] env['LIBSUFFIXES'] = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ] if not GetOption('help') and env.has_key('ANDROID_NDK'): abi_map = { 'arm': 'armeabi', 'mips': 'mips', 'x86': 'x86' } curdir = env.Dir('.').srcnode() if 'win32' == env.subst('$HOST_OS'): cmd_suffix = '.cmd' else: cmd_suffix = '' # Do a "test build" using ndk-build on our special Android.mk file to get # the command line options used by Android when building code. # We do not need stderr but setting it suppresses an error on Windows. tb = subprocess.Popen([ env.subst('$ANDROID_NDK/ndk-build' + cmd_suffix), 'APP_BUILD_SCRIPT=%s/Android.mk' % curdir, 'NDK_PROJECT_PATH=%s' % curdir, 'APP_ABI=%s' % abi_map[env['CPU']], 'APP_STL=%s' % env['ANDROID_STL'], 'APP_PLATFORM=android-%s' % str(ndk_level), '-n' ], stdout = subprocess.PIPE, stderr = subprocess.PIPE, universal_newlines = True) stdoutdata, stderrdata = tb.communicate() # Message the output from ndk-build into a dictionary. settings = dict( [ map(string.strip, line[4:].split('=', 1)) for line in stdoutdata.split('\n') if line.startswith('AJ> ') ] ) # Some versions of the Android NDK leave out # .../gnu-libstdc++//include/backward include path so we need # to add it if it is missing. Also need to figure out where the STL # library lives. stl_lib_path = '' inc_paths = map(string.strip, settings['INCLUDES'].split()) for ip in inc_paths: bpath = ip + '/backward' if bpath not in inc_paths and os.path.exists(bpath): # Get the "backward" include path inc_paths.append(bpath) if '/libs/' in ip: # Get the STL library path stl_lib_path = os.path.split(ip)[0] path = settings['TOOLCHAIN_PREBUILT_ROOT'] + '/bin' prefix = settings['TOOLCHAIN_PREFIX'][len(path) + 1:] env['AR'] = prefix + 'ar' env['CC'] = prefix + 'gcc' env['CXX'] = prefix + 'g++' env['LINK'] = prefix + 'gcc' env['RANLIB'] = prefix + 'ranlib' env.PrependENVPath('PATH', path) env.Append(CPPPATH = inc_paths) env.AppendUnique(CFLAGS = settings['CFLAGS'].split()) env.AppendUnique(CXXFLAGS = settings['CXXFLAGS'].split()) env.AppendUnique(LINKFLAGS = settings['LDFLAGS'].split()) vflags = [f for f in settings[env['VARIANT'] + '_FLAGS'].split() if (f != '-g' and f != '-DNDEBUG' and f != '-UNDEBUG' and not f.startswith('-O'))] env.MergeFlags(vflags) env.Append(LIBPATH = [ settings['SYSROOT'] + '/usr/lib', stl_lib_path ]) env.Append(LINKFLAGS = [ '--sysroot=' + settings['SYSROOT'], '-Wl,-rpath-link=' + settings['SYSROOT'] + '/usr/lib' ]) if env['CRYPTO'] == 'openssl': # Get OpenSSL from Android source. env.Append(CPPPATH = '$ANDROID_SRC/external/openssl/include') env.Append(LIBPATH = '$ANDROID_SRC/out/target/product/$ANDROID_TARGET/system/lib') env.Append(CPPDEFINES = 'QCC_OS_ANDROID') config = Configure(env, custom_tests = { 'CheckCXXFlag' : CheckCXXFlag }) if not config.CheckCXXFlag('-std=c++11'): if not config.CheckCXXFlag('-std=c++0x'): print '*** Compiler too old to build AllJoyn. Aborting.' Exit(1) env = config.Finish() env.Append(CFLAGS = ['-Wall', '-pipe', '-Wno-long-long', '-Wno-deprecated', '-Wno-unknown-pragmas', '-pie', '-fPIE']) env.Append(CXXFLAGS = ['-Wall', '-pipe', '-Wno-long-long', '-Wno-deprecated', '-Wno-unknown-pragmas', '-pie', '-fPIE']) env.Append(LINKFLAGS = ['-Wl,--gc-sections', '-Wl,-z,nocopyreloc', '-pie', '-fPIE']) # Java 6 compile options java6Flags = '-source 1.6 -target 1.6 ' # bootclasspath for java 6 java6BootClassOption = '-bootclasspath ' java6BootPath = env.get('JAVA6_BOOT', '') # Use default java6 bootclass path if JAVA6_BOOT not set if java6BootPath == '': java6BootPath = '/usr/lib/jvm/java-6-sun/jre/lib/' elif not java6BootPath.endswith('/'): java6BootPath = java6BootPath + '/' java6BootClassJar = 'rt.jar' # Add bootclasspath compile option if java6 rt.jar exist if FindFile(java6BootClassJar, java6BootPath): java6Boot = java6BootClassOption + java6BootPath + java6BootClassJar java6Flags = java6Flags + java6Boot # Debug/Release variants if env['VARIANT'] == 'debug': env.Append(CFLAGS = ['-O0', '-g']) env.Append(CXXFLAGS = ['-O0', '-g']) env.Append(JAVACFLAGS='-g -Xlint -Xlint:-serial ' + java6Flags) else: env.Append(CFLAGS = '-Os') env.Append(CXXFLAGS = '-Os') env.Append(LINKFLAGS='-s') env.Append(JAVACFLAGS='-Xlint -Xlint:-serial ' + java6Flags) env.SConscript('${CPU}/SConscript') env.AppendUnique(LIBS = ['m', 'c', 'stdc++', 'log', 'gcc', '$ANDROID_STL']) if env['CRYPTO'] == 'openssl': env.AppendUnique(LIBS =['crypto']) print 'Using OpenSSL crypto' elif env['CRYPTO'] == 'builtin': print 'Using builtin crypto' else: print 'Only CRYPTO=builtin or CRYPTO=openssl are supported for Android.' Exit(1) base-15.09/build_core/conf/android/arm/000077500000000000000000000000001262264444500177065ustar00rootroot00000000000000base-15.09/build_core/conf/android/arm/SConscript000066400000000000000000000015701262264444500217230ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Import('env') # Arm specific flags env.Append(LINKFLAGS = '-Wl,--fix-cortex-a8') base-15.09/build_core/conf/android/x86/000077500000000000000000000000001262264444500175545ustar00rootroot00000000000000base-15.09/build_core/conf/android/x86/SConscript000066400000000000000000000015331262264444500215700ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import os Import('env') # x86 specific compiler flags base-15.09/build_core/conf/darwin/000077500000000000000000000000001262264444500167735ustar00rootroot00000000000000base-15.09/build_core/conf/darwin/SConscript000066400000000000000000000056271262264444500210170ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Import('env', 'CheckCXXFlag') import os # Darwin specific flags env.Append(CPPDEFINES=['QCC_OS_DARWIN']) config = Configure(env, custom_tests = { 'CheckCXXFlag' : CheckCXXFlag }) if not config.CheckCXXFlag('-std=c++11'): if not config.CheckCXXFlag('-std=c++0x'): print '*** Compiler too old to build AllJoyn. Aborting.' Exit(1) env = config.Finish() env.Append(CFLAGS=['-Wall', '-pipe', '-std=c99', '-fno-strict-aliasing', '-Wno-long-long']) env.Append(CXXFLAGS=['-Wall', '-Werror=non-virtual-dtor', '-pipe', '-fno-exceptions', '-fno-strict-aliasing', '-Wno-deprecated']) # Debug/Release Variants if env['VARIANT'] == 'debug': env.Append(CFLAGS='-g') env.Append(CXXFLAGS='-g') env.Append(JAVACFLAGS='-g -Xlint -Xlint:-serial') print 'Using debug settings for darwin build...' else: env.Append(CFLAGS='-O3') env.Append(CXXFLAGS='-O3') env.Append(LINKFLAGS='') env.Append(JAVACFLAGS='-Xlint -Xlint:-serial') print 'Using release settings for darwin build...' env.SConscript('${CPU}/SConscript') env.Append(CPPDEFINES=['MECHANISM_PIPE']) env.AppendUnique(LIBS =['stdc++', 'pthread']) if env['CRYPTO'] == 'openssl': env.AppendUnique(LIBS =['crypto', 'ssl']) if env['CPU'] in ['arm', 'armv7', 'armv7s', 'arm64']: vars = Variables() vars.Add(PathVariable('OPENSSL_ROOT', 'Base OpenSSL directory (darwin only)', os.environ.get('OPENSSL_ROOT'))) vars.Update(env) Help(vars.GenerateHelpText(env)) if '' == env.subst('$OPENSSL_ROOT'): # Must specify OPENSSL_ROOT for darwin, arm print 'Must specify OPENSSL_ROOT when building for OS=darwin, CPU=arm' if not GetOption('help'): Exit(1) env.Append(CPPPATH = ['$OPENSSL_ROOT/include']) env.Append(LIBPATH = ['$OPENSSL_ROOT/build/' + os.environ.get('CONFIGURATION') + '-' + os.environ.get('PLATFORM_NAME')]) print 'Using OpenSSL crypto' else: print 'Using builtin crypto' base-15.09/build_core/conf/darwin/arm/000077500000000000000000000000001262264444500175525ustar00rootroot00000000000000base-15.09/build_core/conf/darwin/arm/SConscript000066400000000000000000000101561262264444500215670ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Import('env') import os vars = Variables() vars.Add(PathVariable('SDKROOT', ' Base directory of Mac/iOS SDK for target', os.environ.get('SDKROOT'))) vars.Add(PathVariable('SYSTEM_DEVELOPER_DIR', ' Base directory for developer tools', os.environ.get('SYSTEM_DEVELOPER_DIR'))) vars.Update(env) Help(vars.GenerateHelpText(env)) # Verify dependencies if '' == env.subst('$SDKROOT'): print 'SDKROOT variable is required' if not GetOption('help'): Exit(1) if '' == env.subst('$SYSTEM_DEVELOPER_DIR'): env['SYSTEM_DEVELOPER_DIR'] = '/Developer' # Darwin on ARM (aka. iOS) specific defines env.Append(CPPDEFINES=['QCC_OS_IPHONE']) s = os.environ.get('CONFIGURATION') s = s.lower() env['OBJDIR'] = 'build/${OS}/${CPU}/' + os.environ.get('PLATFORM_NAME') + '/' + s + '/obj' env['DISTDIR'] = '#build/${OS}/${CPU}/' + os.environ.get('PLATFORM_NAME') + '/' + s + '/dist' env['TESTDIR'] = '#build/${OS}/${CPU}/' + os.environ.get('PLATFORM_NAME') + '/' + s + '/test' env['IPHONEOS_PLATFORM_DIR'] = '$SYSTEM_DEVELOPER_DIR/Platforms/iPhoneOS.platform' env['PATH'] = '$DT_TOOLCHAIN_DIR/usr/bin:$IPHONE_OS_PLATFORM_DIR/Developer/usr/bin:$SYSTEM_DEVELOPER_DIR/usr/bin:$PATH' env['CC'] = '$DT_TOOLCHAIN_DIR/usr/bin/clang' env['CXX'] = '$DT_TOOLCHAIN_DIR/usr/bin/clang++' env.Append(CFLAGS=[ '-fdiagnostics-show-category=id', '-fdiagnostics-parseable-fixits', '-fpascal-strings', '-Wreturn-type', '-Wparentheses', '-Wswitch', '-Wno-unused-parameter', '-Wunused-variable', '-Wunused-value']) env.Append(CXXFLAGS=[ '-fno-rtti', '-fno-exceptions', '-Wc++11-extensions']) if os.environ.get('PLATFORM_NAME') == 'iphonesimulator': print 'Using flags for iOS simulator...' env.Append(CPPDEFINES=['QCC_OS_IPHONE_SIMULATOR']) print env['VARIANT'] if env['VARIANT'] == 'debug': ccld = [ '-g', '-arch', 'i686', '-miphoneos-version-min=7.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=70000', '-isysroot', '$SDKROOT' ] print 'Using iOS debug configuration' else: ccld = [ '-arch', 'i686', '-miphoneos-version-min=7.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=70000', '-isysroot', '$SDKROOT' ] print 'Using iOS release configuration' else: print 'Using flags for iOS devices (arm - defaulting to armv7)...' if env['VARIANT'] == 'debug': ccld = [ '-g', '-arch', 'armv7', '-miphoneos-version-min=7.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=70000', '-isysroot', '$SDKROOT' ] print 'Using iOS debug configuration' else: ccld = [ '-arch', 'armv7', '-miphoneos-version-min=7.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=70000', '-isysroot', '$SDKROOT' ] print 'Using iOS release configuration' ld = [ '-framework', 'SystemConfiguration', '-framework', 'Foundation' ] env.Append(CXXFLAGS=ccld) env.Append(CFLAGS=ccld) env.Append(LINKFLAGS=ccld) env.Append(LINKFLAGS=ld) base-15.09/build_core/conf/darwin/arm64/000077500000000000000000000000001262264444500177245ustar00rootroot00000000000000base-15.09/build_core/conf/darwin/arm64/SConscript000066400000000000000000000100471262264444500217400ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Import('env') import os vars = Variables() vars.Add(PathVariable('SDKROOT', ' Base directory of Mac/iOS SDK for target', os.environ.get('SDKROOT'))) vars.Add(PathVariable('SYSTEM_DEVELOPER_DIR', ' Base directory for developer tools', os.environ.get('SYSTEM_DEVELOPER_DIR'))) vars.Update(env) Help(vars.GenerateHelpText(env)) # Verify dependencies if '' == env.subst('$SDKROOT'): print 'SDKROOT variable is required' if not GetOption('help'): Exit(1) if '' == env.subst('$SYSTEM_DEVELOPER_DIR'): env['SYSTEM_DEVELOPER_DIR'] = '/Developer' # Darwin on ARM (aka. iOS) specific defines env.Append(CPPDEFINES=['QCC_OS_IPHONE']) s = os.environ.get('CONFIGURATION') s = s.lower() env['OBJDIR'] = 'build/${OS}/${CPU}/' + os.environ.get('PLATFORM_NAME') + '/' + s + '/obj' env['DISTDIR'] = '#build/${OS}/${CPU}/' + os.environ.get('PLATFORM_NAME') + '/' + s + '/dist' env['TESTDIR'] = '#build/${OS}/${CPU}/' + os.environ.get('PLATFORM_NAME') + '/' + s + '/test' env['IPHONEOS_PLATFORM_DIR'] = '$SYSTEM_DEVELOPER_DIR/Platforms/iPhoneOS.platform' env['PATH'] = '$DT_TOOLCHAIN_DIR/usr/bin:$IPHONE_OS_PLATFORM_DIR/Developer/usr/bin:$SYSTEM_DEVELOPER_DIR/usr/bin:$PATH' env['CC'] = '$DT_TOOLCHAIN_DIR/usr/bin/clang' env['CXX'] = '$DT_TOOLCHAIN_DIR/usr/bin/clang++' env.Append(CFLAGS=[ '-fdiagnostics-show-category=id', '-fdiagnostics-parseable-fixits', '-fpascal-strings', '-Wreturn-type', '-Wparentheses', '-Wswitch', '-Wno-unused-parameter', '-Wunused-variable', '-Wunused-value']) env.Append(CXXFLAGS=[ '-fno-rtti', '-fno-exceptions', '-Wc++11-extensions']) if os.environ.get('PLATFORM_NAME') == 'iphonesimulator': print 'Using flags for iOS simulator...' env.Append(CPPDEFINES=['QCC_OS_IPHONE_SIMULATOR']) print env['VARIANT'] if env['VARIANT'] == 'debug': ccld = [ '-g', '-arch', 'i686', '-miphoneos-version-min=8.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=80000', '-isysroot', '$SDKROOT' ] print 'Using iOS debug configuration' else: ccld = [ '-arch', 'i686', '-miphoneos-version-min=8.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=80000', '-isysroot', '$SDKROOT' ] print 'Using iOS release configuration' else: print 'Using flags for iOS devices (arm64)...' if env['VARIANT'] == 'debug': ccld = [ '-g', '-arch', 'arm64', '-miphoneos-version-min=8.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=80000', '-isysroot', '$SDKROOT' ] print 'Using iOS debug configuration' else: ccld = [ '-arch', 'arm64', '-miphoneos-version-min=8.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=80000', '-isysroot', '$SDKROOT' ] print 'Using iOS release configuration' ld = [ '-framework', 'SystemConfiguration', '-framework', 'Foundation' ] env.Append(CXXFLAGS=ccld) env.Append(CFLAGS=ccld) env.Append(LINKFLAGS=ccld) env.Append(LINKFLAGS=ld) base-15.09/build_core/conf/darwin/armv7/000077500000000000000000000000001262264444500200275ustar00rootroot00000000000000base-15.09/build_core/conf/darwin/armv7/SConscript000066400000000000000000000101321262264444500220360ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Import('env') import os vars = Variables() vars.Add(PathVariable('SDKROOT', ' Base directory of Mac/iOS SDK for target', os.environ.get('SDKROOT'))) vars.Add(PathVariable('SYSTEM_DEVELOPER_DIR', ' Base directory for developer tools', os.environ.get('SYSTEM_DEVELOPER_DIR'))) vars.Update(env) Help(vars.GenerateHelpText(env)) # Verify dependencies if '' == env.subst('$SDKROOT'): print 'SDKROOT variable is required' if not GetOption('help'): Exit(1) if '' == env.subst('$SYSTEM_DEVELOPER_DIR'): env['SYSTEM_DEVELOPER_DIR'] = '/Developer' # Darwin on ARM (aka. iOS) specific defines env.Append(CPPDEFINES=['QCC_OS_IPHONE']) s = os.environ.get('CONFIGURATION') s = s.lower() env['OBJDIR'] = 'build/${OS}/${CPU}/' + os.environ.get('PLATFORM_NAME') + '/' + s + '/obj' env['DISTDIR'] = '#build/${OS}/${CPU}/' + os.environ.get('PLATFORM_NAME') + '/' + s + '/dist' env['TESTDIR'] = '#build/${OS}/${CPU}/' + os.environ.get('PLATFORM_NAME') + '/' + s + '/test' env['IPHONEOS_PLATFORM_DIR'] = '$SYSTEM_DEVELOPER_DIR/Platforms/iPhoneOS.platform' env['PATH'] = '$DT_TOOLCHAIN_DIR/usr/bin:$IPHONE_OS_PLATFORM_DIR/Developer/usr/bin:$SYSTEM_DEVELOPER_DIR/usr/bin:$PATH' env['CC'] = '$DT_TOOLCHAIN_DIR/usr/bin/clang' env['CXX'] = '$DT_TOOLCHAIN_DIR/usr/bin/clang++' env.Append(CFLAGS=[ '-fdiagnostics-show-category=id', '-fdiagnostics-parseable-fixits', '-fpascal-strings', '-Wreturn-type', '-Wparentheses', '-Wswitch', '-Wno-unused-parameter', '-Wunused-variable', '-Wunused-value']) env.Append(CXXFLAGS=[ '-fno-rtti', '-fno-exceptions', '-Wc++11-extensions']) if os.environ.get('PLATFORM_NAME') == 'iphonesimulator': print 'Using flags for iOS simulator...' env.Append(CPPDEFINES=['QCC_OS_IPHONE_SIMULATOR']) print env['VARIANT'] if env['VARIANT'] == 'debug': ccld = [ '-g', '-arch', 'i686', '-miphoneos-version-min=7.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=70000', '-isysroot', '$SDKROOT' ] print 'Using iOS debug configuration' else: ccld = [ '-arch', 'i686', '-miphoneos-version-min=7.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=70000', '-isysroot', '$SDKROOT' ] print 'Using iOS release configuration' else: print 'Using flags for iOS devices (armv7)...' if env['VARIANT'] == 'debug': ccld = [ '-g', '-arch', 'armv7', '-miphoneos-version-min=7.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=70000', '-isysroot', '$SDKROOT' ] print 'Using iOS debug configuration' else: ccld = [ '-arch', 'armv7', '-miphoneos-version-min=7.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=70000', '-isysroot', '$SDKROOT' ] print 'Using iOS release configuration' ld = [ '-framework', 'SystemConfiguration', '-framework', 'Foundation' ] env.Append(CXXFLAGS=ccld) env.Append(CFLAGS=ccld) env.Append(LINKFLAGS=ccld) env.Append(LINKFLAGS=ld) base-15.09/build_core/conf/darwin/armv7s/000077500000000000000000000000001262264444500202125ustar00rootroot00000000000000base-15.09/build_core/conf/darwin/armv7s/SConscript000066400000000000000000000101331262264444500222220ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Import('env') import os vars = Variables() vars.Add(PathVariable('SDKROOT', ' Base directory of Mac/iOS SDK for target', os.environ.get('SDKROOT'))) vars.Add(PathVariable('SYSTEM_DEVELOPER_DIR', ' Base directory for developer tools', os.environ.get('SYSTEM_DEVELOPER_DIR'))) vars.Update(env) Help(vars.GenerateHelpText(env)) # Verify dependencies if '' == env.subst('$SDKROOT'): print 'SDKROOT variable is required' if not GetOption('help'): Exit(1) if '' == env.subst('$SYSTEM_DEVELOPER_DIR'): env['SYSTEM_DEVELOPER_DIR'] = '/Developer' # Darwin on ARM (aka. iOS) specific defines env.Append(CPPDEFINES=['QCC_OS_IPHONE']) s = os.environ.get('CONFIGURATION') s = s.lower() env['OBJDIR'] = 'build/${OS}/${CPU}/' + os.environ.get('PLATFORM_NAME') + '/' + s + '/obj' env['DISTDIR'] = '#build/${OS}/${CPU}/' + os.environ.get('PLATFORM_NAME') + '/' + s + '/dist' env['TESTDIR'] = '#build/${OS}/${CPU}/' + os.environ.get('PLATFORM_NAME') + '/' + s + '/test' env['IPHONEOS_PLATFORM_DIR'] = '$SYSTEM_DEVELOPER_DIR/Platforms/iPhoneOS.platform' env['PATH'] = '$DT_TOOLCHAIN_DIR/usr/bin:$IPHONE_OS_PLATFORM_DIR/Developer/usr/bin:$SYSTEM_DEVELOPER_DIR/usr/bin:$PATH' env['CC'] = '$DT_TOOLCHAIN_DIR/usr/bin/clang' env['CXX'] = '$DT_TOOLCHAIN_DIR/usr/bin/clang++' env.Append(CFLAGS=[ '-fdiagnostics-show-category=id', '-fdiagnostics-parseable-fixits', '-fpascal-strings', '-Wreturn-type', '-Wparentheses', '-Wswitch', '-Wno-unused-parameter', '-Wunused-variable', '-Wunused-value']) env.Append(CXXFLAGS=[ '-fno-rtti', '-fno-exceptions', '-Wc++11-extensions']) if os.environ.get('PLATFORM_NAME') == 'iphonesimulator': print 'Using flags for iOS simulator...' env.Append(CPPDEFINES=['QCC_OS_IPHONE_SIMULATOR']) print env['VARIANT'] if env['VARIANT'] == 'debug': ccld = [ '-g', '-arch', 'i686', '-miphoneos-version-min=6.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=60000', '-isysroot', '$SDKROOT' ] print 'Using iOS debug configuration' else: ccld = [ '-arch', 'i686', '-miphoneos-version-min=6.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=60000', '-isysroot', '$SDKROOT' ] print 'Using iOS release configuration' else: print 'Using flags for iOS devices (armv7s)...' if env['VARIANT'] == 'debug': ccld = [ '-g', '-arch', 'arm64', '-miphoneos-version-min=8.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=60000', '-isysroot', '$SDKROOT' ] print 'Using iOS debug configuration' else: ccld = [ '-arch', 'arm64', '-miphoneos-version-min=8.0', '-D__IPHONE_OS_VERSION_MIN_REQUIRED=60000', '-isysroot', '$SDKROOT' ] print 'Using iOS release configuration' ld = [ '-framework', 'SystemConfiguration', '-framework', 'Foundation' ] env.Append(CXXFLAGS=ccld) env.Append(CFLAGS=ccld) env.Append(LINKFLAGS=ccld) env.Append(LINKFLAGS=ld) base-15.09/build_core/conf/darwin/x86/000077500000000000000000000000001262264444500174205ustar00rootroot00000000000000base-15.09/build_core/conf/darwin/x86/SConscript000066400000000000000000000046601262264444500214400ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Import('env') import os s = os.environ.get('CONFIGURATION') s = s.lower() env['OBJDIR'] = 'build/${OS}/${CPU}/' + s + '/obj' env['DISTDIR'] = '#build/${OS}/${CPU}/' + s + '/dist' env['TESTDIR'] = '#build/${OS}/${CPU}/' + s + '/test' vars = Variables() vars.Add(PathVariable('SDKROOT', ' Base directory of Mac/iOS SDK for target', os.environ.get('SDKROOT'))) vars.Add(PathVariable('SYSTEM_DEVELOPER_DIR', ' Base directory for developer tools', os.environ.get('SYSTEM_DEVELOPER_DIR'))) vars.Update(env) Help(vars.GenerateHelpText(env)) # Verify dependencies if '' == env.subst('$SDKROOT'): print 'SDKROOT variable is required' if not GetOption('help'): Exit(1) if '' == env.subst('$SYSTEM_DEVELOPER_DIR'): env['SYSTEM_DEVELOPER_DIR'] = '/Developer' # Darwing specific flags env['IPHONEOS_PLATFORM_DIR'] = '$SYSTEM_DEVELOPER_DIR/Platforms/iPhoneOS.platform' env['PATH'] = '$IPHONE_OS_PLATFORM_DIR/Developer/usr/bin:$SYSTEM_DEVELOPER_DIR/usr/bin:$PATH' env['CC'] = '$DT_TOOLCHAIN_DIR/usr/bin/clang' env['CXX'] = '$DT_TOOLCHAIN_DIR/usr/bin/clang++' env.Append(CFLAGS=[ '-fdiagnostics-show-category=id', '-fdiagnostics-parseable-fixits', '-fpascal-strings', '-Wreturn-type', '-Wparentheses', '-Wswitch', '-Wno-unused-parameter', '-Wunused-variable', '-Wunused-value']) env.Append(CXXFLAGS=[ '-fno-rtti', '-fno-exceptions', '-Wc++11-extensions']) ccld = ['-arch', 'i386', '-arch', 'x86_64', '-mmacosx-version-min=10.9'] env.Append(CXXFLAGS=ccld) env.Append(CFLAGS=ccld) env.Append(LINKFLAGS=ccld) base-15.09/build_core/conf/linux/000077500000000000000000000000001262264444500166465ustar00rootroot00000000000000base-15.09/build_core/conf/linux/SConscript000066400000000000000000000066451262264444500206730ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Import('env', 'CheckCXXFlag') import os # Linux specific vars vars = Variables() vars.Add(BoolVariable('GCOV', 'Compile with gcov support', 'no')) vars.Add(BoolVariable('ASAN', 'Enable Address Sanitizer runtime checks', 'no')) vars.Update(env) Help(vars.GenerateHelpText(env)) config = Configure(env, custom_tests = { 'CheckCXXFlag' : CheckCXXFlag }) if not config.CheckCXXFlag('-std=c++11'): if not config.CheckCXXFlag('-std=c++0x'): print '*** Compiler too old to build AllJoyn. Aborting.' Exit(1) env = config.Finish() # Linux specific flags env.Append(CPPDEFINES = ['QCC_OS_LINUX']) env.Append(CPPDEFINES = ['_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC']) env.Append(CFLAGS = ['-Wall', '-Werror', '-pipe', '-std=c99', '-fno-strict-aliasing', '-fno-asynchronous-unwind-tables', '-fno-unwind-tables', '-ffunction-sections', '-fdata-sections', '-Wno-long-long', '-Wunused-parameter']) env.Append(CXXFLAGS = ['-Wall', '-Werror', '-pipe', '-fno-exceptions', '-fno-strict-aliasing', '-fno-asynchronous-unwind-tables', '-fno-unwind-tables', '-ffunction-sections', '-fdata-sections', '-Wno-long-long', '-Wno-deprecated', '-Wno-unknown-pragmas', '-Wunused-parameter']) env.Append(JAVACFLAGS = ['-Xlint', '-Xlint:-serial']) # Debug/Release Variants if env['VARIANT'] == 'debug': env.Append(CFLAGS = '-g') env.Append(CXXFLAGS = '-g') env.Append(JAVACFLAGS = '-g') env.Append(CPPDEFINES = ['_GLIBCXX_DEBUG', '_GLIBCXX_DEBUG_PEDANTIC']) else: env.Append(CFLAGS = '-Os') env.Append(CXXFLAGS = '-Os') env.Append(LINKFLAGS = ['-s', '-Wl,--gc-sections']) # Code coverage control if env['GCOV']: env.Append(CCFLAGS = ['-fprofile-arcs', '-ftest-coverage']) env.Append(LIBS = ['gcov']) # Address sanitizer control if env['ASAN']: env.Append(CFLAGS = ['-fno-omit-frame-pointer', '-fsanitize=address']) env.Append(CXXFLAGS = ['-fno-omit-frame-pointer', '-fsanitize=address']) env.Append(LINKFLAGS = '-fsanitize=address') env.SConscript('${CPU}/SConscript') env.AppendUnique(LIBS =['rt', 'stdc++', 'pthread', 'm']) if env['CRYPTO'] == 'openssl': env.AppendUnique(LIBS =['crypto', 'ssl']) print 'Using OpenSSL crypto' else: print 'Using builtin crypto' base-15.09/build_core/conf/linux/arm/000077500000000000000000000000001262264444500174255ustar00rootroot00000000000000base-15.09/build_core/conf/linux/arm/SConscript000066400000000000000000000026721262264444500214460ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Import('env') import os # Linux specific flags env.Append(CPPFLAGS=['-march=armv6', '-mthumb-interwork']) # Use the OpenEmbedded cross-compilation environment vars = Variables() vars.Add('CROSS_COMPILE', 'Cross compile toolchain prefix', os.environ.get('CROSS_COMPILE')) vars.Update(env) Help(vars.GenerateHelpText(env)) # Use common CROSS_COMPILE prefix if '' == env.subst('$CROSS_COMPILE'): print 'CROSS_COMPILE variable is required for Linux/ARM builds' if not GetOption('help'): Exit(1) env['CC'] = env['CROSS_COMPILE'] + 'gcc' env['CXX'] = env['CROSS_COMPILE'] + 'g++' env['LINK'] = env['CROSS_COMPILE'] + 'gcc' base-15.09/build_core/conf/linux/x86/000077500000000000000000000000001262264444500172735ustar00rootroot00000000000000base-15.09/build_core/conf/linux/x86/SConscript000066400000000000000000000016761262264444500213170ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Import('env') # Linux specific flags # Force 32-bit builds env.Append(CXXFLAGS=['-m32']) env.Append(CFLAGS=['-m32']) env.Append(LINKFLAGS=['-m32']) base-15.09/build_core/conf/linux/x86_64/000077500000000000000000000000001262264444500176045ustar00rootroot00000000000000base-15.09/build_core/conf/linux/x86_64/SConscript000066400000000000000000000026211262264444500216170ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Import('env') vars = Variables() vars.Add(BoolVariable('TSAN', 'Enable Thread Sanitizer runtime checks', 'no')) vars.Update(env) # Linux specific flags # Force 64-bit builds env.Append(CXXFLAGS=['-m64', '-fPIC']) env.Append(CFLAGS=['-m64', '-fPIC']) env.Append(LINKFLAGS=['-m64']) # Thread sanitizer control if env['TSAN']: env.Append(CFLAGS = ['-fno-omit-frame-pointer', '-fsanitize=thread', '-fPIE']) env.Append(CXXFLAGS = ['-fno-omit-frame-pointer', '-fsanitize=thread', '-fPIE']) env.Append(LINKFLAGS = ['-fsanitize=thread', '-pie']) if env['CXX'] != 'clang': env.AppendUnique(LIBS = ['tsan']) base-15.09/build_core/conf/openwrt/000077500000000000000000000000001262264444500172055ustar00rootroot00000000000000base-15.09/build_core/conf/openwrt/SConscript000066400000000000000000000071641262264444500212270ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import os import platform Import('env', 'CheckCXXFlag') if platform.system() == 'Darwin': # De-Mac-ify a couple of the envrionment variables. env.Replace(SHLIBSUFFIX='.so') env.Replace(SHLINKFLAGS=['$LINKFLAGS', '-shared']) # OpenWRT specific vars vars = Variables() vars.Add('TARGET_PATH', 'Paths to toolchain for cross compiling AllJoyn for OpenWRT', os.environ.get('TARGET_PATH')) vars.Add('TARGET_CC', 'OpenWRT C compiler', os.environ.get('TARGET_CC')) vars.Add('TARGET_CFLAGS', 'OpenWRT C compiler flags', os.environ.get('TARGET_CFLAGS')) vars.Add('TARGET_CPPFLAGS', 'OpenWRT C pre-processor compiler flags', os.environ.get('TARGET_CPPFLAGS')) vars.Add('TARGET_CXX', 'OpenWRT C++ compiler', os.environ.get('TARGET_CXX')) vars.Add('TARGET_LINK', 'OpenWRT Linker', os.environ.get('TARGET_CC')) # Normally use the C compiler for linking. vars.Add('TARGET_LINKFLAGS', 'OpenWRT Linker flags', os.environ.get('TARGET_LDFLAGS')) vars.Add('TARGET_AR', 'OpenWRT Archiver', os.environ.get('TARGET_AR')) vars.Add('TARGET_RANLIB', 'OpenWRT Archive Indexer', os.environ.get('TARGET_RANLIB')) vars.Add('STAGING_DIR', 'OpenWRT staging dir', os.environ.get('STAGING_DIR')) vars.Update(env) Help(vars.GenerateHelpText(env)) # Get the compiler flags OpenWrt requires. flags = env.ParseFlags(' '.join([env['TARGET_CFLAGS'], env['TARGET_CPPFLAGS'], env['TARGET_LINKFLAGS']])) # Put OpenWrt build paths in environment varaibles so GCC will search those # paths after paths specified with -I and -L. env['ENV']['CPATH']=':'.join(flags['CPPPATH']) env['ENV']['LIBRARY_PATH']=':'.join(flags['LIBPATH']) # Clear out the CPPPATH and LIBPATH values so that we can merge the rest of # the flags with the SCons build environment. flags['CPPPATH'] = [] flags['LIBPATH'] = [] # Merge the rest of the compiler flags env.MergeFlags(flags) # Set compiler and linker commands. env.Replace(CC = env['TARGET_CC']) env.Replace(CXX = env['TARGET_CXX']) env.Replace(LINK = env['TARGET_LINK']) env.Replace(AR = env['TARGET_AR']) env.Replace(RANLIB = env['TARGET_RANLIB']) env['ENV']['PATH'] = env['TARGET_PATH'] env['ENV']['STAGING_DIR'] = env['STAGING_DIR'] config = Configure(env, custom_tests = { 'CheckCXXFlag' : CheckCXXFlag }) if not config.CheckCXXFlag('-std=c++11'): if not config.CheckCXXFlag('-std=c++0x'): print '*** Compiler too old to build AllJoyn. Aborting.' Exit(1) env = config.Finish() # Set Project and platform flags. env.Append(CPPFLAGS=['-Wno-deprecated']) # AllJoyn uses various deprecated template classes (i.e., hash_map) env.Append(CXXFLAGS=['-fno-exceptions']) env.Append(CPPDEFINES=['QCC_OS_LINUX']) env.Append(LIBS=['m']) # STL needs libm on OpenWrt env.AppendUnique(LIBS =['rt', 'stdc++', 'pthread', 'm']) if env['CRYPTO'] == 'openssl': env.AppendUnique(LIBS =['crypto', 'ssl']) print 'Using OpenSSL crypto' else: print 'Using builtin crypto' base-15.09/build_core/conf/windows/000077500000000000000000000000001262264444500172015ustar00rootroot00000000000000base-15.09/build_core/conf/windows/SConscript000066400000000000000000000216461262264444500212240ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import os Import('env') # Set up TMP env['ENV']['TMP'] = os.environ['TMP'] # MSVC version 8 and higher require a manifest if env['MSVC_VERSION'] >= '8.0': # Add a post-build step to embed the manifest using mt.exe # The number at the end of the line indicates the file type (1: EXE; 2:DLL). env.Append(LINKCOM=[env['LINKCOM'], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;1']) env.Append(SHLINKCOM=[env['SHLINKCOM'], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;2']) # Windows specific compiler flags env.Append(CPPDEFINES=['UNICODE', '_UNICODE', 'WIN32_LEAN_AND_MEAN', ('_VARIADIC_MAX','10')]) # Visual Studio compiler complains that functions like strncpy are unsafe. We # are aware that its possible to create a non-nul terminated string using the # strncpy function. However, we cannot use the strncpy_s functions as VC++ # suggests. Our code must work with a lot of different compilers so we cannot # use compiler specific code like strncpy_s. This will prevent visual studio # from giving errors we cannot do anything about. env.Append(CPPDEFINES=['_CRT_SECURE_NO_WARNINGS']) # Set MS OS version number if env['OS'] == 'win10': # Windows 10 env.Append(CPPDEFINES=[('_WIN32_WINNT', '_WIN32_WINNT_WIN10')]) elif env['OS'] == 'win7': # Windows 7 env.Append(CPPDEFINES=[('_WIN32_WINNT', '_WIN32_WINNT_WIN7')]) else: print 'Error: Unknown Windows OS type: ' + env['OS'] Exit(1) #Suppress specific warnings # C4244 'conversion' conversion from one type to another type results in a possible # loss of data. In AllJoyn code this occures most often when we convert a # socket file descriptor to an int. It may be worth while to investigate # warnings of this type but for now we are going to suppress them. # C4267 Conversion from size_t to another type. We get this because we often change # size_t to another value when we iterate though arrays. Although its possible # to cause issues we are going to suppress these warnings. # C4345 warning specifying that the later versions of MSVC initialize POD types # (Plan Old Data) This warning is designed to inform users that the behavior # changed from older compilers. This warning is only encountered by # common/src/String.cc and does not effect AllJoyn. # see http://msdn.microsoft.com/en-us/library/wewb47ee.aspx # C4355 "'this' used in base member initializer list"' Depending on the version of # the MSVC compiler this warning may or may not be shut off by default. # http://msdn.microsoft.com/en-us/library/3c594ae3.aspx # C4800 warning forcing value to 'true' or 'false'. This warning is produced when # a value is changed from an int or a pointer to a bool. Usage of code that # does it is common in AllJoyn. We often check to see if a pointer is NULL # by checking if( ptr) This also is a common problem in the language bindings # with things like QCC_BOOL and jboolean being defined as integers. For this # reason we are choosing to suppress this particular warning. # C4351 "new behavior: elements of array 'array' will be default initialized" # This warning is triggered when we initialize the guid array in the GUID128() # constructor. We intentionally want to initialize this array, so this behavior # change warning can safely be disabled. # C4146 "unary minus operator applied to unsigned type, result still unsigned" # The warning is triggered by the monty_rho() function in BigNum.cc when it # negates an unsigned value before truncating it to uint32_t. This is an # intentional part of the algorithm so the warning can be suppressed. # C4456 "declaration of 'foo' hides previous local declaration" # This warning (treated as an error) is produced when a local variable # is redefined multiple times under the same parent scope. # C4457 "declaration of 'foo' hides function parameter" # This warning (treated as an error) is produced when a function parameter # name is duplicated in the function body by a local variable named the same. # C4458 "declaration of 'foo' hides class member" # This warning (treated as an error) is produced when a class data member # name is duplicated in a class member method via an argument with the # same type and name and/or a local variable of the same. To avoid this # warning it is best to prefix data member names with "m_". env.Append(CXXFLAGS=['/wd4244', '/wd4267','/wd4345', '/wd4355', '/wd4800', '/wd4351', '/wd4146', '/wd4456', '/wd4457', '/wd4458']) env.Append(CFLAGS=['/nologo']) env.Append(CXXFLAGS=['/nologo']) env.Append(CFLAGS=['/EHsc']) env.Append(CXXFLAGS=['/EHsc']) # Enabling __stdcall calling convention on x86 results in smaller output EXE # files. This calling convention is also used by typical Windows APIs. if env['CPU'] == 'x86': env.Append(CFLAGS=['/Gz']) env.Append(CXXFLAGS=['/Gz']) # Lib setup env.Append(LFLAGS=['/NODEFAULTLIB:libcmt.lib']) env.Append(LINKFLAGS=['/NODEFAULTLIB:libcmt.lib']) # With a modern Microsoft compiler it is typical to use a pdb file i.e. the /Zi # or/ZI CCPDBFLAGS. However in SCons a pdb file is created for each .obj file. # To be able to use the debug information we would have to copy all of the # pdb files (one for each C++ file) into the dist. SCons documentation recommends # using the /Z7 option to solve this problem. Since another more acceptable # solution has not yet been found we are going with the recommendation from the # SCons documentation. env['CCPDBFLAGS'] = '/Z7' env['PDB'] = '${TARGET.base}.pdb' env.Append(LINKFLAGS=['/PDB:${TARGET.base}.pdb']) # Debug/Release variants if env['VARIANT'] == 'debug': # MSVC 2010 an newer require _ITERATOR_DEBUG_LEVEL specified to specify # _ITERATOR_DEBUG_LEVEL _DEBUG must also be specified. If _DEBUG is also # specified then the debug version of the multithread and run-time routines # (/MDd') to prevent build errors. env.Append(CPPDEFINES=['_DEBUG', ('_ITERATOR_DEBUG_LEVEL', 2)]) env.Append(CFLAGS=['/MDd', '/Od']) env.Append(CXXFLAGS=['/MDd', '/Od', '/Ob1', '/W4', '/WX']) env.Append(LINKFLAGS=['/debug']) env.Append(JAVACFLAGS='-g -Xlint -Xlint:-serial') else: # MSVC 2010 and newer require _ITERATOR_DEBUG_LEVEL specified env.Append(CPPDEFINES=[('_ITERATOR_DEBUG_LEVEL', 0)]) env.Append(CFLAGS=['/MD', '/Gy', '/O1', '/Ob2']) env.Append(CXXFLAGS=['/MD', '/Gy', '/O1', '/Ob2', '/W4', '/WX']) env.Append(LINKFLAGS=['/opt:ref']) env.Append(JAVACFLAGS='-Xlint -Xlint:-serial') vars = Variables() vars.Add(PathVariable('OPENSSL_BASE', 'Base OpenSSL directory (windows only)', os.environ.get('OPENSSL_BASE'))) vars.Update(env) Help(vars.GenerateHelpText(env)) env.AppendUnique(LIBS = ['setupapi', 'user32', 'winmm', 'ws2_32', 'iphlpapi', 'secur32', 'Advapi32']) if env['OS'] == 'win10': env.AppendUnique(LIBS = ['msajapi']) if env['CRYPTO'] == 'cng': env.AppendUnique(LIBS = ['bcrypt', 'ncrypt', 'crypt32']) env.Append(CPPDEFINES=['CRYPTO_CNG']) print 'Using CNG crypto libraries' elif env['CRYPTO'] == 'openssl': env.Append(CPPPATH = ['$OPENSSL_BASE/include']) env.Append(LIBPATH = ['$OPENSSL_BASE/lib']) env.AppendUnique(LIBS = ['libeay32']) print 'Using OpenSSL crypto libraries' else: print 'Only CRYPTO=cng or CRYPTO=openssl are supported for Windows.' Exit(1) # Archive expander def archive_expand(target, source, env): # Copy sources to targets outdir = env.subst(os.path.dirname(str(target[0]))) for archive in source: Copy(outdir, str(archive)) return None def archive_expand_emitter(target, source, env): # target starts out as phony file in the desired output directory # target ends up being the list of copied libraries outdir = env.subst(os.path.dirname(str(target[0]))) modTargets = [] for archive in source: modTargets.append(File(outdir+os.path.sep+os.path.basename(str(archive)))) return modTargets, source expand_bld = Builder(action=archive_expand, emitter=archive_expand_emitter) env.Append(BUILDERS={'ArchiveExpand' : expand_bld}) base-15.09/build_core/tools/000077500000000000000000000000001262264444500157225ustar00rootroot00000000000000base-15.09/build_core/tools/bin/000077500000000000000000000000001262264444500164725ustar00rootroot00000000000000base-15.09/build_core/tools/bin/.gitignore000066400000000000000000000000061262264444500204560ustar00rootroot00000000000000*.pyc base-15.09/build_core/tools/bin/make_status.py000077500000000000000000000240251262264444500213720ustar00rootroot00000000000000#!/usr/bin/python # Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import sys import os import getopt import copy from xml.dom import minidom if sys.version_info[:3] < (2,4,0): from sets import Set as set includeSet = set() def openFile(name, type): try: return open(name, type) except IOError, e: errno, errStr = e print "I/O Operation on %s failed" % name print "I/O Error(%d): %s" % (errno, errStr) raise e def main(argv=None): """ make_status --header --code --prefix --base [--commenCode] [--deps ] [--help] Where: - Output "C" header file - Output "C" code - Output code that maps status to comment - Prefix which is unique across all projects (see Makefile XXX_DIR) - Root directory for xi:include directives - Ouput makefile dependency file """ global headerOut global codeOut global depOut global isFirst global fileArgs global baseDir global prefix global CommentCodeOut headerOut = None codeOut = None depOut = None baseDir = "" prefix = "" CommentCodeOut = None if argv is None: argv = sys.argv[1:] try: opts, fileArgs = getopt.getopt(argv, "h", ["help", "header=", "code=", "dep=", "base=", "prefix=", "commentCode="]) for o, a in opts: if o in ("-h", "--help"): print __doc__ return 0 if o in ("--header"): headerOut = openFile(a, 'w') if o in ("--code"): codeOut = openFile(a, 'w') if o in ("--dep"): depOut = openFile(a, 'w') if o in ("--base"): baseDir = a if o in ("--prefix"): prefix = a if o in ("--commentCode"): CommentCodeOut = openFile(a, 'w') if None == headerOut or None == codeOut: raise Error("Must specify both --header and --code") isFirst = True includeSet.clear() writeHeaders() for arg in fileArgs: ret = parseAndWriteDocument(arg) writeFooters() if None != headerOut: headerOut.close() if None != codeOut: codeOut.close() if None != CommentCodeOut: CommentCodeOut.close() if None != depOut: depOut.close() except getopt.error, msg: print msg print "for help use --help" return 1 except Exception, e: print "ERROR: %s" % e if None != headerOut: os.unlink(headerOut.name) if None != codeOut: os.unlink(codeOut.name) if None != CommentCodeOut: os.unlink(CommentCodeOut.name) if None != depOut: os.unlink(depOut.name) return 1 return 0 def writeHeaders(): global headerOut global codeOut global depOut global fileArgs if None != depOut: depOut.write("%s %s %s:" % (depOut.name, codeOut.name, headerOut.name)) for arg in fileArgs: depOut.write(" \\\n %s" % arg) if None != headerOut: headerOut.write(""" /** * @file * This file contains an enumerated list values that QStatus can return * * Note: This file is generated during the make process. */ /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef _STATUS_H #define _STATUS_H /** * This @#define allows for setting of visibility support on relevant platforms */ #ifndef AJ_API # if defined(QCC_OS_GROUP_POSIX) # define AJ_API __attribute__((visibility("default"))) # else # define AJ_API # endif #endif /** This @#define allows for calling convention redefinition on relevant platforms */ #ifndef AJ_CALL # if defined(QCC_OS_GROUP_WINDOWS) # define AJ_CALL __stdcall # else # define AJ_CALL # endif #endif /** This @#define allows for calling convention redefinition on relevant platforms */ #ifndef CDECL_CALL # if defined(QCC_OS_GROUP_WINDOWS) # define CDECL_CALL __cdecl # else # define CDECL_CALL # endif #endif #ifdef __cplusplus extern "C" { #endif /** * Enumerated list of values QStatus can return */ typedef enum {""") if None != codeOut: codeOut.write(""" /** * @file * This file contains an enumerated list values that QStatus can return * * Note: This file is generated during the make process. */ /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include #include #define CASE(_status) case _status: return #_status """) codeOut.write("AJ_API const char* AJ_CALL QCC_%sStatusText(QStatus status)" % prefix) codeOut.write(""" { switch (status) { """) def writeFooters(): global headerOut global codeOut global depOut if None != depOut: depOut.write("\n") if None != headerOut: headerOut.write(""" } QStatus; /** * Convert a status code to a C string. * * @c %QCC_StatusText(ER_OK) returns the C string @c "ER_OK" * * @param status Status code to be converted. * * @return C string representation of the status code. */ """) headerOut.write("extern AJ_API const char* AJ_CALL QCC_%sStatusText(QStatus status);" % prefix) headerOut.write(""" #ifdef __cplusplus } /* extern "C" */ #endif #endif """) if None != codeOut: codeOut.write(""" default: static char code[22]; #ifdef _WIN32 _snprintf(code, sizeof(code), ": 0x%04x", status); #else snprintf(code, sizeof(code), ": 0x%04x", status); #endif return code; } } """) def parseAndWriteDocument(fileName): dom = minidom.parse(fileName) for child in dom.childNodes: if child.localName == 'status_block': parseAndWriteStatusBlock(child) elif child.localName == 'include' and child.namespaceURI == 'http://www.w3.org/2001/XInclude': parseAndWriteInclude(child) dom.unlink() def parseAndWriteStatusBlock(blockNode): global headerOut global codeOut global isFirst offset = 0 for node in blockNode.childNodes: if node.localName == 'offset': offset = int(node.firstChild.data, 0) elif node.localName == 'status': if isFirst: if None != headerOut: headerOut.write("\n %s = %s /**< %s */" % (node.getAttribute('name'), node.getAttribute('value'), node.getAttribute('comment'))) isFirst = False else: if None != headerOut: headerOut.write(",\n %s = %s /**< %s */" % (node.getAttribute('name'), node.getAttribute('value'), node.getAttribute('comment'))) if None != codeOut: codeOut.write(" CASE(%s);\n" % (node.getAttribute('name'))) offset += 1 elif node.localName == 'include' and node.namespaceURI == 'http://www.w3.org/2001/XInclude': parseAndWriteInclude(node) def parseAndWriteInclude(includeNode): global baseDir global includeSet href = os.path.join(baseDir, includeNode.attributes['href'].nodeValue) if href not in includeSet: includeSet.add(href) if None != depOut: depOut.write(" \\\n %s" % href) parseAndWriteDocument(href) if __name__ == "__main__": sys.exit(main()) #end base-15.09/build_core/tools/bin/whitespace.py000077500000000000000000000417701262264444500212140ustar00rootroot00000000000000#!/usr/bin/python # Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # # Another copy of this whitespace.py file exists in ajtcl to support Thin Client builds. # That copy is located in 'ajtcl/tools' # Changes to this file must be done here (build_core) and in ajtcl import sys, os, fnmatch, re, filecmp, difflib, textwrap import hashlib, pickle, time from subprocess import Popen, STDOUT, PIPE def main(argv=None): start_time = time.clock() dir_ignore = ["stlport", "build", ".git", ".repo", "alljoyn_objc", "ios", "external", ".sconf_temp" ] file_ignore_patterns = ['\.#.*', 'alljoyn_java\.h', 'Status\.h', 'Internal\.h', 'ManagedObj.h', #uncrustify has a problem with its private constructor 'org_alljoyn_jni_AllJoynAndroidExt\.h', 'org_alljoyn_bus_samples_chat_Chat\.h', 'org_allseen_sample_event_tester_BusHandler\.h', 'org_allseen_sample_action_tester_BusHandler\.h', 'org_alljoyn_bus_samples_simpleclient_Client\.h', 'org_alljoyn_bus_samples_simpleservice_Service\.h'] file_patterns = ['*.c', '*.h', '*.cpp', '*.cc'] valid_commands = ["check", "detail", "fix", "off"] uncrustify_config = None supported_uncrustify_versions = ["0.57", "0.61"] recommended_uncrustify_version = "0.61" unc_suffix = ".uncrustify" wscfg = None xit=0 sha_hash = hashlib.sha1() whitespace_db = {} whitespace_db_updated = False run_ws_check = True uncfile = None '''Verify uncrustify install and version''' version = get_uncrustify_version() if not version in supported_uncrustify_versions: print ("******************************************************************************") print ("* NOTICE ** NOTICE ** NOTICE *") print ("******************************************************************************") print ("You are using uncrustify v" + version + ".") print ("You must be using one of the following versions of uncrustify v" + (", v".join(supported_uncrustify_versions)) + "." ) print ("Please use the recommended version of uncrustify v" + recommended_uncrustify_version + "."); print "(Or, run SCons with 'WS=off' to bypass the whitespace check)" print ("******************************************************************************") sys.exit(2) if version != recommended_uncrustify_version: print ("******************************************************************************") print ("* NOTICE ** NOTICE ** NOTICE *") print ("******************************************************************************") print ("You are using uncrustify v" + version + ".") print ("Using an older version of uncrustify may result in inaccurate white space scans.") print ("Please use the recommended version of uncrustify v" + recommended_uncrustify_version + "."); print ("******************************************************************************") # if an legacy version of uncrustify does not correctly work for a specific file # and we can not find another way around the issues we can selectively ignore # files only for the legacy version of uncrustify. if version == "0.57": # v0.57 does not process #if and correctly file_ignore_patterns.append("atomic.cc") # v0.57 does not process the case statements correctly for the json_value.cc file file_ignore_patterns.append("json_value\.cc") # v0.57 does not process the case statements correctly file_ignore_patterns.append("BusAttachment\.cc") file_ignore_patterns.append("FileStream\.cc") # v0.57 does not process the case statements and goto labels correctly file_ignore_patterns.append("alljoyn_java\.cc") file_ignore_patterns.append("ProxyBusObject\.cc") # v0.57 of has a problem with multi-line strings and lines that start with # the '<<' stream operator most of these issues only exist in unit-test code file_ignore_patterns.append("SessionListenerTest\.cc") file_ignore_patterns.append("ProxyBusObjectTest\.cc") file_ignore_patterns.append("InterfaceDescriptionTest\.cc") file_ignore_patterns.append("MarshalTest\.cc") file_ignore_patterns.append("SRPTest\.cc") file_ignore_patterns.append("SessionTest\.cc") file_ignore_patterns.append("IPAddressTest\.cc") file_ignore_patterns.append("ASN1Test\.cc") file_ignore_patterns.append("bigNumTest\.cc") file_ignore_patterns.append("SocketTest\.cc") file_ignore_patterns.append("UtilTest\.cc") # v0.57 CruptoECC.cc has a return statement with a buch of ifdefs that # confuse the whitespace checker. file_ignore_patterns.append("CryptoECC\.cc") # v0.57 the use of QCC_DEPRECATED confuses the parser. file_ignore_patterns.append("AboutClient\.h") file_ignore_patterns.append("AboutIconClient\.h") # try an load the whitespace.db file. The file is dictionary of key:value pairs # where the key is the name of a file that has been checked by the WS checker # and the value is a sha1 blob calculated for the file. specified for the key # if the key is not found (i.e. a new file or first time this script has been # run) then the key will be added. If the file fails the WS check it will be # removed from the dictionary. If the file is new or the calculated hash has # changed the WS checker will check the file to see if it complies with the WS # rules. try: f = open('whitespace.db', 'r') try: whitespace_db = pickle.load(f) except pickle.UnpicklingError: os.remove('whitespace.db') finally: f.close() except IOError: print 'whitespace.db not found a new one will be created.' if argv is None: argv=[] if len(argv) > 0: wscmd = argv[0] else: wscmd = valid_commands[0] if len(argv) > 1: wscfg = os.path.normpath(argv[1]) if wscmd not in valid_commands: print "\'" + wscmd + "\'" + " is not a valid command" print_help() sys.exit(2) '''If config specified in CL then use that, otherwise search for it''' if wscfg: uncrustify_config = wscfg else: uncrustify_config = find_config() '''Cannot find config file''' if not uncrustify_config: print "Unable to find a config file" print_help() sys.exit(2) '''Specified config file is invalid''' if not os.path.isfile(uncrustify_config): print uncrustify_config + " does not exist or is not a file" print_help() sys.exit(2) print "whitespace %s %s" % (wscmd,uncrustify_config) print "cwd=%s" % (os.getcwd()) if wscmd == 'off': return 0 '''Get a list of source files and apply uncrustify to them''' for srcfile in locate(file_patterns, file_ignore_patterns, dir_ignore): f = open(srcfile, 'rb') uncfile = None filesize = os.path.getsize(srcfile) sha_digest = None try: # Compute the sha tag for the file the same way as git computes sha # tags this prevents whitespace changes being ignored. sha_hash.update("blob %u\0" % filesize) sha_hash.update(f.read()) sha_digest = sha_hash.hexdigest() finally: f.close() if sha_digest != None: try: if whitespace_db[srcfile] == sha_digest: run_ws_check = False else: whitespace_db[srcfile] = sha_digest run_ws_check = True whitespace_db_updated = True except KeyError: whitespace_db[srcfile] = sha_digest run_ws_check = True whitespace_db_updated = True if run_ws_check: uncfile = srcfile + unc_suffix '''Run uncrustify and generate uncrustify output file''' p = Popen( [ "uncrustify", "-c", uncrustify_config, srcfile, ], stdout=PIPE, stderr=STDOUT ) output = p.communicate()[0] if p.returncode: print "error exit, uncrustify -c %s %s" % ( uncrustify_config, srcfile ) print output print "whitespace check is not complete" del whitespace_db[srcfile] xit=2 break '''check command''' if wscmd == valid_commands[0]: '''If the src file and the uncrustify file are different then print the filename''' if not filecmp.cmp(srcfile, uncfile, False): print srcfile del whitespace_db[srcfile] xit=1 '''detail command''' if wscmd == valid_commands[1]: '''If the src file and the uncrustify file are different then diff the files''' if not filecmp.cmp(srcfile, uncfile, False): print '' print '******** FILE: ' + srcfile print '' print '******** BEGIN DIFF ********' fromlines = open(srcfile, 'U').readlines() tolines = open(uncfile, 'U').readlines() diff = difflib.unified_diff(fromlines, tolines, n=0) sys.stdout.writelines(diff) print '' print '********* END DIFF *********' print '' del whitespace_db[srcfile] xit=1 '''fix command''' if wscmd == valid_commands[2]: '''If the src file and the uncrustify file are different then print the filename so that the user can see what will be fixed''' if not filecmp.cmp(srcfile, uncfile, False): print srcfile del whitespace_db[srcfile] '''run uncrustify again and overwrite the non-compliant file with the uncrustify output''' p = Popen( [ "uncrustify", "-c", uncrustify_config, "--no-backup", srcfile, ], stdout=PIPE, stderr=STDOUT ) output = p.communicate()[0] if p.returncode: print "error exit, uncrustify -c %s --no-backup %s" % ( uncrustify_config, srcfile ) print output print "whitespace check is not complete" del whitespace_db[srcfile] xit=2 break '''remove the uncrustify output file''' if os.path.exists(uncfile): try: os.remove(uncfile) except OSError: print "Unable to remove uncrustify output file: " + uncfile # end srcfile loop if uncfile and os.path.exists(uncfile): try: os.remove(uncfile) except OSError: print "Unable to remove uncrustify output file: " + uncfile # write the whitespace_db to a file so it is avalible next time the whitespace # checker is run. if whitespace_db_updated: try: f = open('whitespace.db', 'w') try: pickle.dump(whitespace_db, f) finally: f.close() except IOError: print 'Unable to create whitespace.db file.' print 'WS total run time: {0:.2f} seconds'.format(time.clock() - start_time) return xit '''Return the uncrustify version number''' def get_uncrustify_version( ): version = None try: '''run the uncrustify version command''' output = Popen(["uncrustify", "-v"], stdout=PIPE).communicate()[0] except OSError: '''OSError probably indicates that uncrustify is not installed, so bail after printing helpful message''' print ("It appears that \'uncrustify\' is not installed or is not " + "on your PATH. Please check your system and try again.") print "(Or, run SCons with 'WS=off' to bypass the whitespace check)" sys.exit(2) else: '''extract version from output string''' p = re.compile('^uncrustify (\d.\d{2})') m = re.search(p, output) version = m.group(1) return version '''Command line argument help''' def print_help( ): prog = 'whitespace.py' print textwrap.dedent('''\ usage: %(prog)s [-h] [command] [uncrustify config] Apply uncrustify to C++ source files (.c, .h, .cc, .cpp), recursively, from the present working directory. Skips 'stlport', 'build', 'alljoyn_objc', 'ios', 'external', '.git', and '.repo' directories. Note: present working directory is presumed to be within, or the parent of, one of the AllJoyn archives. Script will automatically locate the uncrustify config file in build_core, or alternatively, the user may specify one. Enables users to see which source files are not in compliance with the AllJoyn whitespace policy and fix them as follows: check - prints list of non-compliant files (default) detail - prints diff of non-compliant files fix - modifies (fixes) non-compliant files Note that all files generated by uncrustify are removed. positional arguments: command options: check(default) | detail | fix uncrustify config specify an alternative uncrustify config (default=none) optional arguments: -h, --help show this help message and exit Examples: Get a list of non-compliant files using the alljoyn uncrustify config: >python %(prog)s --OR-- >python %(prog)s check Get a list of non-compliant files using your own uncrustify config: >python %(prog)s check r'myconfig.cfg' (note: use raw string) Get a diff of non-compliant files using the alljoyn uncrustify config: >python %(prog)s detail Fix non-compliant files using the alljoyn uncrustify config: >python %(prog)s fix''' % { 'prog': prog } ) '''Search for the uncrustify config file''' def find_config( ): tgtdir = "build_core" cfgname = "ajuncrustify.cfg" ajcfgrelpath = os.path.join(tgtdir, "tools", "conf", cfgname) ajcfgpath = None foundit = 0 DIRDEPTHMAX = 6 '''Limit directory search to depth DIRDEPTHMAX''' curdir = os.path.abspath(os.curdir) for i in range(DIRDEPTHMAX): if tgtdir in os.listdir(curdir): foundit = 1 break else: curdir = os.path.abspath(os.path.join(curdir, "..")) if foundit == 1 and os.path.exists(os.path.join(curdir, ajcfgrelpath)): ajcfgpath = os.path.join(curdir, ajcfgrelpath) return ajcfgpath '''Recurse through directories and locate files that match a given pattern''' def locate(file_patterns, file_ignore_patterns, dir_ignore_patterns, root=os.curdir): for path, dirs, files in os.walk(os.path.abspath(root)): '''Remove unwanted dirs''' for dip in dir_ignore_patterns: for dyr in dirs: if dyr == dip: dirs.remove(dyr) '''Remove unwanted files''' files_dict = {} for filename in files: files_dict[filename] = True for filename in files: for fip in file_ignore_patterns: if re.search(fip, filename) != None: del files_dict[filename] '''Collect the filtered list''' filtered_files = [] for filename in files_dict.keys(): filtered_files.append(filename) '''Filter the remainder using our wanted file pattern list''' for pattern in file_patterns: for filename in fnmatch.filter(filtered_files, pattern): yield os.path.join(path, filename) if __name__ == "__main__": if len(sys.argv) > 1: sys.exit(main(sys.argv[1:])) else: sys.exit(main()) #end base-15.09/build_core/tools/conf/000077500000000000000000000000001262264444500166475ustar00rootroot00000000000000base-15.09/build_core/tools/conf/ajuncrustify.0.57.cfg000066400000000000000000002055101262264444500224510ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # # Uncrustify 0.57 # # General options # # The type of line endings newlines = auto # auto/lf/crlf/cr # The original size of tabs in the input input_tab_size = 8 # number # The size of tabs in the output (only used if align_with_tabs=true) output_tab_size = 8 # number # The ASCII value of the string escape char, usually 92 (\) or 94 (^). (Pawn) string_escape_char = 92 # number # Alternate string escape char for Pawn. Only works right before the quote char. string_escape_char2 = 0 # number # # Indenting # # The number of columns to indent per level. # Usually 2, 3, 4, or 8. # DJM # indent_columns = 8 # number indent_columns = 4 # number # The continuation indent. If non-zero, this overrides the indent of '(' and '=' continuation indents. # For FreeBSD, this is set to 4. indent_continue = 0 # number # How to use tabs when indenting code # 0=spaces only # 1=indent with tabs to brace level, align with spaces # 2=indent and align with tabs, using spaces when not on a tabstop # DJM # indent_with_tabs = 1 # number indent_with_tabs = 0 # number # Comments that are not a brace level are indented with tabs on a tabstop. # Requires indent_with_tabs=2. If false, will use spaces. indent_cmt_with_tabs = false # false/true # Whether to indent strings broken by '\' so that they line up indent_align_string = false # false/true # The number of spaces to indent multi-line XML strings. # Requires indent_align_string=True indent_xml_string = 0 # number # Spaces to indent '{' from level indent_brace = 0 # number # Whether braces are indented to the body level indent_braces = false # false/true # Disabled indenting function braces if indent_braces is true indent_braces_no_func = false # false/true # Disabled indenting class braces if indent_braces is true indent_braces_no_class = false # false/true # Disabled indenting struct braces if indent_braces is true indent_braces_no_struct = false # false/true # Indent based on the size of the brace parent, i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc. indent_brace_parent = false # false/true # Whether the 'namespace' body is indented indent_namespace = false # false/true # The number of spaces to indent a namespace block indent_namespace_level = 0 # number # If the body of the namespace is longer than this number, it won't be indented. # Requires indent_namespace=true. Default=0 (no limit) indent_namespace_limit = 0 # number # Whether the 'extern "C"' body is indented indent_extern = false # false/true # Whether the 'class' body is indented # DJM # indent_class = false # false/true indent_class = true # false/true # Whether to indent the stuff after a leading class colon indent_class_colon = false # false/true # False=treat 'else\nif' as 'else if' for indenting purposes # True=indent the 'if' one level indent_else_if = false # false/true # Amount to indent variable declarations after a open brace. neg=relative, pos=absolute indent_var_def_blk = 0 # number # Indent continued variable declarations instead of aligning. indent_var_def_cont = false # false/true # True: indent continued function call parameters one indent level # False: align parameters under the open paren indent_func_call_param = false # false/true # Same as indent_func_call_param, but for function defs indent_func_def_param = false # false/true # Same as indent_func_call_param, but for function protos indent_func_proto_param = false # false/true # Same as indent_func_call_param, but for class declarations indent_func_class_param = false # false/true # Same as indent_func_call_param, but for class variable constructors indent_func_ctor_var_param = false # false/true # Same as indent_func_call_param, but for templates indent_template_param = false # false/true # Double the indent for indent_func_xxx_param options indent_func_param_double = false # false/true # Indentation column for standalone 'const' function decl/proto qualifier indent_func_const = 0 # number # Indentation column for standalone 'throw' function decl/proto qualifier indent_func_throw = 0 # number # The number of spaces to indent a continued '->' or '.' # Usually set to 0, 1, or indent_columns. indent_member = 0 # number # Spaces to indent single line ('//') comments on lines before code indent_sing_line_comments = 0 # number # If set, will indent trailing single line ('//') comments relative # to the code instead of trying to keep the same absolute column indent_relative_single_line_comments = false # false/true # Spaces to indent 'case' from 'switch' # Usually 0 or indent_columns. indent_switch_case = 0 # number # Spaces to shift the 'case' line, without affecting any other lines # Usually 0. indent_case_shift = 0 # number # Spaces to indent '{' from 'case'. # By default, the brace will appear under the 'c' in case. # Usually set to 0 or indent_columns. indent_case_brace = 4 # number # Whether to indent comments found in first column indent_col1_comment = false # false/true # How to indent goto labels # >0 : absolute column where 1 is the leftmost column # <=0 : subtract from brace indent # DJM # indent_label = 1 # number indent_label = -4 # number # Same as indent_label, but for access specifiers that are followed by a colon # DJM # indent_access_spec = 1 # number indent_access_spec = -2 # number # Indent the code after an access specifier by one level. # If set, this option forces 'indent_access_spec=0' indent_access_spec_body = false # false/true # If an open paren is followed by a newline, indent the next line so that it lines up after the open paren (not recommended) indent_paren_nl = false # false/true # Controls the indent of a close paren after a newline. # 0: Indent to body level # 1: Align under the open paren # 2: Indent to the brace level indent_paren_close = 0 # number # Controls the indent of a comma when inside a paren.If TRUE, aligns under the open paren indent_comma_paren = false # false/true # Controls the indent of a BOOL operator when inside a paren.If TRUE, aligns under the open paren indent_bool_paren = false # false/true # If 'indent_bool_paren' is true, controls the indent of the first expression. If TRUE, aligns the first expression to the following ones indent_first_bool_expr = false # false/true # If an open square is followed by a newline, indent the next line so that it lines up after the open square (not recommended) indent_square_nl = false # false/true # Don't change the relative indent of ESQL/C 'EXEC SQL' bodies indent_preserve_sql = false # false/true # Align continued statements at the '='. Default=True # If FALSE or the '=' is followed by a newline, the next line is indent one tab. indent_align_assign = true # false/true # # Spacing options # # Add or remove space around arithmetic operator '+', '-', '/', '*', etc # ASACORE-1026 we want to add space for arithmetic operators due to # a issue with uncrustify v0.57 not being able to always know the difference # between a pointer '*' and arithmetic '*' we are ignoring this rule # if uncrustify v0.57 is used. sp_arith = ignore # ignore/add/remove/force # Add or remove space around assignment operator '=', '+=', etc # DJM # sp_assign = ignore # ignore/add/remove/force sp_assign = add # ignore/add/remove/force # Add or remove space around assignment operator '=' in a prototype # DJM # sp_assign_default = ignore # ignore/add/remove/force sp_assign_default = add # ignore/add/remove/force # Add or remove space before assignment operator '=', '+=', etc. Overrides sp_assign. sp_before_assign = ignore # ignore/add/remove/force # Add or remove space after assignment operator '=', '+=', etc. Overrides sp_assign. sp_after_assign = ignore # ignore/add/remove/force # Add or remove space around assignment '=' in enum # DJM # sp_enum_assign = ignore # ignore/add/remove/force sp_enum_assign = add # ignore/add/remove/force # Add or remove space before assignment '=' in enum. Overrides sp_enum_assign. sp_enum_before_assign = ignore # ignore/add/remove/force # Add or remove space after assignment '=' in enum. Overrides sp_enum_assign. sp_enum_after_assign = ignore # ignore/add/remove/force # Add or remove space around preprocessor '##' concatenation operator. Default=Add sp_pp_concat = add # ignore/add/remove/force # Add or remove space after preprocessor '#' stringify operator. Also affects the '#@' charizing operator. Default=Add sp_pp_stringify = add # ignore/add/remove/force # Add or remove space around boolean operators '&&' and '||' # DJM # sp_bool = ignore # ignore/add/remove/force sp_bool = add # ignore/add/remove/force # Add or remove space around compare operator '<', '>', '==', etc # DJM # sp_compare = ignore # ignore/add/remove/force sp_compare = add # ignore/add/remove/force # Add or remove space inside '(' and ')' # DJM # sp_inside_paren = ignore # ignore/add/remove/force sp_inside_paren = remove # ignore/add/remove/force # Add or remove space between nested parens # DJM # sp_paren_paren = ignore # ignore/add/remove/force sp_paren_paren = remove # ignore/add/remove/force # Whether to balance spaces inside nested parens sp_balance_nested_parens = false # false/true # Add or remove space between ')' and '{' # DJM # sp_paren_brace = ignore # ignore/add/remove/force sp_paren_brace = add # ignore/add/remove/force # Add or remove space before pointer star '*' # DJM # sp_before_ptr_star = ignore # ignore/add/remove/force sp_before_ptr_star = remove # ignore/add/remove/force # Add or remove space before pointer star '*' that isn't followed by a variable name # If set to 'ignore', sp_before_ptr_star is used instead. sp_before_unnamed_ptr_star = ignore # ignore/add/remove/force # Add or remove space between pointer stars '*' sp_between_ptr_star = ignore # ignore/add/remove/force # Add or remove space after pointer star '*', if followed by a word. sp_after_ptr_star = ignore # ignore/add/remove/force # Add or remove space after a pointer star '*', if followed by a func proto/def. sp_after_ptr_star_func = ignore # ignore/add/remove/force # Add or remove space before a pointer star '*', if followed by a func proto/def. # DJM # sp_before_ptr_star_func = ignore # ignore/add/remove/force sp_before_ptr_star_func = remove # ignore/add/remove/force # Add or remove space before a reference sign '&' # DJM # sp_before_byref = ignore # ignore/add/remove/force sp_before_byref = remove # ignore/add/remove/force # Add or remove space before a reference sign '&' that isn't followed by a variable name # If set to 'ignore', sp_before_byref is used instead. sp_before_unnamed_byref = ignore # ignore/add/remove/force # Add or remove space after reference sign '&', if followed by a word. # DJM # sp_after_byref = ignore # ignore/add/remove/force sp_after_byref = add # ignore/add/remove/force # Add or remove space after a reference sign '&', if followed by a func proto/def. # DJM # sp_after_byref_func = ignore # ignore/add/remove/force sp_after_byref_func = add # ignore/add/remove/force # Add or remove space before a reference sign '&', if followed by a func proto/def. # DJM # sp_before_byref_func = ignore # ignore/add/remove/force sp_before_byref_func = remove # ignore/add/remove/force # Add or remove space between type and word. Default=Force sp_after_type = force # ignore/add/remove/force # Add or remove space in 'template <' vs 'template<'. # If set to ignore, sp_before_angle is used. # DJM # sp_template_angle = ignore # ignore/add/remove/force sp_template_angle = add # ignore/add/remove/force # Add or remove space before '<>' sp_before_angle = ignore # ignore/add/remove/force # Add or remove space inside '<' and '>' # DJM # sp_inside_angle = ignore # ignore/add/remove/force sp_inside_angle = remove # ignore/add/remove/force # Add or remove space after '<>' sp_after_angle = ignore # ignore/add/remove/force # Add or remove space between '<>' and '(' as found in 'new List();' sp_angle_paren = ignore # ignore/add/remove/force # Add or remove space between '<>' and a word as in 'List m;' # DJM # sp_angle_word = ignore # ignore/add/remove/force sp_angle_word = add # ignore/add/remove/force # Add or remove space between '>' and '>' in '>>' (template stuff C++/C# only). Default=Add sp_angle_shift = add # ignore/add/remove/force # Add or remove space before '(' of 'if', 'for', 'switch', and 'while' # DJM # sp_before_sparen = ignore # ignore/add/remove/force sp_before_sparen = add # ignore/add/remove/force # Add or remove space inside if-condition '(' and ')' # DJM # sp_inside_sparen = ignore # ignore/add/remove/force sp_inside_sparen = remove # ignore/add/remove/force # Add or remove space before if-condition ')'. Overrides sp_inside_sparen. sp_inside_sparen_close = ignore # ignore/add/remove/force # Add or remove space after ')' of 'if', 'for', 'switch', and 'while' # DJM # sp_after_sparen = ignore # ignore/add/remove/force sp_after_sparen = add # ignore/add/remove/force # Add or remove space between ')' and '{' of 'if', 'for', 'switch', and 'while' # DJM # sp_sparen_brace = ignore # ignore/add/remove/force sp_sparen_brace = add # ignore/add/remove/force # Add or remove space between 'invariant' and '(' in the D language. sp_invariant_paren = ignore # ignore/add/remove/force # Add or remove space after the ')' in 'invariant (C) c' in the D language. sp_after_invariant_paren = ignore # ignore/add/remove/force # Add or remove space before empty statement ';' on 'if', 'for' and 'while' sp_special_semi = ignore # ignore/add/remove/force # Add or remove space before ';'. Default=Remove sp_before_semi = remove # ignore/add/remove/force # Add or remove space before ';' in non-empty 'for' statements sp_before_semi_for = ignore # ignore/add/remove/force # Add or remove space before a semicolon of an empty part of a for statement. sp_before_semi_for_empty = ignore # ignore/add/remove/force # Add or remove space after ';', except when followed by a comment. Default=Add sp_after_semi = add # ignore/add/remove/force # Add or remove space after ';' in non-empty 'for' statements. Default=Force sp_after_semi_for = force # ignore/add/remove/force # Add or remove space after the final semicolon of an empty part of a for statement: for ( ; ; ). # DJM # sp_after_semi_for_empty = ignore # ignore/add/remove/force sp_after_semi_for_empty = remove # ignore/add/remove/force # Add or remove space before '[' (except '[]') sp_before_square = ignore # ignore/add/remove/force # Add or remove space before '[]' sp_before_squares = ignore # ignore/add/remove/force # Add or remove space inside '[' and ']' sp_inside_square = ignore # ignore/add/remove/force # Add or remove space after ',' # DJM # sp_after_comma = ignore # ignore/add/remove/force sp_after_comma = add # ignore/add/remove/force # Add or remove space before ',' sp_before_comma = remove # ignore/add/remove/force # Add or remove space between an open paren and comma: '(,' vs '( ,' sp_paren_comma = force # ignore/add/remove/force # Add or remove space before the variadic '...' when preceded by a non-punctuator sp_before_ellipsis = ignore # ignore/add/remove/force # Add or remove space after class ':' # DJM # sp_after_class_colon = ignore # ignore/add/remove/force sp_after_class_colon = add # ignore/add/remove/force # Add or remove space before class ':' # DJM # sp_before_class_colon = ignore # ignore/add/remove/force sp_before_class_colon = add # ignore/add/remove/force # Add or remove space before case ':'. Default=Remove sp_before_case_colon = remove # ignore/add/remove/force # Add or remove space between 'operator' and operator sign sp_after_operator = ignore # ignore/add/remove/force # Add or remove space between the operator symbol and the open paren, as in 'operator ++(' sp_after_operator_sym = ignore # ignore/add/remove/force # Add or remove space after C/D cast, i.e. 'cast(int)a' vs 'cast(int) a' or '(int)a' vs '(int) a' sp_after_cast = ignore # ignore/add/remove/force # Add or remove spaces inside cast parens sp_inside_paren_cast = ignore # ignore/add/remove/force # Add or remove space between the type and open paren in a C++ cast, i.e. 'int(exp)' vs 'int (exp)' sp_cpp_cast_paren = ignore # ignore/add/remove/force # Add or remove space between 'sizeof' and '(' sp_sizeof_paren = ignore # ignore/add/remove/force # Add or remove space after the tag keyword (Pawn) sp_after_tag = ignore # ignore/add/remove/force # Add or remove space inside enum '{' and '}' sp_inside_braces_enum = ignore # ignore/add/remove/force # Add or remove space inside struct/union '{' and '}' sp_inside_braces_struct = ignore # ignore/add/remove/force # Add or remove space inside '{' and '}' # DJM # sp_inside_braces = ignore # ignore/add/remove/force sp_inside_braces = add # ignore/add/remove/force # Add or remove space inside '{}' # DJM # sp_inside_braces_empty = ignore # ignore/add/remove/force sp_inside_braces_empty = add # ignore/add/remove/force # Add or remove space between return type and function name # A minimum of 1 is forced except for pointer return types. sp_type_func = ignore # ignore/add/remove/force # Add or remove space between function name and '(' on function declaration # DJM # sp_func_proto_paren = ignore # ignore/add/remove/force sp_func_proto_paren = remove # ignore/add/remove/force # Add or remove space between function name and '(' on function definition # DJM # sp_func_def_paren = ignore # ignore/add/remove/force sp_func_def_paren = remove # ignore/add/remove/force # Add or remove space inside empty function '()' # DJM # sp_inside_fparens = ignore # ignore/add/remove/force sp_inside_fparens = remove # ignore/add/remove/force # Add or remove space inside function '(' and ')' # DJM # sp_inside_fparen = ignore # ignore/add/remove/force sp_inside_fparen = remove # ignore/add/remove/force # Add or remove space between ']' and '(' when part of a function call. sp_square_fparen = ignore # ignore/add/remove/force # Add or remove space between ')' and '{' of function # DJM # sp_fparen_brace = ignore # ignore/add/remove/force sp_fparen_brace = add # ignore/add/remove/force # Add or remove space between function name and '(' on function calls # DJM # sp_func_call_paren = ignore # ignore/add/remove/force sp_func_call_paren = remove # ignore/add/remove/force # Add or remove space between function name and '()' on function calls without parameters. # If set to 'ignore' (the default), sp_func_call_paren is used. sp_func_call_paren_empty = ignore # ignore/add/remove/force # Add or remove space between the user function name and '(' on function calls # You need to set a keyword to be a user function, like this: 'set func_call_user _' in the config file. sp_func_call_user_paren = ignore # ignore/add/remove/force # Add or remove space between a constructor/destructor and the open paren # DJM # sp_func_class_paren = ignore # ignore/add/remove/force sp_func_class_paren = remove # ignore/add/remove/force # Add or remove space between 'return' and '(' sp_return_paren = ignore # ignore/add/remove/force # Add or remove space between '__attribute__' and '(' sp_attribute_paren = ignore # ignore/add/remove/force # Add or remove space between 'defined' and '(' in '#if defined (FOO)' sp_defined_paren = ignore # ignore/add/remove/force # Add or remove space between 'throw' and '(' in 'throw (something)' sp_throw_paren = ignore # ignore/add/remove/force # Add or remove space between macro and value sp_macro = ignore # ignore/add/remove/force # Add or remove space between macro function ')' and value sp_macro_func = ignore # ignore/add/remove/force # Add or remove space between 'else' and '{' if on the same line # DJM # sp_else_brace = ignore # ignore/add/remove/force sp_else_brace = add # ignore/add/remove/force # Add or remove space between '}' and 'else' if on the same line # DJM # sp_brace_else = ignore # ignore/add/remove/force sp_brace_else = add # ignore/add/remove/force # Add or remove space between '}' and the name of a typedef on the same line sp_brace_typedef = ignore # ignore/add/remove/force # Add or remove space between 'catch' and '{' if on the same line sp_catch_brace = ignore # ignore/add/remove/force # Add or remove space between '}' and 'catch' if on the same line sp_brace_catch = ignore # ignore/add/remove/force # Add or remove space between 'finally' and '{' if on the same line sp_finally_brace = ignore # ignore/add/remove/force # Add or remove space between '}' and 'finally' if on the same line sp_brace_finally = ignore # ignore/add/remove/force # Add or remove space between 'try' and '{' if on the same line sp_try_brace = ignore # ignore/add/remove/force # Add or remove space between get/set and '{' if on the same line sp_getset_brace = ignore # ignore/add/remove/force # Add or remove space before the '::' operator # DJM # sp_before_dc = ignore # ignore/add/remove/force sp_before_dc = remove # ignore/add/remove/force # Add or remove space after the '::' operator # DJM # sp_after_dc = ignore # ignore/add/remove/force sp_after_dc = remove # ignore/add/remove/force # Add or remove around the D named array initializer ':' operator sp_d_array_colon = ignore # ignore/add/remove/force # Add or remove space after the '!' (not) operator. Default=Remove sp_not = remove # ignore/add/remove/force # Add or remove space after the '~' (invert) operator. Default=Remove sp_inv = remove # ignore/add/remove/force # Add or remove space after the '&' (address-of) operator. Default=Remove # This does not affect the spacing after a '&' that is part of a type. sp_addr = remove # ignore/add/remove/force # Add or remove space around the '.' or '->' operators. Default=Remove sp_member = remove # ignore/add/remove/force # Add or remove space after the '*' (dereference) operator. Default=Remove # This does not affect the spacing after a '*' that is part of a type. sp_deref = remove # ignore/add/remove/force # Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'. Default=Remove sp_sign = remove # ignore/add/remove/force # Add or remove space before or after '++' and '--', as in '(--x)' or 'y++;'. Default=Remove sp_incdec = remove # ignore/add/remove/force # Add or remove space before a backslash-newline at the end of a line. Default=Add sp_before_nl_cont = add # ignore/add/remove/force # Add or remove space after the scope '+' or '-', as in '-(void) foo;' or '+(int) bar;' sp_after_oc_scope = ignore # ignore/add/remove/force # Add or remove space after the colon in message specs # '-(int) f:(int) x;' vs '-(int) f: (int) x;' sp_after_oc_colon = ignore # ignore/add/remove/force # Add or remove space before the colon in message specs # '-(int) f: (int) x;' vs '-(int) f : (int) x;' sp_before_oc_colon = ignore # ignore/add/remove/force # Add or remove space after the colon in message specs # '[object setValue:1];' vs '[object setValue: 1];' sp_after_send_oc_colon = ignore # ignore/add/remove/force # Add or remove space before the colon in message specs # '[object setValue:1];' vs '[object setValue :1];' sp_before_send_oc_colon = ignore # ignore/add/remove/force # Add or remove space after the (type) in message specs # '-(int)f: (int) x;' vs '-(int)f: (int)x;' sp_after_oc_type = ignore # ignore/add/remove/force # Add or remove space after the first (type) in message specs # '-(int) f:(int)x;' vs '-(int)f:(int)x;' sp_after_oc_return_type = ignore # ignore/add/remove/force # Add or remove space between '@selector' and '(' # '@selector(msgName)' vs '@selector (msgName)' # Also applies to @protocol() constructs sp_after_oc_at_sel = ignore # ignore/add/remove/force # Add or remove space between '@selector(x)' and the following word # '@selector(foo) a:' vs '@selector(foo)a:' sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force # Add or remove space inside '@selector' parens # '@selector(foo)' vs '@selector( foo )' # Also applies to @protocol() constructs sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force # Add or remove space before a block pointer caret # '^int (int arg){...}' vs. ' ^int (int arg){...}' sp_before_oc_block_caret = ignore # ignore/add/remove/force # Add or remove space after a block pointer caret # '^int (int arg){...}' vs. '^ int (int arg){...}' sp_after_oc_block_caret = ignore # ignore/add/remove/force # Add or remove space around the ':' in 'b ? t : f' # DJM # sp_cond_colon = ignore # ignore/add/remove/force sp_cond_colon = add # ignore/add/remove/force # Add or remove space around the '?' in 'b ? t : f' # DJM # sp_cond_question = ignore # ignore/add/remove/force sp_cond_question = add # ignore/add/remove/force # Fix the spacing between 'case' and the label. Only 'ignore' and 'force' make sense here. sp_case_label = ignore # ignore/add/remove/force # Control the space around the D '..' operator. sp_range = ignore # ignore/add/remove/force # Control the space after the opening of a C++ comment '// A' vs '//A' sp_cmt_cpp_start = ignore # ignore/add/remove/force # Controls the spaces between #else or #endif and a trailing comment sp_endif_cmt = ignore # ignore/add/remove/force # # Code alignment (not left column spaces/tabs) # # Whether to keep non-indenting tabs align_keep_tabs = false # false/true # Whether to use tabs for aligning align_with_tabs = false # false/true # Whether to bump out to the next tab when aligning align_on_tabstop = false # false/true # Whether to left-align numbers align_number_left = false # false/true # Align variable definitions in prototypes and functions align_func_params = false # false/true # Align parameters in single-line functions that have the same name. # The function names must already be aligned with each other. align_same_func_call_params = false # false/true # The span for aligning variable definitions (0=don't align) align_var_def_span = 0 # number # How to align the star in variable definitions. # 0=Part of the type 'void * foo;' # 1=Part of the variable 'void *foo;' # 2=Dangling 'void *foo;' align_var_def_star_style = 0 # number # How to align the '&' in variable definitions. # 0=Part of the type # 1=Part of the variable # 2=Dangling align_var_def_amp_style = 0 # number # The threshold for aligning variable definitions (0=no limit) align_var_def_thresh = 0 # number # The gap for aligning variable definitions align_var_def_gap = 0 # number # Whether to align the colon in struct bit fields align_var_def_colon = false # false/true # Whether to align any attribute after the variable name align_var_def_attribute = false # false/true # Whether to align inline struct/enum/union variable definitions align_var_def_inline = false # false/true # The span for aligning on '=' in assignments (0=don't align) align_assign_span = 0 # number # The threshold for aligning on '=' in assignments (0=no limit) align_assign_thresh = 0 # number # The span for aligning on '=' in enums (0=don't align) align_enum_equ_span = 0 # number # The threshold for aligning on '=' in enums (0=no limit) align_enum_equ_thresh = 0 # number # The span for aligning struct/union (0=don't align) align_var_struct_span = 0 # number # The threshold for aligning struct/union member definitions (0=no limit) align_var_struct_thresh = 0 # number # The gap for aligning struct/union member definitions align_var_struct_gap = 0 # number # The span for aligning struct initializer values (0=don't align) align_struct_init_span = 0 # number # The minimum space between the type and the synonym of a typedef align_typedef_gap = 0 # number # The span for aligning single-line typedefs (0=don't align) align_typedef_span = 0 # number # How to align typedef'd functions with other typedefs # 0: Don't mix them at all # 1: align the open paren with the types # 2: align the function type name with the other type names align_typedef_func = 0 # number # Controls the positioning of the '*' in typedefs. Just try it. # 0: Align on typedef type, ignore '*' # 1: The '*' is part of type name: typedef int *pint; # 2: The '*' is part of the type, but dangling: typedef int *pint; align_typedef_star_style = 0 # number # Controls the positioning of the '&' in typedefs. Just try it. # 0: Align on typedef type, ignore '&' # 1: The '&' is part of type name: typedef int &pint; # 2: The '&' is part of the type, but dangling: typedef int &pint; align_typedef_amp_style = 0 # number # The span for aligning comments that end lines (0=don't align) align_right_cmt_span = 0 # number # If aligning comments, mix with comments after '}' and #endif with less than 3 spaces before the comment align_right_cmt_mix = false # false/true # If a trailing comment is more than this number of columns away from the text it follows, # it will qualify for being aligned. This has to be > 0 to do anything. align_right_cmt_gap = 0 # number # Align trailing comment at or beyond column N; 'pulls in' comments as a bonus side effect (0=ignore) align_right_cmt_at_col = 0 # number # The span for aligning function prototypes (0=don't align) align_func_proto_span = 0 # number # Minimum gap between the return type and the function name. align_func_proto_gap = 0 # number # Align function protos on the 'operator' keyword instead of what follows align_on_operator = false # false/true # Whether to mix aligning prototype and variable declarations. # If true, align_var_def_XXX options are used instead of align_func_proto_XXX options. align_mix_var_proto = false # false/true # Align single-line functions with function prototypes, uses align_func_proto_span align_single_line_func = false # false/true # Aligning the open brace of single-line functions. # Requires align_single_line_func=true, uses align_func_proto_span align_single_line_brace = false # false/true # Gap for align_single_line_brace. align_single_line_brace_gap = 0 # number # The span for aligning ObjC msg spec (0=don't align) align_oc_msg_spec_span = 0 # number # Whether to align macros wrapped with a backslash and a newline. # This will not work right if the macro contains a multi-line comment. align_nl_cont = false # false/true # The minimum space between label and value of a preprocessor define align_pp_define_gap = 0 # number # The span for aligning on '#define' bodies (0=don't align) align_pp_define_span = 0 # number # Align lines that start with '<<' with previous '<<'. Default=true align_left_shift = true # false/true # Span for aligning parameters in an Obj-C message call on the ':' (0=don't align) align_oc_msg_colon_span = 0 # number # Aligning parameters in an Obj-C '+' or '-' declaration on the ':' align_oc_decl_colon = false # false/true # # Newline adding and removing options # # Whether to collapse empty blocks between '{' and '}' nl_collapse_empty_body = false # false/true # Don't split one-line braced assignments - 'foo_t f = { 1, 2 };' nl_assign_leave_one_liners = false # false/true # Don't split one-line braced statements inside a class xx { } body # DJM # nl_class_leave_one_liners = false # false/true nl_class_leave_one_liners = true # false/true # Don't split one-line enums: 'enum foo { BAR = 15 };' nl_enum_leave_one_liners = false # false/true # Don't split one-line get or set functions nl_getset_leave_one_liners = false # false/true # Don't split one-line function definitions - 'int foo() { return 0; }' nl_func_leave_one_liners = false # false/true # Don't split one-line if/else statements - 'if(a) b++;' nl_if_leave_one_liners = false # false/true # Add or remove newlines at the start of the file nl_start_of_file = ignore # ignore/add/remove/force # The number of newlines at the start of the file (only used if nl_start_of_file is 'add' or 'force' nl_start_of_file_min = 0 # number # Add or remove newline at the end of the file nl_end_of_file = ignore # ignore/add/remove/force # The number of newlines at the end of the file (only used if nl_end_of_file is 'add' or 'force') nl_end_of_file_min = 0 # number # Add or remove newline between '=' and '{' nl_assign_brace = ignore # ignore/add/remove/force # Add or remove newline between '=' and '[' (D only) nl_assign_square = ignore # ignore/add/remove/force # Add or remove newline after '= [' (D only). Will also affect the newline before the ']' nl_after_square_assign = ignore # ignore/add/remove/force # The number of blank lines after a block of variable definitions nl_func_var_def_blk = 0 # number # Add or remove newline between a function call's ')' and '{', as in: # list_for_each(item, &list) { } nl_fcall_brace = ignore # ignore/add/remove/force # Add or remove newline between 'enum' and '{' # DJM # nl_enum_brace = ignore # ignore/add/remove/force nl_enum_brace = remove # ignore/add/remove/force # Add or remove newline between 'struct and '{' # DJM # nl_struct_brace = ignore # ignore/add/remove/force nl_struct_brace = remove # ignore/add/remove/force # Add or remove newline between 'union' and '{' # DJM # nl_union_brace = ignore # ignore/add/remove/force nl_union_brace = remove # ignore/add/remove/force # Add or remove newline between 'if' and '{' # DJM # nl_if_brace = ignore # ignore/add/remove/force nl_if_brace = remove # ignore/add/remove/force # Add or remove newline between '}' and 'else' # DJM # nl_brace_else = ignore # ignore/add/remove/force nl_brace_else = remove # ignore/add/remove/force # Add or remove newline between 'else if' and '{' # If set to ignore, nl_if_brace is used instead nl_elseif_brace = ignore # ignore/add/remove/force # Add or remove newline between 'else' and '{' # DJM # nl_else_brace = ignore # ignore/add/remove/force nl_else_brace = remove # ignore/add/remove/force # Add or remove newline between 'else' and 'if' nl_else_if = ignore # ignore/add/remove/force # Add or remove newline between '}' and 'finally' # DJM # nl_brace_finally = ignore # ignore/add/remove/force nl_brace_finally = remove # ignore/add/remove/force # Add or remove newline between 'finally' and '{' # DJM # nl_finally_brace = ignore # ignore/add/remove/force nl_finally_brace = remove # ignore/add/remove/force # Add or remove newline between 'try' and '{' # DJM # nl_try_brace = ignore # ignore/add/remove/force nl_try_brace = remove # ignore/add/remove/force # Add or remove newline between get/set and '{' # DJM # nl_getset_brace = ignore # ignore/add/remove/force nl_getset_brace = remove # ignore/add/remove/force # Add or remove newline between 'for' and '{' # DJM # nl_for_brace = ignore # ignore/add/remove/force nl_for_brace = remove # ignore/add/remove/force # Add or remove newline between 'catch' and '{' # DJM # nl_catch_brace = ignore # ignore/add/remove/force nl_catch_brace = remove # ignore/add/remove/force # Add or remove newline between '}' and 'catch' # DJM # nl_brace_catch = ignore # ignore/add/remove/force nl_brace_catch = remove # ignore/add/remove/force # Add or remove newline between 'while' and '{' # DJM # nl_while_brace = ignore # ignore/add/remove/force nl_while_brace = remove # ignore/add/remove/force # Add or remove newline between 'using' and '{' nl_using_brace = ignore # ignore/add/remove/force # Add or remove newline between two open or close braces. # Due to general newline/brace handling, REMOVE may not work. nl_brace_brace = ignore # ignore/add/remove/force # Add or remove newline between 'do' and '{' # DJM # nl_do_brace = ignore # ignore/add/remove/force nl_do_brace = remove # ignore/add/remove/force # Add or remove newline between '}' and 'while' of 'do' statement # DJM # nl_brace_while = ignore # ignore/add/remove/force nl_brace_while = remove # ignore/add/remove/force # Add or remove newline between 'switch' and '{' # DJM # nl_switch_brace = ignore # ignore/add/remove/force nl_switch_brace = remove # ignore/add/remove/force # Add a newline between ')' and '{' if the ')' is on a different line than the if/for/etc. # Overrides nl_for_brace, nl_if_brace, nl_switch_brace, nl_while_switch, and nl_catch_brace. nl_multi_line_cond = false # false/true # Force a newline in a define after the macro name for multi-line defines. nl_multi_line_define = false # false/true # Whether to put a newline before 'case' statement # DJM # nl_before_case = false # false/true nl_before_case = true # false/true # Add or remove newline between ')' and 'throw' nl_before_throw = ignore # ignore/add/remove/force # Whether to put a newline after 'case' statement nl_after_case = false # false/true # Newline between namespace and { # DJM # nl_namespace_brace = ignore # ignore/add/remove/force nl_namespace_brace = remove # ignore/add/remove/force # Add or remove newline between 'template<>' and whatever follows. nl_template_class = ignore # ignore/add/remove/force # Add or remove newline between 'class' and '{' # DJM # nl_class_brace = ignore # ignore/add/remove/force nl_class_brace = remove # ignore/add/remove/force # Add or remove newline after each ',' in the constructor member initialization nl_class_init_args = ignore # ignore/add/remove/force # Add or remove newline between return type and function name in a function definition # DJM nl_func_type_name = ignore # ignore/add/remove/force # nl_func_type_name = remove # ignore/add/remove/force # Add or remove newline between return type and function name inside a class {} # Uses nl_func_type_name or nl_func_proto_type_name if set to ignore. # DJM nl_func_type_name_class = ignore # ignore/add/remove/force # nl_func_type_name_class = remove # ignore/add/remove/force # Add or remove newline between function scope and name in a definition # Controls the newline after '::' in 'void A::f() { }' nl_func_scope_name = ignore # ignore/add/remove/force # Add or remove newline between return type and function name in a prototype # DJM # nl_func_proto_type_name = ignore # ignore/add/remove/force nl_func_proto_type_name = remove # ignore/add/remove/force # Add or remove newline between a function name and the opening '(' # DJM # nl_func_paren = ignore # ignore/add/remove/force nl_func_paren = remove # ignore/add/remove/force # Add or remove newline between a function name and the opening '(' in the definition # DJM # nl_func_def_paren = ignore # ignore/add/remove/force nl_func_def_paren = remove # ignore/add/remove/force # Add or remove newline after '(' in a function declaration nl_func_decl_start = ignore # ignore/add/remove/force # Add or remove newline after '(' in a function definition nl_func_def_start = ignore # ignore/add/remove/force # Overrides nl_func_decl_start when there is only one parameter. nl_func_decl_start_single = ignore # ignore/add/remove/force # Overrides nl_func_def_start when there is only one parameter. nl_func_def_start_single = ignore # ignore/add/remove/force # Add or remove newline after each ',' in a function declaration nl_func_decl_args = ignore # ignore/add/remove/force # Add or remove newline after each ',' in a function definition nl_func_def_args = ignore # ignore/add/remove/force # Add or remove newline before the ')' in a function declaration nl_func_decl_end = ignore # ignore/add/remove/force # Add or remove newline before the ')' in a function definition nl_func_def_end = ignore # ignore/add/remove/force # Overrides nl_func_decl_end when there is only one parameter. nl_func_decl_end_single = ignore # ignore/add/remove/force # Overrides nl_func_def_end when there is only one parameter. nl_func_def_end_single = ignore # ignore/add/remove/force # Add or remove newline between '()' in a function declaration. nl_func_decl_empty = ignore # ignore/add/remove/force # Add or remove newline between '()' in a function definition. nl_func_def_empty = ignore # ignore/add/remove/force # Add or remove newline between function signature and '{' nl_fdef_brace = ignore # ignore/add/remove/force # Whether to put a newline after 'return' statement nl_after_return = false # false/true # Add or remove a newline between the return keyword and return expression. nl_return_expr = ignore # ignore/add/remove/force # Whether to put a newline after semicolons, except in 'for' statements nl_after_semicolon = false # false/true # Whether to put a newline after brace open. # This also adds a newline before the matching brace close. nl_after_brace_open = false # false/true # If nl_after_brace_open and nl_after_brace_open_cmt are true, a newline is # placed between the open brace and a trailing single-line comment. nl_after_brace_open_cmt = false # false/true # Whether to put a newline after a virtual brace open with a non-empty body. # These occur in un-braced if/while/do/for statement bodies. nl_after_vbrace_open = false # false/true # Whether to put a newline after a virtual brace open with an empty body. # These occur in un-braced if/while/do/for statement bodies. nl_after_vbrace_open_empty = false # false/true # Whether to put a newline after a brace close. # Does not apply if followed by a necessary ';'. nl_after_brace_close = false # false/true # Whether to put a newline after a virtual brace close. # Would add a newline before return in: 'if (foo) a++; return;' nl_after_vbrace_close = false # false/true # Whether to alter newlines in '#define' macros nl_define_macro = false # false/true # Whether to not put blanks after '#ifxx', '#elxx', or before '#endif' nl_squeeze_ifdef = false # false/true # Add or remove blank line before 'if' nl_before_if = ignore # ignore/add/remove/force # Add or remove blank line after 'if' statement nl_after_if = ignore # ignore/add/remove/force # Add or remove blank line before 'for' nl_before_for = ignore # ignore/add/remove/force # Add or remove blank line after 'for' statement nl_after_for = ignore # ignore/add/remove/force # Add or remove blank line before 'while' nl_before_while = ignore # ignore/add/remove/force # Add or remove blank line after 'while' statement nl_after_while = ignore # ignore/add/remove/force # Add or remove blank line before 'switch' nl_before_switch = ignore # ignore/add/remove/force # Add or remove blank line after 'switch' statement nl_after_switch = ignore # ignore/add/remove/force # Add or remove blank line before 'do' nl_before_do = ignore # ignore/add/remove/force # Add or remove blank line after 'do/while' statement nl_after_do = ignore # ignore/add/remove/force # Whether to double-space commented-entries in struct/enum nl_ds_struct_enum_cmt = false # false/true # Whether to double-space before the close brace of a struct/union/enum # (lower priority than 'eat_blanks_before_close_brace') nl_ds_struct_enum_close_brace = false # false/true # Add or remove a newline around a class colon. # Related to pos_class_colon, nl_class_init_args, and pos_comma. nl_class_colon = ignore # ignore/add/remove/force # Change simple unbraced if statements into a one-liner # 'if(b)\n i++;' => 'if(b) i++;' nl_create_if_one_liner = false # false/true # Change simple unbraced for statements into a one-liner # 'for (i=0;i<5;i++)\n foo(i);' => 'for (i=0;i<5;i++) foo(i);' nl_create_for_one_liner = false # false/true # Change simple unbraced while statements into a one-liner # 'while (i<5)\n foo(i++);' => 'while (i<5) foo(i++);' nl_create_while_one_liner = false # false/true # # Positioning options # # The position of arithmetic operators in wrapped expressions pos_arith = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of assignment in wrapped expressions. # Do not affect '=' followed by '{' pos_assign = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of boolean operators in wrapped expressions pos_bool = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of comparison operators in wrapped expressions pos_compare = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of conditional (b ? t : f) operators in wrapped expressions pos_conditional = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of the comma in wrapped expressions pos_comma = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of the comma in the constructor initialization list pos_class_comma = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of colons between constructor and member initialization pos_class_colon = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # # Line Splitting options # # Try to limit code width to N number of columns code_width = 0 # number # Whether to fully split long 'for' statements at semi-colons ls_for_split_full = false # false/true # Whether to fully split long function protos/calls at commas ls_func_split_full = false # false/true # # Blank line options # # The maximum consecutive newlines nl_max = 0 # number # The number of newlines after a function prototype, if followed by another function prototype nl_after_func_proto = 0 # number # The number of newlines after a function prototype, if not followed by another function prototype nl_after_func_proto_group = 0 # number # The number of newlines after '}' of a multi-line function body nl_after_func_body = 0 # number # The number of newlines after '}' of a single line function body nl_after_func_body_one_liner = 0 # number # The minimum number of newlines before a multi-line comment. # Doesn't apply if after a brace open or another multi-line comment. nl_before_block_comment = 0 # number # The minimum number of newlines before a single-line C comment. # Doesn't apply if after a brace open or other single-line C comments. nl_before_c_comment = 0 # number # The minimum number of newlines before a CPP comment. # Doesn't apply if after a brace open or other CPP comments. nl_before_cpp_comment = 0 # number # Whether to force a newline after a multi-line comment. nl_after_multiline_comment = false # false/true # The number of newlines before a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. # Will not change the newline count if after a brace open. # 0 = No change. nl_before_access_spec = 0 # number # The number of newlines after a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. # 0 = No change. nl_after_access_spec = 0 # number # The number of newlines between a function def and the function comment. # 0 = No change. nl_comment_func_def = 0 # number # The number of newlines after a try-catch-finally block that isn't followed by a brace close. # 0 = No change. nl_after_try_catch_finally = 0 # number # The number of newlines before and after a property, indexer or event decl. # 0 = No change. nl_around_cs_property = 0 # number # The number of newlines between the get/set/add/remove handlers in C#. # 0 = No change. nl_between_get_set = 0 # number # Whether to remove blank lines after '{' eat_blanks_after_open_brace = false # false/true # Whether to remove blank lines before '}' eat_blanks_before_close_brace = false # false/true # # Code modifying options (non-whitespace) # # Add or remove braces on single-line 'do' statement mod_full_brace_do = ignore # ignore/add/remove/force # Add or remove braces on single-line 'for' statement mod_full_brace_for = ignore # ignore/add/remove/force # Add or remove braces on single-line function definitions. (Pawn) mod_full_brace_function = ignore # ignore/add/remove/force # Add or remove braces on single-line 'if' statement. Will not remove the braces if they contain an 'else'. mod_full_brace_if = add # ignore/add/remove/force # Make all if/elseif/else statements in a chain be braced or not. Overrides mod_full_brace_if. # If any must be braced, they are all braced. If all can be unbraced, then the braces are removed. mod_full_brace_if_chain = false # false/true # Don't remove braces around statements that span N newlines mod_full_brace_nl = 0 # number # Add or remove braces on single-line 'while' statement mod_full_brace_while = ignore # ignore/add/remove/force # Add or remove braces on single-line 'using ()' statement mod_full_brace_using = ignore # ignore/add/remove/force # Add or remove unnecessary paren on 'return' statement mod_paren_on_return = ignore # ignore/add/remove/force # Whether to change optional semicolons to real semicolons mod_pawn_semicolon = false # false/true # Add parens on 'while' and 'if' statement around bools mod_full_paren_if_bool = false # false/true # Whether to remove superfluous semicolons mod_remove_extra_semicolon = false # false/true # If a function body exceeds the specified number of newlines and doesn't have a comment after # the close brace, a comment will be added. mod_add_long_function_closebrace_comment = 0 # number # If a switch body exceeds the specified number of newlines and doesn't have a comment after # the close brace, a comment will be added. mod_add_long_switch_closebrace_comment = 0 # number # If an #ifdef body exceeds the specified number of newlines and doesn't have a comment after # the #else, a comment will be added. mod_add_long_ifdef_endif_comment = 0 # number # If an #ifdef or #else body exceeds the specified number of newlines and doesn't have a comment after # the #endif, a comment will be added. mod_add_long_ifdef_else_comment = 0 # number # If TRUE, will sort consecutive single-line 'import' statements [Java, D] mod_sort_import = false # false/true # If TRUE, will sort consecutive single-line 'using' statements [C#] mod_sort_using = false # false/true # If TRUE, will sort consecutive single-line '#include' statements [C/C++] and '#import' statements [Obj-C] # This is generally a bad idea, as it may break your code. mod_sort_include = false # false/true # If TRUE, it will move a 'break' that appears after a fully braced 'case' before the close brace. mod_move_case_break = false # false/true # Will add or remove the braces around a fully braced case statement. # Will only remove the braces if there are no variable declarations in the block. mod_case_brace = ignore # ignore/add/remove/force # If TRUE, it will remove a void 'return;' that appears as the last statement in a function. mod_remove_empty_return = false # false/true # # Comment modifications # # Try to wrap comments at cmt_width columns cmt_width = 0 # number # Set the comment reflow mode (default: 0) # 0: no reflowing (apart from the line wrapping due to cmt_width) # 1: no touching at all # 2: full reflow cmt_reflow_mode = 0 # number # If false, disable all multi-line comment changes, including cmt_width. keyword substitution, and leading chars. # Default is true. cmt_indent_multi = true # false/true # Whether to group c-comments that look like they are in a block cmt_c_group = false # false/true # Whether to put an empty '/*' on the first line of the combined c-comment cmt_c_nl_start = false # false/true # Whether to put a newline before the closing '*/' of the combined c-comment cmt_c_nl_end = false # false/true # Whether to group cpp-comments that look like they are in a block cmt_cpp_group = false # false/true # Whether to put an empty '/*' on the first line of the combined cpp-comment cmt_cpp_nl_start = false # false/true # Whether to put a newline before the closing '*/' of the combined cpp-comment cmt_cpp_nl_end = false # false/true # Whether to change cpp-comments into c-comments cmt_cpp_to_c = false # false/true # Whether to put a star on subsequent comment lines cmt_star_cont = false # false/true # The number of spaces to insert at the start of subsequent comment lines cmt_sp_before_star_cont = 0 # number # The number of spaces to insert after the star on subsequent comment lines # DJM # cmt_sp_after_star_cont = 0 # number cmt_sp_after_star_cont = 1 # number # For multi-line comments with a '*' lead, remove leading spaces if the first and last lines of # the comment are the same length. Default=True # DJM # cmt_multi_check_last = true # false/true cmt_multi_check_last = false # false/true # The filename that contains text to insert at the head of a file if the file doesn't start with a C/C++ comment. # Will substitute $(filename) with the current file's name. cmt_insert_file_header = "" # string # The filename that contains text to insert at the end of a file if the file doesn't end with a C/C++ comment. # Will substitute $(filename) with the current file's name. cmt_insert_file_footer = "" # string # The filename that contains text to insert before a function implementation if the function isn't preceded with a C/C++ comment. # Will substitute $(function) with the function name and $(javaparam) with the javadoc @param and @return stuff. # Will also substitute $(fclass) with the class name: void CFoo::Bar() { ... } cmt_insert_func_header = "" # string # The filename that contains text to insert before a class if the class isn't preceded with a C/C++ comment. # Will substitute $(class) with the class name. cmt_insert_class_header = "" # string # If a preprocessor is encountered when stepping backwards from a function name, then # this option decides whether the comment should be inserted. # Affects cmt_insert_func_header and cmt_insert_class_header. cmt_insert_before_preproc = false # false/true # # Preprocessor options # # Control indent of preprocessors inside #if blocks at brace level 0 pp_indent = ignore # ignore/add/remove/force # Whether to indent #if/#else/#endif at the brace level (true) or from column 1 (false) pp_indent_at_level = false # false/true # If pp_indent_at_level=false, specifies the number of columns to indent per level. Default=1. pp_indent_count = 1 # number # Add or remove space after # based on pp_level of #if blocks pp_space = ignore # ignore/add/remove/force # Sets the number of spaces added with pp_space pp_space_count = 0 # number # The indent for #region and #endregion in C# and '#pragma region' in C/C++ pp_indent_region = 0 # number # Whether to indent the code between #region and #endregion pp_region_indent_code = false # false/true # If pp_indent_at_level=true, sets the indent for #if, #else, and #endif when not at file-level pp_indent_if = 0 # number # Control whether to indent the code between #if, #else and #endif when not at file-level pp_if_indent_code = false # false/true # Whether to indent '#define' at the brace level (true) or from column 1 (false) pp_define_at_level = false # false/true # You can force a token to be a type with the 'type' option. # Example: # type myfoo1 myfoo2 # # You can create custom macro-based indentation using macro-open, # macro-else and macro-close. # Example: # macro-open BEGIN_TEMPLATE_MESSAGE_MAP # macro-open BEGIN_MESSAGE_MAP # macro-close END_MESSAGE_MAP # # You can assign any keyword to any type with the set option. # set func_call_user _ N_ # # The full syntax description of all custom definition config entries # is shown below: # # define custom tokens as: # - embed whitespace in token using '' escape character, or # put token in quotes # - these: ' " and ` are recognized as quote delimiters # # type token1 token2 token3 ... # ^ optionally specify multiple tokens on a single line # define def_token output_token # ^ output_token is optional, then NULL is assumed # macro-open token # macro-close token # macro-else token # set id token1 token2 ... # ^ optionally specify multiple tokens on a single line # ^ id is one of the names in token_enum.h sans the CT_ prefix, # e.g. PP_PRAGMA # # all tokens are separated by any mix of ',' commas, '=' equal signs # and whitespace (space, tab) # base-15.09/build_core/tools/conf/ajuncrustify.0.61.cfg000066400000000000000000002453651262264444500224600ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Uncrustify 0.61 # # General options # # The type of line endings newlines = auto # auto/lf/crlf/cr # The original size of tabs in the input input_tab_size = 8 # number # The size of tabs in the output (only used if align_with_tabs=true) output_tab_size = 8 # number # The ASCII value of the string escape char, usually 92 (\) or 94 (^). (Pawn) string_escape_char = 92 # number # Alternate string escape char for Pawn. Only works right before the quote char. string_escape_char2 = 0 # number # Allow interpreting '>=' and '>>=' as part of a template in 'void f(list>=val);'. # If true (default), 'assert(x<0 && y>=3)' will be broken. # Improvements to template detection may make this option obsolete. tok_split_gte = false # false/true # Control what to do with the UTF-8 BOM (recommend 'remove') utf8_bom = remove # ignore/add/remove/force # If the file contains bytes with values between 128 and 255, but is not UTF-8, then output as UTF-8 utf8_byte = false # false/true # Force the output encoding to UTF-8 utf8_force = false # false/true # # Indenting # # The number of columns to indent per level. # Usually 2, 3, 4, or 8. # DJM # indent_columns = 8 # number indent_columns = 4 # number # The continuation indent. If non-zero, this overrides the indent of '(' and '=' continuation indents. # For FreeBSD, this is set to 4. Negative value is absolute and not increased for each ( level indent_continue = 0 # number # How to use tabs when indenting code # 0=spaces only # 1=indent with tabs to brace level, align with spaces # 2=indent and align with tabs, using spaces when not on a tabstop # DJM # indent_with_tabs = 1 # number indent_with_tabs = 0 # number # Comments that are not a brace level are indented with tabs on a tabstop. # Requires indent_with_tabs=2. If false, will use spaces. indent_cmt_with_tabs = false # false/true # Whether to indent strings broken by '\' so that they line up indent_align_string = false # false/true # The number of spaces to indent multi-line XML strings. # Requires indent_align_string=True indent_xml_string = 0 # number # Spaces to indent '{' from level indent_brace = 0 # number # Whether braces are indented to the body level indent_braces = false # false/true # Disabled indenting function braces if indent_braces is true indent_braces_no_func = false # false/true # Disabled indenting class braces if indent_braces is true indent_braces_no_class = false # false/true # Disabled indenting struct braces if indent_braces is true indent_braces_no_struct = false # false/true # Indent based on the size of the brace parent, i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc. indent_brace_parent = false # false/true # Indent based on the paren open instead of the brace open in '({\n', default is to indent by brace. indent_paren_open_brace = false # false/true # Whether the 'namespace' body is indented indent_namespace = false # false/true # Only indent one namespace and no sub-namepaces. # Requires indent_namespace=true. indent_namespace_single_indent = false # false/true # The number of spaces to indent a namespace block indent_namespace_level = 0 # number # If the body of the namespace is longer than this number, it won't be indented. # Requires indent_namespace=true. Default=0 (no limit) indent_namespace_limit = 0 # number # Whether the 'extern "C"' body is indented indent_extern = false # false/true # Whether the 'class' body is indented # DJM # indent_class = false # false/true indent_class = true # false/true # Whether to indent the stuff after a leading base class colon indent_class_colon = false # false/true # Whether to indent the stuff after a leading class initializer colon indent_constr_colon = false # false/true # Virtual indent from the ':' for member initializers. Default is 2 indent_ctor_init_leading = 2 # number # Additional indenting for constructor initializer list indent_ctor_init = 0 # number # False=treat 'else\nif' as 'else if' for indenting purposes # True=indent the 'if' one level indent_else_if = false # false/true # Amount to indent variable declarations after a open brace. neg=relative, pos=absolute indent_var_def_blk = 0 # number # Indent continued variable declarations instead of aligning. indent_var_def_cont = false # false/true # True: force indentation of function definition to start in column 1 # False: use the default behavior indent_func_def_force_col1 = false # false/true # True: indent continued function call parameters one indent level # False: align parameters under the open paren indent_func_call_param = false # false/true # Same as indent_func_call_param, but for function defs indent_func_def_param = false # false/true # Same as indent_func_call_param, but for function protos indent_func_proto_param = false # false/true # Same as indent_func_call_param, but for class declarations indent_func_class_param = false # false/true # Same as indent_func_call_param, but for class variable constructors indent_func_ctor_var_param = false # false/true # Same as indent_func_call_param, but for templates indent_template_param = false # false/true # Double the indent for indent_func_xxx_param options indent_func_param_double = false # false/true # Indentation column for standalone 'const' function decl/proto qualifier indent_func_const = 0 # number # Indentation column for standalone 'throw' function decl/proto qualifier indent_func_throw = 0 # number # The number of spaces to indent a continued '->' or '.' # Usually set to 0, 1, or indent_columns. indent_member = 0 # number # Spaces to indent single line ('//') comments on lines before code indent_sing_line_comments = 0 # number # If set, will indent trailing single line ('//') comments relative # to the code instead of trying to keep the same absolute column indent_relative_single_line_comments = false # false/true # Spaces to indent 'case' from 'switch' # Usually 0 or indent_columns. indent_switch_case = 0 # number # Spaces to shift the 'case' line, without affecting any other lines # Usually 0. indent_case_shift = 0 # number # Spaces to indent '{' from 'case'. # By default, the brace will appear under the 'c' in case. # Usually set to 0 or indent_columns. indent_case_brace = 4 # number # Whether to indent comments found in first column indent_col1_comment = false # false/true # How to indent goto labels # >0 : absolute column where 1 is the leftmost column # <=0 : subtract from brace indent # DJM # indent_label = 1 # number indent_label = -4 # number # Same as indent_label, but for access specifiers that are followed by a colon # DJM # indent_access_spec = 1 # number indent_access_spec = -2 # number # Indent the code after an access specifier by one level. # If set, this option forces 'indent_access_spec=0' indent_access_spec_body = false # false/true # If an open paren is followed by a newline, indent the next line so that it lines up after the open paren (not recommended) indent_paren_nl = false # false/true # Controls the indent of a close paren after a newline. # 0: Indent to body level # 1: Align under the open paren # 2: Indent to the brace level indent_paren_close = 0 # number # Controls the indent of a comma when inside a paren.If TRUE, aligns under the open paren indent_comma_paren = false # false/true # Controls the indent of a BOOL operator when inside a paren.If TRUE, aligns under the open paren indent_bool_paren = false # false/true # If 'indent_bool_paren' is true, controls the indent of the first expression. If TRUE, aligns the first expression to the following ones indent_first_bool_expr = false # false/true # If an open square is followed by a newline, indent the next line so that it lines up after the open square (not recommended) indent_square_nl = false # false/true # Don't change the relative indent of ESQL/C 'EXEC SQL' bodies indent_preserve_sql = false # false/true # Align continued statements at the '='. Default=True # If FALSE or the '=' is followed by a newline, the next line is indent one tab. indent_align_assign = true # false/true # Indent OC blocks at brace level instead of usual rules. indent_oc_block = false # false/true # Indent OC blocks in a message relative to the parameter name. # 0=use indent_oc_block rules, 1+=spaces to indent indent_oc_block_msg = 0 # number # Minimum indent for subsequent parameters indent_oc_msg_colon = 0 # number # If true, prioritize aligning with initial colon (and stripping spaces from lines, if necessary). # Default is true. indent_oc_msg_prioritize_first_colon = true # false/true # If indent_oc_block_msg and this option are on, blocks will be indented the way that Xcode does by default (from keyword if the parameter is on its own line; otherwise, from the previous indentation level). indent_oc_block_msg_xcode_style = false # false/true # If indent_oc_block_msg and this option are on, blocks will be indented from where the brace is relative to a msg keyword. indent_oc_block_msg_from_keyword = false # false/true # If indent_oc_block_msg and this option are on, blocks will be indented from where the brace is relative to a msg colon. indent_oc_block_msg_from_colon = false # false/true # If indent_oc_block_msg and this option are on, blocks will be indented from where the block caret is. indent_oc_block_msg_from_caret = false # false/true # If indent_oc_block_msg and this option are on, blocks will be indented from where the brace is. indent_oc_block_msg_from_brace = false # false/true # # Spacing options # # Add or remove space around arithmetic operator '+', '-', '/', '*', etc # DJM # sp_arith = ignore # ignore/add/remove/force sp_arith = add # ignore/add/remove/force # Add or remove space around assignment operator '=', '+=', etc # DJM # sp_assign = ignore # ignore/add/remove/force sp_assign = add # ignore/add/remove/force # Add or remove space around '=' in C++11 lambda capture specifications. Overrides sp_assign sp_cpp_lambda_assign = ignore # ignore/add/remove/force # Add or remove space after the capture specification in C++11 lambda. sp_cpp_lambda_paren = ignore # ignore/add/remove/force # Add or remove space around assignment operator '=' in a prototype # DJM # sp_assign_default = ignore # ignore/add/remove/force sp_assign_default = add # ignore/add/remove/force # Add or remove space before assignment operator '=', '+=', etc. Overrides sp_assign. sp_before_assign = ignore # ignore/add/remove/force # Add or remove space after assignment operator '=', '+=', etc. Overrides sp_assign. sp_after_assign = ignore # ignore/add/remove/force # Add or remove space in 'NS_ENUM (' sp_enum_paren = ignore # ignore/add/remove/force # Add or remove space around assignment '=' in enum # DJM # sp_enum_assign = ignore # ignore/add/remove/force sp_enum_assign = add # ignore/add/remove/force # Add or remove space before assignment '=' in enum. Overrides sp_enum_assign. sp_enum_before_assign = ignore # ignore/add/remove/force # Add or remove space after assignment '=' in enum. Overrides sp_enum_assign. sp_enum_after_assign = ignore # ignore/add/remove/force # Add or remove space around preprocessor '##' concatenation operator. Default=Add sp_pp_concat = add # ignore/add/remove/force # Add or remove space after preprocessor '#' stringify operator. Also affects the '#@' charizing operator. sp_pp_stringify = add # ignore/add/remove/force # Add or remove space before preprocessor '#' stringify operator as in '#define x(y) L#y'. sp_before_pp_stringify = ignore # ignore/add/remove/force # Add or remove space around boolean operators '&&' and '||' # DJM # sp_bool = ignore # ignore/add/remove/force sp_bool = add # ignore/add/remove/force # Add or remove space around compare operator '<', '>', '==', etc # DJM # sp_compare = ignore # ignore/add/remove/force sp_compare = add # ignore/add/remove/force # Add or remove space inside '(' and ')' # DJM # sp_inside_paren = ignore # ignore/add/remove/force sp_inside_paren = remove # ignore/add/remove/force # Add or remove space between nested parens: '((' vs ') )' # DJM # sp_paren_paren = ignore # ignore/add/remove/force sp_paren_paren = remove # ignore/add/remove/force # Add or remove space between back-to-back parens: ')(' vs ') (' sp_cparen_oparen = ignore # ignore/add/remove/force # Whether to balance spaces inside nested parens sp_balance_nested_parens = false # false/true # Add or remove space between ')' and '{' # DJM # sp_paren_brace = ignore # ignore/add/remove/force sp_paren_brace = add # ignore/add/remove/force # Add or remove space before pointer star '*' # DJM # sp_before_ptr_star = ignore # ignore/add/remove/force sp_before_ptr_star = remove # ignore/add/remove/force # Add or remove space before pointer star '*' that isn't followed by a variable name # If set to 'ignore', sp_before_ptr_star is used instead. sp_before_unnamed_ptr_star = ignore # ignore/add/remove/force # Add or remove space between pointer stars '*' sp_between_ptr_star = ignore # ignore/add/remove/force # Add or remove space after pointer star '*', if followed by a word. sp_after_ptr_star = ignore # ignore/add/remove/force # Add or remove space after pointer star '*', if followed by a qualifier. sp_after_ptr_star_qualifier = ignore # ignore/add/remove/force # Add or remove space after a pointer star '*', if followed by a func proto/def. sp_after_ptr_star_func = ignore # ignore/add/remove/force # Add or remove space after a pointer star '*', if followed by an open paren (function types). sp_ptr_star_paren = ignore # ignore/add/remove/force # Add or remove space before a pointer star '*', if followed by a func proto/def. # DJM # sp_before_ptr_star_func = ignore # ignore/add/remove/force sp_before_ptr_star_func = remove # ignore/add/remove/force # Add or remove space before a reference sign '&' # DJM # sp_before_byref = ignore # ignore/add/remove/force sp_before_byref = remove # ignore/add/remove/force # Add or remove space before a reference sign '&' that isn't followed by a variable name # If set to 'ignore', sp_before_byref is used instead. sp_before_unnamed_byref = ignore # ignore/add/remove/force # Add or remove space after reference sign '&', if followed by a word. # DJM # sp_after_byref = ignore # ignore/add/remove/force sp_after_byref = add # ignore/add/remove/force # Add or remove space after a reference sign '&', if followed by a func proto/def. # DJM # sp_after_byref_func = ignore # ignore/add/remove/force sp_after_byref_func = add # ignore/add/remove/force # Add or remove space before a reference sign '&', if followed by a func proto/def. # DJM # sp_before_byref_func = ignore # ignore/add/remove/force sp_before_byref_func = remove # ignore/add/remove/force # Add or remove space between type and word. Default=Force sp_after_type = force # ignore/add/remove/force # Add or remove space before the paren in the D constructs 'template Foo(' and 'class Foo('. sp_before_template_paren = ignore # ignore/add/remove/force # Add or remove space in 'template <' vs 'template<'. # If set to ignore, sp_before_angle is used. # DJM # sp_template_angle = ignore # ignore/add/remove/force sp_template_angle = add # ignore/add/remove/force # Add or remove space before '<>' sp_before_angle = ignore # ignore/add/remove/force # Add or remove space inside '<' and '>' # DJM # sp_inside_angle = ignore # ignore/add/remove/force sp_inside_angle = remove # ignore/add/remove/force # Add or remove space after '<>' sp_after_angle = ignore # ignore/add/remove/force # Add or remove space between '<>' and '(' as found in 'new List();' sp_angle_paren = ignore # ignore/add/remove/force # Add or remove space between '<>' and a word as in 'List m;' # DJM # sp_angle_word = ignore # ignore/add/remove/force sp_angle_word = add # ignore/add/remove/force # Add or remove space between '>' and '>' in '>>' (template stuff C++/C# only). Default=Add sp_angle_shift = add # ignore/add/remove/force # Permit removal of the space between '>>' in 'foo >' (C++11 only). Default=False # sp_angle_shift cannot remove the space without this option. sp_permit_cpp11_shift = false # false/true # Add or remove space before '(' of 'if', 'for', 'switch', and 'while' # DJM # sp_before_sparen = ignore # ignore/add/remove/force sp_before_sparen = add # ignore/add/remove/force # Add or remove space inside if-condition '(' and ')' # DJM # sp_inside_sparen = ignore # ignore/add/remove/force sp_inside_sparen = remove # ignore/add/remove/force # Add or remove space before if-condition ')'. Overrides sp_inside_sparen. sp_inside_sparen_close = ignore # ignore/add/remove/force # Add or remove space before if-condition '('. Overrides sp_inside_sparen. sp_inside_sparen_open = ignore # ignore/add/remove/force # Add or remove space after ')' of 'if', 'for', 'switch', and 'while' # DJM # sp_after_sparen = ignore # ignore/add/remove/force sp_after_sparen = add # ignore/add/remove/force # Add or remove space between ')' and '{' of 'if', 'for', 'switch', and 'while' # DJM # sp_sparen_brace = ignore # ignore/add/remove/force sp_sparen_brace = add # ignore/add/remove/force # Add or remove space between 'invariant' and '(' in the D language. sp_invariant_paren = ignore # ignore/add/remove/force # Add or remove space after the ')' in 'invariant (C) c' in the D language. sp_after_invariant_paren = ignore # ignore/add/remove/force # Add or remove space before empty statement ';' on 'if', 'for' and 'while' sp_special_semi = ignore # ignore/add/remove/force # Add or remove space before ';'. Default=Remove sp_before_semi = remove # ignore/add/remove/force # Add or remove space before ';' in non-empty 'for' statements sp_before_semi_for = ignore # ignore/add/remove/force # Add or remove space before a semicolon of an empty part of a for statement. sp_before_semi_for_empty = ignore # ignore/add/remove/force # Add or remove space after ';', except when followed by a comment. Default=Add sp_after_semi = add # ignore/add/remove/force # Add or remove space after ';' in non-empty 'for' statements. Default=Force sp_after_semi_for = force # ignore/add/remove/force # Add or remove space after the final semicolon of an empty part of a for statement: for ( ; ; ). # DJM # sp_after_semi_for_empty = ignore # ignore/add/remove/force sp_after_semi_for_empty = remove # ignore/add/remove/force # Add or remove space before '[' (except '[]') sp_before_square = ignore # ignore/add/remove/force # Add or remove space before '[]' sp_before_squares = ignore # ignore/add/remove/force # Add or remove space inside a non-empty '[' and ']' sp_inside_square = ignore # ignore/add/remove/force # Add or remove space after ',' # DJM # sp_after_comma = ignore # ignore/add/remove/force sp_after_comma = add # ignore/add/remove/force # Add or remove space before ',' sp_before_comma = remove # ignore/add/remove/force # Add or remove space between an open paren and comma: '(,' vs '( ,' sp_paren_comma = force # ignore/add/remove/force # Add or remove space before the variadic '...' when preceded by a non-punctuator sp_before_ellipsis = ignore # ignore/add/remove/force # Add or remove space after class ':' # DJM # sp_after_class_colon = ignore # ignore/add/remove/force sp_after_class_colon = add # ignore/add/remove/force # Add or remove space before class ':' # DJM # sp_before_class_colon = ignore # ignore/add/remove/force sp_before_class_colon = add # ignore/add/remove/force # Add or remove space after class constructor ':' sp_after_constr_colon = ignore # ignore/add/remove/force # Add or remove space before class constructor ':' sp_before_constr_colon = ignore # ignore/add/remove/force # Add or remove space before case ':'. Default=Remove sp_before_case_colon = remove # ignore/add/remove/force # Add or remove space between 'operator' and operator sign sp_after_operator = ignore # ignore/add/remove/force # Add or remove space between the operator symbol and the open paren, as in 'operator ++(' sp_after_operator_sym = ignore # ignore/add/remove/force # Add or remove space after C/D cast, i.e. 'cast(int)a' vs 'cast(int) a' or '(int)a' vs '(int) a' sp_after_cast = ignore # ignore/add/remove/force # Add or remove spaces inside cast parens sp_inside_paren_cast = ignore # ignore/add/remove/force # Add or remove space between the type and open paren in a C++ cast, i.e. 'int(exp)' vs 'int (exp)' sp_cpp_cast_paren = ignore # ignore/add/remove/force # Add or remove space between 'sizeof' and '(' sp_sizeof_paren = ignore # ignore/add/remove/force # Add or remove space after the tag keyword (Pawn) sp_after_tag = ignore # ignore/add/remove/force # Add or remove space inside enum '{' and '}' sp_inside_braces_enum = ignore # ignore/add/remove/force # Add or remove space inside struct/union '{' and '}' sp_inside_braces_struct = ignore # ignore/add/remove/force # Add or remove space inside '{' and '}' # DJM # sp_inside_braces = ignore # ignore/add/remove/force sp_inside_braces = add # ignore/add/remove/force # Add or remove space inside '{}' # sp_inside_braces_empty = ignore # ignore/add/remove/force sp_inside_braces_empty = add # ignore/add/remove/force # Add or remove space between return type and function name # A minimum of 1 is forced except for pointer return types. sp_type_func = ignore # ignore/add/remove/force # Add or remove space between function name and '(' on function declaration # DJM # sp_func_proto_paren = ignore # ignore/add/remove/force sp_func_proto_paren = remove # ignore/add/remove/force # Add or remove space between function name and '(' on function definition # DJM # sp_func_def_paren = ignore # ignore/add/remove/force sp_func_def_paren = remove # ignore/add/remove/force # Add or remove space inside empty function '()' # DJM # sp_inside_fparens = ignore # ignore/add/remove/force sp_inside_fparens = remove # ignore/add/remove/force # Add or remove space inside function '(' and ')' # DJM # sp_inside_fparen = ignore # ignore/add/remove/force sp_inside_fparen = remove # ignore/add/remove/force # Add or remove space inside the first parens in the function type: 'void (*x)(...)' sp_inside_tparen = ignore # ignore/add/remove/force # Add or remove between the parens in the function type: 'void (*x)(...)' sp_after_tparen_close = ignore # ignore/add/remove/force # Add or remove space between ']' and '(' when part of a function call. sp_square_fparen = ignore # ignore/add/remove/force # Add or remove space between ')' and '{' of function # DJM # sp_fparen_brace = ignore # ignore/add/remove/force sp_fparen_brace = add # ignore/add/remove/force # Java: Add or remove space between ')' and '{{' of double brace initializer. sp_fparen_dbrace = ignore # ignore/add/remove/force # Add or remove space between function name and '(' on function calls # DJM # sp_func_call_paren = ignore # ignore/add/remove/force sp_func_call_paren = remove # ignore/add/remove/force # Add or remove space between function name and '()' on function calls without parameters. # If set to 'ignore' (the default), sp_func_call_paren is used. sp_func_call_paren_empty = ignore # ignore/add/remove/force # Add or remove space between the user function name and '(' on function calls # You need to set a keyword to be a user function, like this: 'set func_call_user _' in the config file. sp_func_call_user_paren = ignore # ignore/add/remove/force # Add or remove space between a constructor/destructor and the open paren # DJM # sp_func_class_paren = ignore # ignore/add/remove/force sp_func_class_paren = remove # ignore/add/remove/force # Add or remove space between 'return' and '(' sp_return_paren = ignore # ignore/add/remove/force # Add or remove space between '__attribute__' and '(' sp_attribute_paren = ignore # ignore/add/remove/force # Add or remove space between 'defined' and '(' in '#if defined (FOO)' sp_defined_paren = ignore # ignore/add/remove/force # Add or remove space between 'throw' and '(' in 'throw (something)' sp_throw_paren = ignore # ignore/add/remove/force # Add or remove space between 'throw' and anything other than '(' as in '@throw [...];' sp_after_throw = ignore # ignore/add/remove/force # Add or remove space between 'catch' and '(' in 'catch (something) { }' # If set to ignore, sp_before_sparen is used. sp_catch_paren = ignore # ignore/add/remove/force # Add or remove space between 'version' and '(' in 'version (something) { }' (D language) # If set to ignore, sp_before_sparen is used. sp_version_paren = ignore # ignore/add/remove/force # Add or remove space between 'scope' and '(' in 'scope (something) { }' (D language) # If set to ignore, sp_before_sparen is used. sp_scope_paren = ignore # ignore/add/remove/force # Add or remove space between macro and value sp_macro = ignore # ignore/add/remove/force # Add or remove space between macro function ')' and value sp_macro_func = ignore # ignore/add/remove/force # Add or remove space between 'else' and '{' if on the same line # DJM # sp_else_brace = ignore # ignore/add/remove/force sp_else_brace = add # ignore/add/remove/force # Add or remove space between '}' and 'else' if on the same line # DJM # sp_brace_else = ignore # ignore/add/remove/force sp_brace_else = add # ignore/add/remove/force # Add or remove space between '}' and the name of a typedef on the same line sp_brace_typedef = ignore # ignore/add/remove/force # Add or remove space between 'catch' and '{' if on the same line sp_catch_brace = ignore # ignore/add/remove/force # Add or remove space between '}' and 'catch' if on the same line sp_brace_catch = ignore # ignore/add/remove/force # Add or remove space between 'finally' and '{' if on the same line sp_finally_brace = ignore # ignore/add/remove/force # Add or remove space between '}' and 'finally' if on the same line sp_brace_finally = ignore # ignore/add/remove/force # Add or remove space between 'try' and '{' if on the same line sp_try_brace = ignore # ignore/add/remove/force # Add or remove space between get/set and '{' if on the same line sp_getset_brace = ignore # ignore/add/remove/force # Add or remove space between a variable and '{' for C++ uniform initialization sp_word_brace = add # ignore/add/remove/force # Add or remove space between a variable and '{' for a namespace sp_word_brace_ns = add # ignore/add/remove/force # Add or remove space before the '::' operator # DJM # sp_before_dc = ignore # ignore/add/remove/force sp_before_dc = remove # ignore/add/remove/force # Add or remove space after the '::' operator # DJM # sp_after_dc = ignore # ignore/add/remove/force sp_after_dc = remove # ignore/add/remove/force # Add or remove around the D named array initializer ':' operator sp_d_array_colon = ignore # ignore/add/remove/force # Add or remove space after the '!' (not) operator. Default=Remove sp_not = remove # ignore/add/remove/force # Add or remove space after the '~' (invert) operator. Default=Remove sp_inv = remove # ignore/add/remove/force # Add or remove space after the '&' (address-of) operator. Default=Remove # This does not affect the spacing after a '&' that is part of a type. sp_addr = remove # ignore/add/remove/force # Add or remove space around the '.' or '->' operators. Default=Remove sp_member = remove # ignore/add/remove/force # Add or remove space after the '*' (dereference) operator. Default=Remove # This does not affect the spacing after a '*' that is part of a type. sp_deref = remove # ignore/add/remove/force # Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'. Default=Remove sp_sign = remove # ignore/add/remove/force # Add or remove space before or after '++' and '--', as in '(--x)' or 'y++;'. Default=Remove sp_incdec = remove # ignore/add/remove/force # Add or remove space before a backslash-newline at the end of a line. Default=Add sp_before_nl_cont = add # ignore/add/remove/force # Add or remove space after the scope '+' or '-', as in '-(void) foo;' or '+(int) bar;' sp_after_oc_scope = ignore # ignore/add/remove/force # Add or remove space after the colon in message specs # '-(int) f:(int) x;' vs '-(int) f: (int) x;' sp_after_oc_colon = ignore # ignore/add/remove/force # Add or remove space before the colon in message specs # '-(int) f: (int) x;' vs '-(int) f : (int) x;' sp_before_oc_colon = ignore # ignore/add/remove/force # Add or remove space after the colon in immutable dictionary expression # 'NSDictionary *test = @{@"foo" :@"bar"};' sp_after_oc_dict_colon = ignore # ignore/add/remove/force # Add or remove space before the colon in immutable dictionary expression # 'NSDictionary *test = @{@"foo" :@"bar"};' sp_before_oc_dict_colon = ignore # ignore/add/remove/force # Add or remove space after the colon in message specs # '[object setValue:1];' vs '[object setValue: 1];' sp_after_send_oc_colon = ignore # ignore/add/remove/force # Add or remove space before the colon in message specs # '[object setValue:1];' vs '[object setValue :1];' sp_before_send_oc_colon = ignore # ignore/add/remove/force # Add or remove space after the (type) in message specs # '-(int)f: (int) x;' vs '-(int)f: (int)x;' sp_after_oc_type = ignore # ignore/add/remove/force # Add or remove space after the first (type) in message specs # '-(int) f:(int)x;' vs '-(int)f:(int)x;' sp_after_oc_return_type = ignore # ignore/add/remove/force # Add or remove space between '@selector' and '(' # '@selector(msgName)' vs '@selector (msgName)' # Also applies to @protocol() constructs sp_after_oc_at_sel = ignore # ignore/add/remove/force # Add or remove space between '@selector(x)' and the following word # '@selector(foo) a:' vs '@selector(foo)a:' sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force # Add or remove space inside '@selector' parens # '@selector(foo)' vs '@selector( foo )' # Also applies to @protocol() constructs sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force # Add or remove space before a block pointer caret # '^int (int arg){...}' vs. ' ^int (int arg){...}' sp_before_oc_block_caret = ignore # ignore/add/remove/force # Add or remove space after a block pointer caret # '^int (int arg){...}' vs. '^ int (int arg){...}' sp_after_oc_block_caret = ignore # ignore/add/remove/force # Add or remove space between the receiver and selector in a message. # '[receiver selector ...]' sp_after_oc_msg_receiver = ignore # ignore/add/remove/force # Add or remove space after @property. sp_after_oc_property = ignore # ignore/add/remove/force # Add or remove space around the ':' in 'b ? t : f' #DJM # sp_cond_colon = ignore # ignore/add/remove/force sp_cond_colon = add # ignore/add/remove/force # Add or remove space before the ':' in 'b ? t : f'. Overrides sp_cond_colon. sp_cond_colon_before = ignore # ignore/add/remove/force # Add or remove space after the ':' in 'b ? t : f'. Overrides sp_cond_colon. sp_cond_colon_after = ignore # ignore/add/remove/force # Add or remove space around the '?' in 'b ? t : f' # DJM # sp_cond_question = ignore # ignore/add/remove/force sp_cond_question = add # ignore/add/remove/force # Add or remove space before the '?' in 'b ? t : f'. Overrides sp_cond_question. sp_cond_question_before = ignore # ignore/add/remove/force # Add or remove space after the '?' in 'b ? t : f'. Overrides sp_cond_question. sp_cond_question_after = ignore # ignore/add/remove/force # In the abbreviated ternary form (a ?: b), add/remove space between ? and :.'. Overrides all other sp_cond_* options. sp_cond_ternary_short = ignore # ignore/add/remove/force # Fix the spacing between 'case' and the label. Only 'ignore' and 'force' make sense here. sp_case_label = ignore # ignore/add/remove/force # Control the space around the D '..' operator. sp_range = ignore # ignore/add/remove/force # Control the spacing after ':' in 'for (TYPE VAR : EXPR)' (Java) sp_after_for_colon = ignore # ignore/add/remove/force # Control the spacing before ':' in 'for (TYPE VAR : EXPR)' (Java) sp_before_for_colon = ignore # ignore/add/remove/force # Control the spacing in 'extern (C)' (D) sp_extern_paren = ignore # ignore/add/remove/force # Control the space after the opening of a C++ comment '// A' vs '//A' sp_cmt_cpp_start = ignore # ignore/add/remove/force # Controls the spaces between #else or #endif and a trailing comment sp_endif_cmt = ignore # ignore/add/remove/force # Controls the spaces after 'new', 'delete', and 'delete[]' sp_after_new = ignore # ignore/add/remove/force # Controls the spaces before a trailing or embedded comment sp_before_tr_emb_cmt = ignore # ignore/add/remove/force # Number of spaces before a trailing or embedded comment sp_num_before_tr_emb_cmt = 0 # number # Control space between a Java annotation and the open paren. sp_annotation_paren = ignore # ignore/add/remove/force # # Code alignment (not left column spaces/tabs) # # Whether to keep non-indenting tabs align_keep_tabs = false # false/true # Whether to use tabs for aligning align_with_tabs = false # false/true # Whether to bump out to the next tab when aligning align_on_tabstop = false # false/true # Whether to left-align numbers align_number_left = false # false/true # Whether to keep whitespace not required for alignment. align_keep_extra_space = false # false/true # Align variable definitions in prototypes and functions align_func_params = false # false/true # Align parameters in single-line functions that have the same name. # The function names must already be aligned with each other. align_same_func_call_params = false # false/true # The span for aligning variable definitions (0=don't align) align_var_def_span = 0 # number # How to align the star in variable definitions. # 0=Part of the type 'void * foo;' # 1=Part of the variable 'void *foo;' # 2=Dangling 'void *foo;' align_var_def_star_style = 0 # number # How to align the '&' in variable definitions. # 0=Part of the type # 1=Part of the variable # 2=Dangling align_var_def_amp_style = 0 # number # The threshold for aligning variable definitions (0=no limit) align_var_def_thresh = 0 # number # The gap for aligning variable definitions align_var_def_gap = 0 # number # Whether to align the colon in struct bit fields align_var_def_colon = false # false/true # Whether to align any attribute after the variable name align_var_def_attribute = false # false/true # Whether to align inline struct/enum/union variable definitions align_var_def_inline = false # false/true # The span for aligning on '=' in assignments (0=don't align) align_assign_span = 0 # number # The threshold for aligning on '=' in assignments (0=no limit) align_assign_thresh = 0 # number # The span for aligning on '=' in enums (0=don't align) align_enum_equ_span = 0 # number # The threshold for aligning on '=' in enums (0=no limit) align_enum_equ_thresh = 0 # number # The span for aligning struct/union (0=don't align) align_var_struct_span = 0 # number # The threshold for aligning struct/union member definitions (0=no limit) align_var_struct_thresh = 0 # number # The gap for aligning struct/union member definitions align_var_struct_gap = 0 # number # The span for aligning struct initializer values (0=don't align) align_struct_init_span = 0 # number # The minimum space between the type and the synonym of a typedef align_typedef_gap = 0 # number # The span for aligning single-line typedefs (0=don't align) align_typedef_span = 0 # number # How to align typedef'd functions with other typedefs # 0: Don't mix them at all # 1: align the open paren with the types # 2: align the function type name with the other type names align_typedef_func = 0 # number # Controls the positioning of the '*' in typedefs. Just try it. # 0: Align on typedef type, ignore '*' # 1: The '*' is part of type name: typedef int *pint; # 2: The '*' is part of the type, but dangling: typedef int *pint; align_typedef_star_style = 0 # number # Controls the positioning of the '&' in typedefs. Just try it. # 0: Align on typedef type, ignore '&' # 1: The '&' is part of type name: typedef int &pint; # 2: The '&' is part of the type, but dangling: typedef int &pint; align_typedef_amp_style = 0 # number # The span for aligning comments that end lines (0=don't align) align_right_cmt_span = 0 # number # If aligning comments, mix with comments after '}' and #endif with less than 3 spaces before the comment align_right_cmt_mix = false # false/true # If a trailing comment is more than this number of columns away from the text it follows, # it will qualify for being aligned. This has to be > 0 to do anything. align_right_cmt_gap = 0 # number # Align trailing comment at or beyond column N; 'pulls in' comments as a bonus side effect (0=ignore) align_right_cmt_at_col = 0 # number # The span for aligning function prototypes (0=don't align) align_func_proto_span = 0 # number # Minimum gap between the return type and the function name. align_func_proto_gap = 0 # number # Align function protos on the 'operator' keyword instead of what follows align_on_operator = false # false/true # Whether to mix aligning prototype and variable declarations. # If true, align_var_def_XXX options are used instead of align_func_proto_XXX options. align_mix_var_proto = false # false/true # Align single-line functions with function prototypes, uses align_func_proto_span align_single_line_func = false # false/true # Aligning the open brace of single-line functions. # Requires align_single_line_func=true, uses align_func_proto_span align_single_line_brace = false # false/true # Gap for align_single_line_brace. align_single_line_brace_gap = 0 # number # The span for aligning ObjC msg spec (0=don't align) align_oc_msg_spec_span = 0 # number # Whether to align macros wrapped with a backslash and a newline. # This will not work right if the macro contains a multi-line comment. align_nl_cont = false # false/true # # Align macro functions and variables together align_pp_define_together = false # false/true # The minimum space between label and value of a preprocessor define align_pp_define_gap = 0 # number # The span for aligning on '#define' bodies (0=don't align, other=number of lines including comments between blocks) align_pp_define_span = 0 # number # Align lines that start with '<<' with previous '<<'. Default=true align_left_shift = true # false/true # Span for aligning parameters in an Obj-C message call on the ':' (0=don't align) align_oc_msg_colon_span = 0 # number # If true, always align with the first parameter, even if it is too short. align_oc_msg_colon_first = false # false/true # Aligning parameters in an Obj-C '+' or '-' declaration on the ':' align_oc_decl_colon = false # false/true # # Newline adding and removing options # # Whether to collapse empty blocks between '{' and '}' nl_collapse_empty_body = false # false/true # Don't split one-line braced assignments - 'foo_t f = { 1, 2 };' nl_assign_leave_one_liners = false # false/true # Don't split one-line braced statements inside a class xx { } body # DJM # nl_class_leave_one_liners = false # false/true nl_class_leave_one_liners = true # false/true # Don't split one-line enums: 'enum foo { BAR = 15 };' nl_enum_leave_one_liners = false # false/true # Don't split one-line get or set functions nl_getset_leave_one_liners = false # false/true # Don't split one-line function definitions - 'int foo() { return 0; }' nl_func_leave_one_liners = false # false/true # Don't split one-line C++11 lambdas - '[]() { return 0; }' nl_cpp_lambda_leave_one_liners = false # false/true # Don't split one-line if/else statements - 'if(a) b++;' nl_if_leave_one_liners = false # false/true # Don't split one-line OC messages nl_oc_msg_leave_one_liner = false # false/true # Add or remove newlines at the start of the file nl_start_of_file = ignore # ignore/add/remove/force # The number of newlines at the start of the file (only used if nl_start_of_file is 'add' or 'force' nl_start_of_file_min = 0 # number # Add or remove newline at the end of the file nl_end_of_file = ignore # ignore/add/remove/force # The number of newlines at the end of the file (only used if nl_end_of_file is 'add' or 'force') nl_end_of_file_min = 0 # number # Add or remove newline between '=' and '{' nl_assign_brace = ignore # ignore/add/remove/force # Add or remove newline between '=' and '[' (D only) nl_assign_square = ignore # ignore/add/remove/force # Add or remove newline after '= [' (D only). Will also affect the newline before the ']' nl_after_square_assign = ignore # ignore/add/remove/force # The number of blank lines after a block of variable definitions at the top of a function body # 0 = No change (default) nl_func_var_def_blk = 0 # number # The number of newlines before a block of typedefs # 0 = No change (default) nl_typedef_blk_start = 0 # number # The number of newlines after a block of typedefs # 0 = No change (default) nl_typedef_blk_end = 0 # number # The maximum consecutive newlines within a block of typedefs # 0 = No change (default) nl_typedef_blk_in = 0 # number # The number of newlines before a block of variable definitions not at the top of a function body # 0 = No change (default) nl_var_def_blk_start = 0 # number # The number of newlines after a block of variable definitions not at the top of a function body # 0 = No change (default) nl_var_def_blk_end = 0 # number # The maximum consecutive newlines within a block of variable definitions # 0 = No change (default) nl_var_def_blk_in = 0 # number # Add or remove newline between a function call's ')' and '{', as in: # list_for_each(item, &list) { } nl_fcall_brace = ignore # ignore/add/remove/force # Add or remove newline between 'enum' and '{' # DJM # nl_enum_brace = ignore # ignore/add/remove/force nl_enum_brace = remove # ignore/add/remove/force # Add or remove newline between 'struct and '{' # DJM # nl_struct_brace = ignore # ignore/add/remove/force nl_struct_brace = remove # ignore/add/remove/force # Add or remove newline between 'union' and '{' # DJM # nl_union_brace = ignore # ignore/add/remove/force nl_union_brace = remove # ignore/add/remove/force # Add or remove newline between 'if' and '{' # DJM # nl_if_brace = ignore # ignore/add/remove/force nl_if_brace = remove # ignore/add/remove/force # Add or remove newline between '}' and 'else' # DJM # nl_brace_else = ignore # ignore/add/remove/force nl_brace_else = remove # ignore/add/remove/force # Add or remove newline between 'else if' and '{' # If set to ignore, nl_if_brace is used instead nl_elseif_brace = ignore # ignore/add/remove/force # Add or remove newline between 'else' and '{' # DJM # nl_else_brace = ignore # ignore/add/remove/force nl_else_brace = remove # ignore/add/remove/force # Add or remove newline between 'else' and 'if' nl_else_if = ignore # ignore/add/remove/force # Add or remove newline between '}' and 'finally' # DJM # nl_brace_finally = ignore # ignore/add/remove/force nl_brace_finally = remove # ignore/add/remove/force # Add or remove newline between 'finally' and '{' # DJM # nl_finally_brace = ignore # ignore/add/remove/force nl_finally_brace = remove # ignore/add/remove/force # Add or remove newline between 'try' and '{' # DJM # nl_try_brace = ignore # ignore/add/remove/force nl_try_brace = remove # ignore/add/remove/force # Add or remove newline between get/set and '{' # DJM # nl_getset_brace = ignore # ignore/add/remove/force nl_getset_brace = remove # ignore/add/remove/force # Add or remove newline between 'for' and '{' # DJM # nl_for_brace = ignore # ignore/add/remove/force nl_for_brace = remove # ignore/add/remove/force # Add or remove newline between 'catch' and '{' # DJM # nl_catch_brace = ignore # ignore/add/remove/force nl_catch_brace = remove # ignore/add/remove/force # Add or remove newline between '}' and 'catch' # DJM # nl_brace_catch = ignore # ignore/add/remove/force nl_brace_catch = remove # ignore/add/remove/force # Add or remove newline between '}' and ']' nl_brace_square = ignore # ignore/add/remove/force # Add or remove newline between '}' and ')' in a function invocation nl_brace_fparen = ignore # ignore/add/remove/force # Add or remove newline between 'while' and '{' # DJM # nl_while_brace = ignore # ignore/add/remove/force nl_while_brace = remove # ignore/add/remove/force # Add or remove newline between 'scope (x)' and '{' (D) nl_scope_brace = ignore # ignore/add/remove/force # Add or remove newline between 'unittest' and '{' (D) nl_unittest_brace = ignore # ignore/add/remove/force # Add or remove newline between 'version (x)' and '{' (D) nl_version_brace = ignore # ignore/add/remove/force # Add or remove newline between 'using' and '{' nl_using_brace = ignore # ignore/add/remove/force # Add or remove newline between two open or close braces. # Due to general newline/brace handling, REMOVE may not work. nl_brace_brace = ignore # ignore/add/remove/force # Add or remove newline between 'do' and '{' # DJM # nl_do_brace = ignore # ignore/add/remove/force nl_do_brace = remove # ignore/add/remove/force # Add or remove newline between '}' and 'while' of 'do' statement # DJM # nl_brace_while = ignore # ignore/add/remove/force nl_brace_while = remove # ignore/add/remove/force # Add or remove newline between 'switch' and '{' # DJM # nl_switch_brace = ignore # ignore/add/remove/force nl_switch_brace = remove # ignore/add/remove/force # Add a newline between ')' and '{' if the ')' is on a different line than the if/for/etc. # Overrides nl_for_brace, nl_if_brace, nl_switch_brace, nl_while_switch, and nl_catch_brace. nl_multi_line_cond = false # false/true # Force a newline in a define after the macro name for multi-line defines. nl_multi_line_define = false # false/true # Whether to put a newline before 'case' statement # DJM # nl_before_case = false # false/true nl_before_case = true # false/true # Add or remove newline between ')' and 'throw' nl_before_throw = ignore # ignore/add/remove/force # Whether to put a newline after 'case' statement nl_after_case = false # false/true # Add or remove a newline between a case ':' and '{'. Overrides nl_after_case. nl_case_colon_brace = ignore # ignore/add/remove/force # Newline between namespace and { # DJM # nl_namespace_brace = ignore # ignore/add/remove/force nl_namespace_brace = remove # ignore/add/remove/force # Add or remove newline between 'template<>' and whatever follows. nl_template_class = ignore # ignore/add/remove/force # Add or remove newline between 'class' and '{' # DJM # nl_class_brace = ignore # ignore/add/remove/force nl_class_brace = remove # ignore/add/remove/force # Add or remove newline after each ',' in the class base list nl_class_init_args = ignore # ignore/add/remove/force # Add or remove newline after each ',' in the constructor member initialization nl_constr_init_args = ignore # ignore/add/remove/force # Add or remove newline between return type and function name in a function definition # DJM # nl_func_type_name = ignore # ignore/add/remove/force nl_func_type_name = remove # ignore/add/remove/force # Add or remove newline between return type and function name inside a class {} # Uses nl_func_type_name or nl_func_proto_type_name if set to ignore. # DJM # nl_func_type_name_class = ignore # ignore/add/remove/force nl_func_type_name_class = remove # ignore/add/remove/force # Add or remove newline between function scope and name in a definition # Controls the newline after '::' in 'void A::f() { }' nl_func_scope_name = ignore # ignore/add/remove/force # Add or remove newline between return type and function name in a prototype # DJM # nl_func_proto_type_name = ignore # ignore/add/remove/force nl_func_proto_type_name = remove # ignore/add/remove/force # Add or remove newline between a function name and the opening '(' # DJM # nl_func_paren = ignore # ignore/add/remove/force nl_func_paren = remove # ignore/add/remove/force # Add or remove newline between a function name and the opening '(' in the definition # DJM # nl_func_def_paren = ignore # ignore/add/remove/force nl_func_def_paren = remove # ignore/add/remove/force # Add or remove newline after '(' in a function declaration nl_func_decl_start = ignore # ignore/add/remove/force # Add or remove newline after '(' in a function definition nl_func_def_start = ignore # ignore/add/remove/force # Overrides nl_func_decl_start when there is only one parameter. nl_func_decl_start_single = ignore # ignore/add/remove/force # Overrides nl_func_def_start when there is only one parameter. nl_func_def_start_single = ignore # ignore/add/remove/force # Add or remove newline after each ',' in a function declaration nl_func_decl_args = ignore # ignore/add/remove/force # Add or remove newline after each ',' in a function definition nl_func_def_args = ignore # ignore/add/remove/force # Add or remove newline before the ')' in a function declaration nl_func_decl_end = ignore # ignore/add/remove/force # Add or remove newline before the ')' in a function definition nl_func_def_end = ignore # ignore/add/remove/force # Overrides nl_func_decl_end when there is only one parameter. nl_func_decl_end_single = ignore # ignore/add/remove/force # Overrides nl_func_def_end when there is only one parameter. nl_func_def_end_single = ignore # ignore/add/remove/force # Add or remove newline between '()' in a function declaration. nl_func_decl_empty = ignore # ignore/add/remove/force # Add or remove newline between '()' in a function definition. nl_func_def_empty = ignore # ignore/add/remove/force # Whether to put each OC message parameter on a separate line # See nl_oc_msg_leave_one_liner nl_oc_msg_args = false # false/true # Add or remove newline between function signature and '{' nl_fdef_brace = ignore # ignore/add/remove/force # Add or remove newline between C++11 lambda signature and '{' nl_cpp_ldef_brace = ignore # ignore/add/remove/force # Add or remove a newline between the return keyword and return expression. nl_return_expr = ignore # ignore/add/remove/force # Whether to put a newline after semicolons, except in 'for' statements nl_after_semicolon = false # false/true # Java: Control the newline between the ')' and '{{' of the double brace initializer. nl_paren_dbrace_open = ignore # ignore/add/remove/force # Whether to put a newline after brace open. # This also adds a newline before the matching brace close. nl_after_brace_open = false # false/true # If nl_after_brace_open and nl_after_brace_open_cmt are true, a newline is # placed between the open brace and a trailing single-line comment. nl_after_brace_open_cmt = false # false/true # Whether to put a newline after a virtual brace open with a non-empty body. # These occur in un-braced if/while/do/for statement bodies. nl_after_vbrace_open = false # false/true # Whether to put a newline after a virtual brace open with an empty body. # These occur in un-braced if/while/do/for statement bodies. nl_after_vbrace_open_empty = false # false/true # Whether to put a newline after a brace close. # Does not apply if followed by a necessary ';'. nl_after_brace_close = false # false/true # Whether to put a newline after a virtual brace close. # Would add a newline before return in: 'if (foo) a++; return;' nl_after_vbrace_close = false # false/true # Control the newline between the close brace and 'b' in: 'struct { int a; } b;' # Affects enums, unions, and structures. If set to ignore, uses nl_after_brace_close nl_brace_struct_var = ignore # ignore/add/remove/force # Whether to alter newlines in '#define' macros nl_define_macro = false # false/true # Whether to not put blanks after '#ifxx', '#elxx', or before '#endif' nl_squeeze_ifdef = false # false/true # Add or remove blank line before 'if' nl_before_if = ignore # ignore/add/remove/force # Add or remove blank line after 'if' statement nl_after_if = ignore # ignore/add/remove/force # Add or remove blank line before 'for' nl_before_for = ignore # ignore/add/remove/force # Add or remove blank line after 'for' statement nl_after_for = ignore # ignore/add/remove/force # Add or remove blank line before 'while' nl_before_while = ignore # ignore/add/remove/force # Add or remove blank line after 'while' statement nl_after_while = ignore # ignore/add/remove/force # Add or remove blank line before 'switch' nl_before_switch = ignore # ignore/add/remove/force # Add or remove blank line after 'switch' statement nl_after_switch = ignore # ignore/add/remove/force # Add or remove blank line before 'do' nl_before_do = ignore # ignore/add/remove/force # Add or remove blank line after 'do/while' statement nl_after_do = ignore # ignore/add/remove/force # Whether to double-space commented-entries in struct/enum nl_ds_struct_enum_cmt = false # false/true # Whether to double-space before the close brace of a struct/union/enum # (lower priority than 'eat_blanks_before_close_brace') nl_ds_struct_enum_close_brace = false # false/true # Add or remove a newline around a class colon. # Related to pos_class_colon, nl_class_init_args, and pos_class_comma. nl_class_colon = ignore # ignore/add/remove/force # Add or remove a newline around a class constructor colon. # Related to pos_constr_colon, nl_constr_init_args, and pos_constr_comma. nl_constr_colon = ignore # ignore/add/remove/force # Change simple unbraced if statements into a one-liner # 'if(b)\n i++;' => 'if(b) i++;' nl_create_if_one_liner = false # false/true # Change simple unbraced for statements into a one-liner # 'for (i=0;i<5;i++)\n foo(i);' => 'for (i=0;i<5;i++) foo(i);' nl_create_for_one_liner = false # false/true # Change simple unbraced while statements into a one-liner # 'while (i<5)\n foo(i++);' => 'while (i<5) foo(i++);' nl_create_while_one_liner = false # false/true # # Positioning options # # The position of arithmetic operators in wrapped expressions pos_arith = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of assignment in wrapped expressions. # Do not affect '=' followed by '{' pos_assign = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of boolean operators in wrapped expressions pos_bool = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of comparison operators in wrapped expressions pos_compare = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of conditional (b ? t : f) operators in wrapped expressions pos_conditional = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of the comma in wrapped expressions pos_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of the comma in the class base list pos_class_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of the comma in the constructor initialization list pos_constr_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of colons between class and base class list pos_class_colon = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of colons between constructor and member initialization pos_constr_colon = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # # Line Splitting options # # Try to limit code width to N number of columns code_width = 0 # number # Whether to fully split long 'for' statements at semi-colons ls_for_split_full = false # false/true # Whether to fully split long function protos/calls at commas ls_func_split_full = false # false/true # Whether to split lines as close to code_width as possible and ignore some groupings ls_code_width = false # false/true # # Blank line options # # The maximum consecutive newlines nl_max = 0 # number # The number of newlines after a function prototype, if followed by another function prototype nl_after_func_proto = 0 # number # The number of newlines after a function prototype, if not followed by another function prototype nl_after_func_proto_group = 0 # number # The number of newlines after '}' of a multi-line function body nl_after_func_body = 0 # number # The number of newlines after '}' of a multi-line function body in a class declaration nl_after_func_body_class = 0 # number # The number of newlines after '}' of a single line function body nl_after_func_body_one_liner = 0 # number # The minimum number of newlines before a multi-line comment. # Doesn't apply if after a brace open or another multi-line comment. nl_before_block_comment = 0 # number # The minimum number of newlines before a single-line C comment. # Doesn't apply if after a brace open or other single-line C comments. nl_before_c_comment = 0 # number # The minimum number of newlines before a CPP comment. # Doesn't apply if after a brace open or other CPP comments. nl_before_cpp_comment = 0 # number # Whether to force a newline after a multi-line comment. nl_after_multiline_comment = false # false/true # The number of newlines after '}' or ';' of a struct/enum/union definition nl_after_struct = 0 # number # The number of newlines after '}' or ';' of a class definition nl_after_class = 0 # number # The number of newlines before a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. # Will not change the newline count if after a brace open. # 0 = No change. nl_before_access_spec = 0 # number # The number of newlines after a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. # 0 = No change. nl_after_access_spec = 0 # number # The number of newlines between a function def and the function comment. # 0 = No change. nl_comment_func_def = 0 # number # The number of newlines after a try-catch-finally block that isn't followed by a brace close. # 0 = No change. nl_after_try_catch_finally = 0 # number # The number of newlines before and after a property, indexer or event decl. # 0 = No change. nl_around_cs_property = 0 # number # The number of newlines between the get/set/add/remove handlers in C#. # 0 = No change. nl_between_get_set = 0 # number # Add or remove newline between C# property and the '{' nl_property_brace = ignore # ignore/add/remove/force # Whether to remove blank lines after '{' eat_blanks_after_open_brace = false # false/true # Whether to remove blank lines before '}' eat_blanks_before_close_brace = false # false/true # How aggressively to remove extra newlines not in preproc. # 0: No change # 1: Remove most newlines not handled by other config # 2: Remove all newlines and reformat completely by config nl_remove_extra_newlines = 0 # number # Whether to put a blank line before 'return' statements, unless after an open brace. nl_before_return = false # false/true # Whether to put a blank line after 'return' statements, unless followed by a close brace. nl_after_return = false # false/true # Whether to put a newline after a Java annotation statement. # Only affects annotations that are after a newline. nl_after_annotation = ignore # ignore/add/remove/force # Controls the newline between two annotations. nl_between_annotation = ignore # ignore/add/remove/force # # Code modifying options (non-whitespace) # # Add or remove braces on single-line 'do' statement mod_full_brace_do = ignore # ignore/add/remove/force # Add or remove braces on single-line 'for' statement mod_full_brace_for = ignore # ignore/add/remove/force # Add or remove braces on single-line function definitions. (Pawn) mod_full_brace_function = ignore # ignore/add/remove/force # Add or remove braces on single-line 'if' statement. Will not remove the braces if they contain an 'else'. # GLN # mod_full_brace_if = ignore # ignore/add/remove/force mod_full_brace_if = add # ignore/add/remove/force # Make all if/elseif/else statements in a chain be braced or not. Overrides mod_full_brace_if. # If any must be braced, they are all braced. If all can be unbraced, then the braces are removed. mod_full_brace_if_chain = false # false/true # Don't remove braces around statements that span N newlines mod_full_brace_nl = 0 # number # Add or remove braces on single-line 'while' statement mod_full_brace_while = ignore # ignore/add/remove/force # Add or remove braces on single-line 'using ()' statement mod_full_brace_using = ignore # ignore/add/remove/force # Add or remove unnecessary paren on 'return' statement mod_paren_on_return = ignore # ignore/add/remove/force # Whether to change optional semicolons to real semicolons mod_pawn_semicolon = false # false/true # Add parens on 'while' and 'if' statement around bools mod_full_paren_if_bool = false # false/true # Whether to remove superfluous semicolons mod_remove_extra_semicolon = false # false/true # If a function body exceeds the specified number of newlines and doesn't have a comment after # the close brace, a comment will be added. mod_add_long_function_closebrace_comment = 0 # number # If a namespace body exceeds the specified number of newlines and doesn't have a comment after # the close brace, a comment will be added. mod_add_long_namespace_closebrace_comment = 0 # number # If a switch body exceeds the specified number of newlines and doesn't have a comment after # the close brace, a comment will be added. mod_add_long_switch_closebrace_comment = 0 # number # If an #ifdef body exceeds the specified number of newlines and doesn't have a comment after # the #endif, a comment will be added. mod_add_long_ifdef_endif_comment = 0 # number # If an #ifdef or #else body exceeds the specified number of newlines and doesn't have a comment after # the #else, a comment will be added. mod_add_long_ifdef_else_comment = 0 # number # If TRUE, will sort consecutive single-line 'import' statements [Java, D] mod_sort_import = false # false/true # If TRUE, will sort consecutive single-line 'using' statements [C#] mod_sort_using = false # false/true # If TRUE, will sort consecutive single-line '#include' statements [C/C++] and '#import' statements [Obj-C] # This is generally a bad idea, as it may break your code. mod_sort_include = false # false/true # If TRUE, it will move a 'break' that appears after a fully braced 'case' before the close brace. mod_move_case_break = false # false/true # Will add or remove the braces around a fully braced case statement. # Will only remove the braces if there are no variable declarations in the block. mod_case_brace = ignore # ignore/add/remove/force # If TRUE, it will remove a void 'return;' that appears as the last statement in a function. mod_remove_empty_return = false # false/true # # Comment modifications # # Try to wrap comments at cmt_width columns cmt_width = 0 # number # Set the comment reflow mode (default: 0) # 0: no reflowing (apart from the line wrapping due to cmt_width) # 1: no touching at all # 2: full reflow cmt_reflow_mode = 0 # number # Whether to convert all tabs to spaces in comments. Default is to leave tabs inside comments alone, unless used for indenting. cmt_convert_tab_to_spaces = false # false/true # If false, disable all multi-line comment changes, including cmt_width. keyword substitution, and leading chars. # Default is true. cmt_indent_multi = true # false/true # Whether to group c-comments that look like they are in a block cmt_c_group = false # false/true # Whether to put an empty '/*' on the first line of the combined c-comment cmt_c_nl_start = false # false/true # Whether to put a newline before the closing '*/' of the combined c-comment cmt_c_nl_end = false # false/true # Whether to group cpp-comments that look like they are in a block cmt_cpp_group = false # false/true # Whether to put an empty '/*' on the first line of the combined cpp-comment cmt_cpp_nl_start = false # false/true # Whether to put a newline before the closing '*/' of the combined cpp-comment cmt_cpp_nl_end = false # false/true # Whether to change cpp-comments into c-comments cmt_cpp_to_c = false # false/true # Whether to put a star on subsequent comment lines cmt_star_cont = false # false/true # The number of spaces to insert at the start of subsequent comment lines cmt_sp_before_star_cont = 0 # number # The number of spaces to insert after the star on subsequent comment lines # DJM # cmt_sp_after_star_cont = 0 # number cmt_sp_after_star_cont = 1 # number # For multi-line comments with a '*' lead, remove leading spaces if the first and last lines of # the comment are the same length. Default=True # DJM # cmt_multi_check_last = true # false/true cmt_multi_check_last = false # false/true # The filename that contains text to insert at the head of a file if the file doesn't start with a C/C++ comment. # Will substitute $(filename) with the current file's name. cmt_insert_file_header = "" # string # The filename that contains text to insert at the end of a file if the file doesn't end with a C/C++ comment. # Will substitute $(filename) with the current file's name. cmt_insert_file_footer = "" # string # The filename that contains text to insert before a function implementation if the function isn't preceded with a C/C++ comment. # Will substitute $(function) with the function name and $(javaparam) with the javadoc @param and @return stuff. # Will also substitute $(fclass) with the class name: void CFoo::Bar() { ... } cmt_insert_func_header = "" # string # The filename that contains text to insert before a class if the class isn't preceded with a C/C++ comment. # Will substitute $(class) with the class name. cmt_insert_class_header = "" # string # The filename that contains text to insert before a Obj-C message specification if the method isn't preceded with a C/C++ comment. # Will substitute $(message) with the function name and $(javaparam) with the javadoc @param and @return stuff. cmt_insert_oc_msg_header = "" # string # If a preprocessor is encountered when stepping backwards from a function name, then # this option decides whether the comment should be inserted. # Affects cmt_insert_oc_msg_header, cmt_insert_func_header and cmt_insert_class_header. cmt_insert_before_preproc = false # false/true # # Preprocessor options # # Control indent of preprocessors inside #if blocks at brace level 0 (file-level) pp_indent = ignore # ignore/add/remove/force # Whether to indent #if/#else/#endif at the brace level (true) or from column 1 (false) pp_indent_at_level = false # false/true # Specifies the number of columns to indent preprocessors per level at brace level 0 (file-level). # If pp_indent_at_level=false, specifies the number of columns to indent preprocessors per level at brace level > 0 (function-level). # Default=1. pp_indent_count = 1 # number # Add or remove space after # based on pp_level of #if blocks pp_space = ignore # ignore/add/remove/force # Sets the number of spaces added with pp_space pp_space_count = 0 # number # The indent for #region and #endregion in C# and '#pragma region' in C/C++ pp_indent_region = 0 # number # Whether to indent the code between #region and #endregion pp_region_indent_code = false # false/true # If pp_indent_at_level=true, sets the indent for #if, #else, and #endif when not at file-level. # 0: indent preprocessors using output_tab_size. # >0: column at which all preprocessors will be indented. pp_indent_if = 0 # number # Control whether to indent the code between #if, #else and #endif. pp_if_indent_code = false # false/true # Whether to indent '#define' at the brace level (true) or from column 1 (false) pp_define_at_level = false # false/true # You can force a token to be a type with the 'type' option. # Example: # type myfoo1 myfoo2 # # You can create custom macro-based indentation using macro-open, # macro-else and macro-close. # Example: # macro-open BEGIN_TEMPLATE_MESSAGE_MAP # macro-open BEGIN_MESSAGE_MAP # macro-close END_MESSAGE_MAP # # You can assign any keyword to any type with the set option. # set func_call_user _ N_ # # The full syntax description of all custom definition config entries # is shown below: # # define custom tokens as: # - embed whitespace in token using '' escape character, or # put token in quotes # - these: ' " and ` are recognized as quote delimiters # # type token1 token2 token3 ... # ^ optionally specify multiple tokens on a single line # define def_token output_token # ^ output_token is optional, then NULL is assumed # macro-open token # macro-close token # macro-else token # set id token1 token2 ... # ^ optionally specify multiple tokens on a single line # ^ id is one of the names in token_enum.h sans the CT_ prefix, # e.g. PP_PRAGMA # # all tokens are separated by any mix of ',' commas, '=' equal signs # and whitespace (space, tab) # # You can add support for other file extensions using the 'file_ext' command. # The first arg is the language name used with the '-l' option. # The remaining args are file extensions, matched with 'endswith'. # file_ext CPP .ch .cxx .cpp.in # base-15.09/build_core/tools/scons/000077500000000000000000000000001262264444500170475ustar00rootroot00000000000000base-15.09/build_core/tools/scons/.gitignore000066400000000000000000000000061262264444500210330ustar00rootroot00000000000000*.pyc base-15.09/build_core/tools/scons/Csharp.py000066400000000000000000000055131262264444500206450ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # # A simple C# builder with no extra bells or whistles import os.path import SCons.Builder import SCons.Node.FS import SCons.Util cs_action = '$CSC "/target:exe" $_CSC_FLAGS "/out:${TARGET.abspath}" ${SOURCES}' #cs_lib_action = "csc.exe /target:library /out:${TARGET} ${SOURCE.dir}\*.cs $_CSC_FLAGS" cs_lib_action = '$CSC "/target:library" $_CSC_LIB_FLAGS $_CSC_LIB_PATHS $_CSC_REFERENCES "/out:${TARGET.abspath}" ${SOURCES}' cs_suffix = '.exe' cs_lib_suffix = '.dll' # This SCons Builder does not properly calculate the dependencies for the .NET # Framework Assemblies specified when using the CSC_REFERENCES do make sure a # Framework Assembly exist a person should use env.Depends for each Assembly listed # in the CSC_REFERENCES def generate(env): cs_builder = SCons.Builder.Builder(action = '$CSC_ACTION', src_suffix = '.cs', suffix = cs_suffix) cs_lib_builder = SCons.Builder.Builder(action = '$CSC_LIB_ACTION', src_suffix = '.cs', suffix = cs_lib_suffix) env['BUILDERS']['CSharp'] = cs_builder env['BUILDERS']['CSharpLib'] = cs_lib_builder #define the C# compiler env['CSC'] = 'csc.exe' # A list of compiler flags like debug, warn, noconfig, or nologo env['CSC_FLAGS'] = '' env['_CSC_FLAGS'] = "${_stripixes('\"/', CSC_FLAGS, '\"', '\"/', '\"', __env__)}" # A list of compiler flags when building a library file env['CSC_LIB_FLAGS'] = '' env['_CSC_LIB_FLAGS'] = "${_stripixes('\"/', CSC_LIB_FLAGS, '\"', '\"/', '\"', __env__)}" # A list of .NET Framework Assemblies i.e. dlls compiled by a .net language env['CSC_REFERENCES'] = '' env['_CSC_REFERENCES'] = "${_stripixes('\"/reference:', CSC_REFERENCES, '\"', '', '', __env__)}" # A list of paths to search for .NET Framework Assemblies env['CSC_LIB_PATHS'] = '' env['_CSC_LIB_PATHS'] = "${_stripixes('\"/lib:', CSC_LIB_PATHS, '\"', '', '', __env__)}" # Action to build an executable env['CSC_ACTION'] = cs_action # Action to build a library env['CSC_LIB_ACTION'] = cs_lib_action def exists(env): return env['CSC']base-15.09/build_core/tools/scons/configurejni.py000066400000000000000000000027321262264444500221070ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import os def ConfigureJNI(env): """Configure the environment for building JNI native code. """ if not env.get('JAVAC'): print "Java compiler not found" return 0 java_home = os.environ.get('JAVA_HOME') if not java_home: print "JAVA_HOME not set" return 0 java_include = [os.path.join(java_home, 'include')] java_lib = [os.path.join(java_home, 'lib')] java_include.append(os.path.join(java_include[0], 'win32')) java_include.append(os.path.join(java_include[0], 'linux')) java_include.append(os.path.join(java_include[0], 'darwin')) env.Append(CPPPATH = java_include) env.Append(LIBPATH = java_lib) return 1 base-15.09/build_core/tools/scons/doxygen.py000066400000000000000000000607671262264444500211160ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # # This doxygen builder does not parse the input file and populate the file list # using an emmitter for this reason to use this builder it is best to specify # env.Doxygen(source='', target=Dir('tmp')) # Where the tmp directory is never created meaning that doxygen is run every # time the SCons is run # env.Clean('Doxygen_html', Dir('html')) # Where 'html' is the output directory if building latex the output directory # would be latex import SCons.Builder import os import ConfigParser import fnmatch import re # this class will allow us to use Pythons built in config parser. # The Config parser is designed to understand ini files with headers Doxygen's # Config file is in the form of an ini file without an headers. this will add # a fake section header to the file when it is being read. class FakeSecHead(object): def __init__(self, fp): self.fp = fp self.sechead = '[doxy_config]\n' # when calling readline on the self.fp return the sechead then assign 'None' # all following calls to readline will then call self.fd.readline def readline(self): if self.sechead: try: return self.sechead finally: self.sechead = None else: return self.fp.readline() # doxygen can read in environment varibles if they have the form '$(VAR) # scons only understands environment vars of form $VAR. This will find # the doxygen expresion change is to an expression SCons understands and # will do the environment variable substitution def _doxygen_expand_environment_vars(str, env): env_var = re.match('(\$\()(\S*)(\))', str) if env_var != None: return re.sub('\$\(\S*\)', env.subst('${' + env_var.group(2) + '}'), str) else: return str # if the path to the file of directory starts with '#' character this # can only be interperated by scons. We will change it to an object path # so we can then walk the object path. def _doxygen_replace_start_hash_if_found(str, env): if str and str[0] == '#': return os.path.join(env.Dir('#').abspath, str[1:]) else: return str def _doxygen_scanner(node, env, path): source = [] #Default file pattern from doxygen 1.8 file_patterns = ['*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.idl', '*.ddl', '*.odl', '*.h', '*.hh', '*.hxx', '*.hpp', '*.h++', '*.cs', '*.d','*.php', '*.php4', '*.php5', '*.phtml', '*.inc', '*.m', '*.markdown', '*.md', '*.mm', '*.dox', '*.py', '*.f90', '*.f', '*.for', '*.tcl', '*.vhd', '*.vhdl', '*.ucf', '*.qsf', '*.as', '*.js'] # TODO figure out a way to change the default file pattern depending on the version # of doxygen being used. #Default file pattern from doxygen 1.6 #file_patterns = ['*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.d', # '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', # '*.h', '*.hh', '*.hxx', '*.hpp', '*.h++', '*.idl', # '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', # '*.mm', '*.dox', '*.py', '*.f90', '*.f', '*.for', # '*.vhd', '*.vhdl'] # all paths listed in the config file are relative to the config file config_file_path = '.' config = ConfigParser.SafeConfigParser() try: fp = open(str(node), 'r') config.readfp(FakeSecHead(fp)) finally: fp.close() config_file_path = os.path.abspath(os.path.dirname(str(node))) recursive = False input = [] generate_html = True generate_latex = True example_path = [] example_patterns = [] example_recursive = False ############################################################################ # PROCESS INPUT FILES ############################################################################ if config.has_option('doxy_config', 'file_patterns'): file_patterns_from_config = config.get('doxy_config', 'file_patterns').replace('\\', '').split() if file_patterns_from_config: file_patterns = file_patterns_from_config if config.has_option('doxy_config', 'recursive'): if config.get('doxy_config', 'recursive') == 'YES': recursive = True if config.has_option('doxy_config', 'input'): input = config.get('doxy_config', 'input').replace('\\', '').split() # if no input is found in the config file the current directory is search # otherwise it will check to see if the input file found is a file or a # directory. If it is a directory is will search the directory. If recursive # search was specified in the config file a recursive directory search will # be done. Only files that match the FILE_PATTERNS option will be added to # the source list # TODO when processing the input take into account the following tags # EXCLUDE # EXLUDE_SYMLINKS # EXLUDE_PATTERNS if not input: for filename in os.listdir(os.path.abspath(config_file_path)): for f_pattern in file_patterns: if fnmatch.fnmatchcase(filename, f_pattern): source.append(os.path.abspath(os.path.join(config_file_path, filename))) else: for i in input: i = _doxygen_expand_environment_vars(i, env) i = _doxygen_replace_start_hash_if_found(i, env) # relative paths are relative to the location of the config file if not os.path.isabs(i): i = os.path.join(config_file_path, i) if os.path.isfile(i): source.append(os.path.abspath(i)) elif os.path.isdir(i): if recursive: for root, dir, filenames in os.walk(i): for f_pattern in file_patterns: for pmatch in fnmatch.filter(filenames, f_pattern): source.append(os.path.abspath(os.path.join(root, pmatch))) else: for filename in os.listdir(os.path.abspath(i)): for f_pattern in file_patterns: if fnmatch.fnmatchcase(filename, f_pattern): source.append(os.path.abspath(os.path.join(i, filename))) ############################################################################ # PROCESS EXAMPLE TAGS ############################################################################ if config.has_option('doxy_config', 'example_patterns'): example_patterns = config.get('doxy_config', 'example_patterns').replace('\\', '').split() if example_patterns == []: example_patterns = None if config.has_option('doxy_config', 'example_recursive'): if config.get('doxy_config', 'example_recursive') == 'YES': example_recursive = True if config.has_option('doxy_config', 'example_path'): example_path = config.get('doxy_config', 'example_path').replace('\\', '').split() # if the example_path don't add any files to the source list # if the example_path is not blank but example_patterns is blank then add all # files found in the path to the source list. Use the example_recursive to # determine if the example_path should be recursivly searched. if example_path: for e in example_path: e = _doxygen_expand_environment_vars(e, env) e = _doxygen_replace_start_hash_if_found(e, env) # relative paths are relative to the location of the config file if not os.path.isabs(e): e = os.path.normpath(os.path.join(config_file_path, e)) if os.path.isdir(e): if example_recursive: for root, dir, filenames in os.walk(e): if example_patterns: for e_pattern in example_patterns: for pmatch in fnmatch.filter(filenames, e_pattern): source.append(os.path.abspath(os.path.join(root, pmatch))) else: source.append(os.path.abspath(os.path.join(root, filenames))) else: for filename in os.listdir(os.path.abspath(e)): if example_patterns: for e_pattern in example_patterns: if fnmatch.fnmatchcase(filename, e_pattern): source.append(os.path.abspath(os.path.join(e, filename))) else: if os.path.isfile(os.path.join(e, filename)): source.append(os.path.abspath(os.path.join(e, filename))) ############################################################################ # PROCESS HTML TAGS ############################################################################ if config.has_option('doxy_config', 'generate_html'): if config.get('doxy_config', 'generate_html') == 'NO': generate_html = False if generate_html: if config.has_option('doxy_config', 'html_header'): html_header = config.get('doxy_config', 'html_header') html_header = _doxygen_expand_environment_vars(html_header, env) html_header = _doxygen_replace_start_hash_if_found(html_header, env) # relative paths are relative to the location of the config file if not os.path.isabs(html_header): html_header = os.path.join(config_file_path, html_header) if os.path.isfile(html_header): source.append(os.path.abspath(html_header)) if config.has_option('doxy_config', 'html_footer'): html_footer = config.get('doxy_config', 'html_footer') html_footer = _doxygen_expand_environment_vars(html_footer, env) html_footer = _doxygen_replace_start_hash_if_found(html_footer, env) # relative paths are relative to the location of the config file if not os.path.isabs(html_footer): html_footer = os.path.join(config_file_path, html_footer) if os.path.isfile(html_footer): source.append(os.path.abspath(html_footer)) if config.has_option('doxy_config', 'html_stylesheet'): html_stylesheet = config.get('doxy_config', 'html_stylesheet') html_stylesheet = _doxygen_expand_environment_vars(html_stylesheet, env) html_stylesheet = _doxygen_replace_start_hash_if_found(html_stylesheet, env) # relative paths are relative to the location of the config file if not os.path.isabs(html_stylesheet): html_stylesheet = os.path.join(config_file_path, html_stylesheet) if os.path.isfile(html_stylesheet): source.append(os.path.abspath(html_stylesheet)) if config.has_option('doxy_config', 'html_extra_stylesheet'): html_extra_stylesheet = config.get('doxy_config', 'html_extra_stylesheet') html_extra_stylesheet = _doxygen_expand_environment_vars(html_extra_stylesheet, env) html_extra_stylesheet = _doxygen_replace_start_hash_if_found(html_extra_stylesheet, env) # relative paths are relative to the location of the config file if not os.path.isabs(html_extra_stylesheet): html_extra_stylesheet = os.path.join(config_file_path, html_extra_stylesheet) if os.path.isfile(html_extra_stylesheet): source.append(os.path.abspath(html_extra_stylesheet)) if config.has_option('doxy_config', 'html_extra_files'): html_extra_files = config.get('doxy_config', 'html_extra_files').replace('\\', '').split() for hef in html_extra_files: hef = _doxygen_expand_environment_vars(hef, env) hef = _doxygen_replace_start_hash_if_found(hef, env) # relative paths are relative to the location of the config file if not os.path.isabs(hef): hef = os.path.join(config_file_path, hef) if os.path.isfile(hef): source.append(os.path.abspath(hef)) ############################################################################ # PROCESS IMAGE_PATH TAG ############################################################################ # since doxygen's only limit on image formats is that it must be supported by # based on the document type being produced. We simply look at every file in # the folder specified in the image_path and add them to the source list. if config.has_option('doxy_config', 'image_path'): image_path = config.get('doxy_config','image_path') image_path = _doxygen_expand_environment_vars(image_path, env) image_path = _doxygen_replace_start_hash_if_found(image_path, env) if image_path: for filename in os.listdir(os.path.abspath(image_path)): if os.path.isfile(os.path.join(image_path, filename)): source.append(os.path.abspath(os.path.join(image_path, filename))) ############################################################################ # PROCESS LAYOUT_FILE TAG ############################################################################ # if layout file found add is to the source list. If not found see if the # default layout file is present 'DoxygenLayout.xml' if it is present add it # to the source files list. if config.has_option('doxy_config', 'layout_file'): layout_file = config.get('doxy_config', 'layout_file') if os.path.isfile(layout_file): source.append(os.path.abspath(layout_file)) else: if os.path.isfile('DoxygenLayout.xml'): source.append(os.path.abspath('DoxygenLayout.xml')) ############################################################################ # PROCESS LATEX / PDF input ############################################################################ if config.has_option('doxy_config', 'generate_latex'): if config.get('doxy_config', 'generate_latex') == 'NO': generate_latex = False if generate_latex: if config.has_option('doxy_config', 'latex_header'): latex_header = config.get('doxy_config', 'latex_header') latex_header = _doxygen_expand_environment_vars(latex_header, env) latex_header = _doxygen_replace_start_hash_if_found(latex_header, env) # relative paths are relative to the location of the config file if not os.path.isabs(latex_header): latex_header = os.path.join(config_file_path, latex_header) if os.path.isfile(latex_header): source.append(os.path.abspath(latex_header)) if config.has_option('doxy_config', 'latex_footer'): latex_footer = config.get('doxy_config', 'latex_footer') latex_footer = _doxygen_expand_environment_vars(latex_footer, env) latex_footer = _doxygen_replace_start_hash_if_found(latex_footer, env) # relative paths are relative to the location of the config file if not os.path.isabs(latex_footer): latex_footer = os.path.join(config_file_path, latex_footer) if os.path.isfile(latex_footer): source.append(os.path.abspath(latex_footer)) if config.has_option('doxy_config', 'latex_extra_files'): latex_extra_files = config.get('doxy_config', 'latex_extra_files').replace('\\', '').split() for lef in latex_extra_files: lef = _doxygen_expand_environment_vars(lef, env) lef = _doxygen_replace_start_hash_if_found(lef, env) # relative paths are relative to the location of the config file if not os.path.isabs(lef): lef = os.path.join(config_file_path, lef) if os.path.isfile(lef): source.append(os.path.abspath(lef)) # TODO list of tags that effect the source and target list that are not # processed. Since none of our config files currently use these tags not # processing them should not affect the output. If any of these tags are # used then this emitter may need to be expanded. # EXCLUDE # EXLUDE_SYMLINKS # EXLUDE_PATTERNS # INPUT_FILTER # FILTER_PATTERNS # FILTER_SOURCE_FILES # FILTER_SOURCE_PATTERNS # CITE_BIB_FILES # GENERATE_HTMLHELP # CHM_FILE # HHC_LOCATION # GENERATE_CHI # GENERATE_QHP # QCH_FILE # QHC_LOCATION # QHC_NAMESPACE # QHP_VIRTUAL_FOLDER # QHP_CUST_FILTER_NAME # GENERATE_ECLIPSEHELP # USE_MATHJAX # MATHJAX_RELPATH # MATHJAX_CODEFILE # GENERATE_RTF # RTF_OUTPUT # RTF_STYLESHEET_FILE # RTF_EXTENSIONS_FILE # GENERATE_MAN # MAN_OUPUT # MAN_EXTENSION # GENERATE_XML # XML_OUTPUT # XML_SCHEMA # XML_DTD # GENERATE_DOCBOOK # DOCBOOK_OUTPUT # GENERATE_AUTOGEN_DEF # GENERATE_PERLMOD # TAGFILES # GENERATE_TAGFILE # Debug print statments used while developing #print "*** Doxygen Scanner ***" #print "*** list of source files ***" #for s in source: # print str(s) #print "\n\n"any return source def _doxygen_emitter(target, source, env): # work around its Safe to use the Doxygen Builder by only specifying the # config file as the source however SCons auto generates what it thinks is # the proper target. The auto generated target is wrong if the config # file is specified as the source and no target is specified. This will # remove the source config file as a target. And prevents circular # dependencies for t in target: for s in source: if s == t: target.remove(s) config_file_path = '.' config = ConfigParser.SafeConfigParser() try: fp = open(str(source[0]), 'r') config.readfp(FakeSecHead(fp)) finally: fp.close() config_file_path = os.path.abspath(os.path.dirname(str(source[0]))) generate_html = True generate_latex = True output_directory = config_file_path html_output = 'html' latex_output = 'latex' if config.has_option('doxy_config', 'output_directory'): output_directory_from_config = config.get('doxy_config', 'output_directory') output_directory_from_config = _doxygen_expand_environment_vars(output_directory_from_config, env) output_directory_from_config = _doxygen_replace_start_hash_if_found(output_directory_from_config, env) # relative paths are relative to the location of the config file if not os.path.isabs(output_directory_from_config): output_directory_from_config = os.path.join(config_file_path, output_directory_from_config) if os.path.isdir(output_directory_from_config): output_directory = output_directory_from_config # Some versions of doxygen will fail to create the output directory if it does # not already exist. And will report that the directory does not exist and # cannot be created. This will by pass this error by creating the dictionary # for doxygen if not os.path.exists(output_directory): output_directory_from_config = config.get('doxy_config', 'output_directory') output_directory_from_config = _doxygen_expand_environment_vars(output_directory_from_config, env) env.Mkdir(output_directory_from_config) ############################################################################ # PROCESS HTML TAGS ############################################################################ if config.has_option('doxy_config', 'generate_html'): if config.get('doxy_config', 'generate_html') == 'NO': generate_html = False if generate_html: if config.has_option('doxy_config', 'html_output'): html_output_from_config = config.get('doxy_config', 'html_output') html_output_from_config = _doxygen_expand_environment_vars(html_output_from_config, env) html_output_from_config = _doxygen_replace_start_hash_if_found(html_output_from_config, env) if html_output_from_config: html_output = html_output_from_config # SCons considers directory nodes upto date if they exist. Past the # fist run of the script the directory exist preventing it from # generating a dependency graph on subsiquent runs. By adding a file # to the targets we are able to workaround this issue. Since index.html # is always updated with the build date it was chosen. target.append(env.File(os.path.abspath(os.path.join(output_directory, html_output + '/index.html')))) env.Clean(source, env.Dir(os.path.abspath(os.path.join(output_directory, html_output)))) ############################################################################ # PROCESS LATEX / PDF input ############################################################################ if config.has_option('doxy_config', 'generate_latex'): if config.get('doxy_config', 'generate_latex') == 'NO': generate_latex = False if generate_latex: if config.has_option('doxy_config', 'latex_output'): latex_output_from_config = config.get('doxy_config', 'latex_output') latex_output_from_config = _doxygen_expand_environment_vars(latex_output_from_config, env) latex_output_from_config = _doxygen_replace_start_hash_if_found(latex_output_from_config, env) if latex_output_from_config: latex_output = latex_output_from_config # SCons considers directory nodes upto date if they exist. Past the # fist run of the script the directory exist preventing it from # generating a dependency graph on subsiquent runs. By adding a file # to the targets we are able to workaround this issue. Since refman.tex # is always updated with the build date it was chosen. target.append(env.File(os.path.abspath(os.path.join(output_directory, latex_output + '/refman.tex')))) env.Clean(source, env.Dir(os.path.abspath(os.path.join(output_directory, latex_output)))) # Debug print statments used while developing #print "*** Doxygen Emiter***" #print "*** list of source files ***" #for s in source: # print str(s) #print "\n\n" #print "*** list of target files ***" #for t in target: # print str(t) #print "\n\n" return target, source def generate(env): # Add Builders for the Doxygen documentation tool import SCons.Builder doxygen_scanner = env.Scanner(name = 'doxygen_scanner', function = _doxygen_scanner) doxygen_builder = SCons.Builder.Builder( action = '${DOXYGENCOM}', emitter = _doxygen_emitter, source_scanner = doxygen_scanner, single_source = 1 ) env.Append(BUILDERS = { 'Doxygen': doxygen_builder, }) env.AppendUnique( DOXYGEN = 'doxygen', DOXYGENFLAGS = '', DOXYGENCOM = 'cd ${SOURCE.dir} && ${DOXYGEN} ${DOXYGENFLAGS} ${SOURCE.file}' ) # SystemDrive environment variable is used by doxygen on some systems to write # cach files. If the OS defines the enviroment variable 'SystemDrive' make # sure it is imported into the scons environment. if os.environ.has_key('SystemDrive'): env.PrependENVPath('SystemDrive', os.path.normpath(os.environ['SystemDrive'])) def exists(env): """ Make sure doxygen exists. """ return env.Detect("doxygen") base-15.09/build_core/tools/scons/genversion.py000066400000000000000000000150751262264444500216100ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import getpass import platform import os import re import sys from subprocess import * ver_re = re.compile('int\s+(?Pyear|month|feature|bugfix)\s*=\s*\'?(?P\w+)\'?\s*;') def GetBuildInfo(env, source, stderr=PIPE ): branches = [] tags = [] remotes = [] if env.has_key('GIT'): try: remotes = Popen([env['GIT'], 'remote', '-v'], stdout = PIPE, stderr = stderr, cwd = source).communicate()[0].splitlines() branches = Popen([env['GIT'], 'branch'], stdout = PIPE, stderr = stderr, cwd = source).communicate()[0].splitlines() tags = Popen([env['GIT'], 'describe', '--always', '--long', '--abbrev=40'], stdout = PIPE, stderr = stderr, cwd = source).communicate()[0].splitlines() except WindowsError as e: if e[0] == 2: try: project = Popen([env['GIT'], 'remote', '-v'], stdout = PIPE, stderr = stderr, cwd = source).communicate()[0].splitlines() branches = Popen([env['GIT'] + '.cmd', 'branch'], stdout = PIPE, stderr = stderr, cwd = source).communicate()[0].splitlines() tags = Popen([env['GIT'] + '.cmd', 'describe', '--always', '--long', '--abbrev=40'], stdout = PIPE, stderr = stderr, cwd = source).communicate()[0].splitlines() except: pass except: pass branch = None for b in branches: if b[0] == '*': branch = b[2:] break tag = None commit_delta = None commit_hash = None gitname = 'Git' if remotes: for l in remotes: m = re.search( r'^origin\s(?P.*)\s\(fetch\)$', l ) if m: n = re.search( r'^.*/(?P.+)$', m.group('url').strip() ) if n: gitname = 'Git: %s' % ( n.group('gitname').strip() ) break if tags: if tags[0].find('-') >= 0: tag, commit_delta, commit_hash = tuple(tags[0].rsplit('-',2)) commit_hash = commit_hash[1:] # lop off the "g" else: tag = '' commit_delta = 0; commit_hash = tags[0] if branch or commit_hash: bld_string = gitname else: bld_string = '' if branch: bld_string += " branch: '%s'" % branch if commit_hash: bld_string += " tag: '%s'" % tag if commit_delta: bld_string += ' (+%s changes)' % commit_delta if commit_delta or tag == '': bld_string += ' commit ref: %s' % commit_hash return bld_string def ParseSource(source): year = 0 month = 0 feature = 0 bugfix = '' f = open(source, 'r') lines = f.readlines() f.close(); for l in lines: m = ver_re.search(l) if m: d = m.groupdict() if d['REL'] == 'year': year = int(d['VAL']) elif d['REL'] == 'month': month = int(d['VAL']) elif d['REL'] == 'feature': feature = int(d['VAL']) elif d['REL'] == 'bugfix': if ord(d['VAL']) == ord('0'): bugfix = '' else: bugfix = '%c' % ord(d['VAL']) return (year, month, feature, bugfix, lines) def GenVersionAction(source, target, env): import time year, month, feature, bugfix, lines = ParseSource(str(source[0])) fpath = os.path.abspath(os.path.dirname(str(source[0]))) bld_info = GetBuildInfo(env, fpath) date = time.strftime('%a %b %d %H:%M:%S UTC %Y', time.gmtime()) version_str = 'v%(year)d.%(month)02d.%(feature)02d%(bugfix)s' % ({ 'year': year, 'month': month, 'feature': feature, 'bugfix': bugfix }) build_str = '%(ver)s (Built %(date)s by %(user)s%(bld)s)' % ({ 'ver': version_str, 'date': date, 'user': getpass.getuser(), 'bld': (bld_info and ' - ' + bld_info) or '' }) f = open(str(target[0]), 'w') f.write('/* This file is auto-generated. Do not modify. */\n') for l in lines: if l.find('##VERSION_STRING##') >= 0: f.write(l.replace('##VERSION_STRING##', version_str)) elif l.find('##BUILD_STRING##') >= 0: f.write(l.replace('##BUILD_STRING##', build_str)) else: f.write(l) f.close() def generate(env): import SCons.Builder builders = [ SCons.Builder.Builder(action = GenVersionAction, suffix = '.cc', src_suffix = '.cc.in'), SCons.Builder.Builder(action = GenVersionAction, suffix = '.c', src_suffix = '.c.in') ] env.Append(BUILDERS = { 'GenVersion' : builders[0] }) if env.Detect('git'): env.AppendUnique(GIT = 'git') def exists(env): return true # "main" calls GetBuildInfo() and prints bld_string on stdout # "main" takes one argument: path to git workspace (optional) # "git" executable is expected to be found in PATH def main( argv=None ): env = dict() env['GIT'] = 'git' source = '' if argv and argv[0]: source = argv[0].strip() if source == '': source = '.' bld_string = GetBuildInfo( env, source, stderr=None ) if bld_string and bld_string != '': print '%s' % ( bld_string ) return 0 else: sys.stderr.write( 'error, unable to get Git version info\n' ) sys.stderr.flush() return 1 if __name__ == '__main__': if len(sys.argv) > 1: sys.exit(main(sys.argv[1:])) else: sys.exit(main()) base-15.09/build_core/tools/scons/javadoc.py000066400000000000000000000127451262264444500210410ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import os import os.path import re import string from datetime import datetime import SCons.Builder from SCons.Node.FS import _my_normcase from SCons.Tool.JavaCommon import parse_java_file _re_package = re.compile(r'^\s*package\s+([A-Za-z\.]+)', re.M) _re_public = re.compile(r'^public', re.M) def parse_javadoc_file(fn): """ Return the package name of Java files with a public class. As configured here, javadoc only generates documentation for public classes. """ contents = open(fn, 'r').read() pkg = _re_package.search(contents).group(1) if _re_public.search(contents): return pkg def javadoc_emitter(source, target, env): """ Look in the source directory for all .java and .html files. Only those .java files with public classes will be listed as a source dependency. The target is a single file: DOCS/index.html (always generated by javadoc). I could not figure out how to get SCons to use a directory as a target, therefore the use of the pseudo-builder JavaDoc (and also to handle clean correctly). """ slist = [] for entry in source: def visit(sl, dirname, names): d = env.Dir(dirname) for fn in names: if os.path.splitext(fn)[1] in ['.java']: f = d.File(fn) f.attributes.javadoc_src = source f.attributes.javadoc_sourcepath = entry.abspath pkg = parse_javadoc_file(str(f)) if pkg: f.attributes.javadoc_pkg = pkg slist.append(f) elif os.path.splitext(fn)[1] in ['.html']: f = d.File(fn) f.attributes.javadoc_src = source f.attributes.javadoc_sourcepath = entry.abspath if os.path.basename(str(f)) == 'overview.html': f.attributes.javadoc_overview = '"' + env.File(str(f)).abspath + '"' slist.append(f) os.path.walk(entry.abspath, visit, slist) slist = env.Flatten(slist) tlist = [target[0].File('index.html')] return tlist, slist def javadoc_generator(source, target, env, for_signature): javadoc_classpath = '-classpath \"%s\"' % (env['JAVACLASSPATH']) javadoc_windowtitle = '-windowtitle \"%s\"' % (env['PROJECT_LONG_NAME']) javadoc_doctitle = '-doctitle \"%s

%s

\"' % (env['PROJECT_LONG_NAME'], env['PROJECT_NUMBER']) javadoc_header = '-header \"%s\"' % (env['PROJECT_SHORT_NAME']) try: copyright = env['PROJECT_COPYRIGHT'] except KeyError: copyright = "Copyright AllSeen Alliance, Inc. All Rights Reserved.

AllSeen, AllSeen Alliance, and AllJoyn are trademarks of the AllSeen Alliance, Inc in the United States and other jurisdictions.

THIS DOCUMENT AND ALL INFORMATION CONTAIN HEREIN ARE PROVIDED ON AN \"AS-IS\" BASIS WITHOUT WARRANTY OF ANY KIND.
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION" javadoc_bottom = '-bottom \"' + "%s %s ($(%s$))
%s
" % (env['PROJECT_LONG_NAME'], env['PROJECT_NUMBER'], datetime.now().strftime('%a %b %d %H:%M:%S %Y'), copyright) + '\"' javadoc_overview = '' for s in source: try: javadoc_overview = '-overview ' + s.attributes.javadoc_overview except AttributeError: pass javadoc_sourcepath = [] for s in source: try: javadoc_sourcepath.append(s.attributes.javadoc_sourcepath) except AttributeError: pass javadoc_sourcepath = os.pathsep.join(set(javadoc_sourcepath)) javadoc_packages = [] for s in source: try: javadoc_packages.append(s.attributes.javadoc_pkg) except AttributeError: pass javadoc_packages = ' '.join(set(javadoc_packages)) com = 'javadoc %s -use %s %s -quiet -public -noqualifier all %s %s %s -sourcepath "%s" -d ${TARGET.dir} %s' % (javadoc_classpath, javadoc_windowtitle, javadoc_doctitle, javadoc_header, javadoc_bottom, javadoc_overview, javadoc_sourcepath, javadoc_packages) return com def JavaDoc(env, target, source, *args, **kw): """ JavaDoc('docs', 'src') will call javadoc on all public .java files under the 'src' directory. Package and private .java files are ignored. """ apply(env.JavaDocBuilder, (target, source) + args, kw) env.Clean(target, target) return [env.Dir(target)] def generate(env): fs = SCons.Node.FS.get_default_fs() javadoc_builder = SCons.Builder.Builder( generator = javadoc_generator, emitter = javadoc_emitter, target_factory = fs.Dir, source_factory = fs.Dir) env.Append(BUILDERS = { 'JavaDocBuilder': javadoc_builder }) env.AddMethod(JavaDoc, 'JavaDoc') def exists(env): """ Make sure javadoc exists. """ return env.Detect("javadoc") base-15.09/build_core/tools/scons/javastatus.py000066400000000000000000000151171262264444500216130ustar00rootroot00000000000000#!/usr/bin/python # Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import sys import os import getopt from xml.dom import minidom from xml.sax.saxutils import escape if sys.version_info[:3] < (2,4,0): from sets import Set as set includeSet = set() def openFile(name, type): try: return open(name, type) except IOError, e: errno, errStr = e print "I/O Operation on %s failed" % name print "I/O Error(%d): %s" % (errno, errStr) raise e def main(argv=None): """ make_status --code --base [--deps ] [--help] Where: - Output "Java" code - Root directory for xi:include directives - Ouput makefile dependency file """ global codeOut global depOut global isFirst global fileArgs global baseDir codeOut = None depOut = None isFirst = True baseDir = "" if argv is None: argv = sys.argv[1:] try: opts, fileArgs = getopt.getopt(argv, "h", ["help", "code=", "dep=", "base="]) for o, a in opts: if o in ("-h", "--help"): print __doc__ return 0 if o in ("--code"): codeOut = openFile(a, 'w') if o in ("--dep"): depOut = openFile(a, 'w') if o in ("--base"): baseDir = a if None == codeOut: raise Error("Must specify --code") writeHeaders() for arg in fileArgs: ret = parseDocument(arg) writeFooters() if None != codeOut: codeOut.close() if None != depOut: depOut.close() except getopt.error, msg: print msg print "for help use --help" return 1 except Exception, e: print "ERROR: %s" % e if None != codeOut: os.unlink(codeOut.name) if None != depOut: os.unlink(depOut.name) return 1 return 0 def writeHeaders(): global codeOut global depOut global fileArgs if None != depOut: depOut.write("%s %s %s:" % (depOut.name, codeOut.name)) for arg in fileArgs: depOut.write(" \\\n %s" % arg) if None != codeOut: codeOut.write("""/* This file is auto-generated. Do not modify. */ /* * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package org.alljoyn.bus; /** * Standard function return codes for this package. */ public enum Status { """) def writeFooters(): global codeOut global depOut if None != depOut: depOut.write("\n") if None != codeOut: codeOut.write("""; /** Error Code */ private int errorCode; /** Constructor */ private Status(int errorCode) { this.errorCode = errorCode; } /** Static constructor */ private static Status create(int errorCode) { for (Status s : Status.values()) { if (s.getErrorCode() == errorCode) { return s; } } return NONE; } /** * Gets the numeric error code. * * @return the numeric error code */ public int getErrorCode() { return errorCode; } } """) def parseDocument(fileName): dom = minidom.parse(fileName) for child in dom.childNodes: if child.localName == 'status_block': parseStatusBlock(child) elif child.localName == 'include' and child.namespaceURI == 'http://www.w3.org/2001/XInclude': parseInclude(child) dom.unlink() def parseStatusBlock(blockNode): global codeOut global isFirst offset = 0 for node in blockNode.childNodes: if node.localName == 'offset': offset = int(node.firstChild.data, 0) elif node.localName == 'status': if isFirst: if None != codeOut: codeOut.write("\n /** %s %s. */" % (escape(node.getAttribute('value')), escape(node.getAttribute('comment')))) codeOut.write("\n %s(%s)" % (node.getAttribute('name')[3:], node.getAttribute('value'))) isFirst = False else: if None != codeOut: codeOut.write(",\n /** %s %s. */" % (escape(node.getAttribute('value')), escape(node.getAttribute('comment')))) codeOut.write("\n %s(%s)" % (node.getAttribute('name')[3:], node.getAttribute('value'))) offset += 1 elif node.localName == 'include' and node.namespaceURI == 'http://www.w3.org/2001/XInclude': parseInclude(node) def parseInclude(includeNode): global baseDir global includeSet href = os.path.join(baseDir, includeNode.attributes['href'].nodeValue) if href not in includeSet: includeSet.add(href) if None != depOut: depOut.write(" \\\n %s" % href) parseDocument(href) def JavaStatus(source): return main(['--base=%s' % os.path.abspath('..'), '--code=%s.java' % source, '%s.xml' % source]) if __name__ == "__main__": sys.exit(main()) base-15.09/build_core/tools/scons/jsdoc3.py000066400000000000000000000062261262264444500206140ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import SCons.Builder import SCons.Action import os def _jsdoc3_scanner(node, env, path): source = [] # walk the JSDOC_TEMPLATE dir and add the files in the demplate dir to the # source list. This way documentation will be rebuilt if a template file is # modified template_dir = env.Dir('$JSDOC_TEMPLATE') for root, dir, filenames in os.walk(str(template_dir)): for f in filenames: source.append(os.path.abspath(os.path.join(root, f))) return source def _jsdoc3_emitter(target, source, env): if len(target) > 1: print('scons: *** Only one target may be specified for the jsdoc3 Builder.') exit(1) if type(target[0]) != SCons.Node.FS.Dir: print('scons: *** Target MUST be a Dir node.') exit(1); outputDir = target[0]; # SCons considers directory nodes upto date if they exist. Past the # fist run of the script the directory exist preventing it from # generating a dependency graph on subsiquent runs. By adding a file # to the targets we are able to workaround this issue. Since index.html # is always updated with the build date it was chosen. target[0] = env.File(str(target[0]) + '/index.html') # make sure the output directory is cleaned. env.Clean(env.File(source), outputDir) return target, source def generate(env): jsdoc3_scanner = env.Scanner(name = 'jsdoc3_scanner', function = _jsdoc3_scanner) _jsdoc3_action = SCons.Action.Action('${JSDOCCOM}', '${JSDOCCOMSTR}') _jsdoc3_builder = SCons.Builder.Builder( action ='jsdoc ${JSDOC_FLAGS} -t ${JSDOC_TEMPLATE} -d ${TARGET.dir} ${SOURCES}', src_suffix = '$JSDOC_SUFFIX', emitter = _jsdoc3_emitter, source_scanner = jsdoc3_scanner ) env.Append(BUILDERS = { 'jsdoc3': _jsdoc3_builder, }) env.AppendUnique( JSDOCCOM = 'jsdoc ${JSDOC_FLAGS} -t ${JSDOC_TEMPLATE} -d ${TARGET.dir} ${SOURCES}', JSDOCCOMSTR = '${JSDOCCOM}', # Suffixes/prefixes JSDOC_SUFFIX = '.js', # JSDoc 2 build flags JSDOC_FLAGS = '', # directory containing the publish.js and other template files. JSDOC_TEMPLATE = env.Dir('templates') ) def exists(env): """ Make sure jsDoc exists. """ run_exists = env.Detect('jsdoc') return (java_exists and jsrun_exists and run_exists) base-15.09/build_core/tools/scons/jsstatus.py000066400000000000000000000151441262264444500213060ustar00rootroot00000000000000#!/usr/bin/python # Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import sys import os import getopt from xml.dom import minidom if sys.version_info[:3] < (2,4,0): from sets import Set as set includeSet = set() def openFile(name, type): try: return open(name, type) except IOError, e: errno, errStr = e print "I/O Operation on %s failed" % name print "I/O Error(%d): %s" % (errno, errStr) raise e def main(argv=None): """ make_status --code --base [--deps ] [--help] Where: - Output "C++" code - Root directory for xi:include directives - Ouput makefile dependency file """ global codeOut global depOut global isFirst global fileArgs global baseDir codeOut = None depOut = None isFirst = True baseDir = "" if argv is None: argv = sys.argv[1:] try: opts, fileArgs = getopt.getopt(argv, "h", ["help", "code=", "dep=", "base="]) for o, a in opts: if o in ("-h", "--help"): print __doc__ return 0 if o in ("--code"): codeOut = openFile(a, 'w') if o in ("--dep"): depOut = openFile(a, 'w') if o in ("--base"): baseDir = a if None == codeOut: raise Error("Must specify --code") writeHeaders() for arg in fileArgs: ret = parseDocument(arg) writeFooters() if None != codeOut: codeOut.close() if None != depOut: depOut.close() except getopt.error, msg: print msg print "for help use --help" return 1 except Exception, e: print "ERROR: %s" % e if None != codeOut: os.unlink(codeOut.name) if None != depOut: os.unlink(depOut.name) return 1 return 0 def writeHeaders(): global codeOut global depOut global fileArgs if None != depOut: depOut.write("%s %s %s:" % (depOut.name, codeOut.name)) for arg in fileArgs: depOut.write(" \\\n %s" % arg) if None != codeOut: codeOut.write("""/* This file is auto-generated. Do not modify. */ /* * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "BusErrorInterface.h" #include "TypeMapping.h" #include #define QCC_MODULE "ALLJOYN_JS" std::map _BusErrorInterface::constants; std::map& _BusErrorInterface::Constants() { if (constants.empty()) { """) def writeFooters(): global codeOut global depOut if None != depOut: depOut.write("\n") if None != codeOut: codeOut.write(""" } return constants; } _BusErrorInterface::_BusErrorInterface(Plugin& plugin) : ScriptableObject(plugin, Constants()) { QCC_DbgTrace(("%s", __FUNCTION__)); ATTRIBUTE("name", &_BusErrorInterface::getName, 0); ATTRIBUTE("message", &_BusErrorInterface::getMessage, 0); ATTRIBUTE("code", &_BusErrorInterface::getCode, 0); } _BusErrorInterface::~_BusErrorInterface() { QCC_DbgTrace(("%s", __FUNCTION__)); } bool _BusErrorInterface::getName(NPVariant* result) { ToDOMString(plugin, plugin->error.name, *result, TreatEmptyStringAsUndefined); return true; } bool _BusErrorInterface::getMessage(NPVariant* result) { ToDOMString(plugin, plugin->error.message, *result, TreatEmptyStringAsUndefined); return true; } bool _BusErrorInterface::getCode(NPVariant* result) { if (ER_NONE == plugin->error.code) { VOID_TO_NPVARIANT(*result); } else { ToUnsignedShort(plugin, plugin->error.code, *result); } return true; } """) def parseDocument(fileName): dom = minidom.parse(fileName) for child in dom.childNodes: if child.localName == 'status_block': parseStatusBlock(child) elif child.localName == 'include' and child.namespaceURI == 'http://www.w3.org/2001/XInclude': parseInclude(child) dom.unlink() def parseStatusBlock(blockNode): global codeOut offset = 0 for node in blockNode.childNodes: if node.localName == 'offset': offset = int(node.firstChild.data, 0) elif node.localName == 'status': if None != codeOut: codeOut.write(" CONSTANT(\"%s\", %s);\n" % (node.getAttribute('name')[3:], node.getAttribute('value'))) offset += 1 elif node.localName == 'include' and node.namespaceURI == 'http://www.w3.org/2001/XInclude': parseInclude(node) def parseInclude(includeNode): global baseDir global includeSet href = os.path.join(baseDir, includeNode.attributes['href'].nodeValue) if href not in includeSet: includeSet.add(href) if None != depOut: depOut.write(" \\\n %s" % href) parseDocument(href) def JavaScriptStatus(source, dest): return main(['--base=%s' % os.path.abspath('.'), '--code=%s' % dest, '%s' % source]) if __name__ == "__main__": sys.exit(main()) base-15.09/build_core/tools/scons/patches/000077500000000000000000000000001262264444500204765ustar00rootroot00000000000000base-15.09/build_core/tools/scons/patches/SConsWin8.txt000066400000000000000000000267201262264444500230410ustar00rootroot00000000000000diff --recursive -u --exclude=*.pyc --exclude=*.pyo ../../scons-2.2.0/engine/scons/Tool/MSCommon/common.py ./Tool/MSCommon/common.py --- ../../scons-2.2.0/engine/scons/Tool/MSCommon/common.py Fri Sep 14 10:15:31 2012 +++ ./Tool/MSCommon/common.py Fri Sep 14 09:56:01 2012 @@ -135,7 +135,11 @@ # controlled by vc.py, or else derived from the common_tools_var # settings in vs.py. vars = [ + 'ProgramFiles', + 'ProgramFiles(x86)', 'COMSPEC', + 'VS110COMNTOOLS', + 'VS100COMNTOOLS', 'VS90COMNTOOLS', 'VS80COMNTOOLS', 'VS71COMNTOOLS', diff --recursive -u --exclude=*.pyc --exclude=*.pyo ../../scons-2.2.0/engine/scons/Tool/MSCommon/sdk.py ./Tool/MSCommon/sdk.py --- ../../scons-2.2.0/engine/scons/Tool/MSCommon/sdk.py Fri Sep 14 10:15:31 2012 +++ ./Tool/MSCommon/sdk.py Fri Sep 14 09:55:06 2012 @@ -125,6 +125,30 @@ debug("sdk.py: get_sdk_vc_script():file:%s"%file) return file + def get_sdk_appx_subdir(self): + """ Return the script to initialize the VC compiler installed by SDK + """ + + if self.__dict__.has_key('vc_appx_subdir') == False: + return None + + appx_subdir = self.vc_appx_subdir; + if not appx_subdir: + debug("sdk.py: get_sdk_appx_subdir():sdk doesn't support appx"); + return None + + file=os.path.join(self.find_sdk_dir(), appx_subdir) + if not file: + debug("sdk.py: get_sdk_appx_subdir():no file") + else: + debug("sdk.py: get_sdk_appx_subdir():file:%s"%file) + + if not os.path.exists(file): + debug("sdk.py: get_sdk_appx_subdir(): sanity check %s not found" % ftc) + return None + + return file + class WindowsSDK(SDKDefinition): """ A subclass for trying to find installed Windows SDK directories. @@ -164,6 +188,21 @@ 'x86_ia64' : r'bin\vcvarsx86_ia64.bat', 'ia64' : r'bin\vcvarsia64.bat'} +SDK71VCSetupScripts = { 'x86' : r'bin\vcvars32.bat', + 'amd64' : r'bin\vcvars64.bat', + 'x86_amd64': r'bin\vcvarsx86_amd64.bat', + 'x86_ia64' : r'bin\vcvarsx86_ia64.bat', + 'ia64' : r'bin\vcvarsia64.bat'} + +SDK80VCSetupScripts = { 'x86' : r'bin\vcvars32.bat', + 'amd64' : r'bin\vcvars64.bat', + 'x86_amd64' : r'bin\vcvarsx86_amd64.bat', + 'x86_ia64' : r'bin\vcvarsx86_ia64.bat', + 'ia64' : r'bin\vcvarsia64.bat', + 'amd64_arm' : r'bin\vcvarsarm.bat', + 'x86_arm' : r'bin\vcvarsarm.bat'} + + # The list of support SDKs which we know how to detect. # # The first SDK found in the list is the one used by default if there @@ -172,6 +211,27 @@ # # If you update this list, update the documentation in Tool/mssdk.xml. SupportedSDKList = [ + WindowsSDK('8.0', + sanity_check_file=r'bin\x86\makeappx.exe', + include_subdir='include', + lib_subdir={ + 'x86' : ['lib'], + 'x86_64' : [r'lib\x64'], + 'ia64' : [r'lib\ia64'], + }, + vc_setup_scripts = SDK80VCSetupScripts, + vc_appx_subdir = 'References\\CommonConfiguration\\Neutral', + ), + WindowsSDK('7.1', + sanity_check_file=r'bin\SetEnv.Cmd', + include_subdir='include', + lib_subdir={ + 'x86' : ['lib'], + 'x86_64' : [r'lib\x64'], + 'ia64' : [r'lib\ia64'], + }, + vc_setup_scripts = SDK71VCSetupScripts, + ), WindowsSDK('7.0', sanity_check_file=r'bin\SetEnv.Cmd', include_subdir='include', diff --recursive -u --exclude=*.pyc --exclude=*.pyo ../../scons-2.2.0/engine/scons/Tool/MSCommon/vc.py ./Tool/MSCommon/vc.py --- ../../scons-2.2.0/engine/scons/Tool/MSCommon/vc.py Fri Sep 14 10:15:31 2012 +++ ./Tool/MSCommon/vc.py Fri Sep 14 10:06:05 2012 @@ -81,6 +81,7 @@ "itanium" : "ia64", "x86" : "x86", "x86_64" : "amd64", + "arm" : "arm", } # Given a (host, target) tuple, return the argument for the bat file. Both host @@ -90,7 +91,9 @@ ("x86", "amd64"): "x86_amd64", ("amd64", "amd64"): "amd64", ("amd64", "x86"): "x86", - ("x86", "ia64"): "x86_ia64" + ("x86", "ia64"): "x86_ia64", + ("amd64", "arm"): "x86_arm", + ("x86", "arm"): "x86_arm", } def get_host_target(env): @@ -155,6 +158,12 @@ '6.0': [ r'Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++\ProductDir'] } + +_VCVER_APPX_PLATFORM_DIR = { + '11.0Exp' : [r'vcpackages'], + '11.0' : [r'vcpackages'], +} + def msvc_version_to_maj_min(msvc_version): msvc_version_numeric = ''.join([x for x in msvc_version if x in string_digits + '.']) @@ -227,6 +236,23 @@ raise MissingConfiguration("registry dir %s not found on the filesystem" % comps) return None +def find_vc_appx_dir(env,msvc_version): + pdir = find_vc_pdir(msvc_version) + if pdir is None: + return None + + debug('vc.py: find_vc_appx_dir(): found directory for VC version %s' % repr(msvc_version)) + + if _VCVER_APPX_PLATFORM_DIR.has_key(msvc_version) == False: + debug('vc.py: find_vc_appx_dir(): no appx directory specified for VC version %s' % repr(msvc_version)) + return None + + subdir = _VCVER_APPX_PLATFORM_DIR[msvc_version][0] + + pdir = os.path.join(pdir, subdir) + debug('vc.py: find_vc_appx_dir(): found platform directory %s' % pdir) + return pdir + def find_batch_file(env,msvc_version,host_arch,target_arch): """ Find the location of the batch script which should set up the compiler @@ -417,6 +443,48 @@ return d +def msvc_appx_metadata_to_flags(env,appx_sdk_directory): + debug('msvc_appx_metadata_to_flags()') + + dirList = os.listdir(appx_sdk_directory) + for fname in dirList: + if fname.endswith(".winmd"): + env.Append(_APPX_CXXFLAGS=['/FU%s\\%s' % (appx_sdk_directory, fname)]) + return + +def msvc_setup_appx_env(env, version): + debug('msvc_setup_appx_env()') + + # detect if appx sdk is installed + appx_sdk_version = os.environ.get('APPX_MSSDK_VERSION') + if appx_sdk_version: + debug('msvc_setup_appx_env: using specified APPX_MSSDK_VERSION version %s\n' % repr(appx_sdk_version)) + appx_sdk = sdk.get_sdk_by_version(appx_sdk_version) + if appx_sdk is None: + debug('msvc_setup_appx_env: APPX_MSSDK_VERSION %s was not found installed\n' % repr(appx_sdk_version)) + return + + appx_sdk_directory = appx_sdk.get_sdk_appx_subdir() + if appx_sdk_directory is None: + debug('msvc_setup_appx_env: APPX_MSSDK_VERSION %s is missing its metadata directory\n' % repr(appx_sdk_version)) + return + + env.Append(_APPX_CXXFLAGS=['/AI%s' % appx_sdk_directory]) + cxxflags = env['_APPX_CXXFLAGS'] + + msvc_appx_metadata_to_flags(env,appx_sdk_directory) + + # now, add the platform specific metadata file on to the flags + vc_appx_directory = find_vc_appx_dir(env,version) + if vc_appx_directory is None: + debug('msvc_setup_appx_env: no platform appx directory for VC version: %s' % repr(version)) + return + + msvc_appx_metadata_to_flags(env,vc_appx_directory) + else: + debug('msvc_setup_appx_env(): APPX_MSSDK_VERSION not found in env') + + return def msvc_setup_env(env): debug('msvc_setup_env()') @@ -455,6 +523,10 @@ for k, v in d.items(): debug('vc.py:msvc_setup_env() env:%s -> %s'%(k,v)) env.PrependENVPath(k, v, delete_existing=True) + + if env.has_key('APPX_CXXFLAGS') and env['APPX_CXXFLAGS'] == 'true': + msvc_setup_appx_env(env, version) + def msvc_exists(version=None): vcs = cached_get_installed_vcs() diff --recursive -u --exclude=*.pyc --exclude=*.pyo ../../scons-2.2.0/engine/scons/Tool/MSCommon/vs.py ./Tool/MSCommon/vs.py --- ../../scons-2.2.0/engine/scons/Tool/MSCommon/vs.py Fri Sep 14 10:15:31 2012 +++ ./Tool/MSCommon/vs.py Fri Sep 14 10:02:34 2012 @@ -211,28 +211,29 @@ # default_dirname='TBD', #), - # Visual Studio 11 + # Visual Studio 2012 # The batch file we look for is in the VC directory, # so the devenv.com executable is up in ..\..\Common7\IDE. VisualStudio('11.0', - sdk_version='6.1', + vc_version='11.0', + sdk_version='8.0', hkeys=[r'Microsoft\VisualStudio\11.0\Setup\VS\ProductDir'], common_tools_var='VS110COMNTOOLS', executable_path=r'Common7\IDE\devenv.com', batch_file_path=r'Common7\Tools\vsvars32.bat', default_dirname='Microsoft Visual Studio 11', - supported_arch=['x86', 'amd64'], + supported_arch=['x86', 'amd64', "arm"], ), # Visual C++ 11 Express Edition # The batch file we look for is in the VC directory, - # so the VCExpress.exe executable is up in ..\..\Common7\IDE. + # so the VSWinExpress.exe executable is up in ..\..\Common7\IDE. VisualStudio('11.0Exp', vc_version='11.0', - sdk_version='6.1', - hkeys=[r'Microsoft\VCExpress\11.0\Setup\VS\ProductDir'], + sdk_version='8.0', + hkeys=[r'Microsoft\VSWinExpress\11.0\Setup\VS\ProductDir'], common_tools_var='VS110COMNTOOLS', - executable_path=r'Common7\IDE\VCExpress.exe', + executable_path=r'Common7\IDE\VSWinExpress.exe', batch_file_path=r'Common7\Tools\vsvars32.bat', default_dirname='Microsoft Visual Studio 11', supported_arch=['x86'], diff --recursive -u --exclude=*.pyc --exclude=*.pyo ../../scons-2.2.0/engine/scons/Tool/msvc.py ./Tool/msvc.py --- ../../scons-2.2.0/engine/scons/Tool/msvc.py Fri Sep 14 10:15:30 2012 +++ ./Tool/msvc.py Fri Sep 14 09:46:37 2012 @@ -220,7 +220,7 @@ env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Z7") or ""}']) env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s \\\"/Fp%s\\\""%(PCHSTOP or "",File(PCH))) or ""}']) env['_MSVC_OUTPUT_FLAG'] = msvc_output_flag - env['_CCCOMCOM'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $CCPCHFLAGS $CCPDBFLAGS' + env['_CCCOMCOM'] = '$CPPFLAGS $_APPX_CXXFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $CCPCHFLAGS $CCPDBFLAGS' env['CC'] = 'cl' env['CCFLAGS'] = SCons.Util.CLVar('/nologo') env['CFLAGS'] = SCons.Util.CLVar('') @@ -260,7 +260,7 @@ env['CXXFILESUFFIX'] = '.cc' env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}']) - env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS' + env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $_APPX_CXXFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS' env['BUILDERS']['PCH'] = pch_builder if 'ENV' not in env: base-15.09/build_core/tools/scons/widl.py000066400000000000000000000105051262264444500203610ustar00rootroot00000000000000#!/usr/bin/python # Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import sys import os import getopt from xml.dom import minidom if sys.version_info[:3] < (2,4,0): from sets import Set as set includeSet = set() def openFile(name, type): try: return open(name, type) except IOError, e: errno, errStr = e print "I/O Operation on %s failed" % name print "I/O Error(%d): %s" % (errno, errStr) raise e def main(argv=None): """ make_status --code --base --widl [--help] Where: - Output "WIDL" code - Root directory for xi:include directives - Input "WIDL" code """ global codeOut global isFirst global fileArgs global baseDir global widlIn codeOut = None isFirst = True baseDir = "" widlIn = None if argv is None: argv = sys.argv[1:] try: opts, fileArgs = getopt.getopt(argv, "h", ["help", "code=", "widl=", "base="]) for o, a in opts: if o in ("-h", "--help"): print __doc__ return 0 if o in ("--code"): codeOut = openFile(a, 'w') if o in ("--widl"): widlIn = openFile(a, 'r') if o in ("--base"): baseDir = a if None == codeOut: raise Error("Must specify --code") if None == widlIn: raise Error("Must specify --widl") lines = widlIn.readlines() codeOut.write('/* This file is auto-generated. Do not modify. */\n') for l in lines: if l.find('##STATUS##') >= 0: for arg in fileArgs: ret = parseDocument(arg) else: codeOut.write(l) if None != codeOut: codeOut.close() if None != widlIn: widlIn.close() except getopt.error, msg: print msg print "for help use --help" return 1 except Exception, e: print "ERROR: %s" % e if None != codeOut: os.unlink(codeOut.name) return 1 return 0 def parseDocument(fileName): dom = minidom.parse(fileName) for child in dom.childNodes: if child.localName == 'status_block': parseStatusBlock(child) elif child.localName == 'include' and child.namespaceURI == 'http://www.w3.org/2001/XInclude': parseInclude(child) dom.unlink() def parseStatusBlock(blockNode): global codeOut offset = 0 for node in blockNode.childNodes: if node.localName == 'offset': offset = int(node.firstChild.data, 0) elif node.localName == 'status': if None != codeOut: codeOut.write(" /** %s */\n" % node.getAttribute('comment')) codeOut.write(" const unsigned short %s = %s;\n" % (node.getAttribute('name')[3:], node.getAttribute('value'))) offset += 1 elif node.localName == 'include' and node.namespaceURI == 'http://www.w3.org/2001/XInclude': parseInclude(node) def parseInclude(includeNode): global baseDir global includeSet href = os.path.join(baseDir, includeNode.attributes['href'].nodeValue) if href not in includeSet: includeSet.add(href) parseDocument(href) def Widl(widlIn, statusXml, widlOut): return main(['--base=%s' % os.path.abspath('.'), '--widl=%s' % widlIn, '--code=%s' % widlOut, '%s' % statusXml]) if __name__ == "__main__": sys.exit(main()) base-15.09/config/000077500000000000000000000000001262264444500137205ustar00rootroot00000000000000base-15.09/config/.gitignore000066400000000000000000000003711262264444500157110ustar00rootroot00000000000000*.a *.class *.jar *.o *.so *~ .cproject .project .sconsign.dblite .settings/* */.settings/* libs QA ajlite.nvram alljoyn-daemon bin build deploy docs/*.html docs/html/*.html gen lib local.properties obj* .DS_Store xcuserdata xccheckout xcshareddata base-15.09/config/ReleaseNotes.txt000066400000000000000000000031271262264444500170550ustar00rootroot00000000000000AllJoyn Config Version 15.09 Release Notes ========================================== Fully Supported Platforms ------------------------- 1) Linux Ubuntu (64 bit x86) 2) Android Lollipop (ARM7) Features added in Version 15.09 ------------------------------- None Issues Addressed in Version 15.09 --------------------------------- ASABASE-535: Replace the pink AllJoyn meatball logo with the new AllJoyn logo ASABASE-553: Update 15.09 SC base services to only use Config, Notification on Linux To search for other fixed issues: https://jira.allseenalliance.org/issues/?jql=project%20%3D%20ASABASE%20AND%20issuetype%20%3D%20Bug%20AND%20fixVersion%20%3D%20%2215.09%22%20AND%20component%20%3D%20%22Config%20Service%20Framework%22%20AND%20status%20in%20(Resolved%2C%20Closed) Known Issues ------------ * Base services have not been updated to support security 2.0 To search for other known issues: https://jira.allseenalliance.org/issues/?jql=project%20%3D%20ASABASE%20AND%20issuetype%20%3D%20Bug%20AND%20fixVersion%20in%20(15.09a%2C%20%22Next%20Major%20Release%22)%20AND%20component%20%3D%20%22Config%20Service%20Framework%22%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened%2C%20New%2C%20%22Monitor%20%2F%20On%20Hold%22) Compatibility ------------- No changes Change history -------------- 15.09 - Bug fixes, compatibility with Core 15.09 15.04 - Bug fixes, compatibility with Core 15.04 14.12 - Bug fixes, compatibility with Core 14.12 14.06 - Device name supports multi language on all platforms, bug fixes, updates needed to match new core 14.06 14.02 - 1st AllSeen Alliance release base-15.09/config/SConscript000066400000000000000000000051651262264444500157410ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. import os Import('env') env.Append(CPPDEFINES = 'NEED_DATA_STORE') env['_ALLJOYN_CONFIG_'] = True env['OBJDIR_SERVICES_CONFIG'] = env['OBJDIR'] + '/services/config' # Make config library and header file paths available to the global environment env.Append(LIBPATH = '$DISTDIR/config/lib'); env.Append(CPPPATH = '$DISTDIR/config/inc'); if not env.has_key('_ALLJOYN_ABOUT_') and os.path.exists('../../../core/alljoyn/services/about/SConscript'): env.SConscript('../../../core/alljoyn/services/about/SConscript') if not env.has_key('_ALLJOYN_SERVICES_COMMON_') and os.path.exists('../services_common/SConscript'): env.SConscript('../services_common/SConscript') if 'cpp' in env['bindings'] and not env.has_key('_ALLJOYNCORE_') and os.path.exists('../../core/alljoyn/alljoyn_core/SConscript'): env.SConscript('../../../core/alljoyn/alljoyn_core/SConscript') if 'java' in env['bindings'] and not env.has_key('_ALLJOYN_JAVA_') and os.path.exists('../../core/alljoyn/alljoyn_java/SConscript'): env.SConscript('../../../core/alljoyn/alljoyn_java/SConscript') config_env = env.Clone() # ASABASE-452, ASACORE-1419 # Even though we have deprecated the About Service code the config service is # designed so a developer can use the deprecated AboutService or the new # About Feature code. So the config service can continue to support the deprecated # methods we must turn off the deprecated-declarations warning. if config_env['OS_GROUP'] == 'posix': config_env.Append(CXXFLAGS = ['-Wno-deprecated-declarations']) for b in config_env['bindings']: if os.path.exists('%s/SConscript' % b): config_env.VariantDir('$OBJDIR_SERVICES_CONFIG/%s' % b, b, duplicate = 0) config_env.SConscript(['$OBJDIR_SERVICES_CONFIG/%s/SConscript' % b for b in env['bindings'] if os.path.exists('%s/SConscript' % b) ], exports = ['config_env']) base-15.09/config/SConstruct000066400000000000000000000044701262264444500157570ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. import os env = SConscript('../../../core/alljoyn/build_core/SConscript') vars = Variables() vars.Add('BINDINGS', 'Bindings to build (comma separated list): cpp, java', 'cpp,java') vars.Add(EnumVariable('BUILD_SERVICES_SAMPLES', 'Build the services samples.', 'on', allowed_values = ['on', 'off'])) vars.Add(PathVariable('ALLJOYN_DISTDIR', 'Directory containing a built AllJoyn Core dist directory.', os.environ.get('ALLJOYN_DISTDIR'))) vars.Add(PathVariable('APP_COMMON_DIR', 'Directory containing common sample application sources.', os.environ.get('APP_COMMON_DIR','../sample_apps'))) vars.Update(env) Help(vars.GenerateHelpText(env)) if env.get('ALLJOYN_DISTDIR'): # normalize ALLJOYN_DISTDIR first env['ALLJOYN_DISTDIR'] = env.Dir('$ALLJOYN_DISTDIR') env.Append(CPPPATH = [ env.Dir('$ALLJOYN_DISTDIR/cpp/inc'), env.Dir('$ALLJOYN_DISTDIR/about/inc'), env.Dir('$ALLJOYN_DISTDIR/services_common/inc') ]) env.Append(LIBPATH = [ env.Dir('$ALLJOYN_DISTDIR/cpp/lib'), env.Dir('$ALLJOYN_DISTDIR/about/lib'), env.Dir('$ALLJOYN_DISTDIR/services_common/lib') ]) if env.get('APP_COMMON_DIR'): # normalize APP_COMMON_DIR env['APP_COMMON_DIR'] = env.Dir('$APP_COMMON_DIR') env['bindings'] = set([ b.strip() for b in env['BINDINGS'].split(',') ]) env.SConscript('SConscript') base-15.09/config/cpp/000077500000000000000000000000001262264444500145025ustar00rootroot00000000000000base-15.09/config/cpp/SConscript000066400000000000000000000035031262264444500165150ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('config_env') if not config_env.has_key('_ALLJOYNCORE_'): config_env.Append(LIBS = ['alljoyn']) if config_env['BR'] == 'on' : config_env['ajrlib'] = 'ajrouter' if config_env['OS'] == 'openwrt': config_env.AppendUnique(LIBS = [ 'stdc++', 'pthread' ]) # Make config dist a sub-directory of the alljoyn dist. This avoids any conflicts with alljoyn dist targets. config_env['CONFIG_DISTDIR'] = config_env['DISTDIR'] + '/config' config_env.Install('$CONFIG_DISTDIR/inc/alljoyn/config', config_env.Glob('inc/alljoyn/config/*.h')) # Libraries config_env.Install('$CONFIG_DISTDIR/lib', config_env.SConscript('src/SConscript', exports = ['config_env'])) # Sample programs if config_env['BUILD_SERVICES_SAMPLES'] == 'on': config_env.Install('$CONFIG_DISTDIR/bin', config_env.SConscript('samples/SConscript', exports = ['config_env'])) # Build docs installDocs = config_env.SConscript('docs/SConscript', exports = ['config_env']) config_env.Depends(installDocs, config_env.Glob('$CONFIG_DISTDIR/inc/alljoyn/config/*.h')); base-15.09/config/cpp/docs/000077500000000000000000000000001262264444500154325ustar00rootroot00000000000000base-15.09/config/cpp/docs/Doxygen_html000066400000000000000000001673401262264444500200310ustar00rootroot00000000000000# Doxyfile 1.6.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "AllJoyn™ Config API Reference Manual" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = "Version 15.09.00" # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = YES # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = NO # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = YES # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = YES # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = ../inc/alljoyn/config # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. # 20120131: header.html should no longer be used in production builds [MBUS-463] # doxygen 1.7.4 and later will generate buggy html if header.html is included HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) # there is already a search function so this one should typically # be disabled. SEARCHENGINE = YES #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = YES # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = YES # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = "QCC_DEPRECATED(func)=func" # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = YES # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 3 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = YES # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES base-15.09/config/cpp/docs/SConscript000066400000000000000000000024261262264444500174500ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. import os Import('env') returnValue = [] docenv = env.Clone() # Build docs if docenv['DOCS'] == 'html': # the target directory 'docs/tmp' is never built this will cause doxygen # to run every time DOCS == 'html' generateDocs = docenv.Doxygen(source='Doxygen_html', target=[Dir('tmp'), Dir('html')]) returnValue = docenv.Install('$CONFIG_DISTDIR/docs', Dir('html')) docenv.Clean('Doxygen_html', Dir('html')) docenv.Depends(returnValue, generateDocs) Return('returnValue') base-15.09/config/cpp/docs/footer.html000066400000000000000000000025051262264444500176200ustar00rootroot00000000000000
$projectname $projectnumber ($datetime)
Copyright AllSeen Alliance, Inc. All Rights Reserved.

AllSeen, AllSeen Alliance, and AllJoyn are trademarks of the AllSeen Alliance, Inc in the United States and other jurisdictions.

THIS DOCUMENT AND ALL INFORMATION CONTAIN HEREIN ARE PROVIDED ON AN "AS-IS" BASIS WITHOUT WARRANTY OF ANY KIND.
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
base-15.09/config/cpp/inc/000077500000000000000000000000001262264444500152535ustar00rootroot00000000000000base-15.09/config/cpp/inc/alljoyn/000077500000000000000000000000001262264444500167235ustar00rootroot00000000000000base-15.09/config/cpp/inc/alljoyn/config/000077500000000000000000000000001262264444500201705ustar00rootroot00000000000000base-15.09/config/cpp/inc/alljoyn/config/AboutDataStoreInterface.h000066400000000000000000000072001262264444500250420ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef ABOUT_DATA_STORE_INTERFACE_H_ #define ABOUT_DATA_STORE_INTERFACE_H_ #include #include #include #if defined(QCC_OS_GROUP_WINDOWS) /* Disabling warning C 4100. Function doesnt use all passed in parameters */ #pragma warning(push) #pragma warning(disable: 4100) #endif /** * The language tag specified is not supported */ #define ER_LANGUAGE_NOT_SUPPORTED ((QStatus)0xb001) /** * The request feature is not available or has not be implemented */ #define ER_FEATURE_NOT_AVAILABLE ((QStatus)0xb002) /** * The value requested is invalid */ #define ER_INVALID_VALUE ((QStatus)0xb003) /** * The maximum allowed size for an element has been exceeded. */ #define ER_MAX_SIZE_EXCEEDED ((QStatus)0xb004) /** * Structure to hold Filter enum */ struct DataPermission { /** * Filter has three possible values ANNOUNCE, READ,WRITE * READ is for data that is marked as read * ANNOUNCE is for data that is marked as announce * WRITE is for data that is marked as write */ typedef enum { ANNOUNCE, //!< ANNOUNCE Property that has ANNOUNCE enabled READ, //!< READ Property that has READ enabled WRITE, //!< WRITE Property that has WRITE enabled } Filter; }; /** * class AboutDataStoreInterface - interface that handles remote config server requests * AboutDataStoreInterface store implementation */ class AboutDataStoreInterface : public ajn::AboutData { public: /** * AboutDataStoreInterface - constructor * @param factoryConfigFile * @param configFile */ AboutDataStoreInterface(const char* factoryConfigFile, const char* configFile) : ajn::AboutData("en") { QCC_UNUSED(factoryConfigFile); QCC_UNUSED(configFile); } /** * FactoryReset */ virtual void FactoryReset() = 0; /** * virtual Destructor */ virtual ~AboutDataStoreInterface() { }; /** * virtual method ReadAll * @param languageTag * @param filter * @param all * @return QStatus */ virtual QStatus ReadAll(const char* languageTag, DataPermission::Filter filter, ajn::MsgArg& all) = 0; /** * virtual method Update * @param name * @param languageTag * @param value * @return QStatus */ virtual QStatus Update(const char* name, const char* languageTag, const ajn::MsgArg* value) = 0; /** * virtual method Delete * @param name * @param languageTag * @return QStatus */ virtual QStatus Delete(const char* name, const char* languageTag) = 0; private: }; #endif /* ABOUT_DATA_STORE_INTERFACE_H_ */ base-15.09/config/cpp/inc/alljoyn/config/ConfigClient.h000066400000000000000000000121171262264444500227070ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef CONFIGCLIENT_H_ #define CONFIGCLIENT_H_ #include #include #include #include #include #include #include #include #include #include namespace ajn { namespace services { /** * ConfigClient is a helper class used by an AllJoyn IoE client application to communicate with ConfigService that implements the org.alljoyn.Config * exposing the following methods: * FactoryReset * Restart * SetPasscode * GetConfigurations * UpdateConfigurations * ResetConfigurations * GetVersion * */ class ConfigClient { public: /** * Configurations data structure where key is of type qcc::String and value is of type ajn::MsgArg */ typedef std::map Configurations; /** * Construct an ConfigClient * @param[in] bus is a reference to BusAttachment */ ConfigClient(ajn::BusAttachment& bus); /** * Destruct ConfigClient */ ~ConfigClient() { } /** * FactoryReset Remote method call * @param busName Unique or well-known name of AllJoyn bus * @param sessionId the session received after joining alljoyn session * @return status. */ QStatus FactoryReset(const char* busName, ajn::SessionId sessionId = 0); /** * Restart Remote method call * @param busName Unique or well-known name of AllJoyn bus * @param sessionId the session received after joining alljoyn session * @return status */ QStatus Restart(const char* busName, ajn::SessionId sessionId = 0); /** * SetPasscode Remote method call * @param busName Unique or well-known name of AllJoyn bus * @param daemonRealm is the new DaemonRealm . * @param newPasscodeSize is the new pass code size. * @param newPasscode is the new pass code . * @param sessionId the session received after joining alljoyn session * @return status */ QStatus SetPasscode(const char* busName, const char* daemonRealm, size_t newPasscodeSize, const uint8_t* newPasscode, ajn::SessionId sessionId = 0); /** * GetConfigurations Remote method call * @param busName Unique or well-known name of AllJoyn bus * @param languageTag is the language used to pull the data by. * @param configs reference to Configurations filled by the function * @param sessionId the session received after joining alljoyn session * @return status */ QStatus GetConfigurations(const char* busName, const char* languageTag, Configurations& configs, ajn::SessionId sessionId = 0); /** * UpdateConfigurations Remote method call * @param busName Unique or well-known name of AllJoyn bus * @param languageTag is the language used to update the data by * @param configs reference to Configurations to be used by the function. * @param sessionId the session received after joining alljoyn session * @return status */ QStatus UpdateConfigurations(const char* busName, const char* languageTag, const Configurations& configs, ajn::SessionId sessionId = 0); /** * DeleteConfigurations Remote method call * @param busName Unique or well-known name of AllJoyn bus * @param languageTag languageTag is the language used to update the data by * @param configNames reference to Configurations to be used by the function. * @param sessionId the session received after joining alljoyn session * @return status */ QStatus ResetConfigurations(const char* busName, const char* languageTag, const std::vector& configNames, ajn::SessionId sessionId = 0); /** * * @param busName Unique or well-known name of AllJoyn bus * @param version reference to be filled by the function * @param sessionId the session received after joining alljoyn session * @return status */ QStatus GetVersion(const char* busName, int& version, ajn::SessionId sessionId = 0); private: /** * pointer to BusAttachment */ ajn::BusAttachment* m_BusAttachment; }; } } #endif /* CONFIGCLIENT_H_ */ base-15.09/config/cpp/inc/alljoyn/config/ConfigService.h000066400000000000000000000134641262264444500230770ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef CONFIGSERVICE_H #define CONFIGSERVICE_H #include #include #include namespace ajn { namespace services { /** * ConfigService is an AllJoyn BusObject that implements the org.alljoyn.Config standard interface. * Applications that provide AllJoyn IoE services with config capability */ class ConfigService : public ajn::BusObject { public: /** * Listener is a callback that is called by ConfigService implemented by the application to provide system calls and control * */ class Listener { public: /** * Application should implement Restart of the device. * @return status - success/failure */ virtual QStatus Restart() = 0; /** * Application should implement FactoryReset of the device ,return to default values including password ! * @return status - success/failure */ virtual QStatus FactoryReset() = 0; /** * Application should receive Passphrase info and persist it. * @param[in] daemonRealm to persist * @param[in] passcodeSize size in bytes of the passcode * @param[in] passcode content * @param[in] sessionId the session that made this request * @return status - success/failure */ virtual QStatus SetPassphrase(const char* daemonRealm, size_t passcodeSize, const char* passcode, SessionId sessionId) = 0; /** * */ virtual ~Listener() = 0; }; /** * Constructor of a ConfigService * @param bus reference * @param store reference * @param listener reference */ ConfigService(ajn::BusAttachment& bus, AboutDataStoreInterface& store, Listener& listener); /** * Constructor of a ConfigService * @param bus reference * @param store reference * @param listener reference * * @deprecated Please see ConfigService(ajn::BusAttachment&, AboutDataStoreInterface&, Listener&) */ QCC_DEPRECATED(ConfigService(ajn::BusAttachment& bus, PropertyStore& store, Listener& listener)); /** * Destructor of ConfigService */ ~ConfigService(); /** * Register the ConfigService on the alljoyn bus. * @return status. */ QStatus Register(); private: /** * Handles the FactoryReset method * @param member * @param msg reference of alljoyn Message */ void FactoryResetHandler(const ajn::InterfaceDescription::Member* member, ajn::Message& msg); /** * Handles the Restart method * @param member * @param msg reference of alljoyn Message */ void RestartHandler(const ajn::InterfaceDescription::Member* member, ajn::Message& msg); /** * Handles the SetPasscode method * @param member * @param msg reference of alljoyn Message */ void SetPasscodeHandler(const ajn::InterfaceDescription::Member* member, ajn::Message& msg); /** * Handles the GetConfiguration method * @param member * @param msg reference of alljoyn Message */ void GetConfigurationsHandler(const ajn::InterfaceDescription::Member* member, ajn::Message& msg); /** * Handles the UpdateConfigurations method * @param member * @param msg reference of alljoyn Message */ void UpdateConfigurationsHandler(const ajn::InterfaceDescription::Member* member, ajn::Message& msg); /** * Handles the DeleteConfigurations method * @param member * @param msg reference of alljoyn Message */ void ResetConfigurationsHandler(const ajn::InterfaceDescription::Member* member, ajn::Message& msg); /** * Handles the GetLanguages method * @param member * @param msg of alljoyn received */ void GetLanguagesHandler(const ajn::InterfaceDescription::Member* member, ajn::Message& msg); /** * Handles the SetDefaultLanguage method * @param member * @param msg reference of alljoyn Message */ void SetDefaultLanguageHandler(const ajn::InterfaceDescription::Member* member, ajn::Message& msg); /** * Handles the GetPropery request * @param ifcName interface name * @param propName the name of the propery * @param val reference of MsgArg out parameter. * @return status - success/failure */ QStatus Get(const char* ifcName, const char* propName, MsgArg& val); /** * pointer of BusAttachment */ ajn::BusAttachment* m_BusAttachment; /** * pointer of AboutData implementing the storage. */ AboutDataStoreInterface* m_AboutDataStore; /** * pointer of PropertyStore implementing the storage. */ PropertyStore* m_PropertyStore; /** * pointer of Listener */ Listener* m_Listener; }; inline ConfigService::Listener::~Listener() { } } } #endif base-15.09/config/cpp/inc/alljoyn/config/LogModule.h000066400000000000000000000023611262264444500222320ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef LOGMODULE_H_ #define LOGMODULE_H_ #include #include #include namespace ajn { namespace services { static char const* const QCC_MODULE = logModules::CONFIG_MODULE_LOG_NAME; } } #endif /* LOGMODULE_H_ */ base-15.09/config/cpp/samples/000077500000000000000000000000001262264444500161465ustar00rootroot00000000000000base-15.09/config/cpp/samples/ConfigClientSample/000077500000000000000000000000001262264444500216545ustar00rootroot00000000000000base-15.09/config/cpp/samples/ConfigClientSample/ConfigClientMain.cc000066400000000000000000000543231262264444500253430ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace ajn; #define INITIAL_PASSCODE "000000" #define NEW_PASSCODE "12345678" static BusAttachment* busAttachment = 0; static SrpKeyXListener* srpKeyXListener = 0; static std::set handledAnnouncements; static volatile sig_atomic_t s_interrupt = false; static volatile sig_atomic_t s_stopped = false; static void CDECL_CALL SigIntHandler(int sig) { QCC_UNUSED(sig); s_interrupt = true; } // Print out the fields found in the AboutData. Only fields with known signatures // are printed out. All others will be treated as an unknown field. void printAboutData(AboutData& aboutData, const char* language) { size_t count = aboutData.GetFields(); const char** fields = new const char*[count]; aboutData.GetFields(fields, count); for (size_t i = 0; i < count; ++i) { std::cout << "\tKey: " << fields[i]; MsgArg* tmp; aboutData.GetField(fields[i], tmp, language); std::cout << "\t"; if (tmp->Signature() == "s") { const char* tmp_s; tmp->Get("s", &tmp_s); std::cout << tmp_s; } else if (tmp->Signature() == "as") { size_t las; MsgArg* as_arg; tmp->Get("as", &las, &as_arg); for (size_t j = 0; j < las; ++j) { const char* tmp_s; as_arg[j].Get("s", &tmp_s); std::cout << tmp_s << " "; } } else if (tmp->Signature() == "ay") { size_t lay; uint8_t* pay; tmp->Get("ay", &lay, &pay); for (size_t j = 0; j < lay; ++j) { std::cout << std::hex << static_cast(pay[j]) << " "; } } else { std::cout << "User Defined Value\tSignature: " << tmp->Signature().c_str(); } std::cout << std::endl; } delete [] fields; std::cout << std::endl; } void printAllAboutData(AboutProxy& aboutProxy) { MsgArg aArg; QStatus status = aboutProxy.GetAboutData(NULL, aArg); if (status == ER_OK) { std::cout << "*********************************************************************************" << std::endl; std::cout << "GetAboutData: (Default Language)" << std::endl; AboutData aboutData(aArg); printAboutData(aboutData, NULL); size_t lang_num; lang_num = aboutData.GetSupportedLanguages(); std::cout << "Number of supported languages: " << lang_num << std::endl; // If the lang_num == 1 we only have a default language if (lang_num > 1) { const char** langs = new const char*[lang_num]; aboutData.GetSupportedLanguages(langs, lang_num); char* defaultLanguage; aboutData.GetDefaultLanguage(&defaultLanguage); // print out the AboutData for every language but the // default it has already been printed. for (size_t i = 0; i < lang_num; ++i) { std::cout << "language=" << i << " " << langs[i] << std::endl; if (strcmp(defaultLanguage, langs[i]) != 0) { std::cout << "Calling GetAboutData: language=" << langs[i] << std::endl; status = aboutProxy.GetAboutData(langs[i], aArg); if (ER_OK == status) { AboutData localized(aArg, langs[i]); std::cout << "GetAboutData: (" << langs[i] << ")" << std::endl; printAboutData(localized, langs[i]); } else { std::cout << "GetAboutData failed " << QCC_StatusText(status) << std::endl; } } } delete [] langs; } std::cout << "*********************************************************************************" << std::endl; } } void interruptibleDelay(int seconds) { for (int i = 0; !s_interrupt && i < seconds; i++) { #ifdef _WIN32 Sleep(1000); #else usleep(1000 * 1000); #endif } } void sessionJoinedCallback(qcc::String const& busName, SessionId id) { std::cout << "sessionJoinedCallback(" << "busName=" << busName.c_str() << " SessionId=" << id << ")" << std::endl; QStatus status = ER_OK; busAttachment->EnableConcurrentCallbacks(); AboutProxy aboutProxy(*busAttachment, busName.c_str(), id); MsgArg objArg; aboutProxy.GetObjectDescription(objArg); std::cout << "AboutProxy.GetObjectDescriptions:\n" << objArg.ToString().c_str() << "\n\n" << std::endl; AboutObjectDescription objectDescription; objectDescription.CreateFromMsgArg(objArg); bool isIconInterface = false; if (!s_interrupt) { isIconInterface = objectDescription.HasInterface("/About/DeviceIcon", "org.alljoyn.Icon"); if (isIconInterface) { std::cout << "The given interface 'org.alljoyn.Icon' is found in a given path '/About/DeviceIcon'" << std::endl; } else { std::cout << "WARNING - The given interface 'org.alljoyn.Icon' is not found in a given path '/About/DeviceIcon'" << std::endl; } } bool isConfigInterface = false; if (!s_interrupt) { isConfigInterface = objectDescription.HasInterface("/Config", "org.alljoyn.Config"); if (isConfigInterface) { std::cout << "The given interface 'org.alljoyn.Config' is found in a given path '/Config'" << std::endl; } else { std::cout << "WARNING - The given interface 'org.alljoyn.Config' is not found in a given path '/Config'" << std::endl; } printAllAboutData(aboutProxy); } if (!s_interrupt) { std::cout << "aboutProxy GetVersion " << std::endl; std::cout << "-----------------------" << std::endl; uint16_t version = 0; status = aboutProxy.GetVersion(version); if (status != ER_OK) { std::cout << "WARNING - Call to getVersion failed " << QCC_StatusText(status) << std::endl; } else { std::cout << "Version=" << version << std::endl; } } if (!s_interrupt) { if (isIconInterface) { AboutIconProxy aiProxy(*busAttachment, busName.c_str(), id); AboutIcon aboutIcon; std::cout << std::endl << busName.c_str() << " AboutIconProxy GetIcon" << std::endl; std::cout << "-----------------------------------" << std::endl; status = aiProxy.GetIcon(aboutIcon); if (status != ER_OK) { std::cout << "WARNING - Call to GetIcon failed: " << QCC_StatusText(status) << std::endl; } std::cout << "url=" << aboutIcon.url.c_str() << std::endl; std::cout << "Content size = " << aboutIcon.contentSize << std::endl; std::cout << "Content =\t"; for (size_t i = 0; i < aboutIcon.contentSize; i++) { if (i % 8 == 0 && i > 0) { std::cout << "\n\t\t"; } std::cout << std::hex << std::uppercase << std::setfill('0') << std::setw(2) << (unsigned int)aboutIcon.content[i] << std::nouppercase << std::dec; //std::cout << std::endl; } std::cout << std::endl; std::cout << "Mimetype =\t" << aboutIcon.mimetype.c_str() << std::endl; std::cout << std::endl << busName.c_str() << " AboutIcontClient GetVersion" << std::endl; std::cout << "-----------------------------------" << std::endl; uint16_t version; status = aiProxy.GetVersion(version); if (status != ER_OK) { std::cout << "WARNING - Call to getVersion failed: " << QCC_StatusText(status) << std::endl; } else { std::cout << "Version=" << version << std::endl; } } } services::ConfigClient* configClient = NULL; if (!s_interrupt && isConfigInterface) { configClient = new services::ConfigClient(*busAttachment); if (!s_interrupt && configClient) { std::cout << "\nConfigClient GetVersion" << std::endl; std::cout << "-----------------------------------" << std::endl; int version; if ((status = configClient->GetVersion(busName.c_str(), version, id)) == ER_OK) { std::cout << "Success GetVersion. Version=" << version << std::endl; } else { std::cout << "WARNING - Call to getVersion failed: " << QCC_StatusText(status) << std::endl; } if (!s_interrupt) { services::ConfigClient::Configurations configurations; std::cout << "\nConfigClient GetConfigurations (en)" << std::endl; std::cout << "-----------------------------------" << std::endl; if ((status = configClient->GetConfigurations(busName.c_str(), "en", configurations, id)) == ER_OK) { for (services::ConfigClient::Configurations::iterator it = configurations.begin(); it != configurations.end(); ++it) { qcc::String key = it->first; ajn::MsgArg value = it->second; if (value.typeId == ALLJOYN_STRING) { std::cout << "Key name=" << key.c_str() << " value=" << value.v_string.str << std::endl; } else if (value.typeId == ALLJOYN_ARRAY && value.Signature().compare("as") == 0) { std::cout << "Key name=" << key.c_str() << " values: "; const MsgArg* stringArray; size_t fieldListNumElements; status = value.Get("as", &fieldListNumElements, &stringArray); for (unsigned int i = 0; i < fieldListNumElements; i++) { char* tempString; stringArray[i].Get("s", &tempString); std::cout << tempString << " "; } std::cout << std::endl; } } } else { std::cout << "WARNING - Call to GetConfigurations failed: " << QCC_StatusText(status) << std::endl; } } if (!s_interrupt) { std::cout << "\nGoing to call to ConfigClient Restart" << std::endl; std::cout << "-----------------------------------" << std::endl; if ((status = configClient->Restart(busName.c_str(), id)) == ER_OK) { std::cout << "Restart succeeded" << std::endl; } else { std::cout << "WARNING - Call to Restart failed: " << QCC_StatusText(status) << std::endl; } } if (!s_interrupt) { std::cout << "\nGoing to call to UpdateConfigurations: key=DeviceName value=This is my new English name ! ! ! !" << std::endl; std::cout << "-----------------------------------------------------------------------------------------------" << std::endl; services::ConfigClient::Configurations updateConfigurations; updateConfigurations.insert( std::pair("DeviceName", MsgArg("s", "This is my new English name ! ! ! !"))); if ((status = configClient->UpdateConfigurations(busName.c_str(), "en", updateConfigurations, id)) == ER_OK) { std::cout << "UpdateConfigurations succeeded" << std::endl; } else { std::cout << "WARNING - Call to UpdateConfigurations failed: " << QCC_StatusText(status) << std::endl; } printAllAboutData(aboutProxy); } interruptibleDelay(3); if (!s_interrupt) { std::cout << "\nGoing to call to UpdateConfigurations: key=DefaultLanguage value=es" << std::endl; std::cout << "-------------------------------------------------------------------" << std::endl; services::ConfigClient::Configurations updateConfigurations; updateConfigurations.insert( std::pair("DefaultLanguage", MsgArg("s", "es"))); if ((status = configClient->UpdateConfigurations(busName.c_str(), NULL, updateConfigurations, id)) == ER_OK) { std::cout << "UpdateConfigurations succeeded" << std::endl; } else { std::cout << "WARNING - Call to UpdateConfigurations failed: " << QCC_StatusText(status) << std::endl; } printAllAboutData(aboutProxy); } interruptibleDelay(3); if (!s_interrupt) { std::vector configNames; configNames.push_back("DeviceName"); std::cout << "\nGoing to call to ConfigClient ResetConfigurations: key='DeviceName' lang='en'" << std::endl; std::cout << "-----------------------------------" << std::endl; if ((status = configClient->ResetConfigurations(busName.c_str(), "en", configNames, id)) == ER_OK) { std::cout << "ResetConfigurations succeeded" << std::endl; } else { std::cout << "WARNING - Call to ResetConfigurations failed: " << QCC_StatusText(status) << std::endl; } printAllAboutData(aboutProxy); } interruptibleDelay(3); if (!s_interrupt) { std::cout << "\nGoing to call to ConfigClient SetPasscode" << std::endl; std::cout << "-----------------------------------" << std::endl; if ((status = configClient->SetPasscode(busName.c_str(), "MyDeamonRealm", 8, (const uint8_t*) NEW_PASSCODE, id)) == ER_OK) { std::cout << "SetPasscode succeeded" << std::endl; srpKeyXListener->setPassCode(NEW_PASSCODE); qcc::String guid; status = busAttachment->GetPeerGUID(busName.c_str(), guid); if (status == ER_OK) { status = busAttachment->ClearKeys(guid); std::cout << "busAttachment->ClearKey for " << guid.c_str() << ". Status: " << QCC_StatusText(status) << std::endl; } } else { std::cout << "WARNING - Call to SetPasscode failed: " << QCC_StatusText(status) << std::endl; } } if (!s_interrupt) { std::cout << "\nGoing to call to ConfigClient FactoryReset" << std::endl; std::cout << "-----------------------------------" << std::endl; if ((status = configClient->FactoryReset(busName.c_str(), id)) == ER_OK) { std::cout << "FactoryReset succeeded" << std::endl; srpKeyXListener->setPassCode(INITIAL_PASSCODE); qcc::String guid; status = busAttachment->GetPeerGUID(busName.c_str(), guid); if (status == ER_OK) { busAttachment->ClearKeys(guid); } } else { std::cout << "WARNING - Call to FactoryReset failed: " << QCC_StatusText(status) << std::endl; } printAllAboutData(aboutProxy); } } //if (configClient) } //if (isConfigInterface) status = busAttachment->LeaveSession(id); std::cout << "Leaving session id = " << id << " with " << busName.c_str() << " status: " << QCC_StatusText(status) << std::endl; if (configClient) { delete configClient; configClient = NULL; } s_stopped = true; } class MyAboutListener : public AboutListener { void Announced(const char* busName, uint16_t version, SessionPort port, const MsgArg& objectDescriptionArg, const MsgArg& aboutDataArg) { QCC_UNUSED(version); QCC_UNUSED(objectDescriptionArg); QCC_UNUSED(aboutDataArg); std::set::iterator searchIterator = handledAnnouncements.find(qcc::String(busName)); if (searchIterator == handledAnnouncements.end()) { handledAnnouncements.insert(busName); SessionOpts opts(SessionOpts::TRAFFIC_MESSAGES, false, SessionOpts::PROXIMITY_ANY, TRANSPORT_ANY); SessionListenerImpl* sessionListener = new SessionListenerImpl(busName); AsyncSessionJoiner* joincb = new AsyncSessionJoiner(busName, sessionJoinedCallback); QStatus status = busAttachment->JoinSessionAsync(busName, port, sessionListener, opts, joincb, sessionListener); if (status != ER_OK) { std::cout << "Unable to JoinSession with " << busName << std::endl; } } else { std::cout << "WARNING - " << busName << " has already been handled" << std::endl; } } }; void WaitForSigInt(void) { while (s_interrupt == false && s_stopped == false) { #ifdef _WIN32 Sleep(100); #else usleep(100 * 1000); #endif } } int main(int argc, char**argv, char**envArg) { QCC_UNUSED(argc); QCC_UNUSED(argv); QCC_UNUSED(envArg); // Initialize AllJoyn AJInitializer ajInit; if (ajInit.Initialize() != ER_OK) { return 1; } QStatus status = ER_OK; std::cout << "AllJoyn Library version: " << ajn::GetVersion() << std::endl; std::cout << "AllJoyn Library build info: " << ajn::GetBuildInfo() << std::endl; std::cout << "*********************************************************************************" << std::endl; std::cout << "PLEASE NOTE THAT AS OF NOW THIS PROGRAM DOES NOT SUPPORT INTERACTION WITH THE ALLJOYN THIN CLIENT BASED CONFIGSAMPLE. SO PLEASE USE THIS PROGRAM ONLY WITH ALLJOYN STANDARD CLIENT BASED CONFIGSERVICESAMPLE" << std::endl; std::cout << "*********************************************************************************" << std::endl; //Enable this line to see logs from config service: //QCC_SetDebugLevel(services::logModules::CONFIG_MODULE_LOG_NAME, services::logModules::ALL_LOG_LEVELS); /* Install SIGINT handler so Ctrl + C deallocates memory properly */ signal(SIGINT, SigIntHandler); busAttachment = new BusAttachment("ConfigClient", true); status = busAttachment->Start(); if (status == ER_OK) { std::cout << "BusAttachment started." << std::endl; } else { std::cout << "ERROR - Unable to start BusAttachment. Status: " << QCC_StatusText(status) << std::endl; return 1; } status = busAttachment->Connect(); if (ER_OK == status) { std::cout << "Daemon Connect succeeded." << std::endl; } else { std::cout << "ERROR - Failed to connect daemon. Status: " << QCC_StatusText(status) << std::endl; return 1; } srpKeyXListener = new SrpKeyXListener(); srpKeyXListener->setPassCode(INITIAL_PASSCODE); status = busAttachment->EnablePeerSecurity("ALLJOYN_SRP_KEYX ALLJOYN_ECDHE_PSK", srpKeyXListener, "/.alljoyn_keystore/central.ks", true); if (ER_OK == status) { std::cout << "EnablePeerSecurity called." << std::endl; } else { std::cout << "ERROR - EnablePeerSecurity call FAILED with status " << QCC_StatusText(status) << std::endl; return 1; } const char* interfaces[] = { "org.alljoyn.Config" }; MyAboutListener* aboutListener = new MyAboutListener(); busAttachment->RegisterAboutListener(*aboutListener); status = busAttachment->WhoImplements(interfaces, sizeof(interfaces) / sizeof(interfaces[0])); if (ER_OK == status) { std::cout << "WhoImplements called." << std::endl; } else { std::cout << "ERROR - WhoImplements call FAILED with status " << QCC_StatusText(status) << std::endl; return 1; } WaitForSigInt(); std::cout << "Preparing to exit..." << std::endl; if (!s_stopped) { std::cout << "Waiting for a few seconds for commands to complete... " << std::endl; for (int i = 0; !s_stopped && i < 5; i++) { #ifdef _WIN32 Sleep(1000); #else usleep(1000 * 1000); #endif } } std::cout << "Cleaning up (press Ctrl-C to abort)... " << std::endl; busAttachment->CancelWhoImplements(interfaces, sizeof(interfaces) / sizeof(interfaces[0])); busAttachment->UnregisterAboutListener(*aboutListener); busAttachment->EnablePeerSecurity(NULL, NULL, NULL, true); delete srpKeyXListener; delete aboutListener; busAttachment->Stop(); delete busAttachment; std::cout << "Done." << std::endl; return 0; } /* main() */ base-15.09/config/cpp/samples/ConfigClientSample/SConscript000066400000000000000000000016671262264444500237000ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('env', 'cobjs') srcs = env.Glob('*.cc') objs = env.Object(srcs) objs.extend(cobjs) prog = env.Program('ConfigClient', objs) Return('prog') base-15.09/config/cpp/samples/ConfigServiceSample/000077500000000000000000000000001262264444500220365ustar00rootroot00000000000000base-15.09/config/cpp/samples/ConfigServiceSample/ConfigService.conf000066400000000000000000000040651262264444500254400ustar00rootroot00000000000000 065202f957c34c97843f2f9cf8c74258 10/1/2199 en 749df3c84b2e489cbd534cc8fd3fd5f4 355.499. b Wxfy388i 000000 12.20.44 build 44454 http://www.alljoyn.org ConfigServiceApp ConfigServiceApp ConfigServiceApp ConfigServiceApp This is an Alljoyn Application This is an Alljoyn Application Esta es una Alljoyn aplicacion C'est une Alljoyn application deviceName deviceName Mi nombre de dispositivo Mon nom de l'appareil Company Company Empresa Entreprise base-15.09/config/cpp/samples/ConfigServiceSample/ConfigServiceListenerImpl.cc000066400000000000000000000067031262264444500274310ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include "ConfigServiceListenerImpl.h" #include #include #include using namespace ajn; using namespace services; extern volatile sig_atomic_t s_restart; ConfigServiceListenerImpl::ConfigServiceListenerImpl(AboutDataStore& store, BusAttachment& bus, CommonBusListener& busListener) : ConfigService::Listener(), m_AboutDataStore(&store), m_Bus(&bus), m_BusListener(&busListener) { } QStatus ConfigServiceListenerImpl::Restart() { std::cout << "Restart has been called !!!" << std::endl; s_restart = true; return ER_OK; } QStatus ConfigServiceListenerImpl::FactoryReset() { QStatus status = ER_OK; std::cout << "FactoryReset has been called!!!" << std::endl; m_AboutDataStore->FactoryReset(); std::cout << "Clearing Key Store" << std::endl; m_Bus->ClearKeyStore(); AboutObjApi* aboutObjApi = AboutObjApi::getInstance(); if (aboutObjApi) { status = aboutObjApi->Announce(); std::cout << "Announce for " << m_Bus->GetUniqueName().c_str() << " = " << QCC_StatusText(status) << std::endl; } return status; } QStatus ConfigServiceListenerImpl::SetPassphrase(const char* daemonRealm, size_t passcodeSize, const char* passcode, ajn::SessionId sessionId) { qcc::String passCodeString(passcode, passcodeSize); std::cout << "SetPassphrase has been called daemonRealm=" << daemonRealm << " passcode=" << passCodeString.c_str() << " passcodeLength=" << passcodeSize << std::endl; PersistPassword(daemonRealm, passCodeString.c_str()); std::cout << "Clearing Key Store" << std::endl; m_Bus->ClearKeyStore(); m_Bus->EnableConcurrentCallbacks(); std::vector sessionIds = m_BusListener->getSessionIds(); for (size_t i = 0; i < sessionIds.size(); i++) { if (sessionIds[i] == sessionId) { continue; } m_Bus->LeaveSession(sessionIds[i]); std::cout << "Leaving session with id: " << sessionIds[i]; } m_AboutDataStore->write(); return ER_OK; } ConfigServiceListenerImpl::~ConfigServiceListenerImpl() { } void ConfigServiceListenerImpl::PersistPassword(const char* daemonRealm, const char* passcode) { MsgArg argPasscode; MsgArg argDaemonrealm; argPasscode.Set("s", passcode); argDaemonrealm.Set("s", daemonRealm); m_AboutDataStore->SetField("Passcode", argPasscode); m_AboutDataStore->SetField("Daemonrealm", argDaemonrealm); } base-15.09/config/cpp/samples/ConfigServiceSample/ConfigServiceListenerImpl.h000066400000000000000000000034731262264444500272740ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef CONFIGSERVICELISTENERIMPL_H_ #define CONFIGSERVICELISTENERIMPL_H_ #include #include #include /* * */ class ConfigServiceListenerImpl : public ajn::services::ConfigService::Listener { public: ConfigServiceListenerImpl(AboutDataStore& store, ajn::BusAttachment& bus, CommonBusListener& busListener); virtual QStatus Restart(); virtual QStatus FactoryReset(); virtual QStatus SetPassphrase(const char* daemonRealm, size_t passcodeSize, const char* passcode, ajn::SessionId sessionId); virtual ~ConfigServiceListenerImpl(); private: AboutDataStore* m_AboutDataStore; ajn::BusAttachment* m_Bus; CommonBusListener* m_BusListener; void PersistPassword(const char* daemonRealm, const char* passcode); }; #endif /* CONFIGSERVICELISTENERIMPL_H_ */ base-15.09/config/cpp/samples/ConfigServiceSample/ConfigServiceMain.cc000066400000000000000000000224051262264444500257030ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include #include #include #include #include #include #include #include "AboutDataStore.h" #include #include "ConfigServiceListenerImpl.h" #include "OptParser.h" #include #define DEFAULTPASSCODE "000000" #define SERVICE_EXIT_OK 0 #define SERVICE_OPTION_ERROR 1 #define SERVICE_CONFIG_ERROR 2 using namespace ajn; using namespace services; /** static variables need for sample */ static BusAttachment* msgBus = NULL; static SrpKeyXListener* keyListener = NULL; static ConfigService* configService = NULL; static AboutIcon* icon = NULL; static AboutIconObj* aboutIconObj = NULL; static AboutDataStore* aboutDataStore = NULL; static AboutObj* aboutObj = NULL; static ConfigServiceListenerImpl* configServiceListener = NULL; static CommonBusListener* busListener = NULL; static SessionPort servicePort = 900; static volatile sig_atomic_t s_interrupt = false; volatile sig_atomic_t s_restart = false; static void CDECL_CALL SigIntHandler(int sig) { QCC_UNUSED(sig); s_interrupt = true; } static void daemonDisconnectCB() { s_restart = true; } static void cleanup() { if (AboutObjApi::getInstance()) { AboutObjApi::DestroyInstance(); } if (configService) { delete configService; configService = NULL; } if (configServiceListener) { delete configServiceListener; configServiceListener = NULL; } if (keyListener) { delete keyListener; keyListener = NULL; } if (busListener) { msgBus->UnregisterBusListener(*busListener); delete busListener; busListener = NULL; } if (aboutIconObj) { delete aboutIconObj; aboutIconObj = NULL; } if (icon) { delete icon; icon = NULL; } if (aboutDataStore) { delete aboutDataStore; aboutDataStore = NULL; } if (aboutObj) { delete aboutObj; aboutObj = NULL; } /* Clean up msg bus */ if (msgBus) { delete msgBus; msgBus = NULL; } } void readPassword(qcc::String& passCode) { ajn::MsgArg*argPasscode; char*tmp; aboutDataStore->GetField("Passcode", argPasscode); argPasscode->Get("s", &tmp); passCode = tmp; return; } void WaitForSigInt(void) { while (s_interrupt == false && s_restart == false) { #ifdef _WIN32 Sleep(100); #else usleep(100 * 1000); #endif } } int main(int argc, char**argv, char**envArg) { QCC_UNUSED(envArg); // Initialize AllJoyn AJInitializer ajInit; if (ajInit.Initialize() != ER_OK) { return 1; } QStatus status = ER_OK; std::cout << "AllJoyn Library version: " << ajn::GetVersion() << std::endl; std::cout << "AllJoyn Library build info: " << ajn::GetBuildInfo() << std::endl; QCC_SetLogLevels("ALLJOYN_ABOUT_SERVICE=7;"); QCC_SetLogLevels("ALLJOYN_ABOUT_ICON_SERVICE=7;"); QCC_SetDebugLevel(logModules::CONFIG_MODULE_LOG_NAME, logModules::ALL_LOG_LEVELS); OptParser opts(argc, argv); OptParser::ParseResultCode parseCode(opts.ParseResult()); switch (parseCode) { case OptParser::PR_OK: break; case OptParser::PR_EXIT_NO_ERROR: return SERVICE_EXIT_OK; default: return SERVICE_OPTION_ERROR; } std::cout << "using port " << servicePort << std::endl; if (!opts.GetConfigFile().empty()) { std::cout << "using Config-file " << opts.GetConfigFile().c_str() << std::endl; } /* Install SIGINT handler so Ctrl + C deallocates memory properly */ signal(SIGINT, SigIntHandler); start: std::cout << "Initializing application." << std::endl; /* Create message bus */ keyListener = new SrpKeyXListener(); keyListener->setPassCode(DEFAULTPASSCODE); keyListener->setGetPassCode(readPassword); /* Connect to the daemon */ uint16_t retry = 0; do { msgBus = CommonSampleUtil::prepareBusAttachment(keyListener); if (msgBus == NULL) { std::cout << "Could not initialize BusAttachment. Retrying" << std::endl; #ifdef _WIN32 Sleep(1000); #else sleep(1); #endif retry++; } } while (msgBus == NULL && retry != 180 && !s_interrupt); if (msgBus == NULL) { std::cout << "Could not initialize BusAttachment." << std::endl; cleanup(); return 1; } busListener = new CommonBusListener(msgBus, daemonDisconnectCB); busListener->setSessionPort(servicePort); aboutDataStore = new AboutDataStore(opts.GetFactoryConfigFile().c_str(), opts.GetConfigFile().c_str()); aboutDataStore->Initialize(); if (!opts.GetAppId().empty()) { std::cout << "using appID " << opts.GetAppId().c_str() << std::endl; aboutDataStore->SetAppId(opts.GetAppId().c_str()); } if (status != ER_OK) { std::cout << "Could not fill aboutDataStore." << std::endl; cleanup(); return 1; } aboutObj = new ajn::AboutObj(*msgBus, BusObject::ANNOUNCED); status = CommonSampleUtil::prepareAboutService(msgBus, dynamic_cast(aboutDataStore), aboutObj, busListener, servicePort); if (status != ER_OK) { std::cout << "Could not set up the AboutService." << std::endl; cleanup(); return 1; } AboutObjApi* aboutObjApi = AboutObjApi::getInstance(); if (!aboutObjApi) { std::cout << "Could not set up the AboutService." << std::endl; cleanup(); return 1; } //////////////////////////////////////////////////////////////////////////////////////////////////// //aboutIconService uint8_t aboutIconContent[] = { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x08, 0x02, 0x00, 0x00, 0x00, 0x02, 0x50, 0x58, 0xEA, 0x00, 0x00, 0x00, 0x04, 0x67, 0x41, 0x4D, 0x41, 0x00, 0x00, 0xAF, 0xC8, 0x37, 0x05, 0x8A, 0xE9, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x41, 0x64, 0x6F, 0x62, 0x65, 0x20, 0x49, 0x6D, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x64, 0x79, 0x71, 0xC9, 0x65, 0x3C, 0x00, 0x00, 0x00, 0x18, 0x49, 0x44, 0x41, 0x54, 0x78, 0xDA, 0x62, 0xFC, 0x3F, 0x95, 0x9F, 0x01, 0x37, 0x60, 0x62, 0xC0, 0x0B, 0x46, 0xAA, 0x34, 0x40, 0x80, 0x01, 0x00, 0x06, 0x7C, 0x01, 0xB7, 0xED, 0x4B, 0x53, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82 }; qcc::String mimeType("image/png"); icon = new ajn::AboutIcon(); status = icon->SetContent(mimeType.c_str(), aboutIconContent, sizeof(aboutIconContent) / sizeof(*aboutIconContent)); if (ER_OK != status) { printf("Failed to setup the AboutIcon.\n"); } aboutIconObj = new ajn::AboutIconObj(*msgBus, *icon); //////////////////////////////////////////////////////////////////////////////////////////////////// //ConfigService configServiceListener = new ConfigServiceListenerImpl(*aboutDataStore, *msgBus, *busListener); configService = new ConfigService(*msgBus, *aboutDataStore, *configServiceListener); status = configService->Register(); if (status != ER_OK) { std::cout << "Could not register the ConfigService." << std::endl; cleanup(); return 1; } status = msgBus->RegisterBusObject(*configService); if (status != ER_OK) { std::cout << "Could not register the ConfigService BusObject." << std::endl; cleanup(); return 1; } //////////////////////////////////////////////////////////////////////////////////////////////////// if (ER_OK == status) { status = aboutObjApi->Announce(); } /* Perform the service asynchronously until the user signals for an exit. */ if (ER_OK == status) { WaitForSigInt(); } cleanup(); if (s_restart) { s_restart = false; goto start; } return 0; } /* main() */ base-15.09/config/cpp/samples/ConfigServiceSample/FactoryConfigService.conf000066400000000000000000000040651262264444500267700ustar00rootroot00000000000000 065202f957c34c97843f2f9cf8c74258 10/1/2199 en 749df3c84b2e489cbd534cc8fd3fd5f4 355.499. b Wxfy388i 000000 12.20.44 build 44454 http://www.alljoyn.org ConfigServiceApp ConfigServiceApp ConfigServiceApp ConfigServiceApp This is an Alljoyn Application This is an Alljoyn Application Esta es una Alljoyn aplicacion C'est une Alljoyn application deviceName deviceName Mi nombre de dispositivo Mon nom de l'appareil Company Company Empresa Entreprise base-15.09/config/cpp/samples/ConfigServiceSample/OptParser.cc000066400000000000000000000077771262264444500243060ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include "OptParser.h" #include #include #include static const char versionPreamble[] = "ConfigService version: 1\n" "Copyright AllSeen Alliance.\n"; using namespace ajn; using namespace services; OptParser::OptParser(int argc, char** argv) : argc(argc), argv(argv) { // GuidUtil::GetInstance()->GetDeviceIdString(&deviceId); // GuidUtil::GetInstance()->GenerateGUID(&appGUID); factoryConfigFile.assign("FactoryConfigService.conf"); configFile.assign("ConfigService.conf"); } qcc::String OptParser::GetFactoryConfigFile() const { return factoryConfigFile; } qcc::String OptParser::GetConfigFile() const { return configFile; } qcc::String OptParser::GetAppId() const { return appGUID; } void OptParser::PrintUsage() { qcc::String cmd = argv[0]; cmd = cmd.substr(cmd.find_last_of('/') + 1); std::cerr << cmd.c_str() << " [--factory-config-file=FILE | --config-file=FILE | --appId=APPID" "]\n" " --factory-config-file=FILE\n" " Configuration file with factory settings.\n\n" " --config-file=FILE\n" " Active configuration file that persists user's updates\n\n" " --appId=\n" " Use the specified it is HexString of 16 bytes (32 chars) \n\n" " --version\n" " Print the version and copyright string, and exit." << std::endl; } bool OptParser::IsAllHex(const char* data) { for (size_t index = 0; index < strlen(data); ++index) { if (!isxdigit(data[index])) { return false; } } return true; } OptParser::ParseResultCode OptParser::ParseResult() { ParseResultCode result = PR_OK; if (argc == 1) { return result; } int indx; for (indx = 1; indx < argc; indx++) { qcc::String arg(argv[indx]); if (arg.compare("--version") == 0) { std::cout << versionPreamble << std::endl; result = PR_EXIT_NO_ERROR; break; } else if (arg.compare(0, sizeof("--appId") - 1, "--appId") == 0) { appGUID = arg.substr(sizeof("--appId")); if ((appGUID.length() != 32) || (!IsAllHex(appGUID.c_str()))) { result = PR_INVALID_APPID; std::cerr << "Invalid appId: \"" << argv[indx] << "\"" << std::endl; break; } } else if (arg.compare(0, sizeof("--factory-config-file") - 1, "--factory-config-file") == 0) { factoryConfigFile = arg.substr(sizeof("--factory-config-file")); } else if (arg.compare(0, sizeof("--config-file") - 1, "--config-file") == 0) { configFile = arg.substr(sizeof("--config-file")); } else if ((arg.compare("--help") == 0) || (arg.compare("-h") == 0)) { PrintUsage(); result = PR_EXIT_NO_ERROR; break; } else { result = PR_INVALID_OPTION; std::cerr << "Invalid option: \"" << argv[indx] << "\"" << std::endl; break; } } return result; } base-15.09/config/cpp/samples/ConfigServiceSample/OptParser.h000066400000000000000000000032021262264444500241230ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef OPTPARSER_H_ #define OPTPARSER_H_ #include #include /** * Class to parse arguments */ class OptParser { public: enum ParseResultCode { PR_OK, PR_EXIT_NO_ERROR, PR_INVALID_OPTION, PR_MISSING_OPTION, PR_INVALID_APPID }; OptParser(int argc, char** argv); ParseResultCode ParseResult(); qcc::String GetConfigFile() const; qcc::String GetFactoryConfigFile() const; qcc::String GetAppId() const; private: int argc; char** argv; bool IsAllHex(const char* data); void PrintUsage(); qcc::String factoryConfigFile; qcc::String configFile; qcc::String appGUID; }; #endif /* OPTPARSER_H_ */ base-15.09/config/cpp/samples/ConfigServiceSample/SConscript000066400000000000000000000020621262264444500240500ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('env', 'cobjs') srcs = env.Glob('*.cc') objs = env.Object(srcs) objs.extend(cobjs) env.Install('$CONFIG_DISTDIR/bin', 'ConfigService.conf') env.Install('$CONFIG_DISTDIR/bin', 'FactoryConfigService.conf') prog = env.Program('ConfigService', objs) Return('prog') base-15.09/config/cpp/samples/SConscript000066400000000000000000000031341262264444500201610ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('config_env') local_env = config_env.Clone() local_env.Prepend(LIBS = ['alljoyn_config', 'alljoyn_about', 'alljoyn_services_common' ]) if local_env['BR'] == 'on' and local_env.has_key('ajrlib'): # Build apps with bundled daemon support local_env.Prepend(LIBS = [local_env['ajrlib']]) local_env.Append(CPPPATH = local_env.Dir('$APP_COMMON_DIR/cpp/samples_common').srcnode()) local_env.VariantDir('AppCommon', '$APP_COMMON_DIR/cpp/samples_common/', duplicate = 0) cobjs = local_env.SConscript('AppCommon/SConscript', {'env': local_env}) # Sample programs sample_dirs = [ 'ConfigClientSample', 'ConfigServiceSample' ] exports = { 'env': local_env, 'cobjs': cobjs } progs = [ local_env.SConscript('%s/SConscript' % sampleapp, exports = exports) for sampleapp in sample_dirs ] Return('progs') base-15.09/config/cpp/src/000077500000000000000000000000001262264444500152715ustar00rootroot00000000000000base-15.09/config/cpp/src/ConfigClient.cc000066400000000000000000000302471262264444500201520ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include #include #define CHECK_BREAK(x) if ((status = x) != ER_OK) { break; } using namespace ajn; using namespace services; static const char* CONFIG_OBJECT_PATH = "/Config"; static const char* CONFIG_INTERFACE_NAME = "org.alljoyn.Config"; ConfigClient::ConfigClient(ajn::BusAttachment& bus) : m_BusAttachment(&bus) { QCC_DbgTrace(("In ConfigClient basic Constructor")); QStatus status = ER_OK; const InterfaceDescription* getIface = NULL; getIface = m_BusAttachment->GetInterface(CONFIG_INTERFACE_NAME); if (!getIface) { InterfaceDescription* createIface = NULL; status = m_BusAttachment->CreateInterface(CONFIG_INTERFACE_NAME, createIface, AJ_IFC_SECURITY_REQUIRED); if (createIface && status == ER_OK) { do { CHECK_BREAK(createIface->AddMethod("FactoryReset", NULL, NULL, NULL)) CHECK_BREAK(createIface->AddMemberAnnotation("FactoryReset", org::freedesktop::DBus::AnnotateNoReply, "true")) CHECK_BREAK(createIface->AddMethod("Restart", NULL, NULL, NULL)) CHECK_BREAK(createIface->AddMemberAnnotation("Restart", org::freedesktop::DBus::AnnotateNoReply, "true")) CHECK_BREAK(createIface->AddMethod("SetPasscode", "say", NULL, "daemonRealm,newPasscode", 0)) CHECK_BREAK(createIface->AddMethod("GetConfigurations", "s", "a{sv}", "languageTag,configData", 0)) CHECK_BREAK(createIface->AddMethod("UpdateConfigurations", "sa{sv}", NULL, "languageTag,configMap", 0)) CHECK_BREAK(createIface->AddMethod("ResetConfigurations", "sas", NULL, "languageTag,fieldList", 0)) CHECK_BREAK(createIface->AddProperty("Version", "q", PROP_ACCESS_READ)) createIface->Activate(); return; } while (0); } //if (createIface) QCC_LogError(status, ("ConfigClientInterface could not be created.")); } //if (!getIface) } QStatus ConfigClient::FactoryReset(const char* busName, ajn::SessionId sessionId) { QCC_DbgTrace(("In ConfigClient FactoryReset")); QStatus status = ER_OK; const InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(CONFIG_INTERFACE_NAME); if (!p_InterfaceDescription) { return ER_FAIL; } ProxyBusObject* proxyBusObj = new ProxyBusObject(*m_BusAttachment, busName, CONFIG_OBJECT_PATH, sessionId); if (!proxyBusObj) { return ER_FAIL; } status = proxyBusObj->AddInterface(*p_InterfaceDescription); if (status == ER_OK) { status = proxyBusObj->MethodCall(CONFIG_INTERFACE_NAME, "FactoryReset", NULL, 0); } delete proxyBusObj; return status; } QStatus ConfigClient::Restart(const char* busName, ajn::SessionId sessionId) { QCC_DbgTrace(("In ConfigClient Restart")); QStatus status = ER_OK; const InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(CONFIG_INTERFACE_NAME); if (!p_InterfaceDescription) { return ER_FAIL; } ProxyBusObject* proxyBusObj = new ProxyBusObject(*m_BusAttachment, busName, CONFIG_OBJECT_PATH, sessionId); if (!proxyBusObj) { return ER_FAIL; } status = proxyBusObj->AddInterface(*p_InterfaceDescription); if (status == ER_OK) { status = proxyBusObj->MethodCall(CONFIG_INTERFACE_NAME, "Restart", NULL, 0); } delete proxyBusObj; return status; } QStatus ConfigClient::SetPasscode(const char* busName, const char* daemonRealm, size_t newPasscodeSize, const uint8_t* newPasscode, ajn::SessionId sessionId) { QCC_DbgTrace(("In ConfigClient SetPasscode")); QStatus status = ER_OK; const InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(CONFIG_INTERFACE_NAME); if (!p_InterfaceDescription) { return ER_FAIL; } ProxyBusObject* proxyBusObj = new ProxyBusObject(*m_BusAttachment, busName, CONFIG_OBJECT_PATH, sessionId); if (!proxyBusObj) { return ER_FAIL; } do { CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription)) Message replyMsg(*m_BusAttachment); MsgArg args[2]; CHECK_BREAK(args[0].Set("s", daemonRealm)) CHECK_BREAK(args[1].Set("ay", newPasscodeSize, newPasscode)) CHECK_BREAK(proxyBusObj->MethodCall(CONFIG_INTERFACE_NAME, "SetPasscode", args, 2, replyMsg)) } while (0); delete proxyBusObj; return status; } QStatus ConfigClient::GetConfigurations(const char* busName, const char* languageTag, Configurations& configs, ajn::SessionId sessionId) { QCC_DbgTrace(("In ConfigClient GetConfigurations")); QStatus status = ER_OK; const InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(CONFIG_INTERFACE_NAME); if (!p_InterfaceDescription) { return ER_FAIL; } ProxyBusObject* proxyBusObj = new ProxyBusObject(*m_BusAttachment, busName, CONFIG_OBJECT_PATH, sessionId); if (!proxyBusObj) { return ER_FAIL; } do { CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription)) Message replyMsg(*m_BusAttachment); MsgArg args[1]; CHECK_BREAK(args[0].Set("s", languageTag)) status = proxyBusObj->MethodCall(CONFIG_INTERFACE_NAME, "GetConfigurations", args, 1, replyMsg); if (status == ER_OK) { const ajn::MsgArg* returnArgs = 0; size_t numArgs = 0; replyMsg->GetArgs(numArgs, returnArgs); if (numArgs == 1) { int languageTagNumElements; MsgArg* tempconfigMapDictEntries; CHECK_BREAK(returnArgs[0].Get("a{sv}", &languageTagNumElements, &tempconfigMapDictEntries)) configs.clear(); for (int i = 0; i < languageTagNumElements; i++) { char* tempKey; MsgArg* tempValue; CHECK_BREAK(tempconfigMapDictEntries[i].Get("{sv}", &tempKey, &tempValue)) configs.insert(std::pair(tempKey, *tempValue)); } } else { status = ER_BUS_BAD_VALUE; } } else if (status == ER_BUS_REPLY_IS_ERROR_MESSAGE) { #if !defined(NDEBUG) qcc::String errorMessage; const char* errorName = replyMsg->GetErrorName(&errorMessage); #endif QCC_LogError(status, ("GetConfigurations errorName:%s errorMessage: %s", errorName ? errorName : "", errorMessage.c_str() ? errorMessage.c_str() : "")); } } while (0); delete proxyBusObj; return status; } QStatus ConfigClient::UpdateConfigurations(const char* busName, const char* languageTag, const Configurations& configs, ajn::SessionId sessionId) { QCC_DbgTrace(("In ConfigClient UpdateConfigurations")); QStatus status = ER_OK; const InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(CONFIG_INTERFACE_NAME); if (!p_InterfaceDescription) { return ER_FAIL; } ProxyBusObject* proxyBusObj = new ProxyBusObject(*m_BusAttachment, busName, CONFIG_OBJECT_PATH, sessionId); if (!proxyBusObj) { return ER_FAIL; } do { CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription)) Message replyMsg(*m_BusAttachment); MsgArg args[2]; CHECK_BREAK(args[0].Set("s", languageTag)) std::vector tempconfigMapDictEntries(configs.size()); int i = 0; for (std::map::const_iterator it = configs.begin(); it != configs.end(); ++it) { MsgArg* arg = new MsgArg(it->second); if ((status = tempconfigMapDictEntries[i].Set("{sv}", it->first.c_str(), arg)) != ER_OK) { delete arg; break; } tempconfigMapDictEntries[i].SetOwnershipFlags(MsgArg::OwnsArgs, true); i++; } if (status != ER_OK) { break; } CHECK_BREAK(args[1].Set("a{sv}", i, tempconfigMapDictEntries.data())) status = proxyBusObj->MethodCall(CONFIG_INTERFACE_NAME, "UpdateConfigurations", args, 2, replyMsg); if (status == ER_BUS_REPLY_IS_ERROR_MESSAGE) { #if !defined(NDEBUG) qcc::String errorMessage; const char* errorName = replyMsg->GetErrorName(&errorMessage); #endif QCC_LogError(status, ("UpdateConfigurations errorName:%s errorMessage: %s", errorName ? errorName : "", errorMessage.c_str() ? errorMessage.c_str() : "")); } } while (0); delete proxyBusObj; return status; } QStatus ConfigClient::ResetConfigurations(const char* busName, const char* languageTag, const std::vector& configNames, ajn::SessionId sessionId) { QCC_DbgTrace(("In ConfigClient ResetConfigurations")); QStatus status = ER_OK; const InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(CONFIG_INTERFACE_NAME); if (!p_InterfaceDescription) { return ER_FAIL; } ProxyBusObject* proxyBusObj = new ProxyBusObject(*m_BusAttachment, busName, CONFIG_OBJECT_PATH, sessionId); if (!proxyBusObj) { return ER_FAIL; } do { CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription)) Message replyMsg(*m_BusAttachment); MsgArg args[2]; CHECK_BREAK(args[0].Set("s", languageTag)) if (!(configNames.size() == 0)) { std::vector tempKeys(configNames.size()); int i = 0; for (std::vector::const_iterator it = configNames.begin(); it != configNames.end(); ++it) { tempKeys[i] = it->c_str(); i++; } CHECK_BREAK(args[1].Set("as", i, tempKeys.data())) status = proxyBusObj->MethodCall(CONFIG_INTERFACE_NAME, "ResetConfigurations", args, 2, replyMsg); if (status == ER_BUS_REPLY_IS_ERROR_MESSAGE) { #if !defined(NDEBUG) qcc::String errorMessage; const char* errorName = replyMsg->GetErrorName(&errorMessage); #endif QCC_LogError(status, ("ResetConfigurations errorName:%s errorMessage: %s", errorName ? errorName : "", errorMessage.c_str() ? errorMessage.c_str() : "")); } } else { status = ER_INVALID_DATA; } } while (0); delete proxyBusObj; return status; } QStatus ConfigClient::GetVersion(const char* busName, int& version, ajn::SessionId sessionId) { QCC_DbgTrace(("In ConfigClient GetVersion")); QStatus status = ER_OK; const InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(CONFIG_INTERFACE_NAME); if (!p_InterfaceDescription) { return ER_FAIL; } ProxyBusObject* proxyBusObj = new ProxyBusObject(*m_BusAttachment, busName, CONFIG_OBJECT_PATH, sessionId); if (!proxyBusObj) { return ER_FAIL; } do { MsgArg arg; CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription)) CHECK_BREAK(proxyBusObj->GetProperty(CONFIG_INTERFACE_NAME, "Version", arg)) version = arg.v_variant.val->v_int16; } while (0); delete proxyBusObj; return status; } base-15.09/config/cpp/src/ConfigService.cc000066400000000000000000000362221262264444500203330ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include #include #define CHECK_RETURN(x) if ((status = x) != ER_OK) { return status; } #define CHECK_BREAK(x) if ((status = x) != ER_OK) { break; } using namespace ajn; using namespace services; static const char* CONFIG_INTERFACE_NAME = "org.alljoyn.Config"; ConfigService::ConfigService(ajn::BusAttachment& bus, AboutDataStoreInterface& store, Listener& listener) : BusObject("/Config"), m_BusAttachment(&bus), m_AboutDataStore(&store), m_PropertyStore(NULL), m_Listener(&listener) { QCC_DbgTrace(("In ConfigService new Constructor")); } ConfigService::ConfigService(ajn::BusAttachment& bus, PropertyStore& store, Listener& listener) : BusObject("/Config"), m_BusAttachment(&bus), m_AboutDataStore(NULL), m_PropertyStore(&store), m_Listener(&listener) { QCC_DbgTrace(("In ConfigService 14.06 Constructor")); } ConfigService::~ConfigService() { QCC_DbgTrace(("In ConfigService destructor")); } QStatus ConfigService::Register() { QStatus status = ER_OK; QCC_DbgTrace(("In ConfigService Register")); InterfaceDescription* intf = const_cast(m_BusAttachment->GetInterface(CONFIG_INTERFACE_NAME)); if (!intf) { CHECK_RETURN(m_BusAttachment->CreateInterface(CONFIG_INTERFACE_NAME, intf, AJ_IFC_SECURITY_REQUIRED)) if (!intf) { return ER_BUS_CANNOT_ADD_INTERFACE; } CHECK_RETURN(intf->AddMethod("FactoryReset", NULL, NULL, NULL)) CHECK_RETURN(intf->AddMemberAnnotation("FactoryReset", org::freedesktop::DBus::AnnotateNoReply, "true")) CHECK_RETURN(intf->AddMethod("Restart", NULL, NULL, NULL)) CHECK_RETURN(intf->AddMemberAnnotation("Restart", org::freedesktop::DBus::AnnotateNoReply, "true")) CHECK_RETURN(intf->AddMethod("SetPasscode", "say", NULL, "DaemonRealm,newPasscode")) CHECK_RETURN(intf->AddMethod("GetConfigurations", "s", "a{sv}", "languageTag,languages")) CHECK_RETURN(intf->AddMethod("UpdateConfigurations", "sa{sv}", NULL, "languageTag,configMap")) CHECK_RETURN(intf->AddMethod("ResetConfigurations", "sas", NULL, "languageTag,fieldList")) CHECK_RETURN(intf->AddProperty("Version", "q", (uint8_t) PROP_ACCESS_READ)) intf->Activate(); } //if (!intf) CHECK_RETURN(AddInterface(*intf, ANNOUNCED)) CHECK_RETURN(AddMethodHandler(intf->GetMember("FactoryReset"), static_cast(&ConfigService::FactoryResetHandler))) CHECK_RETURN(AddMethodHandler(intf->GetMember("Restart"), static_cast(&ConfigService::RestartHandler))) CHECK_RETURN(AddMethodHandler(intf->GetMember("SetPasscode"), static_cast(&ConfigService::SetPasscodeHandler))) CHECK_RETURN(AddMethodHandler(intf->GetMember("GetConfigurations"), static_cast(&ConfigService::GetConfigurationsHandler))) CHECK_RETURN(AddMethodHandler(intf->GetMember("UpdateConfigurations"), static_cast(&ConfigService::UpdateConfigurationsHandler))) CHECK_RETURN(AddMethodHandler(intf->GetMember("ResetConfigurations"), static_cast(&ConfigService::ResetConfigurationsHandler))) return status; } void ConfigService::SetPasscodeHandler(const InterfaceDescription::Member* member, Message& msg) { QCC_UNUSED(member); QCC_DbgTrace(("In ConfigService SetPassCodeHandler")); QStatus status = ER_OK; const ajn::MsgArg* args = 0; size_t numArgs = 0; msg->GetArgs(numArgs, args); do { if (numArgs != 2) { break; } char* newPasscode; size_t newPasscodeNumElements; CHECK_BREAK(args[1].Get("ay", &newPasscodeNumElements, &newPasscode)) if (args[0].typeId != ALLJOYN_STRING) { break; } if (newPasscodeNumElements == 0) { QCC_LogError(ER_INVALID_DATA, ("Password can not be empty.")); MethodReply(msg, ER_INVALID_DATA); return; } m_Listener->SetPassphrase(args[0].v_string.str, newPasscodeNumElements, newPasscode, msg.unwrap()->GetSessionId()); MethodReply(msg, args, 0); return; } while (0); MethodReply(msg, ER_INVALID_DATA); } void ConfigService::GetConfigurationsHandler(const InterfaceDescription::Member* member, Message& msg) { QCC_UNUSED(member); QCC_DbgTrace(("In ConfigService GetConfigurationsHandler")); const ajn::MsgArg* args; size_t numArgs; QStatus status = ER_OK; msg->GetArgs(numArgs, args); do { if (numArgs != 1) { break; } if (args[0].typeId != ALLJOYN_STRING) { break; } ajn::MsgArg writeData[1]; if (m_AboutDataStore) { QCC_DbgTrace(("m_AboutDataStore->ReadAll")); CHECK_BREAK(m_AboutDataStore->ReadAll(args[0].v_string.str, DataPermission::WRITE, writeData[0])) } else if (m_PropertyStore) { QCC_DbgTrace(("m_PropertyStore->ReadAll")); CHECK_BREAK(m_PropertyStore->ReadAll(args[0].v_string.str, PropertyStore::WRITE, writeData[0])) } else { QCC_DbgHLPrintf(("ConfigService::GetConfigurationsHandler no valid pointer")); } QCC_DbgPrintf(("ReadAll called with PropertyStore::WRITE for language: %s data: %s", args[0].v_string.str ? args[0].v_string.str : "", writeData[0].ToString().c_str() ? writeData[0].ToString().c_str() : "")); MethodReply(msg, writeData, 1); return; } while (0); /* * This looks hacky. But we need this because ER_LANGUAGE_NOT_SUPPORTED was not a part of * AllJoyn Core in 14.06 and is defined in alljoyn/services/about/cpp/inc/alljoyn/about/PropertyStore.h * with a value 0xb001 whereas in 14.12 the About support was incorporated in AllJoyn Core and * ER_LANGUAGE_NOT_SUPPORTED is now a part of QStatus enum with a value of 0x911a and AboutData * returns this if a language is not supported */ if ((status == ER_LANGUAGE_NOT_SUPPORTED) || (status == ((QStatus)0x911a))) { MethodReply(msg, "org.alljoyn.Error.LanguageNotSupported", "The language specified is not supported"); } else if (status != ER_OK) { MethodReply(msg, status); } else { MethodReply(msg, ER_INVALID_DATA); } } void ConfigService::UpdateConfigurationsHandler(const InterfaceDescription::Member* member, Message& msg) { QCC_UNUSED(member); QCC_DbgTrace(("In ConfigService UpdateConfigurationsHandler")); const ajn::MsgArg* args; size_t numArgs; QStatus status = ER_OK; msg->GetArgs(numArgs, args); do { if (numArgs != 2) { break; } const MsgArg* configMapDictEntries; size_t configMapNumElements; char* languageTag; CHECK_BREAK(args[0].Get("s", &languageTag)) CHECK_BREAK(args[1].Get("a{sv}", &configMapNumElements, &configMapDictEntries)) for (unsigned int i = 0; i < configMapNumElements; i++) { char* tempKey; MsgArg* tempValue; CHECK_BREAK(configMapDictEntries[i].Get("{sv}", &tempKey, &tempValue)) if (m_AboutDataStore) { CHECK_BREAK(m_AboutDataStore->Update(tempKey, languageTag, tempValue)) } else if (m_PropertyStore) { CHECK_BREAK(m_PropertyStore->Update(tempKey, languageTag, tempValue)) } else { QCC_DbgHLPrintf(("%s no valid pointer", __FUNCTION__)); } QCC_DbgPrintf(("Calling update for %s with lang: %s Value: %s", tempKey ? tempKey : "", languageTag ? languageTag : "", tempValue->ToString().c_str() ? tempValue->ToString().c_str() : "")); } CHECK_BREAK(status) MsgArg * args = NULL; MethodReply(msg, args, 0); return; } while (0); QCC_DbgHLPrintf(("UpdateConfigurationsHandler Failed")); if (status == ER_MAX_SIZE_EXCEEDED) { MethodReply(msg, "org.alljoyn.Error.MaxSizeExceeded", "Maximum size exceeded"); } else if (status == ER_INVALID_VALUE) { MethodReply(msg, "org.alljoyn.Error.InvalidValue", "Invalid value"); } else if (status == ER_FEATURE_NOT_AVAILABLE) { MethodReply(msg, "org.alljoyn.Error.FeatureNotAvailable", "Feature not available"); return; } else if ((status == ER_LANGUAGE_NOT_SUPPORTED) || (status == ((QStatus)0x911a))) { /* * This looks hacky. But we need this because ER_LANGUAGE_NOT_SUPPORTED was not a part of * AllJoyn Core in 14.06 and is defined in alljoyn/services/about/cpp/inc/alljoyn/about/PropertyStore.h * with a value 0xb001 whereas in 14.12 the About support was incorporated in AllJoyn Core and * ER_LANGUAGE_NOT_SUPPORTED is now a part of QStatus enum with a value of 0x911a and AboutData * returns this if a language is not supported */ MethodReply(msg, "org.alljoyn.Error.LanguageNotSupported", "The language specified is not supported"); } else if (status != ER_OK) { MethodReply(msg, status); } else { //default error such as when num params does not match MethodReply(msg, ER_INVALID_DATA); } } void ConfigService::ResetConfigurationsHandler(const InterfaceDescription::Member* member, Message& msg) { QCC_UNUSED(member); QCC_DbgTrace(("In ConfigService ResetConfigurationsHandler")); const ajn::MsgArg* args; size_t numArgs; QStatus status = ER_OK; msg->GetArgs(numArgs, args); do { if (numArgs != 2) { break; } char* languageTag; CHECK_BREAK(args[0].Get("s", &languageTag)) const MsgArg * stringArray; size_t fieldListNumElements; CHECK_BREAK(args[1].Get("as", &fieldListNumElements, &stringArray)) for (unsigned int i = 0; i < fieldListNumElements; i++) { char* tempString; CHECK_BREAK(stringArray[i].Get("s", &tempString)) if (m_AboutDataStore) { CHECK_BREAK(m_AboutDataStore->Delete(tempString, languageTag)) } else if (m_PropertyStore) { CHECK_BREAK(m_PropertyStore->Delete(tempString, languageTag)) } else { QCC_DbgHLPrintf(("%s no valid pointer", __FUNCTION__)); } QCC_DbgPrintf(("Calling delete for %s with lang: %s", tempString ? tempString : "", languageTag ? languageTag : "")); } CHECK_BREAK(status) MsgArg * args = NULL; MethodReply(msg, args, 0); return; } while (0); QCC_DbgHLPrintf(("ResetConfigurationsHandler Failed")); if (status == ER_MAX_SIZE_EXCEEDED) { MethodReply(msg, "org.alljoyn.Error.MaxSizeExceeded", "Maximum size exceeded"); } else if (status == ER_INVALID_VALUE) { MethodReply(msg, "org.alljoyn.Error.InvalidValue", "Invalid value"); } else if (status == ER_FEATURE_NOT_AVAILABLE) { MethodReply(msg, "org.alljoyn.Error.FeatureNotAvailable", "Feature not available"); } else if ((status == ER_LANGUAGE_NOT_SUPPORTED) || (status == ((QStatus)0x911a))) { /* * This looks hacky. But we need this because ER_LANGUAGE_NOT_SUPPORTED was not a part of * AllJoyn Core in 14.06 and is defined in alljoyn/services/about/cpp/inc/alljoyn/about/PropertyStore.h * with a value 0xb001 whereas in 14.12 the About support was incorporated in AllJoyn Core and * ER_LANGUAGE_NOT_SUPPORTED is now a part of QStatus enum with a value of 0x911a and AboutData * returns this if a language is not supported */ MethodReply(msg, "org.alljoyn.Error.LanguageNotSupported", "The language specified is not supported"); } else if (status != ER_OK) { MethodReply(msg, status); } else { //in case number of arguments is different from the one expected MethodReply(msg, ER_INVALID_DATA); } } void ConfigService::FactoryResetHandler(const InterfaceDescription::Member* member, Message& msg) { QCC_UNUSED(member); QCC_DbgTrace(("In ConfigService FactoryResetHandler")); const ajn::MsgArg* args; size_t numArgs; msg->GetArgs(numArgs, args); if (numArgs == 0) { m_Listener->FactoryReset(); //check it the ALLJOYN_FLAG_NO_REPLY_EXPECTED exists if so send response if (!(msg->GetFlags() & ALLJOYN_FLAG_NO_REPLY_EXPECTED)) { MsgArg* args = NULL; MethodReply(msg, args, 0); } } else { //check it the ALLJOYN_FLAG_NO_REPLY_EXPECTED exists if so send response ER_INVALID_DATA if (!(msg->GetFlags() & ALLJOYN_FLAG_NO_REPLY_EXPECTED)) { MethodReply(msg, ER_INVALID_DATA); } } } void ConfigService::RestartHandler(const InterfaceDescription::Member* member, Message& msg) { QCC_UNUSED(member); QCC_DbgTrace(("In ConfigService RestartHandler")); const ajn::MsgArg* args; size_t numArgs; msg->GetArgs(numArgs, args); if (numArgs == 0) { m_Listener->Restart(); //check it the ALLJOYN_FLAG_NO_REPLY_EXPECTED exists if so send response if (!(msg->GetFlags() & ALLJOYN_FLAG_NO_REPLY_EXPECTED)) { MsgArg* args = NULL; MethodReply(msg, args, 0); } } else { //check it the ALLJOYN_FLAG_NO_REPLY_EXPECTED exists if so send response ER_INVALID_DATA if (!(msg->GetFlags() & ALLJOYN_FLAG_NO_REPLY_EXPECTED)) { MethodReply(msg, ER_INVALID_DATA); } } } QStatus ConfigService::Get(const char*ifcName, const char*propName, MsgArg& val) { QCC_DbgTrace(("In ConfigService Get")); QStatus status = ER_BUS_NO_SUCH_PROPERTY; // Check the requested property and return the value if it exists if (0 == strcmp(ifcName, CONFIG_INTERFACE_NAME)) { if (0 == strcmp("Version", propName)) { status = val.Set("q", 1); } } return status; } base-15.09/config/cpp/src/SConscript000066400000000000000000000024731262264444500173110ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('config_env') # Sources srcs = config_env.Glob('*.cc') # Platform specific sources if config_env['OS'] == 'android': srcs += config_env.Glob('$OS/*.cc') else: srcs += config_env.Glob('$OS_GROUP/*.cc') libs = [] # Static library objs = config_env.Object(srcs) libs.append(config_env.StaticLibrary('alljoyn_config', objs)) # Shared library if config_env.get('LIBTYPE', 'static') != 'static': shobjs = config_env.SharedObject(srcs) libs.append(config_env.SharedLibrary('alljoyn_config', shobjs)) Return('libs') base-15.09/config/ios/000077500000000000000000000000001262264444500145125ustar00rootroot00000000000000base-15.09/config/ios/inc/000077500000000000000000000000001262264444500152635ustar00rootroot00000000000000base-15.09/config/ios/inc/alljoyn/000077500000000000000000000000001262264444500167335ustar00rootroot00000000000000base-15.09/config/ios/inc/alljoyn/config/000077500000000000000000000000001262264444500202005ustar00rootroot00000000000000base-15.09/config/ios/inc/alljoyn/config/AJCFGConfigClient.h000066400000000000000000000172261262264444500234600ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusAttachment.h" #import "alljoyn/services_common/AJSVCGenericLogger.h" /** AJCFGConfigClient is a helper class used by an AllJoyn IoE client application to communicate with ConfigService that implements the org.alljoyn.Config . */ @interface AJCFGConfigClient : NSObject /** Designated initializer. Create a AJCFGConfigClient Object using the passed AJNBusAttachment. @param bus A reference to the AJNBusAttachment. @return AJCFGConfigClient if successful. */ - (id)initWithBus:(AJNBusAttachment *)bus; /** Factory reset remote method call using the passed bus name. @param busName Unique or well-known name of AllJoyn bus. @return ER_OK if successful. */ - (QStatus)factoryResetWithBus:(NSString *)busName; /** Factory reset remote method call using the passed bus name and session id. @param busName Unique or well-known name of AllJoyn bus. @param sessionId The session received after joining alljoyn session. @return ER_OK if successful. */ - (QStatus)factoryResetWithBus:(NSString *)busName sessionId:(AJNSessionId)sessionId; /** Restart remote method call using the passed bus name. @param busName Unique or well-known name of AllJoyn bus. @return ER_OK if successful. */ - (QStatus)restartWithBus:(NSString *)busName; /** Restart remote method call using the passed bus name and session id. @param busName Unique or well-known name of AllJoyn bus. @param sessionId The session received after joining alljoyn session. @return ER_OK if successful. */ - (QStatus)restartWithBus:(NSString *)busName sessionId:(AJNSessionId)sessionId; /** Set pass code remote method call. @param busName Unique or well-known name of AllJoyn bus. @param daemonRealm The new DaemonRealm. @param newPasscodeSize The new pass code size. @param newPasscode The new pass code. @return ER_OK if successful. */ - (QStatus)setPasscodeWithBus:(NSString *)busName daemonRealm:(NSString *)daemonRealm newPasscodeSize:(size_t)newPasscodeSize newPasscode:(const uint8_t *)newPasscode; /** Set pass code remote method call using a session id. @param busName Unique or well-known name of AllJoyn bus. @param daemonRealm The new DaemonRealm . @param newPasscodeSize The new pass code size. @param newPasscode The new pass code. @param sessionId The session received after joining alljoyn session. @return ER_OK if successful. */ - (QStatus)setPasscodeWithBus:(NSString *)busName daemonRealm:(NSString *)daemonRealm newPasscodeSize:(size_t)newPasscodeSize newPasscode:(const uint8_t *)newPasscode sessionId:(AJNSessionId)sessionId; /** Get configurations remote method call. @param busName Unique or well-known name of AllJoyn bus. @param languageTag The language used to pull the data by. @param configs A reference to configurations filled by the method. @return ER_OK if successful. */ - (QStatus)configurationsWithBus:(NSString *)busName languageTag:(NSString *)languageTag configs:(NSMutableDictionary **)configs; /** Get configurations remote method call using a session id. @param busName Unique or well-known name of AllJoyn bus. @param languageTag The language used to pull the data by. use @"" to get the current default language. @param configs A reference to configurations filled by the method. @param sessionId The session received after joining alljoyn session. @return ER_OK if successful. */ - (QStatus)configurationsWithBus:(NSString *)busName languageTag:(NSString *)languageTag configs:(NSMutableDictionary **)configs sessionId:(AJNSessionId)sessionId; /** Update configurations remote method call. @param busName Unique or well-known name of. AllJoyn bus. @param languageTag The language used to update the data by. @param configs A reference to configurations to be used by the method. @return ER_OK if successful. */ - (QStatus)updateConfigurationsWithBus:(NSString *)busName languageTag:(NSString *)languageTag configs:(NSMutableDictionary **)configs; /** Update configurations remote method call using a session id. @param busName Unique or well-known name of AllJoyn bus. @param languageTag The language used to update the data by. @param configs A reference to configurations to be used by the method. @param sessionId The session received after joining alljoyn session. @return ER_OK if successful. */ - (QStatus)updateConfigurationsWithBus:(NSString *)busName languageTag:(NSString *)languageTag configs:(NSMutableDictionary **)configs sessionId:(AJNSessionId)sessionId; /** Delete configurations remote method call. @param busName Unique or well-known name of AllJoyn bus. @param languageTag languageTag is the language used to update the data by @param configNames A reference to configurations to be used by the method. @return ER_OK if successful. */ - (QStatus)resetConfigurationsWithBus:(NSString *)busName languageTag:(NSString *)languageTag configNames:(NSMutableArray *)configNames; /** Delete configurations remote method call using a session id. @param busName Unique or well-known name of AllJoyn bus. @param languageTag languageTag is the language used to update the data by @param configNames A reference to configurations to be used by the method. @param sessionId The session received after joining alljoyn session. @return ER_OK if successful. */ - (QStatus)resetConfigurationsWithBus:(NSString *)busName languageTag:(NSString *)languageTag configNames:(NSMutableArray *)configNames sessionId:(AJNSessionId)sessionId; /** Get version remote method call. @param busName Unique or well-known name of AllJoyn bus. @param version A reference to be filled by the method. @return ER_OK if successful. */ - (QStatus)versionWithBus:(NSString *)busName version:(int&)version; /** Get version remote method call using a session id. @param busName Unique or well-known name of AllJoyn bus. @param version A reference to be filled by the method. @param sessionId The session received after joining alljoyn session. @return ER_OK if successful. */ - (QStatus)versionWithBus:(NSString *)busName version:(int&)version sessionId:(AJNSessionId)sessionId; #pragma mark - Logger methods /** Receive AJSVCGenericLogger to use for logging. @param logger Implementation of AJSVCGenericLogger. @return previous logger */ - (void)setLogger:(id )logger; /** Get the currently-configured logger implementation @return logger Implementation of AJSVCGenericLogger. */ - (id )logger; /** Set log level filter for subsequent logging messages. @param newLogLevel New log level enum value. @return logLevel Log level enum value that was in effect prior to this change. */ - (void)setLogLevel:(QLogLevel)newLogLevel; /** Get log level filter value currently in effect. @return logLevel Log level enum value currently in effect. */ - (QLogLevel)logLevel; @end base-15.09/config/ios/inc/alljoyn/config/AJCFGConfigLogger.h000066400000000000000000000030741262264444500234550ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/services_common/AJSVCGenericLogger.h" /** ConfigLogger enable application logging by a given logger. */ @interface AJCFGConfigLogger : NSObject /** * Create a ConfigLogger Shared instance. * @return ConfigLogger instance(created only once). */ + (id)sharedInstance; /** Set the logger to be in use. @param logger The logger to be in used.
If the given logger is nil - will use AJSVCGenericLoggerDefaultImpl. */ - (void)setLogger:(id )logger; /** Return the logger that being used. */ - (id )logger; @end base-15.09/config/ios/inc/alljoyn/config/AJCFGConfigService.h000066400000000000000000000053771262264444500236460ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusAttachment.h" #import "AJNBusObject.h" #import "AJCFGConfigServiceListenerImpl.h" #import "AJCFGPropertyStoreImpl.h" #import "alljoyn/services_common/AJSVCGenericLogger.h" /** AJCFGConfigService is an AllJoyn BusObject that implements the org.alljoyn.Config standard interface. Applications that provide AllJoyn IoE services with config capability. */ @interface AJCFGConfigService : AJNBusObject /** Designated initializer. Create a AJCFGConfigService Object. @param bus A reference to the AJNBusAttachment. @param propertyStore A reference to a property store. @param listener A reference to a Config service listener. @return AJCFGConfigService if successful. */ - (id)initWithBus:(AJNBusAttachment *)bus propertyStore:(AJCFGPropertyStoreImpl *)propertyStore listener:(AJCFGConfigServiceListenerImpl *)listener; /** Register the ConfigService on the alljoyn bus. @return ER_OK if successful. */ - (QStatus)registerService; /** * Unregister the AJCFGConfigService on the alljoyn bus. */ - (void)unregisterService; #pragma mark - Logger methods /** Receive AJSVCGenericLogger to use for logging. @param logger Implementation of AJSVCGenericLogger. @return previous logger. */ - (void)setLogger:(id )logger; /** Get the currently-configured logger implementation. @return logger Implementation of AJSVCGenericLogger. */ - (id )logger; /** Set log level filter for subsequent logging messages. @param newLogLevel New log level enum value. @return logLevel New log level enum value that was in effect prior to this change. */ - (void)setLogLevel:(QLogLevel)newLogLevel; /** Get log level filter value currently in effect. @return logLevel Log level enum value currently in effect. */ - (QLogLevel)logLevel; @end base-15.09/config/ios/inc/alljoyn/config/AJCFGConfigServiceListener.h000066400000000000000000000034621262264444500253450ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/Status.h" /** AJCFGConfigServiceListener is a helper protocol used by AJCFGConfigServiceListenerImplAdapter to receive ConfigService calls. The user of the class need to implement the protocol methods. */ @protocol AJCFGConfigServiceListener @required /** Application should implement restart of the device. @return ER_OK if successful. */ - (QStatus)restart; /** Application should implement factoryReset of the device ,return to default values including password! @return ER_OK if successful. */ - (QStatus)factoryReset; /** Application should receive Passphrase info and persist it. @param daemonRealm Daemon realm to persist. @param passcode passcode content. @return ER_OK if successful. */ - (QStatus)setPassphrase:(NSString *)daemonRealm withPasscode:(NSString *)passcode; @end base-15.09/config/ios/inc/alljoyn/config/AJCFGConfigServiceListenerAdapter.h000066400000000000000000000053601262264444500266450ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef ALLJOYN_CONFIG_OBJC_AJCFGCONFIGSERVICELISTENERADAPTER_H #define ALLJOYN_CONFIG_OBJC_AJCFGCONFIGSERVICELISTENERADAPTER_H #import #import "AJCFGConfigServiceListener.h" #import "alljoyn/about/AJNConvertUtil.h" /** AJCFGConfigServiceListenerImplAdapter enable bind the C++ ConfigService Listener API with an objective-c ConfigService listener */ class AJCFGConfigServiceListenerImplAdapter : public ajn::services::ConfigService::Listener { public: AJCFGConfigServiceListenerImplAdapter(id configServiceListener) { qcsConfigServiceListener = configServiceListener; } /** Restart of the device. @return ER_OK if successful. */ virtual QStatus Restart() { return [qcsConfigServiceListener restart]; } /** Factory reset of the device ,return to default values including password! @return ER_OK if successful. */ virtual QStatus FactoryReset() { return [qcsConfigServiceListener factoryReset]; } /** Receive Passphrase info and persist it. @param daemonRealm Daemon realm to persist. @param passcodeSize passcode size. @param passcode passcode content. @return ER_OK if successful. */ virtual QStatus SetPassphrase(const char *daemonRealm, size_t passcodeSize, const char *passcode, ajn::SessionId sessionId) { NSString *passphrase = [[NSString alloc] initWithBytes:passcode length:passcodeSize encoding:NSASCIIStringEncoding]; return [qcsConfigServiceListener setPassphrase:[AJNConvertUtil convertConstCharToNSString:daemonRealm] withPasscode:passphrase]; } virtual ~AJCFGConfigServiceListenerImplAdapter() { } private: id qcsConfigServiceListener; }; #endif //ALLJOYN_CONFIG_OBJC_AJCFGCONFIGSERVICELISTENERADAPTER_H base-15.09/config/ios/inc/alljoyn/config/AJCFGConfigServiceListenerImpl.h000066400000000000000000000030211262264444500261560ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCFGConfigServiceListenerAdapter.h" /** AJCFGConfigServiceListenerImpl is the default implementation. it creates and initialize a Config service Listener to handle Config service callbacks. */ @interface AJCFGConfigServiceListenerImpl : NSObject @property AJCFGConfigServiceListenerImplAdapter *handle; /** Create a AJCFGConfigServiceListenerImpl. @param configServiceListener Config Service Listener . @return AJCFGConfigServiceListenerImpl if successful. */ - (id)initWithConfigServiceListener:(id )configServiceListener; @end base-15.09/config/ios/inc/alljoyn/config/AJCFGPropertyStoreImpl.h000066400000000000000000000240231262264444500245700ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "alljoyn/about/AJNAboutPropertyStoreImpl.h" #import "AJCFGConfigLogger.h" /** AJCFGPropertyStoreImpl is the default implementation of the objective-c ConfigService(it based on the AJNAboutPropertyStoreImpl class). */ @interface AJCFGPropertyStoreImpl : AJNAboutPropertyStoreImpl /** Create a AJCFGPropertyStoreImpl with a reference to a persistent store. @param filePath Path to a persistent store file. @return AJCFGPropertyStoreImpl if successful. */ - (id)initPointerToFactorySettingFile:(NSString *)filePath; /** Reset all property to the factory settings (was Delete).
factory reset is used only for languageTag = "". */ - (void)factoryReset; /** ReadAll populate an AJNMessageArgument according to the given languageTag and filter. @param languageTag The language to use for the action (nil means default). @param filter Describe which properties to read. @param all A reference to AJNMessageArgument [out]. @return ER_OK if successful. */ - (QStatus)readAll:(const char *)languageTag withFilter:(PFilter)filter ajnMsgArg:(AJNMessageArgument **)all; /** Update an AJNMessageArgument according to the given languageTag and filter. @param name The property key name. @param languageTag The language to use for the action (nil means default). @param value The property value. @return ER_OK if successful. */ - (QStatus)Update:(const char *)name languageTag:(const char *)languageTag ajnMsgArg:(AJNMessageArgument *)value; /** Reset a property to the factory settings. @param name The property key name. @param languageTag The language to use for the action (nil means default). @return ER_OK if successful. */ - (QStatus)reset:(const char *)name languageTag:(const char *)languageTag; #pragma mark - Persistent getters /** Persistent getter by a key. @param key Key to look for(default languageTag = ""). @param language language to look for @return the value of the key if key is in the store. */ - (NSString *)getPersistentValue:(NSString *)key forLanguage:(NSString *)language; /** Get the property store key enum value according to the property key string. @param propertyStoreName property key string. @return a property key enum value. */ - (AJNPropertyStoreKey)getPropertyStoreKeyFromName:(const char *)propertyStoreName; /** Get the service pass code. @return the service pass code it has been set. */ - (NSString *)getPasscode; #pragma mark - Persistent setters /** Set the default language property in the property store.
If the input param is nil - NSUserDefaults entry will be used. If NSUserDefaults entry is not available - factory default is used. @param defaultLang New default language to set. @return ER_OK if successful. */ - (QStatus)setDefaultLang:(NSString *)defaultLang; /** Set the device name property in the property store.
If the input param is nil - NSUserDefaults entry will be used. If NSUserDefaults entry is not available - factory default is used. @param deviceName New device name to set. @param language Language to set device name to. @return ER_OK if successful. */ - (QStatus)setDeviceName:(NSString *)deviceName language:(NSString *)language; /** Set the device id property in the property store.
If the input param is nil - NSUserDefaults entry will be used. If NSUserDefaults entry is not available - factory default is used. @param deviceId New device id to set. @return ER_OK if successful. */ - (QStatus)setDeviceId:(NSString *)deviceId; /** Set the device pass code property in the property store. @param passCode New device pass code to set. @return ER_OK if successful. */ - (QStatus)setPasscode:(NSString *)passCode; @end /** PropertyStoreImplAdapter enable bind the C++ AboutPropertyStoreImpl API with an objective-c AJCFGPropertyStoreImpl object. */ class PropertyStoreImplAdapter : public ajn::services::AboutPropertyStoreImpl { public: PropertyStoreImplAdapter(AJCFGPropertyStoreImpl * objc_PropertyStoreImpl) { m_objc_PropertyStoreImpl = objc_PropertyStoreImpl; }; void FactoryReset() { [m_objc_PropertyStoreImpl factoryReset]; } virtual QStatus ReadAll(const char *languageTag, Filter filter, ajn::MsgArg& all) { if (filter == ANNOUNCE || filter == READ) { return ajn::services::AboutPropertyStoreImpl::ReadAll(languageTag, filter, all); } __autoreleasing AJNMessageArgument *objc_all; QStatus status = [m_objc_PropertyStoreImpl readAll:languageTag withFilter:(PFilter)filter ajnMsgArg:&objc_all]; all = (*(ajn::MsgArg *)objc_all.handle); return status; } virtual QStatus Update(const char *name, const char *languageTag, const ajn::MsgArg *value) { ajn::services::PropertyStoreKey propertyKey = (ajn::services::PropertyStoreKey)[m_objc_PropertyStoreImpl getPropertyStoreKeyFromName : name]; if (propertyKey >= NUMBER_OF_KEYS) return ER_FEATURE_NOT_AVAILABLE; // Validate that the value is acceptable qcc::String languageString = languageTag ? languageTag : ""; QStatus status = validateValue(propertyKey, *value, languageString); if (status != ER_OK) { return status; } __autoreleasing AJNMessageArgument *objc_value = [[AJNMessageArgument alloc] initWithHandle:(AJNHandle)value]; return [m_objc_PropertyStoreImpl Update:name languageTag:languageTag ajnMsgArg:objc_value]; } virtual QStatus Delete(const char *name, const char *languageTag) { return [m_objc_PropertyStoreImpl reset:name languageTag:languageTag]; } QStatus isLanguageSupported_Public_Adapter(const char *language) { return this->isLanguageSupported(language); } long getNumberOfProperties() { return m_Properties.size(); } QStatus populateWritableMsgArgs(const char *languageTag, ajn::MsgArg& all) { QStatus status = ER_OK; ajn::MsgArg * argsWriteData = new ajn::MsgArg[m_Properties.size()]; uint32_t writeArgCount = 0; do { for (ajn::services::PropertyMap::const_iterator it = m_Properties.begin(); it != m_Properties.end(); ++it) { const ajn::services::PropertyStoreProperty& property = it->second; if (!property.getIsWritable()) continue; // Check that it is from the defaultLanguage or empty. if (!(property.getLanguage().empty() || property.getLanguage().compare(languageTag) == 0)) continue; status = argsWriteData[writeArgCount].Set("{sv}", property.getPropertyName().c_str(), new ajn::MsgArg(property.getPropertyValue())); if (status != ER_OK) { break; } argsWriteData[writeArgCount].SetOwnershipFlags(ajn::MsgArg::OwnsArgs, true); writeArgCount++; } status = all.Set("a{sv}", writeArgCount, argsWriteData); if (status != ER_OK) { break; } all.SetOwnershipFlags(ajn::MsgArg::OwnsArgs, true); } while (0); if (status != ER_OK) { delete[] argsWriteData; } return status; } QStatus erasePropertyAccordingToPropertyCode(ajn::services::PropertyStoreKey propertyKey, const char *languageTag) { bool deleted = false; std::pair propertiesIter = m_Properties.equal_range(propertyKey); ajn::services::PropertyMap::iterator it; for (it = propertiesIter.first; it != propertiesIter.second; it++) { const ajn::services::PropertyStoreProperty& property = it->second; if (property.getIsWritable()) { if ((languageTag == NULL && property.getLanguage().empty()) || (languageTag != NULL && property.getLanguage().compare(languageTag) == 0)) { m_Properties.erase(it); // Insert from backup. deleted = true; break; } } } if (!deleted) { if (languageTag != NULL) { return ER_LANGUAGE_NOT_SUPPORTED; } else { return ER_INVALID_VALUE; } } return ER_OK; } QStatus updatePropertyAccordingToPropertyCode(ajn::services::PropertyStoreKey propertyKey, const char *languageTag, ajn::MsgArg *value) { ajn::services::PropertyStoreProperty * temp = NULL; std::pair propertiesIter = m_Properties.equal_range(propertyKey); for (ajn::services::PropertyMap::iterator it = propertiesIter.first; it != propertiesIter.second; it++) { const ajn::services::PropertyStoreProperty& property = it->second; if (property.getIsWritable()) { if ((languageTag == NULL && property.getLanguage().empty()) || (languageTag != NULL && property.getLanguage().compare(languageTag) == 0)) { temp = new ajn::services::PropertyStoreProperty(property.getPropertyName(), *value, property.getIsPublic(), property.getIsWritable(), property.getIsAnnouncable()); if (languageTag) temp->setLanguage(languageTag); m_Properties.erase(it); break; } } } if (temp == NULL) return ER_INVALID_VALUE; m_Properties.insert(ajn::services::PropertyPair(propertyKey, *temp)); return ER_OK; } private: AJCFGPropertyStoreImpl *m_objc_PropertyStoreImpl; }; base-15.09/config/ios/samples/000077500000000000000000000000001262264444500161565ustar00rootroot00000000000000base-15.09/config/ios/samples/ConfigServiceWorkspace.xcworkspace/000077500000000000000000000000001262264444500251135ustar00rootroot00000000000000base-15.09/config/ios/samples/ConfigServiceWorkspace.xcworkspace/contents.xcworkspacedata000066400000000000000000000012711262264444500320560ustar00rootroot00000000000000 base-15.09/config/ios/samples/alljoyn_services_cpp/000077500000000000000000000000001262264444500223735ustar00rootroot00000000000000base-15.09/config/ios/samples/alljoyn_services_cpp/alljoyn_config_cpp.xcodeproj/000077500000000000000000000000001262264444500302265ustar00rootroot00000000000000base-15.09/config/ios/samples/alljoyn_services_cpp/alljoyn_config_cpp.xcodeproj/project.pbxproj000066400000000000000000000344621262264444500333130ustar00rootroot00000000000000// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 196BC69318608C4100049F52 /* ConfigClient.cc in Sources */ = {isa = PBXBuildFile; fileRef = 196BC69118608C4100049F52 /* ConfigClient.cc */; }; 196BC69418608C4100049F52 /* ConfigService.cc in Sources */ = {isa = PBXBuildFile; fileRef = 196BC69218608C4100049F52 /* ConfigService.cc */; }; 9A4D0373186810EC00C9EFA4 /* ConfigClient.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 196BC68F18608C2C00049F52 /* ConfigClient.h */; }; 9A4D0374186810F200C9EFA4 /* ConfigService.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 196BC69018608C2C00049F52 /* ConfigService.h */; }; 9AB9CDD618547B37004660C5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AB9CDD518547B37004660C5 /* Foundation.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ 9AA93A7C1855C1B200378361 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = inc/alljoyn/services_common; dstSubfolderSpec = 16; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 9AA93A7F1855C1F600378361 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = inc/alljoyn/config; dstSubfolderSpec = 16; files = ( 9A4D0373186810EC00C9EFA4 /* ConfigClient.h in CopyFiles */, 9A4D0374186810F200C9EFA4 /* ConfigService.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; 9AB9CDD018547B37004660C5 /* Copy Files */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = inc/alljoyn/about; dstSubfolderSpec = 16; files = ( ); name = "Copy Files"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 196BC68F18608C2C00049F52 /* ConfigClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConfigClient.h; path = ../../../../cpp/inc/alljoyn/config/ConfigClient.h; sourceTree = ""; }; 196BC69018608C2C00049F52 /* ConfigService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConfigService.h; path = ../../../../cpp/inc/alljoyn/config/ConfigService.h; sourceTree = ""; }; 196BC69118608C4100049F52 /* ConfigClient.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConfigClient.cc; path = ../../../../cpp/src/ConfigClient.cc; sourceTree = ""; }; 196BC69218608C4100049F52 /* ConfigService.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConfigService.cc; path = ../../../../cpp/src/ConfigService.cc; sourceTree = ""; }; 9AB9CDD218547B37004660C5 /* liballjoyn_config_cpp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liballjoyn_config_cpp.a; sourceTree = BUILT_PRODUCTS_DIR; }; 9AB9CDD518547B37004660C5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 9AB9CDD918547B37004660C5 /* alljoyn_config_cpp-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "alljoyn_config_cpp-Prefix.pch"; sourceTree = ""; }; 9AB9CDE318547B37004660C5 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 9AB9CDE618547B37004660C5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 9AB9CDCF18547B37004660C5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9AB9CDD618547B37004660C5 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 196BC68918608BF200049F52 /* config */ = { isa = PBXGroup; children = ( 196BC68A18608BFA00049F52 /* cpp */, ); name = config; sourceTree = ""; }; 196BC68A18608BFA00049F52 /* cpp */ = { isa = PBXGroup; children = ( 196BC68E18608C1900049F52 /* src */, 196BC68B18608C0300049F52 /* inc */, ); name = cpp; sourceTree = ""; }; 196BC68B18608C0300049F52 /* inc */ = { isa = PBXGroup; children = ( 196BC68C18608C0B00049F52 /* alljoyn */, ); name = inc; sourceTree = ""; }; 196BC68C18608C0B00049F52 /* alljoyn */ = { isa = PBXGroup; children = ( 196BC68D18608C1200049F52 /* about */, ); name = alljoyn; sourceTree = ""; }; 196BC68D18608C1200049F52 /* about */ = { isa = PBXGroup; children = ( 196BC68F18608C2C00049F52 /* ConfigClient.h */, 196BC69018608C2C00049F52 /* ConfigService.h */, ); name = about; sourceTree = ""; }; 196BC68E18608C1900049F52 /* src */ = { isa = PBXGroup; children = ( 196BC69118608C4100049F52 /* ConfigClient.cc */, 196BC69218608C4100049F52 /* ConfigService.cc */, ); name = src; sourceTree = ""; }; 9AB9CDC918547B37004660C5 = { isa = PBXGroup; children = ( 9AB9CDD718547B37004660C5 /* alljoyn_services_cpp */, 9AB9CDD418547B37004660C5 /* Frameworks */, 9AB9CDD318547B37004660C5 /* Products */, ); sourceTree = ""; }; 9AB9CDD318547B37004660C5 /* Products */ = { isa = PBXGroup; children = ( 9AB9CDD218547B37004660C5 /* liballjoyn_config_cpp.a */, ); name = Products; sourceTree = ""; }; 9AB9CDD418547B37004660C5 /* Frameworks */ = { isa = PBXGroup; children = ( 9AB9CDD518547B37004660C5 /* Foundation.framework */, 9AB9CDE318547B37004660C5 /* XCTest.framework */, 9AB9CDE618547B37004660C5 /* UIKit.framework */, ); name = Frameworks; sourceTree = ""; }; 9AB9CDD718547B37004660C5 /* alljoyn_services_cpp */ = { isa = PBXGroup; children = ( 196BC68918608BF200049F52 /* config */, 9AB9CDD818547B37004660C5 /* Supporting Files */, ); path = alljoyn_services_cpp; sourceTree = ""; }; 9AB9CDD818547B37004660C5 /* Supporting Files */ = { isa = PBXGroup; children = ( 9AB9CDD918547B37004660C5 /* alljoyn_config_cpp-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 9AB9CDD118547B37004660C5 /* alljoyn_config_cpp */ = { isa = PBXNativeTarget; buildConfigurationList = 9AB9CDF518547B37004660C5 /* Build configuration list for PBXNativeTarget "alljoyn_config_cpp" */; buildPhases = ( 9AB9CDCE18547B37004660C5 /* Sources */, 9AB9CDCF18547B37004660C5 /* Frameworks */, 9AB9CDD018547B37004660C5 /* Copy Files */, 9AA93A7C1855C1B200378361 /* CopyFiles */, 9AA93A7F1855C1F600378361 /* CopyFiles */, ); buildRules = ( ); dependencies = ( ); name = alljoyn_config_cpp; productName = alljoyn_services_cpp; productReference = 9AB9CDD218547B37004660C5 /* liballjoyn_config_cpp.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 9AB9CDCA18547B37004660C5 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = AllJoyn; }; buildConfigurationList = 9AB9CDCD18547B37004660C5 /* Build configuration list for PBXProject "alljoyn_config_cpp" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 9AB9CDC918547B37004660C5; productRefGroup = 9AB9CDD318547B37004660C5 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 9AB9CDD118547B37004660C5 /* alljoyn_config_cpp */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ 9AB9CDCE18547B37004660C5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 196BC69318608C4100049F52 /* ConfigClient.cc in Sources */, 196BC69418608C4100049F52 /* ConfigService.cc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ 9AB9CDF318547B37004660C5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; name = Debug; }; 9AB9CDF418547B37004660C5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.0; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; name = Release; }; 9AB9CDF618547B37004660C5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD)"; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; CLANG_ENABLE_MODULES = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; DSTROOT = /tmp/alljoyn_services_cpp.dst; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_cpp/alljoyn_config_cpp-Prefix.pch"; GCC_WARN_ABOUT_RETURN_TYPE = YES; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "$(inherited)", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/config/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/cpp/inc\"", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", "-DUSE_SAMPLE_LOGGER", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = alljoyn_config_cpp; SKIP_INSTALL = YES; VALID_ARCHS = "armv7 armv7s arm64 i386"; }; name = Debug; }; 9AB9CDF718547B37004660C5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD)"; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; CLANG_ENABLE_MODULES = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; DSTROOT = /tmp/alljoyn_services_cpp.dst; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_cpp/alljoyn_config_cpp-Prefix.pch"; GCC_WARN_ABOUT_RETURN_TYPE = YES; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "$(inherited)", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/config/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/cpp/inc\"", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", "-DUSE_SAMPLE_LOGGER", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = alljoyn_config_cpp; SKIP_INSTALL = YES; VALID_ARCHS = "armv7 armv7s arm64 i386"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 9AB9CDCD18547B37004660C5 /* Build configuration list for PBXProject "alljoyn_config_cpp" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AB9CDF318547B37004660C5 /* Debug */, 9AB9CDF418547B37004660C5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 9AB9CDF518547B37004660C5 /* Build configuration list for PBXNativeTarget "alljoyn_config_cpp" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AB9CDF618547B37004660C5 /* Debug */, 9AB9CDF718547B37004660C5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 9AB9CDCA18547B37004660C5 /* Project object */; } base-15.09/config/ios/samples/alljoyn_services_cpp/alljoyn_config_cpp.xcodeproj/project.xcworkspace/000077500000000000000000000000001262264444500342245ustar00rootroot00000000000000contents.xcworkspacedata000066400000000000000000000002451262264444500411100ustar00rootroot00000000000000base-15.09/config/ios/samples/alljoyn_services_cpp/alljoyn_config_cpp.xcodeproj/project.xcworkspace base-15.09/config/ios/samples/alljoyn_services_cpp/alljoyn_services_cpp/000077500000000000000000000000001262264444500266105ustar00rootroot00000000000000alljoyn_config_cpp-Prefix.pch000066400000000000000000000020151262264444500343150ustar00rootroot00000000000000base-15.09/config/ios/samples/alljoyn_services_cpp/alljoyn_services_cpp/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef __OBJC__ #import #endif base-15.09/config/ios/samples/alljoyn_services_objc/000077500000000000000000000000001262264444500225265ustar00rootroot00000000000000base-15.09/config/ios/samples/alljoyn_services_objc/alljoyn_config_objc.xcodeproj/000077500000000000000000000000001262264444500305145ustar00rootroot00000000000000base-15.09/config/ios/samples/alljoyn_services_objc/alljoyn_config_objc.xcodeproj/project.pbxproj000066400000000000000000000637271262264444500336070ustar00rootroot00000000000000// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 190442501863150800534BB5 /* AJCFGConfigClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 190441FC1863150800534BB5 /* AJCFGConfigClient.mm */; }; 190442511863150800534BB5 /* AJCFGPropertyStoreImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 190441FD1863150800534BB5 /* AJCFGPropertyStoreImpl.mm */; }; 190442751863154000534BB5 /* AJCFGConfigClient.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 190441AE1863150800534BB5 /* AJCFGConfigClient.h */; }; 190442761863154600534BB5 /* AJCFGPropertyStoreImpl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 190441AF1863150800534BB5 /* AJCFGPropertyStoreImpl.h */; }; 191A7AC5188304F300B9AAAE /* AJCFGConfigLogger.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 191A7AC3188303DC00B9AAAE /* AJCFGConfigLogger.h */; }; 191A7AC6188304FD00B9AAAE /* AJCFGConfigLogger.mm in Sources */ = {isa = PBXBuildFile; fileRef = 191A7AC1188303D700B9AAAE /* AJCFGConfigLogger.mm */; }; 9A4D03711867412E00C9EFA4 /* AJCFGConfigServiceListenerImpl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9A4D0370186740CC00C9EFA4 /* AJCFGConfigServiceListenerImpl.h */; }; 9A4D03721867413B00C9EFA4 /* AJCFGConfigService.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9A78AC891866F5BC009A1BFE /* AJCFGConfigService.h */; }; 9A684D601867314F00701A1B /* AJCFGConfigServiceListenerImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9A684D5F1867314F00701A1B /* AJCFGConfigServiceListenerImpl.mm */; }; 9A78AC841866EF0A009A1BFE /* AJCFGConfigServiceListenerAdapter.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9A78AC821866E239009A1BFE /* AJCFGConfigServiceListenerAdapter.h */; }; 9A78AC851866EF0A009A1BFE /* AJCFGConfigServiceListener.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9A78AC831866EC56009A1BFE /* AJCFGConfigServiceListener.h */; }; 9A78AC881866F5A0009A1BFE /* AJCFGConfigService.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9A78AC871866F5A0009A1BFE /* AJCFGConfigService.mm */; }; 9AA935ED1854BC2B00378361 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935EC1854BC2B00378361 /* Foundation.framework */; }; 9AA935FB1854BC2B00378361 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935FA1854BC2B00378361 /* XCTest.framework */; }; 9AA935FC1854BC2B00378361 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935EC1854BC2B00378361 /* Foundation.framework */; }; 9AA935FE1854BC2B00378361 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935FD1854BC2B00378361 /* UIKit.framework */; }; 9AA936011854BC2B00378361 /* liballjoyn_config_objc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935E91854BC2B00378361 /* liballjoyn_config_objc.a */; }; 9AA936071854BC2B00378361 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9AA936051854BC2B00378361 /* InfoPlist.strings */; }; 9AA936091854BC2B00378361 /* alljoyn_services_objcTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AA936081854BC2B00378361 /* alljoyn_services_objcTests.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 9AA935FF1854BC2B00378361 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9AA935E11854BC2B00378361 /* Project object */; proxyType = 1; remoteGlobalIDString = 9AA935E81854BC2B00378361; remoteInfo = alljoyn_services_objc; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 9AA93A981855CC8E00378361 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = inc/alljoyn/config; dstSubfolderSpec = 16; files = ( 191A7AC5188304F300B9AAAE /* AJCFGConfigLogger.h in CopyFiles */, 190442761863154600534BB5 /* AJCFGPropertyStoreImpl.h in CopyFiles */, 190442751863154000534BB5 /* AJCFGConfigClient.h in CopyFiles */, 9A78AC841866EF0A009A1BFE /* AJCFGConfigServiceListenerAdapter.h in CopyFiles */, 9A78AC851866EF0A009A1BFE /* AJCFGConfigServiceListener.h in CopyFiles */, 9A4D03711867412E00C9EFA4 /* AJCFGConfigServiceListenerImpl.h in CopyFiles */, 9A4D03721867413B00C9EFA4 /* AJCFGConfigService.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 190441AE1863150800534BB5 /* AJCFGConfigClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCFGConfigClient.h; sourceTree = ""; }; 190441AF1863150800534BB5 /* AJCFGPropertyStoreImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCFGPropertyStoreImpl.h; sourceTree = ""; }; 190441FC1863150800534BB5 /* AJCFGConfigClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCFGConfigClient.mm; sourceTree = ""; }; 190441FD1863150800534BB5 /* AJCFGPropertyStoreImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCFGPropertyStoreImpl.mm; sourceTree = ""; }; 191A7AC1188303D700B9AAAE /* AJCFGConfigLogger.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCFGConfigLogger.mm; sourceTree = ""; }; 191A7AC3188303DC00B9AAAE /* AJCFGConfigLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCFGConfigLogger.h; sourceTree = ""; }; 9A4D0370186740CC00C9EFA4 /* AJCFGConfigServiceListenerImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCFGConfigServiceListenerImpl.h; sourceTree = ""; }; 9A684D5F1867314F00701A1B /* AJCFGConfigServiceListenerImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCFGConfigServiceListenerImpl.mm; sourceTree = ""; }; 9A78AC821866E239009A1BFE /* AJCFGConfigServiceListenerAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCFGConfigServiceListenerAdapter.h; sourceTree = ""; }; 9A78AC831866EC56009A1BFE /* AJCFGConfigServiceListener.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AJCFGConfigServiceListener.h; sourceTree = ""; }; 9A78AC871866F5A0009A1BFE /* AJCFGConfigService.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCFGConfigService.mm; sourceTree = ""; }; 9A78AC891866F5BC009A1BFE /* AJCFGConfigService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCFGConfigService.h; sourceTree = ""; }; 9AA935E91854BC2B00378361 /* liballjoyn_config_objc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liballjoyn_config_objc.a; sourceTree = BUILT_PRODUCTS_DIR; }; 9AA935EC1854BC2B00378361 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 9AA935F01854BC2B00378361 /* alljoyn_config_objc-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "alljoyn_config_objc-Prefix.pch"; sourceTree = ""; }; 9AA935F91854BC2B00378361 /* alljoyn_config_objcTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = alljoyn_config_objcTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 9AA935FA1854BC2B00378361 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 9AA935FD1854BC2B00378361 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; 9AA936041854BC2B00378361 /* alljoyn_config_objcTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "alljoyn_config_objcTests-Info.plist"; sourceTree = ""; }; 9AA936061854BC2B00378361 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 9AA936081854BC2B00378361 /* alljoyn_services_objcTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = alljoyn_services_objcTests.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 9AA935E61854BC2B00378361 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9AA935ED1854BC2B00378361 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 9AA935F61854BC2B00378361 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9AA935FB1854BC2B00378361 /* XCTest.framework in Frameworks */, 9AA936011854BC2B00378361 /* liballjoyn_config_objc.a in Frameworks */, 9AA935FE1854BC2B00378361 /* UIKit.framework in Frameworks */, 9AA935FC1854BC2B00378361 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 1904418C1863150700534BB5 /* config */ = { isa = PBXGroup; children = ( 190441AA1863150800534BB5 /* ios */, ); name = config; path = ../../..; sourceTree = ""; }; 190441AA1863150800534BB5 /* ios */ = { isa = PBXGroup; children = ( 190441AB1863150800534BB5 /* inc */, 190441FB1863150800534BB5 /* src */, ); path = ios; sourceTree = ""; }; 190441AB1863150800534BB5 /* inc */ = { isa = PBXGroup; children = ( 190441AC1863150800534BB5 /* alljoyn */, ); path = inc; sourceTree = ""; }; 190441AC1863150800534BB5 /* alljoyn */ = { isa = PBXGroup; children = ( 190441AD1863150800534BB5 /* config */, ); path = alljoyn; sourceTree = ""; }; 190441AD1863150800534BB5 /* config */ = { isa = PBXGroup; children = ( 191A7AC3188303DC00B9AAAE /* AJCFGConfigLogger.h */, 9A78AC891866F5BC009A1BFE /* AJCFGConfigService.h */, 190441AE1863150800534BB5 /* AJCFGConfigClient.h */, 190441AF1863150800534BB5 /* AJCFGPropertyStoreImpl.h */, 9A78AC821866E239009A1BFE /* AJCFGConfigServiceListenerAdapter.h */, 9A78AC831866EC56009A1BFE /* AJCFGConfigServiceListener.h */, 9A4D0370186740CC00C9EFA4 /* AJCFGConfigServiceListenerImpl.h */, ); path = config; sourceTree = ""; }; 190441FB1863150800534BB5 /* src */ = { isa = PBXGroup; children = ( 191A7AC1188303D700B9AAAE /* AJCFGConfigLogger.mm */, 190441FC1863150800534BB5 /* AJCFGConfigClient.mm */, 190441FD1863150800534BB5 /* AJCFGPropertyStoreImpl.mm */, 9A78AC871866F5A0009A1BFE /* AJCFGConfigService.mm */, 9A684D5F1867314F00701A1B /* AJCFGConfigServiceListenerImpl.mm */, ); path = src; sourceTree = ""; }; 9AA935E01854BC2B00378361 = { isa = PBXGroup; children = ( 1904418C1863150700534BB5 /* config */, 9AA935EE1854BC2B00378361 /* alljoyn_services_objc */, 9AA936021854BC2B00378361 /* alljoyn_services_objcTests */, 9AA935EB1854BC2B00378361 /* Frameworks */, 9AA935EA1854BC2B00378361 /* Products */, ); sourceTree = ""; }; 9AA935EA1854BC2B00378361 /* Products */ = { isa = PBXGroup; children = ( 9AA935E91854BC2B00378361 /* liballjoyn_config_objc.a */, 9AA935F91854BC2B00378361 /* alljoyn_config_objcTests.xctest */, ); name = Products; sourceTree = ""; }; 9AA935EB1854BC2B00378361 /* Frameworks */ = { isa = PBXGroup; children = ( 9AA935EC1854BC2B00378361 /* Foundation.framework */, 9AA935FA1854BC2B00378361 /* XCTest.framework */, 9AA935FD1854BC2B00378361 /* UIKit.framework */, ); name = Frameworks; sourceTree = ""; }; 9AA935EE1854BC2B00378361 /* alljoyn_services_objc */ = { isa = PBXGroup; children = ( 9AA935EF1854BC2B00378361 /* Supporting Files */, ); path = alljoyn_services_objc; sourceTree = ""; }; 9AA935EF1854BC2B00378361 /* Supporting Files */ = { isa = PBXGroup; children = ( 9AA935F01854BC2B00378361 /* alljoyn_config_objc-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; 9AA936021854BC2B00378361 /* alljoyn_services_objcTests */ = { isa = PBXGroup; children = ( 9AA936081854BC2B00378361 /* alljoyn_services_objcTests.m */, 9AA936031854BC2B00378361 /* Supporting Files */, ); path = alljoyn_services_objcTests; sourceTree = ""; }; 9AA936031854BC2B00378361 /* Supporting Files */ = { isa = PBXGroup; children = ( 9AA936041854BC2B00378361 /* alljoyn_config_objcTests-Info.plist */, 9AA936051854BC2B00378361 /* InfoPlist.strings */, ); name = "Supporting Files"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 9AA935E81854BC2B00378361 /* alljoyn_config_objc */ = { isa = PBXNativeTarget; buildConfigurationList = 9AA9360C1854BC2B00378361 /* Build configuration list for PBXNativeTarget "alljoyn_config_objc" */; buildPhases = ( 9AA935E51854BC2B00378361 /* Sources */, 9AA935E61854BC2B00378361 /* Frameworks */, 9AA93A981855CC8E00378361 /* CopyFiles */, ); buildRules = ( ); dependencies = ( ); name = alljoyn_config_objc; productName = alljoyn_services_objc; productReference = 9AA935E91854BC2B00378361 /* liballjoyn_config_objc.a */; productType = "com.apple.product-type.library.static"; }; 9AA935F81854BC2B00378361 /* alljoyn_config_objcTests */ = { isa = PBXNativeTarget; buildConfigurationList = 9AA9360F1854BC2B00378361 /* Build configuration list for PBXNativeTarget "alljoyn_config_objcTests" */; buildPhases = ( 9AA935F51854BC2B00378361 /* Sources */, 9AA935F61854BC2B00378361 /* Frameworks */, 9AA935F71854BC2B00378361 /* Resources */, ); buildRules = ( ); dependencies = ( 9AA936001854BC2B00378361 /* PBXTargetDependency */, ); name = alljoyn_config_objcTests; productName = alljoyn_services_objcTests; productReference = 9AA935F91854BC2B00378361 /* alljoyn_config_objcTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 9AA935E11854BC2B00378361 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = AllJoyn; }; buildConfigurationList = 9AA935E41854BC2B00378361 /* Build configuration list for PBXProject "alljoyn_config_objc" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 9AA935E01854BC2B00378361; productRefGroup = 9AA935EA1854BC2B00378361 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 9AA935E81854BC2B00378361 /* alljoyn_config_objc */, 9AA935F81854BC2B00378361 /* alljoyn_config_objcTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 9AA935F71854BC2B00378361 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 9AA936071854BC2B00378361 /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 9AA935E51854BC2B00378361 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 191A7AC6188304FD00B9AAAE /* AJCFGConfigLogger.mm in Sources */, 190442501863150800534BB5 /* AJCFGConfigClient.mm in Sources */, 9A78AC881866F5A0009A1BFE /* AJCFGConfigService.mm in Sources */, 9A684D601867314F00701A1B /* AJCFGConfigServiceListenerImpl.mm in Sources */, 190442511863150800534BB5 /* AJCFGPropertyStoreImpl.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 9AA935F51854BC2B00378361 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 9AA936091854BC2B00378361 /* alljoyn_services_objcTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 9AA936001854BC2B00378361 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9AA935E81854BC2B00378361 /* alljoyn_config_objc */; targetProxy = 9AA935FF1854BC2B00378361 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 9AA936051854BC2B00378361 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 9AA936061854BC2B00378361 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 9AA9360A1854BC2B00378361 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; name = Debug; }; 9AA9360B1854BC2B00378361 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.0; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; name = Release; }; 9AA9360D1854BC2B00378361 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; DSTROOT = /tmp/alljoyn_services_objc.dst; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_objc/alljoyn_config_objc-Prefix.pch"; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/config/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/config/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/ios/inc\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", "-DUSE_SAMPLE_LOGGER", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = alljoyn_config_objc; SKIP_INSTALL = YES; }; name = Debug; }; 9AA9360E1854BC2B00378361 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; DSTROOT = /tmp/alljoyn_services_objc.dst; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_objc/alljoyn_config_objc-Prefix.pch"; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/config/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/config/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/ios/inc\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", "-DUSE_SAMPLE_LOGGER", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = alljoyn_config_objc; SKIP_INSTALL = YES; }; name = Release; }; 9AA936101854BC2B00378361 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_objc/alljoyn_services_objc-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"/**", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"/**", "\"$(SRCROOT)/../../../../../services\"/**", "\"$(SRCROOT)/../../../../../common/inc\"", "\"$(SRCROOT)/../../../../../alljoyn_objc/AllJoynFramework/AllJoynFramework\"", "\"$(SRCROOT)/../../../../../applications\"/**", "\"$(SRCROOT)/../../../../../services/notification/cpp/inc/alljoyn/notification/", ); INFOPLIST_FILE = "alljoyn_services_objcTests/alljoyn_config_objcTests-Info.plist"; PRODUCT_NAME = alljoyn_config_objcTests; WRAPPER_EXTENSION = xctest; }; name = Debug; }; 9AA936111854BC2B00378361 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_objc/alljoyn_services_objc-Prefix.pch"; HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"/**", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"/**", "\"$(SRCROOT)/../../../../../services\"/**", "\"$(SRCROOT)/../../../../../common/inc\"", "\"$(SRCROOT)/../../../../../alljoyn_objc/AllJoynFramework/AllJoynFramework\"", "\"$(SRCROOT)/../../../../../applications\"/**", ); INFOPLIST_FILE = "alljoyn_services_objcTests/alljoyn_config_objcTests-Info.plist"; PRODUCT_NAME = alljoyn_config_objcTests; WRAPPER_EXTENSION = xctest; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 9AA935E41854BC2B00378361 /* Build configuration list for PBXProject "alljoyn_config_objc" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AA9360A1854BC2B00378361 /* Debug */, 9AA9360B1854BC2B00378361 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 9AA9360C1854BC2B00378361 /* Build configuration list for PBXNativeTarget "alljoyn_config_objc" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AA9360D1854BC2B00378361 /* Debug */, 9AA9360E1854BC2B00378361 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 9AA9360F1854BC2B00378361 /* Build configuration list for PBXNativeTarget "alljoyn_config_objcTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AA936101854BC2B00378361 /* Debug */, 9AA936111854BC2B00378361 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 9AA935E11854BC2B00378361 /* Project object */; } project.xcworkspace/000077500000000000000000000000001262264444500344335ustar00rootroot00000000000000base-15.09/config/ios/samples/alljoyn_services_objc/alljoyn_config_objc.xcodeprojcontents.xcworkspacedata000066400000000000000000000002461262264444500413770ustar00rootroot00000000000000base-15.09/config/ios/samples/alljoyn_services_objc/alljoyn_config_objc.xcodeproj/project.xcworkspace base-15.09/config/ios/samples/alljoyn_services_objc/alljoyn_services_objc/000077500000000000000000000000001262264444500270765ustar00rootroot00000000000000alljoyn_config_objc-Prefix.pch000066400000000000000000000020151262264444500347360ustar00rootroot00000000000000base-15.09/config/ios/samples/alljoyn_services_objc/alljoyn_services_objc/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef __OBJC__ #import #endif base-15.09/config/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests/000077500000000000000000000000001262264444500301215ustar00rootroot00000000000000alljoyn_config_objcTests-Info.plist000066400000000000000000000032551262264444500370320ustar00rootroot00000000000000base-15.09/config/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier org.alljoyn.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType BNDL CFBundleShortVersionString 00.01 CFBundleSignature ???? CFBundleVersion 1 alljoyn_services_objcTests.m000066400000000000000000000027321262264444500356170ustar00rootroot00000000000000base-15.09/config/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import @interface alljoyn_services_objcTests : XCTestCase @end @implementation alljoyn_services_objcTests - (void)setUp { [super setUp]; // Put setup code here. This method is called before the invocation of each test method in the class. } - (void)tearDown { // Put teardown code here. This method is called after the invocation of each test method in the class. [super tearDown]; } - (void)testExample { XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); } @end base-15.09/config/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests/en.lproj/000077500000000000000000000000001262264444500316505ustar00rootroot00000000000000InfoPlist.strings000066400000000000000000000000551262264444500351130ustar00rootroot00000000000000base-15.09/config/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests/en.lproj/* Localized versions of Info.plist keys */ base-15.09/config/ios/samples/sampleApp/000077500000000000000000000000001262264444500201005ustar00rootroot00000000000000base-15.09/config/ios/samples/sampleApp/AnnounceTextViewController.h000066400000000000000000000022231262264444500255620ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/about/AJNAnnouncement.h" @interface AnnounceTextViewController : UIViewController @property (strong, nonatomic) AJNAnnouncement *ajnAnnouncement; @end base-15.09/config/ios/samples/sampleApp/AnnounceTextViewController.m000066400000000000000000000050011262264444500255640ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AnnounceTextViewController.h" #import "alljoyn/about/AJNAboutDataConverter.h" @interface AnnounceTextViewController () @property (weak, nonatomic) IBOutlet UITextView *announceInformation; @end @implementation AnnounceTextViewController - (void)viewDidLoad { [super viewDidLoad]; // Retrive AJNAnnouncement by the announcementButtonCurrentTitle unique name NSString *txt = [[NSString alloc] init]; // Set Announcement title NSString *title = [self.ajnAnnouncement busName]; txt = [txt stringByAppendingFormat:@"%@\n%@\n", title, [@"" stringByPaddingToLength :[title length] + 10 withString : @"-" startingAtIndex : 0]]; // Set Announcement body txt = [txt stringByAppendingFormat:@"BusName: %@\n", [self.ajnAnnouncement busName]]; txt = [txt stringByAppendingFormat:@"Port: %hu\n", [self.ajnAnnouncement port]]; txt = [txt stringByAppendingFormat:@"Version: %u\n", [self.ajnAnnouncement version]]; txt = [txt stringByAppendingString:@"\n\n"]; // Set Announcement AboutMap data txt = [txt stringByAppendingFormat:@"About map:\n"]; txt = [txt stringByAppendingString:[AJNAboutDataConverter aboutDataDictionaryToString:([self.ajnAnnouncement aboutData])]]; txt = [txt stringByAppendingString:@"\n\n"]; // Set Announcement ObjectDesc data txt = [txt stringByAppendingFormat:@"Bus Object Description:\n"]; txt = [txt stringByAppendingString:[AJNAboutDataConverter objectDescriptionsDictionaryToString:[self.ajnAnnouncement objectDescriptions]]]; self.announceInformation.text = txt; } @end base-15.09/config/ios/samples/sampleApp/AppDelegate.h000066400000000000000000000022611262264444500224250ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNStatus.h" @interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; + (void)alertAndLog:(NSString *)message status:(QStatus)status; @end base-15.09/config/ios/samples/sampleApp/AppDelegate.m000066400000000000000000000062171262264444500224370ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AppDelegate.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. return YES; } - (void)applicationWillResignActive:(UIApplication *)application { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } - (void)applicationDidEnterBackground:(UIApplication *)application { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - (void)applicationWillEnterForeground:(UIApplication *)application { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } - (void)applicationDidBecomeActive:(UIApplication *)application { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } + (void)alertAndLog:(NSString *)message status:(QStatus)status { NSString *alertText = [NSString stringWithFormat:@"%@ (%@)",message, [AJNStatus descriptionForStatusCode:status]]; NSLog(@"%@", alertText); [[[UIAlertView alloc] initWithTitle:@"Startup Error" message:alertText delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil] show]; } @end base-15.09/config/ios/samples/sampleApp/ClientInformation.h000066400000000000000000000030501262264444500236730ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/about/AJNAnnouncement.h" // Property store strings static NSString *const DEFAULT_LANGUAGE_STR = @"DefaultLanguage"; static NSString *const DEVICE_NAME_STR = @"DeviceName"; static NSString *const DEVICE_ID_STR = @"DeviceId"; static NSString *const PASS_CODE_STR = @"passcode"; /** ClientInformation is a helper class to contain the announcement data and the user preferred language. */ @interface ClientInformation : NSObject @property (strong, nonatomic) AJNAnnouncement *announcement; @property (strong, nonatomic) NSString *currLang; @end base-15.09/config/ios/samples/sampleApp/ClientInformation.m000066400000000000000000000024261262264444500237060ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "ClientInformation.h" #import "alljoyn/about/AJNAboutDataConverter.h" @implementation ClientInformation - (void)setAnnouncement:(AJNAnnouncement *)announcement { _announcement = announcement; _currLang = [AJNAboutDataConverter messageArgumentToString:[_announcement aboutData][DEFAULT_LANGUAGE_STR]]; } @end base-15.09/config/ios/samples/sampleApp/CommonBusListener.h000066400000000000000000000032701262264444500236630ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJNBusListener.h" #import "AJNSessionPortListener.h" /** Implementation of the Bus listener. Called by AllJoyn to inform apps of bus related events. */ @interface CommonBusListener : NSObject /** Init the Value of the SessionPort associated with this SessionPortListener @param servicePort The port of the session. @return Object ID */ - (id)initWithServicePort:(AJNSessionPort)servicePort; /** Set the Value of the SessionPort associated with this SessionPortListener @param sessionPort The port of the session */ - (void)setSessionPort:(AJNSessionPort)sessionPort; /** Get the SessionPort of the listener @return The port of the session */ - (AJNSessionPort)sessionPort; @end base-15.09/config/ios/samples/sampleApp/CommonBusListener.mm000066400000000000000000000043121262264444500240430ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "CommonBusListener.h" #import "AJNSessionOptions.h" #import "alljoyn/config/AJCFGConfigLogger.h" @interface CommonBusListener () @property AJNSessionPort servicePort; @end @implementation CommonBusListener - (id)initWithServicePort:(AJNSessionPort)servicePort { self = [super init]; if (self) { self.servicePort = servicePort; } return self; } - (void)setSessionPort:(AJNSessionPort)sessionPort { self.servicePort = sessionPort; } - (AJNSessionPort)sessionPort { return self.servicePort; } #pragma mark - AJNSessionPortListener protocol method - (BOOL)shouldAcceptSessionJoinerNamed:(NSString *)joiner onSessionPort:(AJNSessionPort)sessionPort withSessionOptions:(AJNSessionOptions *)options { if (sessionPort != self.servicePort) { [[[AJCFGConfigLogger sharedInstance] logger] errorTag:[[self class] description] text:[NSString stringWithFormat:@"Rejecting join attempt on unexpected session port %hu.", sessionPort]]; return false; } else { [[[AJCFGConfigLogger sharedInstance] logger] debugTag:[[self class] description] text:[NSString stringWithFormat:@"Accepting join session request from %@ (proximity=%c, traffic=%u, transports=%hu).\n", joiner, options.proximity, options.trafficType, options.transports]]; return true; } } @end base-15.09/config/ios/samples/sampleApp/ConfigService.xcodeproj/000077500000000000000000000000001262264444500246225ustar00rootroot00000000000000base-15.09/config/ios/samples/sampleApp/ConfigService.xcodeproj/project.pbxproj000066400000000000000000000725651262264444500277150ustar00rootroot00000000000000// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 19E2F04317E87CE10005851F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F04217E87CE10005851F /* UIKit.framework */; }; 19E2F04517E87CE10005851F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F04417E87CE10005851F /* Foundation.framework */; }; 19E2F04717E87CE10005851F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F04617E87CE10005851F /* CoreGraphics.framework */; }; 19E2F06917E88AF20005851F /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F06817E88AF20005851F /* SystemConfiguration.framework */; }; 19E2F06D17E88B030005851F /* libstdc++.6.0.9.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F06A17E88B030005851F /* libstdc++.6.0.9.dylib */; }; 19E2F06E17E88B030005851F /* libstdc++.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F06B17E88B030005851F /* libstdc++.6.dylib */; }; 19E2F06F17E88B030005851F /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F06C17E88B030005851F /* libstdc++.dylib */; }; 19E2F07417E88B120005851F /* libc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F07117E88B120005851F /* libc++.dylib */; }; 19E2F07517E88B120005851F /* libc++abi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F07217E88B120005851F /* libc++abi.dylib */; }; 87D309431A708D0000BD4141 /* libc++.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F07017E88B120005851F /* libc++.1.dylib */; }; 9A0118C5187402B400975CE6 /* CommonBusListener.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9A0118BF187402B400975CE6 /* CommonBusListener.mm */; }; 9A0118EC187453ED00975CE6 /* ConfigSetupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0118EB187453ED00975CE6 /* ConfigSetupViewController.m */; }; 9A0118EF18745A1100975CE6 /* ConfigServiceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0118EE18745A1100975CE6 /* ConfigServiceViewController.m */; }; 9A0118F218745AA500975CE6 /* ConfigServiceListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0118F118745AA500975CE6 /* ConfigServiceListener.m */; }; 9A0118FA187460FF00975CE6 /* FactoryProperties.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9A0118F9187460FF00975CE6 /* FactoryProperties.plist */; }; 9A3DB0BC183A0D2A0063D6BE /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DAFFD183A0D290063D6BE /* Default-568h@2x.png */; }; 9A3DB0BD183A0D2A0063D6BE /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DAFFE183A0D290063D6BE /* Default.png */; }; 9A3DB0BE183A0D2A0063D6BE /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DAFFF183A0D290063D6BE /* Default@2x.png */; }; 9A3DB0BF183A0D2A0063D6BE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DB000183A0D290063D6BE /* InfoPlist.strings */; }; 9A3DB0C1183A0D2A0063D6BE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A3DB004183A0D290063D6BE /* main.m */; }; 9A3DB0C2183A0D2A0063D6BE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A3DB009183A0D290063D6BE /* AppDelegate.m */; }; 9A3DB0C3183A0D2A0063D6BE /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DB00A183A0D290063D6BE /* MainStoryboard_iPhone.storyboard */; }; 9A3DB0C4183A0D2A0063D6BE /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A3DB00C183A0D290063D6BE /* ViewController.m */; }; 9A3DB315183A19CB0063D6BE /* libc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A3DB314183A19CB0063D6BE /* libc.dylib */; }; 9A5CC10C183D04AA002327C0 /* alljoynicon.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 9A5CC10B183D04AA002327C0 /* alljoynicon.jpeg */; }; 9A5CC10F183D073E002327C0 /* GetAboutCallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5CC10E183D073E002327C0 /* GetAboutCallViewController.m */; }; 9A5EFF7D187044BC002833C1 /* ClientInformation.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5EFF7C187044BC002833C1 /* ClientInformation.m */; }; 9AD3D2DE187191AC00D15544 /* AnnounceTextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD3D2DD187191AC00D15544 /* AnnounceTextViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 19E2F03F17E87CE10005851F /* ConfigService.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ConfigService.app; sourceTree = BUILT_PRODUCTS_DIR; }; 19E2F04217E87CE10005851F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 19E2F04417E87CE10005851F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 19E2F04617E87CE10005851F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 19E2F06817E88AF20005851F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 19E2F06A17E88B030005851F /* libstdc++.6.0.9.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.6.0.9.dylib"; path = "usr/lib/libstdc++.6.0.9.dylib"; sourceTree = SDKROOT; }; 19E2F06B17E88B030005851F /* libstdc++.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.6.dylib"; path = "usr/lib/libstdc++.6.dylib"; sourceTree = SDKROOT; }; 19E2F06C17E88B030005851F /* libstdc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.dylib"; path = "usr/lib/libstdc++.dylib"; sourceTree = SDKROOT; }; 19E2F07017E88B120005851F /* libc++.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.1.dylib"; path = "usr/lib/libc++.1.dylib"; sourceTree = SDKROOT; }; 19E2F07117E88B120005851F /* libc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.dylib"; path = "usr/lib/libc++.dylib"; sourceTree = SDKROOT; }; 19E2F07217E88B120005851F /* libc++abi.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++abi.dylib"; path = "usr/lib/libc++abi.dylib"; sourceTree = SDKROOT; }; 9A0118BE187402B400975CE6 /* CommonBusListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonBusListener.h; sourceTree = ""; }; 9A0118BF187402B400975CE6 /* CommonBusListener.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CommonBusListener.mm; sourceTree = ""; }; 9A0118EA187453ED00975CE6 /* ConfigSetupViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConfigSetupViewController.h; sourceTree = ""; }; 9A0118EB187453ED00975CE6 /* ConfigSetupViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConfigSetupViewController.m; sourceTree = ""; }; 9A0118ED18745A1100975CE6 /* ConfigServiceViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConfigServiceViewController.h; sourceTree = ""; }; 9A0118EE18745A1100975CE6 /* ConfigServiceViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConfigServiceViewController.m; sourceTree = ""; }; 9A0118F018745AA500975CE6 /* ConfigServiceListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConfigServiceListener.h; sourceTree = ""; }; 9A0118F118745AA500975CE6 /* ConfigServiceListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConfigServiceListener.m; sourceTree = ""; }; 9A0118F9187460FF00975CE6 /* FactoryProperties.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = FactoryProperties.plist; sourceTree = ""; }; 9A3DAFFB183A0D290063D6BE /* ConfigService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ConfigService-Info.plist"; sourceTree = ""; }; 9A3DAFFC183A0D290063D6BE /* ConfigService-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ConfigService-Prefix.pch"; sourceTree = ""; }; 9A3DAFFD183A0D290063D6BE /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 9A3DAFFE183A0D290063D6BE /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 9A3DAFFF183A0D290063D6BE /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 9A3DB001183A0D290063D6BE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 9A3DB004183A0D290063D6BE /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 9A3DB008183A0D290063D6BE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../AppDelegate.h; sourceTree = ""; }; 9A3DB009183A0D290063D6BE /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = ../AppDelegate.m; sourceTree = ""; }; 9A3DB00A183A0D290063D6BE /* MainStoryboard_iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard_iPhone.storyboard; sourceTree = ""; }; 9A3DB00B183A0D290063D6BE /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 9A3DB00C183A0D290063D6BE /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 9A3DB314183A19CB0063D6BE /* libc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libc.dylib; path = usr/lib/libc.dylib; sourceTree = SDKROOT; }; 9A5CC10B183D04AA002327C0 /* alljoynicon.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = alljoynicon.jpeg; sourceTree = ""; }; 9A5CC10D183D073E002327C0 /* GetAboutCallViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetAboutCallViewController.h; sourceTree = ""; }; 9A5CC10E183D073E002327C0 /* GetAboutCallViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GetAboutCallViewController.m; sourceTree = ""; }; 9A5EFF7B187044BC002833C1 /* ClientInformation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientInformation.h; sourceTree = ""; }; 9A5EFF7C187044BC002833C1 /* ClientInformation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientInformation.m; sourceTree = ""; }; 9AD3D2DC187191AC00D15544 /* AnnounceTextViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnnounceTextViewController.h; sourceTree = ""; }; 9AD3D2DD187191AC00D15544 /* AnnounceTextViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnnounceTextViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 19E2F03C17E87CE10005851F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9A3DB315183A19CB0063D6BE /* libc.dylib in Frameworks */, 19E2F07417E88B120005851F /* libc++.dylib in Frameworks */, 87D309431A708D0000BD4141 /* libc++.1.dylib in Frameworks */, 19E2F07517E88B120005851F /* libc++abi.dylib in Frameworks */, 19E2F06F17E88B030005851F /* libstdc++.dylib in Frameworks */, 19E2F06E17E88B030005851F /* libstdc++.6.dylib in Frameworks */, 19E2F06D17E88B030005851F /* libstdc++.6.0.9.dylib in Frameworks */, 19E2F06917E88AF20005851F /* SystemConfiguration.framework in Frameworks */, 19E2F04317E87CE10005851F /* UIKit.framework in Frameworks */, 19E2F04517E87CE10005851F /* Foundation.framework in Frameworks */, 19E2F04717E87CE10005851F /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 19E2F03617E87CE10005851F = { isa = PBXGroup; children = ( 9A3DAFF9183A0D290063D6BE /* ConfigService */, 19E2F04117E87CE10005851F /* Frameworks */, 19E2F04017E87CE10005851F /* Products */, ); sourceTree = ""; }; 19E2F04017E87CE10005851F /* Products */ = { isa = PBXGroup; children = ( 19E2F03F17E87CE10005851F /* ConfigService.app */, ); name = Products; sourceTree = ""; }; 19E2F04117E87CE10005851F /* Frameworks */ = { isa = PBXGroup; children = ( 9A3DB314183A19CB0063D6BE /* libc.dylib */, 19E2F07117E88B120005851F /* libc++.dylib */, 19E2F07017E88B120005851F /* libc++.1.dylib */, 19E2F07217E88B120005851F /* libc++abi.dylib */, 19E2F06C17E88B030005851F /* libstdc++.dylib */, 19E2F06B17E88B030005851F /* libstdc++.6.dylib */, 19E2F06A17E88B030005851F /* libstdc++.6.0.9.dylib */, 19E2F06817E88AF20005851F /* SystemConfiguration.framework */, 19E2F04217E87CE10005851F /* UIKit.framework */, 19E2F04417E87CE10005851F /* Foundation.framework */, 19E2F04617E87CE10005851F /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; 19F6D03B1875A89400709EC0 /* ViewControllers */ = { isa = PBXGroup; children = ( 9A0118ED18745A1100975CE6 /* ConfigServiceViewController.h */, 9A0118EE18745A1100975CE6 /* ConfigServiceViewController.m */, 9A0118EA187453ED00975CE6 /* ConfigSetupViewController.h */, 9A0118EB187453ED00975CE6 /* ConfigSetupViewController.m */, 9A5CC10D183D073E002327C0 /* GetAboutCallViewController.h */, 9A5CC10E183D073E002327C0 /* GetAboutCallViewController.m */, 9A3DB00B183A0D290063D6BE /* ViewController.h */, 9A3DB00C183A0D290063D6BE /* ViewController.m */, 9AD3D2DC187191AC00D15544 /* AnnounceTextViewController.h */, 9AD3D2DD187191AC00D15544 /* AnnounceTextViewController.m */, ); name = ViewControllers; sourceTree = ""; }; 19F6D03C1875A8E400709EC0 /* StoryBoards */ = { isa = PBXGroup; children = ( 9A3DB00A183A0D290063D6BE /* MainStoryboard_iPhone.storyboard */, ); name = StoryBoards; sourceTree = ""; }; 19F6D03D1875A8FC00709EC0 /* Utils */ = { isa = PBXGroup; children = ( 9A0118F018745AA500975CE6 /* ConfigServiceListener.h */, 9A0118F118745AA500975CE6 /* ConfigServiceListener.m */, 9A0118BE187402B400975CE6 /* CommonBusListener.h */, 9A0118BF187402B400975CE6 /* CommonBusListener.mm */, 9A5EFF7B187044BC002833C1 /* ClientInformation.h */, 9A5EFF7C187044BC002833C1 /* ClientInformation.m */, ); name = Utils; sourceTree = ""; }; 9A3DAFF9183A0D290063D6BE /* ConfigService */ = { isa = PBXGroup; children = ( 19F6D03D1875A8FC00709EC0 /* Utils */, 19F6D03C1875A8E400709EC0 /* StoryBoards */, 19F6D03B1875A89400709EC0 /* ViewControllers */, 9A0118F9187460FF00975CE6 /* FactoryProperties.plist */, 9A3DAFFA183A0D290063D6BE /* Resources */, ); name = ConfigService; sourceTree = ""; }; 9A3DAFFA183A0D290063D6BE /* Resources */ = { isa = PBXGroup; children = ( 9A3DB008183A0D290063D6BE /* AppDelegate.h */, 9A3DB009183A0D290063D6BE /* AppDelegate.m */, 9A5CC10B183D04AA002327C0 /* alljoynicon.jpeg */, 9A3DAFFB183A0D290063D6BE /* ConfigService-Info.plist */, 9A3DAFFC183A0D290063D6BE /* ConfigService-Prefix.pch */, 9A3DAFFD183A0D290063D6BE /* Default-568h@2x.png */, 9A3DAFFE183A0D290063D6BE /* Default.png */, 9A3DAFFF183A0D290063D6BE /* Default@2x.png */, 9A3DB000183A0D290063D6BE /* InfoPlist.strings */, 9A3DB004183A0D290063D6BE /* main.m */, ); name = Resources; path = ConfigService; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 19E2F03E17E87CE10005851F /* ConfigService */ = { isa = PBXNativeTarget; buildConfigurationList = 19E2F06517E87CE10005851F /* Build configuration list for PBXNativeTarget "ConfigService" */; buildPhases = ( 19E2F03B17E87CE10005851F /* Sources */, 19E2F03C17E87CE10005851F /* Frameworks */, 19E2F03D17E87CE10005851F /* Resources */, ); buildRules = ( ); dependencies = ( ); name = ConfigService; productName = ConfigService; productReference = 19E2F03F17E87CE10005851F /* ConfigService.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 19E2F03717E87CE10005851F /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = AllJoyn; TargetAttributes = { 19E2F03E17E87CE10005851F = { SystemCapabilities = { com.apple.BackgroundModes = { enabled = 0; }; }; }; }; }; buildConfigurationList = 19E2F03A17E87CE10005851F /* Build configuration list for PBXProject "ConfigService" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 19E2F03617E87CE10005851F; productRefGroup = 19E2F04017E87CE10005851F /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 19E2F03E17E87CE10005851F /* ConfigService */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 19E2F03D17E87CE10005851F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 9A3DB0C3183A0D2A0063D6BE /* MainStoryboard_iPhone.storyboard in Resources */, 9A3DB0BD183A0D2A0063D6BE /* Default.png in Resources */, 9A3DB0BF183A0D2A0063D6BE /* InfoPlist.strings in Resources */, 9A5CC10C183D04AA002327C0 /* alljoynicon.jpeg in Resources */, 9A3DB0BE183A0D2A0063D6BE /* Default@2x.png in Resources */, 9A0118FA187460FF00975CE6 /* FactoryProperties.plist in Resources */, 9A3DB0BC183A0D2A0063D6BE /* Default-568h@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 19E2F03B17E87CE10005851F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 9A0118EC187453ED00975CE6 /* ConfigSetupViewController.m in Sources */, 9A3DB0C4183A0D2A0063D6BE /* ViewController.m in Sources */, 9AD3D2DE187191AC00D15544 /* AnnounceTextViewController.m in Sources */, 9A3DB0C2183A0D2A0063D6BE /* AppDelegate.m in Sources */, 9A5EFF7D187044BC002833C1 /* ClientInformation.m in Sources */, 9A0118EF18745A1100975CE6 /* ConfigServiceViewController.m in Sources */, 9A0118F218745AA500975CE6 /* ConfigServiceListener.m in Sources */, 9A3DB0C1183A0D2A0063D6BE /* main.m in Sources */, 9A0118C5187402B400975CE6 /* CommonBusListener.mm in Sources */, 9A5CC10F183D073E002327C0 /* GetAboutCallViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 9A3DB000183A0D290063D6BE /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 9A3DB001183A0D290063D6BE /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 19E2F06317E87CE10005851F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 6.1; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 19E2F06417E87CE10005851F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 6.1; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; 19E2F06617E87CE10005851F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ConfigService/ConfigService-Prefix.pch"; GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/common/inc\"", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework/\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(SRCROOT)/../../inc\"", "\"$(SRCROOT)/../../../cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/ios/inc\"", ); INFOPLIST_FILE = "ConfigService/ConfigService-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(OPENSSL_ROOT)/build/$(CONFIGURATION)-$(PLATFORM_NAME)", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "\"$(SRCROOT)/../alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", ); OTHER_LDFLAGS = ( "-lalljoyn", "-lajrouter", "-lssl", "-lcrypto", "-lalljoyn_config_objc", "-lalljoyn_config_cpp", "-lalljoyn_about_objc", "-lalljoyn_about_cpp", "-lalljoyn_services_common_objc", "-lalljoyn_services_common_cpp", "-lAllJoynFramework_iOS", ); PRODUCT_NAME = ConfigService; PROVISIONING_PROFILE = ""; TARGETED_DEVICE_FAMILY = "1,2"; VALID_ARCHS = "armv7 i386 arm64"; WRAPPER_EXTENSION = app; }; name = Debug; }; 19E2F06717E87CE10005851F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ConfigService/ConfigService-Prefix.pch"; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/common/inc\"", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework/\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(SRCROOT)/../../inc\"", "\"$(SRCROOT)/../../../cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/ios/inc\"", ); INFOPLIST_FILE = "ConfigService/ConfigService-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(OPENSSL_ROOT)/build/$(CONFIGURATION)-$(PLATFORM_NAME)", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "\"$(SRCROOT)/../alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", ); OTHER_LDFLAGS = ( "-lalljoyn", "-lajrouter", "-lssl", "-lcrypto", "-lalljoyn_config_objc", "-lalljoyn_config_cpp", "-lalljoyn_about_objc", "-lalljoyn_about_cpp", "-lalljoyn_services_common_objc", "-lalljoyn_services_common_cpp", "-lAllJoynFramework_iOS", ); PRODUCT_NAME = ConfigService; PROVISIONING_PROFILE = ""; TARGETED_DEVICE_FAMILY = "1,2"; VALID_ARCHS = "armv7 i386 arm64"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 19E2F03A17E87CE10005851F /* Build configuration list for PBXProject "ConfigService" */ = { isa = XCConfigurationList; buildConfigurations = ( 19E2F06317E87CE10005851F /* Debug */, 19E2F06417E87CE10005851F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 19E2F06517E87CE10005851F /* Build configuration list for PBXNativeTarget "ConfigService" */ = { isa = XCConfigurationList; buildConfigurations = ( 19E2F06617E87CE10005851F /* Debug */, 19E2F06717E87CE10005851F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 19E2F03717E87CE10005851F /* Project object */; } base-15.09/config/ios/samples/sampleApp/ConfigService.xcodeproj/project.xcworkspace/000077500000000000000000000000001262264444500306205ustar00rootroot00000000000000contents.xcworkspacedata000066400000000000000000000002361262264444500355040ustar00rootroot00000000000000base-15.09/config/ios/samples/sampleApp/ConfigService.xcodeproj/project.xcworkspace base-15.09/config/ios/samples/sampleApp/ConfigService/000077500000000000000000000000001262264444500226265ustar00rootroot00000000000000base-15.09/config/ios/samples/sampleApp/ConfigService/ConfigService-Info.plist000066400000000000000000000026551262264444500273320ustar00rootroot00000000000000 CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier org.alljoyn.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 00.01 CFBundleSignature ???? CFBundleVersion 0110 LSRequiresIPhoneOS UIMainStoryboardFile MainStoryboard_iPhone UIMainStoryboardFile~ipad MainStoryboard_iPhone UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait base-15.09/config/ios/samples/sampleApp/ConfigService/ConfigService-Prefix.pch000066400000000000000000000022571262264444500273110ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #ifndef __IPHONE_5_0 #warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ #import #import #endif base-15.09/config/ios/samples/sampleApp/ConfigService/Default-568h@2x.png000066400000000000000000000442421262264444500257700ustar00rootroot00000000000000‰PNG  IHDR€pzŹĺ$iCCPICC Profile8…UßoŰT>‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśáiTXtXML:com.adobe.xmp 1 5 72 1 72 640 1 1136 2012-07-27T15:07:06 Pixelmator 2.0.5 )ńq™?7IDATxíŰ=Şže†ŃŤřQń§±qÎĂ™87;;'ŕ RÄBR(J‰…źWĽáw­žł‰Ý^»ą8‰w<řöĽÎű漏ĎűňĽ7Îó @€ü˙^ź~:ď÷óľ;ďůĂóăýóŢ;ď­ó>9Oü @ŕF®¶»ďŹó®ć{}w~|ŢŰç}}ŢŁó®˙ć#@€¸űłĘËó~<ďŐőŔĎĎűč<ńw| @€¸~ÁwµŢWç=»đŠżĎÎó›żŕ#@€ܨŔŐzWóý}×? —†Ź pű÷Wř]'ě#@€ř?~#‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`WŢď& @€ŔÍ Ü_řôĽżn~U  @€\Í÷ô Ŕgçýzžß @ŕF®Ö»šďŮĂóăç˙ţđᙏλ;ĎG€ p;Wü˝<ďńyŻŢ=ďÝóŢ9ĎG€ p;ĎĎ*OÎűáĽÇ×_ż8ďĎóţ>ď·ó^źç#@€¸ «í®Ć»Zďjľ˙LZ9:\‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśŕiTXtXML:com.adobe.xmp 1 5 72 1 72 320 1 480 2012-07-27T15:07:80 Pixelmator 2.0.5 X±=Ć"IDATxíÖŃICQDŃDK°Áć»Iq¦˝ď/L {nđäoÖŔŕýv»ýś÷}Ţ×y>(‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśŕiTXtXML:com.adobe.xmp 1 5 72 1 72 640 1 960 2012-07-27T15:07:37 Pixelmator 2.0.5 PFđ5IDATxíŰ1ŠÝe‡á HHíěÜŽ;qoV.ÂŇÎ.V‚b&“řýa^p Ţßsá›3¦;Ďi^îŕýÝÝÝĎç˝;ď§óŢź÷ĂyŻÎó!@€ř˙ <ź>ś÷ńĽ_Î{x}~\ń÷öĽŻ_ćWgú @€܆ŔŐvWë=ľĚ»űóËoç]ń÷ăyoλţ͇ @ŕvľśU>ť÷ÇyO×7€×ź}Ż*Á‡ p×|Wë}Ţăő˙św}5蛿ŕC€¸aë›ŔĎWô]żř @€Śř>FmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@W>ź÷Ą0  @€nVŕjľç×çLJóŢž÷íy÷çů @€ÜžŔź÷xŕÇë—óŢť÷ć<x| @€7$pĹß§óţ:ďéŐůńÝyž÷ţĽëOÂßś'‚ @ŕúćďú«ďŻçý~ßĂy×7€O/óó™> @€·!pµÝ[ďá_ŠĎ4ěýďlÄIEND®B`‚base-15.09/config/ios/samples/sampleApp/ConfigService/alljoynicon.jpeg000066400000000000000000000031641262264444500260220ustar00rootroot00000000000000˙Ř˙ŕJFIF˙Ű„     "" $(4,$&1'-=-157:::#+?I?8C49:7 8$ $7,57377.,647,,+77/45,,--..7708400,,7,/,,,7.77,54,7˙Ŕ77˙Ä˙Ä5!A12Qa‘"$BqŃ#Rrˇ±Áđ˙Ä˙Ä3 !1AQ"‘±Ń2aqˇÁáđ#3Bb˙Ú ?Üp!LKoćĆšě+{í$©×ÂlćY˙^řpwau˛ŢŘÄ“ťŔt“î4<Ý™&ČZaĐY’ҧ[nť'Ě,ěGžaŚ ą^“eĐĆĐ_)óîŐ¤çrçuE‡)µť<ÎÄř~m{í…şđČTŞ6L±ÇŇÄwŮĚy~{S.ąJ`B”3Ě÷žz5„ĆT±y¨ěŰ}–ő±öóĂâvĘíl¨ZÖş©âűşgě‡ŔË"ŹdV>g¬-7Z†Ęln;9^×ŢÖ#|¸‚¬Í´zĂŘ÷cwÄý´6ÇVµ ä‰ĺľŇ´–cČRx"÷şSkhHČ\Că~lťK7înµŔl ńˇ:Ü÷›]*U×–žë´ĎÔ‘34"AIN› Üűóņô€ćÖ]šf×5á˛î–Ű…őZ/FůĘĹ)qĄ¬®TK$¬ťÖŘOžÄ{b­D{®¸âłn…´ó°v]ň)ż×LHuHýo:JC‹KhBu¨ě ţäá·ěˇý HÍďßtĹřéaA•,˛ŘÝjŰĐ~0˛ą’±ĺÝ­J[–bĆ‹5¤J E¬•¦ýŇylzhĘ·Kűť9ÇĂÚ‘3íů1X¨Ň—Ăť!cŤƆťö°¶ŕ}îN.Ĺľ0í‹főĆ<Ĺ0»ŽâsďĺÜ®ôJµŚĆúÝTEjôRlďEO¨‘éY§ýµĚPXµ0!!ôČ“Ş  ŇxʤŽé?~ĎA‡GÚZŹ ‘†¨ČúŞ Ě-K1ZTTęą/Ăáş°hÓꇱW®f*{ą]1Ý3ĐĺŇ›’žÓż‡aĂ#—_‚u%«~Ăq s|]ZE©tOGrk§úĹÉň>I›.ôj°ę_®şŤ ß«4o«ú•ř÷Âd©ŕŐÉ­ô„X¶śg™ú5¤¶Úm-´„ˇ)JE€Ĺ5–s‹ŤÎ«Ö6o¬Š^™P.ˇYIúś;'ďľ˙`pŘc鄚ĆgŞ'!V‘"`ýj– …ľ‚•jJ”4¨rě$zbŃ…ť3l;%B&Ín˘¶sšŚ•^d®7Â?†®UĆŢ"řYŤ·Źůˇ}‡š*ÎG§ÄOnl‘Hfl—ź‡r¤öw$_–BË’M…ČB⮑Đ!:ú©Ú\TF¤DkŤrůZô)7·ŇŻ{rÄőLÚüMŃuÖ^xśČť-†•N?©<á“g5‚NžËź@¦i°ľHş.ž1QJ^ BŻuDÔ5­Ďq¸ Ťe n7Ă#•ŃßwŠąY ń™ŐŰv%ĆÝj)JP@XPU¬~+€/ᆠ™Ż›(˛é3&B”'„ΨÇLő Č <”ë FŤ=ŢéqmC…°0ĄIy2βěYµ*ja|«©ÚO`:’}đ ‡ n„>ˇ’ő\şéeÚBo©k%× „‘kZŕß™ŰŰQfľúąE‘G˛…=ÚuB ť’ź8Ît… A¤’Ýź'ppw!e(Ôhý\şxď;ÄYPŞú<‡–MĐż˙Ůbase-15.09/config/ios/samples/sampleApp/ConfigService/en.lproj/000077500000000000000000000000001262264444500243555ustar00rootroot00000000000000base-15.09/config/ios/samples/sampleApp/ConfigService/en.lproj/InfoPlist.strings000066400000000000000000000000541262264444500276760ustar00rootroot00000000000000// Localized versions of Info.plist keys base-15.09/config/ios/samples/sampleApp/ConfigService/main.m000066400000000000000000000027371262264444500237410ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AppDelegate.h" #import "AJNInit.h" int main(int argc, char *argv[]) { @autoreleasepool { if ([AJNInit alljoynInit] != ER_OK) { return 1; } if ([AJNInit alljoynRouterInit] != ER_OK) { [AJNInit alljoynShutdown]; return 1; } int ret = UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); [AJNInit alljoynRouterShutdown]; [AJNInit alljoynShutdown]; return ret; } } base-15.09/config/ios/samples/sampleApp/ConfigServiceListener.h000066400000000000000000000043341262264444500245110ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/Status.h" #import "AJNBusAttachment.h" #import "alljoyn/config/AJCFGConfigServiceListener.h" #import "alljoyn/config/AJCFGPropertyStoreImpl.h" /** ConfigServiceListener is the sample implementation. it creates and initialize a Config service Listener to handle Config service callbacks. */ @interface ConfigServiceListener : NSObject /** Designated initializer. Create a ConfigServiceListener Object using the passed propertyStore and AJNBusAttachment. @param propertyStore A reference to a property store. @param bus A reference to the AJNBusAttachment. @return ConfigServiceListener if successful. */ - (id)initWithPropertyStore:(AJCFGPropertyStoreImpl *)propertyStore andBus:(AJNBusAttachment *)bus; /** Restart of the device - method not implemented. @return ER_OK if successful. */ - (QStatus)restart; /** Factory reset of the device - return to default values including password! @return ER_OK if successful. */ - (QStatus)factoryReset; /** Receive Passphrase info and persist it. @param daemonRealm Daemon realm to persist. @param passcode passcode content. @return ER_OK if successful. */ - (QStatus)setPassphrase:(NSString *)daemonRealm withPasscode:(NSString *)passcode; @end base-15.09/config/ios/samples/sampleApp/ConfigServiceListener.m000066400000000000000000000041071262264444500245140ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "ConfigServiceListener.h" #import "alljoyn/about/AJNAboutServiceApi.h" #import "alljoyn/config/AJCFGConfigLogger.h" @interface ConfigServiceListener () @property AJCFGPropertyStoreImpl *propertyStore; @property AJNBusAttachment *bus; @end @implementation ConfigServiceListener - (id)initWithPropertyStore:(AJCFGPropertyStoreImpl *)propertyStore andBus:(AJNBusAttachment *)bus { self = [super init]; if (self) { self.propertyStore = propertyStore; self.bus = bus; } return self; } - (QStatus)restart { [[[AJCFGConfigLogger sharedInstance] logger] debugTag:[[self class] description] text:@"Restart has been called !"]; return ER_OK; } - (QStatus)factoryReset { [[[AJCFGConfigLogger sharedInstance] logger] debugTag:[[self class] description] text:@"Factory Reset called"]; [self.propertyStore factoryReset]; [self.bus clearKeyStore]; return [[AJNAboutServiceApi sharedInstance] announce]; } - (QStatus)setPassphrase:(NSString *)daemonRealm withPasscode:(NSString *)passcode { QStatus status = [self.propertyStore setPasscode:passcode]; [self.bus clearKeyStore]; return status; } @end base-15.09/config/ios/samples/sampleApp/ConfigServiceViewController.h000066400000000000000000000021531262264444500256770ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNAuthenticationListener.h" @interface ConfigServiceViewController : UIViewController @end base-15.09/config/ios/samples/sampleApp/ConfigServiceViewController.m000066400000000000000000000402061262264444500257050ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "ConfigServiceViewController.h" #import "AJNVersion.h" #import "ClientInformation.h" #import "alljoyn/about/AJNAboutServiceApi.h" #import "alljoyn/config/AJCFGPropertyStoreImpl.h" #import "alljoyn/config/AJCFGConfigService.h" #import "alljoyn/config/AJCFGConfigServiceListenerImpl.h" #import "alljoyn/services_common/AJSVCGenericLoggerDefaultImpl.h" #import "alljoyn/config/AJCFGConfigLogger.h" #import "ConfigServiceListener.h" #import "CommonBusListener.h" #import "AppDelegate.h" static NSString *const DEFAULTPASSCODE = @"000000"; static NSString *const DAEMON_QUIET_PREFIX = @"quiet@"; // About Client - quiet advertising static NSString *const ABOUT_CONFIG_OBJECT_PATH = @"/Config"; // Config Service static NSString *const ABOUT_CONFIG_INTERFACE_NAME = @"org.alljoyn.Config"; //Config Service static bool ALLOWREMOTEMESSAGES = true; // About Client - allow Remote Messages flag static AJNSessionPort SERVICE_PORT; // About Service - service port @interface ConfigServiceViewController () @property (strong, nonatomic) AJNBusAttachment *busAttachment; @property (strong, nonatomic) AJCFGConfigServiceListenerImpl *configServiceListenerImpl; @property (strong, nonatomic) AJCFGConfigService *configService; @property (strong, nonatomic) AJCFGPropertyStoreImpl *propertyStore; @property (strong, nonatomic) CommonBusListener *aboutSessionPortListener; @property (strong, nonatomic) ConfigServiceListener *configServiceListener; @property (strong, nonatomic) AJNAboutServiceApi *aboutServiceApi; @property (strong, nonatomic) AJSVCGenericLoggerDefaultImpl *logger; @property (nonatomic) bool isServiceOn; @property (strong, nonatomic) NSString *uniqueID; @property (nonatomic, strong) NSString *password; @property (weak, nonatomic) IBOutlet UIButton *btnStartStopService; @end @implementation ConfigServiceViewController - (void)viewDidLoad { [super viewDidLoad]; // create unique ID*/ self.uniqueID = [[NSUUID UUID] UUIDString]; self.isServiceOn = NO; self.logger = [[AJCFGConfigLogger sharedInstance] logger]; } - (QStatus)startAboutService { QStatus serviceStatus; // Set port int port = 900; SERVICE_PORT = (AJNSessionPort)port; // Create message bus self.busAttachment = [[AJNBusAttachment alloc] initWithApplicationName:@"ConfigService" allowRemoteMessages:ALLOWREMOTEMESSAGES]; if (!self.busAttachment) { [self.logger errorTag:[[self class] description] text:@"Failed to create a message bus"]; serviceStatus = ER_OUT_OF_MEMORY; return serviceStatus; } //start the bus serviceStatus = [self.busAttachment start]; if (serviceStatus != ER_OK) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to start bus: %@", [AJNStatus descriptionForStatusCode:serviceStatus]]]; return serviceStatus; } // Allocate and fill property store self.propertyStore = [[AJCFGPropertyStoreImpl alloc] initPointerToFactorySettingFile:[[NSBundle mainBundle] pathForResource:@"FactoryProperties" ofType:@"plist"]]; serviceStatus = [self fillAboutPropertyStoreImplData]; if (serviceStatus != ER_OK) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to fill propertyStore: %@", [AJNStatus descriptionForStatusCode:serviceStatus]]]; return serviceStatus; } serviceStatus = [self.busAttachment connectWithArguments:@""]; if (serviceStatus != ER_OK) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to connectWithArguments: %@", [AJNStatus descriptionForStatusCode:serviceStatus]]]; } self.aboutSessionPortListener = [[CommonBusListener alloc] initWithServicePort:(SERVICE_PORT)]; if (self.aboutSessionPortListener) { [self.busAttachment registerBusListener:self.aboutSessionPortListener]; } [self.logger debugTag:[[self class] description] text:@"Create aboutServiceApi"]; self.aboutServiceApi = [AJNAboutServiceApi sharedInstance]; if (!self.aboutServiceApi) { serviceStatus = ER_BUS_NOT_ALLOWED; [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to create aboutServiceApi: %@", [AJNStatus descriptionForStatusCode:serviceStatus]]]; return serviceStatus; } [self.logger debugTag:[[self class] description] text:@"Start aboutServiceApi"]; [self.aboutServiceApi startWithBus:self.busAttachment andPropertyStore:self.propertyStore]; //Register Port [self.logger debugTag:[[self class] description] text:@"Register the AboutService on the AllJoyn bus"]; if (self.aboutServiceApi.isServiceStarted) { serviceStatus = [self.aboutServiceApi registerPort:(SERVICE_PORT)]; } if (serviceStatus != ER_OK) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed register port: %@", [AJNStatus descriptionForStatusCode:serviceStatus]]]; return serviceStatus; } // bind session port AJNSessionOptions *opt = [[AJNSessionOptions alloc] initWithTrafficType:(kAJNTrafficMessages) supportsMultipoint:(false) proximity:(kAJNProximityAny) transportMask:(kAJNTransportMaskAny)]; [self.logger debugTag:[[self class] description] text:@"Bind session"]; serviceStatus = [self.busAttachment bindSessionOnPort:SERVICE_PORT withOptions:opt withDelegate:self.aboutSessionPortListener]; if (serviceStatus == ER_ALLJOYN_BINDSESSIONPORT_REPLY_ALREADY_EXISTS) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"SessionPort already exists: %@", [AJNStatus descriptionForStatusCode:serviceStatus]]]; } return serviceStatus; } - (QStatus)startConfigService { QStatus status; status = [self startAboutService]; if (status != ER_OK) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"About service failed to start: %@", [AJNStatus descriptionForStatusCode:status]]]; return status; } status = [self enableServiceSecurity]; if (ER_OK != status) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to enable security on the bus: %@", [AJNStatus descriptionForStatusCode:status]]]; } else { [self.logger debugTag:[[self class] description] text:@"Successfully enabled security for the bus"]; } self.configServiceListener = [[ConfigServiceListener alloc] initWithPropertyStore:self.propertyStore andBus:self.busAttachment]; self.configServiceListenerImpl = [[AJCFGConfigServiceListenerImpl alloc] initWithConfigServiceListener:self.configServiceListener]; self.configService = [[AJCFGConfigService alloc] initWithBus:self.busAttachment propertyStore:self.propertyStore listener:self.configServiceListenerImpl]; // Set logger self.logger = [[AJSVCGenericLoggerDefaultImpl alloc] init]; [self.configService setLogger:self.logger]; NSMutableArray *interfaces = [[NSMutableArray alloc] init]; [interfaces addObject:ABOUT_CONFIG_INTERFACE_NAME]; NSString *path = ABOUT_CONFIG_OBJECT_PATH; status = [self.aboutServiceApi addObjectDescriptionWithPath:path andInterfaceNames:interfaces]; if (status != ER_OK) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to addObjectDescription: %@", [AJNStatus descriptionForStatusCode:status]]]; return status; } status = [self.configService registerService]; if (status != ER_OK) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to register configService: %@", [AJNStatus descriptionForStatusCode:status]]]; return status; } status = [self.busAttachment registerBusObject:self.configService]; if (status != ER_OK) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to register registerBusObject: %@", [AJNStatus descriptionForStatusCode:status]]]; return status; } status = [self.busAttachment advertiseName:[self.busAttachment uniqueName] withTransportMask:kAJNTransportMaskAny]; if (status != ER_OK) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to advertiseName [%@]: %@", [self.busAttachment uniqueName], [AJNStatus descriptionForStatusCode:status]]]; return status; } if (status == ER_OK) { if (self.aboutServiceApi.isServiceStarted) { [self.logger debugTag:[[self class] description] text:@"Calling Announce"]; status = [self.aboutServiceApi announce]; } if (status == ER_OK) { [self.logger debugTag:[[self class] description] text:@"Successfully announced"]; } } return status; } - (QStatus)enableServiceSecurity { QStatus status; status = [self.busAttachment enablePeerSecurity:@"ALLJOYN_SRP_KEYX ALLJOYN_ECDHE_PSK" authenticationListener:self keystoreFileName:@"Documents/alljoyn_keystore/s_central.ks" sharing:YES]; return status; } - (void)stopAboutService { QStatus status; [self.logger debugTag:[[self class] description] text:@"Stop About Service"]; // Delete AboutPropertyStoreImpl self.propertyStore = nil; // BusAttachment cleanup status = [self.busAttachment cancelAdvertisedName:[self.busAttachment uniqueName] withTransportMask:kAJNTransportMaskAny]; if (status == ER_OK) { [self.logger debugTag:[[self class] description] text:@"Successfully cancel advertised nam"]; } status = [self.busAttachment unbindSessionFromPort:SERVICE_PORT]; if (status == ER_OK) { [self.logger debugTag:[[self class] description] text:@"Successfully unbind Session"]; } // Delete AboutSessionPortListener [self.busAttachment unregisterBusListener:self.aboutSessionPortListener]; self.aboutSessionPortListener = nil; // Stop bus attachment status = [self.busAttachment stop]; if (status == ER_OK) { [self.logger debugTag:[[self class] description] text:@"Successfully stopped bus"]; } self.busAttachment = nil; } /* stopAboutService */ - (void)stopConfigService { // Delete AboutServiceApi [self.aboutServiceApi destroyInstance]; self.aboutServiceApi = nil; self.configService = nil; self.configServiceListenerImpl = nil; self.configServiceListener = nil; [self stopAboutService]; } - (IBAction)touchUpInsideStartStopBtn:(UIButton *)sender { QStatus status; if (self.isServiceOn == NO) { status = [self startConfigService]; if (status == ER_OK) { [sender setTitle:@"Stop Service" forState:UIControlStateNormal]; self.isServiceOn = YES; } else { [AppDelegate alertAndLog:@"Start Config Service Failed" status:status]; } } else { [self stopConfigService]; [sender setTitle:@"Start Service" forState:UIControlStateNormal]; self.isServiceOn = NO; } } - (QStatus)fillAboutPropertyStoreImplData { QStatus status; // AppId status = [self.propertyStore setAppId:self.uniqueID]; if (status != ER_OK) return status; // AppName status = [self.propertyStore setAppName:@"AboutConfig"]; if (status != ER_OK) return status; // DeviceId status = [self.propertyStore setDeviceId:@"1231232145667745675477"]; if (status != ER_OK) return status; // DeviceName NSString *value = [self.propertyStore getPersistentValue:DEVICE_NAME_STR forLanguage:@"en"]; value = (value ? value : @"Device Name(en)"); // check that we don't have a persistent value status = [self.propertyStore setDeviceName:value language:@"en"]; if (status != ER_OK) return status; // DeviceName value = [self.propertyStore getPersistentValue:DEVICE_NAME_STR forLanguage:@"fr"]; value = (value ? value : @"Device Name(fr)"); // check that we don't have a persistent value status = [self.propertyStore setDeviceName:value language:@"fr"]; if (status != ER_OK) return status; // DeviceName value = [self.propertyStore getPersistentValue:DEVICE_NAME_STR forLanguage:@"sp"]; value = (value ? value : @"Device Name(sp)"); // check that we don't have a persistent value status = [self.propertyStore setDeviceName:value language:@"sp"]; if (status != ER_OK) return status; // SupportedLangs NSArray *languages = @[@"en", @"sp", @"fr"]; status = [self.propertyStore setSupportedLangs:languages]; if (status != ER_OK) return status; // DefaultLang value = [self.propertyStore getPersistentValue:DEFAULT_LANGUAGE_STR forLanguage:@""]; value = (value ? value : @"en"); // check that we don't have a persistent value status = [self.propertyStore setDefaultLang:value]; if (status != ER_OK) return status; // ModelNumber status = [self.propertyStore setModelNumber:@"Wxfy388i"]; if (status != ER_OK) return status; // DateOfManufacture status = [self.propertyStore setDateOfManufacture:@"10/1/2199"]; if (status != ER_OK) return status; // SoftwareVersion status = [self.propertyStore setSoftwareVersion:@"12.20.44 build 44454"]; if (status != ER_OK) return status; // AjSoftwareVersion status = [self.propertyStore setAjSoftwareVersion:[AJNVersion versionInformation]]; if (status != ER_OK) return status; // HardwareVersion status = [self.propertyStore setHardwareVersion:@"355.499. b"]; if (status != ER_OK) return status; // Description status = [self.propertyStore setDescription:@"This is an Alljoyn Application" language:@"en"]; if (status != ER_OK) return status; status = [self.propertyStore setDescription:@"Esta es una Alljoyn aplicaciĂłn" language:@"sp"]; if (status != ER_OK) return status; status = [self.propertyStore setDescription:@"C'est une Alljoyn application" language:@"fr"]; if (status != ER_OK) return status; // Manufacturer status = [self.propertyStore setManufacturer:@"Company" language:@"en"]; if (status != ER_OK) return status; status = [self.propertyStore setManufacturer:@"Empresa" language:@"sp"]; if (status != ER_OK) return status; status = [self.propertyStore setManufacturer:@"Entreprise" language:@"fr"]; if (status != ER_OK) return status; status = [self.propertyStore setPasscode:DEFAULTPASSCODE]; if (status != ER_OK) return status; // SupportedUrl status = [self.propertyStore setSupportUrl:@"http://www.alljoyn.org"]; if (status != ER_OK) return status; return status; } #pragma mark - AJNAuthenticationListener protocol methods - (AJNSecurityCredentials *)requestSecurityCredentialsWithAuthenticationMechanism:(NSString *)authenticationMechanism peerName:(NSString *)peerName authenticationCount:(uint16_t)authenticationCount userName:(NSString *)userName credentialTypeMask:(AJNSecurityCredentialType)mask { AJNSecurityCredentials *creds = nil; [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"RequestSecurityCredentialsWithAuthenticationMechanism:%@ forRemotePeer%@ userName:%@", authenticationMechanism, peerName, userName]]; if ([authenticationMechanism isEqualToString:@"ALLJOYN_SRP_KEYX"] || [authenticationMechanism isEqualToString:@"ALLJOYN_ECDHE_PSK"]) { if (mask & kAJNSecurityCredentialTypePassword) { if (authenticationCount <= 3) { creds = [[AJNSecurityCredentials alloc] init]; creds.password = [self.propertyStore getPasscode]; } } } return creds; } - (void)authenticationUsing:(NSString *)authenticationMechanism forRemotePeer:(NSString *)peerName didCompleteWithStatus:(BOOL)success { NSString *status; status = (success == YES ? @"was successful" : @"failed"); [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Authentication using:%@ for remote peer%@ %@", authenticationMechanism, peerName, status]]; } @end base-15.09/config/ios/samples/sampleApp/ConfigSetupViewController.h000066400000000000000000000036111262264444500253770ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusAttachment.h" #import "ClientInformation.h" #import "alljoyn/config/AJCFGConfigClient.h" #import "AJNSessionListener.h" @interface ConfigSetupViewController : UITableViewController @property (nonatomic, weak) AJNBusAttachment *clientBusAttachment; @property (nonatomic, strong) ClientInformation *clientInformation; @property (nonatomic, weak) AJCFGConfigClient *configClient; @property (nonatomic, strong) NSString *realmBusName; @property (nonatomic, strong) NSMutableDictionary *peersPasscodes; // Store the peers passcodes @property (nonatomic, weak) IBOutlet UIBarButtonItem *btnFactoryReset; @property (nonatomic, weak) IBOutlet UIBarButtonItem *btnRestart; @property (nonatomic, weak) IBOutlet UIBarButtonItem *btnSetPassword; -(IBAction)factoryResetPressed: (id)sender; -(IBAction)restartPressed: (id)sender; -(IBAction)setPasswordPressed: (id)sender; @end base-15.09/config/ios/samples/sampleApp/ConfigSetupViewController.m000066400000000000000000000363431262264444500254140ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "ConfigSetupViewController.h" #import "qcc/String.h" #import "AJNMessageArgument.h" #import "alljoyn/about/AJNAboutIconClient.h" #import "alljoyn/about/AJNConvertUtil.h" #import "alljoyn/config/AJCFGConfigLogger.h" #import "alljoyn/about/AJNAboutDataConverter.h" @interface ConfigSetupViewController () @property (nonatomic) AJNSessionId sessionId; @property (strong, nonatomic) NSMutableDictionary *writableElements; @property (strong, nonatomic) NSString *annBusName; @property (nonatomic) UIAlertView *setPasswordAlert; @property (nonatomic) UIAlertView *alertNoSession; -(void)hasPasscodeInput:(NSNotification *)notification; -(void)prepareAlerts; -(void)loadSession; -(void)updateWritableDictionary; -(void)updateUI; -(NSString *)getConfigurableValueForKey:(NSString *)key; -(void)resetButtonTouchUpInside:(UIButton *)resetButton; @end @implementation ConfigSetupViewController @synthesize clientBusAttachment = _clientBusAttachment; @synthesize clientInformation = _clientInformation; @synthesize configClient = _configClient; @synthesize realmBusName = _realmBusName; @synthesize peersPasscodes = _peersPasscodes; @synthesize btnFactoryReset = _btnFactoryReset; @synthesize btnRestart = _btnRestart; @synthesize btnSetPassword = _btnSetPassword; @synthesize sessionId = _sessionId; @synthesize writableElements = _writableElements; @synthesize annBusName = _annBusName; @synthesize setPasswordAlert = _setPasswordAlert; @synthesize alertNoSession = _alertNoSession; - (void)viewDidLoad { [super viewDidLoad]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hasPasscodeInput:) name:@"passcodeForBus" object:nil]; [self prepareAlerts]; [self loadSession]; int ver = 0; [self.configClient versionWithBus:[self.clientInformation.announcement busName] version:ver]; NSLog(@"Version: %d",ver); } - (void)viewWillDisappear: (BOOL)animated { [super viewWillDisappear:animated]; //Leave current AllJoyn session QStatus status = [self.clientBusAttachment leaveSession:self.sessionId]; if (status == ER_OK) { NSLog(@"Left AJ session successfully"); } } /* * "passcodeForBus" Notification Handler */ - (void)hasPasscodeInput:(NSNotification *)notification { if ([notification.name isEqualToString:@"passcodeForBus"]) { if ([notification.object isEqualToString:self.annBusName]) { [[[AJCFGConfigLogger sharedInstance] logger] debugTag:[[self class] description] text:@"Successfully received PasscodeInput notification!"]; [self updateWritableDictionary]; [self updateUI]; } } } /* * Private Functions */ - (void)prepareAlerts { /* setPasswordAlert.tag = 1 */ self.setPasswordAlert = [[UIAlertView alloc] initWithTitle:@"" message:@"Enter device password" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; self.setPasswordAlert.alertViewStyle = UIAlertViewStylePlainTextInput; self.setPasswordAlert.tag = 1; // alertNoSession.tag = 2 self.alertNoSession = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Session is not connected, check the connection and reconnect." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; self.alertNoSession.alertViewStyle = UIAlertViewStyleDefault; self.alertNoSession.tag = 2; } - (void)loadSession { if (!self.sessionId) { //create sessionOptions AJNSessionOptions *opt = [[AJNSessionOptions alloc] initWithTrafficType:(kAJNTrafficMessages) supportsMultipoint:(false) proximity:(kAJNProximityAny) transportMask:(kAJNTransportMaskAny)]; //call joinSession self.sessionId = [self.clientBusAttachment joinSessionWithName:[self.clientInformation.announcement busName] onPort:[self.clientInformation.announcement port] withDelegate:self options:opt]; } // Session is not connected if (self.sessionId == 0 || self.sessionId == -1) { [[[AJCFGConfigLogger sharedInstance] logger] errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to join session. sid = %u", self.sessionId]]; [self.alertNoSession show]; } [self updateWritableDictionary]; [self updateUI]; } - (void)updateWritableDictionary { QStatus status; self.annBusName = [self.clientInformation.announcement busName]; NSMutableDictionary *configDict = [[NSMutableDictionary alloc] init]; status = [self.configClient configurationsWithBus:self.annBusName languageTag:@"" configs:&configDict sessionId:self.sessionId]; if (status != ER_OK) { [[[AJCFGConfigLogger sharedInstance] logger] errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to get configuration from bus: %@", [AJNStatus descriptionForStatusCode:status]]]; //[[[UIAlertView alloc] initWithTitle:@"Error" message:@"Failed to get configuration" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; // disable buttons [self.btnFactoryReset setEnabled:NO]; [self.btnRestart setEnabled:NO]; [self.btnSetPassword setEnabled:NO]; self.writableElements = nil; } else { // enable buttons [self.btnFactoryReset setEnabled:YES]; [self.btnRestart setEnabled:YES]; [self.btnSetPassword setEnabled:YES]; self.writableElements = configDict; [self.clientInformation setCurrLang:[self getConfigurableValueForKey:DEFAULT_LANGUAGE_STR]]; NSLog(@"updateWritableDictionary count %d",[self.writableElements count]); } } - (void)updateUI { [self.tableView reloadData]; } - (NSString *)getConfigurableValueForKey:(NSString *)key { AJNMessageArgument *msgArg = [self.writableElements valueForKey:key]; return [AJNAboutDataConverter messageArgumentToString:msgArg]; } - (void)resetButtonTouchUpInside:(UIButton *)resetButton { QStatus status; // Get the property name NSString *key = [self.writableElements allKeys][resetButton.tag]; NSLog(@"Resetting Key = %@", key); NSMutableArray *configNames = [[NSMutableArray alloc]init]; [configNames addObject:key]; status = [self.configClient resetConfigurationsWithBus:self.annBusName languageTag:[self.clientInformation currLang] configNames:configNames sessionId:self.sessionId]; if (status != ER_OK) { [[[UIAlertView alloc] initWithTitle:@"Reset Property Store Failed" message:[NSString stringWithFormat:@"Error occured:%@", [AJNStatus descriptionForStatusCode:status]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; [[[AJCFGConfigLogger sharedInstance] logger] errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to reset Property Store for key '%@': %@", key, [AJNStatus descriptionForStatusCode:status]]]; } else { [[[AJCFGConfigLogger sharedInstance] logger] debugTag:[[self class] description] text:[NSString stringWithFormat:@"Successfully reset Property Store for key '%@'", key]]; [self updateWritableDictionary]; [self updateUI]; } } /* * UITableViewDataSource Protocol Implementation */ -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.writableElements count]; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *fieldKey = [[self.writableElements allKeys] objectAtIndex: [indexPath row]]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: @"WritableElementCell" forIndexPath:indexPath]; for (UIView *view in cell.contentView.subviews) { if ([view isKindOfClass: [UILabel class]]) { UILabel *fieldNameLabel = (UILabel *)view; fieldNameLabel.text = fieldKey; fieldNameLabel.tag = [indexPath row]; } else if ([view isKindOfClass: [UITextField class]]) { UITextField *fieldTextField = (UITextField *)view; fieldTextField.text = [self getConfigurableValueForKey: fieldKey]; fieldTextField.delegate = self; fieldTextField.tag = [indexPath row]; } else if ([view isKindOfClass: [UIButton class]]) { UIButton *resetFieldButton = (UIButton *)view; [resetFieldButton setTitle: [NSString stringWithFormat:@"Reset %@", fieldKey] forState: UIControlStateNormal]; [resetFieldButton setContentHorizontalAlignment: UIControlContentHorizontalAlignmentCenter]; [resetFieldButton addTarget: self action: @selector(resetButtonTouchUpInside:) forControlEvents: UIControlEventTouchUpInside]; resetFieldButton.tag = [indexPath row]; } else { NSLog(@"Got view of unknown type from the content view subviews array"); } } return cell; } /* * UIAlertViewDelegate implementation */ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { QStatus status; switch (alertView.tag) { case 1: // setPasswordAlert { if (buttonIndex == 1) { //user pressed OK // Get the password input NSString *pass = [self.setPasswordAlert textFieldAtIndex:0].text; [[[AJCFGConfigLogger sharedInstance] logger] debugTag:[[self class] description] text:[NSString stringWithFormat:@"Trying to set Passcode to %@", pass]]; // Validate // Prepare password for sending NSString *guid = [self.clientBusAttachment guidForPeerNamed:self.annBusName]; status = [self.clientBusAttachment clearKeysForRemotePeerWithId:guid]; if (ER_OK == status) { [[[AJCFGConfigLogger sharedInstance] logger] debugTag:[[self class] description] text:@"Successfully clearKeysForRemotePeer"]; } else { [[[AJCFGConfigLogger sharedInstance] logger] errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to clearKeysForRemotePeer: %@", [AJNStatus descriptionForStatusCode:status]]]; } NSData *passcodeData = [pass dataUsingEncoding:NSUTF8StringEncoding]; const void *bytes = [passcodeData bytes]; int length = [passcodeData length]; // Set new password status = [self.configClient setPasscodeWithBus:self.annBusName daemonRealm:self.realmBusName newPasscodeSize:length newPasscode:(const uint8_t *)bytes sessionId:self.sessionId]; if (ER_OK == status) { [[[AJCFGConfigLogger sharedInstance] logger] debugTag:[[self class] description] text:@"Successfully setPasscodeWithBus"]; // add passcode to peersPass (self.peersPasscodes)[self.annBusName] = pass; [[[AJCFGConfigLogger sharedInstance] logger] debugTag:[[self class] description] text:[NSString stringWithFormat:@"update peer %@ with passcode %@", self.annBusName, pass]]; } else { [[[AJCFGConfigLogger sharedInstance] logger] errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to setPasscodeWithBus: %@", [AJNStatus descriptionForStatusCode:status]]]; } } } break; case 2: //NoSessionAlert break; default: [[[AJCFGConfigLogger sharedInstance] logger] errorTag:[[self class] description] text:@"alertView.tag is wrong"]; break; } } /* * UITextFieldDelegate implementation */ - (void)textFieldDidEndEditing:(UITextField *)textField { QStatus status; NSMutableDictionary *configElements = [[NSMutableDictionary alloc] init]; // Get the property name NSString *key = [self.writableElements allKeys][textField.tag]; // Get the property value AJNMessageArgument *msgArgValue = [[AJNMessageArgument alloc] init]; const char *char_str_value = [AJNConvertUtil convertNSStringToConstChar:textField.text]; [msgArgValue setValue:@"s", char_str_value]; // Add the property name/value configElements[key] = msgArgValue; NSString *useLang; if ([key isEqualToString:DEFAULT_LANGUAGE_STR]) { useLang = @""; } else { useLang = [self.clientInformation currLang]; } status = [self.configClient updateConfigurationsWithBus:self.annBusName languageTag:useLang configs:&configElements sessionId:self.sessionId]; if (status != ER_OK) { NSString *str= [NSString stringWithFormat:@"Failed to update property '%@' to '%s'", key, char_str_value ]; [[[UIAlertView alloc] initWithTitle:@"Update Property Store Failed" message:str delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; [[[AJCFGConfigLogger sharedInstance] logger] errorTag:[[self class] description] text:str]; } else { [[[AJCFGConfigLogger sharedInstance] logger] debugTag:[[self class] description] text:[NSString stringWithFormat:@"Successfully update Property Store with %@ = %s for tag[%d]", key, char_str_value, textField.tag]]; [self updateWritableDictionary]; [self updateUI]; } } - (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return YES; } /* * IBAction Button Handler Methods */ - (IBAction)factoryResetPressed:(id)sender { QStatus status = [self.configClient factoryResetWithBus:self.annBusName sessionId:self.sessionId]; if (status!=ER_OK) { [[[UIAlertView alloc]initWithTitle:@"Factory reset failed" message:[NSString stringWithFormat:@"Factory reset failed with error:%@",[AJNStatus descriptionForStatusCode:status]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; } else { [[[UIAlertView alloc]initWithTitle:@"Factory reset success" message:@"Factory reset done. Your wifi connection may have changed." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; } [self.navigationController popViewControllerAnimated:YES]; } - (IBAction)restartPressed:(id)sender { [self.configClient restartWithBus:self.annBusName sessionId:self.sessionId]; } - (IBAction)setPasswordPressed:(id)sender { [self.setPasswordAlert show]; } /* * AJNSessionListener Delegate implementation */ - (void)sessionWasLost:(AJNSessionId)sessionId forReason:(AJNSessionLostReason)reason { NSLog(@"session on bus %@ lost. reason:%d",self.annBusName,reason); [self.navigationController popViewControllerAnimated:YES]; } @end base-15.09/config/ios/samples/sampleApp/FactoryProperties.plist000066400000000000000000000013311262264444500246370ustar00rootroot00000000000000 DeviceName fr Device Name(fr) sp Device Name(sp) en Device Name(en) passcode 000000 DefaultLanguage en DeviceID DefaultID base-15.09/config/ios/samples/sampleApp/GetAboutCallViewController.h000066400000000000000000000023521262264444500254600ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusAttachment.h" #import "ClientInformation.h" @interface GetAboutCallViewController : UIViewController @property (weak, nonatomic) AJNBusAttachment *clientBusAttachment; @property (weak, nonatomic) ClientInformation *clientInformation; @end base-15.09/config/ios/samples/sampleApp/GetAboutCallViewController.m000066400000000000000000000175621262264444500254760ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "GetAboutCallViewController.h" #import "AJNMessageArgument.h" #import "alljoyn/about/AJNAboutClient.h" #import "alljoyn/about/AJNAboutDataConverter.h" #import "ViewController.h" #import "GetAboutCallViewController.h" #import "alljoyn/config/AJCFGConfigLogger.h" #define CLIENTDEFAULTLANG @"" @interface GetAboutCallViewController () @property (strong, nonatomic) AJNMessageArgument *supportedLanguagesMsgArg; @property (nonatomic) AJNSessionId sessionId; @property (nonatomic) UIAlertView *alertBusName; @property (nonatomic) UITextField *alertChooseLanguage; @property (nonatomic) UIAlertView *alertAnnouncementOptions; @property (nonatomic) UIAlertView *alertNoSession; @property (weak, nonatomic) IBOutlet UILabel *lblVersion; @property (weak, nonatomic) IBOutlet UILabel *lblAboutLanguage; @property (weak, nonatomic) IBOutlet UITextView *txtViewBusObjectDesc; @property (weak, nonatomic) IBOutlet UITextView *txtViewAboutMap; @property (weak, nonatomic) IBOutlet UIButton *optionsButton; @end @implementation GetAboutCallViewController - (void)prepareAlerts { // busNameAlert.tag = 1 self.alertBusName = [[UIAlertView alloc] initWithTitle:@"Set language" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; self.alertBusName.alertViewStyle = UIAlertViewStylePlainTextInput; self.alertBusName.tag = 1; self.alertChooseLanguage = [self.alertBusName textFieldAtIndex:0]; //connect the UITextField with the alert // announcementOptionsAlert.tag = 2 self.alertAnnouncementOptions = [[UIAlertView alloc] initWithTitle:@"Choose option:" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Refresh", @"Set Language", nil]; self.alertAnnouncementOptions.alertViewStyle = UIAlertViewStyleDefault; self.alertAnnouncementOptions.tag = 2; // alertNoSession.tag = 3 self.alertNoSession = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Session is not connected, check the connection and reconnect." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; self.alertNoSession.alertViewStyle = UIAlertViewStyleDefault; self.alertNoSession.tag = 3; } - (IBAction)TouchUpInsideRefreshandSetLanguage:(UIButton *)sender { [self.alertAnnouncementOptions show]; } - (bool)isValidLanguage:(NSString *)inputLanguage { bool found = false; const ajn::MsgArg *stringArray; size_t fieldListNumElements; QStatus status = [self.supportedLanguagesMsgArg value:@"as", &fieldListNumElements, &stringArray]; if (status == ER_OK) { for (size_t i = 0; i < fieldListNumElements; i++) { char *tempString; stringArray[i].Get("s", &tempString); if ([inputLanguage isEqualToString:@(tempString)]) { found = true; break; } } } return found; } // Get the user's input from the alert dialog - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { switch (alertView.tag) { case 1: // busNameAlert { if (buttonIndex == 1) { //user pressed OK if ([self.alertChooseLanguage.text isEqualToString:@""]) { self.alertChooseLanguage.text = [AJNAboutDataConverter messageArgumentToString:[self.clientInformation.announcement aboutData][@"DefaultLanguage"]]; } if (![self isValidLanguage:self.alertChooseLanguage.text]) { [[[UIAlertView alloc] initWithTitle:@"Error" message:@"Requested language is not supported" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show]; return; } self.clientInformation.currLang = self.alertChooseLanguage.text; [self UpdateCallViewInformation]; } else { // cancel } } break; case 2: //announcementOptionsAlert { if (buttonIndex == 1) { //refresh [self UpdateCallViewInformation]; } else if (buttonIndex == 2) { self.alertBusName.message = [NSString stringWithFormat:@"Available:%@", [AJNAboutDataConverter messageArgumentToString:self.supportedLanguagesMsgArg]]; [self.alertBusName show]; } } break; case 3: //NoSessionAlert { } break; default: [[[AJCFGConfigLogger sharedInstance] logger] errorTag:[[self class] description] text:@"alertView.tag is wrong"]; break; } } - (void)UpdateCallViewInformation { self.lblVersion.text = [NSString stringWithFormat:@"%u", [self.clientInformation.announcement version]]; if (!self.sessionId) { //create sessionOptions AJNSessionOptions *opt = [[AJNSessionOptions alloc] initWithTrafficType:kAJNTrafficMessages supportsMultipoint:false proximity:kAJNProximityAny transportMask:kAJNTransportMaskAny]; //call joinSession self.sessionId = [self.clientBusAttachment joinSessionWithName:[self.clientInformation.announcement busName] onPort:[self.clientInformation.announcement port] withDelegate:(nil) options:opt]; } if (self.sessionId == 0 || self.sessionId == -1) { [[[AJCFGConfigLogger sharedInstance] logger] errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to join session. sid = %u", self.sessionId]]; [self.alertNoSession show]; } else { NSMutableDictionary *aboutData; NSMutableDictionary *objDesc; AJNAboutClient *ajnAboutClient = [[AJNAboutClient alloc] initWithBus:self.clientBusAttachment]; QStatus qStatus = [ajnAboutClient aboutDataWithBusName:[self.clientInformation.announcement busName] andLanguageTag:self.clientInformation.currLang andAboutData:&aboutData andSessionId:self.sessionId]; if (qStatus != ER_OK) { UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Calling the about method returned with an error" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [errorAlert show]; } else { [ajnAboutClient objectDescriptionsWithBusName:[self.clientInformation.announcement busName] andObjectDescriptions:&objDesc andSessionId:self.sessionId]; [[[AJCFGConfigLogger sharedInstance] logger] debugTag:[[self class] description] text:[NSString stringWithFormat:@"AboutData: %@", [AJNAboutDataConverter aboutDataDictionaryToString:aboutData]]]; [[[AJCFGConfigLogger sharedInstance] logger] debugTag:[[self class] description] text:[NSString stringWithFormat:@"objectDescriptions: %@", [AJNAboutDataConverter objectDescriptionsDictionaryToString:objDesc]]]; self.supportedLanguagesMsgArg = aboutData[@"SupportedLanguages"]; self.lblAboutLanguage.text = self.clientInformation.currLang; self.txtViewAboutMap.text = [AJNAboutDataConverter aboutDataDictionaryToString:aboutData]; self.txtViewBusObjectDesc.text = [AJNAboutDataConverter objectDescriptionsDictionaryToString:objDesc]; } } } - (void)viewDidLoad { [super viewDidLoad]; [self prepareAlerts]; [self UpdateCallViewInformation]; } - (void)viewWillDisappear:(BOOL)animated { [self.clientBusAttachment leaveSession:self.sessionId]; [super viewWillDisappear:animated]; } @end base-15.09/config/ios/samples/sampleApp/MainStoryboard_iPhone.storyboard000066400000000000000000001006711262264444500264560ustar00rootroot00000000000000 base-15.09/config/ios/samples/sampleApp/ViewController.h000066400000000000000000000026711262264444500232350ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusListener.h" #import "AJNAuthenticationListener.h" #import "alljoyn/about/AJNAnnouncementListener.h" @interface ViewController : UIViewController @property (weak, nonatomic) IBOutlet UIButton *connectButton; @property (weak, nonatomic) IBOutlet UITableView *servicesTable; - (IBAction)connectButtonDidTouchUpInside:(id)sender; @end base-15.09/config/ios/samples/sampleApp/ViewController.m000066400000000000000000000734721262264444500232510ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "ViewController.h" #import "AJNStatus.h" #import "alljoyn/about/AJNAboutDataConverter.h" #import "alljoyn/about/AJNAnnouncement.h" #import "alljoyn/about/AJNAnnouncementReceiver.h" #import "alljoyn/services_common/AJSVCGenericLoggerDefaultImpl.h" #import "alljoyn/config/AJCFGConfigClient.h" #import "alljoyn/config/AJCFGConfigLogger.h" #import "ConfigSetupViewController.h" #import "AnnounceTextViewController.h" #import "GetAboutCallViewController.h" #import "ClientInformation.h" #import "AppDelegate.h" static bool ALLOWREMOTEMESSAGES = true; // About Client - allow Remote Messages flag static NSString *const APPNAME = @"AboutClientMain"; //About Client - default application name static NSString *const DAEMON_QUIET_PREFIX = @"quiet@"; //About Client - quiet advertising static NSString *const ABOUT_CONFIG_OBJECT_PATH = @"/Config"; //About Service - Config static NSString *const ABOUT_CONFIG_INTERFACE_NAME = @"org.alljoyn.Config"; //About Service - Config static NSString *const DEFAULT_REALM_BUS_NAME = @"org.alljoyn.BusNode.configClient"; static NSString *const DEFAULT_PASSCODE = @"000000"; static NSString *const KEYSTORE_FILE_PATH = @"Documents/alljoyn_keystore/s_central.ks"; static NSString *const AUTH_MECHANISM = @"ALLJOYN_SRP_KEYX ALLJOYN_ECDHE_PSK"; @interface ViewController () // About Client properties @property (strong, nonatomic) AJNBusAttachment *clientBusAttachment; @property (strong, nonatomic) AJNAnnouncementReceiver *announcementReceiver; @property (strong, nonatomic) NSString *realmBusName; @property (nonatomic) bool isAboutClientConnected; @property (strong, nonatomic) NSMutableDictionary *clientInformationDict; // Store the client related information @property (strong, nonatomic) AJSVCGenericLoggerDefaultImpl *logger; @property (strong, nonatomic) NSMutableDictionary *peersPasscodes; // Store the peers passcodes // Announcement @property (strong, nonatomic) NSString *announcementButtonCurrentTitle; // The pressed button's announcementUniqueName @property (strong, nonatomic) dispatch_queue_t annBtnCreationQueue; // About Client strings @property (strong, nonatomic) NSString *ajconnect; @property (strong, nonatomic) NSString *ajdisconnect; @property (strong, nonatomic) NSString *annSubvTitleLabelDefaultTxt; // About Client alerts @property (strong, nonatomic) UIAlertView *announcementOptionsAlert; @property (strong, nonatomic) UIAlertView *announcementOptionsAlertNoConfig; /* ConfigClient */ @property (strong, nonatomic) AJCFGConfigClient *configClient; /* Security */ @property (strong, nonatomic) UIAlertView *setPassCodeAlert; @property (strong, nonatomic) NSString *passCodeText; @property (strong, nonatomic) NSString *peerName; @property (nonatomic, strong) NSString *password; @end @implementation ViewController #pragma mark - Built In methods - (void)viewDidLoad { [super viewDidLoad]; [self loadNewSession]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.navigationController setToolbarHidden: YES]; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; [self.navigationController setToolbarHidden: NO]; } // Get the user's input from the alert dialog - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { switch (alertView.tag) { case 3: // Announcement options alert { [self performAnnouncemnetAction:buttonIndex]; } break; case 4: //announcementOptionsAlertNoConfig { [self performAnnouncemnetAction:buttonIndex]; } break; case 5: // passcode alert { [self.setPassCodeAlert dismissWithClickedButtonIndex:buttonIndex animated:NO]; if (buttonIndex == 1) { // User pressed OK // get the input pass self.passCodeText = [self.setPassCodeAlert textFieldAtIndex:0].text; [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Passcode is: %@", self.passCodeText]]; bool foundPeer = false; // check that peername is not empty if ([self.peerName length]) { if (![self.passCodeText length]) { // set the pass to default if input is empty self.passCodeText = DEFAULT_PASSCODE; } // Iterate over the dictionary and add/update for (NSString *key in self.peersPasscodes.allKeys) { if ([key isEqualToString:self.peerName]) { // Update passcode for key (self.peersPasscodes)[self.peerName] = self.passCodeText; [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Update peer %@ with passcode %@", self.peerName, self.passCodeText]]; // Set flag foundPeer = true; break; } } if (!foundPeer) { // Add new set of key/value [self.peersPasscodes setValue:self.passCodeText forKey:self.peerName]; [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"add new peers %@ %@", self.peerName, self.passCodeText]]; } [[NSNotificationCenter defaultCenter] postNotificationName:@"passcodeForBus" object:self.peerName]; } } else { // User pressed Cancel } } break; default: [self.logger errorTag:[[self class] description] text:@"alertView.tag is wrong"]; break; } } - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.destinationViewController isKindOfClass:[GetAboutCallViewController class]]) { GetAboutCallViewController *getAboutCallView = segue.destinationViewController; getAboutCallView.clientInformation = self.clientInformationDict[self.announcementButtonCurrentTitle]; getAboutCallView.clientBusAttachment = self.clientBusAttachment; } else if ([segue.destinationViewController isKindOfClass:[ConfigSetupViewController class]]) { ConfigSetupViewController *getConfigCallView = segue.destinationViewController; getConfigCallView.clientInformation = self.clientInformationDict[self.announcementButtonCurrentTitle]; getConfigCallView.clientBusAttachment = self.clientBusAttachment; getConfigCallView.configClient = self.configClient; getConfigCallView.realmBusName = self.realmBusName; getConfigCallView.peersPasscodes = self.peersPasscodes; } else if ([segue.destinationViewController isKindOfClass:[AnnounceTextViewController class]]) { AnnounceTextViewController *announceTextViewController = segue.destinationViewController; announceTextViewController.ajnAnnouncement = [(ClientInformation *)(self.clientInformationDict)[self.announcementButtonCurrentTitle] announcement]; } } /* prepareForSegue: sender: */ #pragma mark - IBAction Methods - (IBAction)connectButtonDidTouchUpInside:(id)sender { // Connect to the bus with the default realm bus name if (!self.isAboutClientConnected) { [self startAboutClient]; } else { [self stopAboutClient]; } } // IBAction triggered by a dynamic announcement button - (void)didTouchAnnSubvOkButton:(id)subvOkButton { [[subvOkButton superview] removeFromSuperview]; } #pragma mark - AJNAnnouncementListener protocol method // Here we receive an announcement from AJN and add it to the client's list of services avaialble - (void)announceWithVersion:(uint16_t)version port:(uint16_t)port busName:(NSString *)busName objectDescriptions:(NSMutableDictionary *)objectDescs aboutData:(NSMutableDictionary **)aboutData { NSString *announcementUniqueName; // Announcement unique name in a format of ClientInformation *clientInformation = [[ClientInformation alloc] init]; // Save the announcement in a AJNAnnouncement clientInformation.announcement = [[AJNAnnouncement alloc] initWithVersion:version port:port busName:busName objectDescriptions:objectDescs aboutData:aboutData]; // Generate an announcement unique name in a format of announcementUniqueName = [NSString stringWithFormat:@"%@ %@", [clientInformation.announcement busName], [AJNAboutDataConverter messageArgumentToString:[clientInformation.announcement aboutData][@"DeviceName"]]]; [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Announcement unique name [%@]", announcementUniqueName]]; AJNMessageArgument *annObjMsgArg = [clientInformation.announcement aboutData][@"AppId"]; uint8_t *appIdBuffer; size_t appIdNumElements; QStatus status; status = [annObjMsgArg value:@"ay", &appIdNumElements, &appIdBuffer]; // Add the received announcement if (status != ER_OK) { [self.logger fatalTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to read appId for key [%@] :%@", announcementUniqueName, [AJNStatus descriptionForStatusCode:status]]]; return; } // Dealing with announcement entries should be syncronized, so we add it to a queue dispatch_sync(self.annBtnCreationQueue, ^{ bool isAppIdExists = false; uint8_t *tmpAppIdBuffer; size_t tmpAppIdNumElements; QStatus tStatus; int res; // Iterate over the announcements dictionary for (NSString *key in self.clientInformationDict.allKeys) { ClientInformation *clientInfo = [self.clientInformationDict valueForKey:key]; AJNAnnouncement *announcement = [clientInfo announcement]; AJNMessageArgument *tmpMsgrg = [announcement aboutData][@"AppId"]; tStatus = [tmpMsgrg value:@"ay", &tmpAppIdNumElements, &tmpAppIdBuffer]; if (tStatus != ER_OK) { [self.logger fatalTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to read appId for key [%@] :%@", key, [AJNStatus descriptionForStatusCode:tStatus]]]; return; } res = 1; if (appIdNumElements == tmpAppIdNumElements) { res = memcmp(appIdBuffer, tmpAppIdBuffer, appIdNumElements); } // Found a matched appId - res=0 if (!res) { [self.logger errorTag:[[self class] description] text:@"Got an announcement from a known device[appID"]; isAppIdExists = true; // Same AppId and the same announcementUniqueName if ([key isEqualToString:announcementUniqueName]) { // Update only announcements dictionary (self.clientInformationDict)[announcementUniqueName] = clientInformation; } else { // Same AppId but *different* Bus name/Device name [self.logger debugTag:[[self class] description] text:@"Same AppId but *different* Bus name/Device name - updating the announcement object and UI"]; NSString *prevBusName = [announcement busName]; // Check if bus name has changed if (!([busName isEqualToString:prevBusName])) { [self.logger debugTag:[[self class] description] text:@"Bus name has changed - calling cancelFindAdvertisedName"]; // Cancel advertise name tStatus = [self.clientBusAttachment cancelFindAdvertisedName:prevBusName]; if (status != ER_OK) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to cancelAdvertisedName for %@ :%@", prevBusName, [AJNStatus descriptionForStatusCode:tStatus]]]; } } // Remove existed record from the announcements dictionary [self.clientInformationDict removeObjectForKey:key]; // Add new record to the announcements dictionary [self.clientInformationDict setValue:clientInformation forKey:announcementUniqueName]; // Update UI [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Update UI with the announcementUniqueName: %@", announcementUniqueName]]; [self.servicesTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; } break; } //if } //for //appId doesn't exist and there is no match announcementUniqueName if (!(self.clientInformationDict)[announcementUniqueName] && !isAppIdExists) { // Add new pair with this AboutService information (version,port,bus name, object description and about data) [self.clientInformationDict setValue:clientInformation forKey:announcementUniqueName]; [self addNewAnnouncemetEntry]; } }); // Register interest in a well-known name prefix for the purpose of discovery (didLoseAdertise) [self.clientBusAttachment enableConcurrentCallbacks]; status = [self.clientBusAttachment findAdvertisedName:busName]; if (status != ER_OK) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to findAdvertisedName for %@ :%@", busName, [AJNStatus descriptionForStatusCode:status]]]; } } #pragma mark AJNBusListener protocol methods - (void)didFindAdvertisedName:(NSString *)name withTransportMask:(AJNTransportMask)transport namePrefix:(NSString *)namePrefix { [self.logger debugTag:[[self class] description] text:@"didFindAdvertisedName has been called"]; } - (void)didLoseAdvertisedName:(NSString *)name withTransportMask:(AJNTransportMask)transport namePrefix:(NSString *)namePrefix { [self.logger debugTag:[[self class] description] text:@"didLoseAdvertisedName has been called"]; QStatus status; // Find the button title that should be removed for (NSString *key in[self.clientInformationDict allKeys]) { if ([[[[self.clientInformationDict valueForKey:key] announcement] busName] isEqualToString:name]) { // Cancel advertise name for that bus status = [self.clientBusAttachment cancelFindAdvertisedName:name]; if (status != ER_OK) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to cancelFindAdvertisedName for %@. status:%@", name, [AJNStatus descriptionForStatusCode:status]]]; } // Remove the anouncement from the dictionary [self.clientInformationDict removeObjectForKey:key]; } } [self.servicesTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; } #pragma mark - util methods - (void)loadNewSession { // About Client flags self.isAboutClientConnected = false; self.annBtnCreationQueue = dispatch_queue_create("org.alljoyn.announcementbuttoncreationQueue", NULL); // Set About Client strings self.ajconnect = @"Connect to AllJoyn"; self.ajdisconnect = @"Disconnect from AllJoyn"; self.realmBusName = DEFAULT_REALM_BUS_NAME; self.annSubvTitleLabelDefaultTxt = @"Announcement of "; // Set About Client connect button self.connectButton.backgroundColor = [UIColor darkGrayColor]; //button bg color [self.connectButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; //button font color [self.connectButton setTitle:self.ajconnect forState:UIControlStateNormal]; //default text [self prepareAlerts]; [AJCFGConfigLogger sharedInstance]; [[AJCFGConfigLogger sharedInstance]setLogger:nil]; self.logger = [[AJCFGConfigLogger sharedInstance] logger]; } // Initialize alerts - (void)prepareAlerts { // announcementOptionsAlert.tag = 3 self.announcementOptionsAlert = [[UIAlertView alloc] initWithTitle:@"Choose option:" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Show Announce", @"About", @"Config", nil]; self.announcementOptionsAlert.alertViewStyle = UIAlertViewStyleDefault; self.announcementOptionsAlert.tag = 3; // announcementOptionsAlert.tag = 4 self.announcementOptionsAlertNoConfig = [[UIAlertView alloc] initWithTitle:@"Choose option:" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Show Announce", @"About", nil]; self.announcementOptionsAlertNoConfig.alertViewStyle = UIAlertViewStyleDefault; self.announcementOptionsAlertNoConfig.tag = 4; // setPassCodeAlert.tag = 5 self.setPassCodeAlert = [[UIAlertView alloc] initWithTitle:@"" message:@"Enter device password" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; self.setPassCodeAlert.alertViewStyle = UIAlertViewStylePlainTextInput; self.setPassCodeAlert.tag = 5; } - (void)performAnnouncemnetAction:(NSInteger)opt { switch (opt) { case 0: // "Cancel" break; case 1: // "Show Announce" { [self performSegueWithIdentifier:@"AboutShowAnnounceSegue" sender:self]; } break; case 2: // "About" { [self performSegueWithIdentifier:@"AboutClientSegue" sender:self]; // get the announcment object } break; case 3: // "Config" { [self performSegueWithIdentifier:@"ConfigSetupSegue" sender:self]; } break; default: break; } } #pragma mark - AboutClient #pragma mark start AboutClient - (void)startAboutClient { QStatus status; // Create a dictionary to contain announcements using a key in the format of: "announcementUniqueName + announcementObj" self.clientInformationDict = [[NSMutableDictionary alloc] init]; [self.logger debugTag:[[self class] description] text:@"Start About Client"]; // [[AJCFGConfigLogger sharedInstance] debugTag:[[self class] description] text:@"Start About Client"]; // Init AJNBusAttachment self.clientBusAttachment = [[AJNBusAttachment alloc] initWithApplicationName:APPNAME allowRemoteMessages:(ALLOWREMOTEMESSAGES)]; // Start AJNBusAttachment status = [self.clientBusAttachment start]; if (status != ER_OK) { [AppDelegate alertAndLog:@"Failed AJNBusAttachment start" status:status]; [self stopAboutClient]; return; } // Connect AJNBusAttachment status = [self.clientBusAttachment connectWithArguments:@""]; if (status != ER_OK) { [AppDelegate alertAndLog:@"Failed AJNBusAttachment connectWithArguments" status:status]; [self stopAboutClient]; return; } [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"aboutClientListener"]]; [self.clientBusAttachment registerBusListener:self]; self.announcementReceiver = [[AJNAnnouncementReceiver alloc] initWithAnnouncementListener:self andBus:self.clientBusAttachment]; const char* interfaces[] = { [ABOUT_CONFIG_INTERFACE_NAME UTF8String] }; status = [self.announcementReceiver registerAnnouncementReceiverForInterfaces:interfaces withNumberOfInterfaces:1]; if (status != ER_OK) { [AppDelegate alertAndLog:@"Failed to registerAnnouncementReceiver" status:status]; [self stopAboutClient]; return; } NSUUID *UUID = [NSUUID UUID]; NSString *stringUUID = [UUID UUIDString]; self.realmBusName = [NSString stringWithFormat:@"%@-%@", DEFAULT_REALM_BUS_NAME, stringUUID]; // Advertise Daemon for tcl status = [self.clientBusAttachment requestWellKnownName:self.realmBusName withFlags:kAJNBusNameFlagDoNotQueue]; if (status == ER_OK) { // Advertise the name with a quite prefix for TC to find it status = [self.clientBusAttachment advertiseName:[NSString stringWithFormat:@"%@%@", DAEMON_QUIET_PREFIX, self.realmBusName] withTransportMask:kAJNTransportMaskAny]; if (status != ER_OK) { [AppDelegate alertAndLog:@"Failed to advertise name" status:status]; [self stopAboutClient]; return; } else { [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Successfully advertised: %@%@", DAEMON_QUIET_PREFIX, self.realmBusName]]; } } else { [AppDelegate alertAndLog:@"Failed to requestWellKnownName" status:status]; [self stopAboutClient]; return; } [self.connectButton setTitle:self.ajdisconnect forState:UIControlStateNormal]; //change title to "Disconnect from AllJoyn" // Start Config Client self.configClient = [[AJCFGConfigClient alloc] initWithBus:self.clientBusAttachment]; if (!self.configClient) { [AppDelegate alertAndLog:@"Failed to start Config Client" status:status]; [self stopAboutClient]; return; } // Set logger self.logger = [[AJSVCGenericLoggerDefaultImpl alloc] init]; [self.configClient setLogger:self.logger]; // Create NSMutableDictionary dictionary of peers passcodes self.peersPasscodes = [[NSMutableDictionary alloc] init]; // Enable Client Security status = [self enableClientSecurity]; if (ER_OK != status) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to enable security on the bus. %@", [AJNStatus descriptionForStatusCode:status]]]; } else { [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Successfully enabled security for the bus"]]; } self.isAboutClientConnected = true; } - (QStatus)enableClientSecurity { QStatus status; status = [self.clientBusAttachment enablePeerSecurity:AUTH_MECHANISM authenticationListener:self keystoreFileName:KEYSTORE_FILE_PATH sharing:YES]; if (status != ER_OK) { //try to delete the keystore and recreate it, if that fails return failure NSError *error; NSString *keystoreFilePath = [NSString stringWithFormat:@"%@/alljoyn_keystore/s_central.ks", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]]; [[NSFileManager defaultManager] removeItemAtPath:keystoreFilePath error:&error]; if (error) { NSLog(@"ERROR: Unable to delete keystore. %@", error); return ER_AUTH_FAIL; } status = [self.clientBusAttachment enablePeerSecurity:AUTH_MECHANISM authenticationListener:self keystoreFileName:KEYSTORE_FILE_PATH sharing:YES]; } return status; } - (void)addNewAnnouncemetEntry { [self.servicesTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; } // announcementGetMoreInfo is an IBAction triggered by pressing a dynamic announcement button - (void)announcementGetMoreInfo:(NSInteger)requestedRow { // set the announcementButtonCurrentTitle self.announcementButtonCurrentTitle = [self.clientInformationDict allKeys][requestedRow]; // set the announcementButtonCurrentTitle [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Getting data for [%@]", self.announcementButtonCurrentTitle]]; if ([self announcementHasConfig:self.announcementButtonCurrentTitle]) { [self.announcementOptionsAlert show]; // Event is forward to alertView: clickedButtonAtIndex: } else { [self.announcementOptionsAlertNoConfig show]; // Event is forward to alertView: clickedButtonAtIndex: } } // Return true if an announcement supports icon interface - (bool)announcementHasConfig:(NSString *)announcementKey { bool hasIconInterface = false; AJNAnnouncement *announcement = [(ClientInformation *)[self.clientInformationDict valueForKey:announcementKey] announcement]; NSMutableDictionary *announcementObjDecs = [announcement objectDescriptions]; //Dictionary of ObjectDescriptions NSStrings // iterate over the object descriptions dictionary for (NSString *key in announcementObjDecs.allKeys) { if ([key isEqualToString:ABOUT_CONFIG_OBJECT_PATH]) { // iterate over the NSMutableArray for (NSString *intfc in[announcementObjDecs valueForKey:key]) { if ([intfc isEqualToString:ABOUT_CONFIG_INTERFACE_NAME]) { hasIconInterface = true; } } } } return hasIconInterface; } #pragma mark stop AboutClient - (void)stopAboutClient { QStatus status; [self.logger debugTag:[[self class] description] text:@"Stop About Client"]; // Bus attachment cleanup status = [self.clientBusAttachment cancelAdvertisedName:[NSString stringWithFormat:@"%@%@", DAEMON_QUIET_PREFIX, self.realmBusName] withTransportMask:kAJNTransportMaskAny]; if (status == ER_OK) { [self.logger debugTag:[[self class] description] text:@"Successfully cancel advertised name"]; } status = [self.clientBusAttachment releaseWellKnownName:self.realmBusName]; if (status == ER_OK) { [self.logger debugTag:[[self class] description] text:@"Successfully release WellKnownName"]; } status = [self.clientBusAttachment removeMatchRule:@"sessionless='t',type='error'"]; if (status == ER_OK) { [self.logger debugTag:[[self class] description] text:@"Successfully remove MatchRule"]; } // Cancel advertise name for each announcement bus for (NSString *key in[self.clientInformationDict allKeys]) { ClientInformation *clientInfo = (self.clientInformationDict)[key]; status = [self.clientBusAttachment cancelFindAdvertisedName:[[clientInfo announcement] busName]]; if (status != ER_OK) { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"Failed to cancelAdvertisedName for %@: %@", key, [AJNStatus descriptionForStatusCode:status]]]; } } self.clientInformationDict = nil; const char* interfaces[] = { [ABOUT_CONFIG_INTERFACE_NAME UTF8String] }; status = [self.announcementReceiver unRegisterAnnouncementReceiverForInterfaces:interfaces withNumberOfInterfaces:1]; if (status == ER_OK) { [self.logger debugTag:[[self class] description] text:@"Successfully unregistered AnnouncementReceiver"]; } self.announcementReceiver = nil; // Stop bus attachment status = [self.clientBusAttachment stop]; if (status == ER_OK) { [self.logger debugTag:[[self class] description] text:@"Successfully stopped bus"]; } self.clientBusAttachment = nil; self.peersPasscodes = nil; // Set flag self.isAboutClientConnected = false; // UI cleanup [self.connectButton setTitle:self.ajconnect forState:UIControlStateNormal]; [self.servicesTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; [self.logger debugTag:[[self class] description] text:@"About Client is stopped"]; self.logger = nil; } #pragma mark UITableView delegates - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.clientInformationDict count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *MyIdentifier = @"AnnouncementCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; cell.selectionStyle = UITableViewCellSelectionStyleNone; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier]; } // Here we use the provided setImageWithURL: method to load the web image // Ensure you use a placeholder image otherwise cells will be initialized with no image cell.textLabel.text = [self.clientInformationDict allKeys][indexPath.row]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self announcementGetMoreInfo:indexPath.row]; } - (void)setPassCode:(NSString *)passCode { self.password = passCode; } #pragma mark - AJNAuthenticationListener protocol methods - (AJNSecurityCredentials *)requestSecurityCredentialsWithAuthenticationMechanism:(NSString *)authenticationMechanism peerName:(NSString *)peerName authenticationCount:(uint16_t)authenticationCount userName:(NSString *)userName credentialTypeMask:(AJNSecurityCredentialType)mask { AJNSecurityCredentials *creds = nil; bool credFound = false; [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"requestSecurityCredentialsWithAuthenticationMechanism:%@ forRemotePeer%@ userName:%@", authenticationMechanism, peerName, userName]]; if ([authenticationMechanism isEqualToString:@"ALLJOYN_SRP_KEYX"] || [authenticationMechanism isEqualToString:@"ALLJOYN_ECDHE_PSK"]) { if (mask & kAJNSecurityCredentialTypePassword) { if (authenticationCount <= 3) { creds = [[AJNSecurityCredentials alloc] init]; // Check if the password stored in peersPasscodes for (NSString *key in self.peersPasscodes.allKeys) { if ([key isEqualToString:peerName]) { creds.password = (self.peersPasscodes)[key]; [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Found password %@ for peer %@", creds.password, key]]; credFound = true; break; } } // Use the default password if (!credFound) { creds.password = DEFAULT_PASSCODE; [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Using default password %@ for peer %@", DEFAULT_PASSCODE, peerName]]; } } } } return creds; } - (void)authenticationUsing:(NSString *)authenticationMechanism forRemotePeer:(NSString *)peerName didCompleteWithStatus:(BOOL)success { NSString *status; status = (success == YES ? @"was successful" : @"failed"); [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"authenticationUsing:%@ forRemotePeer%@ %@", authenticationMechanism, peerName, status]]; //get the passcpde for this bus if (!success) { self.peerName = peerName; self.passCodeText = nil; dispatch_async(dispatch_get_main_queue(), ^{ [self.setPassCodeAlert show]; }); } } //- (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView //{ // return YES; //} @end base-15.09/config/ios/src/000077500000000000000000000000001262264444500153015ustar00rootroot00000000000000base-15.09/config/ios/src/AJCFGConfigClient.mm000066400000000000000000000156551262264444500207470ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCFGConfigClient.h" #import "alljoyn/config/ConfigClient.h" #import "alljoyn/services_common/AJSVCGenericLoggerAdapter.h" #import "alljoyn/services_common/AJSVCGenericLoggerDefaultImpl.h" #import "alljoyn/about/AJNConvertUtil.h" #import "alljoyn/about/AJNAboutDataConverter.h" #define DEFAULT_SESSION_ID 0 @interface AJCFGConfigClient () @property ajn::services::ConfigClient *handle; @property id currentLogger; @property AJSVCGenericLoggerAdapter *AJSVCGenericLoggerAdapter; @end @implementation AJCFGConfigClient - (void)dealloc { delete self.handle; } - (id)initWithBus:(AJNBusAttachment *)bus { self = [super init]; if (self) { self.handle = new ajn::services::ConfigClient((ajn::BusAttachment&)(*bus.handle)); // Set a default logger self.currentLogger = [[AJSVCGenericLoggerDefaultImpl alloc] init]; // Call setLoger with the adapter and save the prev Logger self.AJSVCGenericLoggerAdapter = new AJSVCGenericLoggerAdapter(self.currentLogger); } return self; } - (QStatus)factoryResetWithBus:(NSString *)busName { return [self factoryResetWithBus:busName sessionId:DEFAULT_SESSION_ID]; } - (QStatus)factoryResetWithBus:(NSString *)busName sessionId:(AJNSessionId)sessionId { return self.handle->FactoryReset([AJNConvertUtil convertNSStringToConstChar:busName], sessionId); } - (QStatus)restartWithBus:(NSString *)busName { return [self restartWithBus:busName sessionId:DEFAULT_SESSION_ID]; } - (QStatus)restartWithBus:(NSString *)busName sessionId:(AJNSessionId)sessionId { return self.handle->Restart([AJNConvertUtil convertNSStringToConstChar:busName], sessionId); } - (QStatus)setPasscodeWithBus:(NSString *)busName daemonRealm:(NSString *)daemonRealm newPasscodeSize:(size_t)newPasscodeSize newPasscode:(const uint8_t *)newPasscode { return [self setPasscodeWithBus:busName daemonRealm:daemonRealm newPasscodeSize:newPasscodeSize newPasscode:newPasscode sessionId:DEFAULT_SESSION_ID]; } - (QStatus)setPasscodeWithBus:(NSString *)busName daemonRealm:(NSString *)daemonRealm newPasscodeSize:(size_t)newPasscodeSize newPasscode:(const uint8_t *)newPasscode sessionId:(AJNSessionId)sessionId { return self.handle->SetPasscode([AJNConvertUtil convertNSStringToConstChar:busName], [AJNConvertUtil convertNSStringToConstChar:daemonRealm], newPasscodeSize, newPasscode, sessionId); } - (QStatus)configurationsWithBus:(NSString *)busName languageTag:(NSString *)languageTag configs:(NSMutableDictionary **)configs { return [self configurationsWithBus:busName languageTag:languageTag configs:configs sessionId:DEFAULT_SESSION_ID]; } - (QStatus)configurationsWithBus:(NSString *)busName languageTag:(NSString *)languageTag configs:(NSMutableDictionary **)configs sessionId:(AJNSessionId)sessionId { std::map tConfigurations; QStatus status = self.handle->GetConfigurations([AJNConvertUtil convertNSStringToConstChar:busName], [AJNConvertUtil convertNSStringToConstChar:languageTag], tConfigurations, sessionId); *configs = [AJNAboutDataConverter convertToAboutDataDictionary:tConfigurations]; return status; } - (QStatus)updateConfigurationsWithBus:(NSString *)busName languageTag:(NSString *)languageTag configs:(NSMutableDictionary **)configs { return [self updateConfigurationsWithBus:busName languageTag:languageTag configs:configs sessionId:DEFAULT_SESSION_ID]; } - (QStatus)updateConfigurationsWithBus:(NSString *)busName languageTag:(NSString *)languageTag configs:(NSMutableDictionary **)configs sessionId:(AJNSessionId)sessionId { std::map tConfigurations; NSEnumerator *enumerator = [*configs keyEnumerator]; id key; // Iterate over the NSMutableDictionary and get the key/value while ((key = [enumerator nextObject])) { // Put key/ value in the std::map AJNMessageArgument *ajnMsgArg = [*configs objectForKey : (key)]; ajn::MsgArg *cppValue = (ajn::MsgArg *)ajnMsgArg.handle; tConfigurations.insert(std::make_pair([AJNConvertUtil convertNSStringToQCCString:key], *cppValue)); } QStatus status = self.handle->UpdateConfigurations([AJNConvertUtil convertNSStringToConstChar:busName], [AJNConvertUtil convertNSStringToConstChar:languageTag], tConfigurations, sessionId); return status; } - (QStatus)resetConfigurationsWithBus:(NSString *)busName languageTag:(NSString *)languageTag configNames:(NSMutableArray *)configNames { return [self resetConfigurationsWithBus:busName languageTag:languageTag configNames:configNames sessionId:DEFAULT_SESSION_ID]; } - (QStatus)resetConfigurationsWithBus:(NSString *)busName languageTag:(NSString *)languageTag configNames:(NSMutableArray *)configNames sessionId:(AJNSessionId)sessionId { std::vector tConfigNames; // Convert NSMutableArray to std::vector for (NSString *tStr in configNames) { tConfigNames.push_back([AJNConvertUtil convertNSStringToQCCString:tStr]); } return self.handle->ResetConfigurations([AJNConvertUtil convertNSStringToConstChar:busName], [AJNConvertUtil convertNSStringToConstChar:languageTag], tConfigNames, sessionId); } - (QStatus)versionWithBus:(NSString *)busName version:(int&)version { return [self versionWithBus:busName version:version sessionId:DEFAULT_SESSION_ID]; } - (QStatus)versionWithBus:(NSString *)busName version:(int&)version sessionId:(AJNSessionId)sessionId { return self.handle->GetVersion([AJNConvertUtil convertNSStringToConstChar:busName], version, sessionId); } #pragma mark - Logger methods - (void)setLogger:(id )logger { if (logger) { // Save current logger self.currentLogger = logger; // Call setLoger with the adapter and save the prev Logger } else { [self.currentLogger warnTag:([NSString stringWithFormat:@"%@", [[self class] description]]) text:@"Failed set a logger"]; } } - (id )logger { return self.currentLogger; } - (void)setLogLevel:(QLogLevel)newLogLevel { [self.currentLogger setLogLevel:newLogLevel]; } - (QLogLevel)logLevel { return [self.currentLogger logLevel]; } @end base-15.09/config/ios/src/AJCFGConfigLogger.mm000066400000000000000000000032161262264444500207360ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCFGConfigLogger.h" #import "alljoyn/services_common/AJSVCGenericLoggerDefaultImpl.h" @interface AJCFGConfigLogger () @property (nonatomic) id klogger; @end @implementation AJCFGConfigLogger + (id)sharedInstance { static AJCFGConfigLogger *configLogger; static dispatch_once_t donce; dispatch_once(&donce, ^{ configLogger = [[self alloc] init]; }); return configLogger; } - (id)init { self = [super init]; return self; } - (void)setLogger:(id )logger { if (logger) { _klogger = logger; } else { _klogger = [[AJSVCGenericLoggerDefaultImpl alloc] init]; } } - (id )logger { return self.klogger; } @end base-15.09/config/ios/src/AJCFGConfigService.mm000066400000000000000000000052601262264444500211200ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCFGConfigService.h" #import "AJNSessionOptions.h" #import "alljoyn/config/ConfigService.h" #import "alljoyn/services_common/AJSVCGenericLoggerAdapter.h" #import "alljoyn/services_common/AJSVCGenericLoggerDefaultImpl.h" @interface AJCFGConfigService () @property ajn::services::ConfigService *handle; @property id currentLogger; @property AJSVCGenericLoggerAdapter *AJSVCGenericLoggerAdapter; @end @implementation AJCFGConfigService - (id)initWithBus:(AJNBusAttachment *)bus propertyStore:(AJCFGPropertyStoreImpl *)propertyStore listener:(AJCFGConfigServiceListenerImpl *)listener { self = [super init]; if (self) { self.handle = new ajn::services::ConfigService((ajn::BusAttachment&)(*bus.handle), *propertyStore.getHandle, *[listener handle]); // Set a default logger self.currentLogger = [[AJSVCGenericLoggerDefaultImpl alloc] init]; // Create and set a generic logger adapter adapter self.AJSVCGenericLoggerAdapter = new AJSVCGenericLoggerAdapter(self.currentLogger); } return self; } - (QStatus)registerService { return self.handle->Register(); } - (void)unregisterService { //self.handle->Unregister(); } #pragma mark - Logger methods - (void)setLogger:(id )logger { if (logger) { // Save the current logger self.currentLogger = logger; // Call setLoger with the adapter and save the prev Logger } else { [self.currentLogger warnTag:([NSString stringWithFormat:@"%@", [[self class] description]]) text:@"Failed set a logger"]; } } - (id )logger { return self.currentLogger; } - (void)setLogLevel:(QLogLevel)newLogLevel { [self.currentLogger setLogLevel:newLogLevel]; } - (QLogLevel)logLevel { return [self.currentLogger logLevel]; } @end base-15.09/config/ios/src/AJCFGConfigServiceListenerImpl.mm000066400000000000000000000025601262264444500234500ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCFGConfigServiceListenerImpl.h" @implementation AJCFGConfigServiceListenerImpl - (void)dealloc { if (self.handle) { delete self.handle; self.handle = NULL; } } - (id)initWithConfigServiceListener:(id )configServiceListener { self = [super init]; if (self) { self.handle = new AJCFGConfigServiceListenerImplAdapter(configServiceListener); } return self; } @end base-15.09/config/ios/src/AJCFGPropertyStoreImpl.mm000066400000000000000000000255561262264444500220670ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCFGPropertyStoreImpl.h" #import "alljoyn/about/AJNAboutServiceApi.h" #import "alljoyn/about/AJNAboutDataConverter.h" #define DEFAULT_LANGUAGE_STR @"DefaultLanguage" #define DEVICE_NAME_STR @"DeviceName" #define DEVICE_ID_STR @"DeviceId" #define PASS_CODE_STR @"passcode" @interface AJNMessageArgument (Private) @property (nonatomic, readonly) ajn::MsgArg *msgArg; @end @interface AJCFGPropertyStoreImpl () @property (strong, nonatomic) NSDictionary *factoryProperties; @end @implementation AJCFGPropertyStoreImpl - (id)initPointerToFactorySettingFile:(NSString *)filePath { self = [super initWithHandleAllocationBlock: ^{ return (ajn::services::AboutPropertyStoreImpl *)new PropertyStoreImplAdapter(self); }]; if (self) { self.factoryProperties = [NSDictionary dictionaryWithContentsOfFile:filePath]; } return self; } - (void)factoryReset { // Clean the NSUserDefaults [[NSUserDefaults standardUserDefaults] removeObjectForKey:DEFAULT_LANGUAGE_STR]; [[NSUserDefaults standardUserDefaults] removeObjectForKey:DEVICE_NAME_STR]; [[NSUserDefaults standardUserDefaults] removeObjectForKey:DEVICE_ID_STR]; [[NSUserDefaults standardUserDefaults] removeObjectForKey:PASS_CODE_STR]; [[NSUserDefaults standardUserDefaults] synchronize]; // Set the values from the factory store [self setDefaultLang:nil]; [self setDeviceId:@"1231232145667745675477"]; [self setPasscode:nil]; NSDictionary *deviceNames = [self.factoryProperties objectForKey:DEVICE_NAME_STR]; for (NSString *lang in [deviceNames allKeys]) { [self setDeviceName:nil language:lang]; } } - (QStatus)populateWritableMsgArgs:(const char *)languageTag ajnMsgArg:(AJNMessageArgument **)all { QStatus status; ajn::MsgArg *msgArg = new ajn::MsgArg; status = ((PropertyStoreImplAdapter *)[super getHandle])->populateWritableMsgArgs(languageTag, *msgArg); *all = [[AJNMessageArgument alloc] initWithHandle:msgArg]; return status; } - (QStatus)readAll:(const char *)languageTag withFilter:(PFilter)filter ajnMsgArg:(AJNMessageArgument **)all; { QStatus status; if (filter != WRITE) return ER_FAIL; if (languageTag[0]=='\0' || languageTag[0] == ' ') { languageTag = [[self getPersistentValue:DEFAULT_LANGUAGE_STR forLanguage:@""] UTF8String]; } if ([self isLanguageSupported:languageTag] != ER_OK) { return ER_LANGUAGE_NOT_SUPPORTED; } else { AJNPropertyStoreProperty *defaultLang = [self property:DEFAULT_LANG]; if (defaultLang == nil) return ER_LANGUAGE_NOT_SUPPORTED; } status = [self populateWritableMsgArgs:languageTag ajnMsgArg:all]; return status; } - (QStatus)Update:(const char *)name languageTag:(const char *)languageTag ajnMsgArg:(AJNMessageArgument *)value { if ([self isLanguageSupported:languageTag] != ER_OK) { [[[AJCFGConfigLogger sharedInstance] logger] debugTag:@"PropertyStoreImplAdapter" text:[NSString stringWithFormat:@"Language tag is invalid! [%s].", languageTag]]; } // Get the enum value for the property name AJNPropertyStoreKey key_code = [self getPropertyStoreKeyFromName:name]; if (key_code == NUMBER_OF_KEYS) { return ER_BAD_ARG_1; } AJNPropertyStoreProperty *property = NULL; if (key_code == DEVICE_NAME) { // Check if this property is writable property = [self property:key_code withLanguage:[NSString stringWithUTF8String:languageTag]]; } else { property = [self property:key_code]; } if (!property) { return ER_INVALID_VALUE; } if (![property isWritable]) return ER_INVALID_VALUE; if (key_code != DEVICE_NAME) { //only DEVICE_NAME is language sensitive.. this should change if other persistant variables become language specific languageTag = ""; } // Erase the property from the property store in memory ((PropertyStoreImplAdapter *)[super getHandle])->updatePropertyAccordingToPropertyCode((ajn::services::PropertyStoreKey)key_code, languageTag, [value msgArg]); NSString *key = [NSString stringWithCString:name encoding:NSUTF8StringEncoding]; char *msgarg_value; [value value:@"s", &msgarg_value]; // Update entries are assumed to be strings. NSString *msgArgValue = [NSString stringWithUTF8String:msgarg_value]; // Update the entry from the NSUserDefaults persistant storage NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; NSDictionary *newValue = @{ [NSString stringWithUTF8String:languageTag]:msgArgValue }; // default is @"" [userDefaults setObject:newValue forKey:key]; [userDefaults synchronize]; // Persist return [[AJNAboutServiceApi sharedInstance] announce]; } - (AJNPropertyStoreKey)getPropertyStoreKeyFromName:(const char *)propertyStoreName { NSArray *QASPropertyStoreName = @[@"DeviceId", @"DeviceName", @"AppId", @"AppName", @"DefaultLanguage", @"SupportedLanguages", @"Description", @"Manufacturer", @"DateOfManufacture", @"ModelNumber", @"SoftwareVersion", @"AJSoftwareVersion", @"HardwareVersion", @"SupportUrl", @""]; for (int indx = 0; indx < NUMBER_OF_KEYS; indx++) { if ([QASPropertyStoreName[indx] isEqualToString:[NSString stringWithUTF8String:propertyStoreName]] == YES) return (AJNPropertyStoreKey)indx; } return NUMBER_OF_KEYS; } - (QStatus)reset:(const char *)name languageTag:(const char *)languageTag { if ([self isLanguageSupported:languageTag] != ER_OK) { [[[AJCFGConfigLogger sharedInstance] logger] debugTag:@"PropertyStoreImplAdapter" text:[NSString stringWithFormat:@"Language tag is invalid! [%s].", languageTag]]; return ER_INVALID_VALUE; } // Get the enum value for the property name AJNPropertyStoreKey key_code = [self getPropertyStoreKeyFromName:name]; if (key_code == NUMBER_OF_KEYS) { return ER_BAD_ARG_1; } // Check if this property is writable AJNPropertyStoreProperty *property = [self property:key_code withLanguage:[NSString stringWithUTF8String:languageTag]]; if (![property isWritable]) return ER_INVALID_VALUE; // Erase the property from the property store in memory ((PropertyStoreImplAdapter *)[super getHandle])->erasePropertyAccordingToPropertyCode((ajn::services::PropertyStoreKey)key_code, languageTag); NSString *key = [NSString stringWithUTF8String:name]; // Remove the entry from the NSUserDefaults persistant storage [[NSUserDefaults standardUserDefaults] removeObjectForKey:key]; [[NSUserDefaults standardUserDefaults] synchronize]; // Reset to factory setting and set the property: switch (key_code) { case DEVICE_ID: [self setDeviceId:nil]; break; case DEVICE_NAME: [self setDeviceName:nil language:[NSString stringWithUTF8String:languageTag]]; break; case DEFAULT_LANG: [self setDefaultLang:nil]; break; default: return ER_FEATURE_NOT_AVAILABLE; } return [[AJNAboutServiceApi sharedInstance] announce]; } - (NSString *)getPersistentValue:(NSString *)key forLanguage:(NSString *)language { NSDictionary *dict = [[NSUserDefaults standardUserDefaults] dictionaryForKey:key]; return [dict objectForKey:language]; // The default language is the empty key, @"" } - (void)updateUserDefaultsValue:(NSString *)value usingKey:(NSString *)key forLanguage:(NSString *)language { // Set the user defaults with the new value NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; NSDictionary *newValue = @{ language:value }; [userDefaults setObject:newValue forKey:key]; // Add the default language representation, this is what we support for now. [userDefaults synchronize]; // Persist } - (NSString *)lookForValue:(NSString *)value accordingToKey:(NSString *)key forLanguage:(NSString *)language { NSString *val = value; if (!val) { val = [self getPersistentValue:key forLanguage:language]; if (!val) { val = [[self.factoryProperties objectForKey:key] objectForKey:language]; } } else { [self updateUserDefaultsValue:val usingKey:key forLanguage:language]; } return val; } - (QStatus)setDefaultLang:(NSString *)defaultLang { NSString *val = [self lookForValue:defaultLang accordingToKey:DEFAULT_LANGUAGE_STR forLanguage:@""]; if (val) { QStatus status = [super setDefaultLang:val]; if (status == ER_OK) { [self updateUserDefaultsValue:val usingKey:DEFAULT_LANGUAGE_STR forLanguage:@""]; } return status; } return ER_BAD_ARG_1; } - (QStatus)setDeviceName:(NSString *)deviceName language:(NSString *)language { NSString *val = [self lookForValue:deviceName accordingToKey:DEVICE_NAME_STR forLanguage:language]; if (val) { QStatus status = [super setDeviceName:val language:language]; if (status == ER_OK) { [self updateUserDefaultsValue:val usingKey:DEVICE_NAME_STR forLanguage:language]; } return status; } return ER_BAD_ARG_1; } - (QStatus)setDeviceId:(NSString *)deviceId { NSString *val = [self lookForValue:deviceId accordingToKey:DEVICE_ID_STR forLanguage:@""]; if (val) { QStatus status = [super setDeviceId:val]; if (status == ER_OK) { [self updateUserDefaultsValue:val usingKey:DEVICE_ID_STR forLanguage:@""]; } return status; } return ER_BAD_ARG_1; } // The passcode is not stored in the property store, just the NSUserDefaults. - (QStatus)setPasscode:(NSString *)passCode { if (!passCode) { passCode = [[self.factoryProperties objectForKey:PASS_CODE_STR] objectForKey:@""]; } [self updateUserDefaultsValue:passCode usingKey:PASS_CODE_STR forLanguage:@""]; return ER_OK; } - (NSString *)getPasscode { NSString *val = [self lookForValue:nil accordingToKey:PASS_CODE_STR forLanguage:@""]; return val; } - (QStatus)isLanguageSupported:(const char *)language { return ((PropertyStoreImplAdapter *)[self getHandle])->isLanguageSupported_Public_Adapter(language); } - (long)getNumberOfProperties { return ((PropertyStoreImplAdapter *)[self getHandle])->getNumberOfProperties(); } @end base-15.09/config/java/000077500000000000000000000000001262264444500146415ustar00rootroot00000000000000base-15.09/config/java/.classpath000066400000000000000000000005341262264444500166260ustar00rootroot00000000000000 base-15.09/config/java/.project000066400000000000000000000005641262264444500163150ustar00rootroot00000000000000 ConfigService org.eclipse.jdt.core.javabuilder org.eclipse.jdt.core.javanature base-15.09/config/java/SConscript000066400000000000000000000032651262264444500166610ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('config_env') if config_env.has_key('_ALLJOYN_JAVA_'): config_env.Append(JAVACLASSPATH = [ str(config_env.File('$DISTDIR/java/jar/alljoyn.jar')), str(config_env.File('$DISTDIR/java/jar/alljoyn_about.jar')) ]) config_env['dep_jars'] = [ '$DISTDIR/java/jar/alljoyn.jar', '$DISTDIR/java/jar/alljoyn_about.jar' ] else: config_env.Append(JAVACLASSPATH = [ str(config_env.File('$ALLJOYN_DISTDIR/java/jar/alljoyn.jar')), str(config_env.File('$ALLJOYN_DISTDIR/java/jar/alljoyn_about.jar')) ]) config_env['dep_jars'] = [ ] jars = [] jars += config_env.SConscript('src/SConscript', exports = ['config_env']), if config_env['BUILD_SERVICES_SAMPLES'] == 'on': jars += config_env.SConscript('samples/SConscript', exports = ['config_env']) config_env.Install('$DISTDIR/config/jar', jars) base-15.09/config/java/build.xml000066400000000000000000000062741262264444500164730ustar00rootroot00000000000000 AllJoyn™ Config Service Version 15.09.00]]> AllJoyn™ Config Service Java API Reference Manual Version 15.09.00
Copyright AllSeen Alliance, Inc. All Rights Reserved.

AllSeen, AllSeen Alliance, and AllJoyn are trademarks of the AllSeen Alliance, Inc in the United States and other jurisdictions.

THIS DOCUMENT AND ALL INFORMATION CONTAIN HEREIN ARE PROVIDED ON AN "AS-IS" BASIS WITHOUT WARRANTY OF ANY KIND.
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
]]>
base-15.09/config/java/samples/000077500000000000000000000000001262264444500163055ustar00rootroot00000000000000base-15.09/config/java/samples/SConscript000066400000000000000000000022751262264444500203250ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('config_env') sample_env = config_env.Clone() sample_env.Append(JAVACLASSPATH = str(config_env.File('$DISTDIR/config/jar/alljoyn_config.jar'))) sample_env['dep_jars'].append('$DISTDIR/config/jar/alljoyn_config.jar') if sample_env['OS'] == 'linux' or sample_env['OS_GROUP'] == 'windows': jars = sample_env.SConscript('java/SConscript', exports = ['sample_env']) else: jars = [] Return('jars') base-15.09/config/java/samples/java/000077500000000000000000000000001262264444500172265ustar00rootroot00000000000000base-15.09/config/java/samples/java/ConfigClientSample/000077500000000000000000000000001262264444500227345ustar00rootroot00000000000000base-15.09/config/java/samples/java/ConfigClientSample/.classpath000066400000000000000000000007331262264444500247220ustar00rootroot00000000000000 base-15.09/config/java/samples/java/ConfigClientSample/.project000066400000000000000000000015201262264444500244010ustar00rootroot00000000000000 ConfigClient com.android.ide.eclipse.adt.ResourceManagerBuilder com.android.ide.eclipse.adt.PreCompilerBuilder org.eclipse.jdt.core.javabuilder com.android.ide.eclipse.adt.ApkBuilder com.android.ide.eclipse.adt.AndroidNature org.eclipse.jdt.core.javanature base-15.09/config/java/samples/java/ConfigClientSample/AndroidManifest.xml000066400000000000000000000044731262264444500265350ustar00rootroot00000000000000 base-15.09/config/java/samples/java/ConfigClientSample/build.xml000066400000000000000000000104211262264444500245530ustar00rootroot00000000000000 base-15.09/config/java/samples/java/ConfigClientSample/project.properties000066400000000000000000000010641262264444500265210ustar00rootroot00000000000000# 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 base-15.09/config/java/samples/java/ConfigClientSample/res/000077500000000000000000000000001262264444500235255ustar00rootroot00000000000000base-15.09/config/java/samples/java/ConfigClientSample/res/drawable-xhdpi/000077500000000000000000000000001262264444500264205ustar00rootroot00000000000000base-15.09/config/java/samples/java/ConfigClientSample/res/drawable-xhdpi/ic_launcher.png000066400000000000000000000030601262264444500314010ustar00rootroot00000000000000‰PNG  IHDR``múŕotRNSn¦‘ pHYs  šśĐIDATxśí[ßKKIB’Ză5M–5”B@®DZš¶ĐČ­ ÔŢ(jąÚŢ<Ôţ B –˘/•‹6f”\1:n||Őů,u‰ŰźÄ5˘)áNkúľHeÓO[M)i(sĹĽÔ…F …Đi8˘0ˇ÷°C­ť…‘LĆé4˘ÉĐŁ€· €qnąľz¦V ÔL† ?ţřŞx‚–ϡ–ňd¸ €QÜÚYH¸ÓŠ•q3Š[­ČZ8‹´QU‡¬ĺł¨Zžp Řl–µvDš8!ĺIhA ĚÚY€Y>‡rE}ű¸sŇ…Y;`Ëçh™@*Ö΂T@łZ VŁŞuË·B VŁŞ~'°¬ťş†Ť«@ŕŘ%DËŹ@ \kgA°“µN ńFUľ5l<^–ęŠĺHźµłŔZĂZ*V쇺囿,ŐĹ€fH Ö΂J'kN ‘e©>¨Xľ ÔUu€š ÔUu€-_»@˛ËR}€u˛Ú2oí,ŔÖ°z2»Ä°|ŤEhíČZľFt4Şę]ĂęČ|쇔ĺëČkgAj «E äFµ^#­M2‹©¸¸ĺă „¸,%N‰´6I{ű'ßż$N ĺ‹w˛řáXűřyńě·4^6I2ˇ~ßżĆaYšLzŤěn«Cą»EîU•®Bł|dTŐŰĺ3ĹgkSńĉ4L”¬}|Ś4WEĄńňĹ32>ľl¨ĺc \–Ň3Ć{âęŔw C;Y4€Ö>[ 7âlm’ŰeŔ-đŽ@Řu3Ź…cqw+ýĎš„@“w˙ĽBęüŇ(ńđľ¨@„©rěˇXÄ Â%žĐ”Â% ±{n!´ŘfĂ’6Cť «‘0Dއ©iťÍ…¦-…n6W±^CŚÂö+52°ż’Ü iŔřĄIm—Ź §dŃ`Â{˙ Ć–…,J.Ł@„˝<1‡áfVţE;``_¦üň™Đ”Q^_´č剉Ä`(ĺ NAa3Ŕĺ ~Aa3¤2ŠĆ‚Âf–'ě®8ĺ‰é‚ÂfĚVS yô˙u#ú‚b˙÷dş ÖŇ˦IEND®B`‚base-15.09/config/java/samples/java/ConfigClientSample/res/drawable/000077500000000000000000000000001262264444500253065ustar00rootroot00000000000000base-15.09/config/java/samples/java/ConfigClientSample/res/drawable/ic_launcher.png000066400000000000000000000022661262264444500302760ustar00rootroot00000000000000‰PNG  IHDR00Ř`nĐtRNSn¦‘ pHYs  šśVIDATX…ĹŘ˙OgđŹwpx|)0J@ËIgç÷ŮŽ´ŐÚŽZ­q~I§…)ł˛)hĄÖ2uD«d_šn]Ú™&6´I­#kfÚTčKš41áoÚgŻ78îîĐOŢ?qĎ}î%Ü=÷<QJَEEi%´p•˘Ţá›AóO?+ťÎ٤ Ô9வٺůâ>*AŹ}î"’)ÓÚĚb9Mő™úąí»±t"–NÔ´¶Vüň+‘LŻ÷ôŞTEg1z7n”X:ńí?R‡J"™"s⯄¦§·¸7–LŽwOyÖŢ=Ł4ëű;ŮĚô1ÇĂ7(‘LUnnĘŠ˘i齸´÷˘éź÷g “hµ'ţ~A7É”qi3™DŁTÖ9‚ńX%–NDßlá*EöxíŐ« "™˛ż|ĄóůDŃt#«ˇl 瀛ń,ì[ŹłMD2Uµý\ÝÁ|GIeklčöۧą4sŰwQIÎVyö#LĹ˝{xMMšF÷ů[»rQČTź©gobŢŘ`1ÉÔń› ­–brŘ&®°Sbé„w#ĚůWÉl6âő»ÉţĎ®vtÁ0ćť‘őýNÍÚ»gş #' Á;Ś-ţ„ůĽĆ㻉ĄÝS>@•Ęě)€1ňz¦ąŠhiď‘LžÇŁ«éë+.¨Ą÷ ” hĺź›Ĺ㱼4dÉ›š‹ެsÓęŞř /WC…i3™ě/_‰ şýö©Ć +şńq1A®±A!@•ĘŞíçâ€ní>ĘrL¦ů”ş«[PŁűĽp Y–ßď ]{¸"–đÚZA őý“ĂĆ}ťę*ŽAg;ड़cŤ‘  -~ÇŃľĽ Fűa%|ů4śb?C˘×gOĽ@+˙ĆeÇr6–JŔŐ Ëł4T&ľ3Űr Üë-tÁÓ—łeÝÇp}‚B%:W:@!g<Á0[üI~ r3Ę0H_ľa6 =‘i8Ý’ÝFŐ~1?ĐÉłM™‡ńRčl‡č_ •)XÍŮ—;ŘćňŤ˙¶y¬áĚň¦Đ3xÔ*zËR‡Ză˛27Łf#řGQ¨,† í3J¨Ţ†ŮëÜ žĐ×~Ł+…üFě™ńCuyj››t°E8Ý ß‹LˇÇ3ĺeđ~››äpĹ“Ţ"R¨,Ď‚«µDŽ[·3ş&ˇžĂ ĐžTř<Ě ¬ľ“‡ Z ĂŕeDŁfH%péó ˇ™ô2NQYĄVÁpoq)óhŞĺAˇ—Ő\”»{y:Úř,TrÔ§őBçhzŢ?í /…Ž6ˇ3ä”ěVÁz•—g JdśÍŚď|1Ęn…ŕ_Jtz\nž… ŕl†Č4‡Ć7 }‘)ôbyőÎřá¤ý)ô2č˙·€ŚLg,0ލ>qŔŚľč¦[ç[˙Ů´oăźpHIEND®B`‚base-15.09/config/java/samples/java/ConfigClientSample/res/layout/000077500000000000000000000000001262264444500250425ustar00rootroot00000000000000base-15.09/config/java/samples/java/ConfigClientSample/res/layout/bus_description_property.xml000066400000000000000000000047071262264444500327340ustar00rootroot00000000000000 base-15.09/config/java/samples/java/ConfigClientSample/res/layout/config_layout.xml000066400000000000000000000115231262264444500304300ustar00rootroot00000000000000 TurnFanOff false true Turn fan off ? 0x789 base-15.09/controlpanel/cpp/tools/CPSAppGenerator/SampleXMLs/testContainerInContainer.xml000066400000000000000000000127531262264444500315250ustar00rootroot00000000000000 MyDevice #include "ControlPanelProvided.h" en rootContainer false true 0x200 vertical_linear fanSpeedProperty getint32Var setint32Var(%s) false false false 0x350 RPM childContainer false true 0x200 horizontal_linear heatProperty getuint16Var setuint16Var(%s) false true true 0x500 spinner Regular 175 Hot 200 Very Hot 225 Degrees base-15.09/controlpanel/cpp/tools/CPSAppGenerator/SampleXMLs/testDateTimeProperties.xml000066400000000000000000000051121262264444500312110ustar00rootroot00000000000000 MyDevice #include "ControlPanelProvided.h" http://MyControlPanelUrl.com en rootContainer false true 0x200 horizontal_linear myDateProperty getDateProperty setDateProperty(%s) false true true myTimeProperty getTimeProperty setTimeProperty(%s) false true true base-15.09/controlpanel/cpp/tools/CPSAppGenerator/SampleXMLs/testListProperty.xml000066400000000000000000000126641262264444500301320ustar00rootroot00000000000000 MyDevice #include "ControlPanelProvided.h" en rootContainer false true 0x200 vertical_linear alarmListProperty false true 0x500 dynamicspinner getLPNumRecords getLPRecordIdByIndx getLPRecordNameByIndx viewLPRecord updateLPRecord deleteLPRecord addLPRecord confirmLPRecord cancelLPRecord recordNameStringProperty getLPRecordName setLPRecordName(%s) false true true listPropContainer false true 0x200 vertical_linear heatProperty getLPuint16Var setLPuint16Var(%s) false true true 0x500 ovenAction AJ_Printf("Starting the Oven. Execute was called\n"); false true 0x400 actionButton base-15.09/controlpanel/cpp/tools/CPSAppGenerator/SampleXMLs/testNotificationActions.xml000066400000000000000000000114361262264444500314150ustar00rootroot00000000000000 MyDevice #include "ControlPanelProvided.h" en areYouSure false true Are you sure? 0x789 rootContainer false true 0x200 vertical_linear heatProperty getuint16Var setuint16Var(%s) false true true 0x500 spinner Regular 175 Hot 200 Very Hot 225 Degrees ovenAction AJ_Printf("Starting the Oven. Execute was called\n"); false true 0x400 actionButton base-15.09/controlpanel/cpp/tools/CPSAppGenerator/SampleXMLs/testOneActionSecured.xml000066400000000000000000000047601262264444500306420ustar00rootroot00000000000000 MyDevice #include "ControlPanelProvided.h" http://MyControlPanelUrl.com en rootContainer true true 0x200 horizontal_linear ovenAction AJ_Printf("Starting the Oven. Execute was called\n"); true true 0x400 actionButton base-15.09/controlpanel/cpp/tools/CPSAppGenerator/SampleXMLs/testOneOfEachWidget.xml000066400000000000000000000270121262264444500303760ustar00rootroot00000000000000 MyDevice #include "ControlPanelProvided.h" en de-AT zh-Hans-CN rootContainer false true 0x200 vertical_linear horizontal_linear CurrentTemp true 0x98765 textlabel heatProperty getuint16Var setuint16Var(%s) false true true 0x500 spinner Regular Normal UNICODE_REGULAR 175 Hot Heiss UNICODE_HOT 200 Very Hot Sehr Heiss UNICODE_VERY_HOT 225 Degrees Grad UNICODE_DEGREES ovenAction AJ_Printf("Starting the Oven. Execute was called\n"); false true 0x400 actionButton lightAction LightConfirm false true Are you sure you want to turn on the light Are you sure you want to turn on the light UNICODE_ARE_YOU_SURE_YOU_WANT_TO_TURN_OFF_THE_LIGHT 0x789 alertdialog false true 0x400 actionButton areYouSure false true Are you sure? Sind sie sicher? UNICODE_ARE_YOU_SURE 0x789 base-15.09/controlpanel/cpp/tools/CPSAppGenerator/SampleXMLs/testOnePropertyOneAction.xml000066400000000000000000000107161262264444500315340ustar00rootroot00000000000000 MyDevice #include "ControlPanelProvided.h" http://MyControlPanelUrl.com en rootContainer false true 0x200 vertical_linear heatProperty getuint16Var setuint16Var(%s) false true true 0x500 spinner Regular 175 Hot 200 Very Hot 225 Degrees ovenAction AJ_Printf("Starting the Oven. Execute was called\n"); false true 0x400 actionButton base-15.09/controlpanel/cpp/tools/CPSAppGenerator/SampleXMLs/testStringAndUnicodeProperty.xml000066400000000000000000000047331262264444500324150ustar00rootroot00000000000000 MyDevice #include "ControlPanelProvided.h" heb chi rootContainer false true 0x200 vertical_linear unicodeStringProperty getStringVar setStringVar(%s) false true true 0x500 edittext base-15.09/controlpanel/cpp/tools/CPSAppGenerator/cp.xsd000066400000000000000000000504551262264444500231650ustar00rootroot00000000000000 base-15.09/controlpanel/cpp/tools/CPSAppGenerator/generateCPSApp.py000066400000000000000000000116361262264444500252140ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # import sys import os import os.path import subprocess import xml.etree.ElementTree as xml scriptDir = os.path.dirname(os.path.realpath(__file__)) sys.path.append( scriptDir + "/GeneratorUtils" ) import xml2objects import generatedCode as gen import containerWidget as cw import dialogWidget as dw import commonWidget as common import httpControl as http import cpvalidate from optparse import OptionParser ## ERROR CODES ## ## 1 : missing command line arguments ## 2 : Did not pass xsd validation ## 3 : Did not pass logical validation ## 4 : Other error ### Start by validating the input and the xml ### parser = OptionParser() parser.add_option("-p", "--path", dest="path", default=scriptDir + "/../../samples/generated/", help="destination path for generated files") (options, args) = parser.parse_args() path = options.path generated = gen.Generator(scriptDir, path) generated.confirmGenerate() generated.initializeFiles() if len(args) < 1 : print >> sys.stderr, "ERROR - Please provide the xml file as input" sys.exit(1) for i in range(0, len(args)) : xmlfile = args[i] print "\nProcessing xmlfile: " + xmlfile + "\n" if sys.platform != 'win32': cpFile = os.path.join(scriptDir, "cp.xsd") subprocArgs = "xmllint --noout --schema {0} {1}".format(cpFile, xmlfile) rc = subprocess.call(subprocArgs, shell=True) if rc != 0 : print >> sys.stderr, "\nERROR - xml xsd validation did not pass" sys.exit(2) print "\nxml xsd validation passed" else: # There is no pure python way to easily do this print "\nWARNING - skipping xml validation as xmllint is not available on this platform" ### Initialize the generated structure ### o = xml2objects.ObjectBuilder(xmlfile) if not cpvalidate.validate_all(o.root): print >> sys.stderr, "\nERROR - logic xml validation did not pass" sys.exit(3) print "\nxml logic validation passed" generated.setControlDeviceData(o.root.controlPanelDevice.name, o.root.controlPanelDevice.headerCode) generated.setLanguageSets(o.root.controlPanelDevice.languageSet) ### Get and process HttpControlElements if hasattr(o.root.controlPanelDevice, "url") : httpControl = http.HttpControl(generated, o.root.controlPanelDevice.url) httpControl.generate() ### Get and process all ControlPanels if hasattr(o.root.controlPanelDevice, "controlPanels") : for cp in o.root.controlPanelDevice.controlPanels.controlPanel : generated.addControlPanel(cp.rootContainer, cp.attr["languageSet"]) parentName = generated.unitName + cp.rootContainer.name[:1].upper() + cp.rootContainer.name[1:] + "ControlPanel" container = cw.Container(generated, cp.rootContainer, parentName, cp.attr["languageSet"], 1) container.generate() ### Get and process all NotificationAction if hasattr(o.root.controlPanelDevice, "notificationActions") : if hasattr(o.root.controlPanelDevice.notificationActions, "dialog") : for notDialog in o.root.controlPanelDevice.notificationActions.dialog : generated.addNotificationAction(notDialog, notDialog.attr["languageSet"]) parentName = generated.unitName + notDialog.name[:1].upper() + notDialog.name[1:] + "NotificationAction" dialog = dw.Dialog(generated, notDialog, parentName, notDialog.attr["languageSet"], 1) dialog.generate() if hasattr(o.root.controlPanelDevice.notificationActions, "container") : for notContainer in o.root.controlPanelDevice.notificationActions.container : generated.addNotificationAction(notContainer, notContainer.attr["languageSet"]) parentName = generated.unitName + notContainer.name[:1].upper() + notContainer.name[1:] + "NotificationAction" container = cw.Container(generated, notContainer, parentName, notContainer.attr["languageSet"], 1) container.generate() ### Finish up merging all the different components ### generated.replaceInFiles() generated.writeFiles() sys.exit(0) base-15.09/controlpanel/cpp/tools/CPSAppGenerator/integratedXmlToCode.sh000077500000000000000000000020501262264444500262730ustar00rootroot00000000000000#!/bin/bash # Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # echo "Generating code for" "$@" INITIAL_DIR=`pwd` # Save current dir cd `dirname $0` # Go to script dir python generateCPSApp.py "$@" -p ../../../../sample_apps/cpp/samples/ServerSample/generated/ retval=$? cd ${INITIAL_DIR} exit $retval base-15.09/controlpanel/cpp/tools/CPSAppGenerator/sampleGenerate.sh000077500000000000000000000020401262264444500253210ustar00rootroot00000000000000#!/bin/bash # Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # echo "Generating code for testOneOfEachWidget.xml" INITIAL_DIR=`pwd` # Save current dir cd `dirname $0` # Go to script dir python generateCPSApp.py SampleXMLs/testOneOfEachWidget.xml -p ../../samples/generated/ cd ${INITIAL_DIR} base-15.09/controlpanel/cpp/tools/CPSAppGenerator/xmlToCode.sh000077500000000000000000000020061262264444500242650ustar00rootroot00000000000000#!/bin/bash # Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # echo "Generating code for" "$@" INITIAL_DIR=`pwd` # Save current dir cd `dirname $0` # Go to script dir python generateCPSApp.py "$@" -p ../../samples/generated/ retval=$? cd ${INITIAL_DIR} exit $retval base-15.09/controlpanel/ios/000077500000000000000000000000001262264444500157455ustar00rootroot00000000000000base-15.09/controlpanel/ios/inc/000077500000000000000000000000001262264444500165165ustar00rootroot00000000000000base-15.09/controlpanel/ios/inc/alljoyn/000077500000000000000000000000001262264444500201665ustar00rootroot00000000000000base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/000077500000000000000000000000001262264444500226665ustar00rootroot00000000000000base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSAction.h000066400000000000000000000024741262264444500250440ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/controlpanel/Action.h" #import "AJCPSWidget.h" /** * AJCPSAction Class is used to display a Button. */ @interface AJCPSAction : AJCPSWidget - (id)initWithHandle:(ajn ::services ::Action *)handle; /** * Call to execute this Action remotely * @return ER_OK if successful. */ - (QStatus)executeAction; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSActionWithDialog.h000066400000000000000000000032171262264444500270140ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/controlpanel/ActionWithDialog.h" #import "AJCPSWidget.h" #import "AJCPSDialog.h" /** * AJCPSActionWithDialog is used to display a Button. * Upon pressing the button a Dialog is displayed on the Controller side. */ @interface AJCPSActionWithDialog : AJCPSWidget - (id)initWithHandle:(ajn ::services ::ActionWithDialog *)handle; /** * Get the ChildDialog of the Action * @return dialog */ - (AJCPSDialog *)getChildDialog; /** * Unregister the BusObjects for this and children Widgets * @param bus - the bus used to unregister the busObjects * @return status - success/failure */ - (QStatus)unregisterObjects:(AJNBusAttachment *)bus; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSCPSButtonCell.h000066400000000000000000000022501262264444500262400ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJCPSAction.h" @interface CPSButtonCell : UITableViewCell @property (strong, nonatomic) UIButton *cpsButton; //TOD strong @property (weak, nonatomic) AJCPSAction *actionWidget; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSCPSDate.h000066400000000000000000000035601262264444500250470ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/controlpanel/CPSDate.h" /** * AJCPSCPSDate allows sending of a Date as a Property */ @interface AJCPSCPSDate : NSObject - (id)initWithDay:(uint16_t) day month:(uint16_t) month year:(uint16_t) year; - (id)initWithHandle:(ajn ::services ::CPSDate *)handle; /** * Get the day value of the date * @return day value */ - (uint16_t)getDay; /** * Set the day Value of the date * @param day value */ - (void)setDay:(uint16_t)day; /** * Get the Month value of the date * @return month value */ - (uint16_t)getMonth; /** * Set the Month value of the date * @param month value */ - (void)setMonth:(uint16_t)month; /** * Get the Year value of the date * @return year value */ - (uint16_t)getYear; /** * Set the Year value of the date * @param year value */ - (void)setYear:(uint16_t)year; @property (nonatomic, readonly)ajn::services::CPSDate * handle; @endbase-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSCPSGeneralCell.h000066400000000000000000000024511262264444500263450ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJCPSWidget.h" #import "AJCPSControllerModel.h" @interface CPSGeneralCell : UITableViewCell @property (strong, nonatomic) UILabel *widgetNameLabel; @property (strong, nonatomic) UILabel *widgetDetailsLabel; @property (strong, nonatomic) UILabel *hintLabel; @property (weak, nonatomic) AJCPSWidget *widget; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSCPSTime.h000066400000000000000000000035221262264444500250660ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/controlpanel/CPSTime.h" /** * AJCPSCPSTime allows sending of a Time as a Property */ @interface AJCPSCPSTime : NSObject - (id)initWithHour:(uint16_t) hour minute:(uint16_t) minute second:(uint16_t) second; - (id)initWithHandle:(ajn ::services ::CPSTime *)handle; /** * Get the hour value of the date * @return hour value */ - (uint16_t)getHour; /** * Set the hour Value of the date * @param hour value */ - (void)setHour:(uint16_t)hour; /** * Get the Minute value of the date * @return minute value */ - (uint16_t)getMinute; /** * Set the Minute value of the date * @param minute value */ - (void)setMinute:(uint16_t)minute; /** * Get the Second value of the date * @return second value */ - (uint16_t)getSecond; /** * Set the Second value of the date * @param second value */ - (void)setSecond:(uint16_t)second; @endbase-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSConstraintList.h000066400000000000000000000045451262264444500266100ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/controlpanel/ConstraintList.h" #import "AJCPSControlPanelEnums.h" /** * ConstraintValue - a union combining all possible values * that can make up a constraint */ typedef union { /** * Value for uint16_t */ uint16_t uint16Value; /** * Value for int16_t */ int16_t int16Value; /** * Value for uint32_t */ uint32_t uint32Value; /** * Value for int32_t */ int32_t int32Value; /** * Value for uint64_t */ uint64_t uint64Value; /** * Value for int64_t */ int64_t int64Value; /** * Value for double */ double doubleValue; /** * Value for const char* */ const char* charValue; } AJCPSConstraintValue; /** * AJCPSConstraintList defines a list of * Values and constrain a property to those values. * The Constraint is applied on the controller side. * No validations are done in the Controllee */ @interface AJCPSConstraintList : NSObject - (id)initWithHandle:(ajn ::services ::ConstraintList *)handle; /** * Get the Constraint Value * @return the Constraint Value */ - (AJCPSConstraintValue)getConstraintValue; /** * Get the Property Type of the Constraint * @return propertyType of the Constraint */ - (AJCPSPropertyType)getPropertyType; /** * Get the Display * @return Display Value */ - (NSString *)getDisplay; @endbase-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSConstraintRange.h000066400000000000000000000041751262264444500267300ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/controlpanel/ConstraintRange.h" #import "AJCPSControlPanelEnums.h" typedef union { /** * Value of type uint16_t */ uint16_t uint16Value; /** * Value of type int16_t */ int16_t int16Value; /** * Value of type uint32_t */ uint32_t uint32Value; /** * Value of type int32_t */ int32_t int32Value; /** * Value of type uint64_t */ uint64_t uint64Value; /** * Value of type int64_t */ int64_t int64Value; /** * Value of type double */ double doubleValue; } AJCPSConstraintRangeVal; /** * AJCPSConstraintRange defines a range of * Values and constrain a property to those values. * The Constraint is applied on the controller side. * No validations are done in the Controlee. */ @interface AJCPSConstraintRange : NSObject - (id)initWithHandle:(ajn ::services ::ConstraintRange *)handle; /** * get the IncrementValue of the Constraint Range * @return IncrementValue */ - (uint16_t)getIncrementValue; /** * Get the MaxValue of the Constraint Range * @return MaxValue */ - (uint16_t)getMaxValue; /** * Get the MinValue of the Constraint Range * @return MinValue */ - (uint16_t)getMinValue; @endbase-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSContainer.h000066400000000000000000000036501262264444500255460ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJCPSRootWidget.h" #import "alljoyn/controlpanel/Container.h" /** * AJCPSContainer class is used to represent a container widget, * container widgets container children widgets and group them together. */ @interface AJCPSContainer : AJCPSRootWidget - (id)initWithHandle:(ajn::services::Container *)handle; /** * Register the BusObjects for this Widget * @param bus A reference to the AJNBusAttachment. * @return status - success/failure */ - (QStatus)registerObjects:(AJNBusAttachment *)bus; /** * Unregister the BusObjects for this widget * @param bus A reference to the AJNBusAttachment. * @return status - success/failure */ - (QStatus)unregisterObjects:(AJNBusAttachment *)bus; /** * Get the ChildWidget Vector * @return children widgets */ //const std : : vector & getChildWidgets() const; - (NSArray *)getChildWidgets; /** * Get IsDismissable * @return isDismissable */ - (bool)getIsDismissable; @endbase-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSControlPanel.h000066400000000000000000000046471262264444500262330ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/Status.h" #import "AJNBusAttachment.h" #import "alljoyn/controlpanel/ControlPanel.h" #import "AJCPSLanguageSet.h" #import "AJCPSControlPanelDevice.h" #import "AJCPSContainer.h" /** * AJCPSControlPanel Class used to create a ControlPanel. * ControlPanels are made up of a LanguageSet and a RootContainer */ @interface AJCPSControlPanel : NSObject - (id)initWithHandle:(ajn ::services ::ControlPanel *)handle; /** * Get the name of the Panel - the name of the rootWidget * @return name of the Panel */ - (NSString *)getPanelName; /** * Register the BusObjects for this Widget * @param bus - bus used to register the busObjects * @return status - success/failure */ - (QStatus)registerObjects:(AJNBusAttachment *)bus; /** * Unregister the BusObjects for this Widget * @param bus - bus used to unregister the busObjects * @return status - success/failure */ - (QStatus)unregisterObjects:(AJNBusAttachment *)bus; /** * Get the LanguageSet of the ControlPanel * @return */ - (AJCPSLanguageSet *)getLanguageSet; /** * Get the Device of the ControlPanel * @return controlPanelDevice */ - (AJCPSControlPanelDevice *)getDevice; /** * Get the objectPath * @return */ - (NSString *)getObjectPath; /** * Get the RootWidget of the ControlPanel * @param Language the language to use for the action can be NULL meaning default. * @return pointer to rootWidget */ - (AJCPSContainer *)getRootWidget:(NSString *)Language; @endbase-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSControlPanelController.h000066400000000000000000000051331262264444500302660ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/controlpanel/ControlPanelController.h" #import "AJCPSControlPanelDevice.h" /** * AJCPSControlPanelController facilitated controlling of remote ControlPanels */ @interface AJCPSControlPanelController : NSObject - (id)init; - (id)initWithHandle:(ajn::services::ControlPanelController *)handle; /** * create a controllable device by parsing announce descriptions. * @param deviceBusName - BusName of device received in announce * @param objectDescs - ObjectDescriptions received in announce * @return a ControlPanelDevice */ - (AJCPSControlPanelDevice *)createControllableDevice:(NSString *)deviceBusName ObjectDescs:(NSDictionary *)objectDescs; /** * GetControllableDevice - get a device using the busName - creates it if it doesn't exist * @param deviceBusName - deviceName to get * @return ControlPanelDevice* - returns the Device */ - (AJCPSControlPanelDevice *)getControllableDevice:(NSString *)deviceBusName; /** * deleteControllableDevice - shutdown a controllable device and delete it from the Controller * @param deviceBusName - deviceName to delete * @return status - success-failure */ - (QStatus)deleteControllableDevice:(NSString *)deviceBusName; /** * deleteAllControllableDevices - shutdown and delete all controllable devices from the controller * @return status - success-failure */ - (QStatus)deleteAllControllableDevices; /** * Get map of All Controllable Devices * @return controllable Devices map const std::map& */ - (NSDictionary *)getControllableDevices; @property (nonatomic, readonly)ajn::services::ControlPanelController * handle; @endbase-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSControlPanelControllerUnit.h000066400000000000000000000075111262264444500311300ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/Status.h" #import "alljoyn/controlpanel/ControlPanelControllerUnit.h" #import "AJCPSHttpControl.h" @class AJCPSControlPanelDevice; @class AJCPSControlPanel; @class AJCPSNotificationAction; /** * AJCPSControlPanelControllerUnit class represents a ControlPanel Unit. */ @interface AJCPSControlPanelControllerUnit : NSObject - (id)initWithHandle:(ajn ::services ::ControlPanelControllerUnit *)handle; /** * ControlPanelUnit * @param unitName the unit name. * @param device the control panel device object. */ - (id)initControlPanelControllerUnit:(NSString *)unitName device:(AJCPSControlPanelDevice *)device; /** * add a HttpControl * @param objectPath of HTTPControl. * @return ER_OK if successful. */ - (QStatus)addHttpControl:(NSString *)objectPath; /** * addControlPanel * @param objectPath the control panel object path. * @param panelName the control panel name. * @return ER_OK if successful. */ - (QStatus)addControlPanel:(NSString *)objectPath panelName:(NSString *)panelName; /** * addNotificationAction to controlpanel unit * @param objectPath the objectpath of the notification action * @param actionName the actionName parsed from the objectpath * @return ER_OK if successful. */ - (QStatus)addNotificationAction:(NSString *)objectPath actionName:(NSString *)actionName; /** * remove a Notification Action * @param actionName the action name. * @return ER_OK if successful. */ - (QStatus)removeNotificationAction:(NSString *)actionName; /** * Fill control panels and the HTTPControl * @return ER_OK if successful. */ - (QStatus)registerObjects; /** * Called when shutting down device * @return ER_OK if successful. */ - (QStatus)shutdownUnit; /** * getDevice * @return ControlPanelDevice* */ - (AJCPSControlPanelDevice *)getDevice; /** * getUnitName * @return string */ - (NSString *)getUnitName; /** * Get the ControlPanels of the Unit * @return controlPanels map */ // const std::map& getControlPanels; - (NSDictionary *)getControlPanels; /** * Get the NotificationActions of the Unit * @return NotificationActions map */ // const std::map& getNotificationActions; - (NSDictionary *)getNotificationActions; /** * Get a ControlPanel of the Unit * @param panelName - name of the Panel to get * @return ControlPanel or NULL if it doesn't' exist */ - (AJCPSControlPanel *)getControlPanel:(NSString *)panelName; /** * Get a NotificationAction of the Unit * @param actionName - name of the NotificaitonAction to get * @return NotificationAction or NULL if it doesn't exist */ - (AJCPSNotificationAction *)getNotificationAction:(NSString *)actionName; /** * Get the HttpControl of the Unit * @return httpControl */ - (AJCPSHttpControl *)getHttpControl; @property (nonatomic, readonly)ajn::services::ControlPanelControllerUnit * handle; @endbase-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSControlPanelDevice.h000066400000000000000000000102051262264444500273360ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/Status.h" #import "AJNSessionOptions.h" #import "alljoyn/controlpanel/ControlPanelDevice.h" #import "AJCPSControlPanelControllerUnit.h" #import "AJCPSNotificationAction.h" #import "AJCPSControlPanelListener.h" /** * AJCPSControlPanelDevice */ @interface AJCPSControlPanelDevice : NSObject /** * Constructor for ControlPanelDevice * @param handle handle to the instance */ - (id)initWithHandle:(ajn ::services ::ControlPanelDevice *)handle; /** * startSessionAsync - start a session with Device Asynchronously * @return status - success/failure */ - (QStatus)startSessionAsync; /** * startSession - start session with device synchronously * @return status - success/failure */ - (QStatus)startSession; /** * endSession - endSession with device * @return status - success/failure */ - (QStatus)endSession; /** * ShutDown device - end Session and release units * @return status - success/failure */ - (QStatus)shutdownDevice; /** * getDeviceBusName - get the busName of the device * @return deviceBusName - busName of device */ - (NSString *)getDeviceBusName; /** * getSessionId - get the SessionId of the remote Session with device * @return const ajn::SessionId */ - (AJNSessionId)getSessionId; /** * getDeviceUnits * @return the ControlPanelUnits of this Device */ // const std::map& getDeviceUnits const; - (NSDictionary *)getDeviceUnits; /** * getAllControlPanels - returns an array with all controlPanels contained by this device * @return an array with all the controlPanel defined as children of this device */ - (NSArray *)getAllControlPanels; /** * Get an existing unit using the objectPath * @param objectPath - objectPath of unit * @return ControlPanelUnit pointer */ - (AJCPSControlPanelControllerUnit *)getControlPanelUnit:(NSString *)objectPath; /** * addControlPanelUnit - add a ControlPanel unit using the objectPath and interfaces passed in * @param objectPath - objectPath received in the announce * @param interfaces - interfaces received in the announce * @return ControlPanelUnit pointer */ - (AJCPSControlPanelControllerUnit *)addControlPanelUnit:(NSString *)objectPath interfaces:(NSArray *)interfaces; /** * addNotificationAction - add a Notification using an objectPath received in a notification * @param objectPath - objectPath used to create the NotificationAction * @return NotificationAction pointer */ - (AJCPSNotificationAction *)addNotificationAction:(NSString *)objectPath; /** * Delete and shutdown the NotificationAction * @param notificationAction - notificationAction to remove * @return status - success/failure */ - (QStatus)removeNotificationAction:(AJCPSNotificationAction *)notificationAction; /** * Get the Listener defined for this SessionHandler * @return */ - (id )getListener; /** * Set the Listener defined for this SessionHandler * @param listener AJCPSControlPanelListener that will receive session/signal events notifications. * @return status - success/failure */ - (QStatus)setListener:(id )listener; @property (nonatomic, readonly)ajn::services::ControlPanelDevice * handle; @endbase-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSControlPanelEnums.h000066400000000000000000000113601262264444500272310ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import /** * AJCPSControlPanelEnums */ @interface AJCPSControlPanelEnums : NSObject @end /** * Mode ControlPanel is in */ typedef NS_ENUM (NSInteger, AJCPSControlPanelMode) { /*** * CONTROLLEE_MODE */ AJCPS_CONTROLLEE_MODE, /*** * CONTROLLER_MODE */ AJCPS_CONTROLLER_MODE }; /** * WidgetType */ typedef NS_ENUM (NSInteger, AJCPSWidgetType) { /** * AJCPS_CONTAINER */ AJCPS_CONTAINER = 0, /** * AJCPS_ACTION */ AJCPS_ACTION = 1, /** * AJCPS_ACTION_WITH_DIALOG */ AJCPS_ACTION_WITH_DIALOG = 2, /** * AJCPS_LABEL */ AJCPS_LABEL = 3, /** * AJCPS_PROPERTY */ AJCPS_PROPERTY = 4, /** * AJCPS_DIALOG */ AJCPS_DIALOG = 5, /** * AJCPS_ERROR */ AJCPS_ERROR = 6 }; /** * Enum to define the type of Property */ typedef NS_ENUM (NSInteger, AJCPSPropertyType) { /** * bool property */ AJCPS_BOOL_PROPERTY = 0, /** * uint16 property */ AJCPS_UINT16_PROPERTY = 1, /** * int16 property */ AJCPS_INT16_PROPERTY = 2, /** * uint32 property */ AJCPS_UINT32_PROPERTY = 3, /** * int32 property */ AJCPS_INT32_PROPERTY = 4, /** * uint64 property */ AJCPS_UINT64_PROPERTY = 5, /** * int64 property */ AJCPS_INT64_PROPERTY = 6, /** * double property */ AJCPS_DOUBLE_PROPERTY = 7, /** * String property */ AJCPS_STRING_PROPERTY = 8, /** * Date property */ AJCPS_DATE_PROPERTY = 9, /** * Time property */ AJCPS_TIME_PROPERTY = 10, /** * Undefined */ AJCPS_UNDEFINED = 11 }; /** * Transactions that could go wrong resulting in an Error Occurred event being fired */ typedef NS_ENUM (NSInteger, AJCPSControlPanelTransaction) { /** * Session join */ AJCPS_SESSION_JOIN = 0, /** * Register objects */ AJCPS_REGISTER_OBJECTS = 1, /** * refresh value */ AJCPS_REFRESH_VALUE = 2, /** * Refresh properties */ AJCPS_REFRESH_PROPERTIES = 3 }; /** * Hints for Containers Widgets * determining the layout */ typedef NS_ENUM (NSInteger, AJCPS_LAYOUT_HINTS) { /** * Vertical linear */ AJCPS_VERTICAL_LINEAR = 1, /** * Horizontal linear */ AJCPS_HORIZONTAL_LINEAR = 2 }; /** * Hints for Dialog Widgets */ typedef NS_ENUM (NSInteger, AJCPS_DIALOG_HINTS) { /** * Alert dialog */ AJCPS_ALERTDIALOG = 1 }; /** * Hints for Property Widgets */ typedef NS_ENUM (NSInteger, AJCPS_PROPERTY_HINTS) { /** * Switch */ AJCPS_SWITCH = 1, /** * Checkbox */ AJCPS_CHECKBOX = 2, /** * Spinner */ AJCPS_SPINNER = 3, /** * Radio button */ AJCPS_RADIOBUTTON = 4, /** * slider */ AJCPS_SLIDER = 5, /** * Time picker */ AJCPS_TIMEPICKER = 6, /** * Date picker */ AJCPS_DATEPICKER = 7, /** * Number picker */ AJCPS_NUMBERPICKER = 8, /** * Keypad */ AJCPS_KEYPAD = 9, /** * Rotaryk nob */ AJCPS_ROTARYKNOB = 10, /** * text view */ AJCPS_TEXTVIEW = 11, /** * Numeric view */ AJCPS_NUMERICVIEW = 12, /** * Edit text */ AJCPS_EDITTEXT = 13 }; /** * Hints for Label Widgets */ typedef NS_ENUM (NSInteger, AJCPS_LABEL_HINTS) { /** * Text label */ AJCPS_TEXTLABEL = 1 }; /** * Hints for ListProperty Widgets */ typedef NS_ENUM (NSInteger, LIST_PROPERTY_HINTS) { /** * Dynamic spinner */ AJCPS_DYNAMICSPINNER = 1 }; /** * Hints for Action Widgets */ typedef NS_ENUM (NSInteger, ACTION_HINTS) { /** * Action button */ AJCPS_ACTIONBUTTON = 1 }; base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSControlPanelListener.h000066400000000000000000000056701262264444500277360ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJCPSProperty.h" @class AJCPSControlPanelDevice; @class AJCPSNotificationAction; /** * AJCPSControlPanelListener protocol */ @protocol AJCPSControlPanelListener /** * sessionEstablished - callback when a session is established with a device * @param device - the device that the session was established with */ - (void)sessionEstablished:(AJCPSControlPanelDevice *)device; /** * sessionLost - callback when a session is lost with a device * @param device - device that the session was lost with */ - (void)sessionLost:(AJCPSControlPanelDevice *)device; /** * signalPropertiesChanged - callback when a property Changed signal is received * @param device - device signal was received from * @param widget - widget signal was received for */ - (void)signalPropertiesChanged:(AJCPSControlPanelDevice *)device widget:(AJCPSWidget *)widget; /** * signalPropertyValueChanged - callback when a property Value Changed signal is received * @param device - device signal was received from * @param property - Property signal was received for */ - (void)signalPropertyValueChanged:(AJCPSControlPanelDevice *)device property:(AJCPSProperty *)property; /** * signalDismiss - callback when a Dismiss signal is received * @param device - device signal was received from * @param notificationAction - notificationAction signal was received for */ - (void)signalDismiss:(AJCPSControlPanelDevice *)device notificationAction:(AJCPSNotificationAction *)notificationAction; /** * ErrorOccured - callback to tell application when something goes wrong * @param device - device that had the error * @param status - status associated with error if applicable * @param transaction - the type of transaction that resulted in the error * @param errorMessage - a log-able error Message */ - (void)errorOccured:(AJCPSControlPanelDevice *)device status:(QStatus)status transaction:(AJCPSControlPanelTransaction)transaction errorMessage:(NSString *)errorMessage; @endbase-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSControlPanelListenerAdapter.h000066400000000000000000000120251262264444500312270ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "alljoyn/controlpanel/ControlPanelListener.h" #import "AJCPSControlPanelListener.h" #import "alljoyn/about/AJNConvertUtil.h" #ifndef ALLJOYN_CONTROLPANEL_OBJC_AJCPSCONTROLPANELLISTENERADAPTER_H #define ALLJOYN_CONTROLPANEL_OBJC_AJCPSCONTROLPANELLISTENERADAPTER_H using namespace ajn::services; class AJCPSControlPanelListenerAdapter : public ajn::services::ControlPanelListener { public: id listener; AJCPSControlPanelListenerAdapter(id listener) { this->listener = listener;} id getListener() {return this->listener;} /** * sessionEstablished - callback when a session is established with a device * @param device - the device that the session was established with */ virtual void sessionEstablished(ControlPanelDevice* device) { [listener sessionEstablished:[[AJCPSControlPanelDevice alloc]initWithHandle:device]];} /** * sessionLost - callback when a session is lost with a device * @param device - device that the session was lost with */ virtual void sessionLost(ControlPanelDevice* device) { [listener sessionLost:[[AJCPSControlPanelDevice alloc]initWithHandle:device]];} /** * signalPropertiesChanged - callback when a property Changed signal is received * @param device - device signal was received from * @param widget - widget signal was received for */ virtual void signalPropertiesChanged(ControlPanelDevice* device, Widget* widget) { AJCPSWidget *new_widget = [[AJCPSWidget alloc]initWithHandle:widget]; [listener signalPropertiesChanged:[[AJCPSControlPanelDevice alloc]initWithHandle:device] widget:new_widget]; } /** * signalPropertyValueChanged - callback when a property Value Changed signal is received * @param device - device signal was received from * @param property - Property signal was received for */ virtual void signalPropertyValueChanged(ControlPanelDevice* device, Property* property) { AJCPSControlPanelDevice *qcp_device = [[AJCPSControlPanelDevice alloc]initWithHandle:device]; AJCPSProperty *qcp_property = [[AJCPSProperty alloc]initWithHandle:property]; [listener signalPropertyValueChanged:qcp_device property:qcp_property]; } /** * signalDismiss - callback when a Dismiss signal is received * @param device - device signal was received from * @param notificationAction - notificationAction signal was received for */ virtual void signalDismiss(ControlPanelDevice* device, NotificationAction* notificationAction) { AJCPSControlPanelDevice *qcp_device = [[AJCPSControlPanelDevice alloc]initWithHandle:device]; AJCPSNotificationAction *qcp_notification_action = [[AJCPSNotificationAction alloc]initWithHandle:notificationAction]; [listener signalDismiss:qcp_device notificationAction:qcp_notification_action]; } /** * ErrorOccured - callback to tell application when something goes wrong * @param device - device that had the error * @param status - status associated with error if applicable * @param transaction - the type of transaction that resulted in the error * @param errorMessage - a log-able error Message */ virtual void errorOccured(ControlPanelDevice* device, QStatus status, ControlPanelTransaction transaction, qcc::String const& errorMessage) { AJCPSControlPanelDevice *qcp_device = [[AJCPSControlPanelDevice alloc]initWithHandle:device]; AJCPSControlPanelTransaction qcp_controlpanel_transaction = transaction; NSString *qcp_error_message = [AJNConvertUtil convertQCCStringtoNSString:errorMessage]; [listener errorOccured:qcp_device status:status transaction:qcp_controlpanel_transaction errorMessage:qcp_error_message]; } virtual ~AJCPSControlPanelListenerAdapter() { }; private: }; #endif //ALLJOYN_CONTROLPANEL_OBJC_AJCPSCONTROLPANELLISTENERADAPTER_H base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSControlPanelService.h000066400000000000000000000061761262264444500275530ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusAttachment.h" #import "alljoyn/controlpanel/ControlPanelService.h" #import "AJCPSControlPanelController.h" #import "AJCPSControlPanelListener.h" #import "AJSVCGenericLogger.h" /** * AJCPSControlPanelService - singleton implementation */ @interface AJCPSControlPanelService : NSObject /** * Get Instance of ControlPanelServiceImpl - singleton implementation * @return instance A AJCPSControlPanelService instance */ + (AJCPSControlPanelService *)getInstance; /** * Initialize the controller to be used * @param bus - bus used for Controller * @param controlPanelController - controller to initialize * @param controlPanelListener AJCPSControlPanelListener that will receive session/signal events notifications. * @return ER_OK if successful. */ - (QStatus)initController:(AJNBusAttachment *)bus controlPanelController:(AJCPSControlPanelController *)controlPanelController controlPanelListener:(id )controlPanelListener; /** * Remove locally stored controller. Allows a new call to initController to be made * @return ER_OK if successful. */ - (QStatus)shutdownController; #pragma mark - Logger methods /** * Receive GenericLogger* to use for logging * @param logger Implementation of GenericLogger */ - (void)setLogger:(id )logger; /** * Get the currently-configured logger implementation * @return logger Implementation of GenericLogger */ - (id )logger; /** * Set log level filter for subsequent logging messages * @param newLogLevel enum value */ - (void)setLogLevel:(QLogLevel)newLogLevel; /** * Get log level filter value currently in effect * @return logLevel enum value currently in effect */ - (QLogLevel)logLevel; /** * Method to get the busAttachment used in the service. * @return AJNBusAttachment */ - (AJNBusAttachment *)getBusAttachment; /** * Get the ControlPanelListener * @return ControlPanelListener */ - (id )getControlPanelListener; /** * Get the Version of the ControlPanelService * @return the ControlPanelService version */ - (uint16_t)getVersion; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSControllerModel.h000066400000000000000000000036751262264444500267370ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import #import "alljoyn/Status.h" #import "AJCPSContainer.h" #import "AJCPSControlPanelListener.h" #import "AJCPSControllerUpdateEvents.h" #import "AJCPSControlPanel.h" @interface ControllerModel : NSObject @property (strong, nonatomic) NSString *unit; @property (strong, nonatomic) AJCPSControlPanel *controlPanel; @property (strong, atomic) NSArray *widgetsContainer; @property (strong, nonatomic) id delegate; @property (strong, nonatomic,readonly) NSArray *supportedLanguages; -(void)pushChildContainer:(AJCPSContainer *)containerToMoveTo; -(NSInteger)popChildContainer; -(QStatus)switchLanguage:(NSString *)language; -(QStatus)switchLanguageForNotificationAction:(AJCPSRootWidget *)rootWidget; -(QStatus)loadRootWidget:(AJCPSRootWidget *)rootWidget; -(void)setSupportedLanguagesForNotificationAction:(AJCPSNotificationAction *) notificationAction; -(NSInteger)childContainerPosition; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSControllerUpdateEvents.h000066400000000000000000000021171262264444500302740ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import @protocol ControllerUpdateEvents -(void)refreshEntries; -(void)loadEnded; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSDialog.h000066400000000000000000000040751262264444500250250ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/controlpanel/Dialog.h" #import "AJCPSRootWidget.h" /** * AJCPSDialog is used to display a Dialog. */ @interface AJCPSDialog : AJCPSRootWidget - (id)initWithHandle:(ajn ::services ::Dialog *)handle; /** * Get the Number of Actions in the Dialog * @return Number of Actions */ - (uint16_t)getNumActions; /** * Get the Message of the Dialog * @return the message */ - (NSString *)getMessage; /** * Get the LabelAction1 of the Dialog * @return the message */ - (NSString *)getLabelAction1; /** * Get the LabelAction2 of the Dialog * @return the message */ - (NSString *)getLabelAction2; /** * Get the LabelAction3 of the Dialog * @return the message */ - (NSString *)getLabelAction3; /** * Call to execute this Dialog's Action 1 remotely * @return status - success/failure */ - (QStatus)executeAction1; /** * Call to execute this Dialog's Action 2 remotely * @return status - success/failure */ - (QStatus)executeAction2; /** * Call to execute this Dialog's Action 3 remotely * @return status - success/failure */ - (QStatus)executeAction3; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSErrorWidget.h000066400000000000000000000025261262264444500260620ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/controlpanel/ErrorWidget.h" #import "AJCPSWidget.h" /** * AJCPSLabel class used to display a Label. */ @interface AJCPSErrorWidget : AJCPSWidget /** * Constructor for AJCPSLabel class * @param handle handle to the c++ instance */ - (id)initWithHandle:(ajn ::services ::ErrorWidget *)handle; - (AJCPSWidget*)getOriginalWidget; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSGetControlPanelViewController.h000066400000000000000000000026401262264444500315610ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/about/AJNAnnouncement.h" #import "AJNBusAttachment.h" #import "AJCPSControllerModel.h" @interface GetControlPanelViewController : UIViewController - (id)initWithNotificationSenderBusName:(NSString*) senderBusName cpsObjectPath:(NSString*) cpsObjectPath bus:(AJNBusAttachment*) bus; - (id)initWithAnnouncement:(AJNAnnouncement*) announcement bus:(AJNBusAttachment*) bus; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSHttpControl.h000066400000000000000000000143421262264444500261040ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusAttachment.h" #import "alljoyn/controlpanel/HttpControl.h" #import "AJCPSControlPanelEnums.h" @class AJCPSControlPanelDevice; /** * AJCPSHttpControl allows definition of a url. */ @interface AJCPSHttpControl : NSObject - (id)initWithHandle:(ajn ::services ::HttpControl *)handle; /** * Get the Interface Version of the HttpControl * @return interface Version */ - (uint16_t)getInterfaceVersion; /** * Register the HttpControl BusObject * @param bus - bus used for registering the object * @return status - success/failure */ - (QStatus)registerObjects:(AJNBusAttachment *)bus; /** * Refresh the HttpControl * @param bus - bus used for refreshing the object * @return status - success/failure */ - (QStatus)refreshObjects:(AJNBusAttachment *)bus; /** * Unregister the HttpControl BusObject * @param bus - bus used to unregister the object * @return status - success/failure */ - (QStatus)unregisterObjects:(AJNBusAttachment *)bus; /** * Get the Device that contains this HttpControl * @return ControlPanelDevice */ - (AJCPSControlPanelDevice *)getDevice; /** * Get the Url for the HttpControl * @return url */ - (NSString *)getUrl; /** * Get the ControlPanelMode of this HttpControl * @return ControlPanelMode */ - (AJCPSControlPanelMode)getControlPanelMode; @end //#ifndef HTTPCONTROL_H_ //#define HTTPCONTROL_H_ // //#include //#include // //namespace ajn { //namespace services { // //class ControlPanelDevice; //class HttpControlBusObject; // ///** // * HttpControl class. Allows definition of a url // */ //class HttpControl { // public: // // /** // * Constructor for HttpControl // * @param url - url of HttpControl // */ // HttpControl(qcc::String & url);// SKIP // // /** // * Constructor for HttpControl // * @param objectPath - objectPath of HttpControl // * @param device - the device containing this HttpControl // */ // HttpControl(qcc::String & objectPath, ControlPanelDevice* device); // // /** // * Destructor of HttpControl // */ // virtual ~HttpControl(); // // /** // * Get the Interface Version of the HttpControl // * @return interface Version // */ // -(uint16_t) getInterfaceVersion; // // /** // * Register the HttpControl BusObject // * @param bus - bus used for registering the object // * @param unitName - name of unit // * @return status - success/failure // */ // -(QStatus) registerObjects(BusAttachment* bus, qcc::String & unitName);// SKIP // // /** // * Register the HttpControl BusObject // * @param bus - bus used for registering the object // * @return status - success/failure // */ // -(QStatus) registerObjects(BusAttachment* bus); // // /** // * Refresh the HttpControl // * @param bus - bus used for refreshing the object // * @return status - success/failure // */ // -(QStatus) refreshObjects(BusAttachment* bus); // // /** // * Unregister the HttpControl BusObject // * @param bus - bus used to unregister the object // * @return status - success/failure // */ // -(QStatus) unregisterObjects(BusAttachment* bus); // // /** // * Fill MsgArg passed in with Url // * @param val - msgArg to fill // * @return status - success/failure // */ // -(QStatus) fillUrlArg(MsgArg& val);// SKIP // // /** // * Read MsgArg passed in and use it to set the url // * @param val - MsgArg passed in // * @return status - success/failure // */ // -(QStatus) readUrlArg(MsgArg & val);// SKIP // // /** // * Read MsgArg passed in and use it to set the url // * @param val - MsgArg passed in // * @return status - success/failure // */ // -(QStatus) readVersionArg(MsgArg & val);// SKIP // // /** // * Get the Device that contains this HttpControl // * @return ControlPanelDevice // */ // ControlPanelDevice* getDevice; // // /** // * Get the Url for the HttpControl // * @return url // */ // -(NSString *) getUrl; // // /** // * Get the ControlPanelMode of this HttpControl // * @return ControlPanelMode // */ // ControlPanelMode getControlPanelMode; // // private: // // /** // * Url of HttpControl // */ // qcc::String m_Url; // // /** // * ObjectPath of HttpControl // */ // qcc::String m_ObjectPath; // // /** // * BusObject of HttpControl // */ // HttpControlBusObject* m_HttpControlBusObject; // // /** // * The Device containing the HttpControl // */ // ControlPanelDevice* m_Device; // // /** // * The mode of the HttpControl // */ // ControlPanelMode m_ControlPanelMode; // // /** // * Version of the Widget // */ // -(uint16_t) m_Version; // // /** // * Copy ructor of HttpControl - private. HttpControl is not copy-able // * @param httpControl - HttpControl to copy // */ // HttpControl( HttpControl& httpControl); // // /** // * Assignment operator of HttpControl - private. HttpControl is not assignable // * @param httpControl // * @return // */ // HttpControl& operator=( HttpControl& httpControl); //}; //} //namespace services //} //namespace ajn // //#endif /* HTTPCONTROL_H_ */ base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSLabel.h000066400000000000000000000024401262264444500246370ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/controlpanel/Label.h" #import "AJCPSWidget.h" /** * AJCPSLabel class used to display a Label. */ @interface AJCPSLabel : AJCPSWidget /** * Constructor for AJCPSLabel class * @param handle handle to the c++ instance */ - (id)initWithHandle:(ajn ::services ::Label *)handle; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSLanguageSet.h000066400000000000000000000032461262264444500260240ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/controlpanel/LanguageSet.h" /** * AJCPSLanguageSet is used to define a LanguageSet */ @interface AJCPSLanguageSet : NSObject - (id)initWithHandle:(ajn ::services ::LanguageSet *)handle; /** * Get the LanguageSetName * @return LanguageSetName */ - (NSString *)getLanguageSetName; /** * Get the number of Languages defined * @return number of Languages */ - (size_t)getNumLanguages; /** * Add a language to the LanguageSet * @param language - language to Add */ - (void)addLanguage:(NSString *)language; /** * * Get the Languages defined in the LanguageSet * @return languages vector */ //const std::vector& - (NSArray *)getLanguages; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSLanguageSets.h000066400000000000000000000027231262264444500262060ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/controlpanel/LanguageSets.h" #import "AJCPSLanguageSet.h" /** * AJCPSLanguageSets is used to store the LanguageSets defined. */ @interface AJCPSLanguageSets : NSObject - (id)initWithHandle:(ajn ::services ::LanguageSets *)handle; /** * Get a LanguageSet * @param languageSetName - the name of the languageSet to get * @return the languageSet requested or NULL if it does not exist */ - (AJCPSLanguageSet *)getLanguageSet:(NSString *)languageSetName; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSNotificationAction.h000066400000000000000000000045601262264444500274110ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/controlpanel/NotificationAction.h" #import "AJCPSLanguageSet.h" #import "AJCPSRootWidget.h" /** * AJCPSNotificationAction */ @interface AJCPSNotificationAction : NSObject - (id)initWithHandle:(ajn ::services ::NotificationAction *)handle; /** * Get the name of the NotificationAction - the name of the rootWidget * @return name of the NotificationAction */ - (NSString *)getNotificationActionName; /** * Register the BusObjects for this Widget * @param bus - bus used to register the busObjects * @return status - success/failure */ - (QStatus)registerObjects:(AJNBusAttachment *)bus; /** * Unregister the BusObjects of the NotificationAction class * @param bus - bus used to unregister the objects * @return status - success/failure */ - (QStatus)unregisterObjects:(AJNBusAttachment *)bus; /** * Get the LanguageSet of the NotificationAction * @return */ - (AJCPSLanguageSet *)getLanguageSet; /** * Get the Device of the NotificationAction * @return controlPanelDevice */ - (AJCPSControlPanelDevice *)getDevice; /** * Get the objectPath * @return */ - (NSString *)getObjectPath; /** * Get the RootWidget of the NotificationAction * @param Language - languageSet of RootWidget to retrieve * @return rootWidget */ - (AJCPSRootWidget *)getRootWidget:(NSString *)Language; @property (nonatomic, readonly)ajn::services::NotificationAction * handle; @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSProperty.h000066400000000000000000000125431262264444500254510ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJCPSWidget.h" #import "alljoyn/controlpanel/Property.h" #import "AJCPSConstraintRange.h" #import "alljoyn/controlpanel/CPSDate.h" #import "alljoyn/controlpanel/CPSTime.h" #import "AJCPSCPSDate.h" #import "AJCPSCPSTime.h" /** * Union that allows the definition of a function pointer * to get the Properties value. */ typedef union { /** * Get Value for type uint16t * @return value of Property */ uint16_t uint16Value; /** * Get Value for type int16_t * @return value of Property */ int16_t int16Value; /** * Get Value for type uint32_t * @return value of Property */ uint32_t uint32Value; /** * Get Value for type int32_t * @return value of Property */ int32_t int32Value; /** * Get Value for type uint64_t * @return value of Property */ uint64_t uint64Value; /** * Get Value for type int64_t * @return value of Property */ int64_t int64Value; /** * Get Value for type double * @return value of Property */ double doubleValue; /** * Get Value for type const char* * @return value of Property */ const char* charValue; /** * Get Value for type bool * @return value of Property */ bool boolValue; /** * Get Value for type CPSDate * @return value of Property */ // CPSDate* dateValue; TODO: arc forbids objc objects here /** * Get Value for type CPSTime * @return value of Property */ // CPSTime* timeValue; TODO: arc forbids objc objects here /** * Get Value for type CPSDate * @return value of Property */ ajn::services::CPSDate* dateValue; /** * Get Value for type CPSTime * @return value of Property */ ajn::services::CPSTime* timeValue; } AJCPSPropertyValue; /** * AJCPSProperty is used to display a property Widget. */ @interface AJCPSProperty : AJCPSWidget - (id)initWithHandle:(ajn ::services ::Property *)handle; /** * Get the PropertyType * @return PropertyType */ - (AJCPSPropertyType)getPropertyType; /** * Get the PropertyValue of the property * @param propertyValue - the property value according to the property type * @return the value of the property */ - (void)getPropertyValue:(AJCPSPropertyValue &)propertyValue; /** * Get the Unit of Measure * @return Unit of Measure Values */ - (NSString *)getUnitOfMeasure; /** * Get the Constraint List vector * @return the Constraint List vector */ //const std::vector& - (NSArray *)getConstraintList; /** * Get the Constraint Range * @return the Constraint Range */ - (AJCPSConstraintRange *)getConstraintRange; /** * Set the new Value * @param value - new Value to be set to * @return status - success/failure */ - (QStatus)setValueFromBool:(bool)value; /** * Set the new Value * @param value - new Value to be set to * @return status - success/failure */ - (QStatus)setValueFromUnsignedShort:(uint16_t)value; /** * Set the new Value * @param value - new Value to be set to * @return status - success/failure */ - (QStatus)setValueFromShort:(int16_t)value; /** * Set the new Value * @param value - new Value to be set to * @return status - success/failure */ - (QStatus)setValueFromUnsignedLong:(uint32_t)value; /** * Set the new Value * @param value - new Value to be set to * @return status - success/failure */ - (QStatus)setValueFromLong:(int32_t)value; /** * Set the new Value * @param value - new Value to be set to * @return status - success/failure */ - (QStatus)setValueFromUnsignedLongLong:(uint64_t)value; /** * Set the new Value * @param value - new Value to be set to * @return status - success/failure */ - (QStatus)setValueFromLongLong:(int64_t)value; /** * Set the new Value * @param value - new Value to be set to * @return status - success/failure */ - (QStatus)setValueFromDouble:(double)value; /** * Set the new Value * @param value - new Value to be set to * @return status - success/failure */ - (QStatus)setValueFromCString:(const char *)value; /** * Set the new Value * @param value - new Value to be set to * @return status - success/failure */ - (QStatus)setValueFromDate:(AJCPSCPSDate *)value; /** * Set the new Value * @param value - new Value to be set to * @return status - success/failure */ - (QStatus)setValueFromTime:(AJCPSCPSTime *)value; @endbase-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSRootWidget.h000066400000000000000000000022171262264444500257110ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJCPSWidget.h" /** * AJCPSRootWidget is here only to mirror the C++ API, thats why it's empty. */ @interface AJCPSRootWidget : AJCPSWidget @end base-15.09/controlpanel/ios/inc/alljoyn/controlpanel/AJCPSWidget.h000066400000000000000000000063731262264444500250540ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import #import "AJCPSLanguageSet.h" #import "AJCPSControlPanelEnums.h" #import "AJCPSControlPanelEnums.h" #import "alljoyn/controlpanel/Widget.h" @class AJCPSControlPanelDevice; /** * AJCPSWidget is a base class for all Widgets. */ @interface AJCPSWidget : NSObject - (id)initWithHandle:(ajn ::services ::Widget *)handle; /** * Get the widgetType of the Widget * @return widgetType */ - (AJCPSWidgetType)getWidgetType; /** * Get the name of the Widget * @return widgetName */ - (NSString *)getWidgetName; /** * Get the mode of the Widget * @return controlPanelMode */ - (AJCPSControlPanelMode)getControlPanelMode; /** * Get this widget's RootWidget * @return rootWidget */ - (const AJCPSWidget *)getRootWidget; /** * Get the Device of the widget * @return device */ - (const AJCPSControlPanelDevice *)getDevice; /** * Get the Interface Version of the Widget * @return interface Version */ - (const uint16_t)getInterfaceVersion; /** * Get the isSecured boolean * @return true/false */ - (bool)getIsSecured; /** * Get IsEnabled boolean * @return true/false */ - (bool)getIsEnabled; /** * Get IsWritable boolean * @return true/false */ - (bool)getIsWritable; /** * Get the States of the Widget * @return states */ - (uint32_t)getStates; /** * Get the BgColor of the Widget * @return bgColor */ - (uint32_t)getBgColor; /** * Get the Label of the Widget * @return label */ - (NSString *)getLabel; /** * Get the array of Hints for the Widget * @return Array of hints */ // const std::vector& getHints; - (NSArray *)getHints; /** * Register the BusObjects for this Widget * @param bus The bus used to register the busObject * @param objectPath The objectPath of the busObject * @return ER_OK if successful. */ - (QStatus)registerObjects:(AJNBusAttachment *)bus atObjectPath:(NSString *)objectPath; /** * Refresh the Widget * @param bus bus used for refreshing the object * @return ER_OK if successful. */ - (QStatus)refreshObjects:(AJNBusAttachment *)bus; /** * Unregister the BusObjects for this widget * @param bus A reference to the AJNBusAttachment. * @return ER_OK if successful. */ - (QStatus)unregisterObjects:(AJNBusAttachment *)bus; @property (nonatomic, readonly)ajn::services::Widget * handle; @endbase-15.09/controlpanel/ios/samples/000077500000000000000000000000001262264444500174115ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/ControlPanelService.xcworkspace/000077500000000000000000000000001262264444500256625ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/ControlPanelService.xcworkspace/contents.xcworkspacedata000066400000000000000000000012631262264444500326260ustar00rootroot00000000000000 base-15.09/controlpanel/ios/samples/alljoyn_services_cpp/000077500000000000000000000000001262264444500236265ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/alljoyn_services_cpp/alljoyn_controlpanel_cpp.xcodeproj/000077500000000000000000000000001262264444500327145ustar00rootroot00000000000000project.pbxproj000066400000000000000000001317351262264444500357230ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/alljoyn_services_cpp/alljoyn_controlpanel_cpp.xcodeproj// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 19DCFB5F18A79D6C009EC74D /* ErrorWidget.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A23680F189A274C00FC88E8 /* ErrorWidget.h */; }; 19DCFB6018A79D6C009EC74D /* Action.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A5236F818799E3100940ED4 /* Action.h */; }; 19DCFB6118A79D6C009EC74D /* ActionWithDialog.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A5236F918799E3100940ED4 /* ActionWithDialog.h */; }; 19DCFB6218A79D6C009EC74D /* ConstraintList.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A5236FA18799E3100940ED4 /* ConstraintList.h */; }; 19DCFB6318A79D6C009EC74D /* ConstraintRange.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A5236FB18799E3100940ED4 /* ConstraintRange.h */; }; 19DCFB6418A79D6C009EC74D /* Container.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A5236FC18799E3100940ED4 /* Container.h */; }; 19DCFB6518A79D6C009EC74D /* ControlPanel.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A5236FD18799E3100940ED4 /* ControlPanel.h */; }; 19DCFB6618A79D6C009EC74D /* ControlPanelBusListener.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A5236FE18799E3100940ED4 /* ControlPanelBusListener.h */; }; 19DCFB6718A79D6C009EC74D /* ControlPanelControllee.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A5236FF18799E3100940ED4 /* ControlPanelControllee.h */; }; 19DCFB6818A79D6C009EC74D /* ControlPanelControlleeUnit.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370018799E3100940ED4 /* ControlPanelControlleeUnit.h */; }; 19DCFB6918A79D6C009EC74D /* ControlPanelController.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370118799E3100940ED4 /* ControlPanelController.h */; }; 19DCFB6A18A79D6C009EC74D /* ControlPanelControllerUnit.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370218799E3100940ED4 /* ControlPanelControllerUnit.h */; }; 19DCFB6B18A79D6C009EC74D /* ControlPanelDevice.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370318799E3100940ED4 /* ControlPanelDevice.h */; }; 19DCFB6C18A79D6C009EC74D /* ControlPanelEnums.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370418799E3100940ED4 /* ControlPanelEnums.h */; }; 19DCFB6D18A79D6C009EC74D /* ControlPanelListener.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370518799E3100940ED4 /* ControlPanelListener.h */; }; 19DCFB6E18A79D6C009EC74D /* ControlPanelService.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370618799E3100940ED4 /* ControlPanelService.h */; }; 19DCFB6F18A79D6C009EC74D /* ControlPanelSessionHandler.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370718799E3100940ED4 /* ControlPanelSessionHandler.h */; }; 19DCFB7018A79D6C009EC74D /* CPSDate.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370818799E3100940ED4 /* CPSDate.h */; }; 19DCFB7118A79D6C009EC74D /* CPSTime.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370918799E3100940ED4 /* CPSTime.h */; }; 19DCFB7218A79D6C009EC74D /* Dialog.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370A18799E3100940ED4 /* Dialog.h */; }; 19DCFB7318A79D6C009EC74D /* HttpControl.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370B18799E3100940ED4 /* HttpControl.h */; }; 19DCFB7418A79D6C009EC74D /* Label.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370C18799E3100940ED4 /* Label.h */; }; 19DCFB7518A79D6C009EC74D /* LanguageSet.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370D18799E3100940ED4 /* LanguageSet.h */; }; 19DCFB7618A79D6C009EC74D /* LanguageSets.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370E18799E3100940ED4 /* LanguageSets.h */; }; 19DCFB7718A79D6C009EC74D /* NotificationAction.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52370F18799E3100940ED4 /* NotificationAction.h */; }; 19DCFB7818A79D6C009EC74D /* Property.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52371018799E3100940ED4 /* Property.h */; }; 19DCFB7918A79D6C009EC74D /* RootWidget.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52371118799E3100940ED4 /* RootWidget.h */; }; 19DCFB7A18A79D6C009EC74D /* Widget.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 9A52371218799E3100940ED4 /* Widget.h */; }; 9A236812189A276700FC88E8 /* WidgetProxyBusObjectListener.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A236811189A276700FC88E8 /* WidgetProxyBusObjectListener.cc */; }; 9A236814189A277000FC88E8 /* ErrorWidget.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A236813189A277000FC88E8 /* ErrorWidget.cc */; }; 9A5238E718799E3200940ED4 /* ActionBusObject.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52373718799E3100940ED4 /* ActionBusObject.cc */; }; 9A5238E818799E3200940ED4 /* ContainerBusObject.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52373918799E3100940ED4 /* ContainerBusObject.cc */; }; 9A5238E918799E3200940ED4 /* ControlPanelBusObject.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52373B18799E3100940ED4 /* ControlPanelBusObject.cc */; }; 9A5238EA18799E3200940ED4 /* DialogBusObject.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52373D18799E3100940ED4 /* DialogBusObject.cc */; }; 9A5238EB18799E3200940ED4 /* HttpControlBusObject.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52373F18799E3100940ED4 /* HttpControlBusObject.cc */; }; 9A5238EC18799E3200940ED4 /* IntrospectionNode.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52374118799E3100940ED4 /* IntrospectionNode.cc */; }; 9A5238ED18799E3200940ED4 /* LabelBusObject.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52374318799E3100940ED4 /* LabelBusObject.cc */; }; 9A5238EE18799E3200940ED4 /* NotificationActionBusObject.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52374518799E3100940ED4 /* NotificationActionBusObject.cc */; }; 9A5238EF18799E3200940ED4 /* PropertyBusObject.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52374718799E3100940ED4 /* PropertyBusObject.cc */; }; 9A5238F018799E3200940ED4 /* WidgetBusObject.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52374918799E3100940ED4 /* WidgetBusObject.cc */; }; 9A5238F118799E3200940ED4 /* ControlPanel.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52374B18799E3100940ED4 /* ControlPanel.cc */; }; 9A5238F218799E3200940ED4 /* ControlPanelBusListener.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52374C18799E3100940ED4 /* ControlPanelBusListener.cc */; }; 9A5238F318799E3200940ED4 /* ControlPanelControllee.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52374E18799E3100940ED4 /* ControlPanelControllee.cc */; }; 9A5238F418799E3200940ED4 /* ControlPanelControlleeUnit.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52374F18799E3100940ED4 /* ControlPanelControlleeUnit.cc */; }; 9A5238F518799E3200940ED4 /* ControlPanelController.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375018799E3100940ED4 /* ControlPanelController.cc */; }; 9A5238F618799E3200940ED4 /* ControlPanelControllerUnit.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375118799E3100940ED4 /* ControlPanelControllerUnit.cc */; }; 9A5238F718799E3200940ED4 /* ControlPanelDevice.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375218799E3100940ED4 /* ControlPanelDevice.cc */; }; 9A5238F818799E3200940ED4 /* ControlPanelService.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375318799E3100940ED4 /* ControlPanelService.cc */; }; 9A5238F918799E3200940ED4 /* ControlPanelSessionHandler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375418799E3100940ED4 /* ControlPanelSessionHandler.cc */; }; 9A5238FA18799E3200940ED4 /* LanguageSet.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375518799E3100940ED4 /* LanguageSet.cc */; }; 9A5238FB18799E3200940ED4 /* LanguageSets.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375618799E3100940ED4 /* LanguageSets.cc */; }; 9A5238FC18799E3200940ED4 /* NotificationAction.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375718799E3100940ED4 /* NotificationAction.cc */; }; 9A5238FD18799E3200940ED4 /* Action.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375A18799E3100940ED4 /* Action.cc */; }; 9A5238FE18799E3200940ED4 /* ActionWithDialog.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375B18799E3100940ED4 /* ActionWithDialog.cc */; }; 9A5238FF18799E3200940ED4 /* ConstraintList.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375C18799E3100940ED4 /* ConstraintList.cc */; }; 9A52390018799E3200940ED4 /* ConstraintRange.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375D18799E3100940ED4 /* ConstraintRange.cc */; }; 9A52390118799E3200940ED4 /* Container.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375E18799E3100940ED4 /* Container.cc */; }; 9A52390218799E3200940ED4 /* CPSDate.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52375F18799E3100940ED4 /* CPSDate.cc */; }; 9A52390318799E3200940ED4 /* CPSTime.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52376018799E3100940ED4 /* CPSTime.cc */; }; 9A52390418799E3200940ED4 /* Dialog.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52376118799E3100940ED4 /* Dialog.cc */; }; 9A52390518799E3200940ED4 /* HttpControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52376218799E3100940ED4 /* HttpControl.cc */; }; 9A52390618799E3200940ED4 /* Label.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52376318799E3100940ED4 /* Label.cc */; }; 9A52390718799E3200940ED4 /* Property.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52376418799E3100940ED4 /* Property.cc */; }; 9A52390818799E3200940ED4 /* RootWidget.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52376518799E3100940ED4 /* RootWidget.cc */; }; 9A52390918799E3200940ED4 /* Widget.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A52376618799E3100940ED4 /* Widget.cc */; }; 9AB9CDD618547B37004660C5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AB9CDD518547B37004660C5 /* Foundation.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ 9AB9CDD018547B37004660C5 /* Copy Files */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = inc/alljoyn/controlpanel; dstSubfolderSpec = 16; files = ( 19DCFB5F18A79D6C009EC74D /* ErrorWidget.h in Copy Files */, 19DCFB6018A79D6C009EC74D /* Action.h in Copy Files */, 19DCFB6118A79D6C009EC74D /* ActionWithDialog.h in Copy Files */, 19DCFB6218A79D6C009EC74D /* ConstraintList.h in Copy Files */, 19DCFB6318A79D6C009EC74D /* ConstraintRange.h in Copy Files */, 19DCFB6418A79D6C009EC74D /* Container.h in Copy Files */, 19DCFB6518A79D6C009EC74D /* ControlPanel.h in Copy Files */, 19DCFB6618A79D6C009EC74D /* ControlPanelBusListener.h in Copy Files */, 19DCFB6718A79D6C009EC74D /* ControlPanelControllee.h in Copy Files */, 19DCFB6818A79D6C009EC74D /* ControlPanelControlleeUnit.h in Copy Files */, 19DCFB6918A79D6C009EC74D /* ControlPanelController.h in Copy Files */, 19DCFB6A18A79D6C009EC74D /* ControlPanelControllerUnit.h in Copy Files */, 19DCFB6B18A79D6C009EC74D /* ControlPanelDevice.h in Copy Files */, 19DCFB6C18A79D6C009EC74D /* ControlPanelEnums.h in Copy Files */, 19DCFB6D18A79D6C009EC74D /* ControlPanelListener.h in Copy Files */, 19DCFB6E18A79D6C009EC74D /* ControlPanelService.h in Copy Files */, 19DCFB6F18A79D6C009EC74D /* ControlPanelSessionHandler.h in Copy Files */, 19DCFB7018A79D6C009EC74D /* CPSDate.h in Copy Files */, 19DCFB7118A79D6C009EC74D /* CPSTime.h in Copy Files */, 19DCFB7218A79D6C009EC74D /* Dialog.h in Copy Files */, 19DCFB7318A79D6C009EC74D /* HttpControl.h in Copy Files */, 19DCFB7418A79D6C009EC74D /* Label.h in Copy Files */, 19DCFB7518A79D6C009EC74D /* LanguageSet.h in Copy Files */, 19DCFB7618A79D6C009EC74D /* LanguageSets.h in Copy Files */, 19DCFB7718A79D6C009EC74D /* NotificationAction.h in Copy Files */, 19DCFB7818A79D6C009EC74D /* Property.h in Copy Files */, 19DCFB7918A79D6C009EC74D /* RootWidget.h in Copy Files */, 19DCFB7A18A79D6C009EC74D /* Widget.h in Copy Files */, ); name = "Copy Files"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 9A23680F189A274C00FC88E8 /* ErrorWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorWidget.h; sourceTree = ""; }; 9A236810189A276700FC88E8 /* WidgetProxyBusObjectListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WidgetProxyBusObjectListener.h; sourceTree = ""; }; 9A236811189A276700FC88E8 /* WidgetProxyBusObjectListener.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WidgetProxyBusObjectListener.cc; sourceTree = ""; }; 9A236813189A277000FC88E8 /* ErrorWidget.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorWidget.cc; sourceTree = ""; }; 9A5236F818799E3100940ED4 /* Action.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Action.h; sourceTree = ""; }; 9A5236F918799E3100940ED4 /* ActionWithDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActionWithDialog.h; sourceTree = ""; }; 9A5236FA18799E3100940ED4 /* ConstraintList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstraintList.h; sourceTree = ""; }; 9A5236FB18799E3100940ED4 /* ConstraintRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstraintRange.h; sourceTree = ""; }; 9A5236FC18799E3100940ED4 /* Container.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Container.h; sourceTree = ""; }; 9A5236FD18799E3100940ED4 /* ControlPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPanel.h; sourceTree = ""; }; 9A5236FE18799E3100940ED4 /* ControlPanelBusListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPanelBusListener.h; sourceTree = ""; }; 9A5236FF18799E3100940ED4 /* ControlPanelControllee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPanelControllee.h; sourceTree = ""; }; 9A52370018799E3100940ED4 /* ControlPanelControlleeUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPanelControlleeUnit.h; sourceTree = ""; }; 9A52370118799E3100940ED4 /* ControlPanelController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPanelController.h; sourceTree = ""; }; 9A52370218799E3100940ED4 /* ControlPanelControllerUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPanelControllerUnit.h; sourceTree = ""; }; 9A52370318799E3100940ED4 /* ControlPanelDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPanelDevice.h; sourceTree = ""; }; 9A52370418799E3100940ED4 /* ControlPanelEnums.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPanelEnums.h; sourceTree = ""; }; 9A52370518799E3100940ED4 /* ControlPanelListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPanelListener.h; sourceTree = ""; }; 9A52370618799E3100940ED4 /* ControlPanelService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPanelService.h; sourceTree = ""; }; 9A52370718799E3100940ED4 /* ControlPanelSessionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPanelSessionHandler.h; sourceTree = ""; }; 9A52370818799E3100940ED4 /* CPSDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPSDate.h; sourceTree = ""; }; 9A52370918799E3100940ED4 /* CPSTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPSTime.h; sourceTree = ""; }; 9A52370A18799E3100940ED4 /* Dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Dialog.h; sourceTree = ""; }; 9A52370B18799E3100940ED4 /* HttpControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpControl.h; sourceTree = ""; }; 9A52370C18799E3100940ED4 /* Label.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Label.h; sourceTree = ""; }; 9A52370D18799E3100940ED4 /* LanguageSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LanguageSet.h; sourceTree = ""; }; 9A52370E18799E3100940ED4 /* LanguageSets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LanguageSets.h; sourceTree = ""; }; 9A52370F18799E3100940ED4 /* NotificationAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationAction.h; sourceTree = ""; }; 9A52371018799E3100940ED4 /* Property.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Property.h; sourceTree = ""; }; 9A52371118799E3100940ED4 /* RootWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootWidget.h; sourceTree = ""; }; 9A52371218799E3100940ED4 /* Widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Widget.h; sourceTree = ""; }; 9A52373718799E3100940ED4 /* ActionBusObject.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActionBusObject.cc; sourceTree = ""; }; 9A52373818799E3100940ED4 /* ActionBusObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActionBusObject.h; sourceTree = ""; }; 9A52373918799E3100940ED4 /* ContainerBusObject.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContainerBusObject.cc; sourceTree = ""; }; 9A52373A18799E3100940ED4 /* ContainerBusObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContainerBusObject.h; sourceTree = ""; }; 9A52373B18799E3100940ED4 /* ControlPanelBusObject.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ControlPanelBusObject.cc; sourceTree = ""; }; 9A52373C18799E3100940ED4 /* ControlPanelBusObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPanelBusObject.h; sourceTree = ""; }; 9A52373D18799E3100940ED4 /* DialogBusObject.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DialogBusObject.cc; sourceTree = ""; }; 9A52373E18799E3100940ED4 /* DialogBusObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DialogBusObject.h; sourceTree = ""; }; 9A52373F18799E3100940ED4 /* HttpControlBusObject.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpControlBusObject.cc; sourceTree = ""; }; 9A52374018799E3100940ED4 /* HttpControlBusObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpControlBusObject.h; sourceTree = ""; }; 9A52374118799E3100940ED4 /* IntrospectionNode.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntrospectionNode.cc; sourceTree = ""; }; 9A52374218799E3100940ED4 /* IntrospectionNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntrospectionNode.h; sourceTree = ""; }; 9A52374318799E3100940ED4 /* LabelBusObject.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LabelBusObject.cc; sourceTree = ""; }; 9A52374418799E3100940ED4 /* LabelBusObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelBusObject.h; sourceTree = ""; }; 9A52374518799E3100940ED4 /* NotificationActionBusObject.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationActionBusObject.cc; sourceTree = ""; }; 9A52374618799E3100940ED4 /* NotificationActionBusObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationActionBusObject.h; sourceTree = ""; }; 9A52374718799E3100940ED4 /* PropertyBusObject.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PropertyBusObject.cc; sourceTree = ""; }; 9A52374818799E3100940ED4 /* PropertyBusObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyBusObject.h; sourceTree = ""; }; 9A52374918799E3100940ED4 /* WidgetBusObject.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WidgetBusObject.cc; sourceTree = ""; }; 9A52374A18799E3100940ED4 /* WidgetBusObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WidgetBusObject.h; sourceTree = ""; }; 9A52374B18799E3100940ED4 /* ControlPanel.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ControlPanel.cc; sourceTree = ""; }; 9A52374C18799E3100940ED4 /* ControlPanelBusListener.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ControlPanelBusListener.cc; sourceTree = ""; }; 9A52374D18799E3100940ED4 /* ControlPanelConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPanelConstants.h; sourceTree = ""; }; 9A52374E18799E3100940ED4 /* ControlPanelControllee.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ControlPanelControllee.cc; sourceTree = ""; }; 9A52374F18799E3100940ED4 /* ControlPanelControlleeUnit.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ControlPanelControlleeUnit.cc; sourceTree = ""; }; 9A52375018799E3100940ED4 /* ControlPanelController.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ControlPanelController.cc; sourceTree = ""; }; 9A52375118799E3100940ED4 /* ControlPanelControllerUnit.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ControlPanelControllerUnit.cc; sourceTree = ""; }; 9A52375218799E3100940ED4 /* ControlPanelDevice.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ControlPanelDevice.cc; sourceTree = ""; }; 9A52375318799E3100940ED4 /* ControlPanelService.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ControlPanelService.cc; sourceTree = ""; }; 9A52375418799E3100940ED4 /* ControlPanelSessionHandler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ControlPanelSessionHandler.cc; sourceTree = ""; }; 9A52375518799E3100940ED4 /* LanguageSet.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LanguageSet.cc; sourceTree = ""; }; 9A52375618799E3100940ED4 /* LanguageSets.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LanguageSets.cc; sourceTree = ""; }; 9A52375718799E3100940ED4 /* NotificationAction.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationAction.cc; sourceTree = ""; }; 9A52375A18799E3100940ED4 /* Action.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Action.cc; sourceTree = ""; }; 9A52375B18799E3100940ED4 /* ActionWithDialog.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActionWithDialog.cc; sourceTree = ""; }; 9A52375C18799E3100940ED4 /* ConstraintList.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstraintList.cc; sourceTree = ""; }; 9A52375D18799E3100940ED4 /* ConstraintRange.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstraintRange.cc; sourceTree = ""; }; 9A52375E18799E3100940ED4 /* Container.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Container.cc; sourceTree = ""; }; 9A52375F18799E3100940ED4 /* CPSDate.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CPSDate.cc; sourceTree = ""; }; 9A52376018799E3100940ED4 /* CPSTime.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CPSTime.cc; sourceTree = ""; }; 9A52376118799E3100940ED4 /* Dialog.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Dialog.cc; sourceTree = ""; }; 9A52376218799E3100940ED4 /* HttpControl.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpControl.cc; sourceTree = ""; }; 9A52376318799E3100940ED4 /* Label.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Label.cc; sourceTree = ""; }; 9A52376418799E3100940ED4 /* Property.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Property.cc; sourceTree = ""; }; 9A52376518799E3100940ED4 /* RootWidget.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RootWidget.cc; sourceTree = ""; }; 9A52376618799E3100940ED4 /* Widget.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Widget.cc; sourceTree = ""; }; 9AB9CDD218547B37004660C5 /* liballjoyn_controlpanel_cpp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liballjoyn_controlpanel_cpp.a; sourceTree = BUILT_PRODUCTS_DIR; }; 9AB9CDD518547B37004660C5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 9AB9CDD918547B37004660C5 /* alljoyn_controlpanel_cpp-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "alljoyn_controlpanel_cpp-Prefix.pch"; sourceTree = ""; }; 9AB9CDE318547B37004660C5 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 9AB9CDE618547B37004660C5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 9AB9CDCF18547B37004660C5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9AB9CDD618547B37004660C5 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 9A5236EE18799E3100940ED4 /* controlpanel */ = { isa = PBXGroup; children = ( 9A5236F018799E3100940ED4 /* cpp */, ); name = controlpanel; path = ../../../..; sourceTree = ""; }; 9A5236F018799E3100940ED4 /* cpp */ = { isa = PBXGroup; children = ( 9A5236F518799E3100940ED4 /* inc */, 9A52373518799E3100940ED4 /* src */, ); path = cpp; sourceTree = ""; }; 9A5236F518799E3100940ED4 /* inc */ = { isa = PBXGroup; children = ( 9A5236F618799E3100940ED4 /* alljoyn */, ); path = inc; sourceTree = ""; }; 9A5236F618799E3100940ED4 /* alljoyn */ = { isa = PBXGroup; children = ( 9A5236F718799E3100940ED4 /* controlpanel */, ); path = alljoyn; sourceTree = ""; }; 9A5236F718799E3100940ED4 /* controlpanel */ = { isa = PBXGroup; children = ( 9A23680F189A274C00FC88E8 /* ErrorWidget.h */, 9A5236F818799E3100940ED4 /* Action.h */, 9A5236F918799E3100940ED4 /* ActionWithDialog.h */, 9A5236FA18799E3100940ED4 /* ConstraintList.h */, 9A5236FB18799E3100940ED4 /* ConstraintRange.h */, 9A5236FC18799E3100940ED4 /* Container.h */, 9A5236FD18799E3100940ED4 /* ControlPanel.h */, 9A5236FE18799E3100940ED4 /* ControlPanelBusListener.h */, 9A5236FF18799E3100940ED4 /* ControlPanelControllee.h */, 9A52370018799E3100940ED4 /* ControlPanelControlleeUnit.h */, 9A52370118799E3100940ED4 /* ControlPanelController.h */, 9A52370218799E3100940ED4 /* ControlPanelControllerUnit.h */, 9A52370318799E3100940ED4 /* ControlPanelDevice.h */, 9A52370418799E3100940ED4 /* ControlPanelEnums.h */, 9A52370518799E3100940ED4 /* ControlPanelListener.h */, 9A52370618799E3100940ED4 /* ControlPanelService.h */, 9A52370718799E3100940ED4 /* ControlPanelSessionHandler.h */, 9A52370818799E3100940ED4 /* CPSDate.h */, 9A52370918799E3100940ED4 /* CPSTime.h */, 9A52370A18799E3100940ED4 /* Dialog.h */, 9A52370B18799E3100940ED4 /* HttpControl.h */, 9A52370C18799E3100940ED4 /* Label.h */, 9A52370D18799E3100940ED4 /* LanguageSet.h */, 9A52370E18799E3100940ED4 /* LanguageSets.h */, 9A52370F18799E3100940ED4 /* NotificationAction.h */, 9A52371018799E3100940ED4 /* Property.h */, 9A52371118799E3100940ED4 /* RootWidget.h */, 9A52371218799E3100940ED4 /* Widget.h */, ); path = controlpanel; sourceTree = ""; }; 9A52373518799E3100940ED4 /* src */ = { isa = PBXGroup; children = ( 9A52373618799E3100940ED4 /* BusObjects */, 9A52374B18799E3100940ED4 /* ControlPanel.cc */, 9A52374C18799E3100940ED4 /* ControlPanelBusListener.cc */, 9A52374D18799E3100940ED4 /* ControlPanelConstants.h */, 9A52374E18799E3100940ED4 /* ControlPanelControllee.cc */, 9A52374F18799E3100940ED4 /* ControlPanelControlleeUnit.cc */, 9A52375018799E3100940ED4 /* ControlPanelController.cc */, 9A52375118799E3100940ED4 /* ControlPanelControllerUnit.cc */, 9A52375218799E3100940ED4 /* ControlPanelDevice.cc */, 9A52375318799E3100940ED4 /* ControlPanelService.cc */, 9A52375418799E3100940ED4 /* ControlPanelSessionHandler.cc */, 9A52375518799E3100940ED4 /* LanguageSet.cc */, 9A52375618799E3100940ED4 /* LanguageSets.cc */, 9A52375718799E3100940ED4 /* NotificationAction.cc */, 9A52375918799E3100940ED4 /* Widgets */, ); path = src; sourceTree = ""; }; 9A52373618799E3100940ED4 /* BusObjects */ = { isa = PBXGroup; children = ( 9A236810189A276700FC88E8 /* WidgetProxyBusObjectListener.h */, 9A236811189A276700FC88E8 /* WidgetProxyBusObjectListener.cc */, 9A52373718799E3100940ED4 /* ActionBusObject.cc */, 9A52373818799E3100940ED4 /* ActionBusObject.h */, 9A52373918799E3100940ED4 /* ContainerBusObject.cc */, 9A52373A18799E3100940ED4 /* ContainerBusObject.h */, 9A52373B18799E3100940ED4 /* ControlPanelBusObject.cc */, 9A52373C18799E3100940ED4 /* ControlPanelBusObject.h */, 9A52373D18799E3100940ED4 /* DialogBusObject.cc */, 9A52373E18799E3100940ED4 /* DialogBusObject.h */, 9A52373F18799E3100940ED4 /* HttpControlBusObject.cc */, 9A52374018799E3100940ED4 /* HttpControlBusObject.h */, 9A52374118799E3100940ED4 /* IntrospectionNode.cc */, 9A52374218799E3100940ED4 /* IntrospectionNode.h */, 9A52374318799E3100940ED4 /* LabelBusObject.cc */, 9A52374418799E3100940ED4 /* LabelBusObject.h */, 9A52374518799E3100940ED4 /* NotificationActionBusObject.cc */, 9A52374618799E3100940ED4 /* NotificationActionBusObject.h */, 9A52374718799E3100940ED4 /* PropertyBusObject.cc */, 9A52374818799E3100940ED4 /* PropertyBusObject.h */, 9A52374918799E3100940ED4 /* WidgetBusObject.cc */, 9A52374A18799E3100940ED4 /* WidgetBusObject.h */, ); path = BusObjects; sourceTree = ""; }; 9A52375918799E3100940ED4 /* Widgets */ = { isa = PBXGroup; children = ( 9A236813189A277000FC88E8 /* ErrorWidget.cc */, 9A52375A18799E3100940ED4 /* Action.cc */, 9A52375B18799E3100940ED4 /* ActionWithDialog.cc */, 9A52375C18799E3100940ED4 /* ConstraintList.cc */, 9A52375D18799E3100940ED4 /* ConstraintRange.cc */, 9A52375E18799E3100940ED4 /* Container.cc */, 9A52375F18799E3100940ED4 /* CPSDate.cc */, 9A52376018799E3100940ED4 /* CPSTime.cc */, 9A52376118799E3100940ED4 /* Dialog.cc */, 9A52376218799E3100940ED4 /* HttpControl.cc */, 9A52376318799E3100940ED4 /* Label.cc */, 9A52376418799E3100940ED4 /* Property.cc */, 9A52376518799E3100940ED4 /* RootWidget.cc */, 9A52376618799E3100940ED4 /* Widget.cc */, ); path = Widgets; sourceTree = ""; }; 9AB9CDC918547B37004660C5 = { isa = PBXGroup; children = ( 9AB9CDD718547B37004660C5 /* alljoyn_services_cpp */, 9AB9CDD418547B37004660C5 /* Frameworks */, 9AB9CDD318547B37004660C5 /* Products */, ); sourceTree = ""; }; 9AB9CDD318547B37004660C5 /* Products */ = { isa = PBXGroup; children = ( 9AB9CDD218547B37004660C5 /* liballjoyn_controlpanel_cpp.a */, ); name = Products; sourceTree = ""; }; 9AB9CDD418547B37004660C5 /* Frameworks */ = { isa = PBXGroup; children = ( 9AB9CDD518547B37004660C5 /* Foundation.framework */, 9AB9CDE318547B37004660C5 /* XCTest.framework */, 9AB9CDE618547B37004660C5 /* UIKit.framework */, ); name = Frameworks; sourceTree = ""; }; 9AB9CDD718547B37004660C5 /* alljoyn_services_cpp */ = { isa = PBXGroup; children = ( 9A5236EE18799E3100940ED4 /* controlpanel */, 9AB9CDD818547B37004660C5 /* Supporting Files */, ); path = alljoyn_services_cpp; sourceTree = ""; }; 9AB9CDD818547B37004660C5 /* Supporting Files */ = { isa = PBXGroup; children = ( 9AB9CDD918547B37004660C5 /* alljoyn_controlpanel_cpp-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 9AB9CDD118547B37004660C5 /* alljoyn_controlpanel_cpp */ = { isa = PBXNativeTarget; buildConfigurationList = 9AB9CDF518547B37004660C5 /* Build configuration list for PBXNativeTarget "alljoyn_controlpanel_cpp" */; buildPhases = ( 9AB9CDCE18547B37004660C5 /* Sources */, 9AB9CDCF18547B37004660C5 /* Frameworks */, 9AB9CDD018547B37004660C5 /* Copy Files */, ); buildRules = ( ); dependencies = ( ); name = alljoyn_controlpanel_cpp; productName = alljoyn_services_cpp; productReference = 9AB9CDD218547B37004660C5 /* liballjoyn_controlpanel_cpp.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 9AB9CDCA18547B37004660C5 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0510; ORGANIZATIONNAME = AllJoyn; }; buildConfigurationList = 9AB9CDCD18547B37004660C5 /* Build configuration list for PBXProject "alljoyn_controlpanel_cpp" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 9AB9CDC918547B37004660C5; productRefGroup = 9AB9CDD318547B37004660C5 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 9AB9CDD118547B37004660C5 /* alljoyn_controlpanel_cpp */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ 9AB9CDCE18547B37004660C5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 9A5238FA18799E3200940ED4 /* LanguageSet.cc in Sources */, 9A5238EA18799E3200940ED4 /* DialogBusObject.cc in Sources */, 9A52390518799E3200940ED4 /* HttpControl.cc in Sources */, 9A5238EC18799E3200940ED4 /* IntrospectionNode.cc in Sources */, 9A5238ED18799E3200940ED4 /* LabelBusObject.cc in Sources */, 9A5238EF18799E3200940ED4 /* PropertyBusObject.cc in Sources */, 9A52390818799E3200940ED4 /* RootWidget.cc in Sources */, 9A5238FC18799E3200940ED4 /* NotificationAction.cc in Sources */, 9A52390618799E3200940ED4 /* Label.cc in Sources */, 9A52390118799E3200940ED4 /* Container.cc in Sources */, 9A52390718799E3200940ED4 /* Property.cc in Sources */, 9A5238FF18799E3200940ED4 /* ConstraintList.cc in Sources */, 9A52390318799E3200940ED4 /* CPSTime.cc in Sources */, 9A5238F418799E3200940ED4 /* ControlPanelControlleeUnit.cc in Sources */, 9A5238F918799E3200940ED4 /* ControlPanelSessionHandler.cc in Sources */, 9A52390918799E3200940ED4 /* Widget.cc in Sources */, 9A5238FD18799E3200940ED4 /* Action.cc in Sources */, 9A52390018799E3200940ED4 /* ConstraintRange.cc in Sources */, 9A5238F718799E3200940ED4 /* ControlPanelDevice.cc in Sources */, 9A5238F818799E3200940ED4 /* ControlPanelService.cc in Sources */, 9A52390218799E3200940ED4 /* CPSDate.cc in Sources */, 9A5238F518799E3200940ED4 /* ControlPanelController.cc in Sources */, 9A5238F218799E3200940ED4 /* ControlPanelBusListener.cc in Sources */, 9A5238E918799E3200940ED4 /* ControlPanelBusObject.cc in Sources */, 9A5238FE18799E3200940ED4 /* ActionWithDialog.cc in Sources */, 9A52390418799E3200940ED4 /* Dialog.cc in Sources */, 9A5238EE18799E3200940ED4 /* NotificationActionBusObject.cc in Sources */, 9A236812189A276700FC88E8 /* WidgetProxyBusObjectListener.cc in Sources */, 9A5238FB18799E3200940ED4 /* LanguageSets.cc in Sources */, 9A5238E718799E3200940ED4 /* ActionBusObject.cc in Sources */, 9A5238F118799E3200940ED4 /* ControlPanel.cc in Sources */, 9A5238F018799E3200940ED4 /* WidgetBusObject.cc in Sources */, 9A5238E818799E3200940ED4 /* ContainerBusObject.cc in Sources */, 9A5238F318799E3200940ED4 /* ControlPanelControllee.cc in Sources */, 9A5238EB18799E3200940ED4 /* HttpControlBusObject.cc in Sources */, 9A5238F618799E3200940ED4 /* ControlPanelControllerUnit.cc in Sources */, 9A236814189A277000FC88E8 /* ErrorWidget.cc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ 9AB9CDF318547B37004660C5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = NO; SDKROOT = iphoneos; VALID_ARCHS = "armv7 armv7s i386"; }; name = Debug; }; 9AB9CDF418547B37004660C5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.0; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; VALID_ARCHS = "armv7 armv7s i386"; }; name = Release; }; 9AB9CDF618547B37004660C5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "compiler-default"; CLANG_ENABLE_MODULES = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; DSTROOT = /tmp/alljoyn_services_cpp.dst; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_cpp/alljoyn_controlpanel_cpp-Prefix.pch"; GCC_WARN_ABOUT_RETURN_TYPE = YES; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "$(inherited)", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/controlpanel/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/cpp/inc\"", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib\"", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib\"", ); OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", "-DUSE_SAMPLE_LOGGER", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = alljoyn_controlpanel_cpp; SKIP_INSTALL = YES; VALID_ARCHS = "arm64 armv7 armv7s i386"; }; name = Debug; }; 9AB9CDF718547B37004660C5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "compiler-default"; CLANG_ENABLE_MODULES = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; DSTROOT = /tmp/alljoyn_services_cpp.dst; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_cpp/alljoyn_controlpanel_cpp-Prefix.pch"; GCC_WARN_ABOUT_RETURN_TYPE = YES; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "$(inherited)", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/controlpanel/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/cpp/inc\"", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib\"", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib\"", ); OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", "-DUSE_SAMPLE_LOGGER", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = alljoyn_controlpanel_cpp; SKIP_INSTALL = YES; VALID_ARCHS = "arm64 armv7 armv7s i386"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 9AB9CDCD18547B37004660C5 /* Build configuration list for PBXProject "alljoyn_controlpanel_cpp" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AB9CDF318547B37004660C5 /* Debug */, 9AB9CDF418547B37004660C5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 9AB9CDF518547B37004660C5 /* Build configuration list for PBXNativeTarget "alljoyn_controlpanel_cpp" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AB9CDF618547B37004660C5 /* Debug */, 9AB9CDF718547B37004660C5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 9AB9CDCA18547B37004660C5 /* Project object */; } project.xcworkspace/000077500000000000000000000000001262264444500366335ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/alljoyn_services_cpp/alljoyn_controlpanel_cpp.xcodeprojcontents.xcworkspacedata000066400000000000000000000002511262264444500435730ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/alljoyn_services_cpp/alljoyn_controlpanel_cpp.xcodeproj/project.xcworkspace base-15.09/controlpanel/ios/samples/alljoyn_services_cpp/alljoyn_services_cpp/000077500000000000000000000000001262264444500300435ustar00rootroot00000000000000alljoyn_controlpanel_cpp-Prefix.pch000066400000000000000000000020151262264444500370030ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/alljoyn_services_cpp/alljoyn_services_cpp/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef __OBJC__ #import #endif base-15.09/controlpanel/ios/samples/alljoyn_services_objc/000077500000000000000000000000001262264444500237615ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/alljoyn_services_objc/alljoyn_controlpanel_objc.xcodeproj/000077500000000000000000000000001262264444500332025ustar00rootroot00000000000000project.pbxproj000066400000000000000000001372701262264444500362110ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/alljoyn_services_objc/alljoyn_controlpanel_objc.xcodeproj// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 9A6A7EC918A90B5500287EF5 /* AJCPSAction.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E12718A8DF59007080F6 /* AJCPSAction.h */; }; 9A6A7ECA18A90B5500287EF5 /* AJCPSActionWithDialog.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E12818A8DF59007080F6 /* AJCPSActionWithDialog.h */; }; 9A6A7ECB18A90B5500287EF5 /* AJCPSConstraintList.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E12918A8DF59007080F6 /* AJCPSConstraintList.h */; }; 9A6A7ECC18A90B5500287EF5 /* AJCPSConstraintRange.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E12A18A8DF59007080F6 /* AJCPSConstraintRange.h */; }; 9A6A7ECD18A90B5500287EF5 /* AJCPSContainer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E12B18A8DF59007080F6 /* AJCPSContainer.h */; }; 9A6A7ECE18A90B5500287EF5 /* AJCPSControllerUpdateEvents.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E12D18A8DF59007080F6 /* AJCPSControllerUpdateEvents.h */; }; 9A6A7ECF18A90B5500287EF5 /* AJCPSControlPanel.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E12E18A8DF59007080F6 /* AJCPSControlPanel.h */; }; 9A6A7ED018A90B5500287EF5 /* AJCPSControlPanelController.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E12F18A8DF59007080F6 /* AJCPSControlPanelController.h */; }; 9A6A7ED118A90B5500287EF5 /* AJCPSControlPanelControllerUnit.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13018A8DF59007080F6 /* AJCPSControlPanelControllerUnit.h */; }; 9A6A7ED218A90B5500287EF5 /* AJCPSControlPanelDevice.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13118A8DF59007080F6 /* AJCPSControlPanelDevice.h */; }; 9A6A7ED318A90B5500287EF5 /* AJCPSControlPanelEnums.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13218A8DF59007080F6 /* AJCPSControlPanelEnums.h */; }; 9A6A7ED418A90B5500287EF5 /* AJCPSControlPanelListener.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13318A8DF59007080F6 /* AJCPSControlPanelListener.h */; }; 9A6A7ED518A90B5500287EF5 /* AJCPSControlPanelListenerAdapter.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13418A8DF59007080F6 /* AJCPSControlPanelListenerAdapter.h */; }; 9A6A7ED618A90B5500287EF5 /* AJCPSControlPanelService.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13518A8DF59007080F6 /* AJCPSControlPanelService.h */; }; 9A6A7ED718A90B5500287EF5 /* AJCPSCPSDate.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13718A8DF59007080F6 /* AJCPSCPSDate.h */; }; 9A6A7ED818A90B5500287EF5 /* AJCPSCPSTime.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13918A8DF59007080F6 /* AJCPSCPSTime.h */; }; 9A6A7ED918A90B5500287EF5 /* AJCPSDialog.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13A18A8DF59007080F6 /* AJCPSDialog.h */; }; 9A6A7EDA18A90B5500287EF5 /* AJCPSErrorWidget.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13B18A8DF59007080F6 /* AJCPSErrorWidget.h */; }; 9A6A7EDB18A90B5500287EF5 /* AJCPSHttpControl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13D18A8DF59007080F6 /* AJCPSHttpControl.h */; }; 9A6A7EDC18A90B5500287EF5 /* AJCPSLabel.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13E18A8DF59007080F6 /* AJCPSLabel.h */; }; 9A6A7EDD18A90B5500287EF5 /* AJCPSLanguageSet.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13F18A8DF59007080F6 /* AJCPSLanguageSet.h */; }; 9A6A7EDE18A90B5500287EF5 /* AJCPSLanguageSets.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E14018A8DF59007080F6 /* AJCPSLanguageSets.h */; }; 9A6A7EDF18A90B5500287EF5 /* AJCPSNotificationAction.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E14118A8DF59007080F6 /* AJCPSNotificationAction.h */; }; 9A6A7EE018A90B5500287EF5 /* AJCPSProperty.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E14218A8DF59007080F6 /* AJCPSProperty.h */; }; 9A6A7EE118A90B5500287EF5 /* AJCPSRootWidget.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E14318A8DF59007080F6 /* AJCPSRootWidget.h */; }; 9A6A7EE218A90B5500287EF5 /* AJCPSWidget.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E14418A8DF59007080F6 /* AJCPSWidget.h */; }; 9A6A7EE318A90B5C00287EF5 /* AJCPSGetControlPanelViewController.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13C18A8DF59007080F6 /* AJCPSGetControlPanelViewController.h */; }; 9A6A7EE418A90B5C00287EF5 /* AJCPSCPSButtonCell.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13618A8DF59007080F6 /* AJCPSCPSButtonCell.h */; }; 9A6A7EE518A90B5C00287EF5 /* AJCPSCPSGeneralCell.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E13818A8DF59007080F6 /* AJCPSCPSGeneralCell.h */; }; 9A6A7EE618A90B5C00287EF5 /* AJCPSControllerModel.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AC4E12C18A8DF59007080F6 /* AJCPSControllerModel.h */; }; 9AA935ED1854BC2B00378361 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935EC1854BC2B00378361 /* Foundation.framework */; }; 9AA935FB1854BC2B00378361 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935FA1854BC2B00378361 /* XCTest.framework */; }; 9AA935FC1854BC2B00378361 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935EC1854BC2B00378361 /* Foundation.framework */; }; 9AA935FE1854BC2B00378361 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935FD1854BC2B00378361 /* UIKit.framework */; }; 9AA936011854BC2B00378361 /* liballjoyn_controlpanel_objc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935E91854BC2B00378361 /* liballjoyn_controlpanel_objc.a */; }; 9AA936071854BC2B00378361 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9AA936051854BC2B00378361 /* InfoPlist.strings */; }; 9AA936091854BC2B00378361 /* alljoyn_services_objcTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AA936081854BC2B00378361 /* alljoyn_services_objcTests.m */; }; 9AC4E10C18A8DEC7007080F6 /* AJCPSAction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0F118A8DEC7007080F6 /* AJCPSAction.mm */; }; 9AC4E10D18A8DEC7007080F6 /* AJCPSActionWithDialog.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0F218A8DEC7007080F6 /* AJCPSActionWithDialog.mm */; }; 9AC4E10E18A8DEC7007080F6 /* AJCPSConstraintList.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0F318A8DEC7007080F6 /* AJCPSConstraintList.mm */; }; 9AC4E10F18A8DEC7007080F6 /* AJCPSConstraintRange.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0F418A8DEC7007080F6 /* AJCPSConstraintRange.mm */; }; 9AC4E11018A8DEC7007080F6 /* AJCPSContainer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0F518A8DEC7007080F6 /* AJCPSContainer.mm */; }; 9AC4E11118A8DEC7007080F6 /* AJCPSControllerModel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0F618A8DEC7007080F6 /* AJCPSControllerModel.mm */; }; 9AC4E11218A8DEC7007080F6 /* AJCPSControlPanel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0F718A8DEC7007080F6 /* AJCPSControlPanel.mm */; }; 9AC4E11318A8DEC7007080F6 /* AJCPSControlPanelController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0F818A8DEC7007080F6 /* AJCPSControlPanelController.mm */; }; 9AC4E11418A8DEC7007080F6 /* AJCPSControlPanelControllerUnit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0F918A8DEC7007080F6 /* AJCPSControlPanelControllerUnit.mm */; }; 9AC4E11518A8DEC7007080F6 /* AJCPSControlPanelDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0FA18A8DEC7007080F6 /* AJCPSControlPanelDevice.mm */; }; 9AC4E11618A8DEC7007080F6 /* AJCPSControlPanelEnums.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0FB18A8DEC7007080F6 /* AJCPSControlPanelEnums.mm */; }; 9AC4E11718A8DEC7007080F6 /* AJCPSControlPanelService.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0FC18A8DEC7007080F6 /* AJCPSControlPanelService.mm */; }; 9AC4E11818A8DEC7007080F6 /* AJCPSCPSButtonCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0FD18A8DEC7007080F6 /* AJCPSCPSButtonCell.mm */; }; 9AC4E11918A8DEC7007080F6 /* AJCPSCPSDate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0FE18A8DEC7007080F6 /* AJCPSCPSDate.mm */; }; 9AC4E11A18A8DEC7007080F6 /* AJCPSCPSGeneralCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E0FF18A8DEC7007080F6 /* AJCPSCPSGeneralCell.mm */; }; 9AC4E11B18A8DEC7007080F6 /* AJCPSCPSTime.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E10018A8DEC7007080F6 /* AJCPSCPSTime.mm */; }; 9AC4E11C18A8DEC7007080F6 /* AJCPSDialog.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E10118A8DEC7007080F6 /* AJCPSDialog.mm */; }; 9AC4E11D18A8DEC7007080F6 /* AJCPSErrorWidget.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E10218A8DEC7007080F6 /* AJCPSErrorWidget.mm */; }; 9AC4E11E18A8DEC7007080F6 /* AJCPSGetControlPanelViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E10318A8DEC7007080F6 /* AJCPSGetControlPanelViewController.mm */; }; 9AC4E11F18A8DEC7007080F6 /* AJCPSHttpControl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E10418A8DEC7007080F6 /* AJCPSHttpControl.mm */; }; 9AC4E12018A8DEC7007080F6 /* AJCPSLabel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E10518A8DEC7007080F6 /* AJCPSLabel.mm */; }; 9AC4E12118A8DEC7007080F6 /* AJCPSLanguageSet.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E10618A8DEC7007080F6 /* AJCPSLanguageSet.mm */; }; 9AC4E12218A8DEC7007080F6 /* AJCPSLanguageSets.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E10718A8DEC7007080F6 /* AJCPSLanguageSets.mm */; }; 9AC4E12318A8DEC7007080F6 /* AJCPSNotificationAction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E10818A8DEC7007080F6 /* AJCPSNotificationAction.mm */; }; 9AC4E12418A8DEC7007080F6 /* AJCPSProperty.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E10918A8DEC7007080F6 /* AJCPSProperty.mm */; }; 9AC4E12518A8DEC7007080F6 /* AJCPSRootWidget.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E10A18A8DEC7007080F6 /* AJCPSRootWidget.mm */; }; 9AC4E12618A8DEC7007080F6 /* AJCPSWidget.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AC4E10B18A8DEC7007080F6 /* AJCPSWidget.mm */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 9AA935FF1854BC2B00378361 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9AA935E11854BC2B00378361 /* Project object */; proxyType = 1; remoteGlobalIDString = 9AA935E81854BC2B00378361; remoteInfo = alljoyn_services_objc; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 9AA935E71854BC2B00378361 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = inc/alljoyn/controlpanel; dstSubfolderSpec = 16; files = ( 9A6A7EE318A90B5C00287EF5 /* AJCPSGetControlPanelViewController.h in CopyFiles */, 9A6A7EE418A90B5C00287EF5 /* AJCPSCPSButtonCell.h in CopyFiles */, 9A6A7EE518A90B5C00287EF5 /* AJCPSCPSGeneralCell.h in CopyFiles */, 9A6A7EE618A90B5C00287EF5 /* AJCPSControllerModel.h in CopyFiles */, 9A6A7EC918A90B5500287EF5 /* AJCPSAction.h in CopyFiles */, 9A6A7ECA18A90B5500287EF5 /* AJCPSActionWithDialog.h in CopyFiles */, 9A6A7ECB18A90B5500287EF5 /* AJCPSConstraintList.h in CopyFiles */, 9A6A7ECC18A90B5500287EF5 /* AJCPSConstraintRange.h in CopyFiles */, 9A6A7ECD18A90B5500287EF5 /* AJCPSContainer.h in CopyFiles */, 9A6A7ECE18A90B5500287EF5 /* AJCPSControllerUpdateEvents.h in CopyFiles */, 9A6A7ECF18A90B5500287EF5 /* AJCPSControlPanel.h in CopyFiles */, 9A6A7ED018A90B5500287EF5 /* AJCPSControlPanelController.h in CopyFiles */, 9A6A7ED118A90B5500287EF5 /* AJCPSControlPanelControllerUnit.h in CopyFiles */, 9A6A7ED218A90B5500287EF5 /* AJCPSControlPanelDevice.h in CopyFiles */, 9A6A7ED318A90B5500287EF5 /* AJCPSControlPanelEnums.h in CopyFiles */, 9A6A7ED418A90B5500287EF5 /* AJCPSControlPanelListener.h in CopyFiles */, 9A6A7ED518A90B5500287EF5 /* AJCPSControlPanelListenerAdapter.h in CopyFiles */, 9A6A7ED618A90B5500287EF5 /* AJCPSControlPanelService.h in CopyFiles */, 9A6A7ED718A90B5500287EF5 /* AJCPSCPSDate.h in CopyFiles */, 9A6A7ED818A90B5500287EF5 /* AJCPSCPSTime.h in CopyFiles */, 9A6A7ED918A90B5500287EF5 /* AJCPSDialog.h in CopyFiles */, 9A6A7EDA18A90B5500287EF5 /* AJCPSErrorWidget.h in CopyFiles */, 9A6A7EDB18A90B5500287EF5 /* AJCPSHttpControl.h in CopyFiles */, 9A6A7EDC18A90B5500287EF5 /* AJCPSLabel.h in CopyFiles */, 9A6A7EDD18A90B5500287EF5 /* AJCPSLanguageSet.h in CopyFiles */, 9A6A7EDE18A90B5500287EF5 /* AJCPSLanguageSets.h in CopyFiles */, 9A6A7EDF18A90B5500287EF5 /* AJCPSNotificationAction.h in CopyFiles */, 9A6A7EE018A90B5500287EF5 /* AJCPSProperty.h in CopyFiles */, 9A6A7EE118A90B5500287EF5 /* AJCPSRootWidget.h in CopyFiles */, 9A6A7EE218A90B5500287EF5 /* AJCPSWidget.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 9AA935E91854BC2B00378361 /* liballjoyn_controlpanel_objc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liballjoyn_controlpanel_objc.a; sourceTree = BUILT_PRODUCTS_DIR; }; 9AA935EC1854BC2B00378361 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 9AA935F01854BC2B00378361 /* alljoyn_controlpanel_objc-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "alljoyn_controlpanel_objc-Prefix.pch"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 9AA935F91854BC2B00378361 /* alljoyn_controlpanel_objcTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = alljoyn_controlpanel_objcTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 9AA935FA1854BC2B00378361 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 9AA935FD1854BC2B00378361 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; 9AA936041854BC2B00378361 /* alljoyn_controlpanel_objcTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "alljoyn_controlpanel_objcTests-Info.plist"; sourceTree = ""; }; 9AA936061854BC2B00378361 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 9AA936081854BC2B00378361 /* alljoyn_services_objcTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = alljoyn_services_objcTests.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 9AC4E0F118A8DEC7007080F6 /* AJCPSAction.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSAction.mm; sourceTree = ""; }; 9AC4E0F218A8DEC7007080F6 /* AJCPSActionWithDialog.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSActionWithDialog.mm; sourceTree = ""; }; 9AC4E0F318A8DEC7007080F6 /* AJCPSConstraintList.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSConstraintList.mm; sourceTree = ""; }; 9AC4E0F418A8DEC7007080F6 /* AJCPSConstraintRange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSConstraintRange.mm; sourceTree = ""; }; 9AC4E0F518A8DEC7007080F6 /* AJCPSContainer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSContainer.mm; sourceTree = ""; }; 9AC4E0F618A8DEC7007080F6 /* AJCPSControllerModel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSControllerModel.mm; sourceTree = ""; }; 9AC4E0F718A8DEC7007080F6 /* AJCPSControlPanel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSControlPanel.mm; sourceTree = ""; }; 9AC4E0F818A8DEC7007080F6 /* AJCPSControlPanelController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSControlPanelController.mm; sourceTree = ""; }; 9AC4E0F918A8DEC7007080F6 /* AJCPSControlPanelControllerUnit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSControlPanelControllerUnit.mm; sourceTree = ""; }; 9AC4E0FA18A8DEC7007080F6 /* AJCPSControlPanelDevice.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSControlPanelDevice.mm; sourceTree = ""; }; 9AC4E0FB18A8DEC7007080F6 /* AJCPSControlPanelEnums.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSControlPanelEnums.mm; sourceTree = ""; }; 9AC4E0FC18A8DEC7007080F6 /* AJCPSControlPanelService.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSControlPanelService.mm; sourceTree = ""; }; 9AC4E0FD18A8DEC7007080F6 /* AJCPSCPSButtonCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSCPSButtonCell.mm; sourceTree = ""; }; 9AC4E0FE18A8DEC7007080F6 /* AJCPSCPSDate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSCPSDate.mm; sourceTree = ""; }; 9AC4E0FF18A8DEC7007080F6 /* AJCPSCPSGeneralCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSCPSGeneralCell.mm; sourceTree = ""; }; 9AC4E10018A8DEC7007080F6 /* AJCPSCPSTime.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSCPSTime.mm; sourceTree = ""; }; 9AC4E10118A8DEC7007080F6 /* AJCPSDialog.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSDialog.mm; sourceTree = ""; }; 9AC4E10218A8DEC7007080F6 /* AJCPSErrorWidget.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSErrorWidget.mm; sourceTree = ""; }; 9AC4E10318A8DEC7007080F6 /* AJCPSGetControlPanelViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSGetControlPanelViewController.mm; sourceTree = ""; }; 9AC4E10418A8DEC7007080F6 /* AJCPSHttpControl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSHttpControl.mm; sourceTree = ""; }; 9AC4E10518A8DEC7007080F6 /* AJCPSLabel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSLabel.mm; sourceTree = ""; }; 9AC4E10618A8DEC7007080F6 /* AJCPSLanguageSet.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSLanguageSet.mm; sourceTree = ""; }; 9AC4E10718A8DEC7007080F6 /* AJCPSLanguageSets.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSLanguageSets.mm; sourceTree = ""; }; 9AC4E10818A8DEC7007080F6 /* AJCPSNotificationAction.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSNotificationAction.mm; sourceTree = ""; }; 9AC4E10918A8DEC7007080F6 /* AJCPSProperty.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSProperty.mm; sourceTree = ""; }; 9AC4E10A18A8DEC7007080F6 /* AJCPSRootWidget.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSRootWidget.mm; sourceTree = ""; }; 9AC4E10B18A8DEC7007080F6 /* AJCPSWidget.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJCPSWidget.mm; sourceTree = ""; }; 9AC4E12718A8DF59007080F6 /* AJCPSAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSAction.h; sourceTree = ""; }; 9AC4E12818A8DF59007080F6 /* AJCPSActionWithDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSActionWithDialog.h; sourceTree = ""; }; 9AC4E12918A8DF59007080F6 /* AJCPSConstraintList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSConstraintList.h; sourceTree = ""; }; 9AC4E12A18A8DF59007080F6 /* AJCPSConstraintRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSConstraintRange.h; sourceTree = ""; }; 9AC4E12B18A8DF59007080F6 /* AJCPSContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSContainer.h; sourceTree = ""; }; 9AC4E12C18A8DF59007080F6 /* AJCPSControllerModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSControllerModel.h; sourceTree = ""; }; 9AC4E12D18A8DF59007080F6 /* AJCPSControllerUpdateEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSControllerUpdateEvents.h; sourceTree = ""; }; 9AC4E12E18A8DF59007080F6 /* AJCPSControlPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSControlPanel.h; sourceTree = ""; }; 9AC4E12F18A8DF59007080F6 /* AJCPSControlPanelController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSControlPanelController.h; sourceTree = ""; }; 9AC4E13018A8DF59007080F6 /* AJCPSControlPanelControllerUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSControlPanelControllerUnit.h; sourceTree = ""; }; 9AC4E13118A8DF59007080F6 /* AJCPSControlPanelDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSControlPanelDevice.h; sourceTree = ""; }; 9AC4E13218A8DF59007080F6 /* AJCPSControlPanelEnums.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSControlPanelEnums.h; sourceTree = ""; }; 9AC4E13318A8DF59007080F6 /* AJCPSControlPanelListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSControlPanelListener.h; sourceTree = ""; }; 9AC4E13418A8DF59007080F6 /* AJCPSControlPanelListenerAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSControlPanelListenerAdapter.h; sourceTree = ""; }; 9AC4E13518A8DF59007080F6 /* AJCPSControlPanelService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSControlPanelService.h; sourceTree = ""; }; 9AC4E13618A8DF59007080F6 /* AJCPSCPSButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSCPSButtonCell.h; sourceTree = ""; }; 9AC4E13718A8DF59007080F6 /* AJCPSCPSDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSCPSDate.h; sourceTree = ""; }; 9AC4E13818A8DF59007080F6 /* AJCPSCPSGeneralCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSCPSGeneralCell.h; sourceTree = ""; }; 9AC4E13918A8DF59007080F6 /* AJCPSCPSTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSCPSTime.h; sourceTree = ""; }; 9AC4E13A18A8DF59007080F6 /* AJCPSDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSDialog.h; sourceTree = ""; }; 9AC4E13B18A8DF59007080F6 /* AJCPSErrorWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSErrorWidget.h; sourceTree = ""; }; 9AC4E13C18A8DF59007080F6 /* AJCPSGetControlPanelViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSGetControlPanelViewController.h; sourceTree = ""; }; 9AC4E13D18A8DF59007080F6 /* AJCPSHttpControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSHttpControl.h; sourceTree = ""; }; 9AC4E13E18A8DF59007080F6 /* AJCPSLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSLabel.h; sourceTree = ""; }; 9AC4E13F18A8DF59007080F6 /* AJCPSLanguageSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSLanguageSet.h; sourceTree = ""; }; 9AC4E14018A8DF59007080F6 /* AJCPSLanguageSets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSLanguageSets.h; sourceTree = ""; }; 9AC4E14118A8DF59007080F6 /* AJCPSNotificationAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSNotificationAction.h; sourceTree = ""; }; 9AC4E14218A8DF59007080F6 /* AJCPSProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSProperty.h; sourceTree = ""; }; 9AC4E14318A8DF59007080F6 /* AJCPSRootWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSRootWidget.h; sourceTree = ""; }; 9AC4E14418A8DF59007080F6 /* AJCPSWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJCPSWidget.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 9AA935E61854BC2B00378361 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9AA935ED1854BC2B00378361 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 9AA935F61854BC2B00378361 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9AA935FB1854BC2B00378361 /* XCTest.framework in Frameworks */, 9AA936011854BC2B00378361 /* liballjoyn_controlpanel_objc.a in Frameworks */, 9AA935FE1854BC2B00378361 /* UIKit.framework in Frameworks */, 9AA935FC1854BC2B00378361 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 19A86E4C18A245F60000B0FA /* ControlPanelViewController */ = { isa = PBXGroup; children = ( 9AC4E10318A8DEC7007080F6 /* AJCPSGetControlPanelViewController.mm */, 9AC4E0F618A8DEC7007080F6 /* AJCPSControllerModel.mm */, 9AC4E0FD18A8DEC7007080F6 /* AJCPSCPSButtonCell.mm */, 9AC4E0FF18A8DEC7007080F6 /* AJCPSCPSGeneralCell.mm */, ); name = ControlPanelViewController; sourceTree = ""; }; 19A86E4D18A2463D0000B0FA /* ControlPanelViewController */ = { isa = PBXGroup; children = ( 9AC4E13C18A8DF59007080F6 /* AJCPSGetControlPanelViewController.h */, 9AC4E13618A8DF59007080F6 /* AJCPSCPSButtonCell.h */, 9AC4E13818A8DF59007080F6 /* AJCPSCPSGeneralCell.h */, 9AC4E12C18A8DF59007080F6 /* AJCPSControllerModel.h */, ); name = ControlPanelViewController; sourceTree = ""; }; 9AA935E01854BC2B00378361 = { isa = PBXGroup; children = ( 9ACE618A187998630003645A /* controlpanel */, 9AA935EE1854BC2B00378361 /* alljoyn_services_objc */, 9AA936021854BC2B00378361 /* alljoyn_services_objcTests */, 9AA935EB1854BC2B00378361 /* Frameworks */, 9AA935EA1854BC2B00378361 /* Products */, ); sourceTree = ""; }; 9AA935EA1854BC2B00378361 /* Products */ = { isa = PBXGroup; children = ( 9AA935E91854BC2B00378361 /* liballjoyn_controlpanel_objc.a */, 9AA935F91854BC2B00378361 /* alljoyn_controlpanel_objcTests.xctest */, ); name = Products; sourceTree = ""; }; 9AA935EB1854BC2B00378361 /* Frameworks */ = { isa = PBXGroup; children = ( 9AA935EC1854BC2B00378361 /* Foundation.framework */, 9AA935FA1854BC2B00378361 /* XCTest.framework */, 9AA935FD1854BC2B00378361 /* UIKit.framework */, ); name = Frameworks; sourceTree = ""; }; 9AA935EE1854BC2B00378361 /* alljoyn_services_objc */ = { isa = PBXGroup; children = ( 9AA935EF1854BC2B00378361 /* Supporting Files */, ); path = alljoyn_services_objc; sourceTree = ""; }; 9AA935EF1854BC2B00378361 /* Supporting Files */ = { isa = PBXGroup; children = ( 9AA935F01854BC2B00378361 /* alljoyn_controlpanel_objc-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; 9AA936021854BC2B00378361 /* alljoyn_services_objcTests */ = { isa = PBXGroup; children = ( 9AA936081854BC2B00378361 /* alljoyn_services_objcTests.m */, 9AA936031854BC2B00378361 /* Supporting Files */, ); path = alljoyn_services_objcTests; sourceTree = ""; }; 9AA936031854BC2B00378361 /* Supporting Files */ = { isa = PBXGroup; children = ( 9AA936041854BC2B00378361 /* alljoyn_controlpanel_objcTests-Info.plist */, 9AA936051854BC2B00378361 /* InfoPlist.strings */, ); name = "Supporting Files"; sourceTree = ""; }; 9ACE618A187998630003645A /* controlpanel */ = { isa = PBXGroup; children = ( 9ACE622A187998630003645A /* ios */, ); name = controlpanel; path = ../../..; sourceTree = ""; }; 9ACE622A187998630003645A /* ios */ = { isa = PBXGroup; children = ( 9ACE622B187998630003645A /* inc */, 9ACE62FD187998630003645A /* src */, ); path = ios; sourceTree = ""; }; 9ACE622B187998630003645A /* inc */ = { isa = PBXGroup; children = ( 9ACE622C187998630003645A /* alljoyn */, ); path = inc; sourceTree = ""; }; 9ACE622C187998630003645A /* alljoyn */ = { isa = PBXGroup; children = ( 9ACE622D187998630003645A /* controlpanel */, ); path = alljoyn; sourceTree = ""; }; 9ACE622D187998630003645A /* controlpanel */ = { isa = PBXGroup; children = ( 9AC4E12718A8DF59007080F6 /* AJCPSAction.h */, 9AC4E12818A8DF59007080F6 /* AJCPSActionWithDialog.h */, 9AC4E12918A8DF59007080F6 /* AJCPSConstraintList.h */, 9AC4E12A18A8DF59007080F6 /* AJCPSConstraintRange.h */, 9AC4E12B18A8DF59007080F6 /* AJCPSContainer.h */, 9AC4E12D18A8DF59007080F6 /* AJCPSControllerUpdateEvents.h */, 9AC4E12E18A8DF59007080F6 /* AJCPSControlPanel.h */, 9AC4E12F18A8DF59007080F6 /* AJCPSControlPanelController.h */, 9AC4E13018A8DF59007080F6 /* AJCPSControlPanelControllerUnit.h */, 9AC4E13118A8DF59007080F6 /* AJCPSControlPanelDevice.h */, 9AC4E13218A8DF59007080F6 /* AJCPSControlPanelEnums.h */, 9AC4E13318A8DF59007080F6 /* AJCPSControlPanelListener.h */, 9AC4E13418A8DF59007080F6 /* AJCPSControlPanelListenerAdapter.h */, 9AC4E13518A8DF59007080F6 /* AJCPSControlPanelService.h */, 9AC4E13718A8DF59007080F6 /* AJCPSCPSDate.h */, 9AC4E13918A8DF59007080F6 /* AJCPSCPSTime.h */, 9AC4E13A18A8DF59007080F6 /* AJCPSDialog.h */, 9AC4E13B18A8DF59007080F6 /* AJCPSErrorWidget.h */, 9AC4E13D18A8DF59007080F6 /* AJCPSHttpControl.h */, 9AC4E13E18A8DF59007080F6 /* AJCPSLabel.h */, 9AC4E13F18A8DF59007080F6 /* AJCPSLanguageSet.h */, 9AC4E14018A8DF59007080F6 /* AJCPSLanguageSets.h */, 9AC4E14118A8DF59007080F6 /* AJCPSNotificationAction.h */, 9AC4E14218A8DF59007080F6 /* AJCPSProperty.h */, 9AC4E14318A8DF59007080F6 /* AJCPSRootWidget.h */, 9AC4E14418A8DF59007080F6 /* AJCPSWidget.h */, 19A86E4D18A2463D0000B0FA /* ControlPanelViewController */, ); path = controlpanel; sourceTree = ""; }; 9ACE62FD187998630003645A /* src */ = { isa = PBXGroup; children = ( 9AC4E0F118A8DEC7007080F6 /* AJCPSAction.mm */, 9AC4E0F218A8DEC7007080F6 /* AJCPSActionWithDialog.mm */, 9AC4E0F318A8DEC7007080F6 /* AJCPSConstraintList.mm */, 9AC4E0F418A8DEC7007080F6 /* AJCPSConstraintRange.mm */, 9AC4E0F518A8DEC7007080F6 /* AJCPSContainer.mm */, 9AC4E0F718A8DEC7007080F6 /* AJCPSControlPanel.mm */, 9AC4E0F818A8DEC7007080F6 /* AJCPSControlPanelController.mm */, 9AC4E0F918A8DEC7007080F6 /* AJCPSControlPanelControllerUnit.mm */, 9AC4E0FA18A8DEC7007080F6 /* AJCPSControlPanelDevice.mm */, 9AC4E0FB18A8DEC7007080F6 /* AJCPSControlPanelEnums.mm */, 9AC4E0FC18A8DEC7007080F6 /* AJCPSControlPanelService.mm */, 9AC4E0FE18A8DEC7007080F6 /* AJCPSCPSDate.mm */, 9AC4E10018A8DEC7007080F6 /* AJCPSCPSTime.mm */, 9AC4E10118A8DEC7007080F6 /* AJCPSDialog.mm */, 9AC4E10218A8DEC7007080F6 /* AJCPSErrorWidget.mm */, 9AC4E10418A8DEC7007080F6 /* AJCPSHttpControl.mm */, 9AC4E10518A8DEC7007080F6 /* AJCPSLabel.mm */, 9AC4E10618A8DEC7007080F6 /* AJCPSLanguageSet.mm */, 9AC4E10718A8DEC7007080F6 /* AJCPSLanguageSets.mm */, 9AC4E10818A8DEC7007080F6 /* AJCPSNotificationAction.mm */, 9AC4E10918A8DEC7007080F6 /* AJCPSProperty.mm */, 9AC4E10A18A8DEC7007080F6 /* AJCPSRootWidget.mm */, 9AC4E10B18A8DEC7007080F6 /* AJCPSWidget.mm */, 19A86E4C18A245F60000B0FA /* ControlPanelViewController */, ); path = src; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 9AA935E81854BC2B00378361 /* alljoyn_controlpanel_objc */ = { isa = PBXNativeTarget; buildConfigurationList = 9AA9360C1854BC2B00378361 /* Build configuration list for PBXNativeTarget "alljoyn_controlpanel_objc" */; buildPhases = ( 9AA935E51854BC2B00378361 /* Sources */, 9AA935E61854BC2B00378361 /* Frameworks */, 9AA935E71854BC2B00378361 /* CopyFiles */, ); buildRules = ( ); dependencies = ( ); name = alljoyn_controlpanel_objc; productName = alljoyn_services_objc; productReference = 9AA935E91854BC2B00378361 /* liballjoyn_controlpanel_objc.a */; productType = "com.apple.product-type.library.static"; }; 9AA935F81854BC2B00378361 /* alljoyn_controlpanel_objcTests */ = { isa = PBXNativeTarget; buildConfigurationList = 9AA9360F1854BC2B00378361 /* Build configuration list for PBXNativeTarget "alljoyn_controlpanel_objcTests" */; buildPhases = ( 9AA935F51854BC2B00378361 /* Sources */, 9AA935F61854BC2B00378361 /* Frameworks */, 9AA935F71854BC2B00378361 /* Resources */, ); buildRules = ( ); dependencies = ( 9AA936001854BC2B00378361 /* PBXTargetDependency */, ); name = alljoyn_controlpanel_objcTests; productName = alljoyn_services_objcTests; productReference = 9AA935F91854BC2B00378361 /* alljoyn_controlpanel_objcTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 9AA935E11854BC2B00378361 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = AllJoyn; }; buildConfigurationList = 9AA935E41854BC2B00378361 /* Build configuration list for PBXProject "alljoyn_controlpanel_objc" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 9AA935E01854BC2B00378361; productRefGroup = 9AA935EA1854BC2B00378361 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 9AA935E81854BC2B00378361 /* alljoyn_controlpanel_objc */, 9AA935F81854BC2B00378361 /* alljoyn_controlpanel_objcTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 9AA935F71854BC2B00378361 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 9AA936071854BC2B00378361 /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 9AA935E51854BC2B00378361 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 9AC4E11118A8DEC7007080F6 /* AJCPSControllerModel.mm in Sources */, 9AC4E11018A8DEC7007080F6 /* AJCPSContainer.mm in Sources */, 9AC4E11D18A8DEC7007080F6 /* AJCPSErrorWidget.mm in Sources */, 9AC4E11F18A8DEC7007080F6 /* AJCPSHttpControl.mm in Sources */, 9AC4E11518A8DEC7007080F6 /* AJCPSControlPanelDevice.mm in Sources */, 9AC4E11B18A8DEC7007080F6 /* AJCPSCPSTime.mm in Sources */, 9AC4E11818A8DEC7007080F6 /* AJCPSCPSButtonCell.mm in Sources */, 9AC4E12018A8DEC7007080F6 /* AJCPSLabel.mm in Sources */, 9AC4E11C18A8DEC7007080F6 /* AJCPSDialog.mm in Sources */, 9AC4E12218A8DEC7007080F6 /* AJCPSLanguageSets.mm in Sources */, 9AC4E11318A8DEC7007080F6 /* AJCPSControlPanelController.mm in Sources */, 9AC4E11718A8DEC7007080F6 /* AJCPSControlPanelService.mm in Sources */, 9AC4E12618A8DEC7007080F6 /* AJCPSWidget.mm in Sources */, 9AC4E12418A8DEC7007080F6 /* AJCPSProperty.mm in Sources */, 9AC4E11418A8DEC7007080F6 /* AJCPSControlPanelControllerUnit.mm in Sources */, 9AC4E10F18A8DEC7007080F6 /* AJCPSConstraintRange.mm in Sources */, 9AC4E10C18A8DEC7007080F6 /* AJCPSAction.mm in Sources */, 9AC4E10E18A8DEC7007080F6 /* AJCPSConstraintList.mm in Sources */, 9AC4E11918A8DEC7007080F6 /* AJCPSCPSDate.mm in Sources */, 9AC4E12118A8DEC7007080F6 /* AJCPSLanguageSet.mm in Sources */, 9AC4E12318A8DEC7007080F6 /* AJCPSNotificationAction.mm in Sources */, 9AC4E10D18A8DEC7007080F6 /* AJCPSActionWithDialog.mm in Sources */, 9AC4E12518A8DEC7007080F6 /* AJCPSRootWidget.mm in Sources */, 9AC4E11E18A8DEC7007080F6 /* AJCPSGetControlPanelViewController.mm in Sources */, 9AC4E11A18A8DEC7007080F6 /* AJCPSCPSGeneralCell.mm in Sources */, 9AC4E11218A8DEC7007080F6 /* AJCPSControlPanel.mm in Sources */, 9AC4E11618A8DEC7007080F6 /* AJCPSControlPanelEnums.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 9AA935F51854BC2B00378361 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 9AA936091854BC2B00378361 /* alljoyn_services_objcTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 9AA936001854BC2B00378361 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9AA935E81854BC2B00378361 /* alljoyn_controlpanel_objc */; targetProxy = 9AA935FF1854BC2B00378361 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 9AA936051854BC2B00378361 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 9AA936061854BC2B00378361 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 9AA9360A1854BC2B00378361 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; name = Debug; }; 9AA9360B1854BC2B00378361 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.0; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; name = Release; }; 9AA9360D1854BC2B00378361 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; DSTROOT = /tmp/alljoyn_services_objc.dst; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_objc/alljoyn_controlpanel_objc-Prefix.pch"; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "$(inherited)", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/controlpanel/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/ios/inc\"/**", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/controlpanel/ios/inc/alljoyn/controlpanel/\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", "-DUSE_SAMPLE_LOGGER", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = alljoyn_controlpanel_objc; SKIP_INSTALL = YES; VALID_ARCHS = "arm64 armv7 armv7s i386"; }; name = Debug; }; 9AA9360E1854BC2B00378361 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; DSTROOT = /tmp/alljoyn_services_objc.dst; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_objc/alljoyn_controlpanel_objc-Prefix.pch"; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "$(inherited)", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/controlpanel/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/ios/inc\"/**", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/controlpanel/ios/inc/alljoyn/controlpanel/\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", "-DUSE_SAMPLE_LOGGER", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = alljoyn_controlpanel_objc; SKIP_INSTALL = YES; VALID_ARCHS = "arm64 armv7 armv7s i386"; }; name = Release; }; 9AA936101854BC2B00378361 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_objc/alljoyn_services_objc-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"/**", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"/**", "\"$(ALLSEEN_BASE_SERVICES_ROOT)\"/**", "\"$(SRCROOT)/../../../../../common/inc\"", "\"$(SRCROOT)/../../../../../alljoyn_objc/AllJoynFramework/AllJoynFramework\"", "\"$(SRCROOT)/../../../../../applications\"/**", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/notification/cpp/inc/alljoyn/notification/", ); INFOPLIST_FILE = "alljoyn_services_objcTests/alljoyn_controlpanel_objcTests-Info.plist"; PRODUCT_NAME = alljoyn_controlpanel_objcTests; WRAPPER_EXTENSION = xctest; }; name = Debug; }; 9AA936111854BC2B00378361 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_objc/alljoyn_services_objc-Prefix.pch"; HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"/**", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"/**", "\"$(ALLSEEN_BASE_SERVICES_ROOT)\"/**", "\"$(SRCROOT)/../../../../../common/inc\"", "\"$(SRCROOT)/../../../../../alljoyn_objc/AllJoynFramework/AllJoynFramework\"", "\"$(SRCROOT)/../../../../../applications\"/**", ); INFOPLIST_FILE = "alljoyn_services_objcTests/alljoyn_controlpanel_objcTests-Info.plist"; PRODUCT_NAME = alljoyn_controlpanel_objcTests; WRAPPER_EXTENSION = xctest; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 9AA935E41854BC2B00378361 /* Build configuration list for PBXProject "alljoyn_controlpanel_objc" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AA9360A1854BC2B00378361 /* Debug */, 9AA9360B1854BC2B00378361 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 9AA9360C1854BC2B00378361 /* Build configuration list for PBXNativeTarget "alljoyn_controlpanel_objc" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AA9360D1854BC2B00378361 /* Debug */, 9AA9360E1854BC2B00378361 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 9AA9360F1854BC2B00378361 /* Build configuration list for PBXNativeTarget "alljoyn_controlpanel_objcTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AA936101854BC2B00378361 /* Debug */, 9AA936111854BC2B00378361 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 9AA935E11854BC2B00378361 /* Project object */; } project.xcworkspace/000077500000000000000000000000001262264444500371215ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/alljoyn_services_objc/alljoyn_controlpanel_objc.xcodeprojcontents.xcworkspacedata000066400000000000000000000002521262264444500440620ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/alljoyn_services_objc/alljoyn_controlpanel_objc.xcodeproj/project.xcworkspace base-15.09/controlpanel/ios/samples/alljoyn_services_objc/alljoyn_services_objc/000077500000000000000000000000001262264444500303315ustar00rootroot00000000000000alljoyn_controlpanel_objc-Prefix.pch000066400000000000000000000020161262264444500374250ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/alljoyn_services_objc/alljoyn_services_objc/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef __OBJC__ #import #endif base-15.09/controlpanel/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests/000077500000000000000000000000001262264444500313545ustar00rootroot00000000000000alljoyn_controlpanel_objcTests-Info.plist000066400000000000000000000032731262264444500415200ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier org.alljoyn.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType BNDL CFBundleShortVersionString 00.01 CFBundleSignature ???? CFBundleVersion 1 alljoyn_services_objcTests.m000066400000000000000000000027321262264444500370520ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import @interface alljoyn_services_objcTests : XCTestCase @end @implementation alljoyn_services_objcTests - (void)setUp { [super setUp]; // Put setup code here. This method is called before the invocation of each test method in the class. } - (void)tearDown { // Put teardown code here. This method is called after the invocation of each test method in the class. [super tearDown]; } - (void)testExample { XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); } @end base-15.09/controlpanel/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests/en.lproj/000077500000000000000000000000001262264444500331035ustar00rootroot00000000000000InfoPlist.strings000066400000000000000000000000551262264444500363460ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests/en.lproj/* Localized versions of Info.plist keys */ base-15.09/controlpanel/ios/samples/sampleApp/000077500000000000000000000000001262264444500213335ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/sampleApp/AnnounceTextViewController.h000066400000000000000000000022211262264444500270130ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/about/AJNAnnouncement.h" @interface AnnounceTextViewController : UIViewController @property (strong, nonatomic) AJNAnnouncement *ajnAnnouncement; @end base-15.09/controlpanel/ios/samples/sampleApp/AnnounceTextViewController.m000066400000000000000000000064211262264444500270260ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AnnounceTextViewController.h" #import "alljoyn/about/AJNAboutDataConverter.h" @interface AnnounceTextViewController () @property (weak, nonatomic) IBOutlet UITextView *announceInformation; @end @implementation AnnounceTextViewController - (NSString *)objectDescriptionsToString:(NSMutableDictionary *)qnsObjectDesc { NSMutableString *qnsObjectDescContent = [[NSMutableString alloc] init]; for (NSString *key in qnsObjectDesc.allKeys) { // iterate over the NSMutableDictionary // path: [qnsObjectDescContent appendString:[NSString stringWithFormat:@"path: %@ \n", key]]; [qnsObjectDescContent appendString:[NSString stringWithFormat:@"interfaces: "]]; // interfaces: for (NSString *intrf in qnsObjectDesc[key]) { // get NSString from the received object(NSMutableArray) [qnsObjectDescContent appendString:[NSString stringWithFormat:@"%@ ", intrf]]; } [qnsObjectDescContent appendString:[NSString stringWithFormat:@"\n\n"]]; } return (qnsObjectDescContent); } // parseObjectDescriptions - (void)viewDidLoad { [super viewDidLoad]; // retrive AJNAnnouncement by the announcementButtonCurrentTitle unique name NSString *txt = [[NSString alloc] init]; // set title NSString *title = [self.ajnAnnouncement busName]; txt = [txt stringByAppendingFormat:@"%@\n%@\n", title, [@"" stringByPaddingToLength :[title length] + 10 withString : @"-" startingAtIndex : 0]]; // set body txt = [txt stringByAppendingFormat:@"BusName: %@\n", [self.ajnAnnouncement busName]]; txt = [txt stringByAppendingFormat:@"Port: %hu\n", [self.ajnAnnouncement port]]; txt = [txt stringByAppendingFormat:@"Version: %u\n", [self.ajnAnnouncement version]]; txt = [txt stringByAppendingString:@"\n\n"]; // set AboutMap info txt = [txt stringByAppendingFormat:@"About map:\n"]; txt = [txt stringByAppendingString:[AJNAboutDataConverter aboutDataDictionaryToString:([self.ajnAnnouncement aboutData])]]; txt = [txt stringByAppendingString:@"\n\n"]; // set ObjectDesc info txt = [txt stringByAppendingFormat:@"Bus Object Description:\n"]; txt = [txt stringByAppendingString:[self objectDescriptionsToString:[self.ajnAnnouncement objectDescriptions]]]; self.announceInformation.text = txt; } @end base-15.09/controlpanel/ios/samples/sampleApp/AppDelegate.h000066400000000000000000000022611262264444500236600ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNStatus.h" @interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; + (void)alertAndLog:(NSString *)message status:(QStatus)status; @end base-15.09/controlpanel/ios/samples/sampleApp/AppDelegate.m000066400000000000000000000061541262264444500236720ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AppDelegate.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. return YES; } - (void)applicationWillResignActive:(UIApplication *)application { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } - (void)applicationDidEnterBackground:(UIApplication *)application { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - (void)applicationWillEnterForeground:(UIApplication *)application { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } - (void)applicationDidBecomeActive:(UIApplication *)application { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } + (void)alertAndLog:(NSString *)message status:(QStatus)status { NSString *alertText = [NSString stringWithFormat:@"%@ (%@)",message, [AJNStatus descriptionForStatusCode:status]]; NSLog(@"%@", alertText); [[[UIAlertView alloc] initWithTitle:@"Startup Error" message:alertText delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil] show]; } @end base-15.09/controlpanel/ios/samples/sampleApp/AuthenticationListenerImpl.h000066400000000000000000000021541262264444500270150ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNAuthenticationListener.h" @interface AuthenticationListenerImpl : NSObject @end base-15.09/controlpanel/ios/samples/sampleApp/AuthenticationListenerImpl.m000066400000000000000000000152371262264444500270300ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AuthenticationListenerImpl.h" static NSString * const DEFAULT_PASSCODE = @"121212"; // Security @interface AuthenticationListenerImpl () @property (strong, nonatomic) UIAlertView *setPassCodeAlert; //Security @property (strong, nonatomic) NSString *passCodeText; //Security @property (strong, nonatomic) NSString *peerName; //Security @property (strong, nonatomic) NSMutableDictionary *peersPasscodes; // Security - store the peers passcodes @end @implementation AuthenticationListenerImpl - (id)init { self = [super init]; if (self) { [self prepareAlerts]; // Create NSMutableDictionary dictionary of peers passcodes self.peersPasscodes = [[NSMutableDictionary alloc] init]; } return self; } - (void)prepareAlerts { // setPassCodeAlert.tag = 1 self.setPassCodeAlert = [[UIAlertView alloc] initWithTitle:@"" message:@"Enter device password" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; self.setPassCodeAlert.alertViewStyle = UIAlertViewStylePlainTextInput; self.setPassCodeAlert.tag = 1; } // Get the user's input from the alert dialog - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (alertView == self.setPassCodeAlert) { [self.setPassCodeAlert dismissWithClickedButtonIndex:buttonIndex animated:NO]; if (buttonIndex == 1) { // User pressed OK // get the input pass self.passCodeText = [self.setPassCodeAlert textFieldAtIndex:0].text; // [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Passcode is: %@", self.passCodeText]]; NSLog(@"Passcode is: %@", self.passCodeText); bool foundPeer = false; // Check that peername is not empty if ([self.peerName length]) { if (![self.passCodeText length]) { // set the pass to default if input is empty self.passCodeText = DEFAULT_PASSCODE; } // Iterate over the dictionary and add/update for (NSString *key in self.peersPasscodes.allKeys) { if ([key isEqualToString:self.peerName]) { // Update passcode for key (self.peersPasscodes)[self.peerName] = self.passCodeText; // [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Update peer %@ with passcode %@", self.peerName, self.passCodeText]]; NSLog(@"Update peer %@ with passcode %@", self.peerName, self.passCodeText); // Set flag foundPeer = true; break; } } if (!foundPeer) { // Add new set of key/value [self.peersPasscodes setValue:self.passCodeText forKey:self.peerName]; // [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"add new peers %@ %@", self.peerName, self.passCodeText]]; NSLog(@"add new peers %@ %@", self.peerName, self.passCodeText); } [[NSNotificationCenter defaultCenter] postNotificationName:@"hasPasscodeForBus" object:self.peerName]; } } else { // User pressed Cancel } } else { NSLog(@"[%@] [%@] alertView.tag is wrong", @"ERROR", [[self class] description]); } } #pragma mark - AJNAuthenticationListener protocol methods - (AJNSecurityCredentials *)requestSecurityCredentialsWithAuthenticationMechanism:(NSString *)authenticationMechanism peerName:(NSString *)peerName authenticationCount:(uint16_t)authenticationCount userName:(NSString *)userName credentialTypeMask:(AJNSecurityCredentialType)mask { AJNSecurityCredentials *creds = nil; bool credFound = false; NSLog(@"requestSecurityCredentialsWithAuthenticationMechanism:%@ forRemotePeer%@ userName:%@", authenticationMechanism, peerName, userName); if ([authenticationMechanism isEqualToString:@"ALLJOYN_SRP_KEYX"] || [authenticationMechanism isEqualToString:@"ALLJOYN_ECDHE_PSK"]) { if (mask & kAJNSecurityCredentialTypePassword) { if (authenticationCount <= 3) { creds = [[AJNSecurityCredentials alloc] init]; // Check if the password stored in peersPasscodes for (NSString *key in self.peersPasscodes.allKeys) { if ([key isEqualToString:peerName]) { creds.password = (self.peersPasscodes)[key]; NSLog(@"Found password %@ for peer %@", creds.password, key); credFound = true; break; } } // Use the default password if (!credFound) { creds.password = DEFAULT_PASSCODE; NSLog(@"Using default password %@ for peer %@", DEFAULT_PASSCODE, peerName); } } } } return creds; } - (void)authenticationUsing:(NSString *)authenticationMechanism forRemotePeer:(NSString *)peerName didCompleteWithStatus:(BOOL)success { NSString *status; status = (success == YES ? @"was successful" : @"failed"); NSLog(@"authenticationUsing:%@ forRemotePeer%@ %@", authenticationMechanism, peerName, status); // [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"authenticationUsing:%@ forRemotePeer%@ %@", authenticationMechanism, peerName, status]]; //get the passcpde for this bus if (!success) { self.peerName = peerName; self.passCodeText = nil; dispatch_async(dispatch_get_main_queue(), ^{ [self.setPassCodeAlert show]; }); } } @end base-15.09/controlpanel/ios/samples/sampleApp/ClientInformation.h000066400000000000000000000023261262264444500251330ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/about/AJNAnnouncement.h" #import "AJNTransportMask.h" @interface ClientInformation : NSObject @property (strong, nonatomic) AJNAnnouncement *announcement; @property (strong, nonatomic) NSString *currLang; @end base-15.09/controlpanel/ios/samples/sampleApp/ClientInformation.m000066400000000000000000000024241262264444500251370ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "ClientInformation.h" #import "alljoyn/about/AJNAboutDataConverter.h" @implementation ClientInformation - (void)setAnnouncement:(AJNAnnouncement *)announcement { _announcement = announcement; _currLang = [AJNAboutDataConverter messageArgumentToString:[_announcement aboutData][@"DefaultLanguage"]]; } @end base-15.09/controlpanel/ios/samples/sampleApp/CommonBusListener.h000066400000000000000000000033161262264444500251170ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusListener.h" #import "AJNSessionPortListener.h" /** Implementation of the Bus listener. Called by AllJoyn to inform apps of bus related events. */ @interface CommonBusListener : NSObject /** Init the Value of the SessionPort associated with this SessionPortListener @param sessionPort The port of the session @return Object ID */ - (id)initWithServicePort:(AJNSessionPort)servicePort; /** Set the Value of the SessionPort associated with this SessionPortListener @param sessionPort The port of the session */ - (void)setSessionPort:(AJNSessionPort)sessionPort; /** Get the SessionPort of the listener @return The port of the session */ - (AJNSessionPort)sessionPort; @end base-15.09/controlpanel/ios/samples/sampleApp/CommonBusListener.m000066400000000000000000000051451262264444500251260ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "CommonBusListener.h" #import "AJNSessionOptions.h" @interface CommonBusListener () @property AJNSessionPort servicePort; @end @implementation CommonBusListener /** * Accept or reject an incoming JoinSession request. The session does not exist until this * after this function returns. * * This callback is only used by session creators. Therefore it is only called on listeners * passed to BusAttachment::BindSessionPort. * * @param joiner Unique name of potential joiner. * @param sessionPort Session port that was joined. * @param options Session options requested by the joiner. * @return Return true if JoinSession request is accepted. false if rejected. */ - (id)initWithServicePort:(AJNSessionPort)servicePort { self = [super init]; if (self) { self.servicePort = servicePort; } return self; } /** * Set the Value of the SessionPort associated with this SessionPortListener * @param sessionPort */ - (void)setSessionPort:(AJNSessionPort)sessionPort { self.servicePort = sessionPort; } /** * Get the SessionPort of the listener * @return */ - (AJNSessionPort)sessionPort { return self.servicePort; } // protocol method - (BOOL)shouldAcceptSessionJoinerNamed:(NSString *)joiner onSessionPort:(AJNSessionPort)sessionPort withSessionOptions:(AJNSessionOptions *)options { if (sessionPort != self.servicePort) { NSLog(@"Rejecting join attempt on unexpected session port %hu.", sessionPort); return false; } else { NSLog(@"Accepting join session request from %@ (proximity=%c, traffic=%u, transports=%hu).\n", joiner, options.proximity, options.trafficType, options.transports); return true; } } @end base-15.09/controlpanel/ios/samples/sampleApp/ControlPanelService.xcodeproj/000077500000000000000000000000001262264444500272505ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/sampleApp/ControlPanelService.xcodeproj/project.pbxproj000066400000000000000000000665251262264444500323420ustar00rootroot00000000000000// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 19E2F04317E87CE10005851F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F04217E87CE10005851F /* UIKit.framework */; }; 19E2F04517E87CE10005851F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F04417E87CE10005851F /* Foundation.framework */; }; 19E2F04717E87CE10005851F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F04617E87CE10005851F /* CoreGraphics.framework */; }; 19E2F06917E88AF20005851F /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F06817E88AF20005851F /* SystemConfiguration.framework */; }; 19E2F06D17E88B030005851F /* libstdc++.6.0.9.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F06A17E88B030005851F /* libstdc++.6.0.9.dylib */; }; 19E2F06E17E88B030005851F /* libstdc++.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F06B17E88B030005851F /* libstdc++.6.dylib */; }; 19E2F06F17E88B030005851F /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F06C17E88B030005851F /* libstdc++.dylib */; }; 19E2F07417E88B120005851F /* libc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F07117E88B120005851F /* libc++.dylib */; }; 19E2F07517E88B120005851F /* libc++abi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F07217E88B120005851F /* libc++abi.dylib */; }; 49838F67189930CE0007FCC6 /* AuthenticationListenerImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 49838F66189930CE0007FCC6 /* AuthenticationListenerImpl.m */; }; 87D309441A70B44200BD4141 /* libc++.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F07017E88B120005851F /* libc++.1.dylib */; }; 9A0118C5187402B400975CE6 /* CommonBusListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0118BF187402B400975CE6 /* CommonBusListener.m */; }; 9A3DB0BC183A0D2A0063D6BE /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DAFFD183A0D290063D6BE /* Default-568h@2x.png */; }; 9A3DB0BD183A0D2A0063D6BE /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DAFFE183A0D290063D6BE /* Default.png */; }; 9A3DB0BE183A0D2A0063D6BE /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DAFFF183A0D290063D6BE /* Default@2x.png */; }; 9A3DB0BF183A0D2A0063D6BE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DB000183A0D290063D6BE /* InfoPlist.strings */; }; 9A3DB0C1183A0D2A0063D6BE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A3DB004183A0D290063D6BE /* main.m */; }; 9A3DB0C2183A0D2A0063D6BE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A3DB009183A0D290063D6BE /* AppDelegate.m */; }; 9A3DB0C3183A0D2A0063D6BE /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DB00A183A0D290063D6BE /* MainStoryboard_iPhone.storyboard */; }; 9A3DB0C4183A0D2A0063D6BE /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A3DB00C183A0D290063D6BE /* MainViewController.m */; }; 9A3DB315183A19CB0063D6BE /* libc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A3DB314183A19CB0063D6BE /* libc.dylib */; }; 9A5CC10C183D04AA002327C0 /* alljoynicon.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 9A5CC10B183D04AA002327C0 /* alljoynicon.jpeg */; }; 9A5CC10F183D073E002327C0 /* GetAboutCallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5CC10E183D073E002327C0 /* GetAboutCallViewController.m */; }; 9A5EFF7D187044BC002833C1 /* ClientInformation.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5EFF7C187044BC002833C1 /* ClientInformation.m */; }; 9AD3D2DE187191AC00D15544 /* AnnounceTextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD3D2DD187191AC00D15544 /* AnnounceTextViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 19E2F03F17E87CE10005851F /* ControlPanelService.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ControlPanelService.app; sourceTree = BUILT_PRODUCTS_DIR; }; 19E2F04217E87CE10005851F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 19E2F04417E87CE10005851F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 19E2F04617E87CE10005851F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 19E2F06817E88AF20005851F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 19E2F06A17E88B030005851F /* libstdc++.6.0.9.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.6.0.9.dylib"; path = "usr/lib/libstdc++.6.0.9.dylib"; sourceTree = SDKROOT; }; 19E2F06B17E88B030005851F /* libstdc++.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.6.dylib"; path = "usr/lib/libstdc++.6.dylib"; sourceTree = SDKROOT; }; 19E2F06C17E88B030005851F /* libstdc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.dylib"; path = "usr/lib/libstdc++.dylib"; sourceTree = SDKROOT; }; 19E2F07017E88B120005851F /* libc++.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.1.dylib"; path = "usr/lib/libc++.1.dylib"; sourceTree = SDKROOT; }; 19E2F07117E88B120005851F /* libc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.dylib"; path = "usr/lib/libc++.dylib"; sourceTree = SDKROOT; }; 19E2F07217E88B120005851F /* libc++abi.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++abi.dylib"; path = "usr/lib/libc++abi.dylib"; sourceTree = SDKROOT; }; 49838F65189930CE0007FCC6 /* AuthenticationListenerImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationListenerImpl.h; sourceTree = ""; }; 49838F66189930CE0007FCC6 /* AuthenticationListenerImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthenticationListenerImpl.m; sourceTree = ""; }; 9A0118BE187402B400975CE6 /* CommonBusListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonBusListener.h; sourceTree = ""; }; 9A0118BF187402B400975CE6 /* CommonBusListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommonBusListener.m; sourceTree = ""; }; 9A3DAFFB183A0D290063D6BE /* ControlPanelService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ControlPanelService-Info.plist"; sourceTree = ""; }; 9A3DAFFC183A0D290063D6BE /* ControlPanelService-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ControlPanelService-Prefix.pch"; sourceTree = ""; }; 9A3DAFFD183A0D290063D6BE /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 9A3DAFFE183A0D290063D6BE /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 9A3DAFFF183A0D290063D6BE /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 9A3DB001183A0D290063D6BE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 9A3DB004183A0D290063D6BE /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 9A3DB008183A0D290063D6BE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../AppDelegate.h; sourceTree = ""; }; 9A3DB009183A0D290063D6BE /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = ../AppDelegate.m; sourceTree = ""; }; 9A3DB00A183A0D290063D6BE /* MainStoryboard_iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard_iPhone.storyboard; sourceTree = ""; }; 9A3DB00B183A0D290063D6BE /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; 9A3DB00C183A0D290063D6BE /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; 9A3DB314183A19CB0063D6BE /* libc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libc.dylib; path = usr/lib/libc.dylib; sourceTree = SDKROOT; }; 9A5CC10B183D04AA002327C0 /* alljoynicon.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = alljoynicon.jpeg; sourceTree = ""; }; 9A5CC10D183D073E002327C0 /* GetAboutCallViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetAboutCallViewController.h; sourceTree = ""; }; 9A5CC10E183D073E002327C0 /* GetAboutCallViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GetAboutCallViewController.m; sourceTree = ""; }; 9A5EFF7B187044BC002833C1 /* ClientInformation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientInformation.h; sourceTree = ""; }; 9A5EFF7C187044BC002833C1 /* ClientInformation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientInformation.m; sourceTree = ""; }; 9AD3D2DC187191AC00D15544 /* AnnounceTextViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnnounceTextViewController.h; sourceTree = ""; }; 9AD3D2DD187191AC00D15544 /* AnnounceTextViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnnounceTextViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 19E2F03C17E87CE10005851F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9A3DB315183A19CB0063D6BE /* libc.dylib in Frameworks */, 19E2F07417E88B120005851F /* libc++.dylib in Frameworks */, 87D309441A70B44200BD4141 /* libc++.1.dylib in Frameworks */, 19E2F07517E88B120005851F /* libc++abi.dylib in Frameworks */, 19E2F06F17E88B030005851F /* libstdc++.dylib in Frameworks */, 19E2F06E17E88B030005851F /* libstdc++.6.dylib in Frameworks */, 19E2F06D17E88B030005851F /* libstdc++.6.0.9.dylib in Frameworks */, 19E2F06917E88AF20005851F /* SystemConfiguration.framework in Frameworks */, 19E2F04317E87CE10005851F /* UIKit.framework in Frameworks */, 19E2F04517E87CE10005851F /* Foundation.framework in Frameworks */, 19E2F04717E87CE10005851F /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 19E2F03617E87CE10005851F = { isa = PBXGroup; children = ( 9A3DAFF9183A0D290063D6BE /* ViewControllers */, 9AB8994218758EB400BC53DA /* Utils */, 9AB8994118758EA800BC53DA /* StoryBoards */, 9A3DAFFA183A0D290063D6BE /* Resources */, 19E2F04117E87CE10005851F /* Frameworks */, 19E2F04017E87CE10005851F /* Products */, ); sourceTree = ""; }; 19E2F04017E87CE10005851F /* Products */ = { isa = PBXGroup; children = ( 19E2F03F17E87CE10005851F /* ControlPanelService.app */, ); name = Products; sourceTree = ""; }; 19E2F04117E87CE10005851F /* Frameworks */ = { isa = PBXGroup; children = ( 9A3DB314183A19CB0063D6BE /* libc.dylib */, 19E2F07117E88B120005851F /* libc++.dylib */, 19E2F07017E88B120005851F /* libc++.1.dylib */, 19E2F07217E88B120005851F /* libc++abi.dylib */, 19E2F06C17E88B030005851F /* libstdc++.dylib */, 19E2F06B17E88B030005851F /* libstdc++.6.dylib */, 19E2F06A17E88B030005851F /* libstdc++.6.0.9.dylib */, 19E2F06817E88AF20005851F /* SystemConfiguration.framework */, 19E2F04217E87CE10005851F /* UIKit.framework */, 19E2F04417E87CE10005851F /* Foundation.framework */, 19E2F04617E87CE10005851F /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; 9A3DAFF9183A0D290063D6BE /* ViewControllers */ = { isa = PBXGroup; children = ( 9A5CC10D183D073E002327C0 /* GetAboutCallViewController.h */, 9A5CC10E183D073E002327C0 /* GetAboutCallViewController.m */, 9A3DB00B183A0D290063D6BE /* MainViewController.h */, 9A3DB00C183A0D290063D6BE /* MainViewController.m */, 9AD3D2DC187191AC00D15544 /* AnnounceTextViewController.h */, 9AD3D2DD187191AC00D15544 /* AnnounceTextViewController.m */, ); name = ViewControllers; sourceTree = ""; }; 9A3DAFFA183A0D290063D6BE /* Resources */ = { isa = PBXGroup; children = ( 9A3DB008183A0D290063D6BE /* AppDelegate.h */, 9A3DB009183A0D290063D6BE /* AppDelegate.m */, 9A5CC10B183D04AA002327C0 /* alljoynicon.jpeg */, 9A3DAFFB183A0D290063D6BE /* ControlPanelService-Info.plist */, 9A3DAFFC183A0D290063D6BE /* ControlPanelService-Prefix.pch */, 9A3DAFFD183A0D290063D6BE /* Default-568h@2x.png */, 9A3DAFFE183A0D290063D6BE /* Default.png */, 9A3DAFFF183A0D290063D6BE /* Default@2x.png */, 9A3DB000183A0D290063D6BE /* InfoPlist.strings */, 9A3DB004183A0D290063D6BE /* main.m */, ); name = Resources; path = ControlPanelService; sourceTree = ""; }; 9AB8994118758EA800BC53DA /* StoryBoards */ = { isa = PBXGroup; children = ( 9A3DB00A183A0D290063D6BE /* MainStoryboard_iPhone.storyboard */, ); name = StoryBoards; sourceTree = ""; }; 9AB8994218758EB400BC53DA /* Utils */ = { isa = PBXGroup; children = ( 49838F65189930CE0007FCC6 /* AuthenticationListenerImpl.h */, 49838F66189930CE0007FCC6 /* AuthenticationListenerImpl.m */, 9A0118BE187402B400975CE6 /* CommonBusListener.h */, 9A0118BF187402B400975CE6 /* CommonBusListener.m */, 9A5EFF7B187044BC002833C1 /* ClientInformation.h */, 9A5EFF7C187044BC002833C1 /* ClientInformation.m */, ); name = Utils; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 19E2F03E17E87CE10005851F /* ControlPanelService */ = { isa = PBXNativeTarget; buildConfigurationList = 19E2F06517E87CE10005851F /* Build configuration list for PBXNativeTarget "ControlPanelService" */; buildPhases = ( 19E2F03B17E87CE10005851F /* Sources */, 19E2F03C17E87CE10005851F /* Frameworks */, 19E2F03D17E87CE10005851F /* Resources */, ); buildRules = ( ); dependencies = ( ); name = ControlPanelService; productName = ControlPanelService; productReference = 19E2F03F17E87CE10005851F /* ControlPanelService.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 19E2F03717E87CE10005851F /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = AllJoyn; TargetAttributes = { 19E2F03E17E87CE10005851F = { SystemCapabilities = { com.apple.BackgroundModes = { enabled = 0; }; }; }; }; }; buildConfigurationList = 19E2F03A17E87CE10005851F /* Build configuration list for PBXProject "ControlPanelService" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 19E2F03617E87CE10005851F; productRefGroup = 19E2F04017E87CE10005851F /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 19E2F03E17E87CE10005851F /* ControlPanelService */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 19E2F03D17E87CE10005851F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 9A3DB0C3183A0D2A0063D6BE /* MainStoryboard_iPhone.storyboard in Resources */, 9A3DB0BD183A0D2A0063D6BE /* Default.png in Resources */, 9A3DB0BF183A0D2A0063D6BE /* InfoPlist.strings in Resources */, 9A5CC10C183D04AA002327C0 /* alljoynicon.jpeg in Resources */, 9A3DB0BE183A0D2A0063D6BE /* Default@2x.png in Resources */, 9A3DB0BC183A0D2A0063D6BE /* Default-568h@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 19E2F03B17E87CE10005851F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 9A3DB0C4183A0D2A0063D6BE /* MainViewController.m in Sources */, 49838F67189930CE0007FCC6 /* AuthenticationListenerImpl.m in Sources */, 9AD3D2DE187191AC00D15544 /* AnnounceTextViewController.m in Sources */, 9A3DB0C2183A0D2A0063D6BE /* AppDelegate.m in Sources */, 9A5EFF7D187044BC002833C1 /* ClientInformation.m in Sources */, 9A3DB0C1183A0D2A0063D6BE /* main.m in Sources */, 9A0118C5187402B400975CE6 /* CommonBusListener.m in Sources */, 9A5CC10F183D073E002327C0 /* GetAboutCallViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 9A3DB000183A0D290063D6BE /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 9A3DB001183A0D290063D6BE /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 19E2F06317E87CE10005851F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 6.1; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 19E2F06417E87CE10005851F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 6.1; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; 19E2F06617E87CE10005851F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ControlPanelService/ControlPanelService-Prefix.pch"; GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/common/inc\"", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework/\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(SRCROOT)/../../inc\"", "\"$(SRCROOT)/../../../cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/ios/inc\"", ); INFOPLIST_FILE = "ControlPanelService/ControlPanelService-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(OPENSSL_ROOT)/build/$(CONFIGURATION)-$(PLATFORM_NAME)", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "\"$(SRCROOT)/../alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", ); OTHER_LDFLAGS = ( "-lalljoyn", "-lajrouter", "-lssl", "-lcrypto", "-lalljoyn_services_common_objc", "-lalljoyn_services_common_cpp", "-lalljoyn_controlpanel_objc", "-lalljoyn_controlpanel_cpp", "-lalljoyn_about_objc", "-lalljoyn_about_cpp", "-lAllJoynFramework_iOS", ); PRODUCT_NAME = ControlPanelService; PROVISIONING_PROFILE = ""; VALID_ARCHS = "armv7 i386 arm64"; WRAPPER_EXTENSION = app; }; name = Debug; }; 19E2F06717E87CE10005851F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ControlPanelService/ControlPanelService-Prefix.pch"; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/common/inc\"", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework/\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(SRCROOT)/../../inc\"", "\"$(SRCROOT)/../../../cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/ios/inc\"", ); INFOPLIST_FILE = "ControlPanelService/ControlPanelService-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(OPENSSL_ROOT)/build/$(CONFIGURATION)-$(PLATFORM_NAME)", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "\"$(SRCROOT)/../alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", ); OTHER_LDFLAGS = ( "-lalljoyn", "-lajrouter", "-lssl", "-lcrypto", "-lalljoyn_services_common_objc", "-lalljoyn_services_common_cpp", "-lalljoyn_controlpanel_objc", "-lalljoyn_controlpanel_cpp", "-lalljoyn_about_objc", "-lalljoyn_about_cpp", "-lAllJoynFramework_iOS", ); PRODUCT_NAME = ControlPanelService; PROVISIONING_PROFILE = ""; VALID_ARCHS = "armv7 i386 arm64"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 19E2F03A17E87CE10005851F /* Build configuration list for PBXProject "ControlPanelService" */ = { isa = XCConfigurationList; buildConfigurations = ( 19E2F06317E87CE10005851F /* Debug */, 19E2F06417E87CE10005851F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 19E2F06517E87CE10005851F /* Build configuration list for PBXNativeTarget "ControlPanelService" */ = { isa = XCConfigurationList; buildConfigurations = ( 19E2F06617E87CE10005851F /* Debug */, 19E2F06717E87CE10005851F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 19E2F03717E87CE10005851F /* Project object */; } base-15.09/controlpanel/ios/samples/sampleApp/ControlPanelService.xcodeproj/project.xcworkspace/000077500000000000000000000000001262264444500332465ustar00rootroot00000000000000contents.xcworkspacedata000066400000000000000000000002441262264444500401310ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/sampleApp/ControlPanelService.xcodeproj/project.xcworkspace base-15.09/controlpanel/ios/samples/sampleApp/ControlPanelService/000077500000000000000000000000001262264444500252545ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/sampleApp/ControlPanelService/ControlPanelService-Info.plist000066400000000000000000000031521262264444500331440ustar00rootroot00000000000000 CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier org.alljoyn.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 00.01 CFBundleSignature ???? CFBundleVersion 0110 LSRequiresIPhoneOS UIMainStoryboardFile MainStoryboard_iPhone UIMainStoryboardFile~ipad MainStoryboard_iPhone UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight base-15.09/controlpanel/ios/samples/sampleApp/ControlPanelService/ControlPanelService-Prefix.pch000066400000000000000000000022571262264444500331320ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #ifndef __IPHONE_5_0 #warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ #import #import #endif base-15.09/controlpanel/ios/samples/sampleApp/ControlPanelService/Default-568h@2x.png000066400000000000000000000442421262264444500304160ustar00rootroot00000000000000‰PNG  IHDR€pzŹĺ$iCCPICC Profile8…UßoŰT>‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśáiTXtXML:com.adobe.xmp 1 5 72 1 72 640 1 1136 2012-07-27T15:07:06 Pixelmator 2.0.5 )ńq™?7IDATxíŰ=Şže†ŃŤřQń§±qÎĂ™87;;'ŕ RÄBR(J‰…źWĽáw­žł‰Ý^»ą8‰w<řöĽÎű漏ĎűňĽ7Îó @€ü˙^ź~:ď÷óľ;ďůĂóăýóŢ;ď­ó>9Oü @ŕF®¶»ďŹó®ć{}w~|ŢŰç}}ŢŁó®˙ć#@€¸űłĘËó~<ďŐőŔĎĎűč<ńw| @€¸~ÁwµŢWç=»đŠżĎÎó›żŕ#@€ܨŔŐzWóý}×? —†Ź pű÷Wř]'ě#@€ř?~#‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`WŢď& @€ŔÍ Ü_řôĽżn~U  @€\Í÷ô Ŕgçýzžß @ŕF®Ö»šďŮĂóăç˙ţđᙏλ;ĎG€ p;Wü˝<ďńyŻŢ=ďÝóŢ9ĎG€ p;ĎĎ*OÎűáĽÇ×_ż8ďĎóţ>ď·ó^źç#@€¸ «í®Ć»Zďjľ˙LZ9:\‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśŕiTXtXML:com.adobe.xmp 1 5 72 1 72 320 1 480 2012-07-27T15:07:80 Pixelmator 2.0.5 X±=Ć"IDATxíÖŃICQDŃDK°Áć»Iq¦˝ď/L {nđäoÖŔŕýv»ýś÷}Ţ×y>(‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśŕiTXtXML:com.adobe.xmp 1 5 72 1 72 640 1 960 2012-07-27T15:07:37 Pixelmator 2.0.5 PFđ5IDATxíŰ1ŠÝe‡á HHíěÜŽ;qoV.ÂŇÎ.V‚b&“řýa^p Ţßsá›3¦;Ďi^îŕýÝÝÝĎç˝;ď§óŢź÷ĂyŻÎó!@€ř˙ <ź>ś÷ńĽ_Î{x}~\ń÷öĽŻ_ćWgú @€܆ŔŐvWë=ľĚ»űóËoç]ń÷ăyoλţ͇ @ŕvľśU>ť÷ÇyO×7€×ź}Ż*Á‡ p×|Wë}Ţăő˙św}5蛿ŕC€¸aë›ŔĎWô]żř @€Śř>FmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@W>ź÷Ą0  @€nVŕjľç×çLJóŢž÷íy÷çů @€ÜžŔź÷xŕÇë—óŢť÷ć<x| @€7$pĹß§óţ:ďéŐůńÝyž÷ţĽëOÂßś'‚ @ŕúćďú«ďŻçý~ßĂy×7€O/óó™> @€·!pµÝ[ďá_ŠĎ4ěýďlÄIEND®B`‚base-15.09/controlpanel/ios/samples/sampleApp/ControlPanelService/alljoynicon.jpeg000066400000000000000000000031641262264444500304500ustar00rootroot00000000000000˙Ř˙ŕJFIF˙Ű„     "" $(4,$&1'-=-157:::#+?I?8C49:7 8$ $7,57377.,647,,+77/45,,--..7708400,,7,/,,,7.77,54,7˙Ŕ77˙Ä˙Ä5!A12Qa‘"$BqŃ#Rrˇ±Áđ˙Ä˙Ä3 !1AQ"‘±Ń2aqˇÁáđ#3Bb˙Ú ?Üp!LKoćĆšě+{í$©×ÂlćY˙^řpwau˛ŢŘÄ“ťŔt“î4<Ý™&ČZaĐY’ҧ[nť'Ě,ěGžaŚ ą^“eĐĆĐ_)óîŐ¤çrçuE‡)µť<ÎÄř~m{í…şđČTŞ6L±ÇŇÄwŮĚy~{S.ąJ`B”3Ě÷žz5„ĆT±y¨ěŰ}–ő±öóĂâvĘíl¨ZÖş©âűşgě‡ŔË"ŹdV>g¬-7Z†Ęln;9^×ŢÖ#|¸‚¬Í´zĂŘ÷cwÄý´6ÇVµ ä‰ĺľŇ´–cČRx"÷şSkhHČ\Că~lťK7înµŔl ńˇ:Ü÷›]*U×–žë´ĎÔ‘34"AIN› Üűóņô€ćÖ]šf×5á˛î–Ű…őZ/FůĘĹ)qĄ¬®TK$¬ťÖŘOžÄ{b­D{®¸âłn…´ó°v]ň)ż×LHuHýo:JC‹KhBu¨ě ţäá·ěˇý HÍďßtĹřéaA•,˛ŘÝjŰĐ~0˛ą’±ĺÝ­J[–bĆ‹5¤J E¬•¦ýŇylzhĘ·Kűť9ÇĂÚ‘3íů1X¨Ň—Ăť!cŤƆťö°¶ŕ}îN.Ĺľ0í‹főĆ<Ĺ0»ŽâsďĺÜ®ôJµŚĆúÝTEjôRlďEO¨‘éY§ýµĚPXµ0!!ôČ“Ş  ŇxʤŽé?~ĎA‡GÚZŹ ‘†¨ČúŞ Ě-K1ZTTęą/Ăáş°hÓꇱW®f*{ą]1Ý3ĐĺŇ›’žÓż‡aĂ#—_‚u%«~Ăq s|]ZE©tOGrk§úĹÉň>I›.ôj°ę_®şŤ ß«4o«ú•ř÷Âd©ŕŐÉ­ô„X¶śg™ú5¤¶Úm-´„ˇ)JE€Ĺ5–s‹ŤÎ«Ö6o¬Š^™P.ˇYIúś;'ďľ˙`pŘc鄚ĆgŞ'!V‘"`ýj– …ľ‚•jJ”4¨rě$zbŃ…ť3l;%B&Ín˘¶sšŚ•^d®7Â?†®UĆŢ"řYŤ·Źůˇ}‡š*ÎG§ÄOnl‘Hfl—ź‡r¤öw$_–BË’M…ČB⮑Đ!:ú©Ú\TF¤DkŤrůZô)7·ŇŻ{rÄőLÚüMŃuÖ^xśČť-†•N?©<á“g5‚NžËź@¦i°ľHş.ž1QJ^ BŻuDÔ5­Ďq¸ Ťe n7Ă#•ŃßwŠąY ń™ŐŰv%ĆÝj)JP@XPU¬~+€/ᆠ™Ż›(˛é3&B”'„ΨÇLő Č <”ë FŤ=ŢéqmC…°0ĄIy2βěYµ*ja|«©ÚO`:’}đ ‡ n„>ˇ’ő\şéeÚBo©k%× „‘kZŕß™ŰŰQfľúąE‘G˛…=ÚuB ť’ź8Ît… A¤’Ýź'ppw!e(Ôhý\şxď;ÄYPŞú<‡–MĐż˙Ůbase-15.09/controlpanel/ios/samples/sampleApp/ControlPanelService/en.lproj/000077500000000000000000000000001262264444500270035ustar00rootroot00000000000000base-15.09/controlpanel/ios/samples/sampleApp/ControlPanelService/en.lproj/InfoPlist.strings000066400000000000000000000000541262264444500323240ustar00rootroot00000000000000// Localized versions of Info.plist keys base-15.09/controlpanel/ios/samples/sampleApp/ControlPanelService/main.m000066400000000000000000000027371262264444500263670ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AppDelegate.h" #import "AJNInit.h" int main(int argc, char *argv[]) { @autoreleasepool { if ([AJNInit alljoynInit] != ER_OK) { return 1; } if ([AJNInit alljoynRouterInit] != ER_OK) { [AJNInit alljoynShutdown]; return 1; } int ret = UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); [AJNInit alljoynRouterShutdown]; [AJNInit alljoynShutdown]; return ret; } } base-15.09/controlpanel/ios/samples/sampleApp/GetAboutCallViewController.h000066400000000000000000000032621262264444500267140ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ // #import #import "alljoyn/about/AJNAnnouncementReceiver.h" #import "alljoyn/about/AJNAnnouncement.h" #import "alljoyn/about/AJNAboutDataConverter.h" #import "AJNMessageArgument.h" #import "alljoyn/about/AJNAboutClient.h" #import #import #import "alljoyn/about/AJNAboutServiceApi.h" #import "alljoyn/about/AJNAboutService.h" #import "AJNVersion.h" #import "AJNProxyBusObject.h" #import "GetAboutCallViewController.h" #import "ClientInformation.h" @interface GetAboutCallViewController : UIViewController @property (weak, nonatomic) ClientInformation *clientInformation; @property (weak, nonatomic) AJNBusAttachment *clientBusAttachment; @end base-15.09/controlpanel/ios/samples/sampleApp/GetAboutCallViewController.m000066400000000000000000000175211262264444500267240ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ // #import "GetAboutCallViewController.h" static NSString * const CLIENTDEFAULTLANG=@""; @interface GetAboutCallViewController () @property (weak, nonatomic) IBOutlet UILabel *lblVersion; @property (weak, nonatomic) IBOutlet UILabel *lblAboutLanguage; @property (weak, nonatomic) IBOutlet UITextView *txtViewBusObjectDesc; @property (weak, nonatomic) IBOutlet UITextView *txtViewAboutMap; @property (weak, nonatomic) IBOutlet UIButton *optionsButton; @property (strong, nonatomic) AJNMessageArgument *supportedLanguagesMsgArg; @property (nonatomic) AJNSessionId sessionId; @property (nonatomic) UIAlertView *alertBusName; @property (nonatomic) UITextField *alertChooseLanguage; @property (nonatomic) UIAlertView *alertAnnouncementOptions; @property (nonatomic) UIAlertView *alertNoSession; @end @implementation GetAboutCallViewController - (void)prepareAlerts { // busNameAlert.tag = 1 self.alertBusName = [[UIAlertView alloc] initWithTitle:@"Set language" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; self.alertBusName.alertViewStyle = UIAlertViewStylePlainTextInput; self.alertBusName.tag = 1; self.alertChooseLanguage = [self.alertBusName textFieldAtIndex:0]; //connect the UITextField with the alert // announcementOptionsAlert.tag = 2 self.alertAnnouncementOptions = [[UIAlertView alloc] initWithTitle:@"Choose option:" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Refresh", @"Set Language", nil]; self.alertAnnouncementOptions.alertViewStyle = UIAlertViewStyleDefault; self.alertAnnouncementOptions.tag = 2; // alertNoSession.tag = 3 self.alertNoSession = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Session is not connected, check the connection and reconnect." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; self.alertNoSession.alertViewStyle = UIAlertViewStyleDefault; self.alertNoSession.tag = 3; } - (IBAction)TouchUpInsideRefreshandSetLanguage:(UIButton *)sender { [self.alertAnnouncementOptions show]; } - (bool)isValidLanguage:(NSString *)inputLanguage { bool found = false; const ajn::MsgArg *stringArray; size_t fieldListNumElements; QStatus status = [self.supportedLanguagesMsgArg value:@"as", &fieldListNumElements, &stringArray]; if (status == ER_OK) { for (size_t i = 0; i < fieldListNumElements; i++) { char *tempString; stringArray[i].Get("s", &tempString); if ([inputLanguage isEqualToString:@(tempString)]) { found = true; break; } } } return found; } // Get the user's input from the alert dialog - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { switch (alertView.tag) { case 1: // busNameAlert { if (buttonIndex == 1) { //user pressed OK if ([self.alertChooseLanguage.text isEqualToString:@""]) { self.alertChooseLanguage.text = [AJNAboutDataConverter messageArgumentToString:[self.clientInformation.announcement aboutData][@"DefaultLanguage"]]; } if (![self isValidLanguage:self.alertChooseLanguage.text]) { [[[UIAlertView alloc] initWithTitle:@"Error" message:@"Requested language is not supported" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show]; return; } self.clientInformation.currLang = self.alertChooseLanguage.text; [self UpdateCallViewInformation]; } else { // cancel } } break; case 2: //announcementOptionsAlert { if (buttonIndex == 1) { //refresh [self UpdateCallViewInformation]; } else if (buttonIndex == 2) { self.alertBusName.message = [NSString stringWithFormat:@"Available:%@", [AJNAboutDataConverter messageArgumentToString:self.supportedLanguagesMsgArg]]; [self.alertBusName show]; } } break; case 3: //NoSessionAlert { } break; default: NSLog(@"[%@] [%@] alertView.tag is wrong", @"ERROR", [[self class] description]); break; } } // alert view:clickedButtonAtIndex: - (void)UpdateCallViewInformation { self.lblVersion.text = [NSString stringWithFormat:@"%u", [self.clientInformation.announcement version]]; if (!self.sessionId) { //create sessionOptions AJNSessionOptions *opt = [[AJNSessionOptions alloc] initWithTrafficType:kAJNTrafficMessages supportsMultipoint:false proximity:kAJNProximityAny transportMask:kAJNTransportMaskAny]; //call joinSession self.sessionId = [self.clientBusAttachment joinSessionWithName:[self.clientInformation.announcement busName] onPort:[self.clientInformation.announcement port] withDelegate:(nil) options:opt]; } if (self.sessionId == 0 || self.sessionId == -1) { NSLog(@"[%@] [%@] Failed to join session. sid=%u", @"DEBUG", [[self class] description],self.sessionId); [self.alertNoSession show]; } else { NSMutableDictionary *aboutData; NSMutableDictionary *objDesc; AJNAboutClient *ajnAboutClient = [[AJNAboutClient alloc] initWithBus:self.clientBusAttachment]; QStatus qStatus = [ajnAboutClient aboutDataWithBusName:[self.clientInformation.announcement busName] andLanguageTag:self.clientInformation.currLang andAboutData:&aboutData andSessionId:self.sessionId]; if (qStatus != ER_OK) { UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Calling the about method returned with an error" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [errorAlert show]; } else { [ajnAboutClient objectDescriptionsWithBusName:[self.clientInformation.announcement busName] andObjectDescriptions:&objDesc andSessionId:self.sessionId]; NSLog(@"[%@] [%@] AboutData: %@", @"DEBUG", [[self class] description], [AJNAboutDataConverter aboutDataDictionaryToString:aboutData]); NSLog(@"[%@] [%@] objectDescriptions: %@", @"DEBUG", [[self class] description], [AJNAboutDataConverter objectDescriptionsDictionaryToString:objDesc]); self.supportedLanguagesMsgArg = aboutData[@"SupportedLanguages"]; self.lblAboutLanguage.text = self.clientInformation.currLang; self.txtViewAboutMap.text = [AJNAboutDataConverter aboutDataDictionaryToString:aboutData]; self.txtViewBusObjectDesc.text = [AJNAboutDataConverter objectDescriptionsDictionaryToString:objDesc]; } } } - (void)viewDidLoad { [super viewDidLoad]; [self prepareAlerts]; [self UpdateCallViewInformation]; } - (void)viewWillDisappear:(BOOL)animated { [self.clientBusAttachment leaveSession:self.sessionId]; [super viewWillDisappear:animated]; } @end base-15.09/controlpanel/ios/samples/sampleApp/MainStoryboard_iPhone.storyboard000066400000000000000000000614221262264444500277110ustar00rootroot00000000000000 base-15.09/controlpanel/ios/samples/sampleApp/MainViewController.h000066400000000000000000000025721262264444500252750ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusListener.h" #import "alljoyn/about/AJNAnnouncementListener.h" @interface MainViewController : UIViewController @property (weak, nonatomic) IBOutlet UIButton *connectButton; @property (weak, nonatomic) IBOutlet UITableView *servicesTable; - (IBAction)connectButtonDidTouchUpInside:(id)sender; @end base-15.09/controlpanel/ios/samples/sampleApp/MainViewController.m000066400000000000000000000571731262264444500253110ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "MainViewController.h" #import "AJNStatus.h" #import "alljoyn/about/AJNAnnouncement.h" #import "alljoyn/about/AJNAnnouncementReceiver.h" #import "alljoyn/about/AJNAboutDataConverter.h" #import "ClientInformation.h" #import "AnnounceTextViewController.h" #import "GetAboutCallViewController.h" #import "alljoyn/controlpanel/AJCPSGetControlPanelViewController.h" #import "AuthenticationListenerImpl.h" #include #import "AppDelegate.h" static bool ALLOWREMOTEMESSAGES = true; // About Client - allow Remote Messages flag static NSString * const APPNAME = @"AboutClientMain"; // About Client - default application name static NSString * const DAEMON_QUIET_PREFIX = @"quiet@"; // About Client - quiet advertising static NSString * const CONTROLPANEL_OBJECT_PATH = @"/ControlPanel/"; static NSString * const CONTROLPANEL_INTERFACE_NAME = @"org.alljoyn.ControlPanel.ControlPanel"; static NSString * const HTTPCONTROL_INTERFACE_NAME = @"org.alljoyn.ControlPanel.HTTPControl"; static NSString * const DEFAULT_REALM_BUS_NAME = @"org.alljoyn.BusNode.ControlPanelClient"; static NSString * const KEYSTORE_FILE_PATH = @"Documents/alljoyn_keystore/s_central.ks"; static NSString * const AUTH_MECHANISM = @"ALLJOYN_SRP_KEYX ALLJOYN_ECDHE_PSK"; @interface MainViewController () @property NSString *className; // About Client properties @property (strong, nonatomic) AJNBusAttachment *clientBusAttachment; @property (strong, nonatomic) AJNAnnouncementReceiver *announcementReceiver; @property (strong, nonatomic) NSString *realmBusName; @property (nonatomic) bool isAboutClientConnected; @property (strong, nonatomic) NSMutableDictionary *clientInformationDict; // Store the client related information // Announcement @property (strong, nonatomic) NSString *announcementButtonCurrentTitle; // The pressed button's announcementUniqueName @property (strong, nonatomic) dispatch_queue_t annBtnCreationQueue; // About Client strings @property (strong, nonatomic) NSString *ajconnect; @property (strong, nonatomic) NSString *ajdisconnect; @property (strong, nonatomic) NSString *annSubvTitleLabelDefaultTxt; // About Client alerts @property (strong, nonatomic) UIAlertView *announcementOptionsAlert; @property (strong, nonatomic) UIAlertView *announcementOptionsAlertNoCPanel; @property (strong, nonatomic) AuthenticationListenerImpl *authenticationListenerImpl; @end @implementation MainViewController #pragma mark - Built In methods - (void)viewDidLoad { [super viewDidLoad]; [self loadNewSession]; } // Get the user's input from the alert dialog - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (alertView == self.announcementOptionsAlert) { [self performAnnouncementAction:buttonIndex]; } else if (alertView == self.announcementOptionsAlertNoCPanel) { [self performAnnouncementAction:buttonIndex]; } else { NSLog(@"[%@] [%@] alertView.tag is wrong", @"ERROR", [[self class] description]); } } - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // GetAboutCallViewController if ([segue.destinationViewController isKindOfClass:[GetAboutCallViewController class]]) { GetAboutCallViewController *getAboutCallView = segue.destinationViewController; getAboutCallView.clientInformation = (self.clientInformationDict)[self.announcementButtonCurrentTitle]; getAboutCallView.clientBusAttachment = self.clientBusAttachment; } // AnnounceTextViewController else if ([segue.destinationViewController isKindOfClass:[AnnounceTextViewController class]]) { AnnounceTextViewController *announceTextViewController = segue.destinationViewController; announceTextViewController.ajnAnnouncement = [(ClientInformation *)(self.clientInformationDict)[self.announcementButtonCurrentTitle] announcement]; } } #pragma mark - IBAction Methods - (IBAction)connectButtonDidTouchUpInside:(id)sender { // Connect to the bus with the default realm bus name if (!self.isAboutClientConnected) { [self startAboutClient]; } else { [self stopAboutClient]; } } #pragma mark - AJNAnnouncementListener protocol method // Here we receive an announcement from AJN and add it to the client's list of services avaialble - (void)announceWithVersion:(uint16_t)version port:(uint16_t)port busName:(NSString *)busName objectDescriptions:(NSMutableDictionary *)objectDescs aboutData:(NSMutableDictionary **)aboutData { NSString *announcementUniqueName; // Announcement unique name in a format of ClientInformation *clientInformation = [[ClientInformation alloc] init]; // Save the announcement in a AJNAnnouncement clientInformation.announcement = [[AJNAnnouncement alloc] initWithVersion:version port:port busName:busName objectDescriptions:objectDescs aboutData:aboutData]; // Generate an announcement unique name in a format of announcementUniqueName = [NSString stringWithFormat:@"%@ %@", [clientInformation.announcement busName], [AJNAboutDataConverter messageArgumentToString:[clientInformation.announcement aboutData][@"DeviceName"]]]; NSLog(@"[%@] [%@] Announcement unique name [%@]", @"DEBUG", [[self class] description], announcementUniqueName); AJNMessageArgument *annObjMsgArg = [clientInformation.announcement aboutData][@"AppId"]; uint8_t *appIdBuffer; size_t appIdNumElements; QStatus status; status = [annObjMsgArg value:@"ay", &appIdNumElements, &appIdBuffer]; // Add the received announcement if (status != ER_OK) { NSLog(@"[%@] [%@] Failed to read appId for key [%@]", @"DEBUG", [[self class] description], announcementUniqueName); return; } // Dealing with announcement entries should be syncronized, so we add it to a queue dispatch_sync(self.annBtnCreationQueue, ^{ bool isAppIdExists = false; uint8_t *tmpAppIdBuffer; size_t tmpAppIdNumElements; QStatus tStatus; int res; // Iterate over the announcements dictionary for (NSString *key in self.clientInformationDict.allKeys) { ClientInformation *clientInfo = [self.clientInformationDict valueForKey:key]; AJNAnnouncement *announcement = [clientInfo announcement]; AJNMessageArgument *tmpMsgrg = [announcement aboutData][@"AppId"]; tStatus = [tmpMsgrg value:@"ay", &tmpAppIdNumElements, &tmpAppIdBuffer]; if (tStatus != ER_OK) { NSLog(@"[%@] [%@] Failed to read appId for key [%@]", @"DEBUG", [[self class] description], key); return; } res = 1; if (appIdNumElements == tmpAppIdNumElements) { res = memcmp(appIdBuffer, tmpAppIdBuffer, appIdNumElements); } // Found a matched appId - res=0 if (!res) { isAppIdExists = true; // Same AppId and the same announcementUniqueName if ([key isEqualToString:announcementUniqueName]) { // Update only announcements dictionary NSLog(@"[%@] [%@] Got an announcement from a known device - updating the announcement object", @"DEBUG", [[self class] description]); (self.clientInformationDict)[announcementUniqueName] = clientInformation; // Same AppId but *different* announcementUniqueName } else { NSLog(@"[%@] [%@] Got an announcement from a known device(different bus name) - updating the announcement object and UI ", @"DEBUG", [[self class] description]); // Cancel advertise name if the bus name has changed NSString *prevBusName = [announcement busName]; if (!([busName isEqualToString:prevBusName])) { tStatus = [self.clientBusAttachment cancelFindAdvertisedName:prevBusName]; if (status != ER_OK) { NSLog(@"[%@] [%@] failed to cancelAdvertisedName for %@. status:%@", @"DEBUG", [[self class] description],prevBusName, [AJNStatus descriptionForStatusCode:tStatus]); } } // Remove existed record from the announcements dictionary [self.clientInformationDict removeObjectForKey:key]; // Add new record to the announcements dictionary [self.clientInformationDict setValue:clientInformation forKey:announcementUniqueName]; // Update UI [self.servicesTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; } break; } //if } //for //appId doesn't exist and there is no match announcementUniqueName if (!(self.clientInformationDict)[announcementUniqueName] && !isAppIdExists) { // Add new pair with this AboutService information (version,port,bus name, object description and about data) [self.clientInformationDict setValue:clientInformation forKey:announcementUniqueName]; [self addNewAnnouncemetEntry]; // AppId doesn't exist and BUT there is no match announcementUniqueName } // else No OP }); // Register interest in a well-known name prefix for the purpose of discovery (didLoseAdertise) [self.clientBusAttachment enableConcurrentCallbacks]; status = [self.clientBusAttachment findAdvertisedName:busName]; if (status != ER_OK) { NSLog(@"[%@] [%@] failed to findAdvertisedName for %@. status:%@", @"ERROR", [[self class] description],busName, [AJNStatus descriptionForStatusCode:status]); } } #pragma mark AJNBusListener protocol methods - (void)didFindAdvertisedName:(NSString *)name withTransportMask:(AJNTransportMask)transport namePrefix:(NSString *)namePrefix { NSLog(@"didFindAdvertisedName %@", name); } - (void)didLoseAdvertisedName:(NSString *)name withTransportMask:(AJNTransportMask)transport namePrefix:(NSString *)namePrefix { NSLog(@"didLoseAdvertisedName"); QStatus status; // Find the button title that should be removed for (NSString *key in[self.clientInformationDict allKeys]) { if ([[[[self.clientInformationDict valueForKey:key] announcement] busName] isEqualToString:name]) { // Cancel advertise name for that bus status = [self.clientBusAttachment cancelFindAdvertisedName:name]; if (status != ER_OK) { NSLog(@"[%@] [%@] failed to cancelFindAdvertisedName for %@. status:%@", @"DEBUG", [[self class] description],name, [AJNStatus descriptionForStatusCode:status]); } // Remove the anouncement from the dictionary [self.clientInformationDict removeObjectForKey:key]; } } [self.servicesTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; } #pragma mark - util methods - (void)loadNewSession { // About flags self.isAboutClientConnected = false; self.annBtnCreationQueue = dispatch_queue_create("org.alljoyn.announcementbuttoncreationQueue", NULL); // Set About Client strings self.ajconnect = @"Connect to AllJoyn"; self.ajdisconnect = @"Disconnect from AllJoyn"; self.realmBusName = DEFAULT_REALM_BUS_NAME; self.annSubvTitleLabelDefaultTxt = @"Announcement of "; // Set About Client connect button self.connectButton.backgroundColor = [UIColor darkGrayColor]; //button bg color [self.connectButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; //button font color [self.connectButton setTitle:self.ajconnect forState:UIControlStateNormal]; //default text [self prepareAlerts]; } // Initialize alerts - (void)prepareAlerts { // announcementOptionsAlert.tag = 3 self.announcementOptionsAlert = [[UIAlertView alloc] initWithTitle:@"Choose option:" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Show Announce", @"About", @"Control Panel", nil]; self.announcementOptionsAlert.alertViewStyle = UIAlertViewStyleDefault; // announcementOptionsAlert.tag = 4 self.announcementOptionsAlertNoCPanel = [[UIAlertView alloc] initWithTitle:@"Choose option:" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Show Announce", @"About", nil]; self.announcementOptionsAlertNoCPanel.alertViewStyle = UIAlertViewStyleDefault; } - (void)performAnnouncementAction:(NSInteger)opt { switch (opt) { case 0: // "Cancel" break; case 1: // "Show Announce" { [self performSegueWithIdentifier:@"AboutShowAnnounceSegue" sender:self]; } break; case 2: // "About" { [self performSegueWithIdentifier:@"AboutClientSegue" sender:self]; // get the announcment object } break; case 3: // "CPanel" { GetControlPanelViewController *getCpanelView = [[GetControlPanelViewController alloc] initWithAnnouncement:[(ClientInformation *)(self.clientInformationDict)[self.announcementButtonCurrentTitle] announcement] bus:self.clientBusAttachment]; [self.navigationController pushViewController:getCpanelView animated:YES]; } break; default: break; } } #pragma mark - AboutClient #pragma mark start AboutClient - (void)startAboutClient { QStatus status; // Create a dictionary to contain announcements using a key in the format of: "announcementUniqueName + announcementObj" self.clientInformationDict = [[NSMutableDictionary alloc] init]; NSLog(@"[%@] [%@] Start About Client", @"DEBUG", [[self class] description]); // Init AJNBusAttachment self.clientBusAttachment = [[AJNBusAttachment alloc] initWithApplicationName:APPNAME allowRemoteMessages:ALLOWREMOTEMESSAGES]; // Start AJNBusAttachment status = [self.clientBusAttachment start]; if (status != ER_OK) { [AppDelegate alertAndLog:@"Failed AJNBusAttachment start" status:status]; [self stopAboutClient]; return; } // Connect AJNBusAttachment status = [self.clientBusAttachment connectWithArguments:@""]; if (status != ER_OK) { [AppDelegate alertAndLog:@"Failed AJNBusAttachment connectWithArguments" status:status]; [self stopAboutClient]; return; } NSLog(@"[%@] [%@] Create aboutClientListener", @"DEBUG", [[self class] description]); NSLog(@"[%@] [%@] Register aboutClientListener", @"DEBUG", [[self class] description]); [self.clientBusAttachment registerBusListener:self]; self.announcementReceiver = [[AJNAnnouncementReceiver alloc] initWithAnnouncementListener:self andBus:self.clientBusAttachment]; const char* interfaces[] = { [CONTROLPANEL_INTERFACE_NAME UTF8String], [HTTPCONTROL_INTERFACE_NAME UTF8String] }; status = [self.announcementReceiver registerAnnouncementReceiverForInterfaces:&interfaces[0] withNumberOfInterfaces:1]; if (status != ER_OK) { [AppDelegate alertAndLog:@"Failed to registerAnnouncementReceiver" status:status]; [self stopAboutClient]; return; } status = [self.announcementReceiver registerAnnouncementReceiverForInterfaces:&interfaces[1] withNumberOfInterfaces:1]; if (status != ER_OK) { [AppDelegate alertAndLog:@"Failed to registerAnnouncementReceiver" status:status]; [self stopAboutClient]; return; } NSUUID *UUID = [NSUUID UUID]; NSString *stringUUID = [UUID UUIDString]; self.realmBusName = [NSString stringWithFormat:@"%@-%@", DEFAULT_REALM_BUS_NAME, stringUUID]; // Advertise Daemon for tcl status = [self.clientBusAttachment requestWellKnownName:self.realmBusName withFlags:kAJNBusNameFlagDoNotQueue]; if (status == ER_OK) { status = [self.clientBusAttachment advertiseName:[NSString stringWithFormat:@"%@%@", DAEMON_QUIET_PREFIX, self.realmBusName] withTransportMask:kAJNTransportMaskAny]; if (status != ER_OK) { [AppDelegate alertAndLog:@"Failed to advertise name" status:status]; [self stopAboutClient]; return; } else { NSLog(@"[%@] [%@] Successfully advertised: %@%@", @"DEBUG", [[self class] description], DAEMON_QUIET_PREFIX, self.realmBusName); } } else { [AppDelegate alertAndLog:@"Failed to requestWellKnownName" status:status]; [self stopAboutClient]; return; } // Enable Client Security self.authenticationListenerImpl = [[AuthenticationListenerImpl alloc] init]; status = [self enableClientSecurity]; if (ER_OK != status) { NSLog(@"Failed to enable security."); } else { NSLog(@"Successfully enabled security for the bus"); } [self.connectButton setTitle:self.ajdisconnect forState:UIControlStateNormal]; //change title to "Disconnect from AllJoyn" self.isAboutClientConnected = true; } - (QStatus)enableClientSecurity { QStatus status; status = [self.clientBusAttachment enablePeerSecurity:AUTH_MECHANISM authenticationListener:self.authenticationListenerImpl keystoreFileName:KEYSTORE_FILE_PATH sharing:YES]; if (status != ER_OK) { //try to delete the keystore and recreate it, if that fails return failure NSError *error; NSString *keystoreFilePath = [NSString stringWithFormat:@"%@/alljoyn_keystore/s_central.ks", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]]; [[NSFileManager defaultManager] removeItemAtPath:keystoreFilePath error:&error]; if (error) { NSLog(@"ERROR: Unable to delete keystore. %@", error); return ER_AUTH_FAIL; } status = [self.clientBusAttachment enablePeerSecurity:AUTH_MECHANISM authenticationListener:self.authenticationListenerImpl keystoreFileName:KEYSTORE_FILE_PATH sharing:YES]; } return status; } - (void)addNewAnnouncemetEntry { [self.servicesTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; } // announcementGetMoreInfo is an IBAction triggered by pressing a dynamic announcement button - (void)announcementGetMoreInfo:(NSInteger)requestedRow { // set the announcementButtonCurrentTitle self.announcementButtonCurrentTitle = [self.clientInformationDict allKeys][requestedRow]; NSLog(@"[%@] [%@] Requested: [%@]", @"DEBUG", [[self class] description],self.announcementButtonCurrentTitle); // Check if announcement has icon object path if ([self announcementHasCPanel:self.announcementButtonCurrentTitle]) { [self.announcementOptionsAlert show]; // Event is forward to alertView: clickedButtonAtIndex: } else { [self.announcementOptionsAlertNoCPanel show]; // Event is forward to alertView: clickedButtonAtIndex: } } // Return true if an announcement supports icon interface - (bool)announcementHasCPanel:(NSString *)announcementKey { bool hascPanel = false; AJNAnnouncement *announcement = [(ClientInformation *)[self.clientInformationDict valueForKey:announcementKey] announcement]; NSMutableDictionary *announcementObjDecs = [announcement objectDescriptions]; //Dictionary of ObjectDescriptions NSStrings // iterate over the object descriptions dictionary for (NSString *key in announcementObjDecs.allKeys) { if ([key hasPrefix:CONTROLPANEL_OBJECT_PATH]) { // Iterate over the NSMutableArray for (NSString *intf in[announcementObjDecs valueForKey:key]) { if ([intf isEqualToString:(NSString *)CONTROLPANEL_INTERFACE_NAME]) { hascPanel = true; } } } } return hascPanel; } #pragma mark stop AboutClient - (void)stopAboutClient { QStatus status; NSLog(@"[%@] [%@] Stop About Client", @"DEBUG", [[self class] description]); // Bus attachment cleanup status = [self.clientBusAttachment cancelAdvertisedName:[NSString stringWithFormat:@"%@%@", DAEMON_QUIET_PREFIX, self.realmBusName] withTransportMask:kAJNTransportMaskAny]; if (status == ER_OK) { NSLog(@"[%@] [%@] Successfully cancel advertised name", @"DEBUG", [[self class] description]); } status = [self.clientBusAttachment releaseWellKnownName:self.realmBusName]; if (status == ER_OK) { NSLog(@"[%@] [%@] Successfully release WellKnownName", @"DEBUG", [[self class] description]); } status = [self.clientBusAttachment removeMatchRule:@"sessionless='t',type='error'"]; if (status == ER_OK) { NSLog(@"[%@] [%@] Successfully remove MatchRule", @"DEBUG", [[self class] description]); } // Cancel advertise name for each announcement bus for (NSString *key in[self.clientInformationDict allKeys]) { ClientInformation *clientInfo = (self.clientInformationDict)[key]; status = [self.clientBusAttachment cancelFindAdvertisedName:[[clientInfo announcement] busName]]; if (status != ER_OK) { NSLog(@"[%@] [%@] failed to cancelAdvertisedName for %@. status:%@", @"ERROR", [[self class] description],key, [AJNStatus descriptionForStatusCode:status]); } } self.clientInformationDict = nil; const char* interfaces[] = { [CONTROLPANEL_INTERFACE_NAME UTF8String], [HTTPCONTROL_INTERFACE_NAME UTF8String] }; status = [self.announcementReceiver unRegisterAnnouncementReceiverForInterfaces:&interfaces[0] withNumberOfInterfaces:1]; if (status == ER_OK) { NSLog(@"[%@] [%@] Successfully unregistered AnnouncementReceiver", @"DEBUG", [[self class] description]); } status = [self.announcementReceiver unRegisterAnnouncementReceiverForInterfaces:&interfaces[1] withNumberOfInterfaces:1]; if (status == ER_OK) { NSLog(@"[%@] [%@] Successfully unregistered AnnouncementReceiver", @"DEBUG", [[self class] description]); } self.announcementReceiver = nil; // Stop bus attachment status = [self.clientBusAttachment stop]; if (status == ER_OK) { NSLog(@"[%@] [%@] Successfully stopped bus", @"DEBUG", [[self class] description]); } self.clientBusAttachment = nil; // Set flag self.isAboutClientConnected = false; // UI cleanup [self.connectButton setTitle:self.ajconnect forState:UIControlStateNormal]; [self.servicesTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; NSLog(@"[%@] [%@] About Client is stopped", @"DEBUG", [[self class] description]); } #pragma mark UITableView delegates - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.clientInformationDict count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *MyIdentifier = @"AnnouncementCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier forIndexPath:indexPath]; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.textLabel.text = [self.clientInformationDict allKeys][indexPath.row]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self announcementGetMoreInfo:indexPath.row]; } - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { [self announcementGetMoreInfo:indexPath.row]; } @end base-15.09/controlpanel/ios/src/000077500000000000000000000000001262264444500165345ustar00rootroot00000000000000base-15.09/controlpanel/ios/src/AJCPSAction.mm000066400000000000000000000025771262264444500211000ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSAction.h" #import "alljoyn/controlpanel/Action.h" #import "alljoyn/about/AJNConvertUtil.h" #import "AJCPSControlPanelDevice.h" @interface AJCPSAction () @end @implementation AJCPSAction - (id)initWithHandle:(ajn::services::Action *)handle { self = [super initWithHandle:handle]; if (self) { } return self; } - (QStatus)executeAction { return ((ajn::services::Action *)self.handle)->executeAction(); } @endbase-15.09/controlpanel/ios/src/AJCPSActionWithDialog.mm000066400000000000000000000032221262264444500230400ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSActionWithDialog.h" #import "alljoyn/controlpanel/ActionWithDialog.h" #import "alljoyn/about/AJNConvertUtil.h" #import "AJCPSControlPanelDevice.h" @interface AJCPSActionWithDialog () @end @implementation AJCPSActionWithDialog - (id)initWithHandle:(ajn::services::ActionWithDialog *)handle { self = [super initWithHandle:handle]; if (self) { } return self; } - (AJCPSDialog *)getChildDialog { return [[AJCPSDialog alloc]initWithHandle:((ajn::services::ActionWithDialog *)self.handle)->getChildDialog()]; } - (QStatus)unregisterObjects:(AJNBusAttachment *)bus { return ((ajn::services::ActionWithDialog *)self.handle)->unregisterObjects((ajn::BusAttachment *)[bus handle]); } @endbase-15.09/controlpanel/ios/src/AJCPSCPSButtonCell.mm000066400000000000000000000046771262264444500223070ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSCPSButtonCell.h" #import "AJCPSAction.h" @implementation CPSButtonCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.cpsButton = [UIButton buttonWithType:UIButtonTypeSystem]; [self.cpsButton setFrame:CGRectMake(10,0,300,60)]; [self.cpsButton.titleLabel setFont:[UIFont systemFontOfSize:13]]; [self.cpsButton addTarget:self action:@selector(touchUpInsideAction:) forControlEvents:UIControlEventTouchUpInside]; [self.contentView addSubview:self.cpsButton]; [self reloadInputViews]; } return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; } - (void)touchUpInsideAction:(id)sender { NSLog(@"Pressed %@",[self.cpsButton titleLabel].text); QStatus status = [((AJCPSAction *)self.actionWidget) executeAction]; if (status != ER_OK) { NSLog(@"execute Action returned error %d, %@",status, [AJNStatus descriptionForStatusCode:status]); } } -(void)setActionWidget:(AJCPSAction *)actionWidget { _actionWidget = actionWidget; [self.cpsButton setTitle:[self.actionWidget getLabel] forState:UIControlStateNormal]; [self.cpsButton setEnabled:[self.actionWidget getIsEnabled]?YES:NO]; // We do not use [self.actionWidget getBgColor] so the iOS look and feel remain the same } @end base-15.09/controlpanel/ios/src/AJCPSCPSDate.mm000066400000000000000000000034711262264444500211000ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSCPSDate.h" @interface AJCPSCPSDate () @property (nonatomic) ajn::services::CPSDate *handle; @end @implementation AJCPSCPSDate - (id)initWithDay:(uint16_t) day month:(uint16_t) month year:(uint16_t) year { self = [super init]; if (self) { self.handle = new ajn::services::CPSDate(day, month, year); } return self; } - (id)initWithHandle:(ajn::services::CPSDate *)handle { self = [super init]; if (self) { self.handle = handle; } return self; } - (uint16_t)getDay { return self.handle->getDay(); } - (void)setDay:(uint16_t)day { return self.handle->setDay(day); } - (uint16_t)getMonth { return self.handle->getMonth(); } - (void)setMonth:(uint16_t)month { return self.handle->setMonth(month); } - (uint16_t)getYear { return self.handle->getYear(); } - (void)setYear:(uint16_t)year { return self.handle->setYear(year); } @end base-15.09/controlpanel/ios/src/AJCPSCPSGeneralCell.mm000066400000000000000000000321071262264444500223760ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSCPSGeneralCell.h" #import "AJCPSProperty.h" #import "AJCPSConstraintRange.h" #import "AJCPSConstraintList.h" #import "AJCPSErrorWidget.h" @implementation CPSGeneralCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { // Widget Name self.widgetNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, 310, 20)]; // Hint self.hintLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 20, 310, 20)]; self.hintLabel.textColor = [UIColor colorWithRed:0.4 green:0 blue:0.4 alpha:1]; // Label Details self.widgetDetailsLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 20, 270, 110)]; [self.widgetDetailsLabel setFont:[UIFont systemFontOfSize:11]]; self.widgetDetailsLabel.lineBreakMode = NSLineBreakByWordWrapping; self.widgetDetailsLabel.numberOfLines = 0; // Add UI objects to subview [self.contentView addSubview:self.widgetNameLabel]; [self.contentView addSubview:self.widgetDetailsLabel]; [self.contentView addSubview:self.hintLabel]; } return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; } - (NSString *)widgetHints { NSMutableString *str = [[NSMutableString alloc]init]; NSArray *propertyHintsStrings = [[NSArray alloc] initWithObjects: @"", @"SWITCH", @"CHECKBOX", @"SPINNER", @"RADIOBUTTON", @"SLIDER", @"TIMEPICKER", @"DATEPICKER", @"NUMBERPICKER", @"KEYPAD", @"ROTARYKNOB", @"TEXTVIEW", @"NUMERICVIEW", @"EDITTEXT", nil]; [self setAccessoryType:UITableViewCellAccessoryNone]; NSArray *hints = [self.widget getHints]; if ([hints count]) { for (NSInteger i = 0 ; i < [hints count]; i++) { NSInteger hint = [hints[i] integerValue]; switch ([self.widget getWidgetType]) { case AJCPS_ACTION: case AJCPS_ACTION_WITH_DIALOG: if (hint == AJCPS_ACTIONBUTTON) self.hintLabel.text=@"ACTIONBUTTON"; else self.hintLabel.text=@"UNKNOWN"; break; case AJCPS_LABEL: if (hint == AJCPS_TEXTLABEL) self.hintLabel.text=@"TEXTLABEL"; else self.hintLabel.text=@"UNKNOWN"; break; case AJCPS_PROPERTY: { AJCPSPropertyValue propertyValue; [(AJCPSProperty *)self.widget getPropertyValue:propertyValue]; switch ([(AJCPSProperty *)self.widget getPropertyType]) { case AJCPS_BOOL_PROPERTY : [str appendFormat:@"bool property, value:%d",propertyValue.boolValue]; break; case AJCPS_UINT16_PROPERTY : [str appendFormat:@"uint16 property, value:%d",propertyValue.uint16Value]; break; case AJCPS_INT16_PROPERTY : [str appendFormat:@"int16 property, value:%d",propertyValue.int16Value]; break; case AJCPS_UINT32_PROPERTY : [str appendFormat:@"uint32 property, value:%d",propertyValue.uint32Value]; break; case AJCPS_INT32_PROPERTY : [str appendFormat:@"int32 property, value:%d",propertyValue.int32Value]; break; case AJCPS_UINT64_PROPERTY : [str appendFormat:@"uint64 property, value:%llu",propertyValue.uint64Value]; break; case AJCPS_INT64_PROPERTY : [str appendFormat:@"int64 property, value:%lld",propertyValue.int64Value]; break; case AJCPS_DOUBLE_PROPERTY : [str appendFormat:@"double property, value:%f",propertyValue.doubleValue]; break; case AJCPS_STRING_PROPERTY : [str appendFormat:@"string property, value:'%s'",propertyValue.charValue]; break; case AJCPS_DATE_PROPERTY : [str appendFormat:@"date property"]; //TODO support date break; case AJCPS_TIME_PROPERTY : [str appendFormat:@"time property"]; //TODO support time break; default: [str appendFormat:@"unknown property"]; break; } if (hint > 0 && hint < [propertyHintsStrings count]){ self.hintLabel.text=[NSString stringWithFormat:@"%@", propertyHintsStrings[hint]]; } else self.hintLabel.text=@"UNKNOWN"; if(![[((AJCPSProperty *)self.widget) getUnitOfMeasure] isEqualToString:@""]) { [str appendFormat:@",unitOfMeasure:%@", [((AJCPSProperty *)self.widget) getUnitOfMeasure]]; } [str appendString:@"\n"]; AJCPSConstraintRange *constraintRange = [((AJCPSProperty *)self.widget) getConstraintRange]; if (constraintRange) { [str appendFormat:@"min:%d,max:%d,inc:%d",[constraintRange getMinValue],[constraintRange getMaxValue],[constraintRange getIncrementValue]]; } NSArray *list = [((AJCPSProperty *)self.widget) getConstraintList]; if ([list count]) { [str appendString:@"list:"]; } for (AJCPSConstraintList *constraintList in list) { [str appendFormat:@"%@",[constraintList getDisplay]]; AJCPSConstraintValue propertyValue = [constraintList getConstraintValue]; switch ([constraintList getPropertyType]) { case AJCPS_UINT16_PROPERTY : [str appendFormat:@"(%d)",propertyValue.uint16Value]; break; case AJCPS_INT16_PROPERTY : [str appendFormat:@"(%d)",propertyValue.int16Value]; break; case AJCPS_UINT32_PROPERTY : [str appendFormat:@"(%d)",propertyValue.uint32Value]; break; case AJCPS_INT32_PROPERTY : [str appendFormat:@"(%d)",propertyValue.int32Value]; break; case AJCPS_UINT64_PROPERTY : [str appendFormat:@"(%llu)",propertyValue.uint64Value]; break; case AJCPS_INT64_PROPERTY : [str appendFormat:@"(%lld)",propertyValue.int64Value]; break; case AJCPS_DOUBLE_PROPERTY : [str appendFormat:@"(%f)",propertyValue.doubleValue]; break; case AJCPS_STRING_PROPERTY : [str appendFormat:@"('%s')",propertyValue.charValue]; break; default: NSLog(@"unknown property"); break; } } } break; case AJCPS_CONTAINER: if (hint == AJCPS_VERTICAL_LINEAR) self.hintLabel.text=@"VERTICAL_LINEAR"; else if (hint == AJCPS_HORIZONTAL_LINEAR) self.hintLabel.text=@"HORIZONTAL_LINEAR"; else self.hintLabel.text=@"UNKNOWN"; [self setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];//TODO break; case AJCPS_DIALOG: if (hint == AJCPS_ALERTDIALOG) self.hintLabel.text=@"ALERTDIALOG"; else self.hintLabel.text=@"UNKNOWN"; break; } [str appendFormat:@"%@",(i == ([hints count] - 1)) ? @"\n" : @", "]; } } else { [str appendString:@"No hints for this widget"]; } return str; } - (NSString *)widgetType { switch ([self.widget getWidgetType]) { case AJCPS_CONTAINER: { return @"Container"; } break; case AJCPS_ACTION: { return @"Action"; } break; case AJCPS_ACTION_WITH_DIALOG: { return @"Action & Dialog"; } break; case AJCPS_LABEL: { return @"Label"; } break; case AJCPS_PROPERTY: { return @"Property"; } break; case AJCPS_DIALOG: { return @"Dialog"; } break; case AJCPS_ERROR: { return @"Error Widget"; } break; default: { return @"Unsupported AJCPSWidgetType"; } break; } return nil; } -(void)setWidget:(AJCPSWidget *)widget { _widget = widget; self.widgetNameLabel.text = [NSString stringWithFormat:@"%@,%@",[self.widget getLabel],[self widgetType]]; NSString *widgetLabel; if ([[widget getLabel] length]) widgetLabel = [widget getLabel]; NSString *detailedText = [NSString stringWithFormat:@"label:'%@'\n%@,%@,%@\nbg:0x%x\n%@", widgetLabel, [widget getIsSecured] ? @"secured" : @"not secured", [widget getIsEnabled] ? @"enabled" : @"not enabled", [widget getIsWritable] ? @"writable" : @"not writable", [widget getBgColor], [self widgetHints]]; if ([widget getWidgetType] == AJCPS_ERROR) { AJCPSWidget *originalWidget = [(AJCPSErrorWidget *)self.widget getOriginalWidget]; self.hintLabel.text = [NSString stringWithFormat:@"Original Widget name:%@",[originalWidget getWidgetName]]; } //[self printHints:widget widgetType:widgetType indent:indent]; NSLog(@" widgetName:%@ widgetLabel:%@", [self.widget getLabel], widgetLabel); self.widgetDetailsLabel.text = detailedText; } @end base-15.09/controlpanel/ios/src/AJCPSCPSTime.mm000066400000000000000000000043371262264444500211230ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSCPSTime.h" @interface AJCPSCPSTime () @property (nonatomic) ajn::services::CPSTime *handle; @end @implementation AJCPSCPSTime - (id)initWithHour:(uint16_t) hour minute:(uint16_t) minute second:(uint16_t) second { self = [super init]; if (self) { self.handle = new ajn::services::CPSTime(hour, minute, second); } return self; } - (id)initWithHandle:(ajn::services::CPSTime *)handle { self = [super init]; if (self) { self.handle = handle; } return self; } /** * Get the hour value of the date * @return hour value */ - (uint16_t)getHour { return self.handle->getHour(); } /** * Set the hour Value of the date * @param hour value */ - (void)setHour:(uint16_t)hour { self.handle->setHour(hour); } /** * Get the Minute value of the date * @return minute value */ - (uint16_t)getMinute { return self.handle->getMinute(); } /** * Set the Minute value of the date * @param minute value */ - (void)setMinute:(uint16_t)minute { return self.handle->setMinute(minute); } /** * Get the Second value of the date * @return second value */ - (uint16_t)getSecond { return self.handle->getSecond(); } /** * Set the Second value of the date * @param second value */ - (void)setSecond:(uint16_t)second { return self.handle->setSecond(second); } @endbase-15.09/controlpanel/ios/src/AJCPSConstraintList.mm000066400000000000000000000065731262264444500226430ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSConstraintList.h" #import "alljoyn/about/AJNConvertUtil.h" @interface AJCPSConstraintList () @property (nonatomic) ajn::services::ConstraintList *handle; @end @implementation AJCPSConstraintList - (id)initWithHandle:(ajn::services::ConstraintList *)handle { self = [super init]; if (self) { self.handle = handle; } return self; } /** * Get the Constraint Value * @return the Constraint Value */ - (AJCPSConstraintValue)getConstraintValue { return [self convertToAJCPSConstraintValue:self.handle->getConstraintValue()]; } /** * Get the Property Type of the Constraint * @return propertyType of the Constraint */ - (AJCPSPropertyType)getPropertyType { return self.handle->getPropertyType(); } /** * Get the Display * @return Display Value */ - (NSString *)getDisplay { const qcc::String str = self.handle->getDisplay(); return [AJNConvertUtil convertQCCStringtoNSString:str]; } - (AJCPSConstraintValue)convertToAJCPSConstraintValue:(ajn::services::ConstraintValue) constraintValue { AJCPSConstraintValue tConstraintValue; switch ([self getPropertyType]) { case AJCPS_UINT16_PROPERTY : tConstraintValue.uint16Value = constraintValue.uint16Value; break; case AJCPS_INT16_PROPERTY : tConstraintValue.int16Value = constraintValue.int16Value; break; case AJCPS_UINT32_PROPERTY : tConstraintValue.uint32Value = constraintValue.uint32Value; break; case AJCPS_INT32_PROPERTY : tConstraintValue.int32Value = constraintValue.int32Value; break; case AJCPS_UINT64_PROPERTY : tConstraintValue.uint64Value = constraintValue.uint64Value; break; case AJCPS_INT64_PROPERTY : tConstraintValue.int64Value = constraintValue.int64Value; break; case AJCPS_DOUBLE_PROPERTY : tConstraintValue.doubleValue = constraintValue.doubleValue; break; case AJCPS_STRING_PROPERTY : tConstraintValue.charValue = constraintValue.charValue; break; case AJCPS_DATE_PROPERTY : //TODO break; case AJCPS_TIME_PROPERTY : //TODO break; default: break; } return tConstraintValue; } @endbase-15.09/controlpanel/ios/src/AJCPSConstraintRange.mm000066400000000000000000000030021262264444500227440ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSConstraintRange.h" @interface AJCPSConstraintRange () @property (nonatomic) ajn::services::ConstraintRange *handle; @end @implementation AJCPSConstraintRange - (id)initWithHandle:(ajn::services::ConstraintRange *)handle { self = [super init]; if (self) { self.handle = handle; } return self; } - (uint16_t)getIncrementValue { return self.handle->getIncrementValue().int16Value; } - (uint16_t)getMaxValue { return self.handle->getMaxValue().int16Value; } - (uint16_t)getMinValue { return self.handle->getMinValue().int16Value; } @endbase-15.09/controlpanel/ios/src/AJCPSContainer.mm000066400000000000000000000102151262264444500215710ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSContainer.h" #import "alljoyn/controlpanel/Container.h" #import "alljoyn/controlpanel/Widget.h" #import "AJCPSControlPanelDevice.h" #import "AJCPSAction.h" #import "AJCPSActionWithDialog.h" #import "AJCPSLabel.h" #import "AJCPSProperty.h" #import "AJCPSDialog.h" #import "AJCPSErrorWidget.h" @interface AJCPSContainer () // uses Widget's handle @end @implementation AJCPSContainer - (id)initWithHandle:(ajn::services::Container *)handle { self = [super initWithHandle:handle]; if (self) { //self.handle = handle; } return self; } /** * Register the BusObjects for this Widget * @param bus - the bus to be used * @return status - success/failure */ - (QStatus)registerObjects:(AJNBusAttachment *)bus { return ((ajn::services::Container *)self.handle)->registerObjects((ajn::BusAttachment *)[bus handle]); } /** * Unregister the BusObjects for this widget * @param bus * @return status - success/failure */ - (QStatus)unregisterObjects:(AJNBusAttachment *)bus { return ((ajn::services::Container *)self.handle)->unregisterObjects((ajn::BusAttachment *)[bus handle]); } /** * Get the ChildWidget Vector * @return children widgets */ //const std : : vector & getChildWidgets() const; - (NSArray *)getChildWidgets { const std::vector cpp_childWidgets = ((ajn::services::Container *)self.handle)->getChildWidgets(); NSMutableArray *childWidgets = [[NSMutableArray alloc]init]; for (int i = 0; i != cpp_childWidgets.size(); i++) { switch (cpp_childWidgets.at(i)->getWidgetType()) { case AJCPS_CONTAINER: [childWidgets addObject:[[AJCPSContainer alloc]initWithHandle:(ajn::services::Container *)cpp_childWidgets.at(i)]]; break; case AJCPS_ACTION: [childWidgets addObject:[[AJCPSAction alloc]initWithHandle:(ajn::services::Action *)cpp_childWidgets.at(i)]]; break; case AJCPS_ACTION_WITH_DIALOG: [childWidgets addObject:[[AJCPSActionWithDialog alloc]initWithHandle:(ajn::services::ActionWithDialog *)cpp_childWidgets.at(i)]]; break; case AJCPS_LABEL: [childWidgets addObject:[[AJCPSLabel alloc]initWithHandle:(ajn::services::Label *)cpp_childWidgets.at(i)]]; break; case AJCPS_PROPERTY: [childWidgets addObject:[[AJCPSProperty alloc]initWithHandle:(ajn::services::Property *)cpp_childWidgets.at(i)]]; break; case AJCPS_DIALOG: [childWidgets addObject:[[AJCPSDialog alloc]initWithHandle:(ajn::services::Dialog *)cpp_childWidgets.at(i)]]; break; case AJCPS_ERROR: [childWidgets addObject:[[AJCPSErrorWidget alloc]initWithHandle:(ajn::services::ErrorWidget *)cpp_childWidgets.at(i)]]; break; default: NSLog(@"Error. Request to create a widget of unknown type %d",cpp_childWidgets.at(i)->getWidgetType()); break; } } return childWidgets; } - (bool)getIsDismissable { return ((ajn::services::Container *)self.handle)->getIsDismissable(); } @endbase-15.09/controlpanel/ios/src/AJCPSControlPanel.mm000066400000000000000000000045651262264444500222620ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSControlPanel.h" #import "alljoyn/about/AJNConvertUtil.h" @interface AJCPSControlPanel () @property (nonatomic) ajn::services::ControlPanel *handle; @end @implementation AJCPSControlPanel - (id)initWithHandle:(ajn ::services ::ControlPanel *)handle { self = [super init]; if (self) { self.handle = handle; } return self; } // original cpp constructor: ControlPanel(LanguageSet const& languageSet, qcc::String objectPath, ControlPanelDevice* device); - (NSString *)getPanelName { return [AJNConvertUtil convertQCCStringtoNSString:self.handle->getPanelName()]; } - (QStatus)registerObjects:(AJNBusAttachment *)bus { return self.handle->registerObjects((ajn::BusAttachment *)[bus handle]); } - (QStatus)unregisterObjects:(AJNBusAttachment *)bus { return self.handle->unregisterObjects((ajn::BusAttachment *)[bus handle]); } - (AJCPSLanguageSet *)getLanguageSet { return [[AJCPSLanguageSet alloc]initWithHandle:(ajn::services::LanguageSet *)&self.handle->getLanguageSet()]; } - (AJCPSControlPanelDevice *)getDevice { return [[AJCPSControlPanelDevice alloc]initWithHandle:self.handle->getDevice()]; } - (NSString *)getObjectPath { return [AJNConvertUtil convertQCCStringtoNSString:self.handle->getObjectPath()]; } - (AJCPSContainer *)getRootWidget:(NSString *)Language { return [[AJCPSContainer alloc]initWithHandle:self.handle->getRootWidget([AJNConvertUtil convertNSStringToQCCString:Language])]; } @end base-15.09/controlpanel/ios/src/AJCPSControlPanelController.mm000066400000000000000000000067171262264444500243270ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSControlPanelController.h" #import "alljoyn/about/AJNConvertUtil.h" @interface AJCPSControlPanelController () @property (nonatomic) ajn::services::ControlPanelController *handle; @end @implementation AJCPSControlPanelController - (id)init { self = [super init]; if (self) { self.handle = new ajn::services::ControlPanelController(); } return self; } - (id)initWithHandle:(ajn::services::ControlPanelController *)handle { self = [super init]; if (self) { self.handle = handle; } return self; } - (AJCPSControlPanelDevice *)createControllableDevice:(NSString *)deviceBusName ObjectDescs:(NSDictionary *)objectDescs { ajn::services::AnnounceHandler::ObjectDescriptions *cpp_ObjectDescs = new ajn::services::AnnounceHandler::ObjectDescriptions; for (NSString *key in objectDescs) { NSArray *strings = [objectDescs objectForKey:key]; std::vector cpp_strings; for (NSString *string in strings) { cpp_strings.push_back([AJNConvertUtil convertNSStringToQCCString:string]); } cpp_ObjectDescs->insert(std::make_pair([AJNConvertUtil convertNSStringToQCCString:key], cpp_strings)); } return [[AJCPSControlPanelDevice alloc]initWithHandle:self.handle->createControllableDevice([AJNConvertUtil convertNSStringToQCCString:deviceBusName], *cpp_ObjectDescs)]; } - (AJCPSControlPanelDevice *)getControllableDevice:(NSString *)deviceBusName { return [[AJCPSControlPanelDevice alloc]initWithHandle:self.handle->getControllableDevice([AJNConvertUtil convertNSStringToQCCString:deviceBusName])]; } - (QStatus)deleteControllableDevice:(NSString *)deviceBusName { return self.handle->deleteControllableDevice([AJNConvertUtil convertNSStringToQCCString:deviceBusName]); } - (QStatus)deleteAllControllableDevices { return self.handle->deleteAllControllableDevices(); } - (NSDictionary *)getControllableDevices { std::map cpp_ControllableDevices = self.handle->getControllableDevices(); NSMutableDictionary *controllableDevices = [[NSMutableDictionary alloc]init]; for (std::map ::const_iterator itr = cpp_ControllableDevices.begin(); itr != cpp_ControllableDevices.end(); itr++) { NSString *key = [AJNConvertUtil convertQCCStringtoNSString:itr->first]; AJCPSControlPanelDevice *value = [[AJCPSControlPanelDevice alloc] initWithHandle:itr->second]; [controllableDevices setObject:value forKey:key]; } return controllableDevices; } @endbase-15.09/controlpanel/ios/src/AJCPSControlPanelControllerUnit.mm000066400000000000000000000115261262264444500251610ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSControlPanelControllerUnit.h" #import "alljoyn/about/AJNConvertUtil.h" #import "AJCPSControlPanelDevice.h" #import "AJCPSNotificationAction.h" #import "AJCPSHttpControl.h" #import "AJCPSControlPanel.h" @interface AJCPSControlPanelControllerUnit () @property (nonatomic) ajn::services::ControlPanelControllerUnit *handle; @end @implementation AJCPSControlPanelControllerUnit - (id)initWithHandle:(ajn::services::ControlPanelControllerUnit *)handle { self = [super init]; if (self) { self.handle = handle; } return self; } - (id)initControlPanelControllerUnit:(NSString *)unitName device:(AJCPSControlPanelDevice *)device { self = [super init]; if (self) { self.handle = new ajn::services::ControlPanelControllerUnit([AJNConvertUtil convertNSStringToQCCString:unitName], [device handle]); } return self; } - (QStatus)addHttpControl:(NSString *)objectPath { return self.handle->addHttpControl([AJNConvertUtil convertNSStringToQCCString:objectPath]); } - (QStatus)addControlPanel:(NSString *)objectPath panelName:(NSString *)panelName { return self.handle->addControlPanel([AJNConvertUtil convertNSStringToQCCString:objectPath], [AJNConvertUtil convertNSStringToQCCString:panelName]); } - (QStatus)addNotificationAction:(NSString *)objectPath actionName:(NSString *)actionName { return self.handle->addNotificationAction([AJNConvertUtil convertNSStringToQCCString:objectPath], [AJNConvertUtil convertNSStringToQCCString:actionName]); } - (QStatus)removeNotificationAction:(NSString *)actionName { return self.handle->removeNotificationAction([AJNConvertUtil convertNSStringToQCCString:actionName]); } - (QStatus)registerObjects { return self.handle->registerObjects(); } - (QStatus)shutdownUnit { return self.handle->shutdownUnit(); } - (AJCPSControlPanelDevice *)getDevice { return [[AJCPSControlPanelDevice alloc] initWithHandle:self.handle->getDevice()]; } - (NSString *)getUnitName { return [AJNConvertUtil convertQCCStringtoNSString:self.handle->getUnitName()]; } - (NSDictionary *)getControlPanels { const std::map cpp_ControlPanels = self.handle->getControlPanels(); NSMutableDictionary *controlPanels = [[NSMutableDictionary alloc]init]; for (std::map ::const_iterator itr = cpp_ControlPanels.begin(); itr != cpp_ControlPanels.end(); itr++) { NSString *key = [AJNConvertUtil convertQCCStringtoNSString:itr->first]; AJCPSControlPanel *value = [[AJCPSControlPanel alloc] initWithHandle:itr->second]; [controlPanels setObject:value forKey:key]; } return controlPanels; } - (NSDictionary *)getNotificationActions { const std::map cpp_NotificationActions = self.handle->getNotificationActions(); NSMutableDictionary *notificationActions = [[NSMutableDictionary alloc]init]; for (std::map ::const_iterator itr = cpp_NotificationActions.begin(); itr != cpp_NotificationActions.end(); itr++) { NSString *key = [AJNConvertUtil convertQCCStringtoNSString:itr->first]; AJCPSNotificationAction *value = [[AJCPSNotificationAction alloc] initWithHandle:itr->second]; [notificationActions setObject:value forKey:key]; } return notificationActions; } - (AJCPSControlPanel *)getControlPanel:(NSString *)panelName { return [[AJCPSControlPanel alloc]initWithHandle:self.handle->getControlPanel([AJNConvertUtil convertNSStringToQCCString:panelName])]; } - (AJCPSNotificationAction *)getNotificationAction:(NSString *)actionName { return [[AJCPSNotificationAction alloc]initWithHandle:self.handle->getNotificationAction([AJNConvertUtil convertNSStringToQCCString:actionName])]; } - (AJCPSHttpControl *)getHttpControl { if (!self.handle->getHttpControl()) { return nil; } return [[AJCPSHttpControl alloc] initWithHandle:self.handle->getHttpControl()]; } @endbase-15.09/controlpanel/ios/src/AJCPSControlPanelDevice.mm000066400000000000000000000114551262264444500233760ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSControlPanelDevice.h" #import "alljoyn/about/AJNConvertUtil.h" #import "alljoyn/controlpanel/ControlPanelControllerUnit.h" #import "AJCPSControlPanelListenerAdapter.h" #import "AJCPSControlPanel.h" @interface AJCPSControlPanelDevice () @property (nonatomic) ajn::services::ControlPanelDevice *handle; @end @implementation AJCPSControlPanelDevice - (id)initWithHandle:(ajn::services::ControlPanelDevice *)handle; { self = [super init]; if (self) { self.handle = handle; } return self; } - (void)dealloc { //we are not the creators of this handle } - (QStatus)startSessionAsync { return self.handle->startSessionAsync(); } - (QStatus)startSession { return self.handle->startSession(); } - (QStatus)endSession { return self.handle->endSession(); } - (QStatus)shutdownDevice { return self.handle->shutdownDevice(); } - (NSString *)getDeviceBusName { return [AJNConvertUtil convertQCCStringtoNSString:self.handle->getDeviceBusName()]; } - (AJNSessionId)getSessionId { return self.handle->getSessionId(); } // const std::map& getDeviceUnits const; - (NSDictionary *)getDeviceUnits { const std::map & cpp_deviceUnits = self.handle->getDeviceUnits(); NSMutableDictionary *deviceUnits = [[NSMutableDictionary alloc]init]; for (std::map ::const_iterator itr = cpp_deviceUnits.begin(); itr != cpp_deviceUnits.end(); itr++) { NSString *key = [AJNConvertUtil convertQCCStringtoNSString:itr->first]; AJCPSControlPanelControllerUnit *value = [[AJCPSControlPanelControllerUnit alloc] initWithHandle:itr->second]; [deviceUnits setObject:value forKey:key]; } return deviceUnits; } - (NSArray *)getAllControlPanels { std::vector controlPanelsVec; self.handle->getAllControlPanels(controlPanelsVec); NSMutableArray *controlPanels = [[NSMutableArray alloc]init]; for (int i = 0; i != controlPanelsVec.size(); i++) { AJCPSControlPanel *controlPanel = [[AJCPSControlPanel alloc]initWithHandle:controlPanelsVec.at(i)]; [controlPanels addObject:controlPanel]; } return controlPanels; } - (AJCPSControlPanelControllerUnit *)getControlPanelUnit:(NSString *)objectPath { return [[AJCPSControlPanelControllerUnit alloc]initWithHandle:self.handle->getControlPanelUnit([AJNConvertUtil convertNSStringToQCCString:objectPath])]; } - (AJCPSControlPanelControllerUnit *)addControlPanelUnit:(NSString *)objectPath interfaces:(NSArray *)interfaces { std::vector cpp_interfaces; for (NSString *str in interfaces) { cpp_interfaces.push_back([AJNConvertUtil convertNSStringToQCCString:str]); } return [[AJCPSControlPanelControllerUnit alloc]initWithHandle:self.handle->addControlPanelUnit([AJNConvertUtil convertNSStringToQCCString:objectPath], cpp_interfaces)]; } - (AJCPSNotificationAction *)addNotificationAction:(NSString *)objectPath { return [[AJCPSNotificationAction alloc]initWithHandle:self.handle->addNotificationAction([AJNConvertUtil convertNSStringToQCCString:objectPath])]; } - (QStatus)removeNotificationAction:(AJCPSNotificationAction *)notificationAction { return self.handle->removeNotificationAction([notificationAction handle]); } - (id )getListener { AJCPSControlPanelListenerAdapter *adapter = (AJCPSControlPanelListenerAdapter *)self.handle->getListener(); return adapter->getListener(); } - (QStatus)setListener:(id )listener { AJCPSControlPanelListenerAdapter *adapter = (AJCPSControlPanelListenerAdapter *)self.handle->getListener(); if (adapter) { delete adapter; adapter = NULL; // for completeness sake } adapter = new AJCPSControlPanelListenerAdapter(listener); return self.handle->setListener(adapter); } @endbase-15.09/controlpanel/ios/src/AJCPSControlPanelEnums.mm000066400000000000000000000102501262264444500232560ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSControlPanelEnums.h" @interface AJCPSControlPanelEnums () @end @implementation AJCPSControlPanelEnums @end //#ifndef CONTROLPANELENUMS_H_ //#define CONTROLPANELENUMS_H_ // //namespace ajn { //namespace services { // //#ifndef UINT32_MAX //#define UINT32_MAX (4294967295U) //#endif // ///** // * Typedefs for functionPointers used // */ //typedef bool (*GetBoolFptr)(); //typedef uint32_t (*GetUint32Fptr)(); //typedef const char* (*GetStringFptr)(uint16_t); // ///** // * Mode ControlPanel is in // */ //typedef enum { // CONTROLLEE_MODE, //!< CONTROLLEE_MODE // CONTROLLER_MODE //!< CONTROLLER_MODE //} ControlPanelMode; // ///** // * WidgetType // */ //typedef enum { // CONTAINER = 0, //!< CONTAINER // ACTION = 1, //!< ACTION // ACTION_WITH_DIALOG = 2, //!< ACTION_WITH_DIALOG // LABEL = 3, //!< LABEL // PROPERTY = 4, //!< PROPERTY // DIALOG = 5 //!< DIALOG //} WidgetType; // ///** // * Enum to define the type of Property // */ //typedef enum { // BOOL_PROPERTY = 0, //!< BOOL_PROPERTY // UINT16_PROPERTY = 1, //!< UINT16_PROPERTY // INT16_PROPERTY = 2, //!< INT16_PROPERTY // UINT32_PROPERTY = 3, //!< UINT32_PROPERTY // INT32_PROPERTY = 4, //!< INT32_PROPERTY // UINT64_PROPERTY = 5, //!< UINT64_PROPERTY // INT64_PROPERTY = 6, //!< INT64_PROPERTY // DOUBLE_PROPERTY = 7, //!< DOUBLE_PROPERTY // STRING_PROPERTY = 8, //!< STRING_PROPERTY // DATE_PROPERTY = 9, //!< DATE_PROPERTY // TIME_PROPERTY = 10, //!< TIME_PROPERTY // UNDEFINED = 11 //!< UNDEFINED //} PropertyType; // ///** // * Transactions that could go wrong resulting in an Error Occurred event being fired // */ //typedef enum { // SESSION_JOIN = 0, //!< SESSION_JOIN // REGISTER_OBJECTS = 1, //!< REGISTER_OBJECTS // REFRESH_VALUE = 2, //!< REFRESH_VALUE // REFRESH_PROPERTIES = 3 //!< REFRESH_PROPERTIES //} ControlPanelTransaction; // ///** // * Hints for Containers Widgets // * determining the layout // */ //enum LAYOUT_HINTS { // VERTICAL_LINEAR = 1, //!< VERTICAL_LINEAR // HORIZONTAL_LINEAR = 2 //!< HORIZONTAL_LINEAR //}; // ///** // * Hints for Dialog Widgets // */ //enum DIALOG_HINTS { // ALERTDIALOG = 1 //!< ALERTDIALOG //}; // ///** // * Hints for Property Widgets // */ //enum PROPERTY_HINTS { // SWITCH = 1, //!< SWITCH // CHECKBOX = 2, //!< CHECKBOX // SPINNER = 3, //!< SPINNER // RADIOBUTTON = 4, //!< RADIOBUTTON // SLIDER = 5, //!< SLIDER // TIMEPICKER = 6, //!< TIMEPICKER // DATEPICKER = 7, //!< DATEPICKER // NUMBERPICKER = 8, //!< NUMBERPICKER // KEYPAD = 9, //!< KEYPAD // ROTARYKNOB = 10, //!< ROTARYKNOB // TEXTVIEW = 11, //!< TEXTVIEW // NUMERICVIEW = 12, //!< NUMERICVIEW // EDITTEXT = 13 //!< EDITTEXT //}; // ///** // * Hints for Label Widgets // */ //enum LABEL_HINTS { // TEXTLABEL = 1 //!< TEXTLABEL //}; // ///** // * Hints for ListProperty Widgets // */ //enum LIST_PROPERTY_HINTS { // DYNAMICSPINNER = 1 //!< DYNAMICSPINNER //}; // ///** // * Hints for Action Widgets // */ //enum ACTION_HINTS { // ACTIONBUTTON = 1 //!< ACTIONBUTTON //}; // //} //namespace services //} //namespace ajn // //#endif /* CONTROLPANELENUMS_H_ */ base-15.09/controlpanel/ios/src/AJCPSControlPanelService.mm000066400000000000000000000067301262264444500235770ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSControlPanelService.h" #import "AJSVCGenericLoggerAdapter.h" #import "AJCPSControlPanelListenerAdapter.h" @interface AJCPSControlPanelService () @property (nonatomic) ajn::services::ControlPanelService *handle; @property (nonatomic) AJCPSControlPanelListenerAdapter *listenerAdapter; @property id currentLogger; @property AJSVCGenericLoggerAdapter *genericLoggerAdapter; @end @implementation AJCPSControlPanelService + (AJCPSControlPanelService *)getInstance { static AJCPSControlPanelService *aboutLogger; static dispatch_once_t donce; dispatch_once(&donce, ^{ aboutLogger = [[self alloc] init]; }); return aboutLogger; } - (id)init { self = [super init]; self.handle = ajn::services::ControlPanelService::getInstance(); return self; } - (QStatus)initController:(AJNBusAttachment *)bus controlPanelController:(AJCPSControlPanelController *)controlPanelController controlPanelListener:(id )controlPanelListener { self.listenerAdapter = new AJCPSControlPanelListenerAdapter(controlPanelListener); return self.handle->initController((ajn::BusAttachment *)[bus handle], [controlPanelController handle], self.listenerAdapter); } /** * Remove locally stored controller. Allows a new call to initController to be made * @return status */ - (QStatus)shutdownController { return self.handle->shutdown(); } - (AJNBusAttachment *)getBusAttachment { return [[AJNBusAttachment alloc]initWithHandle:self.handle->getBusAttachment()]; } /** * Get the ControlPanelListener * @return ControlPanelListener */ - (id )getControlPanelListener { AJCPSControlPanelListenerAdapter *adapter = (AJCPSControlPanelListenerAdapter *)self.handle->getControlPanelListener(); return adapter->getListener(); } /** * Get the Version of the ControlPanelService * @return the ControlPanelService version */ - (uint16_t)getVersion { return self.handle->getVersion(); } #pragma mark - Logger methods - (void)setLogger:(id )logger { if (logger) { // save current logger self.currentLogger = logger; // call setLoger with the adapter and save the prev Logger } else { [self.currentLogger warnTag:([NSString stringWithFormat:@"%@", [[self class] description]]) text:@"Failed set a logger"]; } } - (id )logger { return self.currentLogger; } - (void)setLogLevel:(QLogLevel)newLogLevel { [self.currentLogger setLogLevel:newLogLevel]; } - (QLogLevel)logLevel { return [self.currentLogger logLevel]; } @endbase-15.09/controlpanel/ios/src/AJCPSControllerModel.mm000066400000000000000000000472131262264444500227630ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSControllerModel.h" #import "AJCPSAction.h" #import "AJCPSDialog.h" #import "AJCPSProperty.h" #import "AJCPSCPSDate.h" #import "AJCPSCPSTime.h" #import "AJCPSControlPanelDevice.h" #import "AJCPSActionWithDialog.h" #import "AJCPSConstraintList.h" #import "alljoyn/about/PropertyStore.h" //for ER codes @interface ControllerModel () @property (strong, nonatomic) NSMutableArray *containerStack; // array of AJCPSContainer * @property (strong, nonatomic) NSArray *supportedLanguages; //array of NSStrings of languages @end @implementation ControllerModel - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { NSLog(@"alert button has been clicked"); dispatch_async(dispatch_get_main_queue(), ^{ [self.delegate loadEnded]; }); } - (id)init { if (self = [super init]) { self.containerStack = [[NSMutableArray alloc]init]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hasPasscodeInput:) name:@"hasPasscodeForBus" object:nil]; } return self; } - (void)hasPasscodeInput:(NSNotification *)notification { if ([notification.name isEqualToString:@"hasPasscodeForBus"]) { [[[UIAlertView alloc] initWithTitle:@"Authentication failed" message:@"If you've entered a new password - please press Back to reload data." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; } } - (NSString *)widgetTypeToString:(AJCPSWidgetType)widgetType { switch (widgetType) { case AJCPS_CONTAINER: return @"AJCPS_CONTAINER"; case AJCPS_ACTION: return @"AJCPS_ACTION"; case AJCPS_ACTION_WITH_DIALOG: return @"AJCPS_ACTION_WITH_DIALOG"; case AJCPS_LABEL: return @"AJCPS_LABEL"; case AJCPS_PROPERTY: return @"AJCPS_PROPERTY"; case AJCPS_DIALOG: return @"AJCPS_DIALOG"; case AJCPS_ERROR: return @"AJCPS_ERROR"; default: return nil; } // AJCPS_CONTAINER = 0, //!< CONTAINER // AJCPS_ACTION = 1, //!< ACTION // AJCPS_ACTION_WITH_DIALOG = 2, //!< ACTION_WITH_DIALOG // AJCPS_LABEL = 3, //!< LABEL // AJCPS_PROPERTY = 4, //!< PROPERTY // AJCPS_DIALOG = 5 //!< DIALOG } - (void)loadContainer { AJCPSContainer *container = self.containerStack[[self.containerStack count] - 1]; [self printBasicWidget:container]; // Array of AJCPSWidget objects @synchronized(self){ self.widgetsContainer = [container getChildWidgets]; } NSLog(@"Print ChildWidgets: "); for (NSInteger i = 0; i < [self.widgetsContainer count]; i++) { AJCPSWidgetType widgetType = [[self.widgetsContainer objectAtIndex:i] getWidgetType]; NSLog(@"Print %@", [self widgetTypeToString:widgetType]); [self printBasicWidget:self.widgetsContainer[i]]; switch (widgetType) { case AJCPS_CONTAINER: { } break; case AJCPS_ACTION: { } break; case AJCPS_ACTION_WITH_DIALOG: { [self printDialog:[((AJCPSActionWithDialog*)self.widgetsContainer[i]) getChildDialog]]; } break; case AJCPS_LABEL: { } break; case AJCPS_PROPERTY: { [self printProperty:((AJCPSProperty *)self.widgetsContainer[i])]; } break; case AJCPS_DIALOG: { [self printDialog:((AJCPSDialog*)self.widgetsContainer[i])]; } break; default: { NSLog(@"Unsupported AJCPSWidgetType"); } break; } } [self.delegate refreshEntries]; } - (QStatus)loadRootWidget:(AJCPSRootWidget *)rootWidget //- (QStatus)printRootWidget:(AJCPSContainer*) rootWidget { if (!rootWidget) { NSLog(@"faild to load RootWidget - rootWidget is empty."); return ER_FAIL; } AJCPSWidgetType wType = [rootWidget getWidgetType]; NSLog(@"---> printRootWidget: %@", [self widgetTypeToString:wType]); switch (wType) { case AJCPS_CONTAINER: { self.containerStack[0] = [[AJCPSContainer alloc] initWithHandle:(ajn::services::Container*)rootWidget.handle]; [self loadContainer]; } break; case AJCPS_ACTION: {} break; case AJCPS_ACTION_WITH_DIALOG: {} break; case AJCPS_LABEL: {} break; case AJCPS_PROPERTY: {} break; case AJCPS_DIALOG: { [self printBasicWidget:rootWidget]; NSString* dialogLabel = [(AJCPSWidget *)rootWidget getLabel]; AJCPSDialog* dialog = [[AJCPSDialog alloc] initWithHandle:(ajn::services::Dialog *)rootWidget.handle]; uint16_t numActions = [dialog getNumActions]; NSLog(@"AJCPS_DIALOG numActions: %hu",numActions); NSMutableString* actionsString = [[NSMutableString alloc] init]; switch (numActions) { case 3: [actionsString appendString:[NSString stringWithFormat:@"%@ ",[dialog getLabelAction3]]]; case 2: [actionsString appendString:[NSString stringWithFormat:@"%@ ",[dialog getLabelAction2]]]; case 1: [actionsString appendString:[NSString stringWithFormat:@"%@ ",[dialog getLabelAction1]]]; break; default: break; } [[[UIAlertView alloc] initWithTitle:@"Received Dialog:" message:[NSString stringWithFormat:@"%@\n%@\n%@",dialogLabel,[dialog getMessage], actionsString] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; } break; default: { NSLog(@"unsupported AJCPSWidgetType"); } break; } return ER_OK; } - (void)printBasicWidget:(AJCPSWidget *)widget { NSLog(@" widget name: %@", [widget getWidgetName]); NSLog(@" widget version: %hu", [widget getInterfaceVersion]); NSLog(@" widget is %@", [widget getIsSecured] ? @"secured" : @"not secured"); NSLog(@" widget is %@", [widget getIsEnabled] ? @"enabled" : @"not enabled"); NSLog(@" widget is %@", [widget getIsWritable] ? @"writable" : @"not writable"); if ([[widget getLabel] length]) NSLog(@" widget label: %@", [widget getLabel]); // if ([widget getBgColor] != UINT32_MAX) NSLog(@" widget bgColor: %u", [widget getBgColor]); } -(void)printProperty:(AJCPSProperty *)property { NSMutableString *str = [[NSMutableString alloc]init]; AJCPSPropertyValue propertyValue; [property getPropertyValue:propertyValue]; switch ([property getPropertyType]) { case AJCPS_BOOL_PROPERTY : [str appendFormat:@"bool property, value:%d",propertyValue.boolValue]; break; case AJCPS_UINT16_PROPERTY : [str appendFormat:@"uint16 property, value:%d",propertyValue.uint16Value]; break; case AJCPS_INT16_PROPERTY : [str appendFormat:@"int16 property, value:%d",propertyValue.int16Value]; break; case AJCPS_UINT32_PROPERTY : [str appendFormat:@"uint32 property, value:%d",propertyValue.uint32Value]; break; case AJCPS_INT32_PROPERTY : [str appendFormat:@"int32 property, value:%d",propertyValue.int32Value]; break; case AJCPS_UINT64_PROPERTY : [str appendFormat:@"uint64 property, value:%llu",propertyValue.uint64Value]; break; case AJCPS_INT64_PROPERTY : [str appendFormat:@"int64 property, value:%lld",propertyValue.int64Value]; break; case AJCPS_DOUBLE_PROPERTY : [str appendFormat:@"double property, value:%f",propertyValue.doubleValue]; break; case AJCPS_STRING_PROPERTY : [str appendFormat:@"string property, value:'%s'",propertyValue.charValue]; break; case AJCPS_DATE_PROPERTY : [str appendFormat:@"date property"]; //TODO support date break; case AJCPS_TIME_PROPERTY : [str appendFormat:@"time property"]; //TODO support time break; default: [str appendFormat:@"unknown property"]; break; } if(![[property getUnitOfMeasure] isEqualToString:@""]) { [str appendFormat:@",unitOfMeasure:%@", [property getUnitOfMeasure]]; } [str appendString:@"\n"]; AJCPSConstraintRange *constraintRange = [property getConstraintRange]; if (constraintRange) { [str appendFormat:@"min:%d,max:%d,inc:%d",[constraintRange getMinValue],[constraintRange getMaxValue],[constraintRange getIncrementValue]]; } NSArray *list = [property getConstraintList]; if ([list count]) { [str appendString:@"list:"]; } for (AJCPSConstraintList *constraintList in list) { [str appendFormat:@"%@",[constraintList getDisplay]]; AJCPSConstraintValue propertyValue = [constraintList getConstraintValue]; switch ([constraintList getPropertyType]) { case AJCPS_UINT16_PROPERTY : [str appendFormat:@"(%d)",propertyValue.uint16Value]; break; case AJCPS_INT16_PROPERTY : [str appendFormat:@"(%d)",propertyValue.int16Value]; break; case AJCPS_UINT32_PROPERTY : [str appendFormat:@"(%d)",propertyValue.uint32Value]; break; case AJCPS_INT32_PROPERTY : [str appendFormat:@"(%d)",propertyValue.int32Value]; break; case AJCPS_UINT64_PROPERTY : [str appendFormat:@"(%llu)",propertyValue.uint64Value]; break; case AJCPS_INT64_PROPERTY : [str appendFormat:@"(%lld)",propertyValue.int64Value]; break; case AJCPS_DOUBLE_PROPERTY : [str appendFormat:@"(%f)",propertyValue.doubleValue]; break; case AJCPS_STRING_PROPERTY : [str appendFormat:@"('%s')",propertyValue.charValue]; break; default: NSLog(@"unknown property"); break; } } NSLog(@"%@",str); } -(void) printDialog:(AJCPSDialog*) dialog { NSLog(@" Dialog message: %@", [dialog getMessage]); NSLog(@" Dialog numActions: %d", [dialog getNumActions]); if (![[dialog getLabelAction1] isEqualToString:@""]) { NSLog(@" Dialog Label for Action1: %@" , [dialog getLabelAction1]); } if (![[dialog getLabelAction2] isEqualToString:@""]) { NSLog(@" Dialog Label for Action1: %@" , [dialog getLabelAction2]); } if (![[dialog getLabelAction3] isEqualToString:@""]) { NSLog(@" Dialog Label for Action1: %@" , [dialog getLabelAction3]); } } #pragma mark - AJCPSControlPanelListener protocol methods /** * sessionEstablished - callback when a session is established with a device * @param device - the device that the session was established with */ - (void)sessionEstablished:(AJCPSControlPanelDevice *)device { // An example of how to get all the control panels on the device: // NSArray *controlpanels = [device getAllControlPanels]; // // for (AJCPSControlPanel *panel in controlpanels) { // NSLog(@"%@", [panel getPanelName]); // } NSLog(@"Session has been established with device: %@", [device getDeviceBusName]); // Dictionary that contains AJCPSControlPanelControllerUnit's NSDictionary *units = [device getDeviceUnits]; if (![units count]) { NSLog(@"Device %@ has no units.", [device getDeviceBusName]); return; } NSString *unitsKey = units.allKeys[0]; NSLog(@"Start loading unit: %@", unitsKey); self.unit = unitsKey; //Setting the table view titleForHeader AJCPSControlPanelControllerUnit *unitsValue = [units objectForKey:unitsKey]; AJCPSHttpControl *httpControl = [unitsValue getHttpControl]; if (httpControl) { NSLog(@"Unit has a HttpControl: "); NSLog(@" HttpControl version: %hu", [httpControl getInterfaceVersion]); NSLog(@" HttpControl url: %@", [httpControl getUrl]); } // Dictionary that contains AJCPSControlPanel's NSDictionary *controlPanels = [unitsValue getControlPanels]; NSString *controlPanelsKey = controlPanels.allKeys[0]; NSLog(@"-----> Start parsing panelName: %@", controlPanelsKey); self.controlPanel = [controlPanels objectForKey:controlPanelsKey]; // Array of languages in an NSString format self.supportedLanguages = [[self.controlPanel getLanguageSet] getLanguages]; if (![self.supportedLanguages count]) { [[[UIAlertView alloc] initWithTitle:@"Error" message:@"There is no supported language for this Container" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; } else { NSString *lang = self.supportedLanguages[0]; [self populateRootContainer:lang]; } dispatch_async(dispatch_get_main_queue(), ^{ [self.delegate loadEnded]; }); } /** * sessionLost - callback when a session is lost with a device * @param device - device that the session was lost with */ - (void)sessionLost:(AJCPSControlPanelDevice *)device { NSLog(@"%@] Calling: %@", [[self class] description], NSStringFromSelector(_cmd)); dispatch_async(dispatch_get_main_queue(), ^{ [self.delegate loadEnded]; }); [NSThread sleepForTimeInterval:5]; [device endSession]; } /** * signalPropertiesChanged - callback when a property Changed signal is received * @param device - device signal was received from * @param widget - widget signal was received for */ - (void)signalPropertiesChanged:(AJCPSControlPanelDevice *)device widget:(AJCPSWidget *)widget { NSLog(@"[%@] Calling: %@", [[self class] description], NSStringFromSelector(_cmd)); dispatch_async(dispatch_get_main_queue(), ^{ [self.delegate loadEnded]; }); [self printBasicWidget:widget]; [self loadContainer]; } /** * signalPropertyValueChanged - callback when a property Value Changed signal is received * @param device - device signal was received from * @param property - Property signal was received for */ - (void)signalPropertyValueChanged:(AJCPSControlPanelDevice *)device property:(AJCPSProperty *)property { NSLog(@"[%@] Calling: %@", [[self class] description], NSStringFromSelector(_cmd)); dispatch_async(dispatch_get_main_queue(), ^{ [self.delegate loadEnded]; }); [self printBasicWidget:property]; [self printProperty:property]; [self loadContainer]; } /** * signalDismiss - callback when a Dismiss signal is received * @param device - device signal was received from * @param notificationAction - notificationAction signal was received for */ - (void)signalDismiss:(AJCPSControlPanelDevice *)device notificationAction:(AJCPSNotificationAction *)notificationAction { NSLog(@"[%@] Calling: %@", [[self class] description], NSStringFromSelector(_cmd)); dispatch_async(dispatch_get_main_queue(), ^{ [self.delegate loadEnded]; }); } /** * ErrorOccured - callback to tell application when something goes wrong * @param device - device that had the error * @param status - status associated with error if applicable * @param transaction - the type of transaction that resulted in the error * @param errorMessage - a log-able error Message */ - (void)errorOccured:(AJCPSControlPanelDevice *)device status:(QStatus)status transaction:(AJCPSControlPanelTransaction)transaction errorMessage:(NSString *)errorMessage { NSLog(@"[%@] Calling: %@", [[self class] description], NSStringFromSelector(_cmd)); dispatch_async(dispatch_get_main_queue(), ^{ [self.delegate loadEnded]; }); NSLog(@"error message:'%@'", errorMessage); dispatch_async(dispatch_get_main_queue(), ^{ [[[UIAlertView alloc] initWithTitle:@"Error" message:[NSString stringWithFormat:@"%@" ,errorMessage] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; }); } #pragma mark - util methods - (void)pushChildContainer:(AJCPSContainer *)containerToPush { self.containerStack[[self.containerStack count]] = containerToPush; [self loadContainer]; } - (NSInteger)popChildContainer { if([self.containerStack count] > 0) //until the first container is loaded, this array is empty { [self.containerStack removeObjectAtIndex:[self.containerStack count] - 1]; if ([self.containerStack count] > 0) { [self loadContainer]; } } return [self.containerStack count]; } - (void)populateRootContainer:(NSString*)lang { QStatus status; NSLog(@"---------> Now loading language: %@", lang); AJCPSContainer *rootContainer = (AJCPSContainer *)[self.controlPanel getRootWidget:lang]; NSLog(@"-----> Finished loading widget: %@", [rootContainer getWidgetName]); status = [self loadRootWidget:rootContainer]; if(ER_OK != status) { NSLog(@"Failed to load root widget"); } } -(QStatus)switchLanguage:(NSString *)language { QStatus status = ER_OK; if ([self.supportedLanguages indexOfObject:language] != NSNotFound) { AJCPSContainer *rootContainer = (AJCPSContainer *)[self.controlPanel getRootWidget:language]; NSLog(@"-----> Finished loading widget: %@", [rootContainer getWidgetName]); status = [self loadRootWidget:rootContainer]; return status; } else { return ER_LANGUAGE_NOT_SUPPORTED; } return status; } -(QStatus)switchLanguageForNotificationAction:(AJCPSRootWidget *)rootWidget { QStatus status = ER_OK; if (rootWidget) { NSLog(@"-----> Finished loading widget: %@", [rootWidget getWidgetName]); status = [self loadRootWidget:rootWidget]; return status; } else { return ER_LANGUAGE_NOT_SUPPORTED; } return status; } -(void)setSupportedLanguagesForNotificationAction:(AJCPSNotificationAction *) notificationAction { self.supportedLanguages = [[notificationAction getLanguageSet] getLanguages]; if (![self.supportedLanguages count]) { NSLog(@"notification action languages is empty"); } } -(NSInteger)childContainerPosition { return [self.containerStack count]; } @end base-15.09/controlpanel/ios/src/AJCPSDialog.mm000066400000000000000000000042261262264444500210530ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSDialog.h" #import "alljoyn/about/AJNConvertUtil.h" @interface AJCPSDialog () @end @implementation AJCPSDialog - (id)initWithHandle:(ajn::services::Dialog *)handle { self = [super initWithHandle:handle]; if (self) { } return self; } - (uint16_t)getNumActions { return ((ajn::services::Dialog *)self.handle)->getNumActions(); } - (NSString *)getMessage { return [AJNConvertUtil convertQCCStringtoNSString:((ajn::services::Dialog *)self.handle)->getMessage()]; } - (NSString *)getLabelAction1 { return [AJNConvertUtil convertQCCStringtoNSString:((ajn::services::Dialog *)self.handle)->getLabelAction1()]; } - (NSString *)getLabelAction2 { return [AJNConvertUtil convertQCCStringtoNSString:((ajn::services::Dialog *)self.handle)->getLabelAction2()]; } - (NSString *)getLabelAction3 { return [AJNConvertUtil convertQCCStringtoNSString:((ajn::services::Dialog *)self.handle)->getLabelAction3()]; } - (QStatus)executeAction1 { return ((ajn::services::Dialog *)self.handle)->executeAction1(); } - (QStatus)executeAction2 { return ((ajn::services::Dialog *)self.handle)->executeAction2(); } - (QStatus)executeAction3 { return ((ajn::services::Dialog *)self.handle)->executeAction3(); } @end base-15.09/controlpanel/ios/src/AJCPSErrorWidget.mm000066400000000000000000000103601262264444500221050ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSErrorWidget.h" #import "alljoyn/about/AJNConvertUtil.h" #import "AJCPSControlPanelDevice.h" @interface AJCPSErrorWidget () @end @implementation AJCPSErrorWidget - (id)initWithHandle:(ajn::services::ErrorWidget *)handle { self = [super initWithHandle:handle]; if (self) { } return self; } - (AJCPSWidget*)getOriginalWidget { return [[AJCPSWidget alloc]initWithHandle:((ajn::services::ErrorWidget *)self.handle)->getOriginalWidget()]; } @end //#ifndef LABEL_H_ //#define LABEL_H_ // //#include //#include // //namespace ajn { //namespace services { // ///** // * Label class used to display a Label // */ //class Label : public Widget { // public: // // /** // * Constructor for Label class // * @param name - name of Widget // * @param rootWidget - the RootWidget of the widget // */ // Label(qcc::String const& name, Widget* rootWidget);// SKIP // // /** // * Constructor for Label class // * @param name - name of Widget // * @param rootWidget - the RootWidget of the widget // * @param device - the device that contains this Widget // */ // Label(qcc::String const& name, Widget* rootWidget, ControlPanelDevice* device); // // /** // * Destructor for Label class // */ // virtual ~Label(); // // /** // * creates and returns the appropriate BusObject for this Widget // * @param bus - the bus used to create the widget // * @param objectPath - the objectPath of the widget // * @param langIndx - the language Indx // * @param status - the status indicating success or failure // * @return a newly created WidgetBusObject // */ // WidgetBusObject* createWidgetBusObject(BusAttachment* bus, qcc::String const& objectPath, // uint16_t langIndx, QStatus& status);// SKIP // // /** // * Get the Labels vector of the widget // * @return - label // */ // const std::vector& getLabels() const;// SKIP // // /** // * Set the labels vector of the widget // * @param labels - vector of labels // */ // void setLabels(const std::vector& labels);// SKIP // // /** // * Get the GetLabel function pointer // * @return GetLabel function pointer // */ // GetStringFptr getGetLabels() const;// SKIP // // /** // * Set the GetLabel function pointer // * @param getLabel - getLabel function pointer // */ // void setGetLabels(GetStringFptr getLabel);// SKIP // // /** // * Fill MsgArg passed in with the Label // * @param val - msgArg to fill // * @param languageIndx - language of the label // * @return status - success/failure // */ // QStatus fillLabelArg(MsgArg& val, uint16_t languageIndx);// SKIP // // /** // * Read MsgArg passed in to fill the Label property // * @param val - MsgArg passed in // * @return status - success/failure // */ // QStatus readLabelArg(MsgArg* val);// SKIP // // private: // // /** // * Vector of Labels of Label Widget // */ // std::vector m_LabelWidgetLabels; // // /** // * GetLabel functionPointer of Label Widget // */ // GetStringFptr m_LabelWidgetGetLabels; //}; //} //namespace services //} //namespace ajn // //#endif /* LABEL_H_ */ // base-15.09/controlpanel/ios/src/AJCPSGetControlPanelViewController.mm000066400000000000000000000371311262264444500256140ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSGetControlPanelViewController.h" #import "alljoyn/Status.h" #import "AJCPSControlPanelService.h" #import "AJCPSControlPanelController.h" #import "AJCPSContainer.h" #import "AJCPSControllerUpdateEvents.h" #import "AJCPSCPSButtonCell.h" #import "AJCPSCPSGeneralCell.h" const float GENERAL_CELL_HEIGHT = 115.00; const float BUTTON_CELL_HEIGHT = 65.00; static NSString * const CLIENTDEFAULTLANG=@""; static NSString * const CPS_BUTTON_CELL = @"CPSButtonCell"; static NSString * const CPS_GENERAL_CELL = @"CPSGeneralCell"; @interface GetControlPanelViewController () @property (strong, nonatomic) ControllerModel *controllerModel; @property (strong, nonatomic) AJCPSControlPanelService *controlPanelService; @property (strong, nonatomic) AJCPSControlPanelController *controlPanelController; @property (strong, nonatomic) AJCPSControlPanelDevice *controlPanelDevice; @property (strong, nonatomic) UITextField *alertChooseLanguage; @property (strong, nonatomic) UIBarButtonItem *chooseLangButton; @property (strong, nonatomic) UITableView* tableView; @property (weak, nonatomic) AJNBusAttachment *clientBusAttachment; @property (weak, nonatomic) AJNAnnouncement *announcement; @property (nonatomic) bool isAnnouncementMode; @property (strong, nonatomic) NSString *notificationSenderBusName; @property (strong, nonatomic) NSString *notificationCPSObjectPath; @property (nonatomic) bool isNotificationMode; @property (strong, nonatomic) AJCPSNotificationAction* notificationAction; @property (strong, atomic) UIAlertView *loadingAV; @end @implementation GetControlPanelViewController - (id)initWithNotificationSenderBusName:(NSString*) senderBusName cpsObjectPath:(NSString*) cpsObjectPath bus:(AJNBusAttachment*) bus { if (self = [super init]) { self.notificationSenderBusName = senderBusName; self.notificationCPSObjectPath = cpsObjectPath; self.clientBusAttachment = bus; self.isNotificationMode = true; } return self; } - (id)initWithAnnouncement:(AJNAnnouncement*) announcement bus:(AJNBusAttachment*) bus { if (self = [super init]) { self.announcement = announcement; self.clientBusAttachment = bus; self.isAnnouncementMode = true; } return self; } - (void)viewDidLoad { QStatus status; [super viewDidLoad]; self.navigationItem.hidesBackButton = YES; [self showLoadingAlert:@"Loading..."]; // Add language button if (self.isAnnouncementMode) { [self addLanguageButton]; } CGRect tableViewFrame = self.view.bounds; self.tableView = [[UITableView alloc] initWithFrame:tableViewFrame style:UITableViewStylePlain]; self.tableView.delegate = self; self.tableView.dataSource = self; // Add two cells to UITableView : [self.tableView registerClass:[CPSButtonCell class] forCellReuseIdentifier:CPS_BUTTON_CELL]; [self.tableView registerClass:[CPSGeneralCell class] forCellReuseIdentifier:CPS_GENERAL_CELL]; [self.view addSubview:self.tableView]; if (!self.controllerModel) { status = [self startService]; if (ER_OK != status) { NSLog(@"Failed to start control panel"); [[[UIAlertView alloc] initWithTitle:@"Error" message:@"Failed to start control panel." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; [self loadEnded]; } } } -(QStatus)startService { QStatus status; if (!self.clientBusAttachment) { NSLog(@"Bus attachment is nil."); return ER_FAIL; } if (self.isNotificationMode && self.isAnnouncementMode) { NSLog(@"Using both Annnouncement and Notification mode is not supported"); return ER_FAIL; } // Get a controllable device using senderBusName (Notification1.1) self.controlPanelController = [[AJCPSControlPanelController alloc] init]; if (self.isNotificationMode) { self.controlPanelDevice = [self.controlPanelController getControllableDevice:self.notificationSenderBusName]; if (!self.controlPanelDevice) { NSLog(@"Could not initialize control panel device."); return ER_FAIL; } } self.controllerModel = [[ControllerModel alloc] init]; if (!self.controllerModel) { NSLog(@"Could not initialize controller model."); return ER_FAIL; } self.controllerModel.delegate = self; self.controlPanelService = [AJCPSControlPanelService getInstance]; status = [self.controlPanelService initController:self.clientBusAttachment controlPanelController:self.controlPanelController controlPanelListener:self.controllerModel]; if (status != ER_OK) { NSLog(@"Could not initialize Controller."); return ER_FAIL; } else { NSLog(@"Successfully initialize Controller."); } if (self.isAnnouncementMode) { // Create a controllable device using the announcement bus name - this will trigger a listener method self.controlPanelDevice = [self.controlPanelController createControllableDevice:self.announcement.busName ObjectDescs:self.announcement.objectDescriptions]; if (!self.controlPanelDevice) { NSLog(@"Could not initialize control panel device."); return ER_FAIL; } else { NSLog(@"Successfully initialize control panel device."); } return status; } if (self.isNotificationMode) { status = [self loadNewSessionForNotificationWithAction]; if (ER_OK != status) { NSLog(@"Failed to load session for notification with action"); } else { NSLog(@"Successfully load a session for notification with action"); } } return status; } -(QStatus)loadNewSessionForNotificationWithAction { QStatus status; status = [self.controlPanelDevice startSession]; // Triggers sessionEstablished if (ER_OK != status) { NSLog(@"Failed to start a session. ERROR: %@", [AJNStatus descriptionForStatusCode:status]); // if (status != ER_ALLJOYN_JOINSESSION_REPLY_ALREADY_JOINED) { return ER_FAIL; // } } else { NSLog(@"Successfully start session with device %@",self.notificationSenderBusName); } // Add notification action self.notificationAction = [self.controlPanelDevice addNotificationAction:self.notificationCPSObjectPath]; if (!self.notificationAction) { NSLog(@"Failed to add notification action."); return ER_FAIL; } else { NSLog(@"Successfully added a notification action."); } [self.controllerModel setSupportedLanguagesForNotificationAction:self.notificationAction]; NSArray *languages= [self.controllerModel supportedLanguages]; if (![languages count]) { NSLog(@"notification action languages is empty"); return ER_FAIL; } else { [self addLanguageButton]; NSLog(@"Get rootWidget for the first language: %@",languages[0]); AJCPSRootWidget *rootWidget = [self.notificationAction getRootWidget:languages[0]]; // Take the rootWidget first language NSLog(@"Finished loading widget: %@", [rootWidget getWidgetName]); [self.controllerModel loadRootWidget:rootWidget]; } return ER_OK; } -(void)addLanguageButton { _chooseLangButton = [[UIBarButtonItem alloc] initWithTitle:@"Language" style:UIBarButtonItemStyleBordered target:self action:@selector(chooseLanguageAction)]; [[self navigationItem] setRightBarButtonItem:_chooseLangButton]; self.navigationItem.rightBarButtonItem.enabled = NO; } - (void)chooseLanguageAction { NSString *supportedLangs; supportedLangs = [[self.controllerModel supportedLanguages] componentsJoinedByString:@" "]; NSLog(@"Supported languages: %@",supportedLangs); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Choose Language" message:supportedLangs delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK",nil]; alert.alertViewStyle = UIAlertViewStylePlainTextInput; self.alertChooseLanguage = [alert textFieldAtIndex:0]; //connect the UITextField with the alert [alert show]; } - (void)stopControlPanel { QStatus status; if (self.isNotificationMode) { status = [self.controlPanelDevice removeNotificationAction:self.notificationAction]; if (ER_OK != status) { NSLog(@"Failed to remove notification action."); } } self.controlPanelDevice = nil; self.controllerModel = nil; self.controlPanelController = nil; // shutdown will handle the self.controlPanelDevice endSession/shutdownDevice status = [self.controlPanelService shutdownController]; if (ER_OK != status) { NSLog(@"Failed to shutdown control panel controller"); } else { NSLog(@"Successfully shutdown control panel controller"); } self.controlPanelService = nil; } - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 1) { //user pressed OK QStatus status = ER_OK; if (self.isAnnouncementMode) { status = [self.controllerModel switchLanguage:self.alertChooseLanguage.text]; } if (self.isNotificationMode) { status = [self.controllerModel switchLanguageForNotificationAction:[self.notificationAction getRootWidget:self.alertChooseLanguage.text]]; } if (status != ER_OK) { [[[UIAlertView alloc]initWithTitle:@"Invalid Language" message:@"" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; } } } - (void)viewWillAppear:(BOOL)animated { self.controllerModel.delegate = self; // enable BackButton for all other containers but the top container(handeled by the AJCPSControlPanelListener protocol methods) if ([self.controllerModel childContainerPosition]) { self.navigationItem.hidesBackButton = NO; [self dismissLoadingAlert]; } } - (void)viewWillDisappear:(BOOL)animated { if ([self.navigationController.viewControllers indexOfObject:self]==NSNotFound) { // the UINavigation controller's back button pressed. the current viewcontroller is no longer in the view controller's list NSInteger pos = [self.controllerModel popChildContainer]; if(pos == 0) { //this is the top most container [self stopControlPanel]; } } [super viewWillDisappear:animated]; } #pragma mark - ControllerUpdateEvents - (void)refreshEntries { dispatch_async(dispatch_get_main_queue(), ^{ [self.tableView reloadData]; }); } -(void)loadEnded { self.navigationItem.hidesBackButton = NO; self.navigationItem.rightBarButtonItem.enabled = YES; [self dismissLoadingAlert]; } #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections - Currently we use only 1 section return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. NSInteger count; @synchronized(self.controllerModel){ count = [[self.controllerModel widgetsContainer]count]; }; return count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { AJCPSWidget *widget = [self.controllerModel widgetsContainer][indexPath.row]; switch ([widget getWidgetType]) { case AJCPS_ACTION: { NSArray *hints = [widget getHints]; for (NSNumber *hint in hints) { if(hint.shortValue == AJCPS_ACTIONBUTTON) { CPSButtonCell *cell = (CPSButtonCell *)[tableView dequeueReusableCellWithIdentifier:CPS_BUTTON_CELL forIndexPath:indexPath]; cell.actionWidget = (AJCPSAction *)widget; return cell; } } break; } } CPSGeneralCell *cell; cell = (CPSGeneralCell *)[tableView dequeueReusableCellWithIdentifier:CPS_GENERAL_CELL forIndexPath:indexPath]; cell.widget = widget; // Configure the cell... cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return self.controllerModel.unit; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { AJCPSWidget *widget = [self.controllerModel widgetsContainer][indexPath.row]; switch ([widget getWidgetType]) { case AJCPS_ACTION: return BUTTON_CELL_HEIGHT; break; } return GENERAL_CELL_HEIGHT; } #pragma mark - Navigation - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { AJCPSWidget *widget = [self.controllerModel widgetsContainer][indexPath.row]; if ([widget getWidgetType] == AJCPS_CONTAINER) { GetControlPanelViewController *viewController = [[GetControlPanelViewController alloc] init]; // prepare the view we load to show the child container widgets viewController.controllerModel = self.controllerModel; viewController.controllerModel.delegate = viewController; viewController.navigationItem.rightBarButtonItem.enabled = NO; [viewController.controllerModel pushChildContainer:(AJCPSContainer *)widget]; // show the table [self.navigationController pushViewController:viewController animated:YES]; } else { NSLog(@"tried to segue into a non container of type %d name %@",[widget getWidgetType], [widget getWidgetName]); return; } } -(void)showLoadingAlert:(NSString *)message { self.loadingAV = [[UIAlertView alloc] initWithTitle:@"Please wait" message:message delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; UIActivityIndicatorView *activityIV = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 80, 40)]; activityIV.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; [activityIV startAnimating]; [self.loadingAV setValue:activityIV forKey:@"accessoryView"]; [self.loadingAV show]; } -(void)dismissLoadingAlert { [self.loadingAV dismissWithClickedButtonIndex:0 animated:YES]; } @end base-15.09/controlpanel/ios/src/AJCPSHttpControl.mm000066400000000000000000000156531262264444500221420ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSHttpControl.h" #import "AJCPSControlPanelDevice.h" #import "alljoyn/about/AJNConvertUtil.h" @interface AJCPSHttpControl () @property ajn::services::HttpControl *handle; @end @implementation AJCPSHttpControl - (id)initWithHandle:(ajn::services::HttpControl *)handle { self = [super init]; if (self) { self.handle = handle; } return self; } - (uint16_t)getInterfaceVersion { return ((ajn::services::HttpControl *)self.handle)->getInterfaceVersion(); } /** * Register the HttpControl BusObject * @param bus - bus used for registering the object * @return status - success/failure */ - (QStatus)registerObjects:(AJNBusAttachment *)bus { return ((ajn::services::HttpControl *)self.handle)->registerObjects((ajn::BusAttachment *)[bus handle]); } /** * Refresh the HttpControl * @param bus - bus used for refreshing the object * @return status - success/failure */ - (QStatus)refreshObjects:(AJNBusAttachment *)bus { return ((ajn::services::HttpControl *)self.handle)->refreshObjects((ajn::BusAttachment *)[bus handle]); } /** * Unregister the HttpControl BusObject * @param bus - bus used to unregister the object * @return status - success/failure */ - (QStatus)unregisterObjects:(AJNBusAttachment *)bus { return ((ajn::services::HttpControl *)self.handle)->unregisterObjects((ajn::BusAttachment *)[bus handle]); } /** * Get the Device that contains this HttpControl * @return ControlPanelDevice */ - (AJCPSControlPanelDevice *)getDevice { return [[AJCPSControlPanelDevice alloc]initWithHandle:((ajn::services::HttpControl *)self.handle)->getDevice()]; } /** * Get the Url for the HttpControl * @return url */ - (NSString *)getUrl { return [AJNConvertUtil convertQCCStringtoNSString:((ajn::services::HttpControl *)self.handle)->getUrl()]; } /** * Get the ControlPanelMode of this HttpControl * @return ControlPanelMode */ - (AJCPSControlPanelMode)getControlPanelMode { return ((ajn::services::HttpControl *)self.handle)->getControlPanelMode(); } @end //#ifndef HTTPCONTROL_H_ //#define HTTPCONTROL_H_ // //#include //#include // //namespace ajn { //namespace services { // //class ControlPanelDevice; //class HttpControlBusObject; // ///** // * HttpControl class. Allows definition of a url // */ //class HttpControl { // public: // // /** // * Constructor for HttpControl // * @param url - url of HttpControl // */ // HttpControl(qcc::String const& url);// SKIP // // /** // * Constructor for HttpControl // * @param objectPath - objectPath of HttpControl // * @param device - the device containing this HttpControl // */ // HttpControl(qcc::String const& objectPath, ControlPanelDevice* device); // // /** // * Destructor of HttpControl // */ // virtual ~HttpControl(); // // /** // * Get the Interface Version of the HttpControl // * @return interface Version // */ // const uint16_t getInterfaceVersion() const; // // /** // * Register the HttpControl BusObject // * @param bus - bus used for registering the object // * @param unitName - name of unit // * @return status - success/failure // */ // QStatus registerObjects(BusAttachment* bus, qcc::String const& unitName);// SKIP // // /** // * Register the HttpControl BusObject // * @param bus - bus used for registering the object // * @return status - success/failure // */ // QStatus registerObjects(BusAttachment* bus); // // /** // * Refresh the HttpControl // * @param bus - bus used for refreshing the object // * @return status - success/failure // */ // QStatus refreshObjects(BusAttachment* bus); // // /** // * Unregister the HttpControl BusObject // * @param bus - bus used to unregister the object // * @return status - success/failure // */ // QStatus unregisterObjects(BusAttachment* bus); // // /** // * Fill MsgArg passed in with Url // * @param val - msgArg to fill // * @return status - success/failure // */ // QStatus fillUrlArg(MsgArg& val);// SKIP // // /** // * Read MsgArg passed in and use it to set the url // * @param val - MsgArg passed in // * @return status - success/failure // */ // QStatus readUrlArg(MsgArg const& val);// SKIP // // /** // * Read MsgArg passed in and use it to set the url // * @param val - MsgArg passed in // * @return status - success/failure // */ // QStatus readVersionArg(MsgArg const& val);// SKIP // // /** // * Get the Device that contains this HttpControl // * @return ControlPanelDevice // */ // ControlPanelDevice* getDevice() const; // // /** // * Get the Url for the HttpControl // * @return url // */ // const qcc::String& getUrl() const; // // /** // * Get the ControlPanelMode of this HttpControl // * @return ControlPanelMode // */ // ControlPanelMode getControlPanelMode() const; // // private: // // /** // * Url of HttpControl // */ // qcc::String m_Url; // // /** // * ObjectPath of HttpControl // */ // qcc::String m_ObjectPath; // // /** // * BusObject of HttpControl // */ // HttpControlBusObject* m_HttpControlBusObject; // // /** // * The Device containing the HttpControl // */ // ControlPanelDevice* m_Device; // // /** // * The mode of the HttpControl // */ // ControlPanelMode m_ControlPanelMode; // // /** // * Version of the Widget // */ // uint16_t m_Version; // // /** // * Copy constructor of HttpControl - private. HttpControl is not copy-able // * @param httpControl - HttpControl to copy // */ // HttpControl(const HttpControl& httpControl); // // /** // * Assignment operator of HttpControl - private. HttpControl is not assignable // * @param httpControl // * @return // */ // HttpControl& operator=(const HttpControl& httpControl); //}; //} //namespace services //} //namespace ajn // //#endif /* HTTPCONTROL_H_ */ base-15.09/controlpanel/ios/src/AJCPSLabel.mm000066400000000000000000000101001262264444500206570ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSLabel.h" #import "alljoyn/about/AJNConvertUtil.h" #import "AJCPSControlPanelDevice.h" @interface AJCPSLabel () @end @implementation AJCPSLabel - (id)initWithHandle:(ajn::services::Label *)handle { self = [super initWithHandle:handle]; if (self) { } return self; } @end //#ifndef LABEL_H_ //#define LABEL_H_ // //#include //#include // //namespace ajn { //namespace services { // ///** // * Label class used to display a Label // */ //class Label : public Widget { // public: // // /** // * Constructor for Label class // * @param name - name of Widget // * @param rootWidget - the RootWidget of the widget // */ // Label(qcc::String const& name, Widget* rootWidget);// SKIP // // /** // * Constructor for Label class // * @param name - name of Widget // * @param rootWidget - the RootWidget of the widget // * @param device - the device that contains this Widget // */ // Label(qcc::String const& name, Widget* rootWidget, ControlPanelDevice* device); // // /** // * Destructor for Label class // */ // virtual ~Label(); // // /** // * creates and returns the appropriate BusObject for this Widget // * @param bus - the bus used to create the widget // * @param objectPath - the objectPath of the widget // * @param langIndx - the language Indx // * @param status - the status indicating success or failure // * @return a newly created WidgetBusObject // */ // WidgetBusObject* createWidgetBusObject(BusAttachment* bus, qcc::String const& objectPath, // uint16_t langIndx, QStatus& status);// SKIP // // /** // * Get the Labels vector of the widget // * @return - label // */ // const std::vector& getLabels() const;// SKIP // // /** // * Set the labels vector of the widget // * @param labels - vector of labels // */ // void setLabels(const std::vector& labels);// SKIP // // /** // * Get the GetLabel function pointer // * @return GetLabel function pointer // */ // GetStringFptr getGetLabels() const;// SKIP // // /** // * Set the GetLabel function pointer // * @param getLabel - getLabel function pointer // */ // void setGetLabels(GetStringFptr getLabel);// SKIP // // /** // * Fill MsgArg passed in with the Label // * @param val - msgArg to fill // * @param languageIndx - language of the label // * @return status - success/failure // */ // QStatus fillLabelArg(MsgArg& val, uint16_t languageIndx);// SKIP // // /** // * Read MsgArg passed in to fill the Label property // * @param val - MsgArg passed in // * @return status - success/failure // */ // QStatus readLabelArg(MsgArg* val);// SKIP // // private: // // /** // * Vector of Labels of Label Widget // */ // std::vector m_LabelWidgetLabels; // // /** // * GetLabel functionPointer of Label Widget // */ // GetStringFptr m_LabelWidgetGetLabels; //}; //} //namespace services //} //namespace ajn // //#endif /* LABEL_H_ */ // base-15.09/controlpanel/ios/src/AJCPSLanguageSet.mm000066400000000000000000000037731262264444500220610ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSLanguageSet.h" #import "alljoyn/about/AJNConvertUtil.h" @interface AJCPSLanguageSet () @property (nonatomic) ajn::services::LanguageSet *handle; @end @implementation AJCPSLanguageSet - (id)initWithHandle:(ajn::services::LanguageSet *)handle { self = [super init]; if (self) { self.handle = handle; } return self; } - (NSString *)getLanguageSetName { return [AJNConvertUtil convertQCCStringtoNSString:self.handle->getLanguageSetName()]; } - (size_t)getNumLanguages { return self.handle->getNumLanguages(); } - (void)addLanguage:(NSString *)language { return self.handle->addLanguage([AJNConvertUtil convertNSStringToQCCString:language]); } - (NSArray *)getLanguages { if (!self.handle) return nil; const std::vector cpp_languages = self.handle->getLanguages(); NSMutableArray *languages = [[NSMutableArray alloc]init]; for (int i = 0; i != cpp_languages.size(); i++) { [languages addObject:[AJNConvertUtil convertQCCStringtoNSString:cpp_languages.at(i)]]; } return languages; } @end base-15.09/controlpanel/ios/src/AJCPSLanguageSets.mm000066400000000000000000000030001262264444500222230ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSLanguageSets.h" #import "alljoyn/about/AJNConvertUtil.h" @interface AJCPSLanguageSets () @property (nonatomic) ajn::services::LanguageSets *handle; @end @implementation AJCPSLanguageSets - (id)initWithHandle:(ajn::services::LanguageSets *)handle { self = [super init]; if (self) { self.handle = handle; } return self; } - (AJCPSLanguageSet *)getLanguageSet:(NSString *)languageSetName { return [[AJCPSLanguageSet alloc]initWithHandle:self.handle->LanguageSets::get([AJNConvertUtil convertNSStringToQCCString:languageSetName])]; } @endbase-15.09/controlpanel/ios/src/AJCPSNotificationAction.mm000066400000000000000000000056741262264444500234500ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSNotificationAction.h" #import "alljoyn/about/AJNConvertUtil.h" #import "AJCPSControlPanelDevice.h" @interface AJCPSNotificationAction () @property (nonatomic) ajn::services::NotificationAction *handle; @end @implementation AJCPSNotificationAction - (id)initWithHandle:(ajn::services::NotificationAction *)handle { self = [super init]; if (self) { self.handle = handle; } return self; } - (NSString *)getNotificationActionName { return [AJNConvertUtil convertQCCStringtoNSString:self.handle->getNotificationActionName()]; } /** * Register the BusObjects for this Widget * @param bus - bus used to register the busObjects * @return status - success/failure */ - (QStatus)registerObjects:(AJNBusAttachment *)bus { return self.handle->registerObjects((ajn::BusAttachment *)[bus handle]); } /** * Unregister the BusObjects of the NotificationAction class * @param bus - bus used to unregister the objects * @return status - success/failure */ - (QStatus)unregisterObjects:(AJNBusAttachment *)bus { return self.handle->unregisterObjects((ajn::BusAttachment *)[bus handle]); } /** * Get the LanguageSet of the NotificationAction * @return */ - (AJCPSLanguageSet *)getLanguageSet { return [[AJCPSLanguageSet alloc] initWithHandle:(ajn::services::LanguageSet *)&self.handle->getLanguageSet()]; } /** * Get the Device of the NotificationAction * @return controlPanelDevice */ - (AJCPSControlPanelDevice *)getDevice { return [[AJCPSControlPanelDevice alloc]initWithHandle:self.handle->getDevice()]; } /** * Get the objectPath * @return */ - (NSString *)getObjectPath { return [AJNConvertUtil convertQCCStringtoNSString:self.handle->getObjectPath()]; } /** * Get the RootWidget of the NotificationAction * @param Language - languageSet of RootWidget to retrieve * @return rootWidget */ - (AJCPSRootWidget *)getRootWidget:(NSString *)Language { return [[AJCPSRootWidget alloc]initWithHandle:self.handle->getRootWidget([AJNConvertUtil convertNSStringToQCCString:Language])]; } @end base-15.09/controlpanel/ios/src/AJCPSProperty.mm000066400000000000000000000134111262264444500214740ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "alljoyn/controlpanel/Property.h" #import "AJCPSProperty.h" #import "alljoyn/about/AJNConvertUtil.h" #import "AJCPSControlPanelDevice.h" #import "AJCPSConstraintList.h" @interface AJCPSProperty () //using AJCPSWidget handle @end @implementation AJCPSProperty - (id)initWithHandle:(ajn::services::Property *)handle { self = [super initWithHandle:handle]; if (self) { } return self; } /** * Get the PropertyType * @return PropertyType */ - (AJCPSPropertyType)getPropertyType { return ((ajn::services::Property *)self.handle)->getPropertyType(); } /** * Get the PropertyValue of the property * @return the value of the property */ - (void)getPropertyValue:(AJCPSPropertyValue &)propertyValue { [self convertToAJCPSPropertyValue:((ajn::services::Property *)self.handle)->getPropertyValue() to:&propertyValue]; } /** * Get the Unit of Measure * @return Unit of Measure Values */ - (NSString *)getUnitOfMeasure { return [AJNConvertUtil convertQCCStringtoNSString:((ajn::services::Property *)self.handle)->getUnitOfMeasure()]; } /** * Get the Constraint List vector * @return the Constraint List vector */ //const std::vector& - (NSArray *)getConstraintList { // TODO: the list gets erased when we leave this loop NSMutableArray *constraintList = [[NSMutableArray alloc]init]; for (int i = 0; i != ((ajn::services::Property *)self.handle)->getConstraintList().size(); i++) { [constraintList addObject:[[AJCPSConstraintList alloc] initWithHandle:(ajn::services::ConstraintList *)&((ajn::services::Property *)self.handle)->getConstraintList().at(i)]]; } return constraintList; } - (AJCPSConstraintRange *)getConstraintRange { ajn::services::ConstraintRange *constraintRange = ((ajn::services::Property *)self.handle)->getConstraintRange(); if (constraintRange) { return [[AJCPSConstraintRange alloc] initWithHandle:constraintRange]; } else return nil; } - (QStatus)setValueFromBool:(bool)value { return ((ajn::services::Property *)self.handle)->setValue(value); } - (QStatus)setValueFromUnsignedShort:(uint16_t)value { return ((ajn::services::Property *)self.handle)->setValue(value); } - (QStatus)setValueFromShort:(int16_t)value { return ((ajn::services::Property *)self.handle)->setValue(value); } - (QStatus)setValueFromUnsignedLong:(uint32_t)value { return ((ajn::services::Property *)self.handle)->setValue(value); } - (QStatus)setValueFromLong:(int32_t)value { return ((ajn::services::Property *)self.handle)->setValue(value); } - (QStatus)setValueFromUnsignedLongLong:(uint64_t)value { return ((ajn::services::Property *)self.handle)->setValue(value); } - (QStatus)setValueFromLongLong:(int64_t)value { return ((ajn::services::Property *)self.handle)->setValue(value); } - (QStatus)setValueFromDouble:(double)value { return ((ajn::services::Property *)self.handle)->setValue(value); } - (QStatus)setValueFromCString:(const char *)value { return ((ajn::services::Property *)self.handle)->setValue(value); } - (QStatus)setValueFromDate:(AJCPSCPSDate *)value { return ((ajn::services::Property *)self.handle)->setValue(*[value handle]); } - (QStatus)setValueFromTime:(AJCPSCPSTime *)value { return ((ajn::services::Property *)self.handle)->setValue(value); } - (void)convertToAJCPSPropertyValue:(ajn::services::PropertyValue) constraintValue to:(AJCPSPropertyValue *)tConstraintValue { switch ([self getPropertyType]) { case AJCPS_BOOL_PROPERTY : tConstraintValue->boolValue = constraintValue.boolValue; break; case AJCPS_UINT16_PROPERTY : tConstraintValue->uint16Value = constraintValue.uint16Value; break; case AJCPS_INT16_PROPERTY : tConstraintValue->int16Value = constraintValue.int16Value; break; case AJCPS_UINT32_PROPERTY : tConstraintValue->uint32Value = constraintValue.uint32Value; break; case AJCPS_INT32_PROPERTY : tConstraintValue->int32Value = constraintValue.int32Value; break; case AJCPS_UINT64_PROPERTY : tConstraintValue->uint64Value = constraintValue.uint64Value; break; case AJCPS_INT64_PROPERTY : tConstraintValue->int64Value = constraintValue.int64Value; break; case AJCPS_DOUBLE_PROPERTY : tConstraintValue->doubleValue = constraintValue.doubleValue; break; case AJCPS_STRING_PROPERTY : tConstraintValue->charValue = constraintValue.charValue; break; case AJCPS_DATE_PROPERTY : //TODO break; case AJCPS_TIME_PROPERTY : //TODO break; default: break; } } @end base-15.09/controlpanel/ios/src/AJCPSRootWidget.mm000066400000000000000000000021441262264444500217400ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSRootWidget.h" #import "alljoyn/controlpanel/RootWidget.h" @interface AJCPSRootWidget () @end @implementation AJCPSRootWidget @endbase-15.09/controlpanel/ios/src/AJCPSWidget.mm000066400000000000000000000071311262264444500210750ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJCPSWidget.h" #import "alljoyn/about/AJNConvertUtil.h" #import "AJCPSControlPanelDevice.h" @interface AJCPSWidget () @property (nonatomic) ajn::services::Widget *handle; @end @implementation AJCPSWidget - (id)init { return Nil; // This is an abstract class. Do Not Instantiate. } - (id)initWithHandle:(ajn::services::Widget *)handle { self = [super init]; if (self) { self.handle = handle; if (!self.handle) { NSLog(@"Failed getting a pointer to a Widget subclass"); return Nil; } } return self; } - (void)dealloc { // it is very important not to delete anything using widget, this is all taken care of by lower layers } - (AJCPSWidgetType)getWidgetType { return self.handle->getWidgetType(); } - (NSString *)getWidgetName { return [AJNConvertUtil convertQCCStringtoNSString:self.handle->getWidgetName()]; } - (AJCPSControlPanelMode)getControlPanelMode { return (AJCPSControlPanelMode)self.handle->getControlPanelMode(); } - (const AJCPSWidget *)getRootWidget { return [[AJCPSWidget alloc]initWithHandle:self.handle->getRootWidget()]; } - (const AJCPSControlPanelDevice *)getDevice { return [[AJCPSControlPanelDevice alloc] initWithHandle:self.handle->getDevice()]; } - (const uint16_t)getInterfaceVersion { return self.handle->getInterfaceVersion(); } - (bool)getIsSecured { return self.handle->getIsSecured(); } - (bool)getIsEnabled { return self.handle->getIsEnabled(); } - (bool)getIsWritable { return self.handle->getIsWritable(); } - (uint32_t)getStates { return self.handle->getStates(); } - (uint32_t)getBgColor { return self.handle->getBgColor(); } - (NSString *)getLabel { return [AJNConvertUtil convertQCCStringtoNSString:self.handle->getLabel()]; } - (NSArray *)getHints { const std::vector cpp_hints = self.handle->getHints(); NSMutableArray *hints = [[NSMutableArray alloc]init]; if (cpp_hints.size()) { for (int i = 0; i != cpp_hints.size(); i++) { [hints addObject:[NSNumber numberWithShort:cpp_hints.at(i)]]; } } return hints; } - (QStatus)registerObjects:(AJNBusAttachment *)bus atObjectPath:(NSString *)objectPath { ajn::BusAttachment *cpp_bus = (ajn::BusAttachment *)[bus handle]; return self.handle->registerObjects(cpp_bus, [AJNConvertUtil convertNSStringToQCCString:objectPath]); } - (QStatus)refreshObjects:(AJNBusAttachment *)bus { ajn::BusAttachment *cpp_bus = (ajn::BusAttachment *)[bus handle]; return self.handle->refreshObjects(cpp_bus); } - (QStatus)unregisterObjects:(AJNBusAttachment *)bus { ajn::BusAttachment *cpp_bus = (ajn::BusAttachment *)[bus handle]; return self.handle->unregisterObjects(cpp_bus); } @end base-15.09/controlpanel/java/000077500000000000000000000000001262264444500160745ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelAdapter/000077500000000000000000000000001262264444500217755ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelAdapter/.classpath000066400000000000000000000010471262264444500237620ustar00rootroot00000000000000 base-15.09/controlpanel/java/ControlPanelAdapter/.gitignore000066400000000000000000000001301262264444500237570ustar00rootroot00000000000000local.properties proguard-project.txt .classpath .project *.class *.jar /bin /gen /docs base-15.09/controlpanel/java/ControlPanelAdapter/.project000066400000000000000000000021431262264444500234440ustar00rootroot00000000000000 ControlPanelAdapter ControlPanelService com.android.ide.eclipse.adt.ResourceManagerBuilder com.android.ide.eclipse.adt.PreCompilerBuilder org.eclipse.jdt.core.javabuilder com.android.ide.eclipse.adt.ApkBuilder com.android.ide.eclipse.adt.AndroidNature org.eclipse.jdt.core.javanature 1369893179588 26 org.eclipse.ui.ide.multiFilter 1.0-name-matches-false-false-.svn base-15.09/controlpanel/java/ControlPanelAdapter/AndroidManifest.xml000066400000000000000000000023721262264444500255720ustar00rootroot00000000000000 base-15.09/controlpanel/java/ControlPanelAdapter/build.xml000066400000000000000000000134711262264444500236240ustar00rootroot00000000000000 AllJoyn™ Control Panel Adapter Version 15.09.00]]> AllJoyn™ Control Panel Adapter Java API Reference Manual Version 15.09.00
Copyright AllSeen Alliance, Inc. All Rights Reserved.

AllSeen, AllSeen Alliance, and AllJoyn are trademarks of the AllSeen Alliance, Inc in the United States and other jurisdictions.

THIS DOCUMENT AND ALL INFORMATION CONTAIN HEREIN ARE PROVIDED ON AN "AS-IS" BASIS WITHOUT WARRANTY OF ANY KIND.
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
]]>
base-15.09/controlpanel/java/ControlPanelAdapter/project.properties000066400000000000000000000011101262264444500255520ustar00rootroot00000000000000# 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 base-15.09/controlpanel/java/ControlPanelAdapter/src/000077500000000000000000000000001262264444500225645ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelAdapter/src/org/000077500000000000000000000000001262264444500233535ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelAdapter/src/org/alljoyn/000077500000000000000000000000001262264444500250235ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelAdapter/src/org/alljoyn/ioe/000077500000000000000000000000001262264444500255775ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelAdapter/src/org/alljoyn/ioe/controlpaneladapter/000077500000000000000000000000001262264444500316405ustar00rootroot00000000000000ContainerCreatedListener.java000066400000000000000000000026021262264444500373440ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelAdapter/src/org/alljoyn/ioe/controlpaneladapter/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpaneladapter; import android.view.View; /** * Implement this interface to receive an event of creating a Root-Container-Element. */ public interface ContainerCreatedListener { /** * This method is called when the Root-Container-Element is created * @param container The container {@link View}. */ void onContainerViewCreated(View container); } ControlPanelAdapter.java000066400000000000000000003241741262264444500363400ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelAdapter/src/org/alljoyn/ioe/controlpaneladapterpackage org.alljoyn.ioe.controlpaneladapter; /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ import java.util.Calendar; import java.util.GregorianCalendar; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.WeakHashMap; import java.util.concurrent.Callable; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; import org.alljoyn.ioe.controlpanelservice.ui.ActionWidget; import org.alljoyn.ioe.controlpanelservice.ui.ActionWidgetHintsType; import org.alljoyn.ioe.controlpanelservice.ui.AlertDialogWidget; import org.alljoyn.ioe.controlpanelservice.ui.AlertDialogWidget.DialogButton; import org.alljoyn.ioe.controlpanelservice.ui.ContainerWidget; import org.alljoyn.ioe.controlpanelservice.ui.ErrorWidget; import org.alljoyn.ioe.controlpanelservice.ui.LabelWidget; import org.alljoyn.ioe.controlpanelservice.ui.LayoutHintsType; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget.ConstrainToValues; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget.RangeConstraint; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget.ValueType; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidgetHintsType; import org.alljoyn.ioe.controlpanelservice.ui.UIElement; import org.alljoyn.ioe.controlpanelservice.ui.UIElementType; import android.app.Activity; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.DatePickerDialog; import android.app.TimePickerDialog; import android.content.Context; import android.content.DialogInterface; import android.content.res.TypedArray; import android.text.InputFilter; import android.text.InputType; import android.text.Layout; import android.text.Spanned; import android.text.format.DateFormat; import android.util.Log; import android.util.SparseArray; import android.view.Gravity; import android.view.KeyEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.DatePicker; import android.widget.EditText; import android.widget.HorizontalScrollView; import android.widget.LinearLayout; import android.widget.LinearLayout.LayoutParams; import android.widget.NumberPicker; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.ScrollView; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.Spinner; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; import android.widget.TimePicker; public class ControlPanelAdapter { private final static String TAG = "cpapp" + ControlPanelAdapter.class.getSimpleName(); private static final Object PROPERTY_VALUE = "property_value"; private static final Object PROPERTY_EDITOR = "property_editor"; /* a context for creating Views */ private final Context uiContext; /* mapping of UIElements to Views that were created by this adapter */ private final Map uiElementToView = new WeakHashMap(10); /* * mapping of AlertDialogWidgets to AlertDialogs that were created by this * adapter */ private final Map alertWidgetToDialog = new WeakHashMap(3); /* App handler for control panel exceptions */ private final ControlPanelExceptionHandler exceptionHandler; /*Time out value to call the ControlPanelService to retrieve a value*/ private long timeoutValue = 4; /*Time out measurement unit to call the ControlPanelService to retrieve a value*/ private TimeUnit timeoutUnit = TimeUnit.SECONDS; // ===================================================================================================================== /** * Constructor * @param uiContext The context of the {@link Activity} hosting the {@link ControlPanelAdapter} * @param exceptionHandler Exceptions listener */ public ControlPanelAdapter(Context uiContext, ControlPanelExceptionHandler exceptionHandler) { if ( uiContext == null || exceptionHandler == null) { throw new IllegalArgumentException("uiContext or exceptionHandler are undefined"); } if ( !(uiContext instanceof Activity) ) { throw new IllegalArgumentException("uiContext should be instance of Activity"); } this.uiContext = uiContext; this.exceptionHandler = exceptionHandler; } // ===================================================================================================================== /** * The maximum time to wait before timing out retrieving the control panel element's current value. * @param timeoutValue The value of the timeout * @param timeoutUnit The {@link TimeUnit} of the timeout value */ public void setTimeout(long timeoutValue, TimeUnit timeoutUnit) { this.timeoutValue = timeoutValue; this.timeoutUnit = timeoutUnit; } // ===================================================================================================================== /** * Creates a {@link Layout} that corresponds with the given ContainerWidget. * Then for each contained widget the corresponded {@link View} is created. * @param container input widget defining a container. * @return a resulting Layout. * @deprecated Use the {@link ControlPanelAdapter#createContainerViewAsync(ContainerWidget, ContainerCreatedListener)} * instead */ @Deprecated public View createContainerView(ContainerWidget container) { if (container == null) { Log.e(TAG, "createContainerView(container==null)"); return null; } Log.w(TAG, "The deprecated createContainerView() methdod has been called, handling"); return createContainerViewImpl(container, new HashMap()); } // ===================================================================================================================== /** * Creates a {@link Layout} that corresponds with the given ContainerWidget. * Then for each contained widget the corresponded {@link View} is created. * The thread that calls this method is released immediately. Once the container {@link Layout} is created * the caller is notified via the {@link ContainerCreatedListener#onContainerViewCreated(View)} method. * @param container input widget defining a container. * @return a resulting Layout. */ public void createContainerViewAsync(final ContainerWidget container, final ContainerCreatedListener contCreateListener) { if (container == null || contCreateListener == null) { throw new IllegalArgumentException("Received an undefined argument"); } Log.i(TAG, "createContainerViewAsync() method has been called, handling"); Runnable task = new Runnable() { @Override public void run() { Map initialData = new HashMap(); ServiceTasksExecutor exec = ServiceTasksExecutor.createExecutor(); traverseContainerElements(container, exec, initialData); retrieveElementsValues(initialData); exec.shutdown(); submitCreateContainerViewTask(container, contCreateListener, initialData); } }; Thread t = new Thread(task); t.start(); } // ===================================================================================================================== /** * Creates a Layout that corresponds with the given ContainerWidget by * iterating the contained widgets and creating the corresponding inner {@link View}s. * The container elements are initialized with the given {@link Map} of the initialData * @param container input widget defining a container. * @param initialData Key: element's object path; Value: element's initial value or NULL * @return a resulting Layout. */ private View createContainerViewImpl(ContainerWidget container, Map initialData) { if (container == null) { Log.e(TAG, "createContainerView(container==null)"); return null; } Log.d(TAG, "Received main container, objPath: '" + container.getObjectPath() + "'"); // the returned Layout object ViewGroup scrollView; LinearLayout containerLayout; ViewGroup.LayoutParams layoutParams; // initialize the container by type List layoutHints = container.getLayoutHints(); Log.d(TAG, "Container has LayoutHints: " + layoutHints); LayoutHintsType layoutHintsType = (layoutHints.size() == 0) ? LayoutHintsType.VERTICAL_LINEAR : layoutHints.get(0); // set the layout switch (layoutHintsType) { case HORIZONTAL_LINEAR: scrollView = new HorizontalScrollView(uiContext); LinearLayout linearLayout = new LinearLayout(uiContext); linearLayout.setOrientation(LinearLayout.HORIZONTAL); linearLayout.setGravity(Gravity.CENTER_VERTICAL); containerLayout = linearLayout; LinearLayout.LayoutParams hLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); hLinearLayoutParams.setMargins(10, 10, 10, 10); layoutParams = hLinearLayoutParams; break; case VERTICAL_LINEAR: default: scrollView = new ScrollView(uiContext); containerLayout = new LinearLayout(uiContext); containerLayout.setOrientation(LinearLayout.VERTICAL); containerLayout.setGravity(Gravity.LEFT); LinearLayout.LayoutParams vLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); vLinearLayoutParams.setMargins(10, 10, 10, 10); layoutParams = vLinearLayoutParams; // set the inner label if (container.getLabel() != null && container.getLabel().trim().length() > 0) { Log.d(TAG, "Setting container label to: " + container.getLabel()); TextView titleTextView = new TextView(uiContext); titleTextView.setText(container.getLabel()); LinearLayout.LayoutParams textLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); textLayoutParams.setMargins(20, 0, 20, 0); containerLayout.addView(titleTextView, textLayoutParams); } break; } Log.d(TAG, "Initialized Layout of class: " + containerLayout.getClass().getSimpleName()); Log.d(TAG, "Container bgColor: " + container.getBgColor()); // if (container.getBgColor() != null) // containerLayout.setBackgroundColor(container.getBgColor()); // recursively layout the items List elements = container.getElements(); Log.d(TAG, String.format("Laying out %d elements", elements.size())); int i = 0; for (UIElement element : elements) { i++; View childView = createInnerView(element, initialData); containerLayout.addView(childView, layoutParams); if (layoutHintsType == LayoutHintsType.VERTICAL_LINEAR && i < elements.size()) { // add a divider containerLayout.addView(createDividerView(), layoutParams); } }// for :: elements LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); scrollView.addView(containerLayout, linearLayoutParams); boolean enabled = container.isEnabled(); Log.d(TAG, "Container is enabled: '" + enabled + "'"); if (!enabled) { enableViewGroup(scrollView, false); // Only if container is created // as disabled, its children // should be disabled } uiElementToView.put(container.getObjectPath(), scrollView); return scrollView; } // ===================================================================================================================== /** * Traverse container elements and use {@link ControlPanelService} to retrieve data required * for creating the element's {@link View}s. * @param container {@link ContainerWidget} containing the elements * @param exec {@link ServiceTasksExecutor} which is responsible to retrieve the element's data and populate the * {@link Future} object * @param initialData The map that is populated with the element's object path as a key and {@link Future} as a value */ private void traverseContainerElements(ContainerWidget container, ServiceTasksExecutor exec, Map initialData) { List elements = container.getElements(); for (UIElement element : elements) { UIElementType elType = element.getElementType(); //Currently only PropertyWidgets need initial data retrieved by the ControlPanelService via AllJoyn if ( elType == UIElementType.PROPERTY_WIDGET ) { Log.d(TAG, "Found a PropertyWidget objPath: '" + element.getObjectPath() + "', retrieving Future value"); initialData.put(element.getObjectPath(), submitGetPropertyCurrentValueTask(exec, (PropertyWidget)element)); } else if ( elType == UIElementType.CONTAINER ) { traverseContainerElements((ContainerWidget)element, exec, initialData); } } } // ===================================================================================================================== /** * Retrieves initial values of the elements from the {@link Future} object stored in the given initialData {@link Map}. * The values are retrieved by the call {@link Future#get(long, TimeUnit)}. * If an {@link Exception} is thrown while retrieving the value, NULL is stored in the initialData instead of the * real value. */ private void retrieveElementsValues(Map initialData) { Log.d(TAG, "Retrieving initial values of the elements with timeout: '" + timeoutValue + " " + timeoutUnit + "'"); for ( String objPath : initialData.keySet() ) { Object fo = initialData.get(objPath); if ( !(fo instanceof Future) ) { Log.w(TAG, "The objPath: '" + objPath + "' doesn't have a Future object"); initialData.put(objPath, null); continue; } @SuppressWarnings("unchecked") Future futureVal = (Future) fo; Object realValue = null; try { //Blocking call with the given timeout realValue = futureVal.get(timeoutValue, timeoutUnit); Log.d(TAG, "Found an initial value of the element: '" + objPath + "', value: '" + realValue + "'"); } catch(Exception e) { Log.e(TAG, "Failed to retrieve the element's initial value objPath: '" + objPath + "'. Exception: ", e); futureVal.cancel(true); } initialData.put(objPath, realValue); } } // ===================================================================================================================== /** * Submits the {@link PropertyWidget#getCurrentValue()} task to the {@link ServiceTasksExecutor}. * @param exec The executor that executes the task * @param property {@link PropertyWidget} to retrieve the current value * @return {@link Future} of the initial {@link PropertyWidget} value or NULL if failed to submit the retrieval task */ private Future submitGetPropertyCurrentValueTask(ServiceTasksExecutor exec, final PropertyWidget property) { Log.d(TAG, "Prepare a task to call PropertyWidget.getCurrentValue(), property: '" + property.getObjectPath() + "'"); Callable task = new Callable() { @Override public Object call() throws Exception { return property.getCurrentValue(); } }; Future future = null; try { future = exec.submit(task); } catch (Exception e){ Log.d(TAG, "Failed to submit the task to call PropertyWidget.getCurrentValue(), property: '" + property.getObjectPath() + "'", e); } return future; } // ===================================================================================================================== /** * Submit the method {@link ControlPanelAdapter#createContainerViewImpl(ContainerWidget, Map)} to run on UI thread * @param container * @param contCreateListener * @param initialData */ private void submitCreateContainerViewTask(final ContainerWidget container, final ContainerCreatedListener contCreateListener, final Map initialData) { ((Activity)uiContext).runOnUiThread( new Runnable() { @Override public void run() { View containerView = createContainerViewImpl(container, initialData); contCreateListener.onContainerViewCreated(containerView); } }); } // ===================================================================================================================== /** * Creates a list divider for vertical layout * @return A list divider */ private View createDividerView() { View listDivider = new View(uiContext); TypedArray listDividerAttrs = uiContext.getTheme().obtainStyledAttributes(new int[] { android.R.attr.listDivider }); if (listDividerAttrs.length() > 0) { // don't change this to setBackground() it'll fly on run time listDivider.setBackgroundDrawable(listDividerAttrs.getDrawable(0)); } listDividerAttrs.recycle(); return listDivider; } // ===================================================================================================================== /** * Creates an Android View that corresponds with the given UIElement using the given initialData * @param element The {@link UIElement} to create the corresponding {@link View}I * @param initialData * @return an Android View that corresponds with the given abstract UIElement */ private View createInnerView(UIElement element, Map initialData) { UIElementType elementType = element.getElementType(); Log.d(TAG, "Creating an Android View for element of type: '" + elementType + "'"); View returnView = new TextView(uiContext); switch (elementType) { case ACTION_WIDGET: { returnView = createActionView((ActionWidget) element); break; }// ACTION_WIDGET case CONTAINER: { returnView = createContainerViewImpl((ContainerWidget) element, initialData); break; }// CONTAINER // case LIST_PROPERTY_WIDGET: { // break; // }//LIST_PROPERTY_WIDGET case PROPERTY_WIDGET: { //Currently only Properties require initial data for the creation returnView = createPropertyViewImpl((PropertyWidget) element, initialData); break; }// PROPERTY_WIDGET case LABEL_WIDGET: { returnView = createLabelView((LabelWidget) element); break; }// PROPERTY_WIDGET case ERROR_WIDGET: { returnView = createErrorView((ErrorWidget) element); break; }// ERROR_WIDGET default: break; }// switch :: elementType return returnView; } // ===================================================================================================================== /** * Creates an AlertDialog that corresponds with the given AlertDialogWidget * @param alertDialogWidget input abstract widget defining a dialog. * @return an AlertDialog with up to 3 actions. Each action executes a different DialogButton UIElement. */ public AlertDialog createAlertDialog(final AlertDialogWidget alertDialogWidget) { final SparseArray buttonToAction = new SparseArray(3); List execButtons = alertDialogWidget.getExecButtons(); int numOfButtons = alertDialogWidget.getNumActions(); if (numOfButtons > 0) { buttonToAction.put(DialogInterface.BUTTON_POSITIVE, execButtons.get(0)); if (numOfButtons > 1) { buttonToAction.put(DialogInterface.BUTTON_NEGATIVE, execButtons.get(1)); if (numOfButtons > 2) { buttonToAction.put(DialogInterface.BUTTON_NEUTRAL, execButtons.get(2)); } } } // create a confirmation dialog DialogInterface.OnClickListener confirmationListener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, final int which) { // handle user choice final DialogButton actionButton = buttonToAction.get(which); Log.d(TAG, "User selected: " + actionButton.getLabel()); // execute the action in a background task ExecuteActionAsyncTask asyncTask = new ExecuteActionAsyncTask() { @Override protected void onFailure(ControlPanelException e) { if (exceptionHandler != null) { exceptionHandler.handleControlPanelException(e); } } @Override protected void onSuccess() { } }; asyncTask.execute(actionButton); } }; // show the confirmation dialog Builder builder = new AlertDialog.Builder(uiContext).setMessage(alertDialogWidget.getMessage()).setTitle(alertDialogWidget.getLabel()); if (numOfButtons > 0) { builder.setPositiveButton(buttonToAction.get(DialogInterface.BUTTON_POSITIVE).getLabel(), confirmationListener); if (numOfButtons > 1) { builder.setNegativeButton(buttonToAction.get(DialogInterface.BUTTON_NEGATIVE).getLabel(), confirmationListener); if (numOfButtons > 2) { builder.setNeutralButton(buttonToAction.get(DialogInterface.BUTTON_NEUTRAL).getLabel(), confirmationListener); } } } AlertDialog alertDialog = builder.create(); alertWidgetToDialog.put(alertDialogWidget.getObjectPath(), alertDialog); return alertDialog; } // ===================================================================================================================== /** * Creates a Button for an ActionWidget * @param action the UIElement to be represented by this button. * @return a Button with 2 optional flows corresponding with the ActionWidget definition: * A button that executes an action. Or a button that popsup an "Are You Sure?" dialog. */ public View createActionView(final ActionWidget action) { List hints = action.getHints(); String label = action.getLabel(); Integer bgColor = action.getBgColor(); boolean isEnabled = action.isEnabled(); Log.d(TAG, "Create Action: " + label + " BGColor: " + bgColor + " actionMeta: " + hints + " isEnable: '" + isEnabled + "'"); Button actionButton = new Button(uiContext); actionButton.setText(label); actionButton.setEnabled(isEnabled); // if (bgColor != null) { // Unfortunately button loses its pressed behavior when background is // set. // actionButton.setBackgroundColor(bgColor); // } // register a click listener OnClickListener actionButtonListener = new OnClickListener() { @Override public void onClick(View v) { if ( !action.isEnabled() ) { Log.i(TAG, "ActionWidget is disabled, objPath: '" + action.getObjectPath() + "', not reacting onClick"); return; } // check if action requires an extra confirmation AlertDialogWidget alertDialogWidget = action.getAlertDialog(); if (alertDialogWidget != null) { Log.d(TAG, "Showing confirmation: " + alertDialogWidget.getMessage() + "?"); // create a confirmation dialog AlertDialog confirmationDialog = createAlertDialog(alertDialogWidget); confirmationDialog.show(); } // Confirmation needed else { // No confirmation needed // execute the action in a background task ExecuteActionAsyncTask asyncTask = new ExecuteActionAsyncTask() { @Override protected void onFailure(ControlPanelException e) { if (exceptionHandler != null) { exceptionHandler.handleControlPanelException(e); } } @Override protected void onSuccess() { } }; asyncTask.execute(action); } // No confirmation needed } };// new OnClickListener() actionButton.setOnClickListener(actionButtonListener); uiElementToView.put(action.getObjectPath(), actionButton); return actionButton; }// createActionView // ===================================================================================================================== /** * Creates a TextView for a LabelWidget * @param labelWidget the UIElement to be represented by this View * @return a TextView displaying the contents of the LabelWidget */ public View createLabelView(final LabelWidget labelWidget) { String label = labelWidget.getLabel(); Integer bgColor = labelWidget.getBgColor(); Log.d(TAG, "Creating Label: \"" + label + "\" BGColor: " + bgColor); TextView labelView = new TextView(uiContext); labelView.setText(label); // if (bgColor != null) // labelView.setBackgroundColor(bgColor); uiElementToView.put(labelWidget.getObjectPath(), labelView); return labelView; }// createLabelView // ===================================================================================================================== /** * Creates a TextView for a ErrorWidget * @param errorWidget the UIElement to be represented by this View * @return a TextView displaying the label of the ErrorWidget */ public View createErrorView(final ErrorWidget errorWidget) { String label = errorWidget.getLabel(); String errorMessage = errorWidget.getError(); Log.w(TAG, "Creating Error Label: \"" + label + "\" Error: '" + errorMessage + "', Original Element Type: " + errorWidget.getOriginalUIElement()); TextView errorView = new TextView(uiContext); errorView.setText(label); uiElementToView.put(errorWidget.getObjectPath(), errorView); return errorView; }// createErrorView // ===================================================================================================================== // ============================================= PropertyWidget // ======================================================== // ===================================================================================================================== /** * A factory method for creating a View for a given PropertyWidget. * @param propertyWidget the UIElement to be represented by this View * @return a View that represents the property. The type of View corresponds * with the property's hint. */ public View createPropertyView(PropertyWidget propertyWidget) { return createPropertyViewImpl(propertyWidget, new HashMap()); } /** * A factory method for creating a View for a given PropertyWidget. * @param propertyWidget the UIElement to be represented by this View * @param initialData The initialData to initialize the {@link PropertyWidget} * @return a View that represents the property. The type of View corresponds * with the property's hint. */ private View createPropertyViewImpl(PropertyWidget propertyWidget, Map initialData) { ValueType valueType = propertyWidget.getValueType(); List hints = propertyWidget.getHints(); PropertyWidgetHintsType hint = (hints == null || hints.size() == 0) ? null : hints.get(0); Object initialValue = getPropertyInitialValue(propertyWidget, initialData); Log.d(TAG, "Creating a View for property '" + propertyWidget.getLabel() + "', using UI hint: ;" + hint + "', value type: '" + valueType + "' initial value: '" + initialValue + "', objPath: '" + propertyWidget.getObjectPath() + "'"); // default view. just in case... View returnView = new TextView(uiContext); switch (valueType) { case BOOLEAN: // Boolean Property returnView = createCheckBoxView(propertyWidget, initialValue); break; case DATE: // Date Property returnView = createDatePickerView(propertyWidget, initialValue); break; case TIME: // Time Property returnView = createTimePickerView(propertyWidget, initialValue); break; case BYTE: case INT: case SHORT: case LONG: case DOUBLE: // Scalar Property if (hint == null) { Log.d(TAG, "No hint provided for property '" + propertyWidget.getLabel() + "', creating default: NumericView"); returnView = createNumericView(propertyWidget, initialValue); } else { switch (hint) { case SPINNER: returnView = createSpinnerView(propertyWidget, initialValue); break; case RADIO_BUTTON: returnView = createRadioButtonView(propertyWidget, initialValue); break; case NUMBER_PICKER: returnView = createNumberPickerView(propertyWidget, initialValue); break; case NUMERIC_VIEW: returnView = createNumericView(propertyWidget, initialValue); break; case SLIDER: returnView = createSliderView(propertyWidget, initialValue); break; case NUMERIC_KEYPAD: returnView = createNumericKeypadView(propertyWidget, initialValue); break; default: Log.d(TAG, "Unsupported hint provided for property '" + propertyWidget.getLabel() + "', creating default: NumericView"); returnView = createNumericView(propertyWidget, initialValue); break; } } break; case STRING: // String Property if (hint == null) { Log.d(TAG, "No hint provided for property '" + propertyWidget.getLabel() + "', creating default: TextView"); returnView = createTextView(propertyWidget, initialValue); } else { switch (hint) { case SPINNER: returnView = createSpinnerView(propertyWidget, initialValue); break; case RADIO_BUTTON: returnView = createRadioButtonView(propertyWidget, initialValue); break; case EDIT_TEXT: returnView = createEditTextView(propertyWidget, initialValue); break; case TEXT_VIEW: returnView = createTextView(propertyWidget, initialValue); break; default: Log.d(TAG, "Unsupported hint provided for property '" + propertyWidget.getLabel() + "', creating default: TextView"); returnView = createTextView(propertyWidget, initialValue); break; } } break; default: Log.d(TAG, "Received an unsupported ValueType: '" + valueType + "' , returning an empty view"); return returnView; } uiElementToView.put(propertyWidget.getObjectPath(), returnView); return returnView; } /** * Retrieves the initial value from the initialData Map. * If the objectPath isn't stored as the key in the initialData Map, the method * {@link ControlPanelAdapter#submitGetPropertyCurrentValueTask(ServiceTasksExecutor, PropertyWidget)} * is called. Otherwise the value retrieved from the Map is returned. * @param propertyWidget The property to look for in the {@link Map}. * @param initialData The {@link Map} with the initial values * @return Object to initialize the Property Widget {@link View} or NULL. */ private Object getPropertyInitialValue(PropertyWidget propertyWidget, Map initialData) { String objPath = propertyWidget.getObjectPath(); Log.d(TAG, "Searching for the initial value of the property: '" + objPath + "'"); if ( !initialData.containsKey(objPath) ) { //This code may be called when there is a use of the deprecated createContainerView method Log.w(TAG, "The object path: '" + objPath + "' is unknown, submitting PropertyWidget.getCurrentValue()"); ServiceTasksExecutor exec = ServiceTasksExecutor.createExecutor(1); Future fo = submitGetPropertyCurrentValueTask(exec, propertyWidget); try { if ( fo == null ) { return null; } return fo.get(timeoutValue, timeoutUnit); } catch (Exception e) { Log.e(TAG, "Failed to retrieve property's initial value objPath: '" + objPath + "'. Exception: ", e); fo.cancel(true); return null; } finally { exec.shutdown(); } } return initialData.get(objPath); } // ===================================================================================================================== private View createSpinnerView(final PropertyWidget propertyWidget, Object initialValue) { Log.d(TAG, "Creating a spinner for propertyWidget " + propertyWidget.getLabel()); final LinearLayout layout = new LinearLayout(uiContext); layout.setOrientation(LinearLayout.VERTICAL); final TextView nameTextView = new TextView(uiContext); nameTextView.setPadding(10, 0, 0, 0); nameTextView.setText(propertyWidget.getLabel()); final Spinner spinner = new Spinner(uiContext); LinearLayout.LayoutParams vLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); layout.addView(nameTextView, vLinearLayoutParams); layout.addView(spinner, vLinearLayoutParams); spinner.setTag(PROPERTY_VALUE); Log.d(TAG, "Property isWritable? " + propertyWidget.isWritable() + ", isEnabled? " + propertyWidget.isEnabled()); // spinner.setEnabled(propertyWidget.isEnabled() && // propertyWidget.isWritable()); enableViewGroup(layout, propertyWidget.isEnabled() && propertyWidget.isWritable()); // set the data model final ArrayAdapter adapter = new ArrayAdapter(uiContext, android.R.layout.simple_spinner_item); int selection = 0; if (propertyWidget.getListOfConstraint() != null) { // create a spinner model made of the given ConstrainToValues // entries int position = 0; for (ConstrainToValues valueCons : propertyWidget.getListOfConstraint()) { boolean isDefault = valueCons.getValue().equals(initialValue); Log.d(TAG, "Adding spinner item, Label: " + valueCons.getLabel() + " Value: " + valueCons.getValue() + (isDefault ? " (default)" : "")); adapter.add(new LabelValuePair(valueCons.getLabel(), valueCons.getValue())); if (isDefault) { selection = position; } position++; } } else if (propertyWidget.getPropertyRangeConstraint() != null) { // dynamically create a spinner model made of integers from min to // max RangeConstraint propertyRangeConstraint = propertyWidget.getPropertyRangeConstraint(); ValueType valueType = propertyWidget.getValueType(); Object minT = propertyRangeConstraint.getMin(); int min = ValueType.SHORT.equals(valueType) ? ((Short) minT) : ValueType.INT.equals(valueType) ? ((Integer) minT) : 0; Object maxT = propertyRangeConstraint.getMax(); int max = ValueType.SHORT.equals(valueType) ? ((Short) maxT) : ValueType.INT.equals(valueType) ? ((Integer) maxT) : 0; Object incrementT = propertyRangeConstraint.getIncrement(); int increment = ValueType.SHORT.equals(valueType) ? ((Short) incrementT) : ValueType.INT.equals(valueType) ? ((Integer) incrementT) : 0; int position = 0; for (int i = min; i <= max; i += increment) { boolean isDefault = false; switch (valueType) { case SHORT: short shortI = (short) i; adapter.add(new LabelValuePair(String.valueOf(i), shortI)); isDefault = Short.valueOf(shortI).equals(initialValue); break; case INT: default: { adapter.add(new LabelValuePair(String.valueOf(i), i)); isDefault = Integer.valueOf(i).equals(initialValue); } } Log.d(TAG, "Added spinner item, Value: " + i + (isDefault ? " (default)" : "")); if (isDefault) { selection = position; } position++; } } adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); spinner.setSelection(selection); final int initialSelection = selection; // Unfortunately spinner loses some of its UI components when background // is set. // spinner.setBackgroundColor(property.getBgColor()); // register a selection listener OnItemSelectedListener listener = new OnItemSelectedListener() { int currentSelection = initialSelection; @Override public void onItemSelected(AdapterView parent, View view, final int pos, long id) { if (pos == currentSelection) { Log.d(TAG, String.format("Selected position %d already selected. No action required", pos)); } else { LabelValuePair item = adapter.getItem(pos); // set the property in a background task SetPropertyAsyncTask asyncTask = new SetPropertyAsyncTask() { @Override protected void onFailure(ControlPanelException e) { spinner.setSelection(currentSelection); if (exceptionHandler != null) { // An exception was thrown. Restore old value. exceptionHandler.handleControlPanelException(e); } } @Override protected void onSuccess() { // All went well. Store the new value. currentSelection = pos; } }; asyncTask.execute(propertyWidget, item.value); } } @Override public void onNothingSelected(AdapterView parent) { // Another interface callback } }; spinner.setOnItemSelectedListener(listener); return layout; } // ===================================================================================================================== private View createRadioButtonView(final PropertyWidget propertyWidget, Object initialValue) { Log.d(TAG, "Creating a radio button group for property '" + propertyWidget.getLabel() + "'"); // Create external widget layout final LinearLayout layout = new LinearLayout(uiContext); layout.setOrientation(LinearLayout.VERTICAL); LinearLayout.LayoutParams vLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); // Create internal label/unit of measure layout final LinearLayout innerLayout = new LinearLayout(uiContext); innerLayout.setOrientation(LinearLayout.HORIZONTAL); LinearLayout.LayoutParams hLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); hLinearLayoutParams.setMargins(10, 0, 0, 0); layout.addView(innerLayout, vLinearLayoutParams); final TextView nameTextView = new TextView(uiContext); nameTextView.setPadding(10, 0, 0, 0); nameTextView.setText(propertyWidget.getLabel()); innerLayout.addView(nameTextView, hLinearLayoutParams); // Add unit of measure String unitOfMeasure = propertyWidget.getUnitOfMeasure(); if (unitOfMeasure != null && unitOfMeasure.length() > 0) { final TextView unitsOfMeasureTextView = new TextView(uiContext); unitsOfMeasureTextView.setText(unitOfMeasure); innerLayout.addView(unitsOfMeasureTextView, hLinearLayoutParams); } RadioGroup radioGroup = new RadioGroup(uiContext); layout.addView(radioGroup, vLinearLayoutParams); radioGroup.setTag(PROPERTY_VALUE); final List> listOfConstraint = propertyWidget.getListOfConstraint(); if (listOfConstraint != null) { for (ConstrainToValues valueCons : listOfConstraint) { boolean isDefault = valueCons.getValue().equals(initialValue); Log.d(TAG, "Adding radio button, Label: " + valueCons.getLabel() + " Value: " + valueCons.getValue() + (isDefault ? " (default)" : "")); RadioButton radioButton = new RadioButton(uiContext); radioButton.setText(valueCons.getLabel()); LinearLayout.LayoutParams layoutParams = new RadioGroup.LayoutParams(RadioGroup.LayoutParams.WRAP_CONTENT, RadioGroup.LayoutParams.WRAP_CONTENT); radioGroup.addView(radioButton, layoutParams); // check the default value if (isDefault && !radioButton.isChecked()) { radioButton.toggle(); } } }// LOV constraints Log.d(TAG, "Property isWritable? " + propertyWidget.isWritable() + ", isEnabled? " + propertyWidget.isEnabled()); enableViewGroup(layout, propertyWidget.isEnabled() && propertyWidget.isWritable()); // radioGroup.setBackgroundColor(propertyWidget.getBgColor()); final int initialCheckedId = radioGroup.getCheckedRadioButtonId(); // register selection listener radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { int currentCheckedId = initialCheckedId; @Override public void onCheckedChanged(final RadioGroup group, final int checkedId) { int index = group.indexOfChild(group.findViewById(checkedId)); if (index > -1) { // Avoid fast consecutive selections. The problem is with // the valueChange events that a controllable device sends // following each selection of the RadioButton. // If a user selects different RadioButton(s) from the group // very fast, the valueChange events start toggling the // RadioGroup automatically for (int i = 0; i < group.getChildCount(); i++) { group.getChildAt(i).setEnabled(false); } group.postDelayed(new Runnable() { @Override public void run() { for (int i = 0; i < group.getChildCount(); i++) { group.getChildAt(i).setEnabled(true); } } }, 1000); ConstrainToValues item = listOfConstraint.get(index); Log.d(TAG, "Selected radio button, Label: '" + item.getLabel() + "' Value: " + item.getValue()); // set the property in a background task SetPropertyAsyncTask asyncTask = new SetPropertyAsyncTask() { @Override protected void onFailure(ControlPanelException e) { group.check(currentCheckedId); if (exceptionHandler != null) { // An exception was thrown. Restore old value. exceptionHandler.handleControlPanelException(e); } } @Override protected void onSuccess() { // All went well. Store the new value. currentCheckedId = checkedId; } }; asyncTask.execute(propertyWidget, item.getValue()); } } }); return layout; } // ===================================================================================================================== private CheckBox createCheckBoxView(final PropertyWidget propertyWidget, Object initialValue) { Log.d(TAG, "Creating a checkbox for property " + propertyWidget.getLabel()); CheckBox checkbox = new CheckBox(uiContext); Log.d(TAG, "Property isWritable? " + propertyWidget.isWritable() + ", isEnabled? " + propertyWidget.isEnabled() + " InitialValue: '" + initialValue + "'"); // initialize meta data checkbox.setEnabled(propertyWidget.isEnabled() && propertyWidget.isWritable()); // if (propertyWidget.getBgColor() != null) // checkbox.setBackgroundColor(propertyWidget.getBgColor()); // initialize data if (initialValue instanceof Boolean) { checkbox.setChecked((Boolean) initialValue); } checkbox.setText(propertyWidget.getLabel()); // register selection listener OnCheckedChangeListener listener = new OnCheckedChangeListener() { @Override public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) { // Avoid fast consecutive selections. The problem is with the // valueChange events that a controllable device sends // following each change of the Checkbox state. // If a user selects/unselects checkbox fast, these valueChange // events start toggle the Checkbox state automatically buttonView.setEnabled(false); buttonView.postDelayed(new Runnable() { @Override public void run() { buttonView.setEnabled(true); } }, 1000); // set the property in a background task SetPropertyAsyncTask asyncTask = new SetPropertyAsyncTask() { @Override protected void onFailure(ControlPanelException e) { buttonView.setChecked(!isChecked); if (exceptionHandler != null) { // An exception was thrown. Restore old value. exceptionHandler.handleControlPanelException(e); } } @Override protected void onSuccess() { // All went well. } }; asyncTask.execute(propertyWidget, isChecked); } }; checkbox.setOnCheckedChangeListener(listener); return checkbox; } // ===================================================================================================================== private View createTextView(final PropertyWidget propertyWidget, Object initialValue) { String label = propertyWidget.getLabel(); Integer bgColor = propertyWidget.getBgColor(); Log.d(TAG, "Creating TextView: \"" + label + "\" BGColor: " + bgColor); final LinearLayout layout = new LinearLayout(uiContext); layout.setOrientation(LinearLayout.HORIZONTAL); final TextView nameTextView = new TextView(uiContext); nameTextView.setText(label); layout.addView(nameTextView); final TextView valueTextView = new TextView(uiContext); valueTextView.setTag(PROPERTY_VALUE); LinearLayout.LayoutParams hLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); hLinearLayoutParams.setMargins(10, 0, 0, 0); layout.addView(valueTextView, hLinearLayoutParams); // if (bgColor != null) // labelView.setBackgroundColor(bgColor); if (initialValue != null) { Log.d(TAG, "Setting property value to: " + initialValue.toString()); valueTextView.setText(initialValue.toString()); } return layout; }// createTextView // ===================================================================================================================== private View createEditTextView(final PropertyWidget propertyWidget, Object initialValue) { Log.d(TAG, "Creating a text editor for property " + propertyWidget.getLabel()); // create the label final LinearLayout layout = new LinearLayout(uiContext); layout.setOrientation(LinearLayout.HORIZONTAL); final TextView nameTextView = new TextView(uiContext); nameTextView.setText(propertyWidget.getLabel()); final EditText valueEditText = new EditText(uiContext); valueEditText.setImeOptions(EditorInfo.IME_ACTION_DONE); valueEditText.setTag(PROPERTY_EDITOR); layout.addView(nameTextView); LinearLayout.LayoutParams hLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); hLinearLayoutParams.setMargins(10, 0, 0, 0); layout.addView(valueEditText, hLinearLayoutParams); // initialize meta data // if (propertyWidget.getBgColor() != null) // valueEditText.setBackgroundColor(propertyWidget.getBgColor()); Log.d(TAG, "Property isWritable? " + propertyWidget.isWritable() + ", isEnabled? " + propertyWidget.isEnabled()); enableViewGroup(layout, propertyWidget.isEnabled() && propertyWidget.isWritable()); // valueEditText.setEnabled(propertyWidget.isEnabled() && // propertyWidget.isWritable()); // nameTextView.setEnabled(true); final String initialValueStr = initialValue == null ? "" : initialValue.toString(); valueEditText.setText(initialValueStr); // register edit listener valueEditText.setInputType(InputType.TYPE_CLASS_TEXT); // limit the number of characters // editText.setFilters( new InputFilter[] {new // InputFilter.LengthFilter(10)}); valueEditText.setOnEditorActionListener(new OnEditorActionListener() { String currentText = initialValueStr; @Override public boolean onEditorAction(final TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_DONE) { // set the property in a background task SetPropertyAsyncTask asyncTask = new SetPropertyAsyncTask() { @Override protected void onFailure(ControlPanelException e) { v.setText(currentText); if (exceptionHandler != null) { // An exception was thrown. Restore old value. exceptionHandler.handleControlPanelException(e); } } @Override protected void onSuccess() { // All went well. Store the new value. currentText = v.getText().toString(); } }; asyncTask.execute(propertyWidget, v.getText().toString()); } // otherwise keyboard remains up return false; } }); return layout; }// createEditTextView // ===================================================================================================================== private View createNumericKeypadView(final PropertyWidget propertyWidget, Object initialValue) { Log.d(TAG, "Creating a number text editor for property " + propertyWidget.getLabel()); // create the label final LinearLayout layout = new LinearLayout(uiContext); layout.setOrientation(LinearLayout.HORIZONTAL); final TextView nameTextView = new TextView(uiContext); nameTextView.setText(propertyWidget.getLabel()); final EditText valueEditText = new EditText(uiContext); valueEditText.setImeOptions(EditorInfo.IME_ACTION_DONE); valueEditText.setTag(PROPERTY_EDITOR); layout.addView(nameTextView); LinearLayout.LayoutParams hLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); hLinearLayoutParams.setMargins(10, 0, 0, 0); layout.addView(valueEditText, hLinearLayoutParams); // initialize meta data // if (propertyWidget.getBgColor() != null) // valueEditText.setBackgroundColor(propertyWidget.getBgColor()); Log.d(TAG, "Property isWritable? " + propertyWidget.isWritable() + ", isEnabled? " + propertyWidget.isEnabled()); enableViewGroup(layout, propertyWidget.isEnabled() && propertyWidget.isWritable()); final ValueType valueType = propertyWidget.getValueType(); final Number initialValueNum = (initialValue == null ? 0 : ValueType.SHORT.equals(valueType) ? ((Short) initialValue) : ValueType.INT.equals(valueType) ? ((Integer) initialValue) : 0); valueEditText.setText(String.valueOf(initialValue)); // register edit listener valueEditText.setInputType(InputType.TYPE_CLASS_NUMBER); // limit to Short/Integer MAX_VALUE InputFilter filter = new InputFilter() { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { String insert = source.toString(); String insertInto = dest.toString(); Log.d(TAG, "Trying to insert ' " + insert + "' into '" + insertInto + "' between characters " + dstart + " and " + dend); try { String prefix = insertInto.substring(0, dstart); String suffix = insertInto.substring(dend); String result = prefix + insert + suffix; if (ValueType.SHORT.equals(valueType)) { short input = Short.parseShort(result); Log.d(TAG, "Valid short entered: " + input); // if we got here we're fine. Accept the editing by // returning null return null; } if (ValueType.INT.equals(valueType)) { int input = Integer.parseInt(result); Log.d(TAG, "Valid int entered: " + input); // if we got here we're fine. Accept the editing by // returning null return null; } } catch (NumberFormatException nfe) { Log.e(TAG, "Rejecting insert because'" + nfe.getMessage() + "'"); } // returning "" will reject the editing action return ""; } }; valueEditText.setFilters(new InputFilter[] { filter }); valueEditText.setOnEditorActionListener(new OnEditorActionListener() { Number currentValue = initialValueNum; @Override public boolean onEditorAction(final TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_DONE) { Number readEnteredValue = null; try { if (ValueType.SHORT == valueType) { readEnteredValue = Short.valueOf(v.getText().toString()); } else if (ValueType.INT == valueType) { readEnteredValue = Integer.valueOf(v.getText().toString()); } } catch (NumberFormatException nfe) { if (ValueType.SHORT == valueType) { Log.e(TAG, "Failed parsing Short: '" + nfe.getMessage() + "' returing to previous value"); } else if (ValueType.INT == valueType) { Log.e(TAG, "Failed parsing Integer: '" + nfe.getMessage() + "' returing to previous value"); } v.setText(String.valueOf(currentValue)); return true; } final Number enteredValue = readEnteredValue; // set the property in a background task SetPropertyAsyncTask asyncTask = new SetPropertyAsyncTask() { @Override protected void onFailure(ControlPanelException e) { v.setText(String.valueOf(currentValue)); if (exceptionHandler != null) { // An exception was thrown. Restore old value. exceptionHandler.handleControlPanelException(e); } } @Override protected void onSuccess() { // All went well. Store the new value. currentValue = enteredValue; } }; asyncTask.execute(propertyWidget, enteredValue); } // otherwise keyboard remains up return false; } }); return layout; }// createEditTextView // ===================================================================================================================== private View createTimePickerView(final PropertyWidget propertyWidget, Object initialValue) { Log.d(TAG, "Creating a time picker for property " + propertyWidget.getLabel()); final LinearLayout layout = new LinearLayout(uiContext); layout.setOrientation(LinearLayout.HORIZONTAL); final TextView nameTextView = new TextView(uiContext); nameTextView.setText(propertyWidget.getLabel()); final Button valueButton = new Button(uiContext); valueButton.setTag(PROPERTY_VALUE); layout.addView(nameTextView); LinearLayout.LayoutParams hLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); hLinearLayoutParams.setMargins(10, 0, 0, 0); layout.addView(valueButton, hLinearLayoutParams); // initialize meta data // if (propertyWidget.getBgColor() != null) // valueButton.setBackgroundColor(propertyWidget.getBgColor()); Log.d(TAG, "Property isWritable? " + propertyWidget.isWritable() + ", isEnabled? " + propertyWidget.isEnabled()); enableViewGroup(layout, propertyWidget.isEnabled() && propertyWidget.isWritable()); // set the current value if (initialValue != null && (ValueType.TIME.equals(propertyWidget.getValueType()))) { PropertyWidget.Time time = (PropertyWidget.Time) initialValue; valueButton.setText(formatTime(time.getHour(), time.getMinute())); } else { Log.e(TAG, "TimePicker property.getValueType() is not TIME, initializing property without current value"); } // register time picker dialog listener final TimePickerDialog.OnTimeSetListener onTimeSetListener = new TimePickerDialog.OnTimeSetListener() { @Override public void onTimeSet(TimePicker view, int hourOfDay, int minute) { PropertyWidget.Time time = new PropertyWidget.Time(); time.setHour((short) hourOfDay); time.setMinute((short) minute); time.setSecond((short) 0); // set the property in a background task SetPropertyAsyncTask asyncTask = new SetPropertyAsyncTask() { @Override protected void onFailure(ControlPanelException e) { if (exceptionHandler != null) { // no need to restore value, it hasn't changed. exceptionHandler.handleControlPanelException(e); } } @Override protected void onSuccess() { // don't worry about the result, it will be broadcasted // with ValueChanged // All went well. } }; asyncTask.execute(propertyWidget, time); } }; // register click listener OnClickListener onClickListener = new OnClickListener() { @Override public void onClick(View v) { // set the current value ServiceTasksExecutor exec = ServiceTasksExecutor.createExecutor(1); Future futCurrValue = submitGetPropertyCurrentValueTask(exec, propertyWidget); Object currentValue = null; PropertyWidget.Time time; try { if ( futCurrValue != null ) { currentValue = futCurrValue.get(timeoutValue, timeoutUnit); } } catch (Exception e) { Log.e(TAG, "TimePickerView property.getCurrentValue() failed, initializing picker without current value", e); futCurrValue.cancel(true); time = new PropertyWidget.Time(); } if (currentValue != null && (ValueType.TIME.equals(propertyWidget.getValueType()))) { time = (PropertyWidget.Time) currentValue; } else { Log.e(TAG, "TimePickerView property.getValueType() is not TIME, initializing picker without current value"); time = new PropertyWidget.Time(); } // Use the current time as the default values for the picker final Calendar c = Calendar.getInstance(); int hour = currentValue == null ? c.get(Calendar.HOUR_OF_DAY) : time.getHour(); int minute = currentValue == null ? c.get(Calendar.MINUTE) : time.getMinute(); // Pop a TimePickerDialog new TimePickerDialog(uiContext, onTimeSetListener, hour, minute, DateFormat.is24HourFormat(uiContext)).show(); } }; valueButton.setOnClickListener(onClickListener); return layout; }// createTimePickerView // ===================================================================================================================== private View createDatePickerView(final PropertyWidget propertyWidget, Object initialValue) { Log.d(TAG, "Creating a date picker for property " + propertyWidget.getLabel()); // create the label final LinearLayout layout = new LinearLayout(uiContext); layout.setOrientation(LinearLayout.HORIZONTAL); final TextView nameTextView = new TextView(uiContext); nameTextView.setText(propertyWidget.getLabel()); final Button valueButton = new Button(uiContext); valueButton.setTag(PROPERTY_VALUE); layout.addView(nameTextView); LinearLayout.LayoutParams hLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); hLinearLayoutParams.setMargins(10, 0, 0, 0); layout.addView(valueButton, hLinearLayoutParams); // initialize meta data // if (propertyWidget.getBgColor() != null) // valueButton.setBackgroundColor(propertyWidget.getBgColor()); Log.d(TAG, "Property isWritable? " + propertyWidget.isWritable() + ", isEnabled? " + propertyWidget.isEnabled()); enableViewGroup(layout, propertyWidget.isEnabled() && propertyWidget.isWritable()); if (initialValue != null && (ValueType.DATE.equals(propertyWidget.getValueType()))) { PropertyWidget.Date date = (PropertyWidget.Date) initialValue; valueButton.setText(formatDate(date.getDay(), date.getMonth(), date.getYear())); } else { Log.e(TAG, "DatePicker property.getValueType() is not DATE, initializing property without current value"); } // register time picker dialog listener final DatePickerDialog.OnDateSetListener onDateSetListener = new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view, int year, int month, int day) { PropertyWidget.Date date = new PropertyWidget.Date(); // DatePicker enums months from 0..11 :( month++; date.setDay((short) day); date.setMonth((short) month); date.setYear((short) year); // set the property in a background task SetPropertyAsyncTask asyncTask = new SetPropertyAsyncTask() { @Override protected void onFailure(ControlPanelException e) { if (exceptionHandler != null) { // no need to restore value, it hasn't changed. exceptionHandler.handleControlPanelException(e); } } @Override protected void onSuccess() { // don't worry about the result, it will be broadcasted // with ValueChanged // All went well. } }; asyncTask.execute(propertyWidget, date); } }; // register click listener OnClickListener onClickListener = new OnClickListener() { @Override public void onClick(View v) { // set the current value ServiceTasksExecutor exec = ServiceTasksExecutor.createExecutor(1); Future futCurrValue = submitGetPropertyCurrentValueTask(exec, propertyWidget); Object currentValue = null; PropertyWidget.Date date; try { if ( futCurrValue != null) { currentValue = futCurrValue.get(timeoutValue, timeoutUnit); } } catch (Exception e) { Log.e(TAG, "DatePickerView property.getCurrentValue() failed, initializing picker without current value", e); futCurrValue.cancel(true); date = new PropertyWidget.Date(); } finally { exec.shutdown(); } if (currentValue != null && (ValueType.DATE.equals(propertyWidget.getValueType()))) { date = (PropertyWidget.Date) currentValue; } else { Log.e(TAG, "property.getValueType() is not DATE, initializing picker without current value"); date = new PropertyWidget.Date(); } // Use the current date as the default values for the picker final Calendar c = Calendar.getInstance(); int day = currentValue == null ? c.get(Calendar.DAY_OF_MONTH) : date.getDay(); int month = currentValue == null ? c.get(Calendar.MONTH) : date.getMonth(); int year = currentValue == null ? c.get(Calendar.YEAR) : date.getYear(); // DatePicker enums months from 0..11 :( month--; // Pop a DatePickerDialog new DatePickerDialog(uiContext, onDateSetListener, year, month, day).show(); } }; valueButton.setOnClickListener(onClickListener); return layout; }// createTimePickerView // ===================================================================================================================== private View createNumberPickerView(final PropertyWidget propertyWidget, Object initialValue) { Log.d(TAG, "Creating a number picker for property " + propertyWidget.getLabel()); // create the label final LinearLayout layout = new LinearLayout(uiContext); layout.setOrientation(LinearLayout.VERTICAL); final LinearLayout innerLayout = new LinearLayout(uiContext); innerLayout.setOrientation(LinearLayout.HORIZONTAL); final TextView nameTextView = new TextView(uiContext); nameTextView.setText(propertyWidget.getLabel()); final TextView valueTextView = new TextView(uiContext); valueTextView.setTag(PROPERTY_VALUE); final TextView unitsOfMeasureTextView = new TextView(uiContext); innerLayout.addView(nameTextView); LinearLayout.LayoutParams hLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); hLinearLayoutParams.setMargins(10, 0, 0, 0); innerLayout.addView(valueTextView, hLinearLayoutParams); innerLayout.addView(unitsOfMeasureTextView, hLinearLayoutParams); LinearLayout.LayoutParams vLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); layout.addView(innerLayout, vLinearLayoutParams); ValueType valueType = propertyWidget.getValueType(); final int initialValueNum = (initialValue == null ? 0 : ValueType.SHORT.equals(valueType) ? ((Short) initialValue) : ValueType.INT.equals(valueType) ? ((Integer) initialValue) : 0); Log.d(TAG, "number picker initial value is: " + initialValueNum); valueTextView.setText(String.valueOf(initialValueNum)); String unitOfMeasure = propertyWidget.getUnitOfMeasure(); Log.d(TAG, "Setting property units of measure to: " + unitOfMeasure); unitsOfMeasureTextView.setText(unitOfMeasure); RangeConstraint propertyRangeConstraint = propertyWidget.getPropertyRangeConstraint(); if (propertyRangeConstraint == null) { Log.e(TAG, "Found null property-range. Disabling Number Picker. Returning a plain label."); valueTextView.setEnabled(false); return layout; } Log.d(TAG, "Property isWritable? " + propertyWidget.isWritable() + ", isEnabled? " + propertyWidget.isEnabled()); enableViewGroup(layout, propertyWidget.isEnabled() && propertyWidget.isWritable()); // Number picker only works for Honeycomb(API 11) and above if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) { final NumberPicker picker = new NumberPicker(uiContext); picker.setTag(PROPERTY_EDITOR); layout.addView(picker, vLinearLayoutParams); Object minT = propertyRangeConstraint.getMin(); Log.d(TAG, "number picker min value is: " + minT.toString()); final int min = ValueType.SHORT.equals(valueType) ? ((Short) minT) : ValueType.INT.equals(valueType) ? ((Integer) minT) : 0; Object maxT = propertyRangeConstraint.getMax(); Log.d(TAG, "number picker max value is: " + maxT.toString()); int max = ValueType.SHORT.equals(valueType) ? ((Short) maxT) : ValueType.INT.equals(valueType) ? ((Integer) maxT) : 0; picker.setValue(initialValueNum); picker.setMinValue(min); picker.setMaxValue(max); picker.setWrapSelectorWheel(true); picker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() { public void onValueChange(NumberPicker picker, int oldVal, int newVal) { Log.d(TAG, "New value is: " + newVal); valueTextView.setText(String.valueOf(newVal)); } }); } return layout; } // ===================================================================================================================== private View createNumericView(final PropertyWidget propertyWidget, Object initialValue) { Log.d(TAG, "Creating a numberic view for property " + propertyWidget.getLabel()); // create the label final LinearLayout layout = new LinearLayout(uiContext); layout.setOrientation(LinearLayout.HORIZONTAL); final TextView nameTextView = new TextView(uiContext); nameTextView.setText(propertyWidget.getLabel()); final TextView valueTextView = new TextView(uiContext); valueTextView.setTag(PROPERTY_VALUE); layout.addView(nameTextView); LinearLayout.LayoutParams hLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); hLinearLayoutParams.setMargins(10, 0, 0, 0); layout.addView(valueTextView, hLinearLayoutParams); // initialize meta data // if (propertyWidget.getBgColor() != null) // valueTextView.setBackgroundColor(propertyWidget.getBgColor()); Log.d(TAG, "Property isWritable? " + propertyWidget.isWritable() + ", isEnabled? " + propertyWidget.isEnabled()); enableViewGroup(layout, propertyWidget.isEnabled() && propertyWidget.isWritable()); if (initialValue != null) { Log.d(TAG, "Setting property value to: " + initialValue.toString()); valueTextView.setText(initialValue.toString()); } return layout; } // ===================================================================================================================== private View createSliderView(final PropertyWidget propertyWidget, Object initialValue) { Log.d(TAG, "Creating a slider for property " + propertyWidget.getLabel()); // create the label final LinearLayout layout = new LinearLayout(uiContext); layout.setOrientation(LinearLayout.VERTICAL); final LinearLayout innerLayout = new LinearLayout(uiContext); innerLayout.setOrientation(LinearLayout.HORIZONTAL); final TextView nameTextView = new TextView(uiContext); nameTextView.setText(propertyWidget.getLabel()); final TextView valueTextView = new TextView(uiContext); valueTextView.setTag(PROPERTY_VALUE); final TextView unitsOfMeasureTextView = new TextView(uiContext); final SeekBar slider = new SeekBar(uiContext); slider.setTag(PROPERTY_EDITOR); innerLayout.addView(nameTextView); LinearLayout.LayoutParams hLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); hLinearLayoutParams.setMargins(10, 0, 0, 0); innerLayout.addView(valueTextView, hLinearLayoutParams); innerLayout.addView(unitsOfMeasureTextView, hLinearLayoutParams); LinearLayout.LayoutParams vLinearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); layout.addView(innerLayout, vLinearLayoutParams); layout.addView(slider, vLinearLayoutParams); // initialize meta data // valueTextView.setBackgroundColor(propertyWidget.getBgColor()); Log.d(TAG, "Property isWritable? " + propertyWidget.isWritable() + ", isEnabled? " + propertyWidget.isEnabled()); enableViewGroup(layout, propertyWidget.isEnabled() && propertyWidget.isWritable()); String unitOfMeasure = propertyWidget.getUnitOfMeasure(); Log.d(TAG, "Setting property units of measure to: " + unitOfMeasure); unitsOfMeasureTextView.setText(unitOfMeasure); RangeConstraint propertyRangeConstraint = propertyWidget.getPropertyRangeConstraint(); if (propertyRangeConstraint == null) { Log.e(TAG, "Found null property-range. Disabling Slider. Returning a plain label."); return new TextView(uiContext); } // set the current value ValueType valueType = propertyWidget.getValueType(); final int initialValueNum = (initialValue == null ? 0 : ValueType.SHORT.equals(valueType) ? ((Short) initialValue) : ValueType.INT.equals(valueType) ? ((Integer) initialValue) : 0); // !!! Android sliders always start from 0 !!! Object minT = propertyRangeConstraint.getMin(); final int min = ValueType.SHORT.equals(valueType) ? ((Short) minT) : ValueType.INT.equals(valueType) ? ((Integer) minT) : 0; Object maxT = propertyRangeConstraint.getMax(); int max = ValueType.SHORT.equals(valueType) ? ((Short) maxT) : ValueType.INT.equals(valueType) ? ((Integer) maxT) : 0; Object incrementT = propertyRangeConstraint.getIncrement(); final int increment = ValueType.SHORT.equals(valueType) ? ((Short) incrementT) : ValueType.INT.equals(valueType) ? ((Integer) incrementT) : 0; // because the minimum value in android always starts from 0, we move // the max value to persist the min,max range max -= min; slider.setMax(max); slider.setKeyProgressIncrement(increment); final int initialValueTrans = initialValueNum - min; Log.d(TAG, "Setting property value to: " + String.valueOf(initialValueNum) + " Slider value: '" + initialValueTrans + "'"); slider.setProgress(initialValueTrans); valueTextView.setText(String.valueOf(initialValueNum)); slider.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { int currentProgress = initialValueTrans; final int listenMin = min; @Override public void onStopTrackingTouch(final SeekBar seekBar) { // set the property in a background task SetPropertyAsyncTask asyncTask = new SetPropertyAsyncTask() { @Override protected void onFailure(ControlPanelException e) { seekBar.setProgress(currentProgress); valueTextView.setText(String.valueOf(currentProgress + listenMin)); if (exceptionHandler != null) { // An exception was thrown. Restore old value. exceptionHandler.handleControlPanelException(e); } } @Override protected void onSuccess() { // All went well. Store the new value. currentProgress = seekBar.getProgress(); } }; int progress = seekBar.getProgress(); int valueToUpdate = progress + listenMin; Log.d(TAG, "The slider progress: '" + progress + "' valueToUpdate: '" + valueToUpdate + "'"); asyncTask.execute(propertyWidget, valueToUpdate); }// onStopTrackingTouch @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { valueTextView.setText(String.valueOf(progress + listenMin)); } }); return layout; } // ===================================================================================================================== /** * A callback that is invoked when the meta data of a UIElement has changed. * Refreshes the UIElement and the corresponding View. * * @param element * the abstract UIElement */ public void onMetaDataChange(UIElement element) { UIElementType elementType = element.getElementType(); Log.d(TAG, "Refreshing the Android View for element : '" + element.getObjectPath() + "'"); switch (elementType) { case ACTION_WIDGET: { onActionMetaDataChange((ActionWidget) element); break; }// ACTION_WIDGET case CONTAINER: { onContainerMetaDataChange((ContainerWidget) element); break; }// CONTAINER // case LIST_PROPERTY_WIDGET: { // break; // }//LIST_PROPERTY_WIDGET case PROPERTY_WIDGET: { onPropertyMetaDataChange((PropertyWidget) element); break; }// PROPERTY_WIDGET case ALERT_DIALOG: { onAlertDialogMetaDataChange((AlertDialogWidget) element); break; }// PROPERTY_WIDGET default: break; }// switch :: elementType } // ===================================================================================================================== private void onContainerMetaDataChange(ContainerWidget container) { if (container == null) { Log.e(TAG, "onContainerMetaDataChange"); return; } // get a handle to the corresponding view ViewGroup containerLayout = (ViewGroup) uiElementToView.get(container.getObjectPath()); if (containerLayout == null) { Log.d(TAG, "ViewGroup not found for widget " + container.getObjectPath()); return; } boolean enabled = container.isEnabled(); Log.d(TAG, "Refreshing ContainerWidget bgColor: " + container.getBgColor() + " enabled: " + enabled); // if (container.getBgColor() != null) // containerLayout.setBackgroundColor(container.getBgColor()); if (enabled && !containerLayout.isEnabled()) { enableViewGroup(containerLayout, true); } else if (!enabled && containerLayout.isEnabled()) { enableViewGroup(containerLayout, false); } } // ===================================================================================================================== private void onActionMetaDataChange(final ActionWidget actionWidget) { // get a handle to the corresponding view Button actionButton = (Button) uiElementToView.get(actionWidget.getObjectPath()); if (actionButton == null) { Log.d(TAG, "Button not found for widget " + actionWidget.getObjectPath()); return; } String label = actionWidget.getLabel(); Integer bgColor = actionWidget.getBgColor(); boolean enabled = actionWidget.isEnabled(); Log.d(TAG, "Refreshing ActionWidget: Label: " + label + " BGColor: " + bgColor + " Enabled: " + enabled); actionButton.setText(label); actionButton.setEnabled(enabled); // if (bgColor != null) { // Unfortunately button loses its pressed behavior when background is // set. // actionButton.setBackgroundColor(bgColor); // } }// onActionMetaDataChange // ===================================================================================================================== private void onAlertDialogMetaDataChange(final AlertDialogWidget alertDialogWidget) { // get a handle to the corresponding AlertDialog AlertDialog alertDialog = alertWidgetToDialog.get(alertDialogWidget.getObjectPath()); if (alertDialog == null) { Log.d(TAG, "AlertDialog not found for widget " + alertDialogWidget.getObjectPath()); return; } if (!alertDialogWidget.isEnabled() && alertDialog.isShowing()) { Log.d(TAG, "Dismissing AlertDialog"); alertDialog.dismiss(); } }// onAlertDialogMetaDataChange // ===================================================================================================================== private void onPropertyMetaDataChange(PropertyWidget propertyWidget) { // get a handle to the corresponding view View propertyView = uiElementToView.get(propertyWidget.getObjectPath()); if (propertyView == null) { Log.d(TAG, "Property View not found for widget " + propertyWidget.getObjectPath()); return; } Log.d(TAG, "Refreshing the view of property '" + propertyWidget.getLabel() + "' isWritable? " + propertyWidget.isWritable() + ", isEnabled? " + propertyWidget.isEnabled()); // Set enable/disable property if (propertyView instanceof ViewGroup) { enableViewGroup(propertyView, propertyWidget.isEnabled() && propertyWidget.isWritable()); }// if :: ViewGroup else { propertyView.setEnabled(propertyWidget.isEnabled() && propertyWidget.isWritable()); } // if (!(propertyView instanceof Spinner)) { // if (propertyWidget.getBgColor() != null) // propertyView.setBackgroundColor(propertyWidget.getBgColor()); // } } /** * Iteration over the given {@link ViewGroup} and set it enable/disable state * @param propertyView {@link ViewGroup} to set its enable/disable state * @param enable */ private void enableViewGroup(View propertyView, boolean enable) { if (!(propertyView instanceof ViewGroup)) { Log.w(TAG, "The given propertyView is no intanceof ViewGroup"); return; } ViewGroup viewGroup = (ViewGroup) propertyView; for (int i = 0; i < viewGroup.getChildCount(); ++i) { View element = viewGroup.getChildAt(i); if (element instanceof ViewGroup) { enableViewGroup(element, enable); } if (PROPERTY_EDITOR.equals(element.getTag())) { element.setEnabled(enable); } }// for :: viewGroup viewGroup.setEnabled(enable); }// enableViewGroup // ===================================================================================================================== /** * A callback that is invoked when a value of a UIElement has changed. * Refreshes the UIElement and the corresponding View. * @param element the abstract UIElement * @param newValue the new value */ public void onValueChange(UIElement element, Object newValue) { UIElementType elementType = element.getElementType(); Log.d(TAG, "Value changed for the Android View for element : '" + element.getObjectPath() + "', newValue: '" + newValue); switch (elementType) { case PROPERTY_WIDGET: { onPropertyValueChange((PropertyWidget) element, newValue); break; }// PROPERTY_WIDGET case ACTION_WIDGET: { Log.d(TAG, "Ignoring change of value for action : '" + element.getObjectPath() + "'"); break; }// ACTION_WIDGET case CONTAINER: { Log.d(TAG, "Ignoring change of value for container : '" + element.getObjectPath() + "'"); break; }// CONTAINER // case LIST_PROPERTY_WIDGET: { // break; // }//LIST_PROPERTY_WIDGET default: break; }// switch :: elementType } // ===================================================================================================================== /** * A callback that is invoked when a value of a property has changed. * Refreshes the property and the corresponding View. * @param propertyWidget the property whose value has changed. * @param newValue new value for the property */ private void onPropertyValueChange(PropertyWidget propertyWidget, Object newValue) { // get a handle to the corresponding view View propertyView = uiElementToView.get(propertyWidget.getObjectPath()); if (propertyView == null) { Log.d(TAG, "Property View not found for widget " + propertyWidget.getObjectPath()); return; } if (newValue == null) { Log.e(TAG, "onPropertyValueChange() failed, new value is null"); // ==== return; } ValueType valueType = propertyWidget.getValueType(); List hints = propertyWidget.getHints(); PropertyWidgetHintsType hint = (hints == null || hints.size() == 0) ? null : hints.get(0); Log.d(TAG, "Refreshing the View for property '" + propertyWidget.getLabel() + "' , using UI hint: " + hint + ", value type: '" + valueType + "', objPath: '" + propertyWidget.getObjectPath() + "'" + "', newValue: '" + newValue); switch (valueType) { case BOOLEAN: // Boolean Property onCheckBoxValueChange(propertyView, propertyWidget, newValue); break; case DATE: // Date Property onDateValueChange(propertyView, propertyWidget, newValue); break; case TIME: // Time Property onTimeValueChange(propertyView, propertyWidget, newValue); break; case BYTE: case INT: case SHORT: case LONG: case DOUBLE: // Scalar Property if (hint == null) { onNumericViewValueChange(propertyView, propertyWidget, newValue); } else { switch (hint) { case SPINNER: onSpinnerValueChange(propertyView, propertyWidget, newValue); break; case RADIO_BUTTON: onRadioButtonValueChange(propertyView, propertyWidget, newValue); break; case NUMBER_PICKER: onNumberPickerValueChange(propertyView, propertyWidget, newValue); break; case NUMERIC_VIEW: onNumericViewValueChange(propertyView, propertyWidget, newValue); break; case SLIDER: onSliderValueChange(propertyView, propertyWidget, newValue); break; case NUMERIC_KEYPAD: onNumericKeypadValueChange(propertyView, propertyWidget, newValue); break; default: onNumericViewValueChange(propertyView, propertyWidget, newValue); break; } } break; case STRING: // String Property if (hint == null) { Log.d(TAG, "No hint provided for property '" + propertyWidget.getLabel() + "', creating default: TextView"); onTextViewValueChange(propertyView, propertyWidget, newValue); } else { switch (hint) { case SPINNER: onSpinnerValueChange(propertyView, propertyWidget, newValue); break; case RADIO_BUTTON: onRadioButtonValueChange(propertyView, propertyWidget, newValue); break; case EDIT_TEXT: onEditTextValueChange(propertyView, propertyWidget, newValue); break; case TEXT_VIEW: onTextViewValueChange(propertyView, propertyWidget, newValue); break; default: onTextViewValueChange(propertyView, propertyWidget, newValue); break; } } break; default: Log.d(TAG, "Received an unsupported ValueType: '" + valueType + "' , not refreshing any view"); break; } } // ===================================================================================================================== private void onSliderValueChange(View propertyView, PropertyWidget propertyWidget, Object newValue2) { ViewGroup layout = (ViewGroup) propertyView; final TextView valueTextView = (TextView) layout.findViewWithTag(PROPERTY_VALUE); final SeekBar slider = (SeekBar) layout.findViewWithTag(PROPERTY_EDITOR); Log.d(TAG, "Refreshing the value of property " + propertyWidget.getLabel()); // set the current value ValueType valueType = propertyWidget.getValueType(); int newValue = -1; switch (valueType) { case SHORT: newValue = (Short) newValue2; break; case INT: newValue = (Integer) newValue2; break; default: Log.e(TAG, "property.getValueType() has unexpected value type: " + valueType); // ==== return; } // set value RangeConstraint rangeCons = propertyWidget.getPropertyRangeConstraint(); if (rangeCons == null) { Log.e(TAG, "Found null property-range nothing to do with it..."); return; } Object minT = rangeCons.getMin(); final int min = ValueType.SHORT.equals(valueType) ? ((Short) minT) : ValueType.INT.equals(valueType) ? ((Integer) minT) : 0; valueTextView.setText(String.valueOf(newValue)); slider.setProgress(newValue - min); } // ===================================================================================================================== private void onCheckBoxValueChange(View propertyView, PropertyWidget propertyWidget, Object newValue) { Log.d(TAG, "Refreshing the CheckBox of property " + propertyWidget.getLabel()); CheckBox checkbox = (CheckBox) propertyView; ValueType valueType = propertyWidget.getValueType(); // set checked if (ValueType.BOOLEAN.equals(valueType)) { checkbox.setChecked((Boolean) newValue); } else { Log.e(TAG, "property.getCurrentValue() failed, cannot update property with value: " + newValue); } } // ===================================================================================================================== private void onTextViewValueChange(View propertyView, PropertyWidget propertyWidget, Object newValue) { String label = propertyWidget.getLabel(); Log.d(TAG, "Refreshing the TextView of property '" + label + "'"); // extract the text view final ViewGroup layout = (ViewGroup) propertyView; final TextView valueTextView = (TextView) layout.findViewWithTag(PROPERTY_VALUE); // set the current value String newValueStr = newValue.toString(); Log.d(TAG, "Setting property value to: '" + newValueStr + "'"); valueTextView.setText(newValueStr); } // ===================================================================================================================== private void onNumericViewValueChange(View propertyView, PropertyWidget propertyWidget, Object newValue) { Log.d(TAG, "Refreshing the NumericView of property " + propertyWidget.getLabel()); // extract the text view final ViewGroup layout = (ViewGroup) propertyView; final TextView valueTextView = (TextView) layout.findViewWithTag(PROPERTY_VALUE); // set the current value Log.d(TAG, "Setting property value to: " + newValue.toString()); valueTextView.setText(newValue.toString()); } // ===================================================================================================================== private void onNumberPickerValueChange(View propertyView, PropertyWidget propertyWidget, Object newValue) { Log.d(TAG, "Refreshing the NumericPicker of property " + propertyWidget.getLabel()); // extract the text view final ViewGroup layout = (ViewGroup) propertyView; final TextView valueTextView = (TextView) layout.findViewWithTag(PROPERTY_VALUE); // set the current value Log.d(TAG, "Setting property value to: " + newValue.toString()); valueTextView.setText(newValue.toString()); } // ===================================================================================================================== private void onNumericKeypadValueChange(View propertyView, PropertyWidget propertyWidget, Object newValue) { Log.d(TAG, "Refreshing the NumericKeypad View of property " + propertyWidget.getLabel()); // extract the text view final ViewGroup layout = (ViewGroup) propertyView; final EditText valueEditText = (EditText) layout.findViewWithTag(PROPERTY_EDITOR); // set the current value Log.d(TAG, "Setting property value to: " + newValue.toString()); valueEditText.setText(newValue.toString()); } // ===================================================================================================================== private void onTimeValueChange(View propertyView, PropertyWidget propertyWidget, Object newValue) { Log.d(TAG, "Refreshing the Time View of property " + propertyWidget.getLabel()); // extract the text view final ViewGroup layout = (ViewGroup) propertyView; final Button valueButton = (Button) layout.findViewWithTag(PROPERTY_VALUE); // set the current value if (ValueType.TIME.equals(propertyWidget.getValueType())) { PropertyWidget.Time time = (PropertyWidget.Time) newValue; String formattedTime = formatTime(time.getHour(), time.getMinute()); Log.d(TAG, "Setting property value to: " + formattedTime); valueButton.setText(formattedTime); } else { Log.e(TAG, "property.getValueType() is not TIME, cannot update property with new value: " + newValue); } } // ===================================================================================================================== private void onDateValueChange(View propertyView, PropertyWidget propertyWidget, Object newValue) { Log.d(TAG, "Refreshing the Date View of property " + propertyWidget.getLabel()); // extract the text view final ViewGroup layout = (ViewGroup) propertyView; final Button valueButton = (Button) layout.findViewWithTag(PROPERTY_VALUE); // set the current value if (ValueType.DATE.equals(propertyWidget.getValueType())) { PropertyWidget.Date date = (PropertyWidget.Date) newValue; String formattedDate = formatDate(date.getDay(), date.getMonth(), date.getYear()); Log.d(TAG, "Setting property value to: " + formattedDate); valueButton.setText(formattedDate); } else { Log.e(TAG, "property.getValueType() is not DATE, cannot update property with current value: " + newValue); } } // ===================================================================================================================== private void onEditTextValueChange(View propertyView, PropertyWidget propertyWidget, Object newValue) { Log.d(TAG, "Refreshing the EditText View of property " + propertyWidget.getLabel()); // extract the text view final ViewGroup layout = (ViewGroup) propertyView; final EditText valueEditText = (EditText) layout.findViewWithTag(PROPERTY_EDITOR); // set the current value Log.d(TAG, "Setting property value to: " + newValue.toString()); valueEditText.setText(newValue.toString()); } // ===================================================================================================================== private void onSpinnerValueChange(View propertyView, PropertyWidget propertyWidget, Object newValue) { // extract the text view final ViewGroup layout = (ViewGroup) propertyView; final Spinner spinner = (Spinner) layout.findViewWithTag(PROPERTY_VALUE); Log.d(TAG, "Refreshing the spinner of property " + propertyWidget.getLabel()); // set the selected item int selection = 0; @SuppressWarnings("unchecked") final ArrayAdapter adapter = (ArrayAdapter) spinner.getAdapter(); for (int i = 0; i < adapter.getCount(); i++) { LabelValuePair item = adapter.getItem(i); if (item != null && item.value.equals(newValue)) { selection = i; break; } } spinner.setSelection(selection); adapter.notifyDataSetChanged(); } // ===================================================================================================================== private void onRadioButtonValueChange(View propertyView, PropertyWidget propertyWidget, Object newValue) { Log.d(TAG, "Refreshing the RadioButton of property '" + propertyWidget.getLabel() + "', new value: " + newValue); final ViewGroup layout = (ViewGroup) propertyView; final RadioGroup radioGroup = (RadioGroup) layout.findViewWithTag(PROPERTY_VALUE); // set the selected item int selection = 0; final List> listOfConstraint = propertyWidget.getListOfConstraint(); if (listOfConstraint != null) { for (ConstrainToValues valueCons : listOfConstraint) { boolean selectThis = valueCons.getValue().equals(newValue); // check the default value if (selectThis) { Log.d(TAG, "Selecting radio button, Label: " + valueCons.getLabel() + " Value: " + valueCons.getValue()); RadioButton radioButton = (RadioButton) radioGroup.getChildAt(selection); if (!radioButton.isChecked()) { radioButton.setChecked(true); } } else { selection++; } } }// LOV constraints } // ===================================================================================================================== /** * A wrapper class for hosting a {label,value} pair inside an ArrayAdapter. * So that the label is displayed, while practically the real value is used. */ class LabelValuePair { final String label; final Object value; public LabelValuePair(String label, Object value) { super(); this.value = value; this.label = label; } @Override // This does the trick of displaying the label and not the value in the // Adapter public String toString() { return label; } } /** * A utility method that formats time for display, following the user's * locale as given by context * @param hour * @param minute * @return */ private String formatTime(short hour, short minute) { Calendar calendar = new GregorianCalendar(); calendar.setTimeInMillis(System.currentTimeMillis()); calendar.set(Calendar.HOUR_OF_DAY, hour); calendar.set(Calendar.MINUTE, minute); return DateFormat.getTimeFormat(uiContext.getApplicationContext()).format(calendar.getTime()); // return String.format("%02d", hour) + ":" + String.format("%02d", // minute); } /** * A utility method that formats dates for display, following the user's * locale as given by context * @param day * @param month * @param year * @return */ private String formatDate(short day, short month, short year) { // GregorianCalendar enums months from 0..11 month--; Calendar calendar = new GregorianCalendar(year, month, day); return DateFormat.getDateFormat(uiContext.getApplicationContext()).format(calendar.getTime()); } } ControlPanelExceptionHandler.java000066400000000000000000000022501262264444500402000ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelAdapter/src/org/alljoyn/ioe/controlpaneladapterpackage org.alljoyn.ioe.controlpaneladapter; /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ import org.alljoyn.ioe.controlpanelservice.ControlPanelException; public interface ControlPanelExceptionHandler { public void handleControlPanelException(ControlPanelException e); } ExecuteActionAsyncTask.java000066400000000000000000000056071262264444500370150ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelAdapter/src/org/alljoyn/ioe/controlpaneladapterpackage org.alljoyn.ioe.controlpaneladapter; /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.ui.ActionWidget; import org.alljoyn.ioe.controlpanelservice.ui.AlertDialogWidget.DialogButton; import android.os.AsyncTask; import android.util.Log; /** * A Utility class that has 2 functions: * 1. Executing an action on the remote device, in a background process, to free the UI thread. * 2. Notifying the caller about the result. */ abstract class ExecuteActionAsyncTask extends AsyncTask { private final static String TAG = "cpapp" + ExecuteActionAsyncTask.class.getSimpleName(); @Override /** * This background processor assumes params[0] to be a ActionWidget or DialogButton. */ protected ControlPanelException doInBackground(Object... params) { try { if (params[0] instanceof ActionWidget) { ActionWidget actionWidget = (ActionWidget) params[0]; Log.d(TAG, String.format("Executing action '%s'", actionWidget.getLabel())); actionWidget.exec(); Log.d(TAG, "Action executed"); } else if (params[0] instanceof DialogButton) { DialogButton dialogButton = (DialogButton) params[0]; Log.d(TAG, String.format("Executing action '%s'", dialogButton.getLabel())); dialogButton.exec(); Log.d(TAG, "Action executed"); } } catch (ControlPanelException e) { Log.e(TAG, "Failed executing the action, error in calling remote object: '" + e.getMessage() + "'"); return e; } return null; // No exception...ok! } @Override /** * Exception means failure. Otherwise - success. */ protected void onPostExecute(ControlPanelException e) { if (e != null) { onFailure(e); } else { onSuccess(); } } /** * Notify the caller about an exception. */ abstract protected void onFailure(ControlPanelException e); /** * Notify the caller about success. */ abstract protected void onSuccess(); } ServiceTasksExecutor.java000066400000000000000000000066461262264444500365650ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelAdapter/src/org/alljoyn/ioe/controlpaneladapter/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpaneladapter; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.RejectedExecutionException; import android.util.Log; /** * Executes {@link Callable} tasks. * The class is initialized with a given number of threads or with {@link ServiceTasksExecutor#NUM_THREADS_DEFAULT} */ public class ServiceTasksExecutor { private final static String TAG = "cpapp" + ServiceTasksExecutor.class.getSimpleName(); /** * Default number of threads */ private static final int NUM_THREADS_DEFAULT = 2; /** * Executor service */ private final ExecutorService executor; /** * Create the {@link ServiceTasksExecutor} with {@link ServiceTasksExecutor#NUM_THREADS_DEFAULT} * @return {@link ServiceTasksExecutor} */ public static ServiceTasksExecutor createExecutor(){ return createExecutor(NUM_THREADS_DEFAULT); } /** * Create the {@link ServiceTasksExecutor} with the given number of threads. * @param numThreads Create the executor with the given number of threads * @return {@link ServiceTasksExecutor} */ public static ServiceTasksExecutor createExecutor(int numThreads){ return new ServiceTasksExecutor(numThreads); } /** * Constructor */ private ServiceTasksExecutor(int numThreads) { Log.d(TAG, "Creating ServiceTaskExecutor with numThreads: '" + numThreads + "'"); executor = Executors.newFixedThreadPool(numThreads); } /** * Do the best effort to shutdown the executor. * @see ExecutorService#shutdownNow() */ public void shutdown() { Log.d(TAG, "Shutting down the ServiceTaskExecutor"); executor.shutdownNow(); } /** * Submit the given task for execution * @param task The {@link Callable} task to execute * @return {@link Future} of the submitted object * @throws IllegalArgumentException if the given task in NULL * @throws RejectedExecutionException * @see ExecutorService#submit(Callable) */ public Future submit(Callable task) { if ( task == null ) { throw new IllegalArgumentException("task is indefined"); } return executor.submit(task); } } SetPropertyAsyncTask.java000066400000000000000000000051601262264444500365470ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelAdapter/src/org/alljoyn/ioe/controlpaneladapterpackage org.alljoyn.ioe.controlpaneladapter; /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget; import android.os.AsyncTask; import android.util.Log; /** * A Utility class that has 2 functions: * 1. Executing an action on the remote device, in a background process, to free the UI thread. * 2. Notifying the caller about the result. */ abstract class SetPropertyAsyncTask extends AsyncTask { private final static String TAG = "cpapp" + SetPropertyAsyncTask.class.getSimpleName(); @Override /** * This background processor assumes params[0] to be a PropertyWidget and params[1] to be the value Object. */ public ControlPanelException doInBackground(Object... params) { PropertyWidget propertyWidget = (PropertyWidget) params[0]; Object value = params[1]; Log.d(TAG, String.format("Setting property %s to value %s", propertyWidget.getLabel(), value.toString())); try { propertyWidget.setCurrentValue(value); Log.d(TAG, "Property successfully set"); } catch (ControlPanelException e) { Log.e(TAG, "Failed setting property, error in calling remote object: '" + e.getMessage() + "'"); return e; } return null; // No exception...ok! } @Override /** * Exception means failure. Otherwise - success. */ protected void onPostExecute(ControlPanelException e) { if (e != null) { onFailure(e); } else { onSuccess(); } } /** * Notify the caller about an exception. */ abstract protected void onFailure(ControlPanelException e); /** * Notify the caller about success. */ abstract protected void onSuccess(); } base-15.09/controlpanel/java/ControlPanelService/000077500000000000000000000000001262264444500220155ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/.classpath000066400000000000000000000013531262264444500240020ustar00rootroot00000000000000 base-15.09/controlpanel/java/ControlPanelService/.project000066400000000000000000000014661262264444500234730ustar00rootroot00000000000000 ControlPanelService com.android.ide.eclipse.adt.ResourceManagerBuilder com.android.ide.eclipse.adt.PreCompilerBuilder org.eclipse.jdt.core.javabuilder com.android.ide.eclipse.adt.ApkBuilder com.android.ide.eclipse.adt.AndroidNature org.eclipse.jdt.core.javanature base-15.09/controlpanel/java/ControlPanelService/.settings/000077500000000000000000000000001262264444500237335ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000003201262264444500307100ustar00rootroot00000000000000#Tue Apr 23 10:24:42 IDT 2013 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.source=1.6 base-15.09/controlpanel/java/ControlPanelService/AndroidManifest.xml000066400000000000000000000042651262264444500256150ustar00rootroot00000000000000 base-15.09/controlpanel/java/ControlPanelService/build.xml000066400000000000000000000155641262264444500236510ustar00rootroot00000000000000 AllJoyn™ Control Panel Service Version 15.09.00]]> AllJoyn™ Control Panel Service Java API Reference Manual Version 15.09.00
Copyright AllSeen Alliance, Inc. All Rights Reserved.

AllSeen, AllSeen Alliance, and AllJoyn are trademarks of the AllSeen Alliance, Inc in the United States and other jurisdictions.

THIS DOCUMENT AND ALL INFORMATION CONTAIN HEREIN ARE PROVIDED ON AN "AS-IS" BASIS WITHOUT WARRANTY OF ANY KIND.
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
]]>
base-15.09/controlpanel/java/ControlPanelService/ic_launcher-web.png000066400000000000000000000030601262264444500255510ustar00rootroot00000000000000‰PNG  IHDR``múŕotRNSn¦‘ pHYs  šśĐIDATxśí[ßKKIB’Ză5M–5”B@®DZš¶ĐČ­ ÔŢ(jąÚŢ<Ôţ B –˘/•‹6f”\1:n||Őů,u‰ŰźÄ5˘)áNkúľHeÓO[M)i(sĹĽÔ…F …Đi8˘0ˇ÷°C­ť…‘LĆé4˘ÉĐŁ€· €qnąľz¦V ÔL† ?ţřŞx‚–ϡ–ňd¸ €QÜÚYH¸ÓŠ•q3Š[­ČZ8‹´QU‡¬ĺł¨Zžp Řl–µvDš8!ĺIhA ĚÚY€Y>‡rE}ű¸sŇ…Y;`Ëçh™@*Ö΂T@łZ VŁŞuË·B VŁŞ~'°¬ťş†Ť«@ŕŘ%DËŹ@ \kgA°“µN ńFUľ5l<^–ęŠĺHźµłŔZĂZ*V쇺囿,ŐĹ€fH Ö΂J'kN ‘e©>¨Xľ ÔUu€š ÔUu€-_»@˛ËR}€u˛Ú2oí,ŔÖ°z2»Ä°|ŤEhíČZľFt4Şę]ĂęČ|쇔ĺëČkgAj «E äFµ^#­M2‹©¸¸ĺă „¸,%N‰´6I{ű'ßż$N ĺ‹w˛řáXűřyńě·4^6I2ˇ~ßżĆaYšLzŤěn«Cą»EîU•®Bł|dTŐŰĺ3ĹgkSńĉ4L”¬}|Ś4WEĄńňĹ32>ľl¨ĺc \–Ň3Ć{âęŔw C;Y4€Ö>[ 7âlm’ŰeŔ-đŽ@Řu3Ź…cqw+ýĎš„@“w˙ĽBęüŇ(ńđľ¨@„©rěˇXÄ Â%žĐ”Â% ±{n!´ŘfĂ’6Cť «‘0Dއ©iťÍ…¦-…n6W±^CŚÂö+52°ż’Ü iŔřĄIm—Ź §dŃ`Â{˙ Ć–…,J.Ł@„˝<1‡áfVţE;``_¦üň™Đ”Q^_´č剉Ä`(ĺ NAa3Ŕĺ ~Aa3¤2ŠĆ‚Âf–'ě®8ĺ‰é‚ÂfĚVS yô˙u#ú‚b˙÷dş ÖŇ˦IEND®B`‚base-15.09/controlpanel/java/ControlPanelService/project.properties000066400000000000000000000011111262264444500255730ustar00rootroot00000000000000# 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=false base-15.09/controlpanel/java/ControlPanelService/res/000077500000000000000000000000001262264444500226065ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/res/drawable-hdpi/000077500000000000000000000000001262264444500253115ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/res/drawable-hdpi/ic_launcher.png000066400000000000000000000022661262264444500303010ustar00rootroot00000000000000‰PNG  IHDR00Ř`nĐtRNSn¦‘ pHYs  šśVIDATX…ĹŘ˙OgđŹwpx|)0J@ËIgç÷ŮŽ´ŐÚŽZ­q~I§…)ł˛)hĄÖ2uD«d_šn]Ú™&6´I­#kfÚTčKš41áoÚgŻ78îîĐOŢ?qĎ}î%Ü=÷<QJَEEi%´p•˘Ţá›AóO?+ťÎ٤ Ô9வٺůâ>*AŹ}î"’)ÓÚĚb9Mő™úąí»±t"–NÔ´¶Vüň+‘LŻ÷ôŞTEg1z7n”X:ńí?R‡J"™"s⯄¦§·¸7–LŽwOyÖŢ=Ł4ëű;ŮĚô1ÇĂ7(‘LUnnĘŠ˘i齸´÷˘éź÷g “hµ'ţ~A7É”qi3™DŁTÖ9‚ńX%–NDßlá*EöxíŐ« "™˛ż|ĄóůDŃt#«ˇl 瀛ń,ì[ŹłMD2Uµý\ÝÁ|GIeklčöۧą4sŰwQIÎVyö#LĹ˝{xMMšF÷ů[»rQČTź©gobŢŘ`1ÉÔń› ­–brŘ&®°Sbé„w#ĚůWÉl6âő»ÉţĎ®vtÁ0ćť‘őýNÍÚ»gş #' Á;Ś-ţ„ůĽĆ㻉ĄÝS>@•Ęě)€1ňz¦ąŠhiď‘LžÇŁ«éë+.¨Ą÷ ” hĺź›Ĺ㱼4dÉ›š‹ެsÓęŞř /WC…i3™ě/_‰ şýö©Ć +şńq1A®±A!@•ĘŞíçâ€ní>ĘrL¦ů”ş«[PŁűĽp Y–ßď ]{¸"–đÚZA őý“ĂĆ}ťę*ŽAg;ड़cŤ‘  -~ÇŃľĽ Fűa%|ů4śb?C˘×gOĽ@+˙ĆeÇr6–JŔŐ Ëł4T&ľ3Űr Üë-tÁÓ—łeÝÇp}‚B%:W:@!g<Á0[üI~ r3Ę0H_ľa6 =‘i8Ý’ÝFŐ~1?ĐÉłM™‡ńRčl‡č_ •)XÍŮ—;ŘćňŤ˙¶y¬áĚň¦Đ3xÔ*zËR‡Ză˛27Łf#řGQ¨,† í3J¨Ţ†ŮëÜ žĐ×~Ł+…üFě™ńCuyj››t°E8Ý ß‹LˇÇ3ĺeđ~››äpĹ“Ţ"R¨,Ď‚«µDŽ[·3ş&ˇžĂ ĐžTř<Ě ¬ľ“‡ Z ĂŕeDŁfH%péó ˇ™ô2NQYĄVÁpoq)óhŞĺAˇ—Ő\”»{y:Úř,TrÔ§őBçhzŢ?í /…Ž6ˇ3ä”ěVÁz•—g JdśÍŚď|1Ęn…ŕ_Jtz\nž… ŕl†Č4‡Ć7 }‘)ôbyőÎřá¤ý)ô2č˙·€ŚLg,0ލ>qŔŚľč¦[ç[˙Ů´oăźpHIEND®B`‚base-15.09/controlpanel/java/ControlPanelService/res/drawable-ldpi/000077500000000000000000000000001262264444500253155ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/res/drawable-ldpi/ic_launcher.png000066400000000000000000000022661262264444500303050ustar00rootroot00000000000000‰PNG  IHDR00Ř`nĐtRNSn¦‘ pHYs  šśVIDATX…ĹŘ˙OgđŹwpx|)0J@ËIgç÷ŮŽ´ŐÚŽZ­q~I§…)ł˛)hĄÖ2uD«d_šn]Ú™&6´I­#kfÚTčKš41áoÚgŻ78îîĐOŢ?qĎ}î%Ü=÷<QJَEEi%´p•˘Ţá›AóO?+ťÎ٤ Ô9வٺůâ>*AŹ}î"’)ÓÚĚb9Mő™úąí»±t"–NÔ´¶Vüň+‘LŻ÷ôŞTEg1z7n”X:ńí?R‡J"™"s⯄¦§·¸7–LŽwOyÖŢ=Ł4ëű;ŮĚô1ÇĂ7(‘LUnnĘŠ˘i齸´÷˘éź÷g “hµ'ţ~A7É”qi3™DŁTÖ9‚ńX%–NDßlá*EöxíŐ« "™˛ż|ĄóůDŃt#«ˇl 瀛ń,ì[ŹłMD2Uµý\ÝÁ|GIeklčöۧą4sŰwQIÎVyö#LĹ˝{xMMšF÷ů[»rQČTź©gobŢŘ`1ÉÔń› ­–brŘ&®°Sbé„w#ĚůWÉl6âő»ÉţĎ®vtÁ0ćť‘őýNÍÚ»gş #' Á;Ś-ţ„ůĽĆ㻉ĄÝS>@•Ęě)€1ňz¦ąŠhiď‘LžÇŁ«éë+.¨Ą÷ ” hĺź›Ĺ㱼4dÉ›š‹ެsÓęŞř /WC…i3™ě/_‰ şýö©Ć +şńq1A®±A!@•ĘŞíçâ€ní>ĘrL¦ů”ş«[PŁűĽp Y–ßď ]{¸"–đÚZA őý“ĂĆ}ťę*ŽAg;ड़cŤ‘  -~ÇŃľĽ Fűa%|ů4śb?C˘×gOĽ@+˙ĆeÇr6–JŔŐ Ëł4T&ľ3Űr Üë-tÁÓ—łeÝÇp}‚B%:W:@!g<Á0[üI~ r3Ę0H_ľa6 =‘i8Ý’ÝFŐ~1?ĐÉłM™‡ńRčl‡č_ •)XÍŮ—;ŘćňŤ˙¶y¬áĚň¦Đ3xÔ*zËR‡Ză˛27Łf#řGQ¨,† í3J¨Ţ†ŮëÜ žĐ×~Ł+…üFě™ńCuyj››t°E8Ý ß‹LˇÇ3ĺeđ~››äpĹ“Ţ"R¨,Ď‚«µDŽ[·3ş&ˇžĂ ĐžTř<Ě ¬ľ“‡ Z ĂŕeDŁfH%péó ˇ™ô2NQYĄVÁpoq)óhŞĺAˇ—Ő\”»{y:Úř,TrÔ§őBçhzŢ?í /…Ž6ˇ3ä”ěVÁz•—g JdśÍŚď|1Ęn…ŕ_Jtz\nž… ŕl†Č4‡Ć7 }‘)ôbyőÎřá¤ý)ô2č˙·€ŚLg,0ލ>qŔŚľč¦[ç[˙Ů´oăźpHIEND®B`‚base-15.09/controlpanel/java/ControlPanelService/res/drawable-mdpi/000077500000000000000000000000001262264444500253165ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/res/drawable-mdpi/ic_launcher.png000066400000000000000000000022661262264444500303060ustar00rootroot00000000000000‰PNG  IHDR00Ř`nĐtRNSn¦‘ pHYs  šśVIDATX…ĹŘ˙OgđŹwpx|)0J@ËIgç÷ŮŽ´ŐÚŽZ­q~I§…)ł˛)hĄÖ2uD«d_šn]Ú™&6´I­#kfÚTčKš41áoÚgŻ78îîĐOŢ?qĎ}î%Ü=÷<QJَEEi%´p•˘Ţá›AóO?+ťÎ٤ Ô9வٺůâ>*AŹ}î"’)ÓÚĚb9Mő™úąí»±t"–NÔ´¶Vüň+‘LŻ÷ôŞTEg1z7n”X:ńí?R‡J"™"s⯄¦§·¸7–LŽwOyÖŢ=Ł4ëű;ŮĚô1ÇĂ7(‘LUnnĘŠ˘i齸´÷˘éź÷g “hµ'ţ~A7É”qi3™DŁTÖ9‚ńX%–NDßlá*EöxíŐ« "™˛ż|ĄóůDŃt#«ˇl 瀛ń,ì[ŹłMD2Uµý\ÝÁ|GIeklčöۧą4sŰwQIÎVyö#LĹ˝{xMMšF÷ů[»rQČTź©gobŢŘ`1ÉÔń› ­–brŘ&®°Sbé„w#ĚůWÉl6âő»ÉţĎ®vtÁ0ćť‘őýNÍÚ»gş #' Á;Ś-ţ„ůĽĆ㻉ĄÝS>@•Ęě)€1ňz¦ąŠhiď‘LžÇŁ«éë+.¨Ą÷ ” hĺź›Ĺ㱼4dÉ›š‹ެsÓęŞř /WC…i3™ě/_‰ şýö©Ć +şńq1A®±A!@•ĘŞíçâ€ní>ĘrL¦ů”ş«[PŁűĽp Y–ßď ]{¸"–đÚZA őý“ĂĆ}ťę*ŽAg;ड़cŤ‘  -~ÇŃľĽ Fűa%|ů4śb?C˘×gOĽ@+˙ĆeÇr6–JŔŐ Ëł4T&ľ3Űr Üë-tÁÓ—łeÝÇp}‚B%:W:@!g<Á0[üI~ r3Ę0H_ľa6 =‘i8Ý’ÝFŐ~1?ĐÉłM™‡ńRčl‡č_ •)XÍŮ—;ŘćňŤ˙¶y¬áĚň¦Đ3xÔ*zËR‡Ză˛27Łf#řGQ¨,† í3J¨Ţ†ŮëÜ žĐ×~Ł+…üFě™ńCuyj››t°E8Ý ß‹LˇÇ3ĺeđ~››äpĹ“Ţ"R¨,Ď‚«µDŽ[·3ş&ˇžĂ ĐžTř<Ě ¬ľ“‡ Z ĂŕeDŁfH%péó ˇ™ô2NQYĄVÁpoq)óhŞĺAˇ—Ő\”»{y:Úř,TrÔ§őBçhzŢ?í /…Ž6ˇ3ä”ěVÁz•—g JdśÍŚď|1Ęn…ŕ_Jtz\nž… ŕl†Č4‡Ć7 }‘)ôbyőÎřá¤ý)ô2č˙·€ŚLg,0ލ>qŔŚľč¦[ç[˙Ů´oăźpHIEND®B`‚base-15.09/controlpanel/java/ControlPanelService/res/drawable-xhdpi/000077500000000000000000000000001262264444500255015ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/res/drawable-xhdpi/ic_launcher.png000066400000000000000000000030601262264444500304620ustar00rootroot00000000000000‰PNG  IHDR``múŕotRNSn¦‘ pHYs  šśĐIDATxśí[ßKKIB’Ză5M–5”B@®DZš¶ĐČ­ ÔŢ(jąÚŢ<Ôţ B –˘/•‹6f”\1:n||Őů,u‰ŰźÄ5˘)áNkúľHeÓO[M)i(sĹĽÔ…F …Đi8˘0ˇ÷°C­ť…‘LĆé4˘ÉĐŁ€· €qnąľz¦V ÔL† ?ţřŞx‚–ϡ–ňd¸ €QÜÚYH¸ÓŠ•q3Š[­ČZ8‹´QU‡¬ĺł¨Zžp Řl–µvDš8!ĺIhA ĚÚY€Y>‡rE}ű¸sŇ…Y;`Ëçh™@*Ö΂T@łZ VŁŞuË·B VŁŞ~'°¬ťş†Ť«@ŕŘ%DËŹ@ \kgA°“µN ńFUľ5l<^–ęŠĺHźµłŔZĂZ*V쇺囿,ŐĹ€fH Ö΂J'kN ‘e©>¨Xľ ÔUu€š ÔUu€-_»@˛ËR}€u˛Ú2oí,ŔÖ°z2»Ä°|ŤEhíČZľFt4Şę]ĂęČ|쇔ĺëČkgAj «E äFµ^#­M2‹©¸¸ĺă „¸,%N‰´6I{ű'ßż$N ĺ‹w˛řáXűřyńě·4^6I2ˇ~ßżĆaYšLzŤěn«Cą»EîU•®Bł|dTŐŰĺ3ĹgkSńĉ4L”¬}|Ś4WEĄńňĹ32>ľl¨ĺc \–Ň3Ć{âęŔw C;Y4€Ö>[ 7âlm’ŰeŔ-đŽ@Řu3Ź…cqw+ýĎš„@“w˙ĽBęüŇ(ńđľ¨@„©rěˇXÄ Â%žĐ”Â% ±{n!´ŘfĂ’6Cť «‘0Dއ©iťÍ…¦-…n6W±^CŚÂö+52°ż’Ü iŔřĄIm—Ź §dŃ`Â{˙ Ć–…,J.Ł@„˝<1‡áfVţE;``_¦üň™Đ”Q^_´č剉Ä`(ĺ NAa3Ŕĺ ~Aa3¤2ŠĆ‚Âf–'ě®8ĺ‰é‚ÂfĚVS yô˙u#ú‚b˙÷dş ÖŇ˦IEND®B`‚base-15.09/controlpanel/java/ControlPanelService/res/layout/000077500000000000000000000000001262264444500241235ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/res/layout/activity_control_panel.xml000066400000000000000000000024051262264444500314210ustar00rootroot00000000000000 base-15.09/controlpanel/java/ControlPanelService/res/menu/000077500000000000000000000000001262264444500235525ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/res/menu/activity_control_panel.xml000066400000000000000000000023631262264444500310530ustar00rootroot00000000000000 base-15.09/controlpanel/java/ControlPanelService/res/values-v11/000077500000000000000000000000001262264444500245125ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/res/values-v11/styles.xml000066400000000000000000000024771262264444500265710ustar00rootroot00000000000000 base-15.09/controlpanel/java/ControlPanelService/res/values-v14/000077500000000000000000000000001262264444500245155ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/res/values-v14/styles.xml000066400000000000000000000025711262264444500265670ustar00rootroot00000000000000 base-15.09/controlpanel/java/ControlPanelService/res/values/000077500000000000000000000000001262264444500241055ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/res/values/strings.xml000066400000000000000000000023361262264444500263240ustar00rootroot00000000000000 Control Panel Service Hello world! Settings base-15.09/controlpanel/java/ControlPanelService/res/values/styles.xml000066400000000000000000000032531262264444500261550ustar00rootroot00000000000000 base-15.09/controlpanel/java/ControlPanelService/src/000077500000000000000000000000001262264444500226045ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/000077500000000000000000000000001262264444500233735ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/000077500000000000000000000000001262264444500250435ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/bus/000077500000000000000000000000001262264444500256345ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/bus/VariantUtil.java000066400000000000000000000025121262264444500307410ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.bus; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; /** * The temporary utility class to retrieve {@link Variant) signature */ public class VariantUtil { public static String getSignature(Variant aVariant) throws BusException { return MsgArg.getSignature( new long [] {aVariant.getMsgArg()} ); } } base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/000077500000000000000000000000001262264444500256175ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/000077500000000000000000000000001262264444500317005ustar00rootroot00000000000000ControlPanelCollection.java000066400000000000000000000313711262264444500371050ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.alljoyn.bus.BusException; import org.alljoyn.bus.ProxyBusObject; import org.alljoyn.ioe.controlpanelservice.communication.CommunicationUtil; import org.alljoyn.ioe.controlpanelservice.communication.ConnectionManager; import org.alljoyn.ioe.controlpanelservice.communication.IntrospectionNode; import org.alljoyn.ioe.controlpanelservice.communication.UIWidgetSignalHandler; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ControlPanel; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.NotificationAction; import org.alljoyn.ioe.controlpanelservice.ui.ControlPanelEventsListener; import org.alljoyn.ioe.controlpanelservice.ui.DeviceControlPanel; import android.util.Log; /** * ControlPanelCollection represents a family of the {@link DeviceControlPanel} objects per language that belong to the same functional {@link Unit} */ public class ControlPanelCollection { private static final String TAG = "cpan" + ControlPanelCollection.class.getSimpleName(); public class NotificationActionReceiver implements NotificationAction { @Override public short getVersion() throws BusException {return 0;} /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.NotificationAction#Dismiss() */ @Override public void Dismiss() throws BusException { Log.d(TAG, "Received NotificationAction.Dismiss() signal, objPath: '" + objectPath + "', notify ControlPanels"); for (DeviceControlPanel panel : controlPanels.values() ) { ControlPanelEventsListener eventsListener = panel.getEventsListener(); if ( eventsListener != null ) { eventsListener.notificationActionDismiss(panel); } }//for :: controlPanels }//Dismiss } //========================================================// /** * The device */ private ControllableDevice device; /** * The {@link Unit} the collection belongs to */ private Unit unit; /** * The name of the collection */ private String name; /** * The object path that represents the {@link ControlPanelCollection} */ private String objectPath; /** * The mask of the interfaces the object path implements */ private int ifaceMask; /** * The version of the {@link ControlPanel} interface of the remote device */ private Short controlPanelVersion; /** * The version of the {@link NotificationAction} of the remote device */ private Short notificationActionVersion; /** * Signal handler of the {@link NotificationAction} interface */ private UIWidgetSignalHandler notifActSignalHandler; /** * Map from the language tag to the {@link DeviceControlPanel} */ private Map controlPanels; /** * Constructor * @param controllableDevice The {@link ControllableDevice} the collection belongs to * @param unit The {@link Unit} the collection belongs to * @param collName The name of the control panel collection * @param objPath The object path to introspect the control panel collection */ public ControlPanelCollection(ControllableDevice controllableDevice, Unit unit, String collName, String objPath) { this.device = controllableDevice; this.unit = unit; this.name = collName; this.objectPath = objPath; controlPanels = new HashMap(); } /** * @return The {@link ControllableDevice} */ public ControllableDevice getDevice() { return device; } /** * @return The functional {@link Unit} the collection belongs to */ public Unit getUnit() { return unit; } /** * @return The name of the collection */ public String getName() { return name; } /** * @return The {@link ControlPanelCollection} object path */ public String getObjectPath() { return objectPath; } /** * @return The version of the {@link ControlPanel} interface, NULL if failed to be set */ public Short getControlPanelVersion() { return controlPanelVersion; } /** * @return The version of the {@link NotificationAction} interface, may be NULL if failed to be set, or the objectPath doesn't implement * the {@link NotificationAction} interface */ public Short getNotificationActionVersion() { return notificationActionVersion; } /** * @return Collection of {@link DeviceControlPanel} */ public Collection getControlPanels() { return Collections.unmodifiableCollection(controlPanels.values()); }//getControlPanels /** * @return A set of languages of the control panels of this collection */ public Set getLanguages() { return Collections.unmodifiableSet(controlPanels.keySet()); }//getLanguages /** * Cleans the object resources */ public void release() { Log.d(TAG, "Cleaning the ControlPanelCollection: '" + name + "'"); if ( notifActSignalHandler != null ) { try { notifActSignalHandler.unregister(); } catch (ControlPanelException cpe) { Log.d(TAG, "Failed to unregister the NotificationAction signal handler"); } notifActSignalHandler = null; } releaseControlPanels(); }//release /** * Creates and fills this collection with the {@link DeviceControlPanel} objects
* The operation is done by introspection of the remote object * @throws ControlPanelException Is thrown if failed to retrieve the ControlPanel objects */ void retrievePanels() throws ControlPanelException { Log.d(TAG, "Introspecting ControlPanels for objectPath: '" + objectPath + "'"); if ( device.getSessionId() == null ) { throw new ControlPanelException("The session wasn't established, can't introspect ControlPanels"); } try { //Introspect the ControlPanelCollection child nodes IntrospectionNode introNode = new IntrospectionNode(objectPath); introNode.parseOneLevel(ConnectionManager.getInstance().getBusAttachment(), device.getSender(), device.getSessionId()); //Analyze interfaces ifaceMask = CommunicationUtil.getInterfaceMask((String[])introNode.getInterfaces().toArray(new String[0])); //Perform version check checkVersion(); releaseControlPanels(); Log.d(TAG, "Fill the ControlPanelCollection, objectPath: '" + objectPath + "'"); List children = introNode.getChidren(); for ( IntrospectionNode node : children ) { String path = node.getPath(); String segments[] = path.split("/"); //Extract the language tag and replace "_" with "-" to comply the IETF standard String lang = segments[ segments.length - 1 ].replace("_", "-"); Log.v(TAG, "Introspected ControlPanel lang: '" + lang + "', objPath: '" + objectPath + "'"); DeviceControlPanel panel = new DeviceControlPanel(device, unit, this, path, lang); controlPanels.put(lang, panel); }//for :: children } catch(Exception e) { Log.e(TAG, "Failed to introspect the ControlPanels for objectPath: '" + objectPath + "', Error: '" + e.getMessage() + "'"); throw new ControlPanelException("Failed to introspect the ControlPanels"); } }//introspectPanels /** * Checks whether the given objectPath implements the {@link NotificationAction} interface and registers the signal handler * @throws ControlPanelException */ void handleNotificationAction() throws ControlPanelException { if ( !CommunicationUtil.maskIncludes(ifaceMask, NotificationAction.ID_MASK)) { throw new ControlPanelException("The received objectPath: '" + objectPath + "' doesn't implement the NotificationAction protocol"); } if ( notificationActionVersion == null ) { throw new ControlPanelException("Undefined the NotificationAction protocol version"); } Log.d(TAG, "Registering NotificationAction signal handler, objPath: '" + objectPath + "'"); Method method = CommunicationUtil.getNotificationActionDismissSignal("Dismiss"); if ( method == null ) { throw new ControlPanelException("Failed to register the NotificationAction.Dismiss signal, no reflection method was found"); } notifActSignalHandler = new UIWidgetSignalHandler(objectPath, new NotificationActionReceiver(), method, NotificationAction.IFNAME); notifActSignalHandler.register(); }//handleNotificationAction /** * Performs version comparison for ControlPanel and NotificationAction interfaces (if is relevant) * @throws ControlPanelException */ private void checkVersion() throws ControlPanelException { boolean isControlPanel = CommunicationUtil.maskIncludes(ifaceMask, ControlPanel.ID_MASK); boolean isNotifAction = CommunicationUtil.maskIncludes(ifaceMask, NotificationAction.ID_MASK); List> interfaces = new ArrayList>(2); if ( isControlPanel ) { interfaces.add(ControlPanel.class); } if ( isNotifAction ) { interfaces.add(NotificationAction.class); } ProxyBusObject proxyObj = ConnectionManager.getInstance().getProxyObject( device.getSender(), objectPath, device.getSessionId(), (Class[])interfaces.toArray(new Class[0]) ); if ( isControlPanel ) { Log.d(TAG, "The objPath: '" + objectPath + "' implements the ControlPanel interface, performing version check"); try { ControlPanel remoteControl = proxyObj.getInterface(ControlPanel.class); short version = remoteControl.getVersion(); Log.d(TAG, "Version check for ControlPanel interface, my protocol version is: '" + ControlPanel.VERSION + "'" + " the remote device version is: '" + version + "'"); if ( version > ControlPanel.VERSION ) { throw new ControlPanelException("Incompatible ControlPanel version, my protocol version is: '" + ControlPanel.VERSION + "'" + " the remote device version is: '" + version + "'"); } this.controlPanelVersion = version; } catch (BusException be) { throw new ControlPanelException("Failed to call getVersion() for ControlPanel interface, objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"); } }//if :: isControlPanel if ( isNotifAction ) { Log.d(TAG, "The objPath: '" + objectPath + "' implements the NotificationAction interface, performing version check"); try { NotificationAction remoteControl = proxyObj.getInterface(NotificationAction.class); short version = remoteControl.getVersion(); Log.d(TAG, "Version check for NotificationAction interface, my protocol version is: '" + NotificationAction.VERSION + "'" + " the remote device version is: '" + version + "'"); if ( version > NotificationAction.VERSION ) { Log.e(TAG,"Incompatible NotificationAction version, my protocol version is: '" + NotificationAction.VERSION + "'" + " the remote device version is: '" + version + "'"); this.notificationActionVersion = null; } else { this.notificationActionVersion = version; } } catch (BusException be) { Log.e(TAG, "Failed to call getVersion() for NotificationAction interface, objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"); this.notificationActionVersion = null; } }//if :: notifAction }//setRemoteController /** * Cleans the DeviceControlPanel collection */ private void releaseControlPanels() { for (DeviceControlPanel panel : controlPanels.values() ) { panel.release(); } controlPanels.clear(); }//releaseControlPanels } ControlPanelException.java000066400000000000000000000027431262264444500367510ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice; public class ControlPanelException extends Exception { private static final long serialVersionUID = -3845000274158639384L; public ControlPanelException() { super(); } public ControlPanelException(String detailMessage, Throwable throwable) { super(detailMessage, throwable); } public ControlPanelException(String detailMessage) { super(detailMessage); } public ControlPanelException(Throwable throwable) { super(throwable); } } ControlPanelService.java000066400000000000000000000401411262264444500364050ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice; import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.alljoyn.about.AboutKeys; import org.alljoyn.bus.AboutListener; import org.alljoyn.bus.AboutObjectDescription; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Status; import org.alljoyn.bus.Variant; import org.alljoyn.bus.VariantUtil; import org.alljoyn.ioe.controlpanelservice.communication.CommunicationUtil; import org.alljoyn.ioe.controlpanelservice.communication.ConnManagerEventType; import org.alljoyn.ioe.controlpanelservice.communication.ConnManagerEventsListener; import org.alljoyn.ioe.controlpanelservice.communication.ConnectionManager; import org.alljoyn.ioe.controlpanelservice.communication.TaskManager; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ControlPanel; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.HTTPControl; import org.alljoyn.ioe.controlpanelservice.ui.DeviceControlPanel; import org.alljoyn.services.common.utils.TransportUtil; import android.os.Handler; import android.os.Message; import android.util.Log; /** * Provides the main methods for control panel service */ public class ControlPanelService implements ConnManagerEventsListener, AboutListener { private static final String TAG = "cpan" + ControlPanelService.class.getSimpleName(); private static final ControlPanelService SELF = new ControlPanelService(); public static final String INTERFACE_PREFIX = "org.alljoyn.ControlPanel"; private static final String[] ANNOUNCEMENT_IFACES = new String[] { ControlPanel.IFNAME, HTTPControl.IFNAME }; /** * Reference to connection manager object */ private final ConnectionManager connMgr; /** * Listens to changes of the devices in the control panel proximity */ private DeviceRegistry deviceRegistry; /** * Creates instance of the control panel service * * @return {@link ControlPanelService} */ public static ControlPanelService getInstance() { return SELF; }// getInstance /** * Constructor */ private ControlPanelService() { connMgr = ConnectionManager.getInstance(); } /** * Starts {@link ControlPanelService} which discovers controllable devices * in its proximity.
* The ControlPanelService user is informed about the devices in proximity * via the {@link DeviceRegistry} interface.
* The discovery mechanism is implemented by receiving Announcement signals.
* * @param bus * BusAttachment that the service should use * @param deviceRegistry * Holds the information about the devices in proximity
* {@link DefaultDeviceRegistry} may be passed in to receive * information about the devices * @throws ControlPanelException * if failed to initialize the control panel service */ public void init(BusAttachment bus, DeviceRegistry deviceRegistry) throws ControlPanelException { if (deviceRegistry == null) { throw new ControlPanelException("deviceRegistry can't be NULL"); } // Perform the basic service initialization init(bus); this.deviceRegistry = deviceRegistry; Log.d(TAG, "Start listening for Announcement signals"); connMgr.registerEventListener(ConnManagerEventType.ANNOUNCEMENT_RECEIVED, this); // Add announcement handlers connMgr.getBusAttachment().registerAboutListener(this); for (String iface : ANNOUNCEMENT_IFACES) { connMgr.getBusAttachment().whoImplements(new String[] { iface }); } }// init /** * Starts {@link ControlPanelService} without discovering new devices in * proximity * * @param bus */ public void init(BusAttachment bus) throws ControlPanelException { connMgr.setBusAttachment(bus); TaskManager.getInstance().initPool(); }// init /** * @return Returns this device registry, or NULL if not defined */ public DeviceRegistry getDeviceRegistry() { return deviceRegistry; }// getDeviceRegistry /** * Creates object of controllable device.
* The controllable device allows to join session with the remote device and * to receive its {@link DeviceControlPanel} * * @param sender * The unique name of the remote device * @return Created ControllableDevice * @throws ControlPanelException * cpe */ public ControllableDevice getControllableDevice(String sender) throws ControlPanelException { return getControllableDevice(UUID.randomUUID().toString(), sender); }// getControllableDevice /** * Creates object of controllable device.
* The controllable device allows to join session with the remote device and * to receive its {@link DeviceControlPanel} * * @param deviceId * The device unique identifier * @param sender * The unique name of the remote device * @return Created ControllableDevice * @throws ControlPanelException * cpe */ public ControllableDevice getControllableDevice(String deviceId, String sender) throws ControlPanelException { if (sender == null || sender.length() == 0) { throw new ControlPanelException("Received an illegal sender name, Sender: '" + sender + "'"); } Log.i(TAG, "Creating ControllableDevice, Sender: '" + sender + "', DeviceId: '" + deviceId + "'"); return new ControllableDevice(deviceId, sender); }// getControllableDevice /** * Shutdown the {@link ControlPanelService} */ public void shutdown() { Log.d(TAG, "Shutdown ControlPanelService"); for (String iface : ANNOUNCEMENT_IFACES) { connMgr.getBusAttachment().cancelWhoImplements(new String[] { iface }); } connMgr.getBusAttachment().unregisterAboutListener(this); if (deviceRegistry != null) { Log.d(TAG, "Clear devices registry"); for (ControllableDevice device : deviceRegistry.getDevices().values()) { stopControllableDevice(device); } deviceRegistry = null; } TaskManager taskManager = TaskManager.getInstance(); if (taskManager.isRunning()) { taskManager.shutdown(); } connMgr.shutdown(); }// shutdown /** * Stops activities of the passed {@link ControllableDevice} * * @param device * {@link ControllableDevice} to be stopped */ public void stopControllableDevice(ControllableDevice device) { Log.d(TAG, "Stop device: '" + device.getDeviceId() + "' activities"); device.stopDeviceActivities(); }// shutdown /** * Called when received a connection manager event * * @see org.alljoyn.ioe.controlpanelservice.communication.ConnManagerEventsListener#connMgrEventOccured(org.alljoyn.ioe.controlpanelservice.communication.ConnManagerEventType, * java.util.Map) */ @Override public void connMgrEventOccured(ConnManagerEventType eventType, Map args) { Log.d(TAG, "Received event from connection manager, type: '" + eventType + "'"); switch (eventType) { case ANNOUNCEMENT_RECEIVED: { handleAnnouncement(args); break; }// announcement default: break; }// switch }// connMgrEventOccured // ======================================================// /** * Checks whether the received announcement has ControlPanel interface
* If has creates ControllableObject and save it in the registry * * @param args */ private void handleAnnouncement(Map args) { String deviceId = (String) args.get("DEVICE_ID"); String appId = (String) args.get("APP_ID"); String sender = (String) args.get("SENDER"); AboutObjectDescription[] objDescList = (AboutObjectDescription[]) args.get("OBJ_DESC"); if (deviceId == null || deviceId.length() == 0) { Log.e(TAG, "Received a bad Announcement signal, deviceId can't be NULL or empty"); return; } if (sender == null || sender.length() == 0) { Log.e(TAG, "Received a bad Announcement signal, sender can't be NULL or empty"); return; } if (objDescList == null || objDescList.length == 0) { Log.e(TAG, "Received a bad Announcement signal, BusObjectDescription array is empty"); return; } // The controllable device id should be constructed from the deviceId // and the appId deviceId = deviceId + "_" + appId; boolean newDevice = false; // TRUE if it's a not registered new device boolean handledDevice = false; // TRUE if for at least one received // control panel object path we handled // the device ControllableDevice device = deviceRegistry.getDevices().get(deviceId); // Iterate over the BusObjectDescription objects received from an // Announcement signal for (AboutObjectDescription busObjDesc : objDescList) { Log.v(TAG, "Found objPath: '" + busObjDesc.path + "'"); String[] interfaces = busObjDesc.interfaces; int ifaceMask = CommunicationUtil.getInterfaceMask(interfaces); // Check if found a ControlPanel or HTTPControl interfaces if (!CommunicationUtil.maskIncludes(ifaceMask, ControlPanel.ID_MASK) && !CommunicationUtil.maskIncludes(ifaceMask, HTTPControl.ID_MASK)) { continue; } String objPath = busObjDesc.path; Log.d(TAG, "Found ControlPanel object, path: '" + objPath + "'"); if (!handledDevice) { if (device == null) { Log.d(TAG, "Discovered new device, deviceId: '" + deviceId + "', sender: '" + sender + "'"); device = new ControllableDevice(deviceId, sender); device.subscribeOnFoundLostEvents(); // Listen to events of // found | lost adv. // name newDevice = true; }// device == null else { Log.d(TAG, "Device with deviceId: '" + deviceId + "' already exists, updating sender to be: '" + sender + "'"); device.setSender(sender); try { connMgr.cancelFindAdvertisedName(sender); } catch (ControlPanelException cpe) { Log.e(TAG, "Failed to call cancelFindAdvertisedName(), Error: '" + cpe.getMessage() + "'"); return; } }// else :: device == null device.setReachable(true); device.startDeviceFoundVerificationService(); // Start scheduled // service before // call // findAdvName Log.d(TAG, "Start findAdvertisedName for sender: '" + sender + "'"); Status res; try { res = connMgr.findAdvertisedName(sender); } catch (ControlPanelException cpe) { Log.e(TAG, "Failed to call findAdvertisedName(), Error: '" + cpe.getMessage() + "'"); return; } if (res != Status.OK) { Log.d(TAG, "Failed to start findAdvertisedName for sender: '" + sender + "', Error: '" + res + "'"); device.stopDeviceActivities(); return; } // We handled the discovered device for at least one of the // received ControlPanel object paths handledDevice = true; }// if :: not handledDevice try { device.addControlPanel(objPath, ifaceMask); } catch (ControlPanelException cpe) { Log.w(TAG, "Received a broken object path: '" + objPath + "', Error: '" + cpe.getMessage() + "'"); } }// for :: BusObjectDescription if (handledDevice) { if (newDevice) { deviceRegistry.foundNewDevice(device); } else { deviceRegistry.reachabilityChanged(device, true); } } }// handleAnnouncement @Override public void announced(String serviceName, int version, short port, AboutObjectDescription[] objectDescriptions, Map aboutData) { Log.v(TAG, "Received Announcement signal"); Handler handler = ConnectionManager.getInstance().getHandler(); if (handler == null) { return; } UUID appId; String deviceId; try { Variant varAppId = aboutData.get(AboutKeys.ABOUT_APP_ID); String appIdSig = VariantUtil.getSignature(varAppId); if (!appIdSig.equals("ay")) { Log.e(TAG, "Received '" + AboutKeys.ABOUT_APP_ID + "', that has an unexpected signature: '" + appIdSig + "', the expected signature is: 'ay'"); return; } byte[] rawAppId = varAppId.getObject(byte[].class); appId = TransportUtil.byteArrayToUUID(rawAppId); if (appId == null) { Log.e(TAG, "Failed to translate the received AppId into UUID"); return; } Variant varDeviceId = aboutData.get(AboutKeys.ABOUT_DEVICE_ID); String devIdSig = VariantUtil.getSignature(varDeviceId); if (!devIdSig.equals("s")) { Log.e(TAG, "Received '" + AboutKeys.ABOUT_DEVICE_ID + "', that has an unexpected signature: '" + devIdSig + "', the expected signature is: 's'"); return; } deviceId = varDeviceId.getObject(String.class); } catch (BusException be) { Log.e(TAG, "Failed to retreive an Announcement properties, Error: '" + be.getMessage() + "'"); return; } Map args = new HashMap(); args.put("SENDER", serviceName); args.put("DEVICE_ID", deviceId); args.put("APP_ID", appId.toString()); args.put("OBJ_DESC", objectDescriptions); Message.obtain(handler, ConnManagerEventType.ANNOUNCEMENT_RECEIVED.ordinal(), args).sendToTarget(); }// onAnnouncement } ControllableDevice.java000066400000000000000000000462241262264444500362340ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import org.alljoyn.bus.Status; import org.alljoyn.ioe.controlpanelservice.communication.CommunicationUtil; import org.alljoyn.ioe.controlpanelservice.communication.ConnManagerEventType; import org.alljoyn.ioe.controlpanelservice.communication.ConnManagerEventsListener; import org.alljoyn.ioe.controlpanelservice.communication.ConnectionManager; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ControlPanel; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.HTTPControl; import android.util.Log; /** * The class includes the generic information about the controllable device.
*/ public class ControllableDevice implements ConnManagerEventsListener { private static final String TAG = "cpan" + ControllableDevice.class.getSimpleName(); /** * The time window in which this device sender name may be found by AJ foundAdvertisedName
* Time in seconds */ private static final int DEVICE_FOUND_TIME = 45; /** * Connection manager */ private ConnectionManager connMgr; /** * The device registry */ private DeviceRegistry deviceRegistry; /** * The scheduled service executing special task */ private ScheduledExecutorService scheduledService; /** * Device events listener */ private DeviceEventsListener deviceEventsListener; /** * The session id with the remote controllable device * If session isn't established the value is null */ private Integer sessionId; /** * The device unique identifier */ private String deviceId; /** * The unique identifier of the remote device */ private String sender; /** * The Map of functional units belonging to this {@link ControllableDevice}
* The map is from unitId to the {@Link Unit} object */ private Map unitMap; /** * Whether the device is reachable, meaning may be controlled */ private AtomicBoolean isReachable; /** * Constructor * @param deviceId The device unique identifier * @param sender The unique identifier of the remote device */ public ControllableDevice(String deviceId, String sender) { this.deviceId = deviceId; this.sender = sender; this.isReachable = new AtomicBoolean(false); this.unitMap = new HashMap(); this.sessionId = null; this.deviceRegistry = ControlPanelService.getInstance().getDeviceRegistry(); this.connMgr = ConnectionManager.getInstance(); }//Constructor /** * The device unique identifier * @return the deviceId */ public String getDeviceId() { return deviceId; } /** * The controllable device reachability state * @return Whether the remotely controllable device can be reached */ public boolean isReachable() { return isReachable.get(); } /** * @return the sender's BusAttachment unique name */ public String getSender() { return sender; } /** * @return Returns sessionId. If the there is no established session with the remote device, NULL is returned */ public Integer getSessionId() { return sessionId; } /** * @return Device events listener */ public DeviceEventsListener getDeviceEventsListener() { return deviceEventsListener; }//getDeviceEventsListener /** * Starts the session with the remote controllable device * @param eventsListener */ public void startSession(DeviceEventsListener eventsListener) throws ControlPanelException { if ( eventsListener == null ) { throw new ControlPanelException("Events listener can't be NULL"); } deviceEventsListener = eventsListener; if ( sessionId != null ) { String msg = "The device is already in session: '" + deviceId + "', sessionId: '" + sessionId + "'"; Log.d(TAG, msg); deviceEventsListener.sessionEstablished(this, getControlPanelCollections()); return; } connMgr.registerEventListener(ConnManagerEventType.SESSION_JOINED, this); connMgr.registerEventListener(ConnManagerEventType.SESSION_LOST, this); connMgr.registerEventListener(ConnManagerEventType.SESSION_JOIN_FAIL, this); Log.d(TAG, "Device: '" + deviceId + "' starting session with sender: '" + sender + "'"); Status status = connMgr.joinSession(sender, deviceId); if ( status != Status.OK ) { String statusName = status.name(); Log.e(TAG, "Failed to join session: '" + statusName + "'"); deviceEventsListener.errorOccurred(this, statusName); return; } }//startSession /** * End the session with the remote controllable device * @return {@link Status} of endSession execution */ public Status endSession() { Log.i(TAG, "endSession has been called, leaving the session"); if ( sessionId == null ) { Log.w(TAG, "Fail to execute endSession, sessionId is NULL, returning Status of FAIL"); return Status.FAIL; } Status status; try { status = connMgr.leaveSession(sessionId); } catch (ControlPanelException cpe) { Log.e(TAG, "Failed to call leaveSession, Error: '" + cpe.getMessage() + "', returning status of FAIL"); return Status.FAIL; } String logMsg = "endSession return Status is: '" + status + "'"; if ( status == Status.OK ) { sessionId = null; Log.i(TAG, logMsg); // Unregister the session relevant events connMgr.unregisterEventListener(ConnManagerEventType.SESSION_JOINED, this); connMgr.unregisterEventListener(ConnManagerEventType.SESSION_LOST, this); connMgr.unregisterEventListener(ConnManagerEventType.SESSION_JOIN_FAIL, this); } else { Log.w(TAG, logMsg); } return status; }//endSession /** * Receives Connection manager events * @see org.alljoyn.ioe.controlpanelservice.communication.ConnManagerEventsListener#connMgrEventOccured(org.alljoyn.ioe.controlpanelservice.communication.ConnManagerEventType, java.util.Map) */ @Override public void connMgrEventOccured(ConnManagerEventType eventType, Map args) { switch (eventType) { case FOUND_DEVICE: { handleFoundAdvName(args); break; } case LOST_DEVICE: { handleLostAdvName(args); break; } case SESSION_JOINED: { handleSessionJoined(args); break; } case SESSION_JOIN_FAIL: { handleSessionJoinFailed(args); break; } case SESSION_LOST: { handleSessionLost(args); break; } default: break; }//switch }//connMgrEventOccured /** * @return Collection of {@link Unit} that belongs to this device */ public Collection getUnitCollection() { return Collections.unmodifiableCollection(unitMap.values()); }//getUnits /** * Adds a ControlPanel for the given objectPath. * @param objectPath The object path of the added control panel * @param interfaces The interfaces the object path implements * @return {@link Unit} this object path belongs to * @throws ControlPanelException */ public Unit addControlPanel(String objectPath, String... interfaces) throws ControlPanelException { if ( objectPath == null ) { throw new ControlPanelException("The objectPath: '" + objectPath + "' is undefined"); } int ifaceMask = CommunicationUtil.getInterfaceMask(interfaces); if ( !CommunicationUtil.maskIncludes(ifaceMask, ControlPanel.ID_MASK) && !CommunicationUtil.maskIncludes(ifaceMask, HTTPControl.ID_MASK) ) { throw new ControlPanelException("The objectPath: '" + objectPath + "', doesn't implement any ControlPanel permitted interface"); } return addControlPanel(objectPath, ifaceMask); }//addControlPanel /** * Creates a NotificationAction control panel for the given objectPath
* The method should be used after establishment a session with a controllable device * @param objectPath The object path to the created control panel * @return {@link ControlPanelCollection} * @throws ControlPanelException */ public ControlPanelCollection createNotificationAction(String objectPath) throws ControlPanelException { if ( sessionId == null ) { throw new ControlPanelException("The session wasn't established, can't create a ControlPanelCollection"); } if ( objectPath == null ) { throw new ControlPanelException("Received an undefined objectPath"); } Log.i(TAG, "Creating a NotificationAction control panel, objectPath: '" + objectPath + "'"); String[] segments = CommunicationUtil.parseObjPath(objectPath); String unitId = segments[0]; String panelName = segments[1]; Unit unit = new Unit(this, unitId); ControlPanelCollection coll = unit.createControlPanelCollection(objectPath, panelName); coll.retrievePanels(); coll.handleNotificationAction(); return coll; }//addNotificationAction /** * Cleans the {@link ControlPanelCollection} that was created following the invocation of the createNotificationAction() method.
* It's important to call this method after the NotificationAction control panel has been completed * @param panelCollection The {@link ControlPanelCollection} to be cleaned out */ public void removeNotificationAction(ControlPanelCollection panelCollection) { panelCollection.getUnit().release(); }//removeNotificationAction //========================================// /** * @param isReachable the isActive to set */ void setReachable(boolean isReachable) { this.isReachable.set(isReachable); } /** * @param sender the sender to set */ void setSender(String sender) { this.sender = sender; } /** * Subscribe to receive foundAdvName and lostAdvName events of ConnectionManager */ void subscribeOnFoundLostEvents() { Log.d(TAG, "Register on ConnManager to receive events of found and lost advertised name"); connMgr.registerEventListener(ConnManagerEventType.FOUND_DEVICE, this); connMgr.registerEventListener(ConnManagerEventType.LOST_DEVICE, this); }//subscribeOnFoundLostEvents /** * Stops all the device activities
* close session
* stop find adv name
* stop scheduled service
* Set is reachable to false */ void stopDeviceActivities() { isReachable.set(false); try { connMgr.cancelFindAdvertisedName(sender); } catch (ControlPanelException cpe) { Log.e(TAG, "Failed to call cancelFindAdvertisedName(), Error: '" + cpe.getMessage() + "'"); } connMgr.unregisterEventListener(ConnManagerEventType.FOUND_DEVICE, this); connMgr.unregisterEventListener(ConnManagerEventType.LOST_DEVICE, this); Status status = endSession(); if ( status != Status.OK ) { Log.e(TAG, "Failed to end the session, Status: '" + status + "'"); } stopDeviceFoundVerificationService(); for (Unit unit : unitMap.values() ) { unit.release(); } unitMap.clear(); }//stopDeviceActivities /** * Start device found scheduled service */ void startDeviceFoundVerificationService() { Log.d(TAG, "Start DeviceFoundVerificationService for device: '" + deviceId + "', the verification will be done after: " + DEVICE_FOUND_TIME + " seconds"); //If the process started previously -> stop it stopDeviceFoundVerificationService(); scheduledService = Executors.newScheduledThreadPool(1); scheduledService.schedule(new Runnable() { @Override public void run() { Log.d(TAG, "DeviceFoundVerificationService is wake up, set the device: '" + deviceId + "' reachability to 'false'"); isReachable.set(false); deviceRegistry.reachabilityChanged(ControllableDevice.this, false); } }, DEVICE_FOUND_TIME, TimeUnit.SECONDS); }//startDeviceFoundVerification /** * * @param objPath * @param ifaceMask * @throws ControlPanelException */ Unit addControlPanel(String objPath, int ifaceMask) throws ControlPanelException { Log.d(TAG, "Creating ControlPanelCollection object for objPath: '" + objPath + "', device: '" + deviceId + "'"); //parse the received object path String[] segments = CommunicationUtil.parseObjPath(objPath); String unitId = segments[0]; String panelId = segments[1]; Unit unit = unitMap.get(unitId); if ( unit == null ) { Log.v(TAG, "Found new functional unit: '" + unitId + "', panel: '" + panelId + "'"); unit = new Unit(this, unitId); unitMap.put(unitId, unit); // Store the new unit object }else { Log.v(TAG, "Found an existent functional unit: '" + unitId + "', panel: '" + panelId + "'"); } if ( CommunicationUtil.maskIncludes(ifaceMask, HTTPControl.ID_MASK) ) { Log.d(TAG, "The objPath: '" + objPath + "' belongs to the HTTPControl interface, setting"); unit.setHttpControlObjPath(objPath); } else { unit.createControlPanelCollection(objPath, panelId); } return unit; }//createUnit /** * @return Collection of the {@link ControlPanelCollection} of all of the functional units of this device */ private Collection getControlPanelCollections() { List collect = new LinkedList(); for ( Unit unit : unitMap.values() ) { collect.addAll(unit.getControlPanelCollection()); } return collect; }// getControlPanelCollection /** * Stop device found scheduled service */ private void stopDeviceFoundVerificationService() { if ( scheduledService == null ) { return; } Log.d(TAG, "Device: '" + deviceId + "' stops DeviceFoundVerification scheduled service"); scheduledService.shutdownNow(); scheduledService = null; }//stopDeviceFoundVerification /** * If received foundAdvName:
* Stop the scheduled timer.
* If reachable state is false - set it to true and call the registry with reachability state changed * @param args Event handler argument */ private void handleFoundAdvName(Map args){ String foundSender = (String)args.get("SENDER"); Log.v(TAG, "Received foundAdvertisedName of sender: '" + foundSender + "', my sender name is: '" + sender + "'"); if ( foundSender == null || !foundSender.equals(sender) ) { Log.v(TAG, "The received sender: '" + foundSender + "' doesn't belong to this device"); return; } stopDeviceFoundVerificationService(); //Atomically sets the value to the given updated value if the current value == the expected value. //Returns - true if successful. False return indicates that the actual value was not equal to the expected value if ( isReachable.compareAndSet(false, true) ) { boolean newVal = isReachable.get(); Log.d(TAG, "The device: '" + deviceId + "' isReachable set to: '" + newVal + "'"); deviceRegistry.reachabilityChanged(this, newVal); } }//handleFoundAdvName /** * If received lostAdvName:
* Stop the scheduled timer.
* set isReachable to false * @param args @param args Event handler argument */ private void handleLostAdvName(Map args) { String foundSender = (String)args.get("SENDER"); Log.d(TAG, "Received lostAdvertisedName of sender: '" + foundSender + "', my sender name is: '" + sender + "'"); if ( foundSender == null || !foundSender.equals(sender) ) { Log.v(TAG, "Received sender: '" + foundSender + "' doesn't belong to this device"); return; } stopDeviceFoundVerificationService(); //Atomically sets the value to the given updated value if the current value == the expected value. //Returns - true if successful. False return indicates that the actual value was not equal to the expected value if ( isReachable.compareAndSet(true, false) ) { boolean newVal = isReachable.get(); Log.d(TAG, "The device: '" + deviceId + "' isReachable set to: '" + newVal + "'"); deviceRegistry.reachabilityChanged(this, newVal); } }//handleLostAdvName /** * Handle session joined * @param args */ private void handleSessionJoined(Map args) { String deviceId = (String)args.get("DEVICE_ID"); Integer sessionId = (Integer)args.get("SESSION_ID"); Log.i(TAG, "Received SESSION_JOINED event for deviceId: '" + deviceId + "', this deviceId is: '" + this.deviceId + "', sid: '" + sessionId + "'"); if ( deviceId == null || !deviceId.equals(this.deviceId) ) { return; } if ( sessionId == null ) { return; } this.sessionId = sessionId; for (Unit unit : unitMap.values() ) { try { unit.fillControlPanelCollections(); } catch (ControlPanelException cpe) { String error = "Failed to fill the ControlPanelCollection of the unit: '" + unit.getUnitId() + "'"; Log.e(TAG, error); deviceEventsListener.errorOccurred(this, error); } }//for unit deviceEventsListener.sessionEstablished(this, getControlPanelCollections()); }//handleSessionJoined /** * Handle session lost * @param args */ private void handleSessionLost(Map args) { Integer sessionId = (Integer)args.get("SESSION_ID"); Log.w(TAG, "Received SESSION_LOST event for sessionId: '" + sessionId + "', this device sessionId is: '" + this.sessionId + "'"); if ( sessionId == null || !sessionId.equals(this.sessionId) ) { return; } this.sessionId = null; connMgr.unregisterEventListener(ConnManagerEventType.SESSION_JOINED, this); connMgr.unregisterEventListener(ConnManagerEventType.SESSION_LOST, this); connMgr.unregisterEventListener(ConnManagerEventType.SESSION_JOIN_FAIL, this); deviceEventsListener.sessionLost(this); }//handleSessionLost /** * Handle session join failed * @param args */ private void handleSessionJoinFailed(Map args) { String deviceId = (String)args.get("DEVICE_ID"); Object statusObj = args.get("STATUS"); if ( statusObj == null || !(statusObj instanceof Status) ) { return; } String status = ((Status)statusObj).name(); Log.w(TAG, "Received SESSION_JOIN_FAIL event for deviceId: '" + deviceId + "', this deviceId is: '" + this.deviceId + "', Status: '" + status + "'"); if ( deviceId == null || !deviceId.equals(this.deviceId) ) { return; } this.sessionId = null; connMgr.unregisterEventListener(ConnManagerEventType.SESSION_JOINED, this); connMgr.unregisterEventListener(ConnManagerEventType.SESSION_LOST, this); connMgr.unregisterEventListener(ConnManagerEventType.SESSION_JOIN_FAIL, this); deviceEventsListener.errorOccurred(this, status); }//handleSessionJoinedFailed } DefaultDeviceRegistry.java000066400000000000000000000064101262264444500367220ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice; import java.util.Collections; import java.util.HashMap; import java.util.Map; import android.util.Log; /** * The default implementation of the DeviceRegistry interface.
* Inherit this class in order to be notified about changes in the {@link DeviceRegistry}. */ public class DefaultDeviceRegistry implements DeviceRegistry { private static final String TAG = "cpan" + DefaultDeviceRegistry.class.getSimpleName(); /** * The devices that in the proximity and may be controlled */ private Map controllableDevices; /** * Constructor */ public DefaultDeviceRegistry() { controllableDevices = new HashMap(); } /** * Adds the device to the registry * @see org.alljoyn.ioe.controlpanelservice.DeviceRegistry#foundNewDevice(org.alljoyn.ioe.controlpanelservice.ControllableDevice) */ @Override public void foundNewDevice(ControllableDevice device) { controllableDevices.put(device.getDeviceId(), device); Log.d(TAG, "Added device, deviceId: '" + device.getDeviceId() + "'"); } /** * Mark the device as not active * @see org.alljoyn.ioe.controlpanelservice.DeviceRegistry#reachabilityChanged(org.alljoyn.ioe.controlpanelservice.ControllableDevice, boolean) */ @Override public void reachabilityChanged(ControllableDevice device, boolean isReachable) { Log.d(TAG, "ReachabilityChanged for device: '" + device.getDeviceId() + "' the device isReachable: '" + isReachable + "'"); } /** * Removes the device from the registry * @see org.alljoyn.ioe.controlpanelservice.DeviceRegistry#removeDevice(org.alljoyn.ioe.controlpanelservice.ControllableDevice) */ @Override public void removeDevice(ControllableDevice device) { Log.d(TAG, "Remove device called, deviceId: '" + device.getDeviceId() + "', cancelFindAdvertise name and remove the device from the registry"); device.stopDeviceActivities(); controllableDevices.remove(device.getDeviceId()); } /** * Returns the devices list * @see org.alljoyn.ioe.controlpanelservice.DeviceRegistry#getDevices() */ @Override public Map getDevices() { return Collections.unmodifiableMap(controllableDevices); } }//DefaultDeviceRegistry DeviceEventsListener.java000066400000000000000000000041631262264444500365620ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice; import java.util.Collection; import org.alljoyn.ioe.controlpanelservice.ui.DeviceControlPanel; /** * The interface to be implemented in order to receive {@link ControllableDevice} relevant events */ public interface DeviceEventsListener { /** * Notify the interface implementer about session establishment with the remote device * @param device The {@link ControllableDevice} * @param controlPanelContainer Used to request the Root UI Container and a relevant to it information * @see DeviceControlPanel */ public void sessionEstablished(ControllableDevice device, Collection controlPanelContainer); /** * Notify the interface implementer about loosing session with the remote device * @param device The {@link ControllableDevice} where the session has lost */ public void sessionLost(ControllableDevice device); /** * Notify the interface implementer about an error in the device activities * @param device The {@link ControllableDevice} where the error has occurred * @param reason The error reason */ public void errorOccurred(ControllableDevice device, String reason); } DeviceRegistry.java000066400000000000000000000041531262264444500354170ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice; import java.util.Map; /** * Used as a callback interface to inform the interface implementer about new discovered devices * and changes in their reachability state */ public interface DeviceRegistry { /** * Called when a new controllable device was found in the control panel service proximity
* @param device */ public void foundNewDevice(ControllableDevice device); /** * Called when a controllable device left the control panel service proximity
* The method implementation should be thread safe * @param device The controllable device * @param isReachable Whether the device is in reachable state */ public void reachabilityChanged(ControllableDevice device, boolean isReachable); /** * Remove a device from registry
* When a device is removed from the registry it will be inserted back after foundDevice method is called * @param device */ public void removeDevice(ControllableDevice device); /** * @return Returns collection of controllable devices */ public Map getDevices(); } base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/Unit.java000066400000000000000000000203531262264444500334650ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.ProxyBusObject; import org.alljoyn.ioe.controlpanelservice.communication.ConnectionManager; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.HTTPControl; import org.alljoyn.ioe.controlpanelservice.ui.DeviceControlPanel; import android.util.Log; /** * The class represents a functional unit of the controllable device {@link ControllableDevice}
* The unit might has a list of the {@link ControlPanelCollection} */ public class Unit { private static final String TAG = "cpan" + Unit.class.getSimpleName(); /** * The controllable device the unit belongs to */ private ControllableDevice device; /** * The unit id retrieved from the object path */ private String unitId; /** * The object path to HTTPControl Interface */ private String httpControlObjPath; /** * The Map from object path to {@link ControlPanelCollection} */ private Map panelCollections; /** * The HTTPControl proxy bus object */ private ProxyBusObject proxyObj; /** * The remote HTTP control object */ private HTTPControl remoteControl; /** * HTTP Protocol version */ private Short version; /** * Constructor * @param unitId The id of the functional unit */ public Unit(ControllableDevice device, String unitId) { this.device = device; this.unitId = unitId; this.panelCollections = new HashMap(); } /** * @return object path of the HTTPControl Interface, if the object path is defined, otherwise NULL is returned */ public String getHttpIfaceObjPath() { return httpControlObjPath; } /** * Set the HTTP control object path * @param httpControlObjPath */ void setHttpControlObjPath(String httpControlObjPath) { this.httpControlObjPath = httpControlObjPath; } /** * @return Get unit Id */ public String getUnitId() { return unitId; }//getUnitId /** * @return Get {@link ControllableDevice} */ public ControllableDevice getDevice() { return device; }//getDevice /** * @return {@link DeviceControlPanel} collection of this functional unit */ public Collection getControlPanelCollection() { return Collections.unmodifiableCollection(panelCollections.values()); }//getControlPanelList /** * @return The URL of this functional unit or NULL of not defined * @throws ControlPanelException */ public String getRootURL() throws ControlPanelException { if ( httpControlObjPath == null ) { return null; } setRemoteController(); try { return remoteControl.GetRootURL(); } catch (BusException be) { throw new ControlPanelException("Failed to receive the Root URL, Error: '" + be.getMessage() + "'"); } }//getRootURL /** * @return The HTTP Protocol version or NULL if the version is not defined * @throws ControlPanelException if failed to get version */ public Short getHttpControlVersion() throws ControlPanelException { if ( httpControlObjPath == null ) { return null; } setRemoteController(); return version; }//getVersion /** * Release all the object resources */ public void release() { Log.d(TAG, "Cleaning the Unit name: '" + unitId + "'"); if ( proxyObj != null ) { proxyObj.release(); } remoteControl = null; version = null; for (ControlPanelCollection coll : panelCollections.values()) { coll.release(); } panelCollections.clear(); }//release /** * Creates and adds to the {@link Unit} a new {@link ControlPanelCollection}
* If the session with a controllable device is already been established, then the created {@link ControlPanelCollection} * is filled * @param objPath The object path that identifies the {@link ControlPanelCollection} * @param collName The collection name * @throws ControlPanelException Is thrown if failed to create the collection */ ControlPanelCollection createControlPanelCollection(String objPath, String collName) throws ControlPanelException { ControlPanelCollection coll = panelCollections.get(collName); if ( coll == null ) { Log.i(TAG, "Received a new ControlPanelCollection Name: '" + collName + "' objPath: '" + objPath + "', creating..."); coll = new ControlPanelCollection(device, this, collName, objPath); panelCollections.put(collName, coll); } else { Log.d(TAG, "Received a known ControlPanelCollection Name: '" + collName + "' objPath: '" + objPath + "'"); } Integer sessionId = device.getSessionId(); if ( sessionId != null && coll.getControlPanels().size() == 0 ) { Log.d(TAG, "The session with the remote device has been previously established , sid: '" + sessionId + "', filling the new collection"); coll.retrievePanels(); } return coll; }//addControlPanel /** * Fills the {@link ControlPanelCollection} objects of this Unit
* The method invokes {@link ControlPanelCollection#retrievePanels()} for each {@link ControlPanelCollection} * @throws ControlPanelException If failed to fill the ControlPanelCollection */ void fillControlPanelCollections() throws ControlPanelException { for (ControlPanelCollection coll : panelCollections.values() ) { coll.retrievePanels(); } }//fillControlPanelCollections /** * Set the remote controller of the HTTP protocol interface * @throws ControlPanelException */ private void setRemoteController() throws ControlPanelException { //If the proxy bus object is defined and is built with the correct bus name, then no need to execute this method if ( proxyObj != null && device.getSender().equals(proxyObj.getBusName()) ) { return; } //Release the resources of the previously created BusObject if ( proxyObj != null ) { proxyObj.release(); } Integer sessionId = device.getSessionId(); if ( sessionId == null ) { throw new ControlPanelException("Session is not established"); } proxyObj = ConnectionManager.getInstance().getProxyObject( device.getSender(), httpControlObjPath, sessionId, new Class[]{HTTPControl.class} ); remoteControl = proxyObj.getInterface(HTTPControl.class); try { short version = remoteControl.getVersion(); Log.d(TAG, "Version check for HTTP Protocol, my protocol version is: '" + HTTPControl.VERSION + "'" + " the remote device version is: '" + version + "'"); if ( version > HTTPControl.VERSION ) { throw new ControlPanelException("Incompatible HTTPProtocol version, my protocol version is: '" + HTTPControl.VERSION + "'" + " the remote device version is: '" + version + "'"); } this.version = version; } catch (BusException be) { proxyObj = null; remoteControl = null; throw new ControlPanelException("Failed to call getVersion() for HTTPProtocol, objPath: '" + httpControlObjPath + "', Error: '" + be.getMessage() + "'"); } }//setRemoteController } application/000077500000000000000000000000001262264444500341245ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelserviceControlPanelActivity.java000066400000000000000000000031431262264444500411050ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/application/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.application; import org.alljoyn.ioe.controlpanelservice.R; import android.app.Activity; import android.os.Bundle; import android.view.Menu; public class ControlPanelActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_control_panel); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_control_panel, menu); return true; } } ControlPanelApplication.java000066400000000000000000000124721262264444500415610ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/application/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.application; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.BusAttachment.RemoteMessage; import org.alljoyn.bus.SessionOpts; import org.alljoyn.bus.Status; import org.alljoyn.bus.alljoyn.DaemonInit; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; import org.alljoyn.services.android.security.AuthPasswordHandler; import org.alljoyn.services.android.security.SrpAnonymousKeyListener; import org.alljoyn.services.android.utils.AndroidLogger; import android.app.Application; import android.util.Log; public class ControlPanelApplication extends Application implements AuthPasswordHandler { private static final String TAG = "cpan" + ControlPanelApplication.class.getSimpleName(); /** * The daemon should advertise itself "quietly" (directly to the calling * port) This is to reply directly to a TC looking for a daemon */ private static final String DAEMON_NAME = "org.alljoyn.BusNode.IoeService"; /** * The daemon should advertise itself "quietly" (directly to the calling * port) This is to reply directly to a TC looking for a daemon */ private static final String DAEMON_QUIET_PREFIX = "quiet@"; private static final String[] authMechanisms = new String[] { "ALLJOYN_SRP_KEYX", "ALLJOYN_ECDHE_PSK" }; static { System.loadLibrary("alljoyn_java"); } private BusAttachment bus; private ControlPanelService service; @Override public void onCreate() { super.onCreate(); service = ControlPanelService.getInstance(); DaemonInit.PrepareDaemon(this); bus = new BusAttachment("ControlPanel", RemoteMessage.Receive); // bus.setDaemonDebug("ALL", 7); // bus.setLogLevels("ALLJOYN=7"); // bus.setLogLevels("ALL=7"); // bus.useOSLogging(true); Log.d(TAG, "Setting the AuthListener"); SrpAnonymousKeyListener authListener = new SrpAnonymousKeyListener(this, new AndroidLogger(), authMechanisms); Status status = bus.registerAuthListener(authListener.getAuthMechanismsAsString(), authListener, getFileStreamPath("alljoyn_keystore").getAbsolutePath()); if (status != Status.OK) { Log.e(TAG, "Failed to register AuthListener"); } status = bus.connect(); if (status != Status.OK) { Log.e(TAG, "Failed to connect bus attachment, bus: '" + status + "'"); return; } // Advertise the daemon so that the thin client can find it advertiseDaemon(); try { service.init(bus, new ControlPanelTestApp()); } catch (ControlPanelException cpe) { Log.e(TAG, "Failure happened, Error: '" + cpe.getMessage() + "'"); } catch (Exception e) { Log.e(TAG, "Unexpected failure occurred, Error: '" + e.getMessage() + "'"); } }// onCreate /** * @see org.alljoyn.services.android.security.AuthPasswordHandler#completed(java.lang.String, * java.lang.String, boolean) */ @Override public void completed(String mechanism, String authPeer, boolean authenticated) { Log.d(TAG, "The peer: '" + authPeer + "' has been authenticated: '" + authenticated + "', mechanism: '" + mechanism + "'"); } /** * @see org.alljoyn.services.android.security.AuthPasswordHandler#getPassword(java.lang.String) */ @Override public char[] getPassword(String peerName) { return SrpAnonymousKeyListener.DEFAULT_PINCODE; } /** * Advertise the daemon so that the thin client can find it * * @param logger */ private void advertiseDaemon() { // request the name int flag = BusAttachment.ALLJOYN_REQUESTNAME_FLAG_DO_NOT_QUEUE; Status reqStatus = bus.requestName(DAEMON_NAME, flag); if (reqStatus == Status.OK) { // advertise the name with a quite prefix for TC to find it Status adStatus = bus.advertiseName(DAEMON_QUIET_PREFIX + DAEMON_NAME, SessionOpts.TRANSPORT_ANY); if (adStatus != Status.OK) { bus.releaseName(DAEMON_NAME); Log.d(TAG, "failed to advertise daemon name " + DAEMON_NAME); } else { Log.d(TAG, "Succefully advertised daemon name " + DAEMON_NAME); } } } } ControlPanelTestApp.java000066400000000000000000001054471262264444500407030ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/application/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.application; import java.util.Collection; import java.util.EnumMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Random; import org.alljoyn.ioe.controlpanelservice.ControlPanelCollection; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.ControllableDevice; import org.alljoyn.ioe.controlpanelservice.DefaultDeviceRegistry; import org.alljoyn.ioe.controlpanelservice.DeviceEventsListener; import org.alljoyn.ioe.controlpanelservice.Unit; import org.alljoyn.ioe.controlpanelservice.ui.ActionWidget; import org.alljoyn.ioe.controlpanelservice.ui.AlertDialogWidget; import org.alljoyn.ioe.controlpanelservice.ui.AlertDialogWidget.DialogButton; import org.alljoyn.ioe.controlpanelservice.ui.ContainerWidget; import org.alljoyn.ioe.controlpanelservice.ui.ControlPanelEventsListener; import org.alljoyn.ioe.controlpanelservice.ui.DeviceControlPanel; import org.alljoyn.ioe.controlpanelservice.ui.ErrorWidget; import org.alljoyn.ioe.controlpanelservice.ui.LabelWidget; import org.alljoyn.ioe.controlpanelservice.ui.LayoutHintsType; import org.alljoyn.ioe.controlpanelservice.ui.ListPropertyWidget; import org.alljoyn.ioe.controlpanelservice.ui.ListPropertyWidget.Record; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget.ConstrainToValues; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget.Date; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget.RangeConstraint; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget.Time; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget.ValueType; import org.alljoyn.ioe.controlpanelservice.ui.UIElement; import org.alljoyn.ioe.controlpanelservice.ui.UIElementType; import android.annotation.SuppressLint; import android.util.Log; public class ControlPanelTestApp extends DefaultDeviceRegistry implements DeviceEventsListener, ControlPanelEventsListener { private static final String TAG = "cpan" + ControlPanelTestApp.class.getSimpleName(); private Map> uiControls = new EnumMap>(UIElementType.class); private Map> uiControlsList = new EnumMap>(UIElementType.class); /** * Constructor */ public ControlPanelTestApp() { } @Override public void foundNewDevice(ControllableDevice device) { super.foundNewDevice(device); if ( !device.isReachable() ) { Log.d(TAG, "Device isn't reachable"); return; } Log.d(TAG, "FOUND_NEW_DEVICE received, handling"); handleNewDevice(device); }//foundNewDevice @Override public void reachabilityChanged(ControllableDevice device, boolean isReachable) { super.reachabilityChanged(device, isReachable); Log.d(TAG, "Device: '" + device.getDeviceId() + "' got event of 'REACHABILITY_CHANGED' value: '" + isReachable + "'"); if ( isReachable ) { handleNewDevice(device); } }//reachabilityChanged @Override public void removeDevice(ControllableDevice device) { super.removeDevice(device); } private void handleNewDevice(ControllableDevice device) { try { Log.d(TAG, "Device: '" + device.getDeviceId() + "', call to start a session"); device.startSession(this); } catch (ControlPanelException e) { e.printStackTrace(); } }//handleNewDevice //==========================================// @Override public void sessionEstablished(ControllableDevice device, Collection controlPanelCollections) { Log.d(TAG, "Received SESSION_ESTABLISHED, looping over the received control panels"); for(ControlPanelCollection controlPanelCollection : controlPanelCollections) { initCollectionTest(controlPanelCollection); }//for :: control panel collections try { //======== Test the NotificationAction================// Log.d(TAG, "Test the NotificationAction ControlPanel"); ControlPanelCollection notifActColl = device.createNotificationAction("/ControlPanel/MyDevice/areYouSure"); initCollectionTest(notifActColl); Log.d(TAG, "Calling removeNotificationAction()"); notifActColl.getDevice().removeNotificationAction(notifActColl); //======== Test the ControlPanel using addControlPanel ================// /*Log.d(TAG, "Test the ControlPanel using addControlPanel"); //Unit unit = device.addControlPanel("/ControlPanel/MyDevice/rootContainer", "org.alljoyn.ControlPanel.ControlPanel"); Unit unit = device.addControlPanel("/ControlPanel/MyDevice/areYouSure", "org.alljoyn.ControlPanel.ControlPanel"); for ( ControlPanelCollection coll : unit.getControlPanelCollection() ) { initCollectionTest(coll); } */ } catch (ControlPanelException cpe) { Log.e(TAG, "Failed to create the NotificationAction application, Error: '" + cpe. getMessage() + "'"); } }//sessionEstablished @Override public void sessionLost(ControllableDevice device) { Log.d(TAG, "Received SESSION_LOST for device: '" + device.getDeviceId() + "'"); //If we lost session we don't want to store reference to the old UI widgets uiControls.clear(); uiControlsList.clear(); //reconnectSession(device); }//sessionLost @Override public void errorOccurred(ControllableDevice device, String reason) { Log.e(TAG, "Found error: '" + reason + "'"); }//errorOccurred @Override public void errorOccurred(DeviceControlPanel panel, String reason) { Log.e(TAG, "An error occurred in the DeviceControlPanel, name: '" + panel.getObjPath() + "' Panels name: '" + panel.getCollection().getName() + "', Reason: '" + reason + "'"); } @Override public void valueChanged(DeviceControlPanel panel, UIElement uielement, Object newValue) { Log.i(TAG, "VALUE_CHANGED : Received value changed signal, device: '" + panel.getDevice().getDeviceId() + "', ObjPath: '" + uielement.getObjectPath() + "', NewValue: '" + newValue + "'"); } @Override public void metadataChanged(DeviceControlPanel panel, UIElement uielement) { UIElementType elementType = uielement.getElementType(); Log.i(TAG, "METADATA_CHANGED : Received metadata changed signal, device: '" + panel.getDevice().getDeviceId() + "', ObjPath: '" + uielement.getObjectPath() + "', element type: '" + elementType + "'"); switch(elementType) { case CONTAINER: { ContainerWidget container = (ContainerWidget)uielement; Log.i(TAG, "Container metadata IsEnabled: '" + container.isEnabled() + "'"); break; } case ACTION_WIDGET: { ActionWidget action = (ActionWidget)uielement; Log.i(TAG, "Action metadata IsEnabled: '" + action.isEnabled() + "'"); break; } case PROPERTY_WIDGET: { PropertyWidget prop = (PropertyWidget)uielement; Log.i(TAG, "Property metadata IsEnabled: '" + prop.isEnabled() + "'"); break; } case ALERT_DIALOG : { AlertDialogWidget alertDialog = (AlertDialogWidget)uielement; Log.i(TAG, "AlertDialog metadata IsEnabled: '" + alertDialog.isEnabled() + "'"); break; } case LABEL_WIDGET: { LabelWidget labelWidget = (LabelWidget)uielement; Log.i(TAG, "LabelWidget metadata IsEnabled: '" + labelWidget.isEnabled() + "'"); break; } case LIST_PROPERTY_WIDGET: { ListPropertyWidget listWidget = (ListPropertyWidget)uielement; Log.i(TAG, "ListPropertyWidget metadata IsEnabled: '" + listWidget.isEnabled() + "'"); break; } case ERROR_WIDGET: { break; } } }//metadataChanged @Override public void notificationActionDismiss(DeviceControlPanel panel) { Log.i(TAG, "NOTIFICATION_ACTION_DISMISS has been received, dismissing the panel: '" + panel.getObjPath()+ "'"); //Log.d(TAG, "Calling removeNotificationAction()"); //panel.getDevice().removeNotificationAction(panel.getCollection()); } //============================================// private void handleContainer(ContainerWidget container, boolean isFromList) { if ( container == null ) { Log.e(TAG, "The received main container is null"); return; } String fromList = ""; if ( isFromList ) { fromList = "(FROM LIST)"; try { container.refreshProperties(); } catch (ControlPanelException e) { Log.e(TAG, "Failed to update the properties of the ContainerWidget objPath: '" + container.getObjectPath() + "'"); return; } } Log.i(TAG, "===== " + fromList + " CONTAINER profiler ===== "); Log.i(TAG, "Received container, Version: '" + container.getVersion() + "', objPath: '" + container.getObjectPath() + "'" + " label: '" + container.getLabel() + "' bgColor: " + container.getBgColor() + " enabled: " + container.isEnabled()); List layHints = container.getLayoutHints(); if ( layHints == null || layHints.size() == 0 ) { Log.i(TAG, "Not found layout hints"); } Log.i(TAG, "LayoutHints: " + layHints); List elements = container.getElements(); if ( elements.size() == 0 ) { Log.d(TAG, "Not found any nested elements in the container"); return; } Log.i(TAG, "Iterating over the elements: "); for(UIElement element : elements) { UIElementType elementType = element.getElementType(); Log.d(TAG, "Found element of type: '" + elementType + "'"); switch(elementType) { case ACTION_WIDGET: { handleAction((ActionWidget)element, isFromList); addToUiControls(UIElementType.ACTION_WIDGET, element, isFromList); break; }//ACTION_WIDGET case CONTAINER: { handleContainer((ContainerWidget) element, isFromList); addToUiControls(UIElementType.CONTAINER, element, isFromList); break; }// CONTAINER case LIST_PROPERTY_WIDGET: { handlePropertyList((ListPropertyWidget) element, isFromList); addToUiControls(UIElementType.LIST_PROPERTY_WIDGET, element, isFromList); break; }//LIST_PROPERTY_WIDGET case PROPERTY_WIDGET: { handleProperty((PropertyWidget) element, isFromList); addToUiControls(UIElementType.PROPERTY_WIDGET, element, isFromList); break; }//PROPERTY_WIDGET case LABEL_WIDGET: { handleLabel((LabelWidget) element, isFromList); addToUiControls(UIElementType.LABEL_WIDGET, element, isFromList); break; } case ALERT_DIALOG: { handleAlertDialog((AlertDialogWidget) element, isFromList); addToUiControls(UIElementType.ALERT_DIALOG, element, isFromList); break; } case ERROR_WIDGET: { handleErrorWidget((ErrorWidget) element); break; } }//switch :: elementType }//for :: elements addToUiControls(UIElementType.CONTAINER, container, isFromList); }//render private void handleProperty(PropertyWidget property, boolean isFromList) { String fromList = ""; if ( isFromList ) { fromList = "(FROM LIST)"; try { property.refreshProperties(); } catch (ControlPanelException e) { Log.e(TAG, "Failed to update the properties of the PropertyWidget objPath: '" + property.getObjectPath() + "'"); return; } } Log.i(TAG, "===== " + fromList + " PROPERTY profiler ===== "); ValueType valueType = property.getValueType(); Log.i(TAG, "Property of value type: '" + valueType + "', objPath: '" + property.getObjectPath() + "'"); Log.i(TAG, "Property Version: '" + property.getVersion() + "' label: '" + property.getLabel() + "' Writable: '" + property.isWritable() + "' unitOfMeas: '" + property.getUnitOfMeasure() + "', BGcolor: '" + property.getBgColor() + "' PropHints: '" + property.getHints() + "' Enabled: '" + property.isEnabled() + "'"); if ( property.getListOfConstraint() != null ) { Log.i(TAG, "Property List-Of-Constraints: "); for (ConstrainToValues valueCons : property.getListOfConstraint() ) { Log.i(TAG, " lovCons Value: " + valueCons.getValue() + " label: " + valueCons.getLabel()); } }//LOV constraints if ( property.getPropertyRangeConstraint() != null ) { RangeConstraint propRangeCons = property.getPropertyRangeConstraint(); Log.d(TAG, "Property Range Constraint, Min: " + propRangeCons.getMin() + " Max: " + propRangeCons.getMax() + " Increment: " + propRangeCons.getIncrement()); } Log.i(TAG, "===== END OF PROPERTY profiler ===== "); }//handleProperty private void handleAction(ActionWidget actionWidget, boolean isFromList) { String fromList = ""; if ( isFromList ) { fromList = "(FROM LIST)"; try { actionWidget.refreshProperties(); } catch (ControlPanelException e) { Log.e(TAG, "Failed to update the properties of the ActionWidget objPath: '" + actionWidget.getObjectPath() + "'"); return; } } Log.i(TAG, "===== " + fromList + " ACTION profiler ===== "); Log.i(TAG, "ActionWidget: objPath: '" + actionWidget.getObjectPath() + "'"); Log.i(TAG, "Version: '" + actionWidget.getVersion() + "' Enabled: '" + actionWidget.isEnabled() + "'" + " Label: '" + actionWidget.getLabel() + "' BGColor: '" + actionWidget.getBgColor() + "' actionHints: '" + actionWidget.getHints() + "'"); AlertDialogWidget alertDialog = actionWidget.getAlertDialog(); if ( alertDialog != null ) { Log.i(TAG, "The ActionWidget: objPath: '" + actionWidget.getObjectPath() + "' has AlertDialog in the sub tree, handling..."); handleAlertDialog(alertDialog, isFromList); addToUiControls(UIElementType.ALERT_DIALOG, alertDialog, isFromList); } else { Log.i(TAG, "The ActionWidget: objPath: '" + actionWidget.getObjectPath() + "' doesn't have the AlertDialog"); } }//handleAction private void handleAlertDialog(AlertDialogWidget alertDialog, boolean isFromList) { String fromList = ""; if ( isFromList ) { fromList = "(FROM LIST)"; try { alertDialog.refreshProperties(); } catch (ControlPanelException e) { Log.e(TAG, "Failed to update the properties of the AlertDialog objPath: '" + alertDialog.getObjectPath() + "'"); return; } } Log.i(TAG, "===== " + fromList + " ALERT_DIALOG profiler ===== "); Log.i(TAG, "AlertDialog: objPath: '" + alertDialog.getObjectPath() + "'"); Log.i(TAG, "Version: '" + alertDialog.getVersion() + "' Enabled: '" + alertDialog.isEnabled() + "'" + " Message: '" + alertDialog.getMessage() + "' NumActions: '" + alertDialog.getNumActions() + "'" + " Label: '" + alertDialog.getLabel() + "' BGColor: '" + alertDialog.getBgColor() + "' hints: '" + alertDialog.getHints() + "'"); Log.i(TAG, "===== END OF ALERT_DIALOG profiler ===== "); }//handleAlertDialog private void handleLabel(LabelWidget label, boolean isFromList) { String fromList = ""; if ( isFromList ) { fromList = "(FROM LIST)"; try { label.refreshProperties(); } catch (ControlPanelException e) { Log.e(TAG, "Failed to update the properties of the LabelWidget objPath: '" + label.getObjectPath() + "'"); return; } } Log.i(TAG, "==== " + fromList + " LABEL profiler ===== "); Log.i(TAG, "LabelWidget: objPath: '" + label.getObjectPath() + "'"); Log.i(TAG, "Version: '" + label.getVersion() + "' Enabled: '" + label.isEnabled() + "'" + " Label: '" + label.getLabel() + "' BGColor: '" + label.getBgColor() + "', LabelHints: '" + label.getHints() + "'"); Log.i(TAG, "===== END OF LABEL profiler ===== "); }//handleLabel private void handlePropertyList(ListPropertyWidget listProperty, boolean isFromList) { String fromList = ""; if ( isFromList ) { fromList = "(FROM LIST)"; try { listProperty.refreshProperties(); } catch (ControlPanelException e) { Log.e(TAG, "Failed to update the properties of a AlertDialog objPath: '" + listProperty.getObjectPath() + "'"); return; } } Log.i(TAG, "==== " + fromList + " LIST_PROPERTY profiler ===== "); Log.i(TAG, "ListProperty: objPath: '" + listProperty.getObjectPath() + "'"); Log.i(TAG, "Version: '" + listProperty.getVersion() + "' Enabled: '" + listProperty.isEnabled() + "'" + " Label: '" + listProperty.getLabel() + "' BGColor: '" + listProperty.getBgColor() + "', LabelHints: '" + listProperty.getHints() + "'"); Log.i(TAG, "===== END OF LIST_PROPERTY profiler ===== "); }//handlePropertyList private void handleErrorWidget(ErrorWidget errorWidget) { Log.w(TAG, "==== ERROR_WIDGET profiler ===== "); Log.w(TAG, "ErrorWidget: objPath: '" + errorWidget.getObjectPath() + "', failed to be created"); Log.w(TAG, "Default Error Label: '" + errorWidget.getLabel() + "' Error: '" + errorWidget.getError() + "', OriginalUIElement: '" + errorWidget.getOriginalUIElement() + "'"); Log.w(TAG, "===== END OF ERROR_WIDGET profiler ===== "); }//handleErrorWidget //=================================================// // TESTS // //=================================================// /** * @param collection Initialize test of the given collection */ private void initCollectionTest(ControlPanelCollection controlPanelCollection) { Unit unit = controlPanelCollection.getUnit(); try { Log.d(TAG, "Testing the UNIT: '" + unit.getUnitId() + "'"); if ( unit.getHttpIfaceObjPath() != null ) { Log.d(TAG, "The unit: '" + unit.getUnitId() + "' has a control, HTTPProtocol version: '" + unit.getHttpControlVersion() + " URL: '" + unit.getRootURL() + "'"); } } catch (ControlPanelException cpe) { Log.e(TAG, "Failed to read attributes of the UNIT: '" + unit.getUnitId() + "'"); } Log.i(TAG, "Test the ControlPanelCollection name: '" + controlPanelCollection.getName() + "', objPath: '" + controlPanelCollection.getObjectPath() + "' collection languages: '" + controlPanelCollection.getLanguages() + "', ControlPanelVersion: '" + controlPanelCollection.getControlPanelVersion() + "', NotificationActionVersion: '" + controlPanelCollection.getNotificationActionVersion() + "'"); for ( DeviceControlPanel controlPanel : controlPanelCollection.getControlPanels() ) { uiControls.clear(); uiControlsList.clear(); Log.i(TAG, "STARTED TEST OF CONTROL PANEL, objPath: '" + controlPanel.getObjPath() + "', lang: '" + controlPanel.getLanguage() + "'"); try { UIElement rootContainerElement = controlPanel.getRootElement(this); if ( rootContainerElement == null ) { Log.e(TAG, "RootContainerElement wasn't created!!! Can't continue"); return; } UIElementType elementType = rootContainerElement.getElementType(); Log.d(TAG, "Found root container of type: '" + elementType + "'"); if ( elementType == UIElementType.CONTAINER ) { handleContainer((ContainerWidget)rootContainerElement, false); } else if ( elementType == UIElementType.ALERT_DIALOG ) { handleAlertDialog((AlertDialogWidget)rootContainerElement, false); addToUiControls(UIElementType.ALERT_DIALOG, (AlertDialogWidget)rootContainerElement, false); } runTestForUiControls(uiControls); }//try catch(ControlPanelException cpe) { Log.e(TAG, "Failed to access remote methods of control panel, Error: '" + cpe.getMessage() + "'"); continue; } Log.i(TAG, "FINISHED TEST OF THE CONTROL_PANEL: '" + controlPanel.getObjPath() + "'"); }//for :: ControlPanels }//initCollectionTest /** * Adds the tested UI widget to the UI controls list * @param type * @param element */ private void addToUiControls(UIElementType type, UIElement element, boolean isFromList) { List elements = null; if ( !isFromList ) { elements = uiControls.get(type); if ( elements == null ) { elements = new LinkedList(); uiControls.put(type, elements); } } else { elements = uiControlsList.get(type); if ( elements == null ) { elements = new LinkedList(); uiControlsList.put(type, elements); } } elements.add(element); }//addToUiControls /** * Run tests for UI controls */ @SuppressLint("DefaultLocale") private void runTestForUiControls(Map> uiControls) { Log.i(TAG, "==== START CONTROL TESTING ===="); for (UIElementType elementType : uiControls.keySet() ) { String elementTypeStr = elementType.toString().toUpperCase(); Log.d(TAG, "TEST element: '" + elementTypeStr + "'"); switch(elementType) { case CONTAINER: { List elements = uiControls.get(UIElementType.CONTAINER); for (UIElement element : elements) { ContainerWidget container = (ContainerWidget) element; try { Log.i(TAG, elementTypeStr + " - Test container: '" + container.getObjectPath() + "', Version: '" + container.getVersion() + "'"); Log.i(TAG, elementTypeStr + " - Refreshing CONTAINER metadata"); container.refreshProperties(); Log.i(TAG, elementTypeStr + " - The refreshed container ENABLE is: '" + container.isEnabled() + "'"); } catch (ControlPanelException cpe) { Log.e(TAG, "Failed happened in calling remote object: '" + cpe.getMessage() + "'"); } }//for :: elements break; }//CONTAINER case PROPERTY_WIDGET: { List elements = uiControls.get(UIElementType.PROPERTY_WIDGET); for (UIElement element : elements) { PropertyWidget property = (PropertyWidget) element; try { Log.i(TAG, elementTypeStr + " - Test property: '" + property.getObjectPath() + "', Version: '" + property.getVersion() + "'" + " Type: '" + property.getValueType() + "', Current Property Value: '" + property.getCurrentValue() + "'"); Log.i(TAG, elementTypeStr + " - Refreshing PROPERTY"); property.refreshProperties(); Log.i(TAG, elementTypeStr + " - The refreshed property ENABLE is: '" + property.isEnabled() + "'"); Log.i(TAG, elementTypeStr +" - PROPERTY setting new value"); switch( property.getValueType() ) { case BOOLEAN :{ property.setCurrentValue(true); break; } case BYTE: { property.setCurrentValue((byte) 1); break; } case DOUBLE:{ property.setCurrentValue(123.45); break; } case INT: { property.setCurrentValue(123); break; } case LONG:{ property.setCurrentValue(111222323L); break; } case SHORT: { property.setCurrentValue((short)12); break; } case STRING: { property.setCurrentValue("THE NEW PROP VALUE: " + Math.random()); break; } case DATE: { Date dt = new PropertyWidget.Date(); dt.setDay((short)29); dt.setMonth((short)11); dt.setYear((short)1947); property.setCurrentValue(dt); break; }//DATE case TIME: { Time time = new PropertyWidget.Time(); time.setHour((short)23); time.setMinute((short)59); time.setSecond((short)59); property.setCurrentValue(time); }//TIME }//switch Log.i(TAG, elementTypeStr + " - Test property: '" + property.getObjectPath() + "', test NEW PROPERTY VALUE, call: property.getCurrentValue(): '" + property.getCurrentValue() + "'"); } catch (ControlPanelException cpe) { Log.e(TAG, "Failed happened in calling remote object: '" + cpe.getMessage() + "'"); } }//for :: elements break; }//PROPERTY_WIDGET case ACTION_WIDGET: { List elements = uiControls.get(UIElementType.ACTION_WIDGET); for (UIElement element : elements) { ActionWidget action = (ActionWidget)element; try { Log.i(TAG, elementTypeStr + " - Test action: '" + action.getObjectPath() + "', Version: '" + action.getVersion() + "'"); Log.i(TAG, elementTypeStr + " - Refreshing ACTION metadata"); action.refreshProperties(); Log.i(TAG, elementTypeStr + " - The refreshed property ENABLE is: '" + action.isEnabled() + "'"); if ( action.getAlertDialog() == null ) { Log.i(TAG, "AlertDialog is not found in the action, calling Action.exec"); action.exec(); Log.i(TAG, "Action.exec was called successfully"); } else { Log.i(TAG, "The action: '" + action.getObjectPath() + "', has alertDialog, not calling exec"); } } catch (ControlPanelException cpe) { Log.e(TAG, "Failed happened in calling remote object: '" + cpe.getMessage() + "'"); } }//for :: elements break; }//ACTION_WIDGET case ALERT_DIALOG: { List elements = uiControls.get(UIElementType.ALERT_DIALOG); for (UIElement element : elements) { AlertDialogWidget alertDialog = (AlertDialogWidget)element; try { Log.i(TAG, elementTypeStr + " - Test alertDialog: '" + alertDialog.getObjectPath() + "', Version: '" + alertDialog.getVersion() + "'"); Log.i(TAG, elementTypeStr + " - Refreshing AlertDialog"); alertDialog.refreshProperties(); Log.i(TAG, elementTypeStr + " - The refreshed AlertDialog ENABLE is: '" + alertDialog.isEnabled() + "'"); List buttons = alertDialog.getExecButtons(); Log.i(TAG, "The AlertDialog objPath: '" + alertDialog.getObjectPath() + "', has '" + buttons.size() + "' buttons"); for (DialogButton button : buttons) { Log.i(TAG, "Found button '" + button.getLabel() + "', pressing"); button.exec(); } } catch (ControlPanelException cpe) { Log.e(TAG, "Failed happened in calling remote object: '" + cpe.getMessage() + "'"); } }//for :: elements break; }//ALERT_DIALOG case LABEL_WIDGET: { List elements = uiControls.get(UIElementType.LABEL_WIDGET); for (UIElement element : elements) { LabelWidget label = (LabelWidget)element; try { Log.i(TAG, elementTypeStr + " - Test LabelWidget: '" + label.getObjectPath() + "', Version: '" + label.getVersion() + "'"); Log.i(TAG, elementTypeStr + " - Refreshing LABEL_WIDGET"); label.refreshProperties(); Log.i(TAG, elementTypeStr + " - The refreshed property ENABLE is: '" + label.isEnabled() + "'"); } catch (ControlPanelException cpe) { Log.e(TAG, "Failed happened in calling remote object: '" + cpe.getMessage() + "'"); } }//for :: elements break; }//LABEL_WIDGET case LIST_PROPERTY_WIDGET: { List elements = uiControls.get(UIElementType.LIST_PROPERTY_WIDGET); for (UIElement element : elements) { ListPropertyWidget listProperty = (ListPropertyWidget)element; try { testListProperty(listProperty); } catch(ControlPanelException cpe) { Log.e(TAG, "Failed happened in calling remote object: '" + cpe.getMessage() + "'"); } }//for :: elements break; } case ERROR_WIDGET: { break; } }//switch :: elementType }//for::elementType Log.i(TAG, "==== TEST IS COMPLETED ==== "); }//runTestForUiControls /** * Run test for ListPropertyWidget * @param listProps * @throws ControlPanelException */ private void testListProperty(ListPropertyWidget listProps) throws ControlPanelException { Random rand = new Random(); Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - Test ListProperty: '" + listProps.getObjectPath() + "'"); List records = listProps.getValue(); Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - ListProperty record values: '" + records + "'"); Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - **** TEST ADD() ****"); //TEST ADD for(int i=1; i<=2; ++i) { boolean willCancel; if (i == 1) { willCancel = true; } else { willCancel = false; } Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - TEST #" + i + " Call Add() method and then Cancel: '" + willCancel + "'"); ContainerWidget container = listProps.add(); Log.i(TAG, "Handle the new Added form"); uiControlsList.clear(); handleContainer(container, true); runTestForUiControls(uiControlsList); if ( willCancel ) { Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - Call Cancel() method"); listProps.cancel(); } else { Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - Call Confirm() method"); listProps.confirm(); } int sizeBefore = records.size(); records = listProps.getValue(); int sizeAfter = records.size(); // If the Add() operation was confirmed the size should be greater if ( !willCancel && sizeAfter <= sizeBefore ) { Log.e(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - A Possible error has happened, after the Add() operation the sizeAfter: '" + sizeAfter + "', should be greater than the sizeBefore: '" + sizeBefore + "'"); } Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - Check the recordValues: '" + records + "', size before: '" + sizeBefore + "', sizeAfter: '" + sizeAfter + "'"); }//for::Add //================================== END ADD ==============================// Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - **** TEST UPDATE() ****"); //TEST UPDATE for(int i=1; i<=2; ++i) { boolean willCancel; if (i == 1) { willCancel = true; } else { willCancel = false; } Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - TEST #" + i + " Call Update() method and then Cancel: '" + willCancel + "'"); if ( records.size() == 0 ) { Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - No records in the list, adding a form..."); ContainerWidget cont = listProps.add(); uiControlsList.clear(); handleContainer(cont, true); runTestForUiControls(uiControlsList); listProps.confirm(); } records = listProps.getValue(); int size = records.size(); if ( size == 0 ) { Log.e(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - No records were found, previously failed to add a new record"); break; } int index = rand.nextInt(size); Record record = records.get(index); Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - Call Update() method on the record: '" + record + "' and then Cancel: '" + willCancel + "'"); ContainerWidget cont = listProps.update(record.getRecordId()); uiControlsList.clear(); handleContainer(cont, true); runTestForUiControls(uiControlsList); if ( willCancel ) { Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - Call Cancel() method"); listProps.cancel(); } else { Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - Call Confirm() method"); listProps.confirm(); } }//for::Update //================================== END UPDATE ==============================// Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - **** TEST DELETE() ****"); //TEST DELETE for(int i=1; i<=2; ++i) { boolean willCancel; if (i == 1) { willCancel = true; } else { willCancel = false; } Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - TEST #" + i + " Call Delete() method and then Cancel: '" + willCancel + "'"); if ( records.size() == 0 ) { Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - No records in the list, adding a form..."); ContainerWidget cont = listProps.add(); uiControlsList.clear(); handleContainer(cont, true); runTestForUiControls(uiControlsList); listProps.confirm(); } records = listProps.getValue(); int size = records.size(); if ( size == 0 ) { Log.e(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - No records were found, previously failed to add a new record"); break; } int index = rand.nextInt(size); Record record = records.get(index); Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - Call Delete() method on the record: '" + record + "' and then Cancel: '" + willCancel + "'"); listProps.delete(record.getRecordId()); if ( willCancel ) { Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - Call Cancel() method"); listProps.cancel(); } else { Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - Call Confirm() method"); listProps.confirm(); } int sizeBefore = records.size(); records = listProps.getValue(); int sizeAfter = records.size(); // If the Delete() operation was confirmed the size after should be smaller than the size before if ( !willCancel && sizeAfter == sizeBefore ) { Log.e(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - A Possible error has happened, after the Delete() operation the sizeAfter: '" + sizeAfter + "', should be smaller than the sizeBefore: '" + sizeBefore + "'"); } Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - Check the recordValues: '" + records + "', size before: '" + sizeBefore + "', sizeAfter: '" + sizeAfter + "'"); }//for::Delete //================================== END DELETE ==============================// Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - **** TEST VIEW() ****"); //TEST VIEW Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - Call View() method"); if ( records.size() == 0 ) { Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - No records in the list, adding a form..."); ContainerWidget cont = listProps.add(); uiControlsList.clear(); handleContainer(cont, true); runTestForUiControls(uiControlsList); listProps.confirm(); } records = listProps.getValue(); int size = records.size(); if ( size == 0 ) { Log.e(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - No records were found, previously failed to add a new record"); return; } int index = rand.nextInt(size); Record record = records.get(index); Log.i(TAG, UIElementType.LIST_PROPERTY_WIDGET + " - Call View() method on the record: '" + record + "'"); ContainerWidget cont = listProps.view(record.getRecordId()); uiControlsList.clear(); handleContainer(cont, true); runTestForUiControls(uiControlsList); //================================== END VIEW ==============================// }//testListProperty } MyLogger.java000066400000000000000000000031001262264444500365060ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/applicationpackage org.alljoyn.ioe.controlpanelservice.application; /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ /* import org.alljoyn.about.GenericLogger; import android.util.Log; public class MyLogger implements GenericLogger { @Override public void debug(String TAG, String msg) { Log.d(TAG, msg); } @Override public void info(String TAG, String msg) { Log.i(TAG, msg); } @Override public void warn(String TAG, String msg) { Log.w(TAG, msg); } @Override public void error(String TAG, String msg) { Log.e(TAG, msg); } @Override public void fatal(String TAG, String msg) { Log.wtf(TAG, msg); } } */communication/000077500000000000000000000000001262264444500344665ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelserviceAnnouncementReceiver.java000066400000000000000000000076051262264444500414600ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication; import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.alljoyn.about.AboutKeys; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.VariantUtil; import org.alljoyn.services.common.AnnouncementHandler; import org.alljoyn.services.common.BusObjectDescription; import org.alljoyn.services.common.utils.TransportUtil; import android.os.Handler; import android.os.Message; import android.util.Log; /** * Receives announcement signals */ public class AnnouncementReceiver implements AnnouncementHandler { private static final String TAG = "cpan" + AnnouncementReceiver.class.getSimpleName(); /** * @see org.alljoyn.services.common.AnnouncementHandler#onAnnouncement(java.lang.String, short, org.alljoyn.services.common.BusObjectDescription[], java.util.Map) */ @Override public void onAnnouncement(String serviceName, short port, BusObjectDescription[] objectDescriptions, Map aboutData) { Log.v(TAG, "Received Announcement signal"); Handler handler = ConnectionManager.getInstance().getHandler(); if ( handler == null ) { return; } UUID appId; String deviceId; try { Variant varAppId = aboutData.get(AboutKeys.ABOUT_APP_ID); String appIdSig = VariantUtil.getSignature(varAppId); if ( !appIdSig.equals("ay") ) { Log.e(TAG, "Received '" + AboutKeys.ABOUT_APP_ID + "', that has an unexpected signature: '" + appIdSig + "', the expected signature is: 'ay'"); return; } byte[] rawAppId = varAppId.getObject(byte[].class); appId = TransportUtil.byteArrayToUUID(rawAppId); if ( appId == null ) { Log.e(TAG, "Failed to translate the received AppId into UUID"); return; } Variant varDeviceId = aboutData.get(AboutKeys.ABOUT_DEVICE_ID); String devIdSig = VariantUtil.getSignature(varDeviceId); if ( !devIdSig.equals("s") ) { Log.e(TAG, "Received '" + AboutKeys.ABOUT_DEVICE_ID + "', that has an unexpected signature: '" + devIdSig + "', the expected signature is: 's'"); return; } deviceId = varDeviceId.getObject(String.class); } catch (BusException be) { Log.e(TAG, "Failed to retreive an Announcement properties, Error: '" + be.getMessage() + "'"); return; } Map args = new HashMap(); args.put("SENDER", serviceName); args.put("DEVICE_ID", deviceId); args.put("APP_ID", appId.toString()); args.put("OBJ_DESC", objectDescriptions); Message.obtain(handler, ConnManagerEventType.ANNOUNCEMENT_RECEIVED.ordinal(), args).sendToTarget(); }//onAnnouncement /** * @see org.alljoyn.services.common.AnnouncementHandler#onDeviceLost(java.lang.String) */ @Override public void onDeviceLost(String serviceName) {} } CommunicationUtil.java000066400000000000000000000172621262264444500410040ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication; import java.lang.reflect.Method; import org.alljoyn.bus.SessionOpts; import org.alljoyn.bus.Variant; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ActionControlSuper; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.AlertDialogSuper; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ContainerSuper; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ControlPanel; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.HTTPControl; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.Label; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControlSuper; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.NotificationAction; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.PropertyControlSuper; import android.util.Log; /** * Communication utilities class */ public class CommunicationUtil { private static final String TAG = "cpan" + CommunicationUtil.class.getSimpleName(); /** * @return MetadataChanged reflection for container */ public static Method getContainerMetadataChanged(String name) { try { return ContainerSuper.class.getMethod(name); } catch (NoSuchMethodException nsme) { Log.e(TAG, "Not found reflection of " + name + " method"); } return null; }//getContainerMetadataChanged /** * @return MetadataChanged reflection for property metadata changed signal */ public static Method getPropertyMetadataChanged(String name) { try { return PropertyControlSuper.class.getMethod(name); } catch (NoSuchMethodException nsme) { Log.e(TAG, "Not found reflection of " + name + " method"); } return null; }//getContainerMetadataChanged /** * @return MetadataChanged reflection for property value changed signal */ public static Method getPropertyValueChanged(String name) { try { return PropertyControlSuper.class.getMethod(name, Variant.class ); } catch (NoSuchMethodException nsme) { Log.e(TAG, "Not found reflection of " + name + " method"); } return null; }//getContainerMetadataChanged /** * @return MetadataChanged reflection for action metadata changed signal */ public static Method getActionMetadataChanged(String name) { try { return ActionControlSuper.class.getMethod(name); } catch (NoSuchMethodException nsme) { Log.e(TAG, "Not found reflection of " + name + " method"); } return null; }//getContainerMetadataChanged /** * @return reflection for alert dialog metadata changed signal */ public static Method getAlertDialogMetadataChanged(String name) { try { return AlertDialogSuper.class.getMethod(name); } catch (NoSuchMethodException nsme) { Log.e(TAG, "Not found reflection of " + name + " method"); } return null; }//getAlertDialogMetadataChanged /** * @return reflection for label widget metadata changed signal */ public static Method getLabelWidgetMetadataChanged(String name) { try { return Label.class.getMethod(name); } catch (NoSuchMethodException nsme) { Log.e(TAG, "Not found reflection of " + name + " method"); } return null; }//getAlertDialogMetadataChanged /** * @return reflection for {@link ListPropertyControlSuper} signals */ public static Method getListPropertyWidgetSignal(String name) { try { return ListPropertyControlSuper.class.getMethod(name); } catch (NoSuchMethodException nsme) { Log.e(TAG, "Not found reflection of " + name + " method"); } return null; }//getListPropertyWidgetSignal /** * @return reflection for {@link NotificationAction} signal */ public static Method getNotificationActionDismissSignal(String name) { try { return NotificationAction.class.getMethod(name); } catch (NoSuchMethodException nsme) { Log.e(TAG, "Not found reflection of " + name + " method"); } return null; }//getListPropertyWidgetSignal /** * Creates SessionOpts * @return SessionOpts to be used to advertise service and ot join session */ public static SessionOpts getSessionOpts(){ SessionOpts sessionOpts = new SessionOpts(); sessionOpts.traffic = SessionOpts.TRAFFIC_MESSAGES; // Use reliable message-based communication to move data between session endpoints sessionOpts.isMultipoint = false; // A session is multi-point if it can be joined multiple times sessionOpts.proximity = SessionOpts.PROXIMITY_ANY; // Holds the proximity for this SessionOpt sessionOpts.transports = SessionOpts.TRANSPORT_ANY; // Holds the allowed transports for this SessionOpt return sessionOpts; }//getSessionOpts /** * Test the given interfaces list
* If an interface from the given interfaces list is a top level interface then adds it to a resultant mask * @param interfaces The interfaces to test * @return Interfaces resultant mask */ public static int getInterfaceMask(String... interfaces) { int resMask = 0; if ( interfaces == null ) { return resMask; } for (String iface : interfaces) { if ( iface.equals(ControlPanel.IFNAME) ) { resMask |= ControlPanel.ID_MASK; } else if ( iface.equals(HTTPControl.IFNAME) ) { resMask |= HTTPControl.ID_MASK; } else if ( iface.equals(NotificationAction.IFNAME) ) { resMask |= NotificationAction.ID_MASK; } }//for :: interfaces return resMask; }//parseInterfaces /** * Checks whether the given numToTest includes the mask * @param numToTest * @param mask * @return TRUE if includes */ public static boolean maskIncludes(int numToTest, int mask) { return (numToTest & mask) == mask; }//maskIncludes /** * Parses the objectPath of the form of: /ControlPanel/{unitId}/{panelId} * @param objPath The objPath to parse * @return Array(0 => unitId, 1 => panelId) */ public static String[] parseObjPath(String objPath) throws ControlPanelException { String[] segments = objPath.split("/"); int segLength = segments.length; if ( segLength == 0 ) { throw new ControlPanelException("Received a broken object path: '" + objPath + "'"); } String panelId = segments[segLength - 1]; // The name of the control panel String unitId; // The name of the functional unit if ( (segLength - 2) >= 0 ) { unitId = segments[segLength - 2]; } else { unitId = "unknown"; } return new String[]{unitId, panelId}; }//parseObjPath } ConnManagerEventType.java000066400000000000000000000023411262264444500413650ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication; /** * Connection Manager events */ public enum ConnManagerEventType { ANNOUNCEMENT_RECEIVED, SESSION_JOINED, SESSION_JOIN_FAIL, SESSION_LOST, FOUND_DEVICE, LOST_DEVICE, ; } ConnManagerEventsListener.java000066400000000000000000000026461262264444500424240ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication; import java.util.Map; /** * Used to notify observers about the connection manager events */ public interface ConnManagerEventsListener { /** * The method is launched when the event happened in ConnectionManager * @param eventType The type of the event * @param args */ public void connMgrEventOccured(ConnManagerEventType eventType, Map args); } ConnectionManager.java000066400000000000000000000401751262264444500407320ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication; import java.lang.reflect.Method; import java.util.Comparator; import java.util.EnumMap; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentSkipListSet; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.BusListener; import org.alljoyn.bus.OnJoinSessionListener; import org.alljoyn.bus.ProxyBusObject; import org.alljoyn.bus.SessionListener; import org.alljoyn.bus.SessionOpts; import org.alljoyn.bus.Status; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import android.os.Handler; import android.os.HandlerThread; import android.os.Message; import android.util.Log; /** * Performs AJ communication for controller */ public class ConnectionManager implements Handler.Callback { private class ConnMgrBusListener extends BusListener { /** * @see org.alljoyn.bus.BusListener#foundAdvertisedName(java.lang.String, short, java.lang.String) */ @Override public void foundAdvertisedName(String name, short transport, String namePrefix) { if ( bus == null ) { return; } bus.enableConcurrentCallbacks(); Map args = new HashMap(); args.put("SENDER", name); if ( handler != null ) { Message.obtain(handler, ConnManagerEventType.FOUND_DEVICE.ordinal(), args).sendToTarget(); } }//foundAdvertisedName /** * @see org.alljoyn.bus.BusListener#lostAdvertisedName(java.lang.String, short, java.lang.String) */ @Override public void lostAdvertisedName(String name, short transport, String namePrefix) { bus.enableConcurrentCallbacks(); Map args = new HashMap(); args.put("SENDER", name); if ( handler != null ) { Message.obtain(handler, ConnManagerEventType.LOST_DEVICE.ordinal(), args).sendToTarget(); } }//lostAdvertisedName } //===================================================// /** * Events listener of lost session */ private class ConnMgrSessionListener extends SessionListener { @Override public void sessionLost(int sessionId, int reason) { Log.d(TAG, "Received SESSION_LOST for session: '" + sessionId + "', Reason: '" + reason + "'"); Map args = new HashMap(); args.put("SESSION_ID", sessionId); if ( handler != null ) { Message.obtain(handler, ConnManagerEventType.SESSION_LOST.ordinal(), args).sendToTarget(); } }//sessionLost }//ControlPanelSessionListener //=====================================================// /** * OnJoinSession events listener */ private class ConnMgrOnJoinSessionListener extends OnJoinSessionListener { @Override public void onJoinSession(Status status, int sessionId, SessionOpts opts, Object context) { super.onJoinSession(status, sessionId, opts, context); Map args = new HashMap(); args.put("DEVICE_ID", context.toString()); args.put("STATUS", status); if (status != Status.OK) { Log.e(TAG, "JoinSessionCB - Failed to join session, device: '" + context.toString() +"' Status: '" + status + "'"); if ( handler != null ) { Message.obtain(handler, ConnManagerEventType.SESSION_JOIN_FAIL.ordinal(), args).sendToTarget(); } return; } Log.d(TAG, "JoinSessionCB - Succeeded to join session, device: '" + context.toString() +"' SID: '" + sessionId + "'"); args.put("SESSION_ID", sessionId); if ( handler != null ) { Message.obtain(handler, ConnManagerEventType.SESSION_JOINED.ordinal(), args).sendToTarget(); } }//onJoinSession }//ControlPanelOnJoinSessionListener //=====================================================// private class ListenersComparator implements Comparator { @Override public int compare(ConnManagerEventsListener lhs, ConnManagerEventsListener rhs) { if ( lhs.hashCode() > rhs.hashCode() ) { return 1; } if ( lhs.hashCode() < rhs.hashCode() ) { return -1; } else { return 0; } }//compare }//ListenersComparator //=============================================================// // END OF NESTED CLASSES // //=============================================================// private static final String TAG = "cpan" + ConnectionManager.class.getSimpleName(); private static final ConnectionManager SELF = new ConnectionManager(); public static final String ANNOUNCE_SIGNAL_NAME = "Announce"; private static final short PORT_NUMBER = 1000; /** * BusAttachment */ private BusAttachment bus; /** * AJ Session listener object */ private ConnMgrSessionListener sessionListener; /** * AJ On join session listener */ private ConnMgrOnJoinSessionListener onJoinSessionListener; /** * AJ Bus listener */ private ConnMgrBusListener busListener; /** * Announcement receiver */ private AnnouncementReceiver announcementReceiver; /** * Events listeners */ private volatile Map> listenersContainer; /** * Handler thread for the Looper thread */ private HandlerThread handlerThread; /** * Handler */ private Handler handler; /** * Constructor */ private ConnectionManager(){ listenersContainer = new EnumMap>(ConnManagerEventType.class); sessionListener = new ConnMgrSessionListener(); onJoinSessionListener = new ConnMgrOnJoinSessionListener(); busListener = new ConnMgrBusListener(); } /** * @return ConnectionManager instance */ public static ConnectionManager getInstance() { return SELF; } /** * @see android.os.Handler.Callback#handleMessage(android.os.Message) */ @Override public boolean handleMessage(Message msg) { ConnManagerEventType eventType = ConnManagerEventType.values()[msg.what]; Log.d(TAG, "Received message type: '" + eventType + "'"); @SuppressWarnings("unchecked") Map args = (Map)msg.obj; notifyListeners(eventType, args); return true; }//handleMessage /** * Set bus attachment to be used * @param busAttachment */ public void setBusAttachment(BusAttachment busAttachment) throws ControlPanelException { if ( busAttachment == null || !busAttachment.isConnected() ) { throw new ControlPanelException("The received BusAttachment is not connected"); } if ( bus != null ) { throw new ControlPanelException("The BusAttachment already exists"); } if ( handlerThread == null ) { handlerThread = new HandlerThread("ControlPanelConnMgr"); handlerThread.start(); handler = new Handler(handlerThread.getLooper(), this); } bus = busAttachment; bus.registerBusListener(busListener); }//setBusAttachment /** * Returns handler * @return */ public Handler getHandler() { return handler; }//returns handler /** * @return BusAttachement that in use of the ConnectionManager */ public BusAttachment getBusAttachment() { return bus; } /** * @return {@link AnnouncementReceiver} object */ public AnnouncementReceiver getAnnouncementReceiver() { return announcementReceiver; } /** * Add listener to be notified when the event of eventType happened * @param eventType * @param listener The listener object */ public void registerEventListener(ConnManagerEventType eventType, ConnManagerEventsListener listener) { synchronized (listenersContainer) { Set listeners = listenersContainer.get(eventType); if ( listeners == null ) { listeners = new ConcurrentSkipListSet( new ListenersComparator() ); listeners.add(listener); listenersContainer.put(eventType, listeners); } else { listeners.add(listener); }//listener == null }//synch }//registerEventListener /** * Removes the listener from receiving events of type eventType * @param eventType * @param listener */ public void unregisterEventListener (ConnManagerEventType eventType, ConnManagerEventsListener listener) { Set listeners = listenersContainer.get(eventType); if ( listeners == null) { return; } else { listeners.remove(listener); } }//unregisterEventListener /** * Notify the events listeners * @param eventType */ public void notifyListeners(ConnManagerEventType eventType, Map args) { Set listeners = listenersContainer.get(eventType); if ( listeners == null ) { return; } else { // notify listeners for (ConnManagerEventsListener listener : listeners) { listener.connMgrEventOccured(eventType, args); } } }//notify listeners /** * Start find advertised name * @param wellKnownName * @return Status AllJoyn Status * @throws ControlPanelException if failed to execute findAdvertisedName */ public Status findAdvertisedName(String wellKnownName) throws ControlPanelException { if ( bus == null ) { throw new ControlPanelException("The BusAttachment is not defined"); } return bus.findAdvertisedName(wellKnownName); }//findAdvertisedName /** * Cancel findAdvertisedName * @return AllJoyn Status * @throws ControlPanelException If failed to execute cancelFindAdvertisedName */ public Status cancelFindAdvertisedName(String wellKnownName) throws ControlPanelException { if ( bus == null ) { throw new ControlPanelException("The BusAttachment is not defined"); } return bus.cancelFindAdvertisedName(wellKnownName); } /** * Register bus object that is intended to be signal handler * @param ifName Interface name that signal handler object belongs to * @param signalName * @param handlerMethod The reflection of the method that is handling the signal * @param toBeRegistered The object to be registered on the bus and set to be signal handler * @param servicePath The identifier of the object * @param source The object path to receive signals from * @throws ControlPanelException if failed to register signal handler */ public void registerObjectAndSetSignalHandler(String ifName, String signalName, Method handlerMethod, Object toBeRegistered, String objectPath, String source) throws ControlPanelException { Log.d(TAG, "Registering BusObject and setting signal handler, IFName: '" + ifName + ", method: '" + handlerMethod.getName() + "'"); if ( bus == null ) { throw new ControlPanelException("Not initialized BusAttachment"); } Status status; if ( source.length() == 0 ) { Log.d(TAG, "Registering signal handler without source object"); status = bus.registerSignalHandler(ifName, signalName, toBeRegistered, handlerMethod); } else { Log.d(TAG, "Registering signal handler with source object: '" + source + "'"); status = bus.registerSignalHandler(ifName, signalName, toBeRegistered, handlerMethod, source); } if ( status == Status.OK ) { Log.d(TAG, "Signal receiver ifname: '" + ifName + "', signal '" + signalName + "' registered successfully"); } else { Log.e(TAG, "Failed to register signal handler, status: '" + status + "'"); throw new ControlPanelException("Failed to register signal handler"); } status = bus.addMatch("type='signal',interface='" + ifName + "',member='" + signalName + "'"); if ( status != Status.OK ) { Log.e(TAG, "Failed to register addMatch rule for interface: '" + ifName + "',signal: '" + signalName + "', status: '" + status + "'"); throw new ControlPanelException("Failed to register signal handler"); } }//registerObjectAndSetSignalHandler /** * Unregisters the signal handler and the bus object * @param receiverObj * @param handlerMethod * @throws ControlPanelException if failed to register signal handler */ public void unregisterSignalHandler(Object receiverObj, Method handlerMethod) throws ControlPanelException { if ( bus == null ) { throw new ControlPanelException("The BusAttachment is not defined"); } bus.unregisterSignalHandler(receiverObj, handlerMethod); }//unregisterObjectAndSignalHandler /** * Join session with the sender's host * @param sender The host to join the session with * @param deviceId The device Id this join session request belongs to * @return Return status whether the synchronous part of join session succeeded * @throws ControlPanelException if failed to register signal handler */ public Status joinSession(String sender, String deviceId) throws ControlPanelException { if ( bus == null ) { throw new ControlPanelException("The BusAttachment is not defined"); } Status status = bus.joinSession(sender, PORT_NUMBER, getSessionOpts(), sessionListener, onJoinSessionListener, deviceId); return status; }//joinSession /** * @param sessionId Leave session */ public Status leaveSession(int sessionId) throws ControlPanelException { if ( bus == null ) { throw new ControlPanelException("LeaveSession was called, but BusAttachment has not been defined"); } return bus.leaveSession(sessionId); }//leaveSession /** * Creates proxy bus object and returns the desired interface * @param busName * @param objPath * @param sessionId * @param busInterfaces * @param iface The desired interface class * @return * @throws ControlPanelException if failed to register signal handler */ public ProxyBusObject getProxyObject(String busName, String objPath, int sessionId, Class[] busInterfaces) throws ControlPanelException { if ( bus == null ) { throw new ControlPanelException("The BusAttachment is not defined"); } ProxyBusObject proxyObj = bus.getProxyBusObject(busName, objPath, sessionId, busInterfaces); return proxyObj; } /** * Shutdown the connection manager */ public void shutdown() { Log.d(TAG, "Shutdown the ConnectionMgr service"); if ( handlerThread != null ) { handlerThread.getLooper().quit(); handlerThread = null; handler = null; } bus = null; }//shutdown //================= PRIVATE ==================// /** * Creates SessionOpts * @return SessionOpts to be used to advertise service and ot join session */ private SessionOpts getSessionOpts(){ SessionOpts sessionOpts = new SessionOpts(); sessionOpts.traffic = SessionOpts.TRAFFIC_MESSAGES; // Use reliable message-based communication to move data between session endpoints sessionOpts.isMultipoint = false; // A session is multi-point if it can be joined multiple times sessionOpts.proximity = SessionOpts.PROXIMITY_ANY; // Holds the proximity for this SessionOpt sessionOpts.transports = SessionOpts.TRANSPORT_ANY; // Holds the allowed transports for this SessionOpt return sessionOpts; }//getSessionOpts } IntrospectionNode.java000066400000000000000000000225051262264444500410030ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.StringReader; import java.util.LinkedList; import java.util.List; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.BusException; import org.alljoyn.bus.ProxyBusObject; import org.alljoyn.bus.ifaces.Introspectable; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.xml.sax.Attributes; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; import android.util.Log; public class IntrospectionNode { class NoOpEntityResolver implements EntityResolver { public InputSource resolveEntity(String publicId, String systemId) throws SAXException, java.io.IOException { return new InputSource(new ByteArrayInputStream("".getBytes())); } } //=============================================// class IntrospectionParser extends DefaultHandler{ private XMLReader xmlReader = null; private SAXParser saxParser = null; private IntrospectionNode currentNode = null; private boolean sawRootNode = false; public IntrospectionParser() throws IOException, ParserConfigurationException, SAXException { SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(false); saxParser = spf.newSAXParser(); xmlReader = saxParser.getXMLReader(); xmlReader.setContentHandler(this); xmlReader.setEntityResolver(new NoOpEntityResolver()); } public void parse(IntrospectionNode node, String xml) throws SAXException { this.currentNode = node; sawRootNode = false; try{ xmlReader.parse(new InputSource(new StringReader(xml))); }catch(IOException cantReallyHappen) { Log.e("IntrospectionNode", "Failed to read the XML: '" + cantReallyHappen.getMessage() + "', ", cantReallyHappen); } this.currentNode = null; } public void startElement(String namespaceURI, String localName, String qName, Attributes attrs) throws SAXException { if(qName.equals("node")) { if(!sawRootNode) { sawRootNode = true; return; } currentNode.addChild(getNameAttr(attrs)); }else if(qName.equals("interface")){ if(null == currentNode) throw new SAXException("interface not in node"); currentNode.interfaces.add(getNameAttr(attrs)); } } private String getNameAttr(Attributes attrs) throws SAXException { int i = attrs.getIndex("name"); if(-1 == i) throw new SAXException("inner node without a name"); return attrs.getValue(i); } } //================================================// // END OF NESTED CLASSES // //================================================// private boolean parsed = false; private String path = null; private IntrospectionParser parser = null; private List children = new LinkedList(); private List interfaces = new LinkedList(); public IntrospectionNode(String path) throws ParserConfigurationException, IOException, SAXException { this.path = path; this.parser = new IntrospectionParser(); } private IntrospectionNode(String path, IntrospectionParser parser){ this.path = path; this.parser = parser; } protected void addChild(String name) { StringBuilder sb = new StringBuilder(path); if(!name.endsWith("/")) sb.append('/'); sb.append(name); children.add(new IntrospectionNode(sb.toString(), parser)); } public String getPath() { return path; } public boolean isParsed() { return parsed; } public String toString() { StringBuilder sb = new StringBuilder(); sb.append(path); sb.append('\n'); if(!parsed) { sb.append(" Not parsed\n"); return sb.toString(); } for(String ifc : interfaces) { sb.append(' '); sb.append(ifc); sb.append('\n'); } for(IntrospectionNode node : children ) { sb.append(node.toString()); } return sb.toString(); } public void parse(BusAttachment bus, String busName, int sessionId) throws SAXException, ControlPanelException { String xml = getInstrospection(bus, busName, path, sessionId); parse(xml); for (IntrospectionNode childNode : children) { childNode.parse(bus, busName, sessionId); } }//parse public void parseOneLevel(BusAttachment bus, String busName, int sessionId) throws SAXException, ControlPanelException { String xml = getInstrospection(bus, busName, path, sessionId); parse(xml); } public void parse(String xml) throws SAXException { parser.parse(this, xml); parsed = true; }//parse public List getChidren() { return children; } public List getInterfaces() { return interfaces; } /** * Get introspection of the object path * @param bus BusAttachment * @param busName * @param objPath * @param sessionId * @return Introspection XML * @throws ControlPanelException If failed to get the introspection */ public static String getInstrospection(BusAttachment bus, String busName, String objPath, int sessionId) throws ControlPanelException { Log.v("IntrospectionNode", "Introspecting the Object: '" + objPath + "', BusUniqueName: '" + busName + "', sessionId: '" + sessionId + "'"); ProxyBusObject proxyObj = bus.getProxyBusObject(busName, objPath, sessionId, new Class[]{Introspectable.class}); Introspectable introObj = proxyObj.getInterface(Introspectable.class); String introXML; try { introXML = introObj.Introspect(); } catch (BusException be) { throw new ControlPanelException("Failed to get introspection of: '" + objPath + "', Error: '" + be.getMessage() + "'"); } proxyObj.release(); return introXML; }//getIntrospection /* public static void main(String[] args) throws Exception { IntrospectionNode n = new IntrospectionNode("/josh"); n.parse(blob); System.out.println(n.toString()); } static private String blob = " "; */ } TaskManager.java000066400000000000000000000126321262264444500375320ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import android.util.Log; /** * The thread pool manager is used to handle different tasks.
* The tasks can be executed instantly by invoking the {@link TaskManager#execute(Runnable)} method, or * they may be enqueued and executed later, by calling the {@link TaskManager#enqueue(Runnable)} method */ public class TaskManager implements RejectedExecutionHandler { private static final String TAG = "cpan" + TaskManager.class.getSimpleName(); /** * Self reference for singleton */ private static final TaskManager SELF = new TaskManager(); /** * Gets TRUE if the object is valid, which means it has been initialized */ private volatile boolean isValid; /** * The thread TTL time */ private static final long THREAD_TTL = 3; /** * The thread TTL time unit */ private static final TimeUnit TTL_TIME_UNIT = TimeUnit.SECONDS; /** * Amount of the core threads */ private static final int THREAD_CORE_NUM = 4; /** * The maximum number of threads that may be spawn */ private static final int THREAD_MAX_NUM = 10; /** * Thread pool object */ private ThreadPoolExecutor threadPool; /** * The queue of tasks to be handled sequentially */ private ExecutorService taskQueue; /** * Constructor */ private TaskManager() {} /** * @return {@link TaskManager} instance */ public static TaskManager getInstance() { return SELF; } /** * Initializes the thread pool * @param nativePlatform The reference to the platform dependent object */ public void initPool() { Log.d(TAG, "Initializing TaskManager"); initThreadPool(); initTaskQueue(); isValid = true; } /** * @param task Executes the given {@link Runnable} task if there is a free thread worker * @throws IllegalStateException if the object has not been initialized */ public void execute(Runnable task) { checkValid(); Log.d(TAG,"Executing task, Current Thread pool size: '" + threadPool.getPoolSize() + "', 'Number of currently working threads: '" + threadPool.getActiveCount() + "'"); threadPool.execute(task); } /** * Enqueue the given {@link Runnable} task to be executed later * @param task to executed * @throws IllegalStateException if the object has not been initialized */ public void enqueue(Runnable task){ checkValid(); Log.d(TAG, "Enqueueing task to be executed"); taskQueue.execute(task); } /** * @return TRUE if the {@link TaskManager} has been initialized and it is running */ public boolean isRunning() { return isValid; } /** * Tries to stop the thread pool and all its threads * @throws IllegalStateException if the object has not been initialized */ public void shutdown() { Log.d(TAG, "Shutting down TaskManager"); isValid = false; if ( threadPool != null && !threadPool.isShutdown() ) { threadPool.shutdown(); threadPool = null; } if ( taskQueue != null && !taskQueue.isShutdown() ) { taskQueue.shutdown(); taskQueue = null; } } /** * The callback is called, when there are no free threads to execute the given task */ @Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { throw new RejectedExecutionException("Failed to execute the given task, all the worker threads are busy"); } //=================================================// /** * Checks the object validity * @throws IllegalStateException if the object hasn't been initialized */ private void checkValid() { if ( !isValid ){ throw new IllegalStateException("The WorkPoolManager has not been initialized. " + "The initPool mathod should have been invoked"); } } /** * Initialize the threadpool */ private void initThreadPool() { threadPool = new ThreadPoolExecutor( THREAD_CORE_NUM, THREAD_MAX_NUM, THREAD_TTL, TTL_TIME_UNIT, new SynchronousQueue(true) // The fair order FIFO ); threadPool.setRejectedExecutionHandler(this); } /** * Initialize the task queue */ private void initTaskQueue() { taskQueue = Executors.newSingleThreadExecutor(); } } UIWidgetSignalHandler.java000066400000000000000000000137551262264444500414610ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.ui.UIElement; import android.util.Log; /** * The class includes all the required data to register/unregister signals
* Additionally the class has a logic to dispatch the received signals to be handled on the separate thread from AllJoyn */ public class UIWidgetSignalHandler implements InvocationHandler { private static final String TAG = "cpan" + UIWidgetSignalHandler.class.getSimpleName(); /** * MetadataChanged signal refreshes the {@link UIElement} object properties which it was sent for. * This is done by executing {@link org.alljoyn.bus.ifaces.Properties#GetAll(String)} method. * To avoid load on the AJ daemon when it receives multiple METADATA_CHANGED signals, we handle them * sequentially on a separate thread by invoking {@link TaskManager#enqueue(Runnable)}. * All the other signals that are just delegated to an appropriate listener will be simultaneously * handled by a separate thread from the {@link TaskManager} thread pool by invoking {@link TaskManager#execute(Runnable)} */ private static final String METADATA_CHANGED = "MetadataChanged"; /** * The object path that is used as a signal source. */ private String objPath; /** * The real signal handler object */ private Object signalReceiver; /** * The proxy object signal handler is created based on the {@link Proxy} * This is the object that actually receives signals from the daemon and its {@link InvocationHandler} dispatches * the signal to be handled on the separate thread from AllJoyn. * Signal handling logic is executed in the signalReceiver object */ private Object proxySignalReceiver; /** * The reflection of the signal method */ private Method method; /** * The interface of the signal */ private String ifName; /** * Constructor * @param objPath The object path that is used as a signal source. * @param signalReceiver The signal receiver object * @param method The reflection of the signal method * @param ifName The interface of the signal */ public UIWidgetSignalHandler(String objPath, Object signalReceiver, Method method, String ifName) { this.objPath = objPath; this.signalReceiver = signalReceiver; this.method = method; this.ifName = ifName; } /** * Registers signal handler * @throws ControlPanelException */ public void register() throws ControlPanelException { Class[] ifaceList = signalReceiver.getClass().getInterfaces(); if ( ifaceList.length == 0 ) { String msg = "Received signalReceiver object doesn't implement any interface"; Log.e(TAG, msg); throw new ControlPanelException(msg); } proxySignalReceiver = createProxySignalReceiver(ifaceList); ConnectionManager.getInstance().registerObjectAndSetSignalHandler( ifName, method.getName(), method, proxySignalReceiver, objPath, objPath ); }//register /** * Unregisters signal handler * @throws ControlPanelException */ public void unregister() throws ControlPanelException { Log.v(TAG, "Unregistering signal handler: '" + method.getName() + "', objPath: '" + objPath + "'"); ConnectionManager.getInstance().unregisterSignalHandler(proxySignalReceiver, method); signalReceiver = null; proxySignalReceiver = null; }//unregister /** * Create {@link Proxy} object based on the given array of interface classes * @return Created object */ private Object createProxySignalReceiver(Class[] ifaceClassList) { return Proxy.newProxyInstance(ifaceClassList[0].getClassLoader(), ifaceClassList, this); } /** * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) */ @Override public Object invoke(Object proxy, final Method method, final Object[] args) throws Throwable { Runnable task = new Runnable() { @Override public void run() { try { method.invoke(signalReceiver, args); } catch (Exception e) { Log.d(TAG, "Failed to invoke the method: '" + method.getName() + "', Error: '" + e.getMessage() + "'", e); } } }; //Received METADATA_CHANGED signal enqueue it to be executed if ( METADATA_CHANGED.equals(method.getName()) ) { Log.d(TAG, "Received '" + METADATA_CHANGED + "' signal storing it in the queue for later execution"); TaskManager.getInstance().enqueue(task) ; } else { Log.d(TAG, "Received '" + method.getName() + "' signal passing it for execution"); TaskManager.getInstance().execute(task); } return null; }//invoke } interfaces/000077500000000000000000000000001262264444500366115ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communicationActionControl.java000066400000000000000000000045771262264444500422470ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusMethod; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; /** * Action control interface */ @BusInterface (name = ActionControl.IFNAME) public interface ActionControl extends ActionControlSuper { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".Action"; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ @BusProperty(signature="u") public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ @BusProperty(signature="a{qv}") public Map getOptParams() throws BusException; /** * Called when the action is executed on the widget */ @BusMethod public void Exec() throws BusException; /** * Signal is sent when the UI container metadata changed * @param metadata */ @BusSignal public void MetadataChanged() throws BusException; } ActionControlSecured.java000066400000000000000000000047171262264444500435560ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusMethod; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.bus.annotation.Secure; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; /** * Action control secured interface */ @BusInterface (name = ActionControlSecured.IFNAME) @Secure public interface ActionControlSecured extends ActionControlSuper { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".SecuredAction"; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ @BusProperty(signature="u") public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ @BusProperty(signature="a{qv}") public Map getOptParams() throws BusException; /** * Called when the action is executed on the widget */ @BusMethod public void Exec() throws BusException; /** * Signal is sent when the UI container metadata changed * @param metadata */ @BusSignal public void MetadataChanged() throws BusException; } ActionControlSuper.java000066400000000000000000000036061262264444500432560ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; /** * The parent interface of the {@link ActionControl} and {@link ActionControlSecured} interfaces */ public interface ActionControlSuper { /** * @return Interface version */ public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ public Map getOptParams() throws BusException; /** * Called when the action is executed on the widget */ public void Exec() throws BusException; /** * Signal is sent when the UI container metadata changed * @param metadata */ public void MetadataChanged() throws BusException; } AlertDialog.java000066400000000000000000000056121262264444500416470ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusMethod; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; /** * Dialog interface */ @BusInterface (name = AlertDialog.IFNAME) public interface AlertDialog extends AlertDialogSuper { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".Dialog"; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ @BusProperty(signature="u") public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ @BusProperty(signature="a{qv}") public Map getOptParams() throws BusException; /** * @return Returns the dialog message * @throws BusException */ @BusProperty(signature="s") public String getMessage() throws BusException; /** * @return Returns the number of the dialog buttons * @throws BusException */ @BusProperty(signature="q") public short getNumActions() throws BusException; /** * Call the method if is relevant */ @BusMethod public void Action1() throws BusException;; /** * Call the method if is relevant */ @BusMethod public void Action2() throws BusException; /** * Call the method if is relevant */ @BusMethod public void Action3() throws BusException; /** * Signal is sent when the UI container metadata changed * @param metadata */ @BusSignal public void MetadataChanged() throws BusException; } AlertDialogSecured.java000066400000000000000000000057351262264444500431700ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusMethod; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.bus.annotation.Secure; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; /** * Secured dialog interface */ @BusInterface (name = AlertDialogSecured.IFNAME) @Secure public interface AlertDialogSecured extends AlertDialogSuper { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".SecuredDialog"; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ @BusProperty(signature="u") public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ @BusProperty(signature="a{qv}") public Map getOptParams() throws BusException; /** * @return Returns the dialog message * @throws BusException */ @BusProperty(signature="s") public String getMessage() throws BusException; /** * @return Returns the number of the dialog buttons * @throws BusException */ @BusProperty(signature="q") public short getNumActions() throws BusException; /** * Call the method if is relevant */ @BusMethod public void Action1() throws BusException; /** * Call the method if is relevant */ @BusMethod public void Action2() throws BusException; /** * Call the method if is relevant */ @BusMethod public void Action3() throws BusException; /** * Signal is sent when the UI container metadata changed * @param metadata */ @BusSignal public void MetadataChanged() throws BusException; } AlertDialogSuper.java000066400000000000000000000044171262264444500426700ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; /** * Super interface for dialog interfaces */ public interface AlertDialogSuper { /** * @return Interface version */ public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ public Map getOptParams() throws BusException; /** * @return Returns the dialog message * @throws BusException */ public String getMessage() throws BusException; /** * @return Returns the number of the dialog buttons * @throws BusException */ public short getNumActions() throws BusException; /** * Call the method if is relevant */ public void Action1() throws BusException; /** * Call the method if is relevant */ public void Action2() throws BusException; /** * Call the method if is relevant */ public void Action3() throws BusException; /** * Signal is sent when the UI container metadata changed * @param metadata */ public void MetadataChanged() throws BusException; } Container.java000066400000000000000000000043051262264444500414000ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; /** * UIContainer interface */ @BusInterface (name = Container.IFNAME) public interface Container extends ContainerSuper { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".Container"; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ @BusProperty(signature="u") public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ @BusProperty(signature="a{qv}") public Map getOptParams() throws BusException; /** * Signal is sent when the UI container metadata changed * @param metadata */ @BusSignal public void MetadataChanged() throws BusException; } ContainerSecured.java000066400000000000000000000043511262264444500427140ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.bus.annotation.Secure; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; @BusInterface (name = ContainerSecured.IFNAME) @Secure public interface ContainerSecured extends ContainerSuper { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".SecuredContainer"; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ @BusProperty(signature="u") public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ @BusProperty(signature="a{qv}") public Map getOptParams() throws BusException; /** * Signal is sent when the UI container metadata changed * @param metadata */ @BusSignal public void MetadataChanged() throws BusException; } ContainerSuper.java000066400000000000000000000032431262264444500424170ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; public interface ContainerSuper { /** * @return Interface version */ public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ public Map getOptParams() throws BusException; /** * Signal is sent when the UI container metadata changed * @param metadata */ public void MetadataChanged() throws BusException; } ControlPanel.java000066400000000000000000000033121262264444500420530ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import org.alljoyn.bus.BusException; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; /** * This interface indicates whether the object is a control panel */ @BusInterface (name = ControlPanel.IFNAME) public interface ControlPanel { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".ControlPanel"; public static final int ID_MASK = 0x01; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; } HTTPControl.java000066400000000000000000000035471262264444500416050ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import org.alljoyn.bus.BusException; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusMethod; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; /** * HTTPControl interface */ @BusInterface (name = HTTPControl.IFNAME) public interface HTTPControl { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".HTTPControl"; public static final int ID_MASK = 0x02; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; /** * @return Retrieve the URL of the home page * @throws BusException */ @BusMethod public String GetRootURL() throws BusException; } Label.java000066400000000000000000000043741262264444500405030ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; /** * LabelProperty interface */ @BusInterface (name = Label.IFNAME) public interface Label { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".LabelProperty"; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ @BusProperty(signature="u") public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ @BusProperty(signature="a{qv}") public Map getOptParams() throws BusException; /** * @return The label value * @throws BusException */ @BusProperty(signature="s") public String getLabel() throws BusException; /** * Signal is sent when the UI container metadata changed * @param metadata */ @BusSignal public void MetadataChanged() throws BusException; } ListPropertyControl.java000066400000000000000000000076321262264444500435050ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusMethod; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; import org.alljoyn.ioe.controlpanelservice.ui.ajstruct.ListPropertyWidgetRecordAJ; /** * List property interface */ @BusInterface(name = ListPropertyControl.IFNAME) public interface ListPropertyControl extends ListPropertyControlSuper { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".ListProperty"; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ @BusProperty(signature="u") public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ @BusProperty(signature="a{qv}") public Map getOptParams() throws BusException; /** * @return The array of list records * @throws BusException */ @BusProperty(signature="a(qs)") public ListPropertyWidgetRecordAJ[] getValue() throws BusException; /** * Prepare the input form for adding a new record to the list * @throws BusException */ @BusMethod public void Add() throws BusException; /** * Prepare the form for view the record prior to the delete action. * @param recordId * @throws BusException */ @BusMethod(signature = "q") public void Delete(short recordId) throws BusException; /** * Prepare the display form to view the record identified by the recordID. * @param recordId * @throws BusException */ @BusMethod(signature = "q") public void View(short recordId) throws BusException; /** * Prepare the input form to view the record identified by the recordID and allow the end-user to modify the fields. * @param recordId * @throws BusException */ @BusMethod(signature = "q") public void Update(short recordId) throws BusException; /** * Confirm the action and save the change requested * @throws BusException */ @BusMethod public void Confirm() throws BusException; /** * Cancel the current action * @throws BusException */ @BusMethod public void Cancel() throws BusException; /** * The signal is sent when a list property value has changed, i.e. a record was added or removed from the records list * @throws BusException */ @BusSignal public void ValueChanged() throws BusException; /** * The signal is sent when there is a change in the list property metadata * @throws BusException */ @BusSignal public void MetadataChanged() throws BusException; } ListPropertyControlSecured.java000066400000000000000000000076741262264444500450260ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusMethod; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.bus.annotation.Secure; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; import org.alljoyn.ioe.controlpanelservice.ui.ajstruct.ListPropertyWidgetRecordAJ; @BusInterface(name = ListPropertyControlSecured.IFNAME) @Secure public interface ListPropertyControlSecured extends ListPropertyControlSuper { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".SecuredListProperty"; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ @BusProperty(signature="u") public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ @BusProperty(signature="a{qv}") public Map getOptParams() throws BusException; /** * @return The array of list records * @throws BusException */ @BusProperty(signature="a(qs)") public ListPropertyWidgetRecordAJ[] getValue() throws BusException; /** * Prepare the input form for adding a new record to the list * @throws BusException */ @BusMethod public void Add() throws BusException; /** * Prepare the form for view the record prior to the delete action. * @param recordId * @throws BusException */ @BusMethod(signature = "q") public void Delete(short recordId) throws BusException; /** * Prepare the display form to view the record identified by the recordID. * @param recordId * @throws BusException */ @BusMethod(signature = "q") public void View(short recordId) throws BusException; /** * Prepare the input form to view the record identified by the recordID and allow the end-user to modify the fields. * @param recordId * @throws BusException */ @BusMethod(signature = "q") public void Update(short recordId) throws BusException; /** * Confirm the action and save the change requested * @throws BusException */ @BusMethod public void Confirm() throws BusException; /** * Cancel the current action * @throws BusException */ @BusMethod public void Cancel() throws BusException; /** * The signal is sent when a list property value has changed, i.e. a record was added or removed from the records list * @throws BusException */ @BusSignal public void ValueChanged() throws BusException; /** * The signal is sent when there is a change in the list property metadata * @throws BusException */ @BusSignal public void MetadataChanged() throws BusException; } ListPropertyControlSuper.java000066400000000000000000000062601262264444500445200ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.ioe.controlpanelservice.ui.ajstruct.ListPropertyWidgetRecordAJ; /** * List property super interface */ public interface ListPropertyControlSuper { /** * @return Interface version */ public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ public Map getOptParams() throws BusException; /** * @return The array of list records * @throws BusException */ public ListPropertyWidgetRecordAJ[] getValue() throws BusException; /** * Prepare the input form for adding a new record to the list * @throws BusException */ public void Add() throws BusException; /** * Prepare the form for view the record prior to the delete action. * @param recordId * @throws BusException */ public void Delete(short recordId) throws BusException; /** * Prepare the display form to view the record identified by the recordID. * @param recordId * @throws BusException */ public void View(short recordId) throws BusException; /** * Prepare the input form to view the record identified by the recordID and allow the end-user to modify the fields. * @param recordId * @throws BusException */ public void Update(short recordId) throws BusException; /** * Confirm the action and save the change requested * @throws BusException */ public void Confirm() throws BusException; /** * Cancel the current action * @throws BusException */ public void Cancel() throws BusException; /** * The signal is sent when a list property value has changed, i.e. a record was added or removed from the records list * @throws BusException */ public void ValueChanged() throws BusException; /** * The signal is sent when there is a change in the list property metadata * @throws BusException */ public void MetadataChanged() throws BusException; } NotificationAction.java000066400000000000000000000036451262264444500432500ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import org.alljoyn.bus.BusException; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; /** * This interface indicates whether the object is a notification action object */ @BusInterface (name = NotificationAction.IFNAME) public interface NotificationAction { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".NotificationAction"; public static final int ID_MASK = 0x04; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; /** * The controller needs to dismiss this NotificationAction panel */ @BusSignal public void Dismiss() throws BusException; } PropertyControl.java000066400000000000000000000052771262264444500426540ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; /** * Property control interface */ @BusInterface (name = PropertyControl.IFNAME) public interface PropertyControl extends PropertyControlSuper { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".Property"; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ @BusProperty(signature="u") public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ @BusProperty(signature="a{qv}") public Map getOptParams() throws BusException; /** * @return Returns the property current value */ @BusProperty(signature="v") public Variant getValue() throws BusException; /** * @param value The property value */ @BusProperty(signature="v") public void setValue(Variant value) throws BusException; /** * Signal is sent when the property value changed * @param newValue The new property value */ @BusSignal(signature="v") public void ValueChanged(Variant newValue) throws BusException; /** * Signal is sent when the property metadata changed * @param metadata */ @BusSignal public void MetadataChanged() throws BusException; } PropertyControlSecured.java000066400000000000000000000054241262264444500441610ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.bus.annotation.Secure; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; /** * Property control secured interface */ @BusInterface (name = PropertyControlSecured.IFNAME) @Secure public interface PropertyControlSecured extends PropertyControlSuper { public static final String IFNAME = ControlPanelService.INTERFACE_PREFIX + ".SecuredProperty"; public static final short VERSION = 1; /** * @return Interface version */ @BusProperty(signature="q") public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ @BusProperty(signature="u") public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ @BusProperty(signature="a{qv}") public Map getOptParams() throws BusException; /** * @return Returns the property current value */ @BusProperty(signature="v") public Variant getValue() throws BusException; /** * @param value The property value */ @BusProperty(signature="v") public void setValue(Variant value) throws BusException; /** * Signal is sent when the property value changed * @param newValue The new property value */ @BusSignal(signature="v") public void ValueChanged(Variant newValue) throws BusException; /** * Signal is sent when the property metadata changed * @param metadata */ @BusSignal public void MetadataChanged() throws BusException; } PropertyControlSuper.java000066400000000000000000000042431262264444500436630ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/communication/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.communication.interfaces; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; /** * The parent interface of the {@link PropertyControl} and {@link PropertyControlSecured} interfaces */ public interface PropertyControlSuper { /** * @return Interface version */ public short getVersion() throws BusException; /** * @return States bitmask * @throws BusException */ public int getStates() throws BusException; /** * @return Optional parameters * @throws BusException */ public Map getOptParams() throws BusException; /** * @return Returns the property current value */ public Variant getValue() throws BusException; /** * @param value The property value */ public void setValue(Variant value) throws BusException; /** * Signal is sent when the property value changed * @param newValue The new property value */ public void ValueChanged(Variant newValue) throws BusException; /** * Signal is sent when the property metadata changed * @param metadata */ public void MetadataChanged() throws BusException; } package-info.java000066400000000000000000000041061262264444500350110ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ /** * The package includes classes that allow to start the control panel service {@link org.alljoyn.ioe.controlpanelservice.ControlPanelService}, * and manage the list of controllable devices {@link org.alljoyn.ioe.controlpanelservice.ControllableDevice}.
* The list of controllable devices is managed by the {@link org.alljoyn.ioe.controlpanelservice.DeviceRegistry} interface * and its default implementation {@link org.alljoyn.ioe.controlpanelservice.DefaultDeviceRegistry}
* For each controllable device there is a list of the device control panels {@link org.alljoyn.ioe.controlpanelservice.ui.DeviceControlPanel} * that is passed to the user when {@link org.alljoyn.ioe.controlpanelservice.ControllableDevice#startSession(DeviceEventsListener)} * is called. By using the {@link org.alljoyn.ioe.controlpanelservice.ui.DeviceControlPanel} a user may call * {@link org.alljoyn.ioe.controlpanelservice.ui.DeviceControlPanel#getRootElement(org.alljoyn.ioe.controlpanelservice.ui.ControlPanelEventsListener)} to retrieve the root * UI container */ package org.alljoyn.ioe.controlpanelservice; base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/000077500000000000000000000000001262264444500323155ustar00rootroot00000000000000ActionWidget.java000066400000000000000000000254041262264444500354670ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.ProxyBusObject; import org.alljoyn.bus.Variant; import org.alljoyn.bus.VariantTypeReference; import org.alljoyn.bus.ifaces.Properties; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; import org.alljoyn.ioe.controlpanelservice.communication.CommunicationUtil; import org.alljoyn.ioe.controlpanelservice.communication.ConnectionManager; import org.alljoyn.ioe.controlpanelservice.communication.IntrospectionNode; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ActionControlSuper; import android.util.Log; /** * Action widget */ public class ActionWidget extends UIElement { private static final String TAG = "cpan" + ActionWidget.class.getSimpleName(); private static final int ENABLED_MASK = 0x01; /** * The remote action object */ private ActionControlSuper remoteControl; /** * Action label
* Not required to be sets */ private String label; /** * Action bgcolor
* Not required to be sets */ private Integer bgColor; /** * Whether the action is enabled
* Not required to be sets */ private boolean enabled; /** * The widget rendering hints
* Not required to be sets */ private List hints; /** * The alert dialog that should be presented. * In this case use of Exec button is illegal */ private AlertDialogWidget alertDialog; /** * Constructor * @param ifName * @param objectPath * @param controlPanel * @param children * @throws ControlPanelException */ public ActionWidget(String ifName, String objectPath, DeviceControlPanel controlPanel, List children) throws ControlPanelException { super(UIElementType.ACTION_WIDGET, ifName, objectPath, controlPanel, children); } public String getLabel() { return label; } public Integer getBgColor() { return bgColor; } public boolean isEnabled() { return enabled; } public List getHints() { return hints; } public AlertDialogWidget getAlertDialog() { return alertDialog; } /** * Call the remote device to execute its activity * @throws ControlPanelException */ public void exec() throws ControlPanelException { if ( alertDialog != null ) { throw new ControlPanelException("ActionWidget objPath: '" + objectPath + "', alertDialog is defined, can't call exec"); } Log.d(TAG, "Exec called, device: '" + device.getDeviceId() + "' objPath: '" + objectPath + "'"); try { remoteControl.Exec(); } catch(BusException be) { String msg = "Failed to call Exec, objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//exec /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setRemoteController() */ @Override protected void setRemoteController() throws ControlPanelException { WidgetFactory widgetFactory = WidgetFactory.getWidgetFactory(ifName); if ( widgetFactory == null ) { String msg = "Received an unrecognized interface name: '" + ifName + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } Class ifClass = widgetFactory.getIfaceClass(); ProxyBusObject proxyObj = ConnectionManager.getInstance().getProxyObject( device.getSender(), objectPath, sessionId, new Class[]{ ifClass, Properties.class } ); Log.d(TAG, "Setting remote control ActionWidget, objPath: '" + objectPath + "'"); properties = proxyObj.getInterface(Properties.class); remoteControl = (ActionControlSuper) proxyObj.getInterface(ifClass); try { this.version = remoteControl.getVersion(); } catch (BusException e) { String msg = "Failed to call getVersion for element: '" + elementType + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//setRemoteController /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#registerSignalHandler() */ @Override protected void registerSignalHandler() { Method metaDataChangedMethod = CommunicationUtil.getActionMetadataChanged("MetadataChanged"); if ( metaDataChangedMethod == null ) { Log.e(TAG, "ActionWidget, MetadataChanged method is not defined"); return; } try { registerSignalHander(new ActionWidgetSignalHandler(this), metaDataChangedMethod); } catch(ControlPanelException cpe) { String msg = "Device: '" + device.getDeviceId() + "', ActionWidget, failed to register signal handler, Error: '" + cpe.getMessage() + "'"; Log.e(TAG, msg); controlPanel.getEventsListener().errorOccurred(controlPanel, msg); } }//registerSignalHandler /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setProperty(java.lang.String, org.alljoyn.bus.Variant) */ @Override protected void setProperty(String propName, Variant propValue) throws ControlPanelException { try { if ( "States".equals(propName) ) { int states = propValue.getObject(int.class); enabled = (states & ENABLED_MASK) == ENABLED_MASK; } else if ( "OptParams".equals(propName) ) { Map optParams = propValue.getObject(new VariantTypeReference>() {}); fillOptionalParams(optParams); } } catch(BusException be) { throw new ControlPanelException("Failed to unmarshal the property: '" + propName + "', Error: '" + be.getMessage() + "'"); } }//setProperty /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#createChildWidgets() */ @Override protected void createChildWidgets() throws ControlPanelException { int size = children.size(); if ( size == 0 ) { Log.d(TAG, "ActionWidget objPath: '" + objectPath + "', doesn't have any child nodes"); return; } //ActionWidget may has only AlertDialog widget as a child node if ( size > 1) { throw new ControlPanelException("ActionWidget objPath: '" + objectPath + "' has more than one child nodes: '" + size + "'"); } IntrospectionNode childNode = children.get(0); String path = childNode.getPath(); List interfaces = childNode.getInterfaces(); //Search for existence of the AlertDialog interface for (String ifName : interfaces) { if ( !ifName.startsWith(ControlPanelService.INTERFACE_PREFIX + ".") ) { Log.v(TAG, "Found not a ControlPanel interface: '" + ifName + "'"); continue; } //Check the ControlPanel interface WidgetFactory widgFactory = WidgetFactory.getWidgetFactory(ifName); if ( widgFactory == null ) { String msg = "Received an unknown ControlPanel interface: '" + ifName + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } //Found a known interface, check whether it's an AlertDialog if ( widgFactory.getElementType() == UIElementType.ALERT_DIALOG ) { Log.i(TAG, "ActionWidget objPath: '" + objectPath + "', has AlertDialog objPath: '" + path + "', creating..."); alertDialog = new AlertDialogWidget(ifName, path, controlPanel, childNode.getChidren()); return; } }//for :: interfaces throw new ControlPanelException("ActionWidget objPath: '" + objectPath + "', not found the AlertDialog interface"); }//createChildWidgets /** * Fill the actionWidget optional parameters * @throws ControlPanelException if failed to read optional parameters */ private void fillOptionalParams(Map optParams) throws ControlPanelException { // Add optional parameters Log.d(TAG, "ActionWidget - scanning optional parameters"); for (ActionWidgetEnum optKeyEnum : ActionWidgetEnum.values()) { Variant optParam = optParams.get(optKeyEnum.ID); if ( optParam == null ) { Log.v(TAG, "OptionalParameter: '" + optKeyEnum + "', is not found"); continue; } Log.v(TAG, "Found OptionalParameter: '" + optKeyEnum + "'"); try { switch (optKeyEnum) { case LABEL: { label = optParam.getObject(String.class); break; } case BG_COLOR: { bgColor = optParam.getObject(int.class); break; } case HINTS: { short[] actHints = optParam.getObject(short[].class); setListOfActionWidgetHints(actHints); break; } }//switch } catch(BusException be) { throw new ControlPanelException("Failed to unmarshal optional parameters, Error: '" + be.getMessage() + "'"); } }//for }//fillOptionalParams /** * Fill the list of ActionWidgetHint types * @param hIds * @return List of Action hints */ private void setListOfActionWidgetHints(short[] hIds) { Log.v(TAG, "Scanning ActionWidgetHints"); hints = new ArrayList( hIds.length ); for (short hintId : hIds) { ActionWidgetHintsType hintType = ActionWidgetHintsType.getEnumById(hintId); if (hintType == null) { Log.w(TAG, "Received unrecognized ActionWidgetHint: '" + hintId + "', ignoring..."); continue; } hints.add(hintType); }//for :: hIds }//getListOfActionWidgetHints } ActionWidgetEnum.java000066400000000000000000000025261262264444500363140ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * Optional parameters keys of {@link ActionWidget} */ public enum ActionWidgetEnum { LABEL((short)0), BG_COLOR((short)1), HINTS((short)2) ; /** * The key number */ public final short ID; /** * Constructor * @param id */ private ActionWidgetEnum(short id) { ID = id; } } ActionWidgetHintsType.java000066400000000000000000000034221262264444500373330ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * Possible types of Action UI hints */ public enum ActionWidgetHintsType { ACTION_BUTTON ((short)1) ; /** * The key number */ public final short ID; private ActionWidgetHintsType(short id) { ID = id; } /** * Search for the enum by the given id * If not found returns NULL * @param id * @return Enum type by the given id */ public static ActionWidgetHintsType getEnumById(short id) { ActionWidgetHintsType retType = null; for (ActionWidgetHintsType type : ActionWidgetHintsType.values()) { if ( id == type.ID ) { retType = type; break; } } return retType; }//getEnumById } ActionWidgetSignalHandler.java000066400000000000000000000071541262264444500401250ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.communication.TaskManager; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ActionControl; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ActionControlSecured; import android.util.Log; /** * The class is a signal handler that is responsible to receive signals of ActionControl interface.
* Signals:
* - MetadataChanged */ public class ActionWidgetSignalHandler implements ActionControl, ActionControlSecured { private static final String TAG = "cpan" + ActionWidgetSignalHandler.class.getSimpleName(); /** * Container widget to be notified about signal receiving */ private ActionWidget actionWidget; /** * Constructor * @param actionWidget */ public ActionWidgetSignalHandler(ActionWidget actionWidget) { this.actionWidget = actionWidget; } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ActionControl#getVersion() */ @Override public short getVersion() throws BusException { return 0; } @Override public int getStates() throws BusException { // TODO Auto-generated method stub return 0; } @Override public Map getOptParams() throws BusException { // TODO Auto-generated method stub return null; } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ActionControl#Exec() */ @Override public void Exec() { } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ActionControl#MetadataChanged() */ @Override public void MetadataChanged() { String msg = "Device: '" + actionWidget.device.getDeviceId() + "', ActionWidget: '" + actionWidget.objectPath + "', received METADATA_CHANGED signal"; Log.d(TAG, msg); final ControlPanelEventsListener eventsListener = actionWidget.controlPanel.getEventsListener(); try{ actionWidget.refreshProperties(); } catch(ControlPanelException cpe) { msg += ", but failed to refresh the ActionWidget properties"; Log.e(TAG, msg); eventsListener.errorOccurred(actionWidget.controlPanel, msg); return; } //Delegate to the listener on a separate thread TaskManager.getInstance().execute( new Runnable() { @Override public void run() { eventsListener.metadataChanged(actionWidget.controlPanel, actionWidget); } }); }//MetadataChanged } AlertDialogHintsType.java000066400000000000000000000035711262264444500371460ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * The hint types of the {@link AlertDialogWidget} */ public enum AlertDialogHintsType { ALERT_DIALOG((short)1) ; /** * The key number */ public final short ID; /** * Constructor * @param id */ private AlertDialogHintsType(short id) { ID = id; } /** * Search for the enum by the given id * If not found returns NULL * @param id * @return Enum type by the given id */ public static AlertDialogHintsType getEnumById(short id) { AlertDialogHintsType retType = null; for (AlertDialogHintsType type : AlertDialogHintsType.values()) { if ( id == type.ID ) { retType = type; break; } } return retType; }//getEnumById } AlertDialogWidget.java000066400000000000000000000340061262264444500364370ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.ProxyBusObject; import org.alljoyn.bus.Variant; import org.alljoyn.bus.VariantTypeReference; import org.alljoyn.bus.ifaces.Properties; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.communication.CommunicationUtil; import org.alljoyn.ioe.controlpanelservice.communication.ConnectionManager; import org.alljoyn.ioe.controlpanelservice.communication.IntrospectionNode; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.AlertDialogSuper; import android.util.Log; public class AlertDialogWidget extends UIElement { private static final String TAG = "cpan" + AlertDialogWidget.class.getSimpleName(); /** * The class represents a dialog button */ public static class DialogButton { /** * Action label */ private String label; /** * The method that should be executed when exec called */ private Method bindMethod; /** * The alert dialog on which to call the bind method */ private AlertDialogWidget alertDialog; /** * Constructor */ private DialogButton(String label, Method bindMethod, AlertDialogWidget alertDialog) { this.label = label; this.bindMethod = bindMethod; this.alertDialog = alertDialog; } /** * @return Get the button label */ public String getLabel() { return label; } /** * Execute the action * @throws ControlPanelException */ public void exec() throws ControlPanelException { try { bindMethod.invoke(alertDialog); } catch (InvocationTargetException ite) { String invokeError = ite.getTargetException().getMessage(); throw new ControlPanelException("DialogButton label: '" + label + "', failed to invoke the method: '" + bindMethod.getName() + "', Error: '" + invokeError + "'"); } catch (Exception e) { throw new ControlPanelException("DialogButton label: '" + label + "', failed to invoke the method: '" + bindMethod.getName() + "'"); } }//exec } //=====================================================// // END OF NESTED CLASSES // //=====================================================// private static final int ENABLED_MASK = 0x01; /** * The remote AlertDialog object */ private AlertDialogSuper remoteControl; /** * Whether the widget is enabled */ private boolean enabled; /** * The Alert dialog display message */ private String message; /** * The number of the available actions */ private short numActions; /** * The Alert dialog label */ private String label; /** * Background color */ private Integer bgColor; /** * The hints for this alert dialog */ private List hints; /** * List of this alert dialog supported buttons */ private List execButtons; /** * Constructor * @param ifName * @param objectPath * @param controlPanel * @param children * @throws ControlPanelException */ public AlertDialogWidget(String ifName, String objectPath, DeviceControlPanel controlPanel, List children) throws ControlPanelException { super(UIElementType.ALERT_DIALOG, ifName, objectPath, controlPanel, children); } public boolean isEnabled() { return enabled; } /** * @return Display message */ public String getMessage() { return message; } /** * @return The number of the available actions */ public short getNumActions() { return numActions; } public String getLabel() { return label; } public Integer getBgColor() { return bgColor; } public List getHints() { return hints; } /** * @return List of this alert dialog supported buttons */ public List getExecButtons() { return execButtons; } /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setRemoteController() */ @Override protected void setRemoteController() throws ControlPanelException { WidgetFactory widgetFactory = WidgetFactory.getWidgetFactory(ifName); if ( widgetFactory == null ) { String msg = "Received an unrecognized interface name: '" + ifName + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } Class ifClass = widgetFactory.getIfaceClass(); ProxyBusObject proxyObj = ConnectionManager.getInstance().getProxyObject( device.getSender(), objectPath, sessionId, new Class[]{ifClass, Properties.class} ); Log.d(TAG, "Setting remote control AlertDialog, objPath: '" + objectPath + "'"); properties = proxyObj.getInterface(Properties.class); remoteControl = (AlertDialogSuper) proxyObj.getInterface(ifClass); try { this.version = remoteControl.getVersion(); } catch (BusException e) { String msg = "Failed to call getVersion for element: '" + elementType + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//setRemoteController /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#registerSignalHandler() */ @Override protected void registerSignalHandler() throws ControlPanelException { Method alertMetaDataChanged = CommunicationUtil.getAlertDialogMetadataChanged("MetadataChanged"); if ( alertMetaDataChanged == null ) { String msg = "AlertDialogWidget, MetadataChanged method isn't defined"; Log.e(TAG, msg); throw new ControlPanelException(msg); } try { registerSignalHander(new AlertDialogWidgetSignalHandler(this), alertMetaDataChanged); } catch(ControlPanelException cpe) { String msg = "Device: '" + device.getDeviceId() + "', AlertDialogWidget, failed to register signal handler, Error: '" + cpe.getMessage() + "'"; Log.e(TAG, msg); controlPanel.getEventsListener().errorOccurred(controlPanel, msg); } }//registerSignalHandler /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setProperty(java.lang.String, org.alljoyn.bus.Variant) */ @Override protected void setProperty(String propName, Variant propValue) throws ControlPanelException { try{ if ( "States".equals(propName) ) { int states = propValue.getObject(int.class); enabled = (states & ENABLED_MASK) == ENABLED_MASK; } else if ( "OptParams".equals(propName) ) { Map optParams = propValue.getObject(new VariantTypeReference>() {}); fillOptionalParams(optParams); } else if ( "Message".equals(propName) ) { message = propValue.getObject(String.class); } else if ( "NumActions".equals(propName) ) { numActions = propValue.getObject(short.class); } } catch(BusException be) { throw new ControlPanelException("Failed to unmarshal the property: '" + propName + "', Error: '" + be.getMessage() + "'"); } }//setProperty /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#createChildWidgets() */ @Override protected void createChildWidgets() throws ControlPanelException { int size = children.size(); Log.d(TAG, "Test AlertDialogWidget validity - AlertDialogWidget can't has child nodes. #ChildNodes: '" + size + "'"); if ( size > 0 ) { throw new ControlPanelException("The AlertDialogWidget objPath: '" + objectPath + "' is not valid, found '" + size + "' child nodes"); } }//createChildWidgets /** * Execute the action number 1 * @throws ControlPanelException if failed to execute the remote call */ void execAction1() throws ControlPanelException { Log.d(TAG, "ExecAction1 called, device: '" + device.getDeviceId() + "' objPath: '" + objectPath + "'"); try { remoteControl.Action1(); } catch(BusException be) { String msg = "Failed to call ExecAction1, objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//execAction1 /** * Execute the action number 2 * @throws ControlPanelException if failed to execute the remote call */ void execAction2() throws ControlPanelException { Log.d(TAG, "ExecAction2 called, device: '" + device.getDeviceId() + "' objPath: '" + objectPath + "'"); try { remoteControl.Action2(); } catch(BusException be) { String msg = "Failed to call ExecAction2, objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//execAction2 /** * Execute the action number 3 * @throws ControlPanelException if failed to execute the remote call */ void execAction3() throws ControlPanelException { Log.d(TAG, "ExecAction3 called, device: '" + device.getDeviceId() + "' objPath: '" + objectPath + "'"); try { remoteControl.Action3(); } catch(BusException be) { String msg = "Failed to call ExecAction3, objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//execAction2 /** * Fill the alertDialogWidget optional parameters * @throws ControlPanelException if failed to read optional parameters */ private void fillOptionalParams(Map optParams) throws ControlPanelException { this.execButtons = new ArrayList(); // Add optional parameters Log.d(TAG, "AlertDialogWidget - scanning optional parameters"); for (AlertDialogWidgetEnum optKeyEnum : AlertDialogWidgetEnum.values()) { Variant optParam = optParams.get(optKeyEnum.ID); if ( optParam == null ) { Log.v(TAG, "OptionalParameter: '" + optKeyEnum + "', is not found"); continue; } Log.v(TAG, "Found OptionalParameter: '" + optKeyEnum + "'"); try { switch (optKeyEnum) { case LABEL: { label = optParam.getObject(String.class); break; } case BG_COLOR: { bgColor = optParam.getObject(int.class); break; } case HINTS: { short[] alertHints = optParam.getObject(short[].class); fillAlertDialogHints(alertHints); break; } case LABEL_ACTION1: { String label = optParam.getObject(String.class); execButtons.add( new DialogButton(label, getActionMethodReflection("execAction1"), this) ); break; } case LABEL_ACTION2: { String label = optParam.getObject(String.class); execButtons.add( new DialogButton(label, getActionMethodReflection("execAction2"), this)); break; } case LABEL_ACTION3: { String label = optParam.getObject(String.class); execButtons.add( new DialogButton(label, getActionMethodReflection("execAction3"), this)); break; } }//switch } catch(BusException be) { throw new ControlPanelException("Failed to unmarshal optional parameters, Error: '" + be.getMessage() + "'"); } }//for }//fillOptionalParams /** * Iterate over the alert dialog hints and fill it * @param hIds */ private void fillAlertDialogHints(short[] hIds) { hints = new ArrayList( hIds.length ); Log.v(TAG, "Searching for AlertDialog hints"); //Fill layout hints for (short hintId : hIds) { AlertDialogHintsType hintType = AlertDialogHintsType.getEnumById(hintId); if ( hintType != null ) { Log.v(TAG, "Found AlertDialog hint: '" + hintType + "', adding"); hints.add(hintType); } else { Log.w(TAG, "AlertDialog hint id: '" + hintId + "' is unknown"); } }//hints }//fillAlertDialogHints /** * Return reflection of getAction1 method * @param methodName The name of the method to get the reflection object * @return Method reflection of the received methodName */ private Method getActionMethodReflection(String methodName) throws ControlPanelException { Method method; try { method = AlertDialogWidget.class.getDeclaredMethod(methodName, (Class[])null); } catch (NoSuchMethodException nse) { throw new ControlPanelException("Failed to get reflection of the '" + methodName + "', Error: '" + nse.getMessage() + "'"); } return method; }//getAction1Method } AlertDialogWidgetEnum.java000066400000000000000000000027661262264444500372740ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * Optional parameters keys of {@link AlertDialogWidget} */ public enum AlertDialogWidgetEnum { LABEL((short)0), BG_COLOR((short)1), HINTS((short)2), LABEL_ACTION1((short)6), LABEL_ACTION2((short)7), LABEL_ACTION3((short)8) ; /** * The key number */ public final short ID; /** * Constructor * @param id */ private AlertDialogWidgetEnum(short id) { ID = id; } } AlertDialogWidgetSignalHandler.java000066400000000000000000000075161262264444500411010ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.communication.TaskManager; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.AlertDialog; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.AlertDialogSecured; import android.util.Log; public class AlertDialogWidgetSignalHandler implements AlertDialog, AlertDialogSecured { private static final String TAG = "cpan" + AlertDialogWidgetSignalHandler.class.getSimpleName(); /** * AlertDialog to be notified about signal receiving */ private AlertDialogWidget alertDialog; /** * @param alertDialog */ public AlertDialogWidgetSignalHandler(AlertDialogWidget alertDialog) { this.alertDialog = alertDialog; } @Override public short getVersion() throws BusException { // TODO Auto-generated method stub return 0; } @Override public int getStates() throws BusException { // TODO Auto-generated method stub return 0; } @Override public Map getOptParams() throws BusException { // TODO Auto-generated method stub return null; } @Override public String getMessage() throws BusException { // TODO Auto-generated method stub return null; } @Override public short getNumActions() throws BusException { // TODO Auto-generated method stub return 0; } @Override public void Action1() throws BusException { // TODO Auto-generated method stub } @Override public void Action2() throws BusException { // TODO Auto-generated method stub } @Override public void Action3() throws BusException { // TODO Auto-generated method stub } /** * Signal handler * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.AlertDialog#MetadataChanged() */ @Override public void MetadataChanged() throws BusException { String msg = "Device: '" + alertDialog.device.getDeviceId() + "', AlertDialogWidget: '" + alertDialog.objectPath + "', received METADATA_CHANGED signal"; Log.d(TAG, msg); final ControlPanelEventsListener eventsListener = alertDialog.controlPanel.getEventsListener(); try { alertDialog.refreshProperties(); } catch (ControlPanelException cpe) { msg += ", but failed to refresh the Container properties"; Log.e(TAG, msg); eventsListener.errorOccurred(alertDialog.controlPanel, msg); return; } //Delegate to the listener on a separate thread TaskManager.getInstance().execute( new Runnable() { @Override public void run() { eventsListener.metadataChanged(alertDialog.controlPanel, alertDialog); } }); }//MetadataChanged } ContainerWidget.java000066400000000000000000000253541262264444500362000ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.ProxyBusObject; import org.alljoyn.bus.Variant; import org.alljoyn.bus.VariantTypeReference; import org.alljoyn.bus.ifaces.Properties; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; import org.alljoyn.ioe.controlpanelservice.communication.CommunicationUtil; import org.alljoyn.ioe.controlpanelservice.communication.ConnectionManager; import org.alljoyn.ioe.controlpanelservice.communication.IntrospectionNode; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ContainerSuper; import android.util.Log; /** * Container widget */ public class ContainerWidget extends UIElement { private static final String TAG = "cpan" + ContainerWidget.class.getSimpleName(); private static final int ENABLED_MASK = 0x01; /** * The remote container object */ private ContainerSuper remoteControl; /** * The list of UI elements
* Not required to be set */ private List elements; /** * The layout hints
* Not required to be set */ private List layoutHints; /** * The label
* Not required to be set */ private String label; /** * bgColor
* Not required to be set */ private Integer bgColor; /** * Indicates whether the UI element is enabled
* Default is true
* Not required to be set */ private boolean enabled; /** * Constructor * @param ifName * @param objectPath * @param controlPanel * @param children * @throws ControlPanelException */ public ContainerWidget(String ifName, String objectPath, DeviceControlPanel controlPanel, List children) throws ControlPanelException { super(UIElementType.CONTAINER, ifName, objectPath, controlPanel, children); layoutHints = new ArrayList(); elements = new ArrayList(); bgColor = 0; enabled = true; } public List getElements() { return elements; } public List getLayoutHints() { return layoutHints; } public String getLabel() { return label; } public Integer getBgColor() { return bgColor; } public boolean isEnabled() { return enabled; } //===========================================// /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setProperty(java.lang.String, org.alljoyn.bus.Variant) */ @Override protected void setProperty(String propName, Variant propValue) throws ControlPanelException { try{ if ( "States".equals(propName) ) { int states = propValue.getObject(int.class); enabled = (states & ENABLED_MASK) == ENABLED_MASK; } else if ( "OptParams".equals(propName) ) { Map optParams = propValue.getObject(new VariantTypeReference>() {}); fillOptionalParams(optParams); } } catch(BusException be) { throw new ControlPanelException("Failed to unmarshal the property: '" + propName + "', Error: '" + be.getMessage() + "'"); } }//setProperty /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setRemoteController() */ @Override protected void setRemoteController() throws ControlPanelException { WidgetFactory widgetFactory = WidgetFactory.getWidgetFactory(ifName); if ( widgetFactory == null ) { String msg = "Received an unrecognized interface name: '" + ifName + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } Class ifClass = widgetFactory.getIfaceClass(); ProxyBusObject proxyObj = ConnectionManager.getInstance().getProxyObject( device.getSender(), objectPath, sessionId, new Class[]{ifClass, Properties.class} ); Log.d(TAG, "Setting remote control ContainerWidget, objPath: '" + objectPath + "'"); properties = proxyObj.getInterface(Properties.class); remoteControl = (ContainerSuper) proxyObj.getInterface(ifClass); try { this.version = remoteControl.getVersion(); } catch (BusException e) { String msg = "Failed to call getVersion for element: '" + elementType + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//newSessionEstablished /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#registerSignalHandler() */ @Override protected void registerSignalHandler() throws ControlPanelException { Method containerMetadataChanged = CommunicationUtil.getContainerMetadataChanged("MetadataChanged"); if ( containerMetadataChanged == null ) { String msg = "ContainerWidget, MetadataChanged method isn't defined"; Log.e(TAG, msg); throw new ControlPanelException(msg); } try { registerSignalHander(new ContainerWidgetSignalHandler(this), containerMetadataChanged); } catch(ControlPanelException cpe) { String msg = "Device: '" + device.getDeviceId() + "', ContainerWidget, failed to register signal handler, Error: '" + cpe.getMessage() + "'"; Log.e(TAG, msg); controlPanel.getEventsListener().errorOccurred(controlPanel, msg); } }//registerSignalHandler /** * Fill container optional parameters * @param optParams * @throws ControlPanelException if failed to read optional parameters */ private void fillOptionalParams(Map optParams) throws ControlPanelException { // Add optional parameters Log.d(TAG, "Container - scanning optional parameters"); for (ContainerWidgetEnum optKeyEnum : ContainerWidgetEnum.values()) { Variant optParam = optParams.get(optKeyEnum.ID); if ( optParam == null ) { Log.v(TAG, "OptionalParameter: '" + optKeyEnum + "', is not found"); continue; } Log.v(TAG, "Found OptionalParameter: '" + optKeyEnum + "'"); try { switch (optKeyEnum) { case LABEL: { label = optParam.getObject(String.class); break; } case BG_COLOR: { bgColor = optParam.getObject(int.class); break; } case LAYOUT_HINTS: { short[] layoutHints = optParam.getObject( short[].class ); fillLayoutHints(layoutHints); break; } }//switch } catch(BusException be) { throw new ControlPanelException("Failed to unmarshal optional parameters, Error: '" + be.getMessage() + "'"); } }//for }//fillOptionalParams /** * Iterate over the layout hints and fill it * @param hIds */ private void fillLayoutHints(short[] hIds) { layoutHints = new ArrayList( hIds.length ); Log.v(TAG, "Searching for layoutHints"); //Fill layout hints for (short hintId : hIds) { LayoutHintsType hintType = LayoutHintsType.getEnumById(hintId); if ( hintType != null ) { Log.v(TAG, "Found layout hint: '" + hintType + "', adding"); layoutHints.add(hintType); } else { Log.w(TAG, "Layout hint id: '" + hintId + "' is unknown"); } }//hints }//fillLayoutHints /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#createChildWidgets() */ @Override protected void createChildWidgets() { Log.d(TAG, "Device: '" + device.getDeviceId() + "', iterate over the child elements"); elements = new LinkedList(); for ( IntrospectionNode childNode : children ) { String path = childNode.getPath(); List interfaces = childNode.getInterfaces(); Log.d(TAG, "Device: '" + device.getDeviceId() + "' found child node objPath: '" + path + "', interfaces: '" + interfaces + "'"); for (String ifName : interfaces) { try { if ( !ifName.startsWith(ControlPanelService.INTERFACE_PREFIX + ".") ) { Log.v(TAG, "Found not a ControlPanel interface: '" + ifName + "'"); continue; } //Check the ControlPanel interface WidgetFactory widgFactory = WidgetFactory.getWidgetFactory(ifName); if ( widgFactory == null ) { String msg = "Received an unknown ControlPanel interface: '" + ifName + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } UIElement childElement = widgFactory.create(path, controlPanel, childNode.getChidren()); elements.add(childElement); }//try catch (Exception e) { Log.w(TAG, "An error occurred during creation the Object: '" + path + "', device: '" + device.getDeviceId() + "'"); controlPanel.getEventsListener().errorOccurred(controlPanel, e.getMessage()); try { ErrorWidget errorWidget = new ErrorWidget(UIElementType.ERROR_WIDGET, ifName, path, controlPanel, childNode.getChidren()); errorWidget.setError(e.getMessage()); elements.add(errorWidget); } catch (Exception ex) { //This should never happen, because ErrorWidget never throws an exception Log.w(TAG, "A failure has occurred in creation the ErrorWidget"); } } }//for :: interfaces }//for :: children }//createChildWidgets } ContainerWidgetEnum.java000066400000000000000000000025461262264444500370230ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * Optional parameters keys of {@link ContainerWidget} */ public enum ContainerWidgetEnum { LABEL((short)0), BG_COLOR((short)1), LAYOUT_HINTS((short)2) ; /** * The key number */ public final short ID; /** * Constructor * @param id */ private ContainerWidgetEnum(short id) { ID = id; } } ContainerWidgetSignalHandler.java000066400000000000000000000066511262264444500406330ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.communication.TaskManager; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.Container; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ContainerSecured; import android.util.Log; /** * The class is a signal handler that is responsible to receive signals of UIContainer interface.
* Signals:
* - MetadataChanged */ public class ContainerWidgetSignalHandler implements Container, ContainerSecured { private static final String TAG = "cpan" + ContainerWidgetSignalHandler.class.getSimpleName(); /** * Container widget to be notified about signal receiving */ private ContainerWidget containerWidget; /** * Constructor * @param containerWidget */ public ContainerWidgetSignalHandler(ContainerWidget containerWidget) { this.containerWidget = containerWidget; } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.Container#getVersion() */ @Override public short getVersion() throws BusException { return 0; } @Override public int getStates() throws BusException { // TODO Auto-generated method stub return 0; } @Override public Map getOptParams() throws BusException { // TODO Auto-generated method stub return null; } /** * Signal handler * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.Container#MetadataChanged() */ @Override public void MetadataChanged() throws BusException { String msg = "Device: '" + containerWidget.device.getDeviceId() + "', ContainerWidget: '" + containerWidget.objectPath + "', received METADATA_CHANGED signal"; Log.d(TAG, msg); final ControlPanelEventsListener eventsListener = containerWidget.controlPanel.getEventsListener(); try { containerWidget.refreshProperties(); } catch (ControlPanelException cpe) { msg += ", but failed to refresh the Container properties"; Log.e(TAG, msg); eventsListener.errorOccurred(containerWidget.controlPanel, msg); return; } //Delegate to the listener on a separate thread TaskManager.getInstance().execute( new Runnable() { @Override public void run() { eventsListener.metadataChanged(containerWidget.controlPanel, containerWidget); } }); }//MetadataChanged } ControlPanelEventsListener.java000066400000000000000000000045201262264444500403750ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * The interface to be implemented in order to receive {@link DeviceControlPanel} relevant events */ public interface ControlPanelEventsListener { /** * Notify the interface implementer about the changed value in the {@link UIElement} * @param panel {@link DeviceControlPanel} where the value has changed * @param uielement The {@link UIElement} where the change has occurred * @param newValue The new value */ public void valueChanged(DeviceControlPanel panel, UIElement uielement, Object newValue); /** * Notify the interface implementer about the metadata changed in the {@link UIElement} * @param panel {@link DeviceControlPanel} where the metadata has changed * @param uielement The {@link UIElement} where the change has occurred */ public void metadataChanged(DeviceControlPanel panel, UIElement uielement); /** * Dismiss the NotificationAction of the given {@link DeviceControlPanel} * @param panel The NotificationAction control panel to dismissed */ public void notificationActionDismiss(DeviceControlPanel panel); /** * Notify the interface implementer about an error in the {@link DeviceControlPanel} activities * @param panel {@link DeviceControlPanel} where the error has occurred * @param reason The error reason */ public void errorOccurred(DeviceControlPanel panel, String reason); } DeviceControlPanel.java000066400000000000000000000167741262264444500366400ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.util.LinkedList; import java.util.List; import org.alljoyn.ioe.controlpanelservice.ControlPanelCollection; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; import org.alljoyn.ioe.controlpanelservice.ControllableDevice; import org.alljoyn.ioe.controlpanelservice.Unit; import org.alljoyn.ioe.controlpanelservice.communication.ConnectionManager; import org.alljoyn.ioe.controlpanelservice.communication.IntrospectionNode; import org.alljoyn.ioe.controlpanelservice.communication.UIWidgetSignalHandler; import android.util.Log; /** * Represents a device control panel.
* This class provides methods of receiving a root UI container and its label */ public class DeviceControlPanel { private static final String TAG = "cpan" + DeviceControlPanel.class.getSimpleName(); /** * The device this control panel belongs to */ private ControllableDevice device; /** * The functional unit that this control panel belongs to */ private Unit unit; /** * The {@link ControlPanelCollection} the device belongs to */ private ControlPanelCollection collection; /** * The remote object identifier of this control panel */ private String objPath; /** * The IETF standard language tag */ private String language; /** * The signal handler objects of this ControlPanel */ private List widgetSignalHandlers; /** * The listener of the events that happen on the widgets of this {@link DeviceControlPanel} */ private ControlPanelEventsListener eventsListener; /** * Constructor * @param device */ public DeviceControlPanel(ControllableDevice device, Unit unit, ControlPanelCollection collection, String objPath, String language) { this.device = device; this.objPath = objPath; this.unit = unit; this.collection = collection; this.language = language; this.widgetSignalHandlers = new LinkedList(); } /** * @return The functional unit of the device */ public Unit getUnit() { return unit; }//getUnit /** * @return {@link DeviceControlPanel} object path */ public String getObjPath() { return objPath; }//getObjPath /** * @return The IETF language tag */ public String getLanguage() { return language; }//getLanguage /** * @return The {@link ControllableDevice} this {@link DeviceControlPanel} belongs to */ public ControllableDevice getDevice() { return device; }//getDevice /** * @return The {@link ControlPanelCollection} the device belongs to */ public ControlPanelCollection getCollection() { return collection; } /** * @return The events listener that is used by this {@link DeviceControlPanel} */ public synchronized ControlPanelEventsListener getEventsListener() { return eventsListener; } /** * @param listener The listener of the events that happen on the UI widgets of this {@link DeviceControlPanel} * @return UIElement of either {@link ContainerWidget} or {@link AlertDialogWidget}. If failed to build the element, NULL is returned * @throws ControlPanelException */ public synchronized UIElement getRootElement(ControlPanelEventsListener listener) throws ControlPanelException { if ( listener == null ) { throw new ControlPanelException("Received an undefined ControlPanelEventsListener"); } this.eventsListener = listener; Integer sessionId = device.getSessionId(); if ( sessionId == null ) { Log.e(TAG, "Device: '" + device.getDeviceId() + "', getRootElement() called, but session not defined"); throw new ControlPanelException("Session not established"); } // Clean the previous signal handlers if exist cleanSignalHandlers(); Log.i(TAG, "GetRootElement was called, handling..."); IntrospectionNode introNode; try { introNode = new IntrospectionNode(objPath); introNode.parse(ConnectionManager.getInstance().getBusAttachment(), device.getSender(), sessionId); } catch (Exception e) { String msg = "Failed to introspect the path '" + objPath + "', Error: '" + e.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } List interfaces = introNode.getInterfaces(); Log.v(TAG, "For requested objPath: '" + objPath + "', the found interfaces are: '" + interfaces + "'"); Log.d(TAG, "Search for Container or Dialog interface"); if ( !WidgetFactory.isInitialized() ) { Log.e(TAG, "Failed to initialize the WidgetFactory, returning NULL"); return null; } for (String ifName : interfaces) { if ( !ifName.startsWith(ControlPanelService.INTERFACE_PREFIX + ".") ) { Log.v(TAG, "Found not a ControlPanel interface: '" + ifName + "'"); continue; } //Check the ControlPanel interface WidgetFactory widgFactory = WidgetFactory.getWidgetFactory(ifName); if ( widgFactory == null ) { Log.e(TAG, "Received an unknown ControlPanel interface: '" + ifName + "', return NULL"); return null; } if ( widgFactory.isTopLevelObj() ) { Log.d(TAG, "Found the top level interface: '" + ifName + "', creating widgets..."); return widgFactory.create(objPath, this, introNode.getChidren()); } }//for::interfaces return null; }//getRootContainer /** * Cleans the object resources */ public synchronized void release() { Log.d(TAG, "Cleaning the DeviceControlPanel, objPath: '" + objPath + "'"); try { cleanSignalHandlers(); } catch (ControlPanelException cpe) { Log.e(TAG, "Failed to unregister a signal handler from the bus"); } eventsListener = null; }//release /** * Adds the UI widget signal handler to the signal handlers list * @param signalHandler */ synchronized void addSignalHandler(UIWidgetSignalHandler signalHandler) { this.widgetSignalHandlers.add(signalHandler); }//addSignalHandler /** * Unregister the signal handlers * @throws ControlPanelException Is thrown if failed to unregister a signal handler */ private void cleanSignalHandlers() throws ControlPanelException { if ( widgetSignalHandlers.size() > 0 ) { Log.d(TAG, "Found the previous signal handlers, unregistering them from the bus"); for (UIWidgetSignalHandler handler : widgetSignalHandlers) { handler.unregister(); } widgetSignalHandlers.clear(); }//if :: handler size > 0 }//cleanSignalHandlers } ErrorWidget.java000066400000000000000000000110431262264444500353350ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.util.List; import org.alljoyn.bus.Variant; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.communication.IntrospectionNode; /** * The widget is used to replace a {@link UIElement} that had a failure in its creation
* Use the {@link ErrorWidget#getLabel()} method to receive a proposed label for this widget.
* Use the {@link ErrorWidget#getError()} method to receive an error description that triggered creation of this widget */ public class ErrorWidget extends UIElement { /** * The error message that explains the reason of this widget creation */ private String errorMsg; /** * The default label for the widget */ private final String LABEL = "NOT AVAILABLE"; /** * Constructor * @param elementType * @param ifName * @param objectPath * @param controlPanel * @param children * @throws ControlPanelException */ public ErrorWidget(UIElementType elementType, String ifName, String objectPath, DeviceControlPanel controlPanel, List children) throws ControlPanelException { super(elementType, ifName, objectPath, controlPanel, children); } /** * The default label for the widget * @return The label content */ public String getLabel() { return LABEL; }//getLabel /** * The error message that explains the reason of this widget creation * @return The error message */ public String getError() { return errorMsg; }//getError /** * The method tries to retrieve the original {@link UIElementType} that failed during the creation process * @return {@link UIElementType} of the original {@link UIElement} or NULL if it couldn't be retrieved */ public UIElementType getOriginalUIElement() { if ( ifName == null ) { return null; } if ( !WidgetFactory.isInitialized() ) { return null; } WidgetFactory widgetFact = WidgetFactory.getWidgetFactory(ifName); if ( widgetFact == null ) { return null; } return widgetFact.getElementType(); }//getUIElement /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#refreshProperties() */ @Override public void refreshProperties() throws ControlPanelException { } /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#getVersion() */ @Override public short getVersion() { return 0; } /** * The error message that explains the reason of this widget creation * @param errorMsg */ void setError(String errorMsg) { this.errorMsg = errorMsg; } /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setRemoteController() */ @Override protected void setRemoteController() throws ControlPanelException { } /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#registerSignalHandler() */ @Override protected void registerSignalHandler() throws ControlPanelException { } /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setProperty(java.lang.String, org.alljoyn.bus.Variant) */ @Override protected void setProperty(String propName, Variant propValue) throws ControlPanelException { } /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#createChildWidgets() */ @Override protected void createChildWidgets() throws ControlPanelException { } /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#versionCheck() */ @Override protected void versionCheck() throws ControlPanelException { } } LabelWidget.java000066400000000000000000000207641262264444500352750ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.ProxyBusObject; import org.alljoyn.bus.Variant; import org.alljoyn.bus.VariantTypeReference; import org.alljoyn.bus.ifaces.Properties; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.communication.CommunicationUtil; import org.alljoyn.ioe.controlpanelservice.communication.ConnectionManager; import org.alljoyn.ioe.controlpanelservice.communication.IntrospectionNode; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.Label; import android.util.Log; public class LabelWidget extends UIElement { private static final String TAG = LabelWidget.class.getSimpleName(); private static final int ENABLED_MASK = 0x01; /** * The remote property object */ private Label remoteControl; /** * Whether the label is enabled */ private boolean enabled; /** * The label */ private String label; /** * The label widget bgcolor */ private Integer bgColor; /** * The hints for this Label Widget */ private List hints; /** * Constructor * @param ifName * @param objectPath * @param controlPanel * @param children * @throws ControlPanelException */ public LabelWidget(String ifName, String objectPath, DeviceControlPanel controlPanel, List children) throws ControlPanelException { super(UIElementType.LABEL_WIDGET, ifName, objectPath, controlPanel, children); } public boolean isEnabled() { return enabled; } public String getLabel() { return label; } public Integer getBgColor() { return bgColor; } public List getHints() { return hints; } /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setRemoteController() */ @Override protected void setRemoteController() throws ControlPanelException { WidgetFactory widgetFactory = WidgetFactory.getWidgetFactory(ifName); if ( widgetFactory == null ) { String msg = "Received an unrecognized interface name: '" + ifName + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } Class ifClass = widgetFactory.getIfaceClass(); ProxyBusObject proxyObj = ConnectionManager.getInstance().getProxyObject( device.getSender(), objectPath, sessionId, new Class[]{ ifClass, Properties.class } ); Log.d(TAG, "Setting remote control LabelWidget, objPath: '" + objectPath + "'"); properties = proxyObj.getInterface(Properties.class); remoteControl = (Label) proxyObj.getInterface(ifClass); try { this.version = remoteControl.getVersion(); } catch (BusException e) { String msg = "Failed to call getVersion for element: '" + elementType + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//setRemoteController /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#registerSignalHandler() */ @Override protected void registerSignalHandler() throws ControlPanelException { Method labelMetadataChanged = CommunicationUtil.getLabelWidgetMetadataChanged("MetadataChanged"); if ( labelMetadataChanged == null ) { String msg = "LabelWidget, MetadataChanged method isn't defined"; Log.e(TAG, msg); throw new ControlPanelException(msg); } try { registerSignalHander(new LabelWidgetSignalHandler(this), labelMetadataChanged); } catch(ControlPanelException cpe) { String msg = "Device: '" + device.getDeviceId() + "', LabelWidget, failed to register signal handler, Error: '" + cpe.getMessage() + "'"; Log.e(TAG, msg); controlPanel.getEventsListener().errorOccurred(controlPanel, msg); } }//registerSignalHandler /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setProperty(java.lang.String, org.alljoyn.bus.Variant) */ @Override protected void setProperty(String propName, Variant propValue) throws ControlPanelException { try{ if ( "States".equals(propName) ) { int states = propValue.getObject(int.class); enabled = (states & ENABLED_MASK) == ENABLED_MASK; } else if ( "Label".equals(propName) ) { label = propValue.getObject(String.class); } else if ( "OptParams".equals(propName) ) { Map optParams = propValue.getObject(new VariantTypeReference>() {}); fillOptionalParams(optParams); } } catch(BusException be) { throw new ControlPanelException("Failed to unmarshal the property: '" + propName + "', Error: '" + be.getMessage() + "'"); } }//setProperty /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#createChildWidgets() */ @Override protected void createChildWidgets() throws ControlPanelException { int size = children.size(); Log.d(TAG, "Test LabelWidget validity - LabelWidget can't has child nodes. #ChildNodes: '" + size + "'"); if ( size > 0 ) { throw new ControlPanelException("The LabelWidget objPath: '" + objectPath + "' is not valid, found '" + size + "' child nodes"); } }//createChildWidgets /** * Fill LabelWidget optional parameters * @param optParams * @throws ControlPanelException if failed to read optional parameters */ private void fillOptionalParams(Map optParams) throws ControlPanelException { // Add optional parameters Log.d(TAG, "LabelWidget - scanning optional parameters"); for (LabelWidgetEnum optKeyEnum : LabelWidgetEnum.values()) { Variant optParam = optParams.get(optKeyEnum.ID); if ( optParam == null ) { Log.v(TAG, "OptionalParameter: '" + optKeyEnum + "', is not found"); continue; } Log.v(TAG, "Found OptionalParameter: '" + optKeyEnum + "'"); try { switch (optKeyEnum) { case BG_COLOR: { bgColor = optParam.getObject(int.class); break; } case HINTS: { short[] labelHints = optParam.getObject(short[].class); fillLabelHints(labelHints); break; } }//switch } catch(BusException be) { throw new ControlPanelException("Failed to unmarshal optional parameters, Error: '" + be.getMessage() + "'"); } }//for }//fillOptionalParams /** * Iterate over the alert dialog hints and fill it * @param hIds */ private void fillLabelHints(short[] hIds) { hints = new ArrayList( hIds.length ); Log.v(TAG, "Searching for LabelWidget hints"); //Fill layout hints for (short hintId : hIds) { LabelWidgetHintsType hintType = LabelWidgetHintsType.getEnumById(hintId); if ( hintType != null ) { Log.v(TAG, "Found LabelWidget hint: '" + hintType + "', adding"); hints.add(hintType); } else { Log.w(TAG, "LabelWidget hint id: '" + hintId + "' is unknown"); } }//hints }//fillLabelHints } LabelWidgetEnum.java000066400000000000000000000025431262264444500361150ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * Optional parameters keys of {@link LabelWidget} */ public enum LabelWidgetEnum { BG_COLOR((short)1), HINTS((short)2) ; /** * The key number */ public final short ID; /** * Constructor * @param id */ private LabelWidgetEnum(short id) { ID = id; } } LabelWidgetHintsType.java000066400000000000000000000035641262264444500371440ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * The hint types of the {@link LabelWidget} */ public enum LabelWidgetHintsType { TEXT_LABEL((short)1) ; /** * The key number */ public final short ID; /** * Constructor * @param id */ private LabelWidgetHintsType(short id) { ID = id; } /** * Search for the enum by the given id * If not found returns NULL * @param id * @return Enum type by the given id */ public static LabelWidgetHintsType getEnumById(short id) { LabelWidgetHintsType retType = null; for (LabelWidgetHintsType type : LabelWidgetHintsType.values()) { if ( id == type.ID ) { retType = type; break; } } return retType; }//getEnumById } LabelWidgetSignalHandler.java000066400000000000000000000063731262264444500377310ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.communication.TaskManager; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.Label; import android.util.Log; public class LabelWidgetSignalHandler implements Label { private static final String TAG = "cpan" + LabelWidgetSignalHandler.class.getSimpleName(); /** * Container widget to be notified about signal receiving */ private LabelWidget labelWidget; /** * Constructor * @param labelWidget */ public LabelWidgetSignalHandler(LabelWidget labelWidget) { this.labelWidget = labelWidget; } @Override public short getVersion() throws BusException { // TODO Auto-generated method stub return 0; } @Override public int getStates() throws BusException { // TODO Auto-generated method stub return 0; } @Override public Map getOptParams() throws BusException { // TODO Auto-generated method stub return null; } @Override public String getLabel() throws BusException { // TODO Auto-generated method stub return null; } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.Label#MetadataChanged() */ @Override public void MetadataChanged() throws BusException { String msg = "Device: '" + labelWidget.device.getDeviceId() + "', labelWidget: '" + labelWidget.objectPath + "', received METADATA_CHANGED signal"; Log.d(TAG, msg); final ControlPanelEventsListener eventsListener = labelWidget.controlPanel.getEventsListener(); try { labelWidget.refreshProperties(); } catch (ControlPanelException cpe) { msg += ", but failed to refresh the LabelWidget properties"; Log.e(TAG, msg); eventsListener.errorOccurred(labelWidget.controlPanel, msg); return; } //Delegate to the listener on a separate thread TaskManager.getInstance().execute( new Runnable() { @Override public void run() { eventsListener.metadataChanged(labelWidget.controlPanel, labelWidget); } }); }//MetadataChanged } LayoutHintsType.java000066400000000000000000000033251262264444500362310ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * Possible types of layout hints */ public enum LayoutHintsType { VERTICAL_LINEAR((short)1), HORIZONTAL_LINEAR((short)2), ; /** * The key number */ public final short ID; /** * Constructor * @param id */ private LayoutHintsType(short id) { ID = id; } /** * Search for the enum by the given id * If not found returns NULL * @param id * @return Enum type by the given id */ public static LayoutHintsType getEnumById(short id) { LayoutHintsType retType = null; for (LayoutHintsType type : LayoutHintsType.values()) { if ( id == type.ID ) { retType = type; break; } } return retType; }//getEnumById } ListPropertyWidget.java000066400000000000000000000472471262264444500367430ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.ProxyBusObject; import org.alljoyn.bus.Variant; import org.alljoyn.bus.VariantTypeReference; import org.alljoyn.bus.ifaces.Properties; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; import org.alljoyn.ioe.controlpanelservice.communication.CommunicationUtil; import org.alljoyn.ioe.controlpanelservice.communication.ConnectionManager; import org.alljoyn.ioe.controlpanelservice.communication.IntrospectionNode; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControlSuper; import org.alljoyn.ioe.controlpanelservice.ui.ajstruct.ListPropertyWidgetRecordAJ; import android.util.Log; /** * List of Property Widget */ public class ListPropertyWidget extends UIElement { private static final String TAG = "cpan" + ListPropertyWidget.class.getSimpleName(); /** * The Record object of the {@link ListPropertyWidget} */ public static class Record { /** * Record Id */ private short recordId; /** * Record label */ private String label; /** * Constructor * @param recordId * @param label */ private Record(short recordId, String label) { this.recordId = recordId; this.label = label; } public short getRecordId() { return recordId; } public String getLabel() { return label; } @Override public String toString() { return recordId + ":'" + label + "'"; }//toString } //========================================// private static final int ENABLED_MASK = 0x01; /** * The remote list of property object */ private ListPropertyControlSuper remoteControl; /** * Whether the ui object is enabled */ private boolean enabled; /** * The UI widget label
* An optional field */ private String label; /** * The background color
* An optional field */ private Integer bgColor; /** * The widget rendering hints */ private List hints; /** * The Input Form Container widget introspection node to be used to create a {@link ContainerWidget} */ private IntrospectionNode containerIntroNode; /** * The Input Form Container Widget interface */ private String containerIfname; /** * The input form container */ private ContainerWidget inputFormContainer; /** * Constructor * @param ifName * @param objectPath * @param controlPanel * @param children * @throws ControlPanelException */ public ListPropertyWidget(String ifName, String objectPath, DeviceControlPanel controlPanel, List children) throws ControlPanelException { super(UIElementType.LIST_PROPERTY_WIDGET, ifName, objectPath, controlPanel, children); } public boolean isEnabled() { return enabled; } public String getLabel() { return label; } public Integer getBgColor() { return bgColor; } public List getHints() { return hints; } /** * @return Returns a list of the {@link Record} objects.
* Each object has a necessary data to control the input form * @throws ControlPanelException If failed to read the remote property value */ public List getValue() throws ControlPanelException { Log.d(TAG, "getValue() called, device: '" + device.getDeviceId() + "' objPath: '" + objectPath + "'"); List records; try { ListPropertyWidgetRecordAJ[] recordsAJ = remoteControl.getValue(); records = createListOfRecords(recordsAJ); } catch(BusException be) { String msg = "Failed to call getValue(), objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } return records; }//getValue /** * Prepares the input form for adding a new record to the list.
* Complete filling the added form by calling the {@link ListPropertyWidget#confirm()} or the {@link ListPropertyWidget#cancel()} methods * @return A form {@link ContainerWidget} to be filled * @throws ControlPanelException If failed to call the add method on the remote object */ public ContainerWidget add() throws ControlPanelException { Log.d(TAG, "Add() called, device: '" + device.getDeviceId() + "' objPath: '" + objectPath + "'"); try { remoteControl.Add(); } catch (BusException be) { String msg = "Failed to call Add(), objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } if ( inputFormContainer == null ) { createContainerWidget(); } return inputFormContainer; }//add /** * Prepares the form for view the record prior to the delete action.
* Complete deleting the form by calling the {@link ListPropertyWidget#confirm()} or the {@link ListPropertyWidget#cancel()} methods * @param recordId The record id of the deleted form * @throws ControlPanelException If failed to call the delete method on the remote object */ public void delete(short recordId) throws ControlPanelException { Log.d(TAG, "Delete() called, device: '" + device.getDeviceId() + "' objPath: '" + objectPath + "'"); try { remoteControl.Delete(recordId); } catch (BusException be) { String msg = "Failed to call Delete(), objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//delete /** * Prepare the display form to view the record identified by the record id. * @param recordId The record id of the shown form * @return A form {@link ContainerWidget} to be shown * @throws ControlPanelException If failed to call the view method on the remote object */ public ContainerWidget view(short recordId) throws ControlPanelException { Log.d(TAG, "View() called, device: '" + device.getDeviceId() + "' objPath: '" + objectPath + "'"); try { remoteControl.View(recordId); } catch (BusException be) { String msg = "Failed to call View(), objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } if ( inputFormContainer == null ) { createContainerWidget(); } return inputFormContainer; }//view /** * Prepare the input form to view the record identified by the record id * @param recordId The record id of the updated form
* Complete updating the form by calling the {@link ListPropertyWidget#confirm()} or the {@link ListPropertyWidget#cancel()} methods * @return A form {@link ContainerWidget} to be updated * @throws ControlPanelException If failed to call the update method on the remote object */ public ContainerWidget update(short recordId) throws ControlPanelException { Log.d(TAG, "Update() called, device: '" + device.getDeviceId() + "' objPath: '" + objectPath + "'"); try { remoteControl.Update(recordId); } catch (BusException be) { String msg = "Failed to call Update(), objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } if ( inputFormContainer == null ) { createContainerWidget(); } return inputFormContainer; }//update /** * Confirm the action and save the change requested * @throws ControlPanelException If failed to call the confirm method on the remote object */ public void confirm() throws ControlPanelException { Log.d(TAG, "Confirm() called, device: '" + device.getDeviceId() + "' objPath: '" + objectPath + "'"); try { remoteControl.Confirm(); } catch (BusException be) { String msg = "Failed to call Confirm(), objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//confirm /** * Cancel the current action * @throws ControlPanelException If failed to call the cancel method on the remote object */ public void cancel() throws ControlPanelException { Log.d(TAG, "Cancel() called, device: '" + device.getDeviceId() + "' objPath: '" + objectPath + "'"); try { remoteControl.Cancel(); } catch (BusException be) { String msg = "Failed to call Cancel(), objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//cancel //============================================// /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setRemoteController() */ @Override protected void setRemoteController() throws ControlPanelException { WidgetFactory widgetFactory = WidgetFactory.getWidgetFactory(ifName); if ( widgetFactory == null ) { String msg = "Received an unrecognized interface name: '" + ifName + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } Class ifClass = widgetFactory.getIfaceClass(); ProxyBusObject proxyObj = ConnectionManager.getInstance().getProxyObject( device.getSender(), objectPath, sessionId, new Class[]{ ifClass, Properties.class } ); Log.d(TAG, "Setting remote control ListOfProperties widget, objPath: '" + objectPath + "'"); properties = proxyObj.getInterface(Properties.class); remoteControl = (ListPropertyControlSuper) proxyObj.getInterface(ifClass); try { this.version = remoteControl.getVersion(); } catch (BusException e) { String msg = "Failed to call getVersion for element: '" + elementType + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//setRemoteController /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#registerSignalHandler() */ @Override protected void registerSignalHandler() throws ControlPanelException { Method listMetaDataChanged = CommunicationUtil.getListPropertyWidgetSignal("MetadataChanged"); if ( listMetaDataChanged == null ) { String msg = "ListPropertyWidget, MetadataChanged method isn't defined"; Log.e(TAG, msg); throw new ControlPanelException(msg); } Method listValueChanged = CommunicationUtil.getListPropertyWidgetSignal("ValueChanged"); if ( listValueChanged == null ) { String msg = "ListPropertyWidget, ValueChanged method isn't defined"; Log.e(TAG, msg); throw new ControlPanelException(msg); } try { Log.d(TAG, "ListPropertyWidget objPath: '" + objectPath + "', registering signal handler 'MetadataChanged'"); registerSignalHander(new ListPropertyWidgetSignalHandler(this), listMetaDataChanged); Log.d(TAG, "ListPropertyWidget objPath: '" + objectPath + "', registering signal handler 'ValueChanged'"); registerSignalHander(new ListPropertyWidgetSignalHandler(this), listValueChanged); }//try catch (ControlPanelException cpe) { String msg = "Device: '" + device.getDeviceId() + "', ListPropertyWidget, failed to register signal handler, Error: '" + cpe.getMessage() + "'"; Log.e(TAG, msg); controlPanel.getEventsListener().errorOccurred(controlPanel, msg); } }//registerSignalHandler /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setProperty(java.lang.String, org.alljoyn.bus.Variant) */ @Override protected void setProperty(String propName, Variant propValue) throws ControlPanelException { try { if( "States".equals(propName) ) { int states = propValue.getObject(int.class); enabled = (states & ENABLED_MASK) == ENABLED_MASK; } else if ( "OptParams".equals(propName) ) { Map optParams = propValue.getObject(new VariantTypeReference>() {}); fillOptionalParams(optParams); } } catch(BusException be) { throw new ControlPanelException("Failed to unmarshal the property: '" + propName + "', Error: '" + be.getMessage() + "'"); } }//setProperty /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#createChildWidgets() */ @Override protected void createChildWidgets() throws ControlPanelException { int size = children.size(); if ( size == 0 || size > 1 ) { throw new ControlPanelException("ListPropertyWidget has a wrong number of child elements, the child num is: '" + size + "'"); } IntrospectionNode childNode = children.get(0); List interfaces = childNode.getInterfaces(); //Search for existence of the AlertDialog interface for (String ifName : interfaces) { if ( !ifName.startsWith(ControlPanelService.INTERFACE_PREFIX + ".") ) { Log.v(TAG, "Found not a ControlPanel interface: '" + ifName + "'"); continue; } //Check the ControlPanel interface WidgetFactory widgFactory = WidgetFactory.getWidgetFactory(ifName); if ( widgFactory == null ) { String msg = "Received an unknown ControlPanel interface: '" + ifName + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } //Found a known interface, check whether it's a Container if ( widgFactory.getElementType() == UIElementType.CONTAINER ) { containerIntroNode = childNode; containerIfname = ifName; return; } }//for :: interfaces throw new ControlPanelException("ListPropertyWidget objPath: '" + objectPath + "', does not have a ContainerWidget interface"); }//createChildWidgets /** * Creates the {@link ContainerWidget} which is used as an input form for the {@link ListPropertyWidget} * @throws ControlPanelException If failed to create the widget */ private void createContainerWidget() throws ControlPanelException { if ( containerIntroNode == null || containerIfname == null ) { throw new ControlPanelException("ListProperty objPath: '" + objectPath + "' can't create the input form ContainerWidget, IntrospectionNode is undefined"); } String path = containerIntroNode.getPath(); Log.i(TAG, "ListProperty objPath: '" + objectPath + "', has a Container element, objPath: '" + path + "', creating..."); inputFormContainer = new ContainerWidget(containerIfname, path, controlPanel, containerIntroNode.getChidren()); }//createContainerWidget /** * Creates a list of records * @param recordsAJ The list of records received from the remote device * @return List of records */ private List createListOfRecords(ListPropertyWidgetRecordAJ[] recordsAJ) { List records = new LinkedList(); if ( recordsAJ == null ) { return records; } for (ListPropertyWidgetRecordAJ recordAJ : recordsAJ) { Record record = new Record(recordAJ.recordId, recordAJ.label); records.add(record); } return records; }//createListOfRecords /** * Fill the ListOfProperties optional parameters * @param valueType The value type of this property * @param propertyMetadata To be filled with the optional parameters * @throws ControlPanelException if failed to read optional parameters */ private void fillOptionalParams(Map optParams) throws ControlPanelException { // Add optional parameters Log.d(TAG, "ListOfProperties - scanning optional parameters"); for (ListPropertyWidgetEnum optKeyEnum : ListPropertyWidgetEnum.values()) { Variant optParam = optParams.get(optKeyEnum.ID); if ( optParam == null ) { Log.v(TAG, "OptionalParameter: '" + optKeyEnum + "', is not found"); continue; } Log.v(TAG, "Found OptionalParameter: '" + optKeyEnum + "'"); try { switch (optKeyEnum) { case LABEL: { label = optParam.getObject(String.class); break; } case BG_COLOR: { bgColor = optParam.getObject(int.class); break; } case HINTS: { short[] listOfPropertiesHints = optParam.getObject(short[].class); setListOfPropertyWidgetHints(listOfPropertiesHints); break; } }//switch }//try catch(BusException be) { throw new ControlPanelException("Failed to unmarshal optional parameters for ListOfProperties objPath: '" + objectPath + "'"); } }//for }//fillOptionalParams /** * Iterates over the hintIds array and fills list of {@link ListPropertyWidgetHintsType} * @param hintIds Ids of the widget hints * @return */ private void setListOfPropertyWidgetHints(short[] hintIds) { Log.v(TAG, "ListOfProperty objPath: '" + objectPath + "', filling ListOfProperties hints"); this.hints = new ArrayList( hintIds.length ); for (short hId : hintIds) { ListPropertyWidgetHintsType hintType = ListPropertyWidgetHintsType.getEnumById(hId); if (hintType == null) { Log.w(TAG, "Received unrecognized hintId: '" + hId + "', ignoring"); continue; } hints.add(hintType); }//for :: hintId }//setListOfPropertyWidgetHints } ListPropertyWidgetEnum.java000066400000000000000000000026451262264444500375610ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * Optional parameter keys of {@link ListPropertyWidget} */ public enum ListPropertyWidgetEnum { LABEL((short)0), BG_COLOR((short)1), HINTS((short)2), ; /** * The key number */ public final short ID; /** * Constructor * @param id */ private ListPropertyWidgetEnum(short id) { ID = id; } } ListPropertyWidgetHintsType.java000066400000000000000000000036351262264444500406040ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * Possible types of list of properties UI hints */ public enum ListPropertyWidgetHintsType { DYNAMIC_SPINNER((short)1); /** * The key number */ public final short ID; /** * Constructor * @param id */ private ListPropertyWidgetHintsType(short id) { ID = id; } /** * Search for the enum by the given id * If not found returns NULL * @param id * @return Enum type by the given id */ public static ListPropertyWidgetHintsType getEnumById(short id) { ListPropertyWidgetHintsType retType = null; for (ListPropertyWidgetHintsType type : ListPropertyWidgetHintsType.values()) { if ( id == type.ID ) { retType = type; break; } } return retType; }//getEnumById } ListPropertyWidgetSignalHandler.java000066400000000000000000000143571262264444500413730ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.util.List; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.communication.TaskManager; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControlSecured; import org.alljoyn.ioe.controlpanelservice.ui.ListPropertyWidget.Record; import org.alljoyn.ioe.controlpanelservice.ui.ajstruct.ListPropertyWidgetRecordAJ; import android.util.Log; /** * The class is a signal handler that is responsible to receive signals of ListPropertyControl interface.
* Signals:
* - ValueChanged
* - MetadataChanged */ public class ListPropertyWidgetSignalHandler implements ListPropertyControl, ListPropertyControlSecured { private static final String TAG = "cpan" + ListPropertyWidgetSignalHandler.class.getSimpleName(); /** * The {@link ListPropertyWidget} to be notified about the receiving the signals */ private ListPropertyWidget listPropertyWidget; /** * Constructor * @param listPropertyWidget */ public ListPropertyWidgetSignalHandler(ListPropertyWidget listPropertyWidget) { this.listPropertyWidget = listPropertyWidget; } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl#getVersion() */ @Override public short getVersion() throws BusException { return 0; } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl#getStates() */ @Override public int getStates() throws BusException { return 0; } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl#getOptParams() */ @Override public Map getOptParams() throws BusException { return null; } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl#getValue() */ @Override public ListPropertyWidgetRecordAJ[] getValue() throws BusException { return null; } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl#Add() */ @Override public void Add() throws BusException { } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl#Delete(short) */ @Override public void Delete(short recordId) throws BusException { } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl#View(short) */ @Override public void View(short recordId) throws BusException { } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl#Update(short) */ @Override public void Update(short recordId) throws BusException { } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl#Confirm() */ @Override public void Confirm() throws BusException { } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl#Cancel() */ @Override public void Cancel() throws BusException { // TODO Auto-generated method stub } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl#ValueChanged() */ @Override public void ValueChanged() throws BusException { ControlPanelEventsListener eventsListener = listPropertyWidget.controlPanel.getEventsListener(); String msg = "Device: '" + listPropertyWidget.device.getDeviceId() + "', ListProperty: '" + listPropertyWidget.objectPath + "', received VALUE_CHANGED signal"; Log.d(TAG, msg); try { List records = listPropertyWidget.getValue(); eventsListener.valueChanged(listPropertyWidget.controlPanel, listPropertyWidget, records); } catch (ControlPanelException cpe) { msg += ", but failed to read the new values, Error: '" + cpe.getMessage() + "'"; Log.e(TAG, msg); eventsListener.errorOccurred(listPropertyWidget.controlPanel, msg); } }//ValueChanged /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl#MetadataChanged() */ @Override public void MetadataChanged() throws BusException { String msg = "Device: '" + listPropertyWidget.device.getDeviceId() + "', ListProperty: '" + listPropertyWidget.objectPath + "', received METADATA_CHANGED signal"; Log.d(TAG, msg); final ControlPanelEventsListener eventsListener = listPropertyWidget.controlPanel.getEventsListener(); try { listPropertyWidget.refreshProperties(); } catch(ControlPanelException cpe) { msg += ", but failed to refresh the widget properties"; Log.e(TAG, msg); eventsListener.errorOccurred(listPropertyWidget.controlPanel, msg); return; } //Delegate to the listener on a separate thread TaskManager.getInstance().execute( new Runnable() { @Override public void run() { eventsListener.metadataChanged(listPropertyWidget.controlPanel, listPropertyWidget); } }); }//MetadataChanged } PropertyWidget.java000066400000000000000000000623231262264444500360770ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.lang.reflect.Method; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.ProxyBusObject; import org.alljoyn.bus.Variant; import org.alljoyn.bus.VariantTypeReference; import org.alljoyn.bus.VariantUtil; import org.alljoyn.bus.ifaces.Properties; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.communication.CommunicationUtil; import org.alljoyn.ioe.controlpanelservice.communication.ConnectionManager; import org.alljoyn.ioe.controlpanelservice.communication.IntrospectionNode; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.PropertyControlSuper; import org.alljoyn.ioe.controlpanelservice.ui.ajstruct.PropertyWidgetConstrainToValuesAJ; import org.alljoyn.ioe.controlpanelservice.ui.ajstruct.PropertyWidgetRangeConstraintAJ; import org.alljoyn.ioe.controlpanelservice.ui.ajstruct.PropertyWidgetThreeShortAJ; import android.util.Log; /** * Property widget */ public class PropertyWidget extends UIElement { private static final String TAG = "cpan" + PropertyWidget.class.getSimpleName(); /** * The possible types that {@link PropertyWidget} can be casted.
* The {@link PropertyWidget} type is defined according to the received DBus signature. */ public static enum ValueType { BOOLEAN, DOUBLE, INT, SHORT, STRING, LONG, BYTE, DATE, TIME ; } //=================================================// /** * The class defines a range constraint of {@link PropertyWidget}
* The generic type designates the actual type of the property value */ public static class RangeConstraint { /** * The min value with the same type as that of the property */ private T min; /** * The max value with the same type as that of the property */ private T max; /** * The increment/decrement value with the same type as that of the property */ private T increment; /** * Conctructor * @param min The min value with the same type as that of the property * @param max The max value with the same type as that of the property * @param increment The increment/decrement value with the same type as that of the property
* The generic type designates the actual type of the property value */ public RangeConstraint(T min, T max, T increment) { this.min = min; this.max = max; this.increment = increment; } /** * The min value with the same type as that of the property */ public T getMin() { return min; } /** * The max value with the same type as that of the property */ public T getMax() { return max; } /** * The increment/decrement value with the same type as that of the property */ public T getIncrement() { return increment; } } //=====================================================// /** * The class define a single entry of the List-Of-Values constraint
* {@link PropertyWidget#listOfValuesConstraint}
* The generic type designates the actual type of the property value */ public static class ConstrainToValues { /** * Constraint value */ private T value; /** * The value to be displayed */ private String label; /** * Constructor * @param value Constraint value * @param label The value to be displayed */ public ConstrainToValues(T value, String label) { super(); this.value = value; this.label = label; } /** * Constraint value * @return The constraint value */ public T getValue() { return value; } /** * The value to be displayed * @return The label content */ public String getLabel() { return label; } } //=====================================================// /** * The class defines the {@link ValueType#DATE} object of the {@link PropertyWidget} */ public static class Date { private short day; private short month; private short year; public static final short TYPE_CODE = 0; public short getDay() { return day; } public void setDay(short day) { this.day = day; } public short getMonth() { return month; } public void setMonth(short month) { this.month = month; } public short getYear() { return year; } public void setYear(short year) { this.year = year; } @Override public String toString() { return day + "/" + month + "/" + year; } } //=====================================================// /** * The class defines the {@link ValueType#TIME} object of the {@link PropertyWidget} */ public static class Time { private short hour; private short minute; private short second; public static final short TYPE_CODE = 1; public short getHour() { return hour; } public void setHour(short hour) { this.hour = hour; } public short getMinute() { return minute; } public void setMinute(short minute) { this.minute = minute; } public short getSecond() { return second; } public void setSecond(short second) { this.second = second; } @Override public String toString() { return hour + ":" + minute + ":" + second; } } //=====================================================// // END OF NESTED CLASSES // //=====================================================// private static final int ENABLED_MASK = 0x01; private static final int WRITABLE_MASK = 0x02; /** * The remote property object */ private PropertyControlSuper remoteControl; /** * The property value dbus signature */ private String signature; /** * Use this variable for decision to what type the property currentValue should be casted */ private ValueType valueType; /** * The propertyWidget type used to unmarshal the property value from a Variant type */ private Type conversionType; /** * Property label
* Not required to be set */ private String label; /** * The property unit of measure
* Not required to be set */ private String unitOfMeasure; /** * The background color *
* Not required to be set */ private Integer bgColor; /** * Whether the property is enabled
* Not required to be set */ private boolean enabled; /** * Does the property has a permits a read & write *
* Not required to be set */ private boolean writable; /** * The list of value constraints *
* Not required to be set */ private List> listOfValuesConstraint; /** * Stores PropertyRange constraint *
* Not required to be set */ private RangeConstraint propertyRangeConstraint; /** * The widget rendering hints */ private List hints; /** * Optional parameters */ private Map optParams; /** * Constructor * @param ifName * @param objectPath * @param controlPanel * @param children * @throws ControlPanelException */ public PropertyWidget(String ifName, String objectPath, DeviceControlPanel controlPanel, List children) throws ControlPanelException { super(UIElementType.PROPERTY_WIDGET, ifName, objectPath, controlPanel, children); } /** * @return Returns the current property value of the remote controllable device * @throws ControlPanelException If failed to read the remote current property value */ public Object getCurrentValue() throws ControlPanelException { Object retValue; Log.d(TAG, "getCurrentValue called, device: '" + device.getDeviceId() + "' objPath: '" + objectPath + "'"); try{ Variant currValVar = remoteControl.getValue(); retValue = unmarshalCurrentValue(currValVar); } catch(BusException be) { String msg = "Failed to getCurrentValue, objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } return retValue; }//getValue /** * @param newValue Set the new property value to the remote controllable device * @throws ControlPanelException If failed to set the new property value */ public void setCurrentValue(Object newValue) throws ControlPanelException { Log.i(TAG, "setCurrentValue called, device: '" + device.getDeviceId() + "' objPath: '" + objectPath + "', value: '" + newValue + "'"); if ( newValue == null ) { throw new ControlPanelException("PropertyWidget: '" + objectPath + "', the new value can't be NULL"); } try { if ( valueType == ValueType.DATE ) { Date dt = (Date)newValue; PropertyWidgetThreeShortAJ struct = new PropertyWidgetThreeShortAJ(); struct.dataType = Date.TYPE_CODE; struct.data = new PropertyWidgetThreeShortAJ.ThreeShortAJ(); struct.data.var1 = dt.day; struct.data.var2 = dt.month; struct.data.var3 = dt.year; remoteControl.setValue( new Variant(struct, signature) ); }//if DATE_TIME else if ( valueType == ValueType.TIME ) { PropertyWidgetThreeShortAJ struct = new PropertyWidgetThreeShortAJ(); Time time = (Time)newValue; struct.dataType = Time.TYPE_CODE; struct.data = new PropertyWidgetThreeShortAJ.ThreeShortAJ(); struct.data.var1 = time.hour; struct.data.var2 = time.minute; struct.data.var3 = time.second; remoteControl.setValue( new Variant(struct, signature) ); } else { remoteControl.setValue( new Variant(newValue, signature) ); } }//try catch(BusException be) { String msg = "Failed to setCurrentValue objPath: '" + objectPath + "', Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//setCurrentValue public String getSignature() { return signature; } /** * @return Returns the list of value constraints.
* Each constraint value stored in {@link ConstrainToValues} */ public List> getListOfConstraint() { return listOfValuesConstraint; } /** * Use the type for casting the property value returned from getCurrentValue * @return PropertyValueType */ public ValueType getValueType() { return valueType; } public String getLabel() { return label; } public String getUnitOfMeasure() { return unitOfMeasure; } public Integer getBgColor() { return bgColor; } public boolean isEnabled() { return enabled; } public boolean isWritable() { return writable; } public RangeConstraint getPropertyRangeConstraint() { return propertyRangeConstraint; } public List getHints() { return hints; } //=============================================================// /** * Unmarshal the current value from Variant object * @param curValVar The variant object * @return The unmarshalled value * @throws ControlPanelException If failed to unmarshal the current value from variant */ Object unmarshalCurrentValue(Variant curValVar) throws ControlPanelException { Object retVal; try { if ( valueType == ValueType.DATE ) { Date retDate = new Date(); PropertyWidgetThreeShortAJ struct = curValVar.getObject(PropertyWidgetThreeShortAJ.class); retDate.day = struct.data.var1; retDate.month = struct.data.var2; retDate.year = struct.data.var3; retVal = retDate; } else if ( valueType == ValueType.TIME ) { Time retTime = new Time(); PropertyWidgetThreeShortAJ struct = curValVar.getObject(PropertyWidgetThreeShortAJ.class); retTime.hour = struct.data.var1; retTime.minute = struct.data.var2; retTime.second = struct.data.var3; retVal = retTime; } else { retVal = curValVar.getObject(conversionType); } }//try catch(BusException be) { String msg = "Failed to unmarshal current property value, Error: '" + be.getMessage() + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } return retVal; }//unmarshalCurrentValue /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setRemoteController() */ @Override protected void setRemoteController() throws ControlPanelException { WidgetFactory widgetFactory = WidgetFactory.getWidgetFactory(ifName); if ( widgetFactory == null ) { String msg = "Received an unrecognized interface name: '" + ifName + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } Class ifClass = widgetFactory.getIfaceClass(); ProxyBusObject proxyObj = ConnectionManager.getInstance().getProxyObject( device.getSender(), objectPath, sessionId, new Class[]{ ifClass, Properties.class } ); Log.d(TAG, "Setting remote control PropertyWidget, objPath: '" + objectPath + "'"); properties = proxyObj.getInterface(Properties.class); remoteControl = (PropertyControlSuper) proxyObj.getInterface(ifClass); try { this.version = remoteControl.getVersion(); } catch (BusException e) { String msg = "Failed to call getVersion for element: '" + elementType + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } }//setRemoteController /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#registerSignalHandler() */ protected void registerSignalHandler() { try { Method propertyMetaDataChanged = CommunicationUtil.getPropertyMetadataChanged("MetadataChanged"); if ( propertyMetaDataChanged == null ) { String msg = "PropertyWidget, MetadataChanged method isn't defined"; Log.e(TAG, msg); throw new ControlPanelException(msg); } Method propertyValueChanged = CommunicationUtil.getPropertyValueChanged("ValueChanged"); if ( propertyValueChanged == null ) { String msg = "PropertyWidget, ValueChanged method isn't defined"; Log.e(TAG, msg); throw new ControlPanelException(msg); } Log.d(TAG, "PropertyWidget objPath: '" + objectPath + "', registering signal handler 'MetadataChanged'"); registerSignalHander(new PropertyWidgetSignalHandler(this), propertyMetaDataChanged); Log.d(TAG, "PropertyWidget objPath: '" + objectPath + "', registering signal handler 'ValueChanged'"); registerSignalHander(new PropertyWidgetSignalHandler(this), propertyValueChanged); }//try catch (ControlPanelException cpe) { String msg = "Device: '" + device.getDeviceId() + "', PropertyWidget, failed to register signal handler, Error: '" + cpe.getMessage() + "'"; Log.e(TAG, msg); controlPanel.getEventsListener().errorOccurred(controlPanel, msg); } }//registerSignalHandler //=============================================================// /** * One note fillOptionalParameter method needs the valueType for execution. Therefore there is a code that ensures that the valueType * will be defined before the fillOptionalParameter method is called * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#setProperty(java.lang.String, org.alljoyn.bus.Variant) */ @Override protected void setProperty(String propName, Variant propValue) throws ControlPanelException { try { if( "States".equals(propName) ) { int states = propValue.getObject(int.class); enabled = (states & ENABLED_MASK) == ENABLED_MASK; writable = (states & WRITABLE_MASK) == WRITABLE_MASK; } else if ( "OptParams".equals(propName) ) { optParams = propValue.getObject(new VariantTypeReference>() {}); if ( valueType != null ) { // The property type has been already realized, it's possible to call fillOptionalParams fillOptionalParams(optParams); optParams = null; } } else if ( "Value".equals(propName) ) { Variant value = propValue.getObject(Variant.class); definePropertyType(value); if ( optParams != null ) { // The OptionalParameters have been already set, call fillOptionalParams fillOptionalParams(optParams); optParams = null; } } }//try catch(BusException be) { throw new ControlPanelException("Failed to unmarshal the property: '" + propName + "', Error: '" + be.getMessage() + "'"); } }//setProperty /** * @see org.alljoyn.ioe.controlpanelservice.ui.UIElement#createChildWidgets() */ @Override protected void createChildWidgets() throws ControlPanelException { int size = children.size(); Log.d(TAG, "Test PropertyWidget validity - PropertyWidget can't has child nodes. #ChildNodes: '" + size + "'"); if ( size > 0 ) { throw new ControlPanelException("The PropertyWidget objPath: '" + objectPath + "' is not valid, found '" + size + "' child nodes"); } }//createChildWidgets /** * Define the property type from the given value * @param value * @throws ControlPanelException Is throws when failed to realize the property type */ private void definePropertyType(Variant value) throws ControlPanelException { if ( valueType != null ) { return; } try { signature = VariantUtil.getSignature(value); fromDbusSignatureToType(value); Log.d(TAG, "The PropertyWidget objPath: '" + objectPath + "', type is: '" + valueType + "', DbusSign: '" + signature + "'"); } catch (BusException be) { throw new ControlPanelException("Failed to read the property objPath: '" + objectPath + "' value, Error: '" + be.getMessage() + "'"); } }//realize /** * Converts from DBUS signature to the PropertyValueType * @param propValue the value * @throws ControlPanelException if the signature is of unsupported type */ private void fromDbusSignatureToType(Variant propValue) throws ControlPanelException { if ( "b".equals(signature) ) { valueType = ValueType.BOOLEAN; conversionType = boolean.class; } else if ( "d".equals(signature) ) { valueType = ValueType.DOUBLE; conversionType = double.class; } else if ( "s".equals(signature) ) { valueType = ValueType.STRING; conversionType = String.class; } else if ( "y".equals(signature) ) { valueType = ValueType.BYTE; conversionType = byte.class; } else if ( "n".equals(signature) || "q".equals(signature) ) { valueType = ValueType.SHORT; conversionType = short.class; } else if ( "i".equals(signature) || "u".equals(signature) ) { valueType = ValueType.INT; conversionType = int.class; } else if ( "t".equals(signature) || "x".equals(signature) ) { valueType = ValueType.LONG; conversionType = long.class; } //Handler 3q structure else if ( "(q(qqq))".equals(signature) ) { PropertyWidgetThreeShortAJ struct; try { struct = propValue.getObject(PropertyWidgetThreeShortAJ.class); } catch (BusException be) { throw new ControlPanelException("PropertyWidget objPath: '" + objectPath + "', failed to unmarshal value of sugnature: '" + signature + "'"); } switch ( struct.dataType ) { case Date.TYPE_CODE: { valueType = ValueType.DATE; conversionType = PropertyWidgetThreeShortAJ.class; break; } case Time.TYPE_CODE: { valueType = ValueType.TIME; conversionType = PropertyWidgetThreeShortAJ.class; break; } default: { throw new ControlPanelException("PropertyWidget objPath: '" + objectPath + "' belongs to an unsupported composite type: '" + signature + "'"); } }//switch }//if :: 3q struct else { throw new ControlPanelException("PropertyWidget objPath: '" + objectPath + "' belongs to an unsupported type: '" + signature + "'"); } }//fromDbusSignatureToType /** * Fill the PropertyWidget optional parameters * @param optParams The optinal parameters to fill * @throws ControlPanelException */ private void fillOptionalParams(Map optParams) throws ControlPanelException { // Add optional parameters Log.d(TAG, "PropertyWidget - scanning optional parameters"); for (PropertyWidgetEnum optKeyEnum : PropertyWidgetEnum.values()) { Variant optParam = optParams.get(optKeyEnum.ID); if ( optParam == null ) { Log.v(TAG, "OptionalParameter: '" + optKeyEnum + "', is not found"); continue; } Log.v(TAG, "Found OptionalParameter: '" + optKeyEnum + "'"); try { switch (optKeyEnum) { case LABEL: { label = optParam.getObject(String.class); break; } case UNIT_OF_MEASURE: { unitOfMeasure = optParam.getObject(String.class); break; } case BG_COLOR: { bgColor = optParam.getObject(int.class); break; } case CONSTRAINT_TO_VALUES: { PropertyWidgetConstrainToValuesAJ[] lovConsAJ = optParam.getObject( PropertyWidgetConstrainToValuesAJ[].class ); setListOfValuesConstraints(lovConsAJ); break; } case RANGE: { PropertyWidgetRangeConstraintAJ propRangeConsAJ = optParam.getObject( PropertyWidgetRangeConstraintAJ.class ); RangeConstraint propRangeCons = propRangeConsAJ.getPropertyWidgetRangeConstraint(valueType); if ( propRangeCons == null ) { throw new ControlPanelException("Fail to unmarshal a range constraint for PropertyWidget objPath: '" + objectPath + "'"); } this.propertyRangeConstraint = propRangeCons; break; } case HINTS: { short[] propertyWidgetHints = optParam.getObject(short[].class); setListOfPropertyWidgetHints(propertyWidgetHints); break; } }//switch }//try catch(BusException be) { throw new ControlPanelException("Failed to unmarshal optional parameters for PropertyWidget objPath: '" + objectPath + "'"); } }//for }//fillOptionalParams /** * Iterates over PropertyWidgetListOfValuesConstraintAJ[]. For each value call {@link PropertyWidgetConstrainToValuesAJ#getPropertyWidgetConstrainToValues(ValueType)} * to receive {@link ConstrainToValues} * @param * @param lovConsAJ Array of PropertyWidgetListOfValuesConstraintAJ * @param valueType The type of property value * @return List of values constraints or null on fail * @throws ControlPanelException If failed to unmarshal ConstaintToValues property */ private void setListOfValuesConstraints(PropertyWidgetConstrainToValuesAJ[] lovConsAJ) throws ControlPanelException { listOfValuesConstraint = new ArrayList>( lovConsAJ.length ); for (PropertyWidgetConstrainToValuesAJ consValueAJ : lovConsAJ) { ConstrainToValues consValue = consValueAJ.getPropertyWidgetConstrainToValues(valueType); if ( consValue == null ) { throw new ControlPanelException("PropertyWidget objPath: '" + objectPath + "', failed to unmarshal constraint value object"); } listOfValuesConstraint.add(consValue); }//for :: consAJ[] }//getListOfValuesConstraints /** * Iterates over the hintIds array and fills list of {@link PropertyWidgetHintsType} * @param hintIds Ids of the widget hints * @return */ private void setListOfPropertyWidgetHints(short[] hintIds) { Log.v(TAG, "PropertyWidget objPath: '" + objectPath + "', filling PropertyWidget hints"); this.hints = new ArrayList( hintIds.length ); for (short hId : hintIds) { PropertyWidgetHintsType hintType = PropertyWidgetHintsType.getEnumById(hId); if (hintType == null) { Log.w(TAG, "Received unrecognized hintId: '" + hId + "', ignoring"); continue; } hints.add(hintType); }//for :: hintId }//setListOfPropertyWidgetHints } PropertyWidgetEnum.java000066400000000000000000000026561262264444500367270ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * Optional parameters keys of {@link PropertyWidget} */ public enum PropertyWidgetEnum { LABEL((short)0), BG_COLOR((short)1), HINTS((short)2), UNIT_OF_MEASURE((short)3), CONSTRAINT_TO_VALUES((short)4), RANGE((short)5) ; /** * The key number */ public final short ID; /** * Constructor * @param id */ private PropertyWidgetEnum(short id) { ID = id; } } PropertyWidgetHintsType.java000066400000000000000000000042411262264444500377420ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * Possible types of property UI hints */ public enum PropertyWidgetHintsType { SWITCH((short)1), CHECKBOX((short)2), SPINNER((short)3), RADIO_BUTTON((short)4), SLIDER((short)5), TIME_PICKER((short)6), DATE_PICKER((short)7), NUMBER_PICKER((short)8), NUMERIC_KEYPAD((short)9), ROTARY_KNOB((short)10), TEXT_VIEW((short)11), NUMERIC_VIEW((short)12), EDIT_TEXT((short)13), ; /** * The key number */ public final short ID; /** * Constructor * @param id */ private PropertyWidgetHintsType(short id) { ID = id; } /** * Search for the enum by the given id * If not found returns NULL * @param id * @return Enum type by the given id */ public static PropertyWidgetHintsType getEnumById(short id) { PropertyWidgetHintsType retType = null; for (PropertyWidgetHintsType type : PropertyWidgetHintsType.values()) { if ( id == type.ID ) { retType = type; break; } } return retType; }//getEnumById } PropertyWidgetSignalHandler.java000066400000000000000000000115641262264444500405340ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.communication.TaskManager; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.PropertyControl; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.PropertyControlSecured; import android.util.Log; /** * The class is a signal handler that is responsible to receive signals of PropertyControl interface.
* Signals:
* - ValueChanged
* - MetadataChanged */ public class PropertyWidgetSignalHandler implements PropertyControlSecured, PropertyControl { private static final String TAG = "cpan" + PropertyWidgetSignalHandler.class.getSimpleName(); /** * Property widget to be notified about signal receiving */ private PropertyWidget propertyWidget; /** * @param propertyWidget */ public PropertyWidgetSignalHandler(PropertyWidget propertyWidget) { this.propertyWidget = propertyWidget; } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.PropertyControl#getVersion() */ @Override public short getVersion() throws BusException { return 0; } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.PropertyControl#getValue() */ @Override public Variant getValue() throws BusException { return null; } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.PropertyControl#setValue(org.alljoyn.bus.Variant) */ @Override public void setValue(Variant value) throws BusException { } @Override public int getStates() throws BusException { return 0; } @Override public Map getOptParams() throws BusException { return null; } /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.PropertyControl#ValueChanged(org.alljoyn.bus.Variant) */ @Override public void ValueChanged(Variant value) throws BusException { ControlPanelEventsListener eventsListener = propertyWidget.controlPanel.getEventsListener(); String msg = "Device: '" + propertyWidget.device.getDeviceId() + "', PropertyWidget: '" + propertyWidget.objectPath + "', received VALUE_CHANGED signal"; Log.d(TAG, msg); try { Object unmarshVal = propertyWidget.unmarshalCurrentValue(value); Log.d(TAG, "The new property: '" + propertyWidget.objectPath + "' value is: '" + unmarshVal + "'"); eventsListener.valueChanged(propertyWidget.controlPanel, propertyWidget, unmarshVal); } catch (ControlPanelException cpe) { msg += ", but failed to unmarshal the received data, Error: '" + cpe.getMessage() + "'"; Log.e(TAG, msg); eventsListener.errorOccurred(propertyWidget.controlPanel, msg); } }//ValueChanged /** * @see org.alljoyn.ioe.controlpanelservice.communication.interfaces.PropertyControl#MetadataChanged() */ @Override public void MetadataChanged() throws BusException { String msg = "Device: '" + propertyWidget.device.getDeviceId() + "', PropertyWidget: '" + propertyWidget.objectPath + "', received METADATA_CHANGED signal"; Log.d(TAG, msg); final ControlPanelEventsListener eventsListener = propertyWidget.controlPanel.getEventsListener(); try { propertyWidget.refreshProperties(); } catch(ControlPanelException cpe) { msg += ", but failed to refresh the widget properties"; Log.e(TAG, msg); eventsListener.errorOccurred(propertyWidget.controlPanel, msg); return; } //Delegate to the listener on a separate thread TaskManager.getInstance().execute( new Runnable() { @Override public void run() { eventsListener.metadataChanged(propertyWidget.controlPanel, propertyWidget); } }); }//MetadataChanged } UIElement.java000066400000000000000000000176511262264444500347420ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.lang.reflect.Method; import java.util.List; import java.util.Map; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.ifaces.Properties; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.ControllableDevice; import org.alljoyn.ioe.controlpanelservice.communication.IntrospectionNode; import org.alljoyn.ioe.controlpanelservice.communication.UIWidgetSignalHandler; import android.util.Log; /** * The parent class for another UI elements */ public abstract class UIElement { private static final String TAG = "cpan" + UIElement.class.getSimpleName(); /** * Element type */ protected UIElementType elementType; /** * The interface name this element is connected to the remote device */ protected String ifName; /** * The object path to the object with the UIContainer Interface */ protected String objectPath; /** * This {@link UIElement} child nodes after the introspection */ protected List children; /** * The proxy bus object of the remote device */ protected Properties properties; /** * The {@link DeviceControlPanel} the widget belongs to */ protected DeviceControlPanel controlPanel; /** * The controllable device this widget belongs to */ protected ControllableDevice device; /** * The session id in which this object is connected to the remote controlled object */ protected Integer sessionId; /** * The interface version */ protected short version; /** * Constructor * @param elementType The type of the element * @param objectPath The object path to the remote object * @throws ControlPanelException if failed to build the element */ public UIElement(UIElementType elementType, String ifName, String objectPath, DeviceControlPanel controlPanel, List children) throws ControlPanelException { this.elementType = elementType; this.ifName = ifName; this.objectPath = objectPath; this.children = children; this.controlPanel = controlPanel; this.device = controlPanel.getDevice(); this.sessionId = device.getSessionId(); if ( this.sessionId == null ) { throw new ControlPanelException("Failed to create widget: '" + elementType + "', objPath: '" + objectPath + "', session not established"); } setRemoteController(); versionCheck(); registerSignalHandler(); refreshProperties(); createChildWidgets(); }//Constructor public UIElementType getElementType() { return elementType; } public String getObjectPath() { return objectPath; } /** * Retrieve and set all the widget properties from the remote device * @throws ControlPanelException if failed to retrieve a property data from the remote device */ public void refreshProperties() throws ControlPanelException { Log.d(TAG, "Retreive the " + elementType + " properties, object path: '" + objectPath + "'"); Map props; try { props = properties.GetAll(ifName); } catch (BusException be) { throw new ControlPanelException("Failed to retreive properties for ifName: '" + ifName + "', Error: '" + be.getMessage() + "'"); } catch (Exception e) { throw new ControlPanelException("Unexpected error happened on retrieving properties for ifName: '" + ifName + "', Error: '" + e.getMessage() + "'"); } for(String propName : props.keySet() ) { Log.v(TAG, "Set property: '" + propName + "', object path: '" + objectPath + "'"); setProperty(propName, props.get(propName)); } }//refreshProperties /** * Returns the version number of this widget interface * @throws ControlPanelException if failed to call remote object * @return The widget version number */ public short getVersion() { return version; } /** * Performs version check of this interface version vs. the interface version of the remote device * @throws ControlPanelException If the interface version of the remote device is greater than the version of this interface */ protected void versionCheck() throws ControlPanelException { WidgetFactory widgFactory = WidgetFactory.getWidgetFactory(ifName); //Check the ControlPanel interface if ( widgFactory == null ) { String msg = "Received an unknown ControlPanel interface: '" + ifName + "'"; Log.e(TAG, msg); throw new ControlPanelException(msg); } Class ifaceClass = widgFactory.getIfaceClass(); try { short myVersion = ifaceClass.getDeclaredField("VERSION").getShort(short.class); Log.d(TAG, "Version check for interface: '" + ifName + "' my version is: '" + myVersion + "'" + " the remote device version is: '" + this.version + "'"); if ( this.version > myVersion ) { throw new ControlPanelException("Incompatible interface version: '" + ifName + "', my interface version is: '" + myVersion + "'" + " the remote device interface version is: '" + this.version + "'"); } } catch (Exception e) { throw new ControlPanelException("Failed to perform version check for interface: '" + ifName + "', unable to get the reflection of the VERSION field"); } }//versionCheck /** * Register signal handler of the given busObject and its signalHandlerMethod * @param signalReceiver The object that receives the signal * @param signalHandlerMethod The method that handles the signal * @throws ControlPanelException Thrown if failed to register signal handler */ protected void registerSignalHander(Object signalReceiver, Method signalHandlerMethod) throws ControlPanelException { UIWidgetSignalHandler signalHandler = new UIWidgetSignalHandler(objectPath, signalReceiver, signalHandlerMethod, ifName); signalHandler.register(); controlPanel.addSignalHandler(signalHandler); }//registerSignalHander /** * Set remote controller of the object * @throws ControlPanelException if failed to set remote control */ protected abstract void setRemoteController() throws ControlPanelException; /** * Register signal handler of the remote object * @throws ControlPanelException Thrown if failed to register signal handler */ protected abstract void registerSignalHandler() throws ControlPanelException; /** * Sets the specific property * @param propName The name of the property to be set * @param propValue The property value * @throws ControlPanelException If failed to set the property value */ protected abstract void setProperty(String propName, Variant propValue) throws ControlPanelException; /** * Create this element child widgets * @throws ControlPanelException */ protected abstract void createChildWidgets() throws ControlPanelException; } UIElementType.java000066400000000000000000000023371262264444500355770ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; /** * The types of all the UI elements */ public enum UIElementType { CONTAINER, PROPERTY_WIDGET, LIST_PROPERTY_WIDGET, ACTION_WIDGET, ALERT_DIALOG, LABEL_WIDGET, ERROR_WIDGET ; } WidgetFactory.java000066400000000000000000000210021262264444500356470ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.List; import java.util.Map; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.communication.IntrospectionNode; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ActionControl; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ActionControlSecured; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.AlertDialog; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.AlertDialogSecured; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.Container; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ContainerSecured; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.Label; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControl; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ListPropertyControlSecured; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.PropertyControl; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.PropertyControlSecured; import android.util.Log; /** * The factory class for the UI widgets */ public class WidgetFactory { private static final String TAG = "cpan" + WidgetFactory.class.getSimpleName(); /** * Whether the factory was initialized successfully */ private static boolean isInitialized = false; /** * The interface lookup */ private static Map ifaceLookup = new HashMap(); static { init(); } private String iface; /** * The class reflection of the AJ interface */ private Class ifaceClass; /** * The constructor reflection of the widget class */ private Constructor constructor; /** * The element type */ private UIElementType elementType; /** * Whether the created widget is a top level object */ private boolean isTopLevelObj; private static void init () { try { ifaceLookup.put(ActionControl.IFNAME, new WidgetFactory(ActionControl.IFNAME, ActionControl.class, getConstructorReflection(ActionWidget.class), UIElementType.ACTION_WIDGET, false)); ifaceLookup.put(ActionControlSecured.IFNAME, new WidgetFactory(ActionControlSecured.IFNAME, ActionControlSecured.class, getConstructorReflection(ActionWidget.class), UIElementType.ACTION_WIDGET, false)); ifaceLookup.put(Container.IFNAME, new WidgetFactory(Container.IFNAME, Container.class, getConstructorReflection(ContainerWidget.class), UIElementType.CONTAINER, true)); ifaceLookup.put(ContainerSecured.IFNAME, new WidgetFactory(ContainerSecured.IFNAME, ContainerSecured.class, getConstructorReflection(ContainerWidget.class), UIElementType.CONTAINER, true)); ifaceLookup.put(AlertDialog.IFNAME, new WidgetFactory(AlertDialog.IFNAME, AlertDialog.class, getConstructorReflection(AlertDialogWidget.class), UIElementType.ALERT_DIALOG, true)); ifaceLookup.put(AlertDialogSecured.IFNAME, new WidgetFactory(AlertDialogSecured.IFNAME, AlertDialogSecured.class, getConstructorReflection(AlertDialogWidget.class), UIElementType.ALERT_DIALOG, true)); ifaceLookup.put(PropertyControl.IFNAME, new WidgetFactory(PropertyControl.IFNAME, PropertyControl.class, getConstructorReflection(PropertyWidget.class), UIElementType.PROPERTY_WIDGET, false)); ifaceLookup.put(PropertyControlSecured.IFNAME, new WidgetFactory(PropertyControlSecured.IFNAME, PropertyControlSecured.class, getConstructorReflection(PropertyWidget.class), UIElementType.PROPERTY_WIDGET, false)); ifaceLookup.put(Label.IFNAME, new WidgetFactory(Label.IFNAME, Label.class, getConstructorReflection(LabelWidget.class), UIElementType.LABEL_WIDGET, false)); ifaceLookup.put(ListPropertyControl.IFNAME, new WidgetFactory(ListPropertyControl.IFNAME, ListPropertyControl.class, getConstructorReflection(ListPropertyWidget.class), UIElementType.LIST_PROPERTY_WIDGET, false)); ifaceLookup.put(ListPropertyControlSecured.IFNAME, new WidgetFactory(ListPropertyControlSecured.IFNAME, ListPropertyControlSecured.class, getConstructorReflection(ListPropertyWidget.class), UIElementType.LIST_PROPERTY_WIDGET, false)); isInitialized = true; } catch(Exception e) { Log.e(TAG, "Failed to initialize widget factory, Error: '" + e.getMessage() + "'"); isInitialized = false; } }//init /** * @return Whether the {@link WidgetFactory} is successfully initialized */ public static boolean isInitialized() { return isInitialized; } /** * @param ifName The interface name to look for the appropriate factory * @return Return {@link WidgetFactory} if the ifName is a known interface and WidgetFactory was initialized successfully, * otherwise returns NULL */ public static WidgetFactory getWidgetFactory(String ifName) { if ( !isInitialized ) { return null; } Log.d(TAG, "getWidgetFactory() is looking for the interface '" + ifName + "'"); return ifaceLookup.get(ifName); }//getWidgetFactory /** * Constructor * @param iface The name of the AJ interface * @param ifaceClass The class reflection object of the AJ interface * @param constructor The constructor reflection of the widget class * @param elementType The element type * @param isTopLevelObj Whether the built element is a top level object */ private WidgetFactory(String iface, Class ifaceClass, Constructor constructor, UIElementType elementType, boolean isTopLevelObj) { this.iface = iface; this.ifaceClass = ifaceClass; this.constructor = constructor; this.elementType = elementType; this.isTopLevelObj = isTopLevelObj; } /** * @param widgClass * @return Returns constructor object of the received class * @throws NoSuchMethodException */ private static Constructor getConstructorReflection(Class widgClass) throws NoSuchMethodException { return widgClass.getConstructor( String.class, String.class, DeviceControlPanel.class, List.class ); }//getConstructorReflection public String getIface() { return iface; } public Class getIfaceClass() { return ifaceClass; } public UIElementType getElementType() { return elementType; } public boolean isTopLevelObj() { return isTopLevelObj; } /** * Create the {@link UIElement} * @param objectPath * @param controlPanel * @param children * @return Return the {@link UIElement} if create succeeded or NULL if failed to create the object * @throws ControlPanelException */ public UIElement create(String objectPath, DeviceControlPanel controlPanel, List children) throws ControlPanelException { Log.i(TAG, "Create element: '" + elementType + "' objPath: '" + objectPath + "'"); UIElement retValue; try { retValue = (UIElement) constructor.newInstance(iface, objectPath, controlPanel, children); } catch (InvocationTargetException ite) { String invokeError = ite.getTargetException().getMessage(); Log.e(TAG, "Error happened when invoking the constructor of '" + elementType + "', Error: '" + invokeError + "'"); throw new ControlPanelException(invokeError); } catch (Exception e) { Log.e(TAG, "Unexpected error happened, failed to create the UIElement: '" + elementType + "'"); throw new ControlPanelException(e); } return retValue; }//create } ajstruct/000077500000000000000000000000001262264444500340755ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/uiListPropertyWidgetRecordAJ.java000066400000000000000000000025101262264444500421340ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/ajstruct/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui.ajstruct; import org.alljoyn.bus.annotation.Position; import org.alljoyn.ioe.controlpanelservice.ui.ListPropertyWidget; /** * The value of the {@link ListPropertyWidget} */ public class ListPropertyWidgetRecordAJ { @Position(0) public short recordId; @Position(1) public String label; } PropertyWidgetConstrainToValuesAJ.java000066400000000000000000000064471262264444500435220ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/ajstruct/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui.ajstruct; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.Position; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget.ConstrainToValues; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget.ValueType; import android.util.Log; public class PropertyWidgetConstrainToValuesAJ { @Position(0) public Variant value; @Position(1) public String label; /** * Returns single object of PropertyWidget list of values * @param valueType The property type of value * @return */ public ConstrainToValues getPropertyWidgetConstrainToValues(ValueType valueType) { Log.v("cpan" + PropertyWidgetConstrainToValuesAJ.class.getSimpleName(), "Unmarshalling PropertyWidget LOV constraint, label: '" + label + "'"); try { switch (valueType) { case BOOLEAN: { Boolean valueCast = value.getObject(boolean.class); return new ConstrainToValues(valueCast, label); } case BYTE: { Byte valueCast = value.getObject(byte.class); return new ConstrainToValues(valueCast, label); } case DOUBLE: { Double valueCast = value.getObject(double.class); return new ConstrainToValues(valueCast, label); } case INT: { Integer valueCast = value.getObject(int.class); return new ConstrainToValues(valueCast, label); } case LONG: { Long valueCast = value.getObject(long.class); return new ConstrainToValues(valueCast, label); } case SHORT: { Short valueCast = value.getObject(short.class); return new ConstrainToValues(valueCast, label); } case STRING: { String valueCast = value.getObject(String.class); return new ConstrainToValues(valueCast, label); } default: { break; } }//SWITCH }//TRY catch (BusException be) { Log.e("cpan" + PropertyWidgetConstrainToValuesAJ.class.getSimpleName(), "Failed to unmarshal PropertyWidget LOV - Error: '" + be.getMessage() + "'" ); return null; } Log.e("cpan" + PropertyWidgetConstrainToValuesAJ.class.getSimpleName(), "Failed to unmarshal PropertyWidget LOV" ); return null; }//getPropertyWidgetRangeConstraint } PropertyWidgetRangeConstraintAJ.java000066400000000000000000000075001262264444500431670ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/ajstruct/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui.ajstruct; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.Position; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget.RangeConstraint; import org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget.ValueType; import android.util.Log; /** * Property widget range constraint */ public class PropertyWidgetRangeConstraintAJ { /** * Minimum range value */ @Position(0) public Variant min; /** * Maximum range value */ @Position(1) public Variant max; /** * The value to increment/decerement */ @Position(2) public Variant increment; /** * @param valueType The value type of this property * @param * @return Property widget range constraint or NULL if failed to unmarshal */ public RangeConstraint getPropertyWidgetRangeConstraint(ValueType valueType) { Log.v("cpan" + PropertyWidgetRangeConstraintAJ.class.getSimpleName(), "Unmarshalling PropertyWidget range constraint"); try { switch (valueType) { case BYTE: { Byte minCast = min.getObject(byte.class); Byte maxCast = max.getObject(byte.class); Byte incrementCast = increment.getObject(byte.class); return new RangeConstraint(minCast, maxCast, incrementCast); } case DOUBLE: { Double minCast = min.getObject(double.class); Double maxCast = max.getObject(double.class); Double incrementCast = increment.getObject(double.class); return new RangeConstraint(minCast, maxCast, incrementCast); } case INT: { Integer minCast = min.getObject(int.class); Integer maxCast = max.getObject(int.class); Integer incrementCast = increment.getObject(int.class); return new RangeConstraint(minCast, maxCast, incrementCast); } case LONG: { Long minCast = min.getObject(long.class); Long maxCast = max.getObject(long.class); Long incrementCast = increment.getObject(long.class); return new RangeConstraint(minCast, maxCast, incrementCast); } case SHORT: { Short minCast = min.getObject(short.class); Short maxCast = max.getObject(short.class); Short incrementVal = increment.getObject(short.class); return new RangeConstraint(minCast, maxCast, incrementVal); } default : { break; } }//SWITCH }//TRY catch (BusException be) { Log.e("cpan" + PropertyWidgetRangeConstraintAJ.class.getSimpleName(), "Failed to unmarshal Range constraint: Error: '" + be.getMessage() + "'" ); return null; } Log.e("cpan" + PropertyWidgetRangeConstraintAJ.class.getSimpleName(), "Failed to unmarshal Range constraint" ); return null; }//getPropertyWidgetRangeConstraint } PropertyWidgetThreeShortAJ.java000066400000000000000000000027531262264444500421620ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/ajstruct/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ioe.controlpanelservice.ui.ajstruct; import org.alljoyn.bus.annotation.Position; public class PropertyWidgetThreeShortAJ { /** * The type of the received structure, either Date or Time */ @Position(0) public short dataType; /** * Either Hour or Day */ @Position(1) public ThreeShortAJ data; public static class ThreeShortAJ { @Position(0) public short var1; @Position(1) public short var2; @Position(2) public short var3; } } package-info.java000066400000000000000000000045561262264444500354370ustar00rootroot00000000000000base-15.09/controlpanel/java/ControlPanelService/src/org/alljoyn/ioe/controlpanelservice/ui/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ /** * The package includes classes that represent the UI widgets and its metadata
* The UI widget classes are used to receive the initial values that were set by the remotely controllable device.
* In addition these classes used to perform the remote control of the device. * For example:
* {@link org.alljoyn.ioe.controlpanelservice.ui.ActionWidget#exec()} is used to invoke an action * on the remote device
* {@link org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget#setCurrentValue(Object)} is used to set a * new property value on the remote device
* {@link org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget#getCurrentValue()} is used to receive the current * property value
* Each UI widget has its signal handler to be notified about the state changes in the remote device. * The user receives these notifications by implementing the {@link org.alljoyn.ioe.controlpanelservice.ui.ControlPanelEventsListener} interface
* The signal {@link org.alljoyn.ioe.controlpanelservice.ui.ControlPanelEventsListener#metadataChanged(DeviceControlPanel, UIElement)} * notifies about a possible change in a widget UI state.
* The method refreshProperties, i.e: {@link org.alljoyn.ioe.controlpanelservice.ui.PropertyWidget#refreshProperties()} * is used to receive the updated state of a Property */ package org.alljoyn.ioe.controlpanelservice.ui; base-15.09/controlpanel/java/sample_applications/000077500000000000000000000000001262264444500221235ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/000077500000000000000000000000001262264444500235435ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/000077500000000000000000000000001262264444500275075ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/.classpath000066400000000000000000000016251262264444500314760ustar00rootroot00000000000000 base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/.project000066400000000000000000000014661262264444500311650ustar00rootroot00000000000000 ControlPanelBrowser com.android.ide.eclipse.adt.ResourceManagerBuilder com.android.ide.eclipse.adt.PreCompilerBuilder org.eclipse.jdt.core.javabuilder com.android.ide.eclipse.adt.ApkBuilder com.android.ide.eclipse.adt.AndroidNature org.eclipse.jdt.core.javanature base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/AndroidManifest.xml000066400000000000000000000050611262264444500333020ustar00rootroot00000000000000 base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/build.xml000066400000000000000000000104261262264444500313330ustar00rootroot00000000000000 base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/ic_launcher-web.png000066400000000000000000000215151262264444500332500ustar00rootroot00000000000000‰PNG  IHDR``âw8tEXtSoftwareAdobe ImageReadyqÉe<"iTXtXML:com.adobe.xmp ˛TžśÁIDATxÚě]y”嵿Őű¬ÝĂ2, 4J„Â( (Š FEÍ"‰ŃÄ 1$yçHžI^bţŰ3zô$ćEMň^ô¨ŃĽgôťD(3 8Ś3Č&ë0Ś2¬Ó=kŻő˝{żŞŻú«ęŞîžîA†óRsľ©^««îďŢß]ľĄĆüs;}›ňOţ Ŕ˙oÜnwIH§Óy?3eʸîşë`Îś9PYYÉżŁ( $“IţľĎçăĎ©y<¸Ţw}T¨Ô&áGÂĽąřŢycĽµŕ˙~źö! -++čmUUůo§R) ţߥë§çt.|đ¬YłÖŻ__đő—"?úÝS €üŚ3¸ŕý~?żĐx<.— Ľ^/ż€ý7†@AaÜ^Ü“ U|ćÂć‘čĘs2LoüĤ˝Ę_oŔ}#>_¶L]Ö"€ =#Ŕ %čîî† 6ŔŞU«ŕСCgVÁÓgHč¤uô{m·řnYŚ~¶EŕÖ…çÓ….„-^W%!;Úł Ptz)˝ĄŤcµa[†Ďź)ůR‹‚Î/đsěééÂ[o˝oľůć™ŔÂ… á’K.p8̵I\=¦ßşĂG| i1¶°_oŞ$ŕ^lǰ:p  úví‚Cí‡ ‰8žËرcᬠg÷ pgUŚŔ7:8.„„ľ§–DŞJĂ/Ş/>GÇ EJtHÖA@ĽöÚk°eË–á ŔôéÓąÖOś8ŃŕszŹL›¨ć[D#Ť–§¨ŹŁ¨ţýľ“ODD´DŤ@Ř…~iĺĘ•§€»ďľ›_ im÷ÂâďCyŐŻ¸¦—“DéÁ'ÍďÁžµŤĐ}2‚VŹšŽ˘ôś] •˙6ĽÓkŃqŽć¤›ôÔvRňďmřű>‰zĚâ÷\8 ĘąĽ—ťĄi|{Ä˙¶bżkň§®ĎÜń†bP#Rë˙e3ôýň]“5P;wę' ćJâ“çhJ“Ĩ r’hЬá‹w÷>ŐBÖŔĎ“âŚćî˝÷ŢÓ ŔŇĄKąFüĽúΤ•gAUAÍ(ăť„ńR7|Äżř-˛ÎŚrRű@Đ…ŽaäH¤OäOúŃžžkŻńĚ 7¸·.'(2˛ M Ýî»ď>SžYÔöŰô­uP×⥠ŁE-Cáďl®¬…ýěĹđŢchľŁ›ĘŻN˙䆳•…Â"¨U[OčBĎh˝˙ëÓˇň×hĎíťŢo݆ź¬Ăך´_ĽŻÔ”Cô'ë!˝˛ üwÖ÷skŕľ-Á?c,F˘nnůÓŔ8yřyń%řôüË.ť P‹@T µť<ľřô-uŔb ľ•úuä´Ö‚Rw6ă••­E‡‚*>i˙žý°óď(śî^®ń¤QEŰ“XË®źŐú\–łM®ď€»!˝őxVb;2öCóIëBî:ďipŁE”Ý{)xćť•9ŻÖcĐ÷ťU|o8ç}F-x®8KsĘ»!±r/¤Ł1#D5|ŇRJ˘¤s¦Nš«`1-C¸.<ÇTĽťÄĎ3ő‘ÓâR·ľ^Ę-\+4$Ć;vĂ»Č÷$x ^> ^@Í‹Ľď˝|xj Dg‹|Ípoĺ6Ž8r'(!Ö9* Ň>*bysń€j8eíqŠ‘ć ÔÔŽ‚ÉWŐk ôta¸J1kŞ$Š ő­Ć:艭y‚#4ÚŮş6Â×P\:Żjüę  ě΋ ě¶ ¸ć’đzżú*×TŁŚ3©*~Q®š2|? }?jď8ŐŞčőř Ű :_+v@0)q™§Xš[PV]Ó^… Ôb®Đ«Ž·ôDŽ-¨Yvcäc ˙ć•u>ĹZÔţ×ü†šďď„MŤoˇŁőZďÖ-ŔĐţ ‚ŻÝŢ™µőđ“X˙!t_ór&˛iľ<3GĎzúöL@Đ–\w¨(«-a˛%D ş<B_”GH±î“ •Ë-(€A…@‡ŻýSČMˇf<ÂpťRŕ}&á{• ý¸őF Pă«câ~^/j=jP Źv&U›~SŤÄŤÇ$řb…/˙†ěcăué(TÖ­Xř0ŻĹĹşűa×ę|„çíöóĚ>ŕ/Ż?qýËĎsN…üW·ŰW‡vęâćśO´# ß- Ţ­s>ý©íÝ™Eß'Vě…‡›ŔwĹD(GGJCÔ"xť(ĆJ3ô˛a ¦Ä -Çé˝ü@(†ŹrI–ë–|żF„ťBžgÉŞwbŃľĹmóžY|ʢ }s˙ëQ•ˇű+ď©őĹáÝż­6â{݉v4á+–J&i·ď zÝ59Ýzü·aůôBž›VżI ”Ýs)çüČěx‚UýúÍE‘ďâë´Ń1čX†ĺ =7-×ü ‚Vö˝‹1BÇ?c4¤¶ř5peZ˛Ł$9:Jq:Ňś2µ†¦“ŻśńŰ!ď…”‹EҶ`ňş%-…RPAyŔć Q—ěŹßßť‚·-Á[ ;×oČ8Ü„Żp ­ĺľ µîC.|^M K™l4nú]ľĐzrÚnĽě<ŇsYř™Ó÷ ĐŞWn@«8ŰxŹS ( šľ/ŽAĎS-G!öâ6Hn=¦…ĘŻ 0° t ®ŁÇa ˛@ů¬™PŰyŤ!:Ţ!*ş¨P (/xž­ T@…Çľ ačÜĐŚfŘg„›®Ďß%™9ýŻzů \űĺž´tŕ7› ®·Ň ='ˇ$×u ÖÍvŞřŇp'ĘQBCŕ¶Źŕd™´—(xç!@K/‚'7CďÝ &¶Ć\ <üłnŘąu;ĚąŞ ’Ç0«N±ş­3őŔŚÖ<0$> yę#`b_çwy rÔX€;áöCRśď‚˛Ë&@Íş[Áʱ˝Y÷5á“€dáó–BJŠrb‹- wÉj8á˙čľúeţ9`Ňh„čJDOŽő»ĽŻ˘őh~ŕyđeß$S+[z1nťnň nýş…Ő7ŻyO¶şOD »+ jŤń<ŐnäĐ’4·ŘŤ„OĄq >AŻ ţ§ß ‡®EOÎJmݶY¶ Bŕöé&'íÖÁĐłć;wďqÓ¦CM%ć1ޤbÉgKvÂkÇ˙ôŮĺÁĹĺnL>g*tbČy¸­G=ätCżľĘo˝€Óżow¨ 9=˝_y@ŇH~ňhćÄă†Söšo#M­x¬Ţ '˛‚.µÜęäĂęŔĺÚĎ}Ú}řY-QÓňrĚÂ)'đQ_™ő™ůĐßG:`@MŔK,đÁ†˘śđ_«—†“ńĹ˝Én¨1†‡[TRösĚ>q”}mş^ĂO@ůŇY†ĆP©AÄë‚s‰jÔĹiľK*G(Aá YŇýľ V),ĹŤç,;x^DČzbOnŃŻéy‚öČĄÝŚ¨AËú·ˇîŠąŕéüü$)˛‚ÉE9aŻâąż ť.iúřŃc`OëűzUÓUÎŔ-ç]®o&»Eޱ _Ö\śj–z(”d‘YŃQ‘ źśaźí@ ‘xçźŤÇ r˙‘X±ëÚ-ů-ăŇĂU…S‘Š`ˇŔŃ\â0ybö´ďXO_řE囋żÎž}nPüµßçň,&„G׌ŹŻŚ÷dő®=Ęż{‘ÖÚŃĘä©´ĐűťŐ\“\Á2Ă9ĘšaGńŐW i˛°¨ŞWľ`[˛(vłMüđOłz*Ň«ZÜÇ M ÚĽá=˙2čÇ(1>@Ĺn×7đ Ď Ę ŁÓ˝?ŽŮ]:ž„q¤ý[·éŽWŞźÍă˝Wý·żQZ -†YmŁŞçTŻąÉĐzL÷ŐŻp-+DS ő&MĘ“ýĹf-[¸dǬhŮ3É©3äQ5#%ÓÄ ő/(‹ë ŕ9ĺö˘ÂŐ´ #‚# í('ţđ>ô|ęP˘IÔě€A;ýw7j&,9:™§‰–J‰|˛i#–óůĐ ^±-ehă–2ő.˘îضjŞ‚€,‚ţAVPř•E!IŘ˝őýL}…MŔSou@üŃfčCÁw}ňžá'Ëa\)t“o#ĘNT„ť˘bJÖ!;ÔˇA±©‰dBN¨ŔP(‡Ń#FiN\‹I± ő_r륅qµc`Ű{[ŤČÇ%uŞĐŇŚ2^¸YřŰQăŹňzeą1=ă-u#+#jٞEýBÍ`óm&Á&T,AE’/ á—šĆĂľ={Áď÷eŠy¨ŘvľŔŔóĘ7BT|žľP]QiôꢢÉG«IH[Í2†)»á x¨E_p›Ń‰’Fú)Ą”,čč˘**ś&cŐz^Ćhě(¸ă¦+‹w+©ŠŞňÇQ¤í fÍ€öĂ\vŇ~)/Ö"щRćŔ}LZďĘ*3d`HbČFMlAIřZˇmh8š¬Ę‡T'JF©\ݞZ7ąŘ7” d˘"íĂ'3fZáŽŘ‹4žPSA~>ŻŔ_éŇkgʱţ“ŕĹc»ľŰ\I“FGC〩A•§ĺŚşşĎ©rΊE>ÂöďŰ—ŰčÁhhQ>𙌰%Í×éÇÚs”k¬&ŐâI+©ÖBšZł{ wŇCŻ €ĺŚšŞŞD9&«#ßóÇíFÂfĐ%ľVl9ÄJEÂ\¦2¤&7Rŕ±ăja˙ávІ&(uřŃe¶ ˙‡ŕ/ŠMGwf Wňę˝9iZOĽíŇ»]“Чú®ěWČÁ ~'RAŽú¨ Ma)Í;ôőąźAţîP8cĐiIRĎ™±ă  ýůÇK_‡o?` ~©Nv˛4>?€o[Ă-+ …€"€ })Ú/°ádQ«e!Ňńĺ2´_lI%^Ýk[Ć.-IS´‘vL{ŤĘÓB¦ŕ›íč y‰H(‚UŐÁŰM\ ‡ęúQ oçŰHH#ă?ä‚lŽgË·OĎY!µV@‹Mά´,Ë­˝˝Ý=Ó89áOŃřGÁůą4Ţi´ňPn˘·Jîš´&vĄć®H4ß H 0•Y°“)ľZYQ ‰îíkJvČYJý†.z@ďýâ#ćźť·š)h†>CVD%ĺBúÔ<ô":cä󠀡XZ˛öŰY2͵řRCĺŕ;O|ĐOóvÉóňFŃŹ(ĉl•*—r¬N‘˝FT şeZ ˇS¸IŻÉŕ &śĄc”ßs©í°F!d»aŹdY˘7­°ś ă­`¸ ź =ŹC*`k—‹˙董¶ˇ¦“đţ^ägş`Ň&ąLL#}‘ĹtM}|źźÂłb˘Š~(śÍG—Ľ¤R\ľŔ©[ęŢÓÝcđ*zĄŠ­ ťč‡^'ˇÉ‘iąUÓŻjŕ˘D !—ĄZ’©‡ŽUŮT8ý·ťź·ŹY†Ľ%’ŹČµ¦R´!P}y{Äňń>iŐ}ĘôđĐęÔdá áäë†ý$äÁä běĎ`6·Ťu e)—ҢĎp€clţóz(˙×YY›5Ę€„HŮ'…ŤäX©‘Ż´ě×cőţ­5†ÚF,‹p˛”‚:s , Eý*oÍĚń$m&8(«řh1!<łđ;8_’ćĘ©r™7q¸&Hüž3¤Äc[)K ę|EőX^n·V[°ÍxSÇ|GţË:ů`4ąBľÓ8ţA Âꬉ“ý8mä´é}A 6Łé ÝčXr´fÝ(JŞ2E.ĄvY‘b¶_ÔŃş\ëř¦ń2‰{´IuŘ(\¬¶ĂÝ"¶çQTcGIÂŕŁëzËFKͲů„@“ŕ™- `Žh)A¸/ÉĚ+{Ę <Ô4tÚˇ´ÍWž Ş /7?ąąč‡"7^ŢŽh!m±ˇ'Ëb–EGůŔ€ĂĐÝvŚ «ĆÚ ćqňî F›řX›×5¸ Y¤ü˘ŹXvâÔŃ’ŰbüY ÷Oi}Îvľe(č…IzoŔŔXn P-SÖřcY®ĽżÍ·¤uzťçÓ~kg‹©LŤ đÉCĚŮ… ]Ţ3éd 30{ ľÉÖîV`VÍ·L`ٱ’­ÚÄ'§â´‰Š¦ óg…Ť”ÎUą$`<3játlĚ‚äY—˛,{řş6ś„ţăÖµudD“Ű09z¤ ˘×ýďŕcaMëÔ‘~¦m ˛‹˛›‡LŁŞ_`Í«ě-€E›2–Íëěđ×0yét#€>Ťh0‹]…vRőt(’«SRĘóŤ™$KŃNB_'h«e°Ţß„qH,mŇ~–eBV7R 9…¨ÖŇE±ÎRîţřµźeÓSMÜ/#ÍmN™pç!čj3i˝äŐ¬*ĚDÍ:K…&…˛Mž¬ đu!ľ˝ę49_IArh>źe‰ ´C×VÇLh{ĎcµÓŇJf5)«?PőáŘâýGíBŇę57ˇ¦(Už„YLÔ"úČ ĺÇRůßni´Ě¬{ „VÖńv. ‰xý*eÚçŇú™4GVü€Ëř‘ÜY€u¤4=¦Ě“ç“ę ٨ž†Ŕ‹T„ §˘tOűm9źÉ‹~¨ĆŇhÇ‘˙ßöćśĹ¸Včx÷ôvĘ_4"#bľ€.Ű2v }®bâ¶5ŁăZ“´Ź3•é'-­¸b,ú˛Ű í­Vţ·«†î˘Ňz9i0ÓPÔlß#2°ëŃ*uČ8i~®2…XĽéăÔ~Ő²¬ŇŘ~Z:’€}0mĚÔW ‘žńěöQQĆÉmXČçäŃp1đă;™Ą‚Ŕô…ž„öÓ:Cb&eDÚvŔá7 ę îă»ÄŠQ)¬©†ą©6á—|˘ąććžĘíT'wÖbŤ]ÄcLa%XšˇŤčgWAĐ_g;6¦ůBEiCűĺEŚŇ†›qNH¨ľcĺúR@!ç]ď8sĹě˛\9ĂU 唩[! ‘˙aď.łŁ'"ka÷Ş~1i(ť±f¦#;+ŕI–ľÚ•©Î^â¨h*=ç*zJ©,±ľL×)Cóuć`tIűWOqę’lz>hV´ «9éL¸ĺ…‡´( °˘}©3d &RjGŤ“đ­5í03]‹ućú!{‰mZ] mh6 G1$MJć$ˇ:$jYę 6? ”ńřröLýNǢ¬x¨¦#ĺľ™’…Ók (Íppă1čÉiöąëhx…˝·Z^ Hü@Zâ<ŐR;˛¦é †ö5$dš#/ř!fIĘkĎťjÍ7Ö‹`iIAÓýD ?ň¶–j$9;Oň­ő/Ź(‹îšc¦ůřÁËGĚŃÜ?š5ďS<|‚Ě«#;Ź`x”–s _v°Iť˘ăúb1„€ÇX^`˙Ľ¶ţ¤¸YĘTŔ˘}«žaoŻîC.K€Š2™N “'Řűf©žI·Kş íg™…]SőEPQ…ß”Kř…P÷{áXSěnÔ–eŃš‰’tL[ęF̡j8\A°Ó|™Zĺ%jdĘ!żHËŐ™ôB<ö[ÖH#Ň *Ѳj⪧ŮŰ {ŕŘ®¤ädRL=cA`6#ś×ÍX~ĘA*ľţ ŰĽ•¶Ĺ)ń*J ck–wA_Dł‚”ÉRşéY3g3-ewäśn ěĘ vÂ7iľ.ü„A=Şľľ >jAę!á/+¸ÄRŕçšN@_ËďŘş?'XFřf Ô,Ô¬^5ł_8]Ö`Żőv—™ňź$3ó˝ć|5ážÎ'YĂj]ř‘ˇ€¶e› }×2h]N?×y/‚ÎY–Ŕ ˘¤Ź 'Ág/ŕ-×t2ÂOH×M×L IĽ/[ń<*iSˇÔcŰ!“Ż€í%LĐBŠ/°ťż0× ]hUAÚÄň^Úd&Í›Ë&?+§”j _7šö2çg(8…J¨9ÝÇŮ›$ü¶Bo±ĐFťĘËĐ)Ăx%4f_g••ˇU4ĆHÉĚ"gĆŞ"šŮ‰îĚ\@” Ć`o˝Ă’(1XĂLYř},{…˙´“đźˇSčuŤŔěopźňY¸P!;ć×ÖQë.3i±;&­9aD)`äzvI¤ŇB††Ä˝ĚÂĎP. ˙qöĆó›J~!™p®Ťž¨űž˛ ţ 2ź÷Ł,Ů«gÉbˇkyŤQ»5‡\6K!Ř­Aˇ JóťKɲö[˘ŮÝ=CDyBřDG‚v$Íď,ެRčÚŃNN™ţý†­…ăJod›yQN¦ĂĆĄ_”›/éHÖ ÁL+”k7MŐ¨I±řyâ ËSÖČŐc6Ž]gŠĹĄ¤Ş¦Đ~~'tw>ĂŢ^^Şđ‡ÂÄVOmśľC™ű•JđĽúzűbUYOfը̲öŠyťi—Ă‚ßĹúYó­ąuôźÜî,üŤëi{˝ögt¸f>—N§;‡Ĺ˝$ń´ ˢ‘Př©rÝW&BMŘ«xx‘Î Ú^ßzc·±,‚â°0Hî{‰eÇ÷öšoíG™v9EČrIřëa_#Z{DHř<Ę.wSĹă„q÷UrĐä.‡sçűôű »)yÁmşąG_EÇeł,ŘL÷Ďĺ ¬ŁÔě"1´Fćţdkż6ś.t¸ŕ´…‹Î˘N›ÇĂz#ţO€şýLyďÎIEND®B`‚base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/project.properties000066400000000000000000000010631262264444500332730ustar00rootroot00000000000000# 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 base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/000077500000000000000000000000001262264444500303005ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/drawable-hdpi/000077500000000000000000000000001262264444500330035ustar00rootroot00000000000000ic_launcher.png000066400000000000000000000022661262264444500357140ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/drawable-hdpi‰PNG  IHDR00Ř`nĐtRNSn¦‘ pHYs  šśVIDATX…ĹŘ˙OgđŹwpx|)0J@ËIgç÷ŮŽ´ŐÚŽZ­q~I§…)ł˛)hĄÖ2uD«d_šn]Ú™&6´I­#kfÚTčKš41áoÚgŻ78îîĐOŢ?qĎ}î%Ü=÷<QJَEEi%´p•˘Ţá›AóO?+ťÎ٤ Ô9வٺůâ>*AŹ}î"’)ÓÚĚb9Mő™úąí»±t"–NÔ´¶Vüň+‘LŻ÷ôŞTEg1z7n”X:ńí?R‡J"™"s⯄¦§·¸7–LŽwOyÖŢ=Ł4ëű;ŮĚô1ÇĂ7(‘LUnnĘŠ˘i齸´÷˘éź÷g “hµ'ţ~A7É”qi3™DŁTÖ9‚ńX%–NDßlá*EöxíŐ« "™˛ż|ĄóůDŃt#«ˇl 瀛ń,ì[ŹłMD2Uµý\ÝÁ|GIeklčöۧą4sŰwQIÎVyö#LĹ˝{xMMšF÷ů[»rQČTź©gobŢŘ`1ÉÔń› ­–brŘ&®°Sbé„w#ĚůWÉl6âő»ÉţĎ®vtÁ0ćť‘őýNÍÚ»gş #' Á;Ś-ţ„ůĽĆ㻉ĄÝS>@•Ęě)€1ňz¦ąŠhiď‘LžÇŁ«éë+.¨Ą÷ ” hĺź›Ĺ㱼4dÉ›š‹ެsÓęŞř /WC…i3™ě/_‰ şýö©Ć +şńq1A®±A!@•ĘŞíçâ€ní>ĘrL¦ů”ş«[PŁűĽp Y–ßď ]{¸"–đÚZA őý“ĂĆ}ťę*ŽAg;ड़cŤ‘  -~ÇŃľĽ Fűa%|ů4śb?C˘×gOĽ@+˙ĆeÇr6–JŔŐ Ëł4T&ľ3Űr Üë-tÁÓ—łeÝÇp}‚B%:W:@!g<Á0[üI~ r3Ę0H_ľa6 =‘i8Ý’ÝFŐ~1?ĐÉłM™‡ńRčl‡č_ •)XÍŮ—;ŘćňŤ˙¶y¬áĚň¦Đ3xÔ*zËR‡Ză˛27Łf#řGQ¨,† í3J¨Ţ†ŮëÜ žĐ×~Ł+…üFě™ńCuyj››t°E8Ý ß‹LˇÇ3ĺeđ~››äpĹ“Ţ"R¨,Ď‚«µDŽ[·3ş&ˇžĂ ĐžTř<Ě ¬ľ“‡ Z ĂŕeDŁfH%péó ˇ™ô2NQYĄVÁpoq)óhŞĺAˇ—Ő\”»{y:Úř,TrÔ§őBçhzŢ?í /…Ž6ˇ3ä”ěVÁz•—g JdśÍŚď|1Ęn…ŕ_Jtz\nž… ŕl†Č4‡Ć7 }‘)ôbyőÎřá¤ý)ô2č˙·€ŚLg,0ލ>qŔŚľč¦[ç[˙Ů´oăźpHIEND®B`‚base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/drawable-mdpi/000077500000000000000000000000001262264444500330105ustar00rootroot00000000000000ic_launcher.png000066400000000000000000000022661262264444500357210ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/drawable-mdpi‰PNG  IHDR00Ř`nĐtRNSn¦‘ pHYs  šśVIDATX…ĹŘ˙OgđŹwpx|)0J@ËIgç÷ŮŽ´ŐÚŽZ­q~I§…)ł˛)hĄÖ2uD«d_šn]Ú™&6´I­#kfÚTčKš41áoÚgŻ78îîĐOŢ?qĎ}î%Ü=÷<QJَEEi%´p•˘Ţá›AóO?+ťÎ٤ Ô9வٺůâ>*AŹ}î"’)ÓÚĚb9Mő™úąí»±t"–NÔ´¶Vüň+‘LŻ÷ôŞTEg1z7n”X:ńí?R‡J"™"s⯄¦§·¸7–LŽwOyÖŢ=Ł4ëű;ŮĚô1ÇĂ7(‘LUnnĘŠ˘i齸´÷˘éź÷g “hµ'ţ~A7É”qi3™DŁTÖ9‚ńX%–NDßlá*EöxíŐ« "™˛ż|ĄóůDŃt#«ˇl 瀛ń,ì[ŹłMD2Uµý\ÝÁ|GIeklčöۧą4sŰwQIÎVyö#LĹ˝{xMMšF÷ů[»rQČTź©gobŢŘ`1ÉÔń› ­–brŘ&®°Sbé„w#ĚůWÉl6âő»ÉţĎ®vtÁ0ćť‘őýNÍÚ»gş #' Á;Ś-ţ„ůĽĆ㻉ĄÝS>@•Ęě)€1ňz¦ąŠhiď‘LžÇŁ«éë+.¨Ą÷ ” hĺź›Ĺ㱼4dÉ›š‹ެsÓęŞř /WC…i3™ě/_‰ şýö©Ć +şńq1A®±A!@•ĘŞíçâ€ní>ĘrL¦ů”ş«[PŁűĽp Y–ßď ]{¸"–đÚZA őý“ĂĆ}ťę*ŽAg;ड़cŤ‘  -~ÇŃľĽ Fűa%|ů4śb?C˘×gOĽ@+˙ĆeÇr6–JŔŐ Ëł4T&ľ3Űr Üë-tÁÓ—łeÝÇp}‚B%:W:@!g<Á0[üI~ r3Ę0H_ľa6 =‘i8Ý’ÝFŐ~1?ĐÉłM™‡ńRčl‡č_ •)XÍŮ—;ŘćňŤ˙¶y¬áĚň¦Đ3xÔ*zËR‡Ză˛27Łf#řGQ¨,† í3J¨Ţ†ŮëÜ žĐ×~Ł+…üFě™ńCuyj››t°E8Ý ß‹LˇÇ3ĺeđ~››äpĹ“Ţ"R¨,Ď‚«µDŽ[·3ş&ˇžĂ ĐžTř<Ě ¬ľ“‡ Z ĂŕeDŁfH%péó ˇ™ô2NQYĄVÁpoq)óhŞĺAˇ—Ő\”»{y:Úř,TrÔ§őBçhzŢ?í /…Ž6ˇ3ä”ěVÁz•—g JdśÍŚď|1Ęn…ŕ_Jtz\nž… ŕl†Č4‡Ć7 }‘)ôbyőÎřá¤ý)ô2č˙·€ŚLg,0ލ>qŔŚľč¦[ç[˙Ů´oăźpHIEND®B`‚base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/drawable-xhdpi/000077500000000000000000000000001262264444500331735ustar00rootroot00000000000000ic_launcher.png000066400000000000000000000030601262264444500360750ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/drawable-xhdpi‰PNG  IHDR``múŕotRNSn¦‘ pHYs  šśĐIDATxśí[ßKKIB’Ză5M–5”B@®DZš¶ĐČ­ ÔŢ(jąÚŢ<Ôţ B –˘/•‹6f”\1:n||Őů,u‰ŰźÄ5˘)áNkúľHeÓO[M)i(sĹĽÔ…F …Đi8˘0ˇ÷°C­ť…‘LĆé4˘ÉĐŁ€· €qnąľz¦V ÔL† ?ţřŞx‚–ϡ–ňd¸ €QÜÚYH¸ÓŠ•q3Š[­ČZ8‹´QU‡¬ĺł¨Zžp Řl–µvDš8!ĺIhA ĚÚY€Y>‡rE}ű¸sŇ…Y;`Ëçh™@*Ö΂T@łZ VŁŞuË·B VŁŞ~'°¬ťş†Ť«@ŕŘ%DËŹ@ \kgA°“µN ńFUľ5l<^–ęŠĺHźµłŔZĂZ*V쇺囿,ŐĹ€fH Ö΂J'kN ‘e©>¨Xľ ÔUu€š ÔUu€-_»@˛ËR}€u˛Ú2oí,ŔÖ°z2»Ä°|ŤEhíČZľFt4Şę]ĂęČ|쇔ĺëČkgAj «E äFµ^#­M2‹©¸¸ĺă „¸,%N‰´6I{ű'ßż$N ĺ‹w˛řáXűřyńě·4^6I2ˇ~ßżĆaYšLzŤěn«Cą»EîU•®Bł|dTŐŰĺ3ĹgkSńĉ4L”¬}|Ś4WEĄńňĹ32>ľl¨ĺc \–Ň3Ć{âęŔw C;Y4€Ö>[ 7âlm’ŰeŔ-đŽ@Řu3Ź…cqw+ýĎš„@“w˙ĽBęüŇ(ńđľ¨@„©rěˇXÄ Â%žĐ”Â% ±{n!´ŘfĂ’6Cť «‘0Dއ©iťÍ…¦-…n6W±^CŚÂö+52°ż’Ü iŔřĄIm—Ź §dŃ`Â{˙ Ć–…,J.Ł@„˝<1‡áfVţE;``_¦üň™Đ”Q^_´č剉Ä`(ĺ NAa3Ŕĺ ~Aa3¤2ŠĆ‚Âf–'ě®8ĺ‰é‚ÂfĚVS yô˙u#ú‚b˙÷dş ÖŇ˦IEND®B`‚base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/drawable-xxhdpi/000077500000000000000000000000001262264444500333635ustar00rootroot00000000000000ic_launcher.png000066400000000000000000000030601262264444500362650ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/drawable-xxhdpi‰PNG  IHDR``múŕotRNSn¦‘ pHYs  šśĐIDATxśí[ßKKIB’Ză5M–5”B@®DZš¶ĐČ­ ÔŢ(jąÚŢ<Ôţ B –˘/•‹6f”\1:n||Őů,u‰ŰźÄ5˘)áNkúľHeÓO[M)i(sĹĽÔ…F …Đi8˘0ˇ÷°C­ť…‘LĆé4˘ÉĐŁ€· €qnąľz¦V ÔL† ?ţřŞx‚–ϡ–ňd¸ €QÜÚYH¸ÓŠ•q3Š[­ČZ8‹´QU‡¬ĺł¨Zžp Řl–µvDš8!ĺIhA ĚÚY€Y>‡rE}ű¸sŇ…Y;`Ëçh™@*Ö΂T@łZ VŁŞuË·B VŁŞ~'°¬ťş†Ť«@ŕŘ%DËŹ@ \kgA°“µN ńFUľ5l<^–ęŠĺHźµłŔZĂZ*V쇺囿,ŐĹ€fH Ö΂J'kN ‘e©>¨Xľ ÔUu€š ÔUu€-_»@˛ËR}€u˛Ú2oí,ŔÖ°z2»Ä°|ŤEhíČZľFt4Şę]ĂęČ|쇔ĺëČkgAj «E äFµ^#­M2‹©¸¸ĺă „¸,%N‰´6I{ű'ßż$N ĺ‹w˛řáXűřyńě·4^6I2ˇ~ßżĆaYšLzŤěn«Cą»EîU•®Bł|dTŐŰĺ3ĹgkSńĉ4L”¬}|Ś4WEĄńňĹ32>ľl¨ĺc \–Ň3Ć{âęŔw C;Y4€Ö>[ 7âlm’ŰeŔ-đŽ@Řu3Ź…cqw+ýĎš„@“w˙ĽBęüŇ(ńđľ¨@„©rěˇXÄ Â%žĐ”Â% ±{n!´ŘfĂ’6Cť «‘0Dއ©iťÍ…¦-…n6W±^CŚÂö+52°ż’Ü iŔřĄIm—Ź §dŃ`Â{˙ Ć–…,J.Ł@„˝<1‡áfVţE;``_¦üň™Đ”Q^_´č剉Ä`(ĺ NAa3Ŕĺ ~Aa3¤2ŠĆ‚Âf–'ě®8ĺ‰é‚ÂfĚVS yô˙u#ú‚b˙÷dş ÖŇ˦IEND®B`‚base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/layout/000077500000000000000000000000001262264444500316155ustar00rootroot00000000000000activity_device_detail.xml000066400000000000000000000024721262264444500367620ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/layout activity_device_list.xml000066400000000000000000000027011262264444500364660ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/layout activity_device_twopane.xml000066400000000000000000000045331262264444500371750ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/layout enter_password_popup.xml000066400000000000000000000045341262264444500365500ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/layout fragment_device_detail.xml000066400000000000000000000034521262264444500367300ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/layout base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/menu/000077500000000000000000000000001262264444500312445ustar00rootroot00000000000000activity_control_panel.xml000066400000000000000000000023331262264444500364630ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/menu base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/values-large/000077500000000000000000000000001262264444500326675ustar00rootroot00000000000000refs.xml000066400000000000000000000025301262264444500342710ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/values-large @layout/activity_device_twopane base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/values-sw600dp/000077500000000000000000000000001262264444500330005ustar00rootroot00000000000000refs.xml000066400000000000000000000025271262264444500344100ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/values-sw600dp @layout/activity_device_twopane base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/values-v11/000077500000000000000000000000001262264444500322045ustar00rootroot00000000000000styles.xml000066400000000000000000000024431262264444500341750ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/values-v11 base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/values-v14/000077500000000000000000000000001262264444500322075ustar00rootroot00000000000000styles.xml000066400000000000000000000025341262264444500342010ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/values-v14 base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/values/000077500000000000000000000000001262264444500315775ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/values/strings.xml000066400000000000000000000026021262264444500340120ustar00rootroot00000000000000 ControlPanelBrowser Appliance Detail Action failed Set password Enter device password Show password base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/res/values/styles.xml000066400000000000000000000032071262264444500336460ustar00rootroot00000000000000 base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/src/000077500000000000000000000000001262264444500302765ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/src/org/000077500000000000000000000000001262264444500310655ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/src/org/alljoyn/000077500000000000000000000000001262264444500325355ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/src/org/alljoyn/ioe/000077500000000000000000000000001262264444500333115ustar00rootroot00000000000000controlpanelbrowser/000077500000000000000000000000001262264444500373365ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/src/org/alljoyn/ioeDeviceDetailActivity.java000066400000000000000000000112321262264444500442370ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/src/org/alljoyn/ioe/controlpanelbrowserpackage org.alljoyn.ioe.controlpanelbrowser; /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ import org.alljoyn.ioe.controlpanelbrowser.DeviceDetailFragment.DeviceDetailCallback; import org.alljoyn.ioe.controlpanelbrowser.DeviceList.DeviceContext; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.NavUtils; import android.util.Log; import android.view.MenuItem; /** * An activity representing a single Appliance detail screen. This activity is * only used on handset devices. On tablet-size devices, item details are * presented side-by-side with a list of items in a {@link DeviceListActivity}. *

* This activity is mostly just a 'shell' activity containing nothing more than * a {@link DeviceDetailFragment}. */ public class DeviceDetailActivity extends FragmentActivity implements DeviceDetailCallback { /** * For logging */ private final static String TAG = "cpappDeviceDetailActivity"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_device_detail); // Show the Up button in the action bar. getActionBar().setDisplayHomeAsUpEnabled(true); // savedInstanceState is non-null when there is fragment state // saved from previous configurations of this activity // (e.g. when rotating the screen from portrait to landscape). // In this case, the fragment will automatically be re-added // to its container so we don't need to manually add it. // For more information, see the Fragments API guide at: // // http://developer.android.com/guide/components/fragments.html // if (savedInstanceState == null) { // Create the detail fragment and add it to the activity // using a fragment transaction. DeviceContext deviceContext = getIntent().getParcelableExtra(DeviceDetailFragment.ARG_ITEM_ID); // set the activity title to the context's label setTitle(deviceContext.toString()); // pass the context to the fragment Bundle arguments = new Bundle(); arguments.putParcelable(DeviceDetailFragment.ARG_ITEM_ID, deviceContext); DeviceDetailFragment fragment = new DeviceDetailFragment(); fragment.setArguments(arguments); getSupportFragmentManager().beginTransaction().add(R.id.appliance_detail_container, fragment).commit(); } } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: // This ID represents the Home or Up button. In the case of this // activity, the Up button is shown. Use NavUtils to allow users // to navigate up one level in the application structure. For // more details, see the Navigation pattern on Android Design: // // http://developer.android.com/design/patterns/navigation.html#up-vs-back // NavUtils.navigateUpTo(this, new Intent(this, DeviceListActivity.class)); return true; } return super.onOptionsItemSelected(item); } /** * @see org.alljoyn.ioe.controlpanelbrowser.DeviceDetailFragment.DeviceDetailCallback#onControlPanelStale() */ @Override public void onControlPanelStale() { Log.d(TAG, "onControlPanelStale was called, navigating to the DeviceListActivity"); Intent intent = new Intent(this, DeviceListActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } } DeviceDetailFragment.java000066400000000000000000000737241262264444500442240ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/src/org/alljoyn/ioe/controlpanelbrowserpackage org.alljoyn.ioe.controlpanelbrowser; /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ import java.util.Collection; import java.util.Locale; import org.alljoyn.bus.Status; import org.alljoyn.ioe.controlpaneladapter.ContainerCreatedListener; import org.alljoyn.ioe.controlpaneladapter.ControlPanelAdapter; import org.alljoyn.ioe.controlpaneladapter.ControlPanelExceptionHandler; import org.alljoyn.ioe.controlpanelservice.ControlPanelCollection; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; import org.alljoyn.ioe.controlpanelservice.ControllableDevice; import org.alljoyn.ioe.controlpanelservice.DeviceEventsListener; import org.alljoyn.ioe.controlpanelservice.Unit; import org.alljoyn.ioe.controlpanelservice.ui.AlertDialogWidget; import org.alljoyn.ioe.controlpanelservice.ui.ContainerWidget; import org.alljoyn.ioe.controlpanelservice.ui.ControlPanelEventsListener; import org.alljoyn.ioe.controlpanelservice.ui.DeviceControlPanel; import org.alljoyn.ioe.controlpanelservice.ui.UIElement; import org.alljoyn.ioe.controlpanelservice.ui.UIElementType; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.ArrayAdapter; import android.widget.LinearLayout; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; /** * A fragment representing a single Appliance detail screen. This fragment is * either contained in a {@link DeviceListActivity} in two-pane mode (on * tablets) or a {@link DeviceDetailActivity} on handsets. */ public class DeviceDetailFragment extends Fragment { /** * Implement this interface to receive events from the {@link DeviceDetailFragment} */ public static interface DeviceDetailCallback { /** * This event is sent when the ControlPanel, presented by this * {@link Fragment} is stale and can't be used anymore. * For example when the session with the Controllable device is closed or * an error has occurred to establish the session. */ void onControlPanelStale(); } //===========================================// /** * For logging */ private final static String TAG = "cpappApplianceDetailFragment"; /** * The fragment argument representing the item ID that this fragment * represents. */ public static final String ARG_ITEM_ID = "item_id"; /** * The dummy content this fragment is presenting. */ private DeviceList.DeviceContext deviceContext; /** * The device controller this fragment is presenting. */ private DeviceController deviceController; private View rootView; private Activity activity; /** * Progress dialog */ private ProgressDialog progressDialog; /** * Mandatory empty constructor for the fragment manager to instantiate the * fragment (e.g. upon screen orientation changes). */ public DeviceDetailFragment() { } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments().containsKey(ARG_ITEM_ID)) { // Load the dummy content specified by the fragment // arguments. In a real-world scenario, use a Loader // to load content from a content provider. deviceContext = getArguments().getParcelable(ARG_ITEM_ID); // get the controllable device try { ControllableDevice controllableDevice = ControlPanelService.getInstance().getControllableDevice(deviceContext.getDeviceId(), deviceContext.getBusName()); if (controllableDevice != null) { for (String objPath: deviceContext.getBusObjects()) { controllableDevice.addControlPanel(objPath, deviceContext.getInterfaces(objPath)); } showProgressDialog("Connecting..."); deviceController = new DeviceController(controllableDevice); deviceController.start(); } } catch (ControlPanelException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.fragment_device_detail, container, false); return rootView; } @Override public void onDestroy() { if (deviceController != null) { deviceController.stop(); } super.onDestroy(); } @Override public void onAttach(Activity activity) { super.onAttach(activity); if ( !(activity instanceof DeviceDetailCallback) ) { throw new IllegalStateException("The hosting Activity must implement the DeviceDetailCallback"); } this.activity = activity; } /** * Workaround for cases where the Fragment needs to call actions on the Acitvity, but getActivity() returns null. * This happens at scren initialization. * @return if getActivity() returns null, then return the formerly attached Activity. see {@link #onAttach(Activity)} */ private Activity getActivitySafely() { Activity retActivity = getActivity(); if (retActivity == null) { Log.w(TAG, "getActivity() returned null. using formerly attached activity"); retActivity = this.activity; } return retActivity; } /** * The method is called when there is a fundamental problem in the Control Panel management, such as * failure in session establishment */ private void raiseControlPanelStaleEvent() { Activity activity = getActivitySafely(); if ( activity == null || activity.isFinishing() ) { Log.w(TAG, "The acitivity is NULL or is finishing can't call to raiseControlPanelStaleEvent"); return; } ((DeviceDetailCallback)activity).onControlPanelStale(); } /** * If the {@link ProgressDialog} is not initialized it's created and is presented. * If the {@link ProgressDialog} is already presented it's msg is updated. * @param msg The message to show with the {@link ProgressDialog} */ private void showProgressDialog(String msg) { if ( progressDialog == null || !progressDialog.isShowing() ) { Activity activity = getActivitySafely(); if ( activity == null || activity.isFinishing() ) { Log.w(TAG, "The activity is finishing, can't show the ProgressDialog"); return; } progressDialog = ProgressDialog.show(activity, "", msg, true); progressDialog.setCancelable(false); } else if ( progressDialog.isShowing() ) { progressDialog.setMessage(msg); } } /** * Hide {@link ProgressDialog} */ private void hideProgressDialog() { if ( progressDialog != null ) { progressDialog.dismiss(); } } class DeviceController implements DeviceEventsListener, ControlPanelExceptionHandler, ControlPanelEventsListener, ContainerCreatedListener { final ControllableDevice device; private DeviceControlPanel deviceControlPanel; private ControlPanelAdapter controlPanelAdapter; private AlertDialog alertDialog; DeviceController(ControllableDevice controllableDevice) { this.device = controllableDevice; } public void start() throws ControlPanelException { try { Log.d(TAG, "Starting the session with the device"); if (device != null) { device.startSession(this); } } catch (Exception e) { hideProgressDialog(); String text = "Failed to establish the session"; Log.d(TAG, text, e); Toast.makeText(getActivitySafely(), text, Toast.LENGTH_LONG).show(); stop(); raiseControlPanelStaleEvent(); } } public void stop() { try { Log.d(TAG, "Closing session and releasing the device resources"); if (device != null) { ControlPanelService.getInstance().stopControllableDevice(device); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void sessionLost(final ControllableDevice device) { if (this.device.getDeviceId().equalsIgnoreCase(device.getDeviceId())) { getActivitySafely().runOnUiThread(new Runnable(){ @Override public void run() { String text = "Received SESSION_LOST for device: '" + device.getDeviceId() + "'"; Log.d(TAG, text); Toast.makeText(getActivitySafely(), text, Toast.LENGTH_LONG).show(); stop(); raiseControlPanelStaleEvent(); }}); } } @Override public void sessionEstablished(final ControllableDevice device, java.util.Collection controlPanelContainer) { Log.d(TAG, "Received sessionEstablished for device: '" + device.getDeviceId() + "'"); getActivitySafely().runOnUiThread(new Runnable(){ @Override public void run() { hideProgressDialog(); selectControlPanel(device); } }); } /** * Act when Control Panel is selected */ private void onControlPanelSelected() { //The time unit depends on the given TimeUnit object AsyncTask panelLoader; panelLoader = new AsyncTask () { @Override protected void onPreExecute() { showProgressDialog("Retrieving Control Panel"); } @Override protected Object doInBackground(Void... params) { try { return deviceControlPanel.getRootElement(DeviceController.this); } catch (ControlPanelException cpe) { return cpe; } } @Override protected void onPostExecute(Object result) { if ( result instanceof ControlPanelException ) { String errMsg = "Failed to retrieve the Control Panel"; Log.e(TAG, errMsg, (ControlPanelException)result); renderErrorMessage(errMsg); hideProgressDialog(); return; } controlPanelAdapter = new ControlPanelAdapter(getActivitySafely(), DeviceController.this); hideProgressDialog(); buildControlPanel( (UIElement)result ); } }; panelLoader.execute(); } /** * Builds the Control Panel depending on its type * @param rootContainerElement */ private void buildControlPanel(UIElement rootContainerElement) { UIElementType elementType = rootContainerElement.getElementType(); Log.d(TAG, "Found root container of type: '" + elementType + "', building"); if ( elementType == UIElementType.CONTAINER ) { showProgressDialog("Populating container"); controlPanelAdapter.createContainerViewAsync((ContainerWidget) rootContainerElement, this); } else if ( elementType == UIElementType.ALERT_DIALOG ) { renderControlPanelDialog(rootContainerElement); } } /** * @see org.alljoyn.ioe.controlpaneladapter.ContainerCreatedListener#onContainerViewCreated(android.view.View) */ @Override public void onContainerViewCreated(final View containerLayout) { getActivitySafely().runOnUiThread(new Runnable(){ @Override public void run() { hideProgressDialog(); if (rootView != null) { LinearLayout body = (LinearLayout) rootView.findViewById(R.id.control_panel); body.removeAllViews(); body.addView(containerLayout); } } }); } /** * Render the Control Panel Alert Dialog * @param rootContainerElement */ private void renderControlPanelDialog(UIElement rootContainerElement) { Log.d(TAG, "Found root container of type: '" + rootContainerElement.getElementType() + "', building"); AlertDialogWidget alertDialogWidget = ((AlertDialogWidget)rootContainerElement); AlertDialog alertDialog = controlPanelAdapter.createAlertDialog(alertDialogWidget); alertDialog.setCancelable(false); alertDialog.setCanceledOnTouchOutside(false); alertDialog.setOnDismissListener(new AlertDialog.OnDismissListener() { @Override public void onDismiss(DialogInterface arg0) { String text = "Dialog dismissed."; Toast.makeText(getActivitySafely(), text, Toast.LENGTH_LONG).show(); Log.d(TAG, text); } }); alertDialog.show(); } /** * Renders the error message on the screen * @param msg The message to render */ private void renderErrorMessage(String msg) { final TextView returnView = new TextView(getActivitySafely()); returnView.setText(msg); getActivitySafely().runOnUiThread(new Runnable() { @Override public void run() { if (rootView != null) { LinearLayout body = (LinearLayout) rootView.findViewById(R.id.control_panel); body.removeAllViews(); body.addView(returnView); } } }); } private void selectControlPanel(ControllableDevice device) { if (rootView != null) { Spinner unitSelector = (Spinner) rootView.findViewById(R.id.unit_selector); Collection unitCollection = device.getUnitCollection(); if (unitCollection.size() == 0) { Log.w(TAG, "No units found"); unitSelector.setEnabled(false); } else { final ArrayAdapter adapter = new ArrayAdapter(getActivitySafely(), android.R.layout.simple_spinner_item); for (Unit unit: unitCollection) { adapter.add(new LabelValuePair(unit.getUnitId(), unit)); } unitSelector.setAdapter(adapter); if (unitCollection.size() == 1) { unitSelector.setEnabled(false); onUnitSelection(unitCollection.iterator().next()); } else { // register a selection listener OnItemSelectedListener listener = new OnItemSelectedListener() { int currentSelection = 1000; @Override public void onItemSelected(AdapterView parent, View view, final int pos, long id) { if (pos == currentSelection) { Log.d(TAG, String.format("Selected position %d already selected. No action required", pos)); } else { currentSelection = pos; LabelValuePair item = adapter.getItem(pos); Unit selectedUnit = (Unit) item.value; onUnitSelection(selectedUnit); } } @Override public void onNothingSelected(AdapterView parent) { // Another interface callback } }; unitSelector.setOnItemSelectedListener(listener); } } } } private void onUnitSelection(Unit selectedUnit) { Log.d(TAG, String.format("Unit selected: '%s'", selectedUnit.getUnitId())); Collection controlPanelContainer = selectedUnit.getControlPanelCollection(); selectControlPanelCollection(controlPanelContainer); } private void selectControlPanelCollection( Collection controlPanelContainer) { if (rootView != null) { Spinner cpCollectionSelector = (Spinner) rootView.findViewById(R.id.cp_collection_selector); if (controlPanelContainer.size() == 0) { Log.w(TAG, "No control panel collections found"); cpCollectionSelector.setEnabled(false); } else { final ArrayAdapter adapter = new ArrayAdapter(getActivitySafely(), android.R.layout.simple_spinner_item); for (ControlPanelCollection cpCollection: controlPanelContainer) { adapter.add(new LabelValuePair(cpCollection.getName(), cpCollection)); } cpCollectionSelector.setAdapter(adapter); if (controlPanelContainer.size() == 1) { cpCollectionSelector.setEnabled(false); onControlPanelCollectionSelection(controlPanelContainer.iterator().next()); } else { // register a selection listener OnItemSelectedListener listener = new OnItemSelectedListener() { int currentSelection = 1000; @Override public void onItemSelected(AdapterView parent, View view, final int pos, long id) { if (pos == currentSelection) { Log.d(TAG, String.format("Selected position %d already selected. No action required", pos)); } else { currentSelection = pos; LabelValuePair item = adapter.getItem(pos); ControlPanelCollection cpCollection = (ControlPanelCollection) item.value; onControlPanelCollectionSelection(cpCollection); } } @Override public void onNothingSelected(AdapterView parent) { // Another interface callback } }; cpCollectionSelector.setOnItemSelectedListener(listener); } } } } private void onControlPanelCollectionSelection(ControlPanelCollection controlPanelCollection) { Collection controlPanels = controlPanelCollection.getControlPanels(); String language_IETF_RFC5646_java = Locale.getDefault().toString(); //"en_US", "es_SP" String language_IETF_RFC5646 = language_IETF_RFC5646_java.replace('_', '-'); String languageISO639 = Locale.getDefault().getLanguage(); //"en", "es" DeviceControlPanel previousControlPanel = deviceControlPanel; boolean found = false; for(DeviceControlPanel controlPanel : controlPanels) { String cpLanugage = controlPanel.getLanguage(); Log.d(TAG, String.format("Control Panel language: %s", cpLanugage)); if (cpLanugage.equalsIgnoreCase(language_IETF_RFC5646) || cpLanugage.equalsIgnoreCase(languageISO639) // phone language=de_DE (de), cp language=de_AT || cpLanugage.startsWith(languageISO639)) { deviceControlPanel = controlPanel; found = true; Log.d(TAG, String.format("Found a control panel that matches phone languages: RFC5646=%s, ISO639=%s, Given language was: %s", language_IETF_RFC5646, languageISO639, cpLanugage)); break; } } if (!found && !controlPanels.isEmpty()) { Log.w(TAG, String.format("Could not find a control panel that matches phone languages: RFC5646=%s, ISO639=%s", language_IETF_RFC5646, languageISO639)); deviceControlPanel = controlPanels.iterator().next(); Log.d(TAG, String.format("Defaulting to the control panel of language: %s", deviceControlPanel.getLanguage())); } Log.d(TAG, "Releasing the previous device control panel"); if (previousControlPanel != null) { previousControlPanel.release(); } if ( deviceControlPanel != null ) { onControlPanelSelected(); } else { Log.w(TAG, "No DeviceControlPanel found, ControlPanelCollection size: '" + controlPanels.size() + "'"); } } public void metadataChanged(ControllableDevice device, final UIElement uielement) { UIElementType elementType = uielement.getElementType(); Log.d(TAG, "METADATA_CHANGED : Received metadata changed signal, device: '" + device.getDeviceId() + "', ObjPath: '" + uielement.getObjectPath() + "', element type: '" + elementType + "'"); Activity activity = getActivitySafely(); if (activity != null) { activity.runOnUiThread(new Runnable() { @Override public void run() { controlPanelAdapter.onMetaDataChange(uielement); } }); } } @Override public void errorOccurred(ControllableDevice device, final String reason) { final String text = "ErrorOccurred was called, Reason: '" + reason + "'"; Log.e(TAG, text); if (this.device.getDeviceId().equalsIgnoreCase(device.getDeviceId())) { final Activity activity = getActivitySafely(); if (activity == null) { return; } activity.runOnUiThread(new Runnable() { @Override public void run() { hideProgressDialog(); Toast.makeText(activity, text, Toast.LENGTH_LONG).show(); if ( isErrorSevere(reason) ) { Log.w(TAG, "The received error: '" + reason + "' is severe, calling raiseControlPanelStaleEvent"); raiseControlPanelStaleEvent(); } } }); } } /** * Analyzes whether the given error reason is severe that * {@link DeviceDetailFragment#raiseControlPanelStaleEvent()} should be called * @param reason The error reason * @return TRUE if the error is severe otherwise FALSE is returned */ private boolean isErrorSevere(String reason) { if ( reason == null ) { return false; } Status status; try { status = Status.valueOf(reason); } catch(IllegalArgumentException ilae) { //Not an AllJoyn status return false; } if ( status == Status.ALLJOYN_JOINSESSION_REPLY_ALREADY_JOINED ) { return false; //Not considered as an error } return true; //All the other cases are considered as a severe error } @Override public void handleControlPanelException(ControlPanelException e) { Activity activity = getActivitySafely(); if ( activity == null ) { Log.w(TAG, "handleControlPanelException - activity is not defined, returning"); return; } String text = activity.getString(R.string.action_failed); Log.e(TAG, text + ", error in calling remote object: '" + e.getMessage() + "'"); Toast.makeText(activity, text, Toast.LENGTH_SHORT).show(); } @Override public void errorOccurred(DeviceControlPanel deviceControlPanel, String reason) { errorOccurred(deviceControlPanel.getDevice(), reason); } @Override public void metadataChanged(DeviceControlPanel deviceControlPanel, final UIElement uielement) { Log.d(TAG, "Received metadataChanged signal, device: '" + deviceControlPanel.getDevice().getDeviceId() + "', ObjPath: '" + uielement.getObjectPath() + "'"); if (device.getDeviceId().equalsIgnoreCase(deviceControlPanel.getDevice().getDeviceId())) { UIElementType elementType = uielement.getElementType(); Log.d(TAG, "Received metadataChanged : Received metadata changed signal, device: '" + device.getDeviceId() + "', ObjPath: '" + uielement.getObjectPath() + "', element type: '" + elementType + "'"); Activity activity = getActivitySafely(); if (activity != null) { activity.runOnUiThread(new Runnable() { @Override public void run() { controlPanelAdapter.onMetaDataChange(uielement); } }); } } } @Override public void valueChanged(DeviceControlPanel deviceControlPanel, final UIElement uielement, final Object newValue) { Log.d(TAG, "Received valueChanged signal, device: '" + deviceControlPanel.getDevice().getDeviceId() + "', ObjPath: '" + uielement.getObjectPath() + "', NewValue: '" + newValue + "'"); if (device.getDeviceId().equalsIgnoreCase(deviceControlPanel.getDevice().getDeviceId())) { if (controlPanelAdapter != null) { final Activity activity = getActivitySafely(); if (activity != null) { activity.runOnUiThread(new Runnable() { @Override public void run() { controlPanelAdapter.onValueChange(uielement, newValue); String text = "Received value changed signal, ObjPath: '" + uielement.getObjectPath() + "', NewValue: '" + newValue + "'"; Toast.makeText(activity, text, Toast.LENGTH_SHORT).show(); } }); } } } } @Override public void notificationActionDismiss(DeviceControlPanel deviceControlPanel) { Log.d(TAG,"Received notificationActionDismiss"); if (alertDialog != null && alertDialog.isShowing()) { Log.d(TAG,"Dismissing the dialog"); alertDialog.dismiss(); } } }; /** * A wrapper class for hosting a {label,value} pair inside an ArrayAdapter. * So that the label is displayed, while practically the real value is used. */ class LabelValuePair { final String label; final Object value; public LabelValuePair(String label, Object value) { super(); this.value = value; this.label = label; } @Override // This does the trick of displaying the label and not the value in the Adapter public String toString() { return label; } } } DeviceList.java000066400000000000000000000141531262264444500422400ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/src/org/alljoyn/ioe/controlpanelbrowserpackage org.alljoyn.ioe.controlpanelbrowser; /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.UUID; import android.os.Parcel; import android.os.Parcelable; import android.util.Log; /** * The list of the Devices discovered by Announcements */ public class DeviceList { private static final String TAG = "cpappDeviceList"; /** * An array of ControlPanelContexts. */ private final List contexts = new ArrayList(); public void addItem(DeviceContext item) { //If the device with the same deviceId, appId exists, then remove it removeExistingDevice(item.getDeviceId(), item.getAppId()); contexts.add(item); } public List getContexts() { return contexts; } public void onDeviceOffline(String busName) { Iterator iter = contexts.iterator(); while ( iter.hasNext() ) { DeviceContext context = iter.next(); if ( context.getBusName().equals(busName) ) { Log.d(TAG, "Found the busName to be removed from the list: '" + busName + "'"); iter.remove(); } } } /** * Check whether the {@link DeviceContext} with the given deviceId and appId exist in the list. * If the device is found it's removed from the {@link DeviceList}. * @param deviceId * @param appId * @return {@link DeviceContext} if the device was found and removed from the {@link DeviceList} * otherwise NULL is returned */ private DeviceContext removeExistingDevice(String deviceId, UUID appId) { Iterator iter = contexts.iterator(); while ( iter.hasNext() ) { DeviceContext context = iter.next(); if ( context.getDeviceId().equals(deviceId) && context.getAppId().equals(appId) ) { Log.d(TAG, "The Device with the deviceId: '" + deviceId + "', appId: '" + appId + "' already exists, removing"); iter.remove(); return context; } } return null; } //=========================================================// /** * An item representing a device. */ public static class DeviceContext implements Parcelable { final private String deviceId; final private String busName; final private String label; final private Map object2Interfaces; final private UUID appId; /** * Constructor * @param deviceId * @param busName * @param deviceName * @param appId */ public DeviceContext(String deviceId, String busName, String deviceName, UUID appId) { Log.d("DeviceList", String.format("Adding a new device. id='%s', busName='%s', name='%s' appId='%s;", deviceId, busName, deviceName, appId)); this.deviceId = deviceId; this.busName = busName; this.appId = appId; this.object2Interfaces = new HashMap(5); label = deviceName + '(' + busName + ')'; } public String getDeviceId() { return deviceId; } public String getBusName() { return busName; } public UUID getAppId() { return appId; } public String getLabel() { return label; } public void addObjectInterfaces(String objPath, String[] interfaces) { object2Interfaces.put(objPath, interfaces); } public String[] getInterfaces(String objPath) { return object2Interfaces.get(objPath); } @Override public String toString() { return label; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel out, int flags) { out.writeStringArray(new String[] { deviceId, busName, label, appId.toString() }); out.writeMap(this.object2Interfaces); } public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { @Override public DeviceContext createFromParcel(Parcel in) { return new DeviceContext(in); } @Override public DeviceContext[] newArray(int size) { return new DeviceContext[size]; } }; private DeviceContext(Parcel in) { String[] fields = new String[4]; in.readStringArray(fields); this.deviceId = fields[0]; this.busName = fields[1]; this.label = fields[2]; this.appId = UUID.fromString(fields[3]); this.object2Interfaces = new HashMap(5); in.readMap(object2Interfaces, getClass().getClassLoader()); } public Set getBusObjects() { return object2Interfaces.keySet(); } } } DeviceListActivity.java000066400000000000000000000117341262264444500437570ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/src/org/alljoyn/ioe/controlpanelbrowserpackage org.alljoyn.ioe.controlpanelbrowser; /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ import org.alljoyn.ioe.controlpanelbrowser.DeviceDetailFragment.DeviceDetailCallback; import org.alljoyn.ioe.controlpanelbrowser.DeviceList.DeviceContext; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.util.Log; /** * An activity representing a list of Appliances. This activity has different * presentations for handset and tablet-size devices. On handsets, the activity * presents a list of items, which when touched, lead to a * {@link DeviceDetailActivity} representing item details. On tablets, the * activity presents the list of items and item details side-by-side using two * vertical panes. *

* The activity makes heavy use of fragments. The list of items is a * {@link DeviceListFragment} and the item details (if present) is a * {@link DeviceDetailFragment}. *

* This activity also implements the required * {@link DeviceListFragment.DeviceListCallback} interface to listen for item * selections. */ public class DeviceListActivity extends FragmentActivity implements DeviceListFragment.DeviceListCallback, DeviceDetailCallback { /** * For logging */ private final static String TAG = "cpappApplianceListActivity"; /** * Whether or not the activity is in two-pane mode, i.e. running on a tablet * device. */ private boolean isTwoPane; /** * The {@link Fragment} containing the Control Panel */ private DeviceDetailFragment fragment; @Override protected void onCreate(Bundle savedInstanceState) { Log.d(TAG, "onCreate()"); super.onCreate(savedInstanceState); setContentView(R.layout.activity_device_list); if (findViewById(R.id.appliance_detail_container) != null) { // The detail container view will be present only in the // large-screen layouts (res/values-large and // res/values-sw600dp). If this view is present, then the // activity should be in two-pane mode. isTwoPane = true; // In two-pane mode, list items should be given the // 'activated' state when touched. ((DeviceListFragment) getSupportFragmentManager().findFragmentById(R.id.appliance_list)).setActivateOnItemClick(true); } } @Override public void onDestroy() { super.onDestroy(); } /** * Callback method from {@link DeviceListFragment.DeviceListCallback} * indicating that the item with the given ID was selected. */ @Override public void onItemSelected(DeviceContext context) { if (isTwoPane) { // In two-pane mode, show the detail view in this activity by // adding or replacing the detail fragment using a // fragment transaction. Bundle arguments = new Bundle(); arguments.putParcelable(DeviceDetailFragment.ARG_ITEM_ID, context); fragment = new DeviceDetailFragment(); fragment.setArguments(arguments); getSupportFragmentManager().beginTransaction().replace(R.id.appliance_detail_container, fragment).commit(); } else { // In single-pane mode, simply start the detail activity // for the selected item ID. Intent detailIntent = new Intent(this, DeviceDetailActivity.class); detailIntent.putExtra(DeviceDetailFragment.ARG_ITEM_ID, context); startActivity(detailIntent); } } /** * @see org.alljoyn.ioe.controlpanelbrowser.DeviceDetailFragment.DeviceDetailCallback#onControlPanelStale() */ @Override public void onControlPanelStale() { if ( fragment == null ) { Log.wtf(TAG, "onControlPanelStale was called, but Fragment is NULL, weird..."); return; } Log.d(TAG, "onControlPanelStale was called need to detach the DeviceDetailFragment"); getSupportFragmentManager().beginTransaction().detach(fragment).commit(); } } DeviceListFragment.java000066400000000000000000000562611262264444500437320ustar00rootroot00000000000000base-15.09/controlpanel/java/sample_applications/android/ControlPanelBrowser/src/org/alljoyn/ioe/controlpanelbrowserpackage org.alljoyn.ioe.controlpanelbrowser; /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ import java.util.Map; import java.util.UUID; import org.alljoyn.about.AboutKeys; import org.alljoyn.bus.AboutListener; import org.alljoyn.bus.AboutObjectDescription; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.BusException; import org.alljoyn.bus.SessionOpts; import org.alljoyn.bus.Status; import org.alljoyn.bus.Variant; import org.alljoyn.ioe.controlpanelbrowser.DeviceList.DeviceContext; import org.alljoyn.ioe.controlpanelservice.ControlPanelException; import org.alljoyn.ioe.controlpanelservice.ControlPanelService; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.ControlPanel; import org.alljoyn.ioe.controlpanelservice.communication.interfaces.HTTPControl; import org.alljoyn.services.android.security.AuthPasswordHandler; import org.alljoyn.services.android.security.SrpAnonymousKeyListener; import org.alljoyn.services.common.utils.GenericLogger; import org.alljoyn.services.common.utils.TransportUtil; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.SharedPreferences; import android.os.Bundle; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; import android.os.Message; import android.support.v4.app.ListFragment; import android.text.InputType; import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.ArrayAdapter; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.EditText; import android.widget.ListView; import android.widget.Toast; /** * A list fragment representing a list of Appliances. This fragment also * supports tablet devices by allowing list items to be given an 'activated' * state upon selection. This helps indicate which item is currently being * viewed in a {@link DeviceDetailFragment}. *

* Activities containing this fragment MUST implement the * {@link DeviceListCallback} interface. */ public class DeviceListFragment extends ListFragment { /** * The serialization (saved instance state) Bundle key representing the * activated item position. Only used on tablets. */ private static final String STATE_ACTIVATED_POSITION = "activated_position"; /** * The fragment's current callback object, which is notified of list item * clicks. */ private DeviceListCallback mCallbacks = sDummyCallbacks; /** * The current activated item position. Only used on tablets. */ private int mActivatedPosition = ListView.INVALID_POSITION; /** * A callback interface that all activities containing this fragment must * implement. This mechanism allows activities to be notified of item * selections. */ public interface DeviceListCallback { /** * Callback for when an item has been selected. */ public void onItemSelected(DeviceContext context); } /** * A dummy implementation of the {@link DeviceListCallback} interface that * does nothing. Used only when this fragment is not attached to an * activity. */ private static DeviceListCallback sDummyCallbacks = new DeviceListCallback() { @Override public void onItemSelected(DeviceContext context) { } }; /** * For logging */ private final static String TAG = "cpappApplianceListFragment"; /** * A Handler for handling AllJoyn connection and disconnection on a * separated thread. */ private AsyncHandler handler; /** * A device registry */ private DeviceList deviceRegistry; /** * The AllJoyn bus attachment */ private BusAttachment bus; /** * The AllJoyn daemon advertises itself so thin clients can connect to it. * This is the known prefix of the daemon advertisement. */ private static final String DAEMON_NAME_PREFIX = "org.alljoyn.BusNode"; /** * The daemon should advertise itself "quietly" (directly to the calling * port) This is to reply directly to a TC looking for a daemon */ private static final String DAEMON_QUIET_PREFIX = "quiet@"; /** * The password for authentication with a remote secured Interface */ private static final String PREFS_NAME = "MyPrefsFile"; private static final String PREFS_PASSWORD = "CPB_PASS"; private static final String DEFAULT_SECURED_SRP_PASSWORD = "000000"; private String srpPassword = DEFAULT_SECURED_SRP_PASSWORD; /** * Supported Authentication mechanisms */ private final String[] AUTH_MECHANISMS = new String[] { "ALLJOYN_SRP_KEYX", "ALLJOYN_ECDHE_PSK" }; private static final String[] ANNOUNCE_IFACES = new String[] { ControlPanel.IFNAME, HTTPControl.IFNAME }; /** * Load the native alljoyn_java library. */ static { System.loadLibrary("alljoyn_java"); } /** * Reference to Logger */ private final GenericLogger logger = new GenericLogger() { @Override public void debug(String TAG, String msg) { Log.d(TAG, msg); } @Override public void info(String TAG, String msg) { Log.i(TAG, msg); } @Override public void warn(String TAG, String msg) { Log.w(TAG, msg); } @Override public void error(String TAG, String msg) { Log.e(TAG, msg); } @Override public void fatal(String TAG, String msg) { Log.wtf(TAG, msg); } }; /** * Mandatory empty constructor for the fragment manager to instantiate the * fragment (e.g. upon screen orientation changes). */ public DeviceListFragment() { } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); deviceRegistry = new DeviceList(); HandlerThread busThread = new HandlerThread("BusHandler"); busThread.start(); handler = new AsyncHandler(busThread.getLooper()); handler.sendEmptyMessage(AsyncHandler.CONNECT); } @Override public void onDestroy() { // Disconnect to prevent any resource leaks. handler.disconnect(); handler.getLooper().quit(); super.onDestroy(); } @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); // Restore the previously serialized activated item position. if (savedInstanceState != null && savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) { setActivatedPosition(savedInstanceState.getInt(STATE_ACTIVATED_POSITION)); } } @Override public void onAttach(Activity activity) { super.onAttach(activity); // Activities containing this fragment must implement its callbacks. if (!(activity instanceof DeviceListCallback)) { throw new IllegalStateException("Activity must implement fragment's callbacks."); } mCallbacks = (DeviceListCallback) activity; } @Override public void onDetach() { super.onDetach(); // Reset the active callbacks interface to the dummy implementation. mCallbacks = sDummyCallbacks; } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { // TODO Add your menu entries here super.onCreateOptionsMenu(menu, inflater); // Inflate the menu; this adds items to the action bar if it is present. inflater.inflate(R.menu.activity_control_panel, menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle item selection if (item.getItemId() == R.id.menu_set_password) { showSetPasswordDialog(); return true; } else { return super.onOptionsItemSelected(item); } } @Override public void onListItemClick(ListView listView, View view, int position, long id) { super.onListItemClick(listView, view, position, id); // Notify the active callbacks interface (the activity, if the // fragment is attached to one) that an item has been selected. mCallbacks.onItemSelected(deviceRegistry.getContexts().get(position)); } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); if (mActivatedPosition != ListView.INVALID_POSITION) { // Serialize and persist the activated item position. outState.putInt(STATE_ACTIVATED_POSITION, mActivatedPosition); } } /** * Turns on activate-on-click mode. When this mode is on, list items will be * given the 'activated' state when touched. */ public void setActivateOnItemClick(boolean activateOnItemClick) { // When setting CHOICE_MODE_SINGLE, ListView will automatically // give items the 'activated' state when touched. getListView().setChoiceMode(activateOnItemClick ? ListView.CHOICE_MODE_SINGLE : ListView.CHOICE_MODE_NONE); } private void setActivatedPosition(int position) { if (position == ListView.INVALID_POSITION) { getListView().setItemChecked(mActivatedPosition, false); } else { getListView().setItemChecked(position, true); } mActivatedPosition = position; } /* This class will handle all AllJoyn calls. See onCreate(). */ class AsyncHandler extends Handler implements AboutListener, AuthPasswordHandler { public static final int CONNECT = 1; public static final int DISCONNECT = 2; public AsyncHandler(Looper looper) { super(looper); } @Override public void handleMessage(Message msg) { switch (msg.what) { /* Connect to the bus and start our service. */ case CONNECT: { connect(); break; } /* Release all resources acquired in connect. */ case DISCONNECT: { disconnect(); break; } } } // =================================== Connect // ============================================ /** * Connect to the bus and start our services. */ private void connect() { Log.d(TAG, "connect()"); /* initialize AllJoyn BusAttachment. */ bus = new BusAttachment("ControlPanelBrowser", BusAttachment.RemoteMessage.Receive); // Pump up the daemon debug level // bus.setDaemonDebug("ALL", 7); // bus.setLogLevels("ALLJOYN=7"); // bus.useOSLogging(true); // load the password for accessing secured interfaces on the board SharedPreferences settings = getActivity().getSharedPreferences(PREFS_NAME, 0); srpPassword = settings.getString(PREFS_PASSWORD, DEFAULT_SECURED_SRP_PASSWORD); Log.d(TAG, "Setting the AuthListener"); SrpAnonymousKeyListener authListener = new SrpAnonymousKeyListener(this, logger, AUTH_MECHANISMS); Status authStatus = bus.registerAuthListener(authListener.getAuthMechanismsAsString(), authListener, getKeyStoreFileName()); if (authStatus != Status.OK) { Log.e(TAG, "Failed to register AuthListener"); } Status status = bus.connect(); if (Status.OK == status) { Log.d(TAG, "BusAttachment.connect(): ok. BusUniqueName: " + bus.getUniqueName()); // request the name String daemonName = DAEMON_NAME_PREFIX + ".ControlPanelBrowser.G" + bus.getGlobalGUIDString(); int flag = BusAttachment.ALLJOYN_REQUESTNAME_FLAG_DO_NOT_QUEUE; Status reqStatus = bus.requestName(daemonName, flag); if (reqStatus == Status.OK) { // advertise the name with a quite prefix for thin clients // to find it Status adStatus = bus.advertiseName(DAEMON_QUIET_PREFIX + daemonName, SessionOpts.TRANSPORT_ANY); if (adStatus != Status.OK) { bus.releaseName(daemonName); Log.e(TAG, "Failed to advertise daemon name: '" + daemonName + "', Error: '" + status + "'"); } else { Log.d(TAG, "Succefully advertised daemon name: '" + daemonName + "'"); } } else { Log.e(TAG, "Failed to request daemon name: '" + daemonName + "', Error: '" + status + "'"); } } // Initialize AboutService bus.registerAboutListener(this); for (String iface : ANNOUNCE_IFACES) { bus.whoImplements(new String[] { iface }); } // Initialize ControlPanelService ControlPanelService controlPanelService = ControlPanelService.getInstance(); try { controlPanelService.init(bus); Log.d(TAG, "Initialized ControlPanelService with BusAttachment " + bus.getUniqueName()); } catch (ControlPanelException e) { Log.e(TAG, "Unable to start ControlPanelService, Error: " + e.getMessage()); } Toast.makeText(getActivity(), "Initialized", Toast.LENGTH_SHORT).show(); // update the list refreshListView(); } // =================================== Disconnect // ============================================ /** * Release all resources acquired in connect. */ private void disconnect() { ControlPanelService.getInstance().shutdown(); for (String iface : ANNOUNCE_IFACES) { bus.cancelWhoImplements(new String[] { iface }); } bus.unregisterAboutListener(this); bus.disconnect(); bus.release(); } // =================================== onAnnouncement // ============================================ /* * A callback where About service notifies listeners about a new * announcement. * * @see * org.alljoyn.services.common.AnnouncementHandler#onAnnouncement(java * .lang.String, short, * org.alljoyn.services.common.BusObjectDescription[], java.util.Map) */ @Override public void announced(String busName, int version, short port, AboutObjectDescription[] objectDescriptions, Map aboutMap) { String deviceId; String deviceFriendlyName; UUID appId; DeviceContext deviceContext = null; try { Variant varDeviceId = aboutMap.get(AboutKeys.ABOUT_DEVICE_ID); String devIdSig = (varDeviceId != null) ? varDeviceId.getSignature() : ""; if (!devIdSig.equals("s")) { Log.e(TAG, "Received '" + AboutKeys.ABOUT_DEVICE_ID + "', that has an unexpected signature: '" + devIdSig + "', the expected signature is: 's'"); return; } deviceId = varDeviceId.getObject(String.class); Variant varFriendlyName = aboutMap.get(AboutKeys.ABOUT_DEVICE_NAME); String friendlyNameSig = (varFriendlyName != null) ? varFriendlyName.getSignature() : ""; if (!friendlyNameSig.equals("s")) { Log.e(TAG, "Received '" + AboutKeys.ABOUT_DEVICE_NAME + "', that has an unexpected signature: '" + friendlyNameSig + "', the expected signature is: 's'"); return; } deviceFriendlyName = varFriendlyName.getObject(String.class); Variant varAppId = aboutMap.get(AboutKeys.ABOUT_APP_ID); String appIdSig = (varAppId != null) ? varAppId.getSignature() : ""; if (!appIdSig.equals("ay")) { Log.e(TAG, "Received '" + AboutKeys.ABOUT_APP_ID + "', that has an unexpected signature: '" + appIdSig + "', the expected signature is: 'ay'"); return; } byte[] rawAppId = varAppId.getObject(byte[].class); appId = TransportUtil.byteArrayToUUID(rawAppId); if (appId == null) { Log.e(TAG, "Received a bad AppId, failed to convert it to the UUID"); return; } } catch (BusException be) { Log.e(TAG, "Failed to retreive an Announcement properties, Error: '" + be.getMessage() + "'", be); return; } // scan the object descriptions, pick those who implement a control // panel interface for (int i = 0; i < objectDescriptions.length; ++i) { AboutObjectDescription description = objectDescriptions[i]; String[] supportedInterfaces = description.interfaces; for (int j = 0; j < supportedInterfaces.length; ++j) { if (supportedInterfaces[j].startsWith(ControlPanelService.INTERFACE_PREFIX)) { // found a control panel interface Log.d(TAG, "Adding BusObjectDesciption: " + description); if (deviceContext == null) { deviceContext = new DeviceContext(deviceId, busName, deviceFriendlyName, appId); } deviceContext.addObjectInterfaces(description.path, supportedInterfaces); } } } // add the device context if (deviceContext != null) { deviceRegistry.addItem(deviceContext); } // update the list refreshListView(); } public void onDeviceLost(String busName) { Log.d(TAG, "Received DeviceLost for '" + busName + "'"); deviceRegistry.onDeviceOffline(busName); // update the list refreshListView(); } private void refreshListView() { getActivity().runOnUiThread(new Runnable() { @Override public void run() { ArrayAdapter arrayAdapter = new ArrayAdapter(getActivity(), android.R.layout.simple_list_item_activated_1, android.R.id.text1, deviceRegistry.getContexts()); setListAdapter(arrayAdapter); arrayAdapter.notifyDataSetChanged(); } }); } /** * @see org.alljoyn.services.android.security.AuthPasswordHandler#getPassword(java.lang.String) */ @Override public char[] getPassword(String peer) { return srpPassword.toCharArray(); } /** * @see org.alljoyn.bus.AuthListener#completed(java.lang.String, * java.lang.String, boolean) */ @Override public void completed(String authMechanism, String authPeer, final boolean authenticated) { Log.d(TAG, "Authentication completed. peer: '" + authPeer + "', authenticated: " + authenticated + " using mechanism: '" + authMechanism + "'"); if (authenticated) { Log.d(TAG, "The peer: '" + authPeer + "', authenticated successfully for authMechanism: '" + authMechanism + "'"); } else { Log.w(TAG, "The peer: '" + authPeer + "', WAS NOT authenticated for authMechanism: '" + authMechanism + "'"); } if (getActivity() != null) getActivity().runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(getActivity(), "Authenticated: " + authenticated, Toast.LENGTH_SHORT).show(); } }); } /** * Persistent authentication and encryption data is stored at this * location. * * This uses the private file area associated with the application * package. */ public String getKeyStoreFileName() { return getActivity().getFileStreamPath("alljoyn_keystore").getAbsolutePath(); }// getKeyStoreFileName } private void showSetPasswordDialog() { AlertDialog.Builder alert = new AlertDialog.Builder(getActivity()); alert.setTitle(R.string.enter_device_password); alert.setCancelable(false); View view = getActivity().getLayoutInflater().inflate(R.layout.enter_password_popup, null); final EditText input = (EditText) view.findViewById(R.id.passwordEditText); input.setText(srpPassword); final CheckBox showPassword = (CheckBox) view.findViewById(R.id.showPasswordCheckBox); alert.setView(view); showPassword.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { input.setInputType(InputType.TYPE_CLASS_TEXT); } else { input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); } } }); alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int whichButton) { srpPassword = input.getText().toString(); // store the new password SharedPreferences settings = getActivity().getSharedPreferences(PREFS_NAME, 0); SharedPreferences.Editor editor = settings.edit(); editor.putString(PREFS_PASSWORD, srpPassword); editor.commit(); } }); alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int whichButton) { } }); alert.show(); } } base-15.09/notification/000077500000000000000000000000001262264444500151415ustar00rootroot00000000000000base-15.09/notification/.gitignore000066400000000000000000000005721262264444500171350ustar00rootroot00000000000000*.developerprofile *.xcuserdatad *.a *.class *.jar *.o *.so *~ .cproject .project .sconsign.dblite */.settings/* libs QA ajlite.nvram alljoyn-daemon bin build deploy docs/*.html docs/html/*.html gen lib local.properties obj* # OS generated files # ###################### .DS_Store .DS_Store? ios/samples/.DS_Store ._* .Spotlight-V100 .Trashes ehthumbs.db Thumbs.db xcshareddata base-15.09/notification/ReleaseNotes.txt000066400000000000000000000032151262264444500202740ustar00rootroot00000000000000AllJoyn Notification Service Version 15.09 Release Notes ======================================================== Fully Supported Platforms ------------------------- 1) Linux Ubuntu (64 bit x86) 2) Android Lollipop (ARM7) Features added in Version 15.09 ------------------------------- None Issues Addressed in Version 15.09 --------------------------------- ASABASE-535: Replace the pink AllJoyn meatball logo with the new AllJoyn logo ASABASE-553: Update 15.09 SC base services to only use Config, Notification on Linux To search for other fixed issues: https://jira.allseenalliance.org/issues/?jql=project%20%3D%20ASABASE%20AND%20issuetype%20%3D%20Bug%20AND%20fixVersion%20%3D%20%2215.09%22%20AND%20component%20%3D%20%22Notification%20Service%20Framework%22%20AND%20status%20in%20(Resolved%2C%20Closed) Known Issues ------------ * Base services have not been updated to support security 2.0 To search for other known issues: https://jira.allseenalliance.org/issues/?jql=project%20%3D%20ASABASE%20AND%20issuetype%20%3D%20Bug%20AND%20fixVersion%20in%20(15.09a%2C%20%22Next%20Major%20Release%22)%20AND%20component%20%3D%20%22Notification%20Service%20Framework%22%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened%2C%20New%2C%20%22Monitor%20%2F%20On%20Hold%22) Compatibility ------------- No changes Change history -------------- 15.09 - Bug fixes, compatibility with Core 15.09 15.04 - Bug fixes, compatibility with Core 15.04 14.12 - Bug fixes, compatibility with Core 14.12 14.06 - bug fixes, updates needed to match new core 14.06, added notification with actions to samples that didn't support it. 14.02 - 1st AllSeen Alliance release base-15.09/notification/SConscript000066400000000000000000000051361262264444500171600ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. import os Import('env') env['_ALLJOYN_NOTIFICATION_'] = True env['OBJDIR_SERVICES_NOTIFICATION'] = env['OBJDIR'] + '/services/notification' # Make config library and header file paths available to the global environment env.Append(LIBPATH = '$DISTDIR/notification/lib'); env.Append(CPPPATH = '$DISTDIR/notification/inc'); if not env.has_key('_ALLJOYN_ABOUT_') and os.path.exists('../../../core/alljoyn/services/about/SConscript'): env.SConscript('../../../core/alljoyn/services/about/SConscript') if not env.has_key('_ALLJOYN_SERVICES_COMMON_') and os.path.exists('../services_common/SConscript'): env.SConscript('../services_common/SConscript') if 'cpp' in env['bindings'] and not env.has_key('_ALLJOYNCORE_') and os.path.exists('../../../core/alljoyn/alljoyn_core/SConscript'): env.SConscript('../../../core/alljoyn/alljoyn_core/SConscript') if 'java' in env['bindings'] and not env.has_key('_ALLJOYN_JAVA_') and os.path.exists('../../../core/alljoyn/alljoyn_java/SConscript'): env.SConscript('../../../core/alljoyn/alljoyn_java/SConscript') nsenv = env.Clone() # ASABASE-452, ASACORE-1419 # Even though we have deprecated the About Service code the notification service is # designed so a developer can use the deprecated AboutService or the new # About Feature code. So the notification service can continue to support the # deprecated methods we must turn off the deprecated-declarations warning. if nsenv['OS_GROUP'] == 'posix': nsenv.Append(CXXFLAGS = ['-Wno-deprecated-declarations']) for b in nsenv['bindings']: if os.path.exists('%s/SConscript' % b): nsenv.VariantDir('$OBJDIR_SERVICES_NOTIFICATION/%s' % b, b, duplicate = 0) nsenv.SConscript(['$OBJDIR_SERVICES_NOTIFICATION/%s/SConscript' % b for b in env['bindings'] if os.path.exists('%s/SConscript' % b) ], exports = ['nsenv']) base-15.09/notification/SConstruct000066400000000000000000000044731262264444500172030ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. import os env = SConscript('../../../core/alljoyn/build_core/SConscript') vars = Variables() vars.Add('BINDINGS', 'Bindings to build (comma separated list): cpp, java', 'cpp,java') vars.Add(EnumVariable('BUILD_SERVICES_SAMPLES', 'Build the services samples.', 'on', allowed_values = ['on', 'off'])) vars.Add(PathVariable('ALLJOYN_DISTDIR', 'Directory containing a built AllJoyn Core dist directory.', os.environ.get('ALLJOYN_DISTDIR'))) vars.Add(PathVariable('APP_COMMON_DIR', 'Directory containing common sample application sources.', os.environ.get('APP_COMMON_DIR','../sample_apps'))) vars.Update(env) Help(vars.GenerateHelpText(env)) if env.get('ALLJOYN_DISTDIR'): # normalize ALLJOYN_DISTDIR first env['ALLJOYN_DISTDIR'] = env.Dir('$ALLJOYN_DISTDIR') env.Append(CPPPATH = [ env.Dir('$ALLJOYN_DISTDIR/cpp/inc'), env.Dir('$ALLJOYN_DISTDIR/about/inc'), env.Dir('$ALLJOYN_DISTDIR/services_common/inc') ]) env.Append(LIBPATH = [ env.Dir('$ALLJOYN_DISTDIR/cpp/lib'), env.Dir('$ALLJOYN_DISTDIR/about/lib'), env.Dir('$ALLJOYN_DISTDIR/services_common/lib') ]) if env.get('APP_COMMON_DIR'): # normalize APP_COMMON_DIR env['APP_COMMON_DIR'] = env.Dir('$APP_COMMON_DIR') env['bindings'] = set([ b.strip() for b in env['BINDINGS'].split(',') ]) env.SConscript('SConscript') base-15.09/notification/cpp/000077500000000000000000000000001262264444500157235ustar00rootroot00000000000000base-15.09/notification/cpp/SConscript000066400000000000000000000031141262264444500177340ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('nsenv') if not nsenv.has_key('_ALLJOYNCORE_'): nsenv.Append(LIBS = ['alljoyn']) if nsenv['BR'] == 'on' : nsenv['ajrlib'] = 'ajrouter' if nsenv['OS'] == 'openwrt': nsenv.AppendUnique(LIBS = [ 'stdc++', 'pthread' ]) nsenv['NS_DISTDIR'] = nsenv['DISTDIR'] + '/notification' nsenv.Install('$NS_DISTDIR/inc/alljoyn/notification', nsenv.Glob('inc/alljoyn/notification/*.h')) nsenv.Install('$NS_DISTDIR/lib', nsenv.SConscript('src/SConscript', exports = ['nsenv'])) if nsenv['BUILD_SERVICES_SAMPLES'] == 'on': nsenv.Install('$NS_DISTDIR/bin', nsenv.SConscript('samples/SConscript', exports = ['nsenv'])) # Build docs installDocs = nsenv.SConscript('docs/SConscript', exports = ['nsenv']) nsenv.Depends(installDocs, nsenv.Glob('$NS_DISTDIR/inc/alljoyn/notification/*.h')); base-15.09/notification/cpp/docs/000077500000000000000000000000001262264444500166535ustar00rootroot00000000000000base-15.09/notification/cpp/docs/Doxygen_html000066400000000000000000001700461262264444500212470ustar00rootroot00000000000000# Doxyfile 1.6.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "AllJoyn™ Notification API Reference Manual" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = "Version 15.09.00" # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = YES # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = NO # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = YES # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = YES # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = ../inc/alljoyn/notification # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. # 20120131: header.html should no longer be used in production builds [MBUS-463] # doxygen 1.7.4 and later will generate buggy html if header.html is included HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) # there is already a search function so this one should typically # be disabled. SEARCHENGINE = YES #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = YES # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = YES # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = "QCC_DEPRECATED(func)=func" # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = YES # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 3 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = YES # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES base-15.09/notification/cpp/docs/SConscript000066400000000000000000000024231262264444500206660ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. import os Import('env') returnValue = [] docenv = env.Clone() # Build docs if docenv['DOCS'] == 'html': # the target directory 'docs/tmp' is never built this will cause doxygen # to run every time DOCS == 'html' generateDocs = docenv.Doxygen(source='Doxygen_html', target=[Dir('tmp'), Dir('html')]) returnValue = docenv.Install('$NS_DIST_DIR/docs', Dir('html')) docenv.Clean('Doxygen_html', Dir('html')) docenv.Depends(returnValue, generateDocs) Return('returnValue') base-15.09/notification/cpp/docs/footer.html000066400000000000000000000025051262264444500210410ustar00rootroot00000000000000


$projectname $projectnumber ($datetime)
Copyright AllSeen Alliance, Inc. All Rights Reserved.

AllSeen, AllSeen Alliance, and AllJoyn are trademarks of the AllSeen Alliance, Inc in the United States and other jurisdictions.

THIS DOCUMENT AND ALL INFORMATION CONTAIN HEREIN ARE PROVIDED ON AN "AS-IS" BASIS WITHOUT WARRANTY OF ANY KIND.
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
base-15.09/notification/cpp/inc/000077500000000000000000000000001262264444500164745ustar00rootroot00000000000000base-15.09/notification/cpp/inc/alljoyn/000077500000000000000000000000001262264444500201445ustar00rootroot00000000000000base-15.09/notification/cpp/inc/alljoyn/notification/000077500000000000000000000000001262264444500226325ustar00rootroot00000000000000base-15.09/notification/cpp/inc/alljoyn/notification/LogModule.h000066400000000000000000000023671262264444500247020ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef LOGMODULE_H_ #define LOGMODULE_H_ #include #include #include namespace ajn { namespace services { static char const* const QCC_MODULE = logModules::NOTIFICATION_MODULE_LOG_NAME; } } #endif /* LOGMODULE_H_ */ base-15.09/notification/cpp/inc/alljoyn/notification/Notification.h000066400000000000000000000227571262264444500254460ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATION_H_ #define NOTIFICATION_H_ #include #include #include #include #include #include #include #include "NotificationAsyncTaskEvents.h" #include namespace ajn { namespace services { /** * NotificationMsg * This message will be sent when user uses interface NotificationProducer * Implicit or explicit copy constructor must work. */ class NotificationMsg : public TaskData { public: /** * NotificationMsg constructor */ NotificationMsg(const char* originalSender, int32_t messageId, const char* appId) : m_OriginalSender(originalSender), m_MessageId(messageId), m_AppId(appId) { } /** * NotificationMsg destructor */ ~NotificationMsg() { } public: /** * The original sender of the notification */ const qcc::String m_OriginalSender; /** * The Notification's Message Id */ const int32_t m_MessageId; /** * The Notification's App Id */ const qcc::String m_AppId; }; /** * The Notification Class is used to send and receive Notifications */ class Notification { public: /** * Constructor for Notification * @param messageId * @param messageType * @param deviceId * @param deviceName * @param appId * @param appName * @param sender * @param customAttributes * @param notificationText * @param richIconUrl * @param richAudioUrl * @param richIconObjectPath * @param richAudioObjectPath * @param controlPanelServiceObjectPath * @param originalSender */ Notification(int32_t messageId, NotificationMessageType messageType, const char* deviceId, const char* deviceName, const char* appId, const char* appName, const char* sender, std::map const& customAttributes, std::vector const& notificationText, const char* richIconUrl, std::vector const& richAudioUrl, const char* richIconObjectPath, const char* richAudioObjectPath, const char* controlPanelServiceObjectPath, const char* originalSender); /** * Construct for Notification * @param messageType * @param notificationText */ Notification(NotificationMessageType messageType, std::vector const& notificationText); /** * Destructor of Notification */ ~Notification(); /** * copy constructor */ Notification(const Notification& notification); /** * Get the Version * @return version */ const uint16_t getVersion() const; /** * Get the device Id * @return deviceId */ const char* getDeviceId() const; /** * Get the Device Name * @return deviceName */ const char* getDeviceName() const; /** * Get the app Id * @return appId */ const char* getAppId() const; /** * Get the app Name * @return appName */ const char* getAppName() const; /** * Get the map of customAttributes * @return customAttributes */ const std::map& getCustomAttributes() const; /** * Get the Message Id * @return notificationId */ const int32_t getMessageId() const; /** * Get the Sender * @return Sender */ const char* getSenderBusName() const; /** * Get the MessageType * @return MessageType */ const NotificationMessageType getMessageType() const; /** * Get the Notification Text * @return notificationText */ const std::vector& getText() const; /** * Get the Rich Icon Url * @return richIconUrl */ const char* getRichIconUrl() const; /** * Get the Rich Icon Object Path * @return richIconObjectPath */ const char* getRichIconObjectPath() const; /** * Get the Rich Audio Object Path * @return richAudioObjectPath */ const char* getRichAudioObjectPath() const; /** * Get the Rich Audio Urls * @return RichAudioUrl */ const std::vector& getRichAudioUrl() const; /** * Get the ControlPanelService object path * @return ControlPanelServiceObjectPath */ const char* getControlPanelServiceObjectPath() const; /** * Get the OriginalSender object path * @return OriginalSender */ const char* getOriginalSender() const; /** * Set the App Id of the Notification * @param appId */ void setAppId(const char* appId); /** * Set the App Name of the Notification * @param appName */ void setAppName(const char* appName); /** * Set the Control Panel Service Object Path of the Notification * @param controlPanelServiceObjectPath */ void setControlPanelServiceObjectPath( const char* controlPanelServiceObjectPath); /** * Set the Custom Attributed of the Notification * @param customAttributes */ void setCustomAttributes( const std::map& customAttributes); /** * Set the deviceId of the Notification * @param deviceId */ void setDeviceId(const char* deviceId); /** * Set the deviceName of the Notification * @param deviceName */ void setDeviceName(const char* deviceName); /** * Set the messageId of the Notification * @param messageId */ void setMessageId(int32_t messageId); /** * Set the richAudioUrl of the Notification * @param richAudioUrl */ void setRichAudioUrl(const std::vector& richAudioUrl); /** * Set the richIconUrl of the Notification * @param richIconUrl */ void setRichIconUrl(const char* richIconUrl); /** * Set the richIconObjectPath of the Notification * @param richIconObjectPath */ void setRichIconObjectPath(const char* richIconObjectPath); /** * Set the richAudioObjectPath of the Notification * @param richAudioObjectPath */ void setRichAudioObjectPath(const char* richAudioObjectPath); /** * Set the sender of the Notification * @param sender */ void setSender(const char* sender); /** * dismiss */ QStatus dismiss(); /** * Responsible to get and handle events comming from the queue. */ static NotificationAsyncTaskEvents m_NotificationAsyncTaskEvents; /** * Purpose is to handle tasks asynchronously. * Handling user dismiss of the notification. */ static AsyncTaskQueue m_AsyncTaskQueue; private: /** * assignment operator is forbidden */ Notification& operator=(const Notification&); /** * set the original sender */ void setOriginalSender(const char* originalSender); /** * The Notification's Message Id */ int32_t m_MessageId; /** * The Notifications Sender */ qcc::String* m_Sender; /** * The Notifications MessageType */ NotificationMessageType m_MessageType; /** * The Notification's Device Id */ qcc::String* m_DeviceId; /** * The Notification's Device Name */ qcc::String* m_DeviceName; /** * The Notification's App Id */ qcc::String* m_AppId; /** * The Notification's App Name */ qcc::String* m_AppName; /** * The Notification's map of Custom Attributs */ std::map m_CustomAttributes; /** * The Notification's vector of Notification Texts */ std::vector m_Text; /** * The Notification's rich Icon Url */ qcc::String* m_RichIconUrl; /** * The Notification's vector of Rich Audio Urls */ std::vector m_RichAudioUrl; /** * The Notification's rich Icon Object Path */ qcc::String* m_RichIconObjectPath; /** * The Notification's rich Audio Object */ qcc::String* m_RichAudioObjectPath; /** * The Notification's ControlPanelService object path */ qcc::String* m_ControlPanelServiceObjectPath; /** * The Notification's original sender */ qcc::String* m_OriginalSender; }; } //namespace services } //namespace ajn #endif /* NOTIFICATION_H_ */ base-15.09/notification/cpp/inc/alljoyn/notification/NotificationAsyncTaskEvents.h000066400000000000000000000041661262264444500304460ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATION_ASYNCTASK_EVENTS_H_ #define NOTIFICATION_ASYNCTASK_EVENTS_H_ #include #include #include #include #include namespace ajn { namespace services { /** * Notification async task events. * Class implementing callbacks fto handle messages. */ class NotificationAsyncTaskEvents : public AsyncTask { public: /** * constructor of NotificationAsyncTaskEvents */ NotificationAsyncTaskEvents(); /** * destructor of NotificationAsyncTaskEvents */ virtual ~NotificationAsyncTaskEvents(); /** * callback to handle the case of empty message queue. */ virtual void OnEmptyQueue(); /** * callback to handle the case of new message * @param taskdata - object to handle */ virtual void OnTask(TaskData const* taskdata); private: /** * send dismiss signal * @param asyncTaskQueue - a template type of message */ void sendDismissSignal(TaskData const* taskdata); }; } //namespace services } //namespace ajn #endif /* NOTIFICATION_ASYNCTASK_EVENTS_H_ */ base-15.09/notification/cpp/inc/alljoyn/notification/NotificationEnums.h000066400000000000000000000050721262264444500264450ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONENUMS_H_ #define NOTIFICATIONENUMS_H_ #include namespace ajn { namespace services { /** * Enum to describe Message type levels */ enum NotificationMessageType { EMERGENCY = 0, //!< EMERGENCY - Urgent Message WARNING = 1, //!< WARNING - Warning Message INFO = 2, //!< INFO - Informational Message MESSAGE_TYPE_CNT = 3, //!< MESSAGE_TYPE_CNT - Number of Message Types Defined UNSET = 4 //!< UNSET - No message Type set - used for testing }; /** * A Util class that convers MessageType to String * */ class MessageTypeUtil { public: /** * Get MessageType String back based on int received * @param messageType - MessageType to convert * @return String that represents MessageType Enum */ static qcc::String const& getMessageTypeString(int32_t messageType); /** * Get MessageType int and convert to enum * To prevent ugly casting in many places * @param messageType - MessageType to convert * @return Enum MessageType */ static NotificationMessageType getMessageType(int32_t messageType); /** * Get the number of MessageType * Same as using enum MESSAGE_TYPE_CNT * @return amount of MessageType defined */ static int32_t getNumMessageTypes(); private: /** * Array that holds message type Strings */ static const qcc::String MESSAGE_TYPE_STRINGS[]; /** * private Constructor */ MessageTypeUtil() { }; }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONENUMS_H_ */ base-15.09/notification/cpp/inc/alljoyn/notification/NotificationReceiver.h000066400000000000000000000037341262264444500271250ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONRECEIVER_H_ #define NOTIFICATIONRECEIVER_H_ #include namespace ajn { namespace services { /** * An Abstract class with function receive. The implementation of this class * can be passed in to the initReceive function and will be the callback for * when notifications are received */ class NotificationReceiver { public: /** * Constructor for NotificationReceiver */ NotificationReceiver() { }; /** * Destructor for NotificationReceiver */ virtual ~NotificationReceiver() { }; /** * Pure abstract function that receives a notification * Consumer Application must override this method * @param notification the notification that is received */ virtual void Receive(Notification const& notification) = 0; /** * Dismiss handler */ virtual void Dismiss(const int32_t msgId, const qcc::String appId) = 0; }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONRECEIVER_H_ */ base-15.09/notification/cpp/inc/alljoyn/notification/NotificationSender.h000066400000000000000000000060651262264444500266010ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONSENDER_H_ #define NOTIFICATIONSENDER_H_ #include #include #include #include #include #include namespace ajn { namespace services { class Notification; /** * The class used to send Notifications or delete the last sent Notification */ class NotificationSender { public: /** * Constructor for NotificationSenderImpl * @param aboutdata - AboutData that includes entries * for deviceId, deviceName, appId and appName */ NotificationSender(ajn::AboutData* aboutdata); /** * Constructor for NotificationSenderImpl * @param propertyStore - propertyStoreImplementation that includes entries * for deviceId, deviceName, appId and appName * @deprecated see NotificationSender(ajn::AboutData*) */ QCC_DEPRECATED(NotificationSender(ajn::services::PropertyStore* propertyStore)); /** * Destructor for NotificationSenderImpl */ ~NotificationSender() { }; /** * Send notification * @param notification * @param ttl * @return */ QStatus send(Notification const& notification, uint16_t ttl); /** * Delete last message that was sent with given MessageType * @param messageType MessageType of message to be deleted * @return success/failure */ QStatus deleteLastMsg(NotificationMessageType messageType); /** * Get the notification id of the last message sent with the given MessageType * @param messageType type of message * @param messageId pointer to hold the notification id of the last message * @return success/failure */ QStatus getLastMsgId(NotificationMessageType messageType, int32_t* messageId); private: /** * Pointer to AboutData implementing the storage. */ ajn::AboutData* m_aboutdata; /** * Pointer to PropertyStore implementing the storage. */ ajn::services::PropertyStore* m_PropertyStore; }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONSENDER_H_ */ base-15.09/notification/cpp/inc/alljoyn/notification/NotificationService.h000066400000000000000000000074461262264444500267650ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONSERVICE_H_ #define NOTIFICATIONSERVICE_H_ #include #include #include #include #include namespace ajn { namespace services { class NotificationReceiver; /** * Notification Service class. Used to initialize and shutdown the service */ class NotificationService { public: /** * Get Instance of NotificationService - singleton implementation * @return instance */ static NotificationService* getInstance(); /** * Destructor for NotificationService */ ~NotificationService(); /** * Initialize Producer side via Transport. Create and * return NotificationSender. * @param bus * @param store * @return NotificationSender instance */ NotificationSender* initSend(ajn::BusAttachment* bus, ajn::AboutData* store); /** * Initialize Producer side via Transport. Create and * return NotificationSender. * @param bus * @param store * * @deprecated see initSend(ajn::BusAttachment*, ajn::AboutData*) * * @return NotificationSender instance */ QCC_DEPRECATED(NotificationSender* initSend(ajn::BusAttachment* bus, ajn::services::PropertyStore* store)); /** * Initialize Consumer side via Transport. * Set NotificationReceiver to given receiver * @param bus * @param notificationReceiver * @return status */ QStatus initReceive(ajn::BusAttachment* bus, NotificationReceiver* notificationReceiver); /** * Stops sender but leaves bus and other objects alive */ void shutdownSender(); /** * Stops receiving but leaves bus and other objects alive */ void shutdownReceiver(); /** * Cleanup and get ready for shutdown */ void shutdown(); /** * @deprecated May 2015 for 15.04 release. * Disabling superagent mode. * Needs to be called before starting receiver * @return ER_OK */ QCC_DEPRECATED(QStatus disableSuperAgent() {return ER_OK; }); /** * Virtual method to get the busAttachment used in the service. */ ajn::BusAttachment* getBusAttachment(); /** * Get the Version of the NotificationService * @return the NotificationService version */ static uint16_t getVersion(); private: /** * Default constructor for NotificationServiceImpl * Private to allow for singleton implementation */ NotificationService(); /** * Version of the API */ static uint16_t const NOTIFICATION_SERVICE_VERSION; /** * instance variable - NotificationServiceImpl is a singleton */ static NotificationService* s_Instance; }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONSERVICE_H_ */ base-15.09/notification/cpp/inc/alljoyn/notification/NotificationText.h000066400000000000000000000043521262264444500263020ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONTEXT_H_ #define NOTIFICATIONTEXT_H_ #include namespace ajn { namespace services { /** * Class NotificationText is used to represent the actual text message of the notification * Made up of language and text values */ class NotificationText { public: /** * Constructor for NotificationText * @param language Language of Notification * @param text Text of Notification */ NotificationText(qcc::String const& language, qcc::String const& text); /** * Destructor for NotificationText */ ~NotificationText() { }; /** * Set Language for Notification * @param language */ void setLanguage(qcc::String const& language); /** * Get Language for Notification * @return language */ qcc::String const& getLanguage() const; /** * Set Text for Notification * @param text */ void setText(qcc::String const& text); /** * Get Text for Notification * @return text */ qcc::String const& getText() const; private: /** * Notification Language */ qcc::String m_Language; /** * Notification Text */ qcc::String m_Text; }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONTEXT_H_ */ base-15.09/notification/cpp/inc/alljoyn/notification/RichAudioUrl.h000066400000000000000000000042001262264444500253310ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef RICHAUDIOURL_H_ #define RICHAUDIOURL_H_ #include namespace ajn { namespace services { /** * Class to store RichAudio urls, a url per language */ class RichAudioUrl { public: /** * Constructor for RichAudioUrl * @param language Language of Audio Content * @param url Url of Audio Content */ RichAudioUrl(qcc::String const& language, qcc::String const& url); /** * Destructor for RichAudioUrl */ ~RichAudioUrl() { }; /** * Set Language for Audio Content * @param language */ void setLanguage(qcc::String const& language); /** * Get Language for Audio Content * @return language */ qcc::String const& getLanguage() const; /** * Set URL for Audio Content * @param url */ void setUrl(qcc::String const& url); /** * Get URL for Audio Content * @return url */ qcc::String const& getUrl() const; private: /** * Audio Content Language String */ qcc::String m_Language; /** * Audio Content URL */ qcc::String m_Url; }; } //namespace services } //namespace ajn #endif /* RICHAUDIOURL_H_ */ base-15.09/notification/cpp/samples/000077500000000000000000000000001262264444500173675ustar00rootroot00000000000000base-15.09/notification/cpp/samples/ConsumerService/000077500000000000000000000000001262264444500225035ustar00rootroot00000000000000base-15.09/notification/cpp/samples/ConsumerService/.gitignore000066400000000000000000000000261262264444500244710ustar00rootroot00000000000000/obj /ConsumerService base-15.09/notification/cpp/samples/ConsumerService/ConsumerService.cc000066400000000000000000000102701262264444500261260ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include #include #include #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include "../common/NotificationReceiverTestImpl.h" #include "CommonSampleUtil.h" #include #include using namespace ajn; using namespace services; NotificationService* conService = 0; NotificationReceiverTestImpl* Receiver = 0; ajn::BusAttachment* busAttachment = 0; static volatile sig_atomic_t s_interrupt = false; void cleanup() { std::cout << "cleanup() - start" << std::endl; if (conService) { std::cout << "cleanup() - conService" << std::endl; conService->shutdown(); conService = NULL; } if (Receiver) { std::cout << "cleanup() - Receiver" << std::endl; delete Receiver; Receiver = NULL; } if (busAttachment) { std::cout << "cleanup() - busAttachment" << std::endl; delete busAttachment; busAttachment = NULL; } std::cout << "cleanup() - end" << std::endl; } void CDECL_CALL signal_callback_handler(int32_t signum) { QCC_UNUSED(signum); std::cout << "got signal_callback_handler" << std::endl; s_interrupt = true; } void WaitForSigInt() { while (s_interrupt == false) { #ifdef _WIN32 Sleep(100); #else usleep(100 * 1000); #endif } std::cout << "Getting out from WaitForSigInt()" << std::endl; } int main() { // Initialize AllJoyn AJInitializer ajInit; if (ajInit.Initialize() != ER_OK) { return 1; } std::string listOfApps; // Allow CTRL+C to end application signal(SIGINT, signal_callback_handler); std::cout << "Begin Consumer Application. (Press CTRL+C to end application)" << std::endl; std::cout << "Enter in a list of app names (separated by ';') you would like to receive notifications from." << std::endl; std::cout << "Empty list means all app names." << std::endl; getline(std::cin, listOfApps); // Initialize Service object and send it Notification Receiver object conService = NotificationService::getInstance(); // change loglevel to debug: QCC_SetLogLevels("ALLJOYN_ABOUT_CLIENT=7"); QCC_SetLogLevels("ALLJOYN_ABOUT_ICON_CLIENT=7"); QCC_SetLogLevels("ALLJOYN_ABOUT_ANNOUNCE_HANDLER=7"); QCC_SetLogLevels("ALLJOYN_ABOUT_ANNOUNCEMENT_REGISTRAR=7"); QCC_SetDebugLevel(logModules::NOTIFICATION_MODULE_LOG_NAME, logModules::ALL_LOG_LEVELS); Receiver = new NotificationReceiverTestImpl(false); // Set the list of applications this receiver should receive notifications from Receiver->setApplications(listOfApps.c_str()); busAttachment = CommonSampleUtil::prepareBusAttachment(); if (busAttachment == NULL) { std::cout << "Could not initialize BusAttachment." << std::endl; cleanup(); return 1; } QStatus status; status = conService->initReceive(busAttachment, Receiver); if (status != ER_OK) { std::cout << "Could not initialize receiver." << std::endl; cleanup(); return 1; } std::cout << "Waiting for notifications." << std::endl; WaitForSigInt(); cleanup(); return 0; } base-15.09/notification/cpp/samples/ConsumerService/SConscript000066400000000000000000000016721262264444500245230ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('env', 'cobjs') srcs = env.Glob('*.cc') objs = env.Object(srcs) objs.extend(cobjs) prog = env.Program('ConsumerService', objs) Return('prog') base-15.09/notification/cpp/samples/ProducerBasic/000077500000000000000000000000001262264444500221145ustar00rootroot00000000000000base-15.09/notification/cpp/samples/ProducerBasic/.gitignore000066400000000000000000000000241262264444500241000ustar00rootroot00000000000000/obj /ProducerBasic base-15.09/notification/cpp/samples/ProducerBasic/ProducerBasic.cc000066400000000000000000000161211262264444500251510ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include #include #include #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include #include #include #include "CommonSampleUtil.h" #include #include #include #include using namespace qcc; using namespace ajn; // Set application constants #define DEVICE_NAME "testdeviceName" #define APP_NAME "testappName" #define LANG1 "en" #define TEXT1 "Hello World" #define LANG2 "es" #define TEXT2 "Hola Mundo" #define KEY1 "On" #define VAL1 "Hello" #define KEY2 "Off" #define VAL2 "Goodbye" #define URL1 "http://url1.com" #define URL2 "http://url2.com" #define RICH_ICON_URL "http://iconurl.com" #define CONTROL_PANEL_SERVICE_OBJECT_PATH "/ControlPanel/MyDevice/areYouSure" #define RICH_ICON_OBJECT_PATH "/icon/objectPath" #define RICH_AUDIO_OBJECT_PATH "/Audio/objectPath" #define SERVICE_PORT 900 using namespace ajn; using namespace services; NotificationService* prodService = 0; NotificationSender* Sender = 0; BusAttachment* bus = 0; AboutData* aboutData = NULL; AboutObj* aboutObj = NULL; CommonBusListener* busListener = 0; static volatile sig_atomic_t s_interrupt = false; void cleanup() { // Clean up if (prodService) { prodService->shutdown(); prodService = NULL; } if (bus && busListener) { CommonSampleUtil::aboutServiceDestroy(bus, busListener); } if (busListener) { delete busListener; busListener = NULL; } if (aboutData) { delete aboutData; aboutData = NULL; } if (aboutObj) { delete aboutObj; aboutObj = NULL; } if (bus) { delete bus; bus = NULL; } std::cout << "Goodbye!" << std::endl; } void CDECL_CALL signal_callback_handler(int32_t signum) { QCC_UNUSED(signum); std::cout << "got signal_callback_handler" << std::endl; s_interrupt = true; } void WaitForSigInt() { while (s_interrupt == false) { #ifdef _WIN32 Sleep(100); #else usleep(100 * 1000); #endif } } int main() { // Initialize AllJoyn AJInitializer ajInit; if (ajInit.Initialize() != ER_OK) { return 1; } // Allow CTRL+C to end application signal(SIGINT, signal_callback_handler); // Initialize Service object and Sender Object prodService = NotificationService::getInstance(); QStatus status; QCC_SetDebugLevel(logModules::NOTIFICATION_MODULE_LOG_NAME, logModules::ALL_LOG_LEVELS); bus = CommonSampleUtil::prepareBusAttachment(); if (bus == NULL) { std::cout << "Could not initialize BusAttachment." << std::endl; return 1; } qcc::String deviceid; GuidUtil::GetInstance()->GetDeviceIdString(&deviceid); qcc::String appid; GuidUtil::GetInstance()->GenerateGUID(&appid); aboutData = new AboutData("en"); DeviceNamesType deviceNames; deviceNames.insert(std::pair("en", "ProducerBasicDeviceName")); status = CommonSampleUtil::fillAboutData(aboutData, appid, APP_NAME, deviceid, deviceNames); if (status != ER_OK) { std::cout << "Could not fill About Data." << std::endl; cleanup(); return 1; } busListener = new CommonBusListener(); aboutObj = new AboutObj(*bus, BusObject::ANNOUNCED); status = CommonSampleUtil::prepareAboutService(bus, aboutData, aboutObj, busListener, SERVICE_PORT); if (status != ER_OK) { std::cout << "Could not set up the AboutService." << std::endl; cleanup(); return 1; } Sender = prodService->initSend(bus, aboutData); if (!Sender) { std::cout << "Could not initialize Sender - exiting application" << std::endl; cleanup(); return 1; } status = CommonSampleUtil::aboutServiceAnnounce(); if (status != ER_OK) { std::cout << "Could not announce." << std::endl; cleanup(); return 1; } // Prepare message type NotificationMessageType messageType = INFO; // Prepare text object, set language and text, add notification to vector NotificationText textToSend1(LANG1, TEXT1); NotificationText textToSend2(LANG2, TEXT2); std::vector vecMessages; vecMessages.push_back(textToSend1); vecMessages.push_back(textToSend2); // Add variable parameters std::map customAttributes; customAttributes[KEY1] = VAL1; customAttributes[KEY2] = VAL2; //Prepare Rich Notification Content RichAudioUrl audio1(LANG1, URL1); RichAudioUrl audio2(LANG2, URL2); std::vector richAudioUrl; richAudioUrl.push_back(audio1); richAudioUrl.push_back(audio2); qcc::String richIconUrl = RICH_ICON_URL; qcc::String richIconObjectPath = RICH_ICON_OBJECT_PATH; qcc::String richAudioObjectPath = RICH_AUDIO_OBJECT_PATH; qcc::String controlPanelServiceObjectPath = CONTROL_PANEL_SERVICE_OBJECT_PATH; // Send messages Notification notification(messageType, vecMessages); notification.setCustomAttributes(customAttributes); notification.setRichIconUrl(richIconUrl.c_str()); notification.setRichAudioUrl(richAudioUrl); notification.setRichIconObjectPath(richIconObjectPath.c_str()); notification.setRichAudioObjectPath(richAudioObjectPath.c_str()); notification.setControlPanelServiceObjectPath(controlPanelServiceObjectPath.c_str()); status = Sender->send(notification, 7200); if (status != ER_OK) { std::cout << "Notification was not sent successfully - exiting application" << std::endl; cleanup(); return 1; } std::cout << "Notification sent! " << std::endl; std::cout << "Hit Ctrl+C to exit the application" << std::endl; WaitForSigInt(); std::cout << "Exiting the application and deleting the bus connection." << std::endl; cleanup(); return 0; } base-15.09/notification/cpp/samples/ProducerBasic/SConscript000066400000000000000000000016701262264444500241320ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('env', 'cobjs') srcs = env.Glob('*.cc') objs = env.Object(srcs) objs.extend(cobjs) prog = env.Program('ProducerBasic', objs) Return('prog') base-15.09/notification/cpp/samples/ProducerService/000077500000000000000000000000001262264444500224735ustar00rootroot00000000000000base-15.09/notification/cpp/samples/ProducerService/.gitignore000066400000000000000000000000261262264444500244610ustar00rootroot00000000000000/obj /ProducerService base-15.09/notification/cpp/samples/ProducerService/ProducerService.cc000066400000000000000000000464251262264444500261210ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include #include #include #include #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include #include #include #include "CommonSampleUtil.h" #include #include #include #include #include #define DEFAULT_DEVICE_NAME "defaultDeviceName" #define DEFAULT_APP_NAME "defaultAppName" #define DEFAULT_TTL 30 #define DEFAULT_SLEEP_TIME 20 #define SERVICE_PORT 900 using namespace ajn; using namespace services; using namespace qcc; NotificationService* prodService = 0; BusAttachment* bus = 0; CommonBusListener* notificationBusListener = 0; AboutData* aboutData = NULL; AboutObj* aboutObj = NULL; NotificationSender* Sender = 0; static volatile sig_atomic_t s_interrupt = false; enum states { BeginNewNotification, SetDeviceName, SetAppName, SetMsgType, CheckForNewMsg, SetMsgLang, SetMsgText, CheckForCustomAttributes, SetCustomKey, SetCustomVal, CheckForRichIconUrl, SetRichIconUrl, CheckForNewRichAudioUrl, SetRichAudioUrlLang, SetRichAudioUrlUrl, CheckForRichIconObjectPath, SetRichIconObjectPath, CheckForRichAudioObjectPath, SetRichAudioObjectPath, CheckForControlPanelServiceObjectPath, SetControlPanelServiceObjectPath, SetTTL, SetSleepTime, EndNotification, }; bool getInput(qcc::String& device_name, qcc::String& app_name, NotificationMessageType& messageType, std::vector& vecMessages, std::map& customAttributes, qcc::String& richIconUrl, std::vector& richAudioUrl, qcc::String& richIconObjectPath, qcc::String& richAudioObjectPath, qcc::String& controlPanelServiceObjectPath, uint16_t& ttl, int32_t& sleepTime) { int32_t state = BeginNewNotification; std::string input; qcc::String tempLang = ""; qcc::String tempText = ""; qcc::String tempUrl = ""; qcc::String tempKey; qcc::String defaultDeviceName = DEFAULT_DEVICE_NAME; qcc::String defaultAppName = DEFAULT_APP_NAME; qcc::String defaultLang = "en"; qcc::String defaultText = "Using the default text."; qcc::String defaultRichAudioUrl = "http://myRichContentAudioUrl.wv"; qcc::String defaultRichIconUrl = "http://myRichContentIconUrl.jpg"; uint16_t defaultTTL = DEFAULT_TTL; qcc::String defaultRichIconObjectPath = "/Icon/ObjectPath"; qcc::String defaultRichAudioObjectPath = "/Audio/ObjectPath"; qcc::String defaultControlPanelServiceObjectPath = "/ControlPanel/MyDevice/areYouSure"; std::cout << "Enter in new notification info:" << std::endl; std::cout << "Enter in device name or press 'enter' to use default:" << std::endl; state = SetDeviceName; getline(std::cin, input); while (!std::cin.eof()) { switch (state) { case SetDeviceName: device_name = input.length() ? input.c_str() : defaultDeviceName; std::cout << "Enter in application name or press 'enter' to use default:" << std::endl; state = SetAppName; break; case SetAppName: app_name = input.length() ? input.c_str() : defaultAppName; std::cout << "Enter in message type (0,1,2) or press 'enter' to use default:" << std::endl; state = SetMsgType; break; case SetMsgType: // If atoi fails message type will hold a 0 which is fine in this case messageType = input.length() ? (NotificationMessageType)atoi(input.c_str()) : NotificationMessageType(INFO); // We require to send at least one message std::cout << "Enter in message language (ex: en_US) or press 'enter' to use default and move to message text:" << std::endl; state = SetMsgLang; break; case CheckForNewMsg: if (input.compare("y") == 0) { std::cout << "Enter in message language (ex: en_US) or press 'enter' to use default and move to message text:" << std::endl; state = SetMsgLang; } else { std::cout << "Do you want to enter a set of custom Attributes? (press 'y' for yes or anything else for no)" << std::endl; state = CheckForCustomAttributes; } break; case SetMsgLang: // Currently allowing an empty value for the language so no need to check the value tempLang = input.length() ? input.c_str() : defaultLang; std::cout << "Enter in message text or press 'enter' to use default and move on to custom Attributes:" << std::endl; state = SetMsgText; break; case SetMsgText: { tempText = input.length() ? input.c_str() : defaultText; // It is possible for both the language and text to be empty NotificationText textToSend(tempLang.c_str(), tempText.c_str()); vecMessages.push_back(textToSend); tempLang = ""; tempText = ""; std::cout << "Do you want to enter a new message? (press 'y' for yes or anything else for no)" << std::endl; state = CheckForNewMsg; break; } case CheckForCustomAttributes: if (input.compare("y") == 0) { std::cout << "Enter in custom attribute key or press 'enter' to continue:" << std::endl; state = SetCustomKey; } else { std::cout << "Do you want to enter a rich content icon url? (press 'y' for yes or anything else for no)" << std::endl; state = CheckForRichIconUrl; } break; case SetCustomKey: tempKey = input.c_str(); std::cout << "Enter in custom attribute value or press 'enter' to continue:" << std::endl; state = SetCustomVal; break; case SetCustomVal: customAttributes[tempKey] = input.c_str(); std::cout << "Do you want to enter another set of custom attributes? (press 'y' for yes or anything else for no)" << std::endl; state = CheckForCustomAttributes; break; case CheckForRichIconUrl: if (input.compare("y") == 0) { std::cout << "Enter in a url for rich icon or press 'enter' to use default:" << std::endl; state = SetRichIconUrl; } else { std::cout << "Do you want to enter a rich content audio url? (press 'y' for yes or anything else for no)" << std::endl; state = CheckForNewRichAudioUrl; } break; case SetRichIconUrl: richIconUrl = input.length() ? input.c_str() : defaultRichIconUrl; std::cout << "Do you want to enter a rich content audio url? (press 'y' for yes or anything else for no)" << std::endl; state = CheckForNewRichAudioUrl; break; case CheckForNewRichAudioUrl: if (input.compare("y") == 0) { std::cout << "Enter in a language (ex: en_US) for the audio content or press 'enter' to use default and move to url text:" << std::endl; state = SetRichAudioUrlLang; } else { std::cout << "Do you want to enter a rich content icon object path? (press 'y' for yes or anything else for no)" << std::endl; state = CheckForRichIconObjectPath; } break; case SetRichAudioUrlLang: // Currently allowing an empty value for the language so no need to check the value tempLang = input.length() ? input.c_str() : defaultLang; std::cout << "Enter in a url for audio content or press 'enter' to use default and move on to set ttl:" << std::endl; state = SetRichAudioUrlUrl; break; case SetRichAudioUrlUrl: { tempUrl = input.length() ? input.c_str() : defaultRichAudioUrl; // It is possible for both the language and text to be empty RichAudioUrl audioContent(tempLang.c_str(), tempUrl.c_str()); richAudioUrl.push_back(audioContent); tempLang = ""; tempText = ""; std::cout << "Do you want to enter another rich audio content? (press 'y' for yes or anything else for no)" << std::endl; state = CheckForNewRichAudioUrl; break; } case CheckForRichIconObjectPath: if (input.compare("y") == 0) { std::cout << "Enter in a object path for rich icon or press 'enter' to use default:" << std::endl; state = SetRichIconObjectPath; } else { std::cout << "Do you want to enter a rich content audio object path? (press 'y' for yes or anything else for no)" << std::endl; state = CheckForRichAudioObjectPath; } break; case SetRichIconObjectPath: richIconObjectPath = input.length() ? input.c_str() : defaultRichIconObjectPath; std::cout << "Do you want to enter a rich content audio object path? (press 'y' for yes or anything else for no)" << std::endl; state = CheckForRichAudioObjectPath; break; case CheckForRichAudioObjectPath: if (input.compare("y") == 0) { std::cout << "Enter in a object path for rich audio or press 'enter' to use default:" << std::endl; state = SetRichAudioObjectPath; } else { std::cout << "Do you want to enter a control panel service object path? (press 'y' for yes or anything else for no)" << std::endl; state = CheckForControlPanelServiceObjectPath; } break; case SetRichAudioObjectPath: richAudioObjectPath = input.length() ? input.c_str() : defaultRichAudioObjectPath; std::cout << "Do you want to enter a control panel service object path? (press 'y' for yes or anything else for no)" << std::endl; state = CheckForControlPanelServiceObjectPath; break; case CheckForControlPanelServiceObjectPath: if (input.compare("y") == 0) { std::cout << "Enter in the ControlPanelService object path or press 'enter' to use default:" << std::endl; state = SetControlPanelServiceObjectPath; } else { std::cout << "Enter in TTL of message in seconds or press 'enter' to use default:" << std::endl; state = SetTTL; } break; case SetControlPanelServiceObjectPath: controlPanelServiceObjectPath = input.length() ? input.c_str() : defaultControlPanelServiceObjectPath; std::cout << "Enter in TTL of message in seconds or press 'enter' to use default:" << std::endl; state = SetTTL; break; case SetTTL: if (input.length()) { ttl = atoi(input.c_str()); } else { ttl = defaultTTL; } std::cout << "Enter in sleep time between messages (in milliseconds) or press 'enter' to end notification:" << std::endl; state = SetSleepTime; break; case SetSleepTime: if (input.size() > 0) { sleepTime = (atoi(input.c_str()) / 1000); } else { sleepTime = 0; } return true; } getline(std::cin, input); } return false; } void cleanup() { if (prodService) { prodService->shutdown(); prodService = NULL; } if (Sender) { delete Sender; Sender = NULL; } if (bus && notificationBusListener) { CommonSampleUtil::aboutServiceDestroy(bus, notificationBusListener); } if (notificationBusListener) { delete notificationBusListener; notificationBusListener = NULL; } if (aboutData) { delete aboutData; aboutData = NULL; } if (aboutObj) { delete aboutObj; bus = NULL; } if (bus) { delete bus; bus = NULL; } std::cout << "Goodbye!" << std::endl; } void CDECL_CALL signal_callback_handler(int32_t signum) { QCC_UNUSED(signum); s_interrupt = true; } int main(int argc, char* argv[]) { // Initialize AllJoyn AJInitializer ajInit; if (ajInit.Initialize() != ER_OK) { return 1; } bool automated = (argc > 1); int count = automated ? atoi(argv[1]) : 1; if (count <= 0) { std::cout << "Usage: " << argv[0] << " [AutomatedMessageCount]" << std::endl; return 1; } notificationBusListener = new CommonBusListener(); aboutData = new AboutData("en"); // Allow CTRL+C to end application signal(SIGINT, signal_callback_handler); // Initialize Service object prodService = NotificationService::getInstance(); QCC_SetDebugLevel(logModules::NOTIFICATION_MODULE_LOG_NAME, logModules::ALL_LOG_LEVELS); std::cout << "Begin Producer Application. (Press CTRL+D to end application)" << std::endl; bus = CommonSampleUtil::prepareBusAttachment(); if (bus == NULL) { std::cout << "Could not initialize BusAttachment." << std::endl; cleanup(); return 1; } aboutObj = new AboutObj(*bus, AboutObj::ANNOUNCED); qcc::String device_id = "749df3c84b2e489cbd534cc8fd3fd5f4"; qcc::String app_id = "AC7a0787-d8b4-474f-a298-6bf0964f02d5"; if (!automated) { GuidUtil::GetInstance()->GetDeviceIdString(&device_id); GuidUtil::GetInstance()->GenerateGUID(&app_id); } //Run in loop unless ctrl+c has been hit while (s_interrupt == false) { qcc::String device_name = DEFAULT_DEVICE_NAME; qcc::String app_name = DEFAULT_APP_NAME; qcc::String richIconUrl = ""; qcc::String richIconObjectPath = ""; qcc::String richAudioObjectPath = ""; qcc::String controlPanelServiceObjectPath = ""; NotificationMessageType messageType = NotificationMessageType(INFO); std::vector vecMessages; std::map customAttributes; std::vector richAudioUrl; uint16_t ttl = DEFAULT_TTL; int32_t sleepTime = DEFAULT_SLEEP_TIME; QStatus status; if (!automated) { if (!getInput(device_name, app_name, messageType, vecMessages, customAttributes, richIconUrl, richAudioUrl, richIconObjectPath, richAudioObjectPath, controlPanelServiceObjectPath, ttl, sleepTime)) { break; } } else { NotificationText textToSend("en", "Default notification text"); vecMessages.push_back(textToSend); } DeviceNamesType deviceNames; deviceNames.insert(std::pair("en", device_name)); status = CommonSampleUtil::fillAboutData(aboutData, app_id, app_name, device_id, deviceNames); if (status != ER_OK) { std::cout << "Could not fill About Data." << std::endl; cleanup(); return 1; } status = CommonSampleUtil::prepareAboutService(bus, aboutData, aboutObj, notificationBusListener, SERVICE_PORT); if (status != ER_OK) { std::cout << "Could not set up the AboutService." << std::endl; cleanup(); return 1; } Sender = prodService->initSend(bus, aboutData); if (!Sender) { std::cout << "Could not initialize the sender" << std::endl; CommonSampleUtil::aboutServiceDestroy(bus, notificationBusListener); continue; } status = CommonSampleUtil::aboutServiceAnnounce(); if (status != ER_OK) { std::cout << "Could not announce." << std::endl; cleanup(); return 1; } for (int i = 0; i < count; i++) { if (i > 0) { #ifdef _WIN32 Sleep(sleepTime * 1000); #else sleep(sleepTime); #endif } Notification notification(messageType, vecMessages); notification.setCustomAttributes(customAttributes); notification.setRichAudioUrl(richAudioUrl); if (richIconUrl.length()) { notification.setRichIconUrl(richIconUrl.c_str()); } if (richIconObjectPath.length()) { notification.setRichIconObjectPath(richIconObjectPath.c_str()); } if (richAudioObjectPath.length()) { notification.setRichAudioObjectPath(richAudioObjectPath.c_str()); } if (controlPanelServiceObjectPath.length()) { notification.setControlPanelServiceObjectPath(controlPanelServiceObjectPath.c_str()); } if (Sender->send(notification, ttl) != ER_OK) { std::cout << "Could not send the message successfully" << std::endl; } else { std::cout << "Notification sent with ttl of " << ttl << std::endl; } } if (!automated) { std::string input; do { std::cout << "To delete the bus connection and start again please push 'c' character:" << std::endl; getline(std::cin, input); } while ((std::cin) && (input != "c")); } else { s_interrupt = true; } prodService->shutdownSender(); if (Sender) { std::cout << "Going to delete Sender" << std::endl; delete Sender; Sender = 0; } std::cout << "Going to call aboutServiceDestroy" << std::endl; CommonSampleUtil::aboutServiceDestroy(bus, notificationBusListener); std::cout << "Going to sleep:" << sleepTime << std::endl; #ifdef _WIN32 Sleep(sleepTime * 1000); #else sleep(sleepTime); #endif } std::cout << "Exiting the application deletes the bus connection." << std::endl; cleanup(); return 0; } base-15.09/notification/cpp/samples/ProducerService/SConscript000066400000000000000000000016721262264444500245130ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('env', 'cobjs') srcs = env.Glob('*.cc') objs = env.Object(srcs) objs.extend(cobjs) prog = env.Program('ProducerService', objs) Return('prog') base-15.09/notification/cpp/samples/SConscript000066400000000000000000000032251262264444500214030ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('nsenv') samples_env = nsenv.Clone() samples_env.Append(CPPPATH = samples_env.Dir('common').srcnode()) samples_env.Append(CPPPATH = samples_env.Dir('$APP_COMMON_DIR/cpp/samples_common').srcnode()) samples_env.Prepend(LIBS = ['alljoyn_notification', 'alljoyn_about', 'alljoyn_services_common']) if samples_env['BR'] == 'on' and samples_env.has_key('ajrlib'): # Build apps with bundled daemon support samples_env.Prepend(LIBS = [samples_env['ajrlib']]) samples_env.Append(CPPDEFINES='QCC_USING_BD') cobjs = samples_env.SConscript('common/SConscript', {'env': samples_env}) sample_dirs = [ 'ConsumerService', 'ProducerBasic', 'ProducerService', 'TestService' ] exports = { 'env':samples_env, 'cobjs': cobjs } progs = [ samples_env.SConscript('%s/SConscript' % sampleapp, exports = exports) for sampleapp in sample_dirs ] Return('progs') base-15.09/notification/cpp/samples/TestService/000077500000000000000000000000001262264444500216275ustar00rootroot00000000000000base-15.09/notification/cpp/samples/TestService/.gitignore000066400000000000000000000000221262264444500236110ustar00rootroot00000000000000/obj /TestService base-15.09/notification/cpp/samples/TestService/SConscript000066400000000000000000000016661262264444500236520ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('env', 'cobjs') srcs = env.Glob('*.cc') objs = env.Object(srcs) objs.extend(cobjs) prog = env.Program('TestService', objs) Return('prog') base-15.09/notification/cpp/samples/TestService/TestFunction.cc000066400000000000000000000045611262264444500245710ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include #include "TestFunction.h" using namespace qcc; TestFunction::TestFunction() : activateTest(0) { } TestFunction::~TestFunction() { } bool TestFunction::checkRequiredParams(std::map& params) { if (requiredParams.size() == 0) { return true; } for (std::vector::const_iterator reqParams_it = requiredParams.begin(); reqParams_it != requiredParams.end(); ++reqParams_it) { if (params.find(*reqParams_it) == params.end()) { std::cout << "Missing required parameter " << reqParams_it->c_str() << std::endl; std::cout << usage.c_str() << std::endl; return false; } } return true; } void TestFunction::checkOptionalParams(std::map& params) { for (std::map::const_iterator params_it = params.begin(); params_it != params.end(); ++params_it) { if (find(optionalParams.begin(), optionalParams.end(), params_it->first) == optionalParams.end()) { if (find(requiredParams.begin(), requiredParams.end(), params_it->first) == requiredParams.end()) { // Element is NOT in either vector so let the user know std::cout << "Parameter " << params_it->first.c_str() << " is not a valid parameter for " << functionName.c_str() << ". Ignoring value" << std::endl; } } } } base-15.09/notification/cpp/samples/TestService/TestFunction.h000066400000000000000000000045211262264444500244270ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef TESTFUNCTION_H_ #define TESTFUNCTION_H_ #include #include #include #include /** * TestFunction class used to represent on of the possible API calls * in the TestService application */ class TestFunction { public: /** * Constructor */ TestFunction(); /** * Destructor */ virtual ~TestFunction(); /** * Validate that required params were added * @param params * @return true/false */ bool checkRequiredParams(std::map& params); /** * Check the optional parameters * @param params */ void checkOptionalParams(std::map& params); /** * The name of the function */ qcc::String functionName; /** * The usage string */ qcc::String usage; /** * The required Parameters */ std::vector requiredParams; /** * The optional Parameters */ std::vector optionalParams; /** * Preconditions - steps that need to be taken before this API call */ std::vector requiredSteps; /** * functionPointer to function that will execute the API call * @param params * @return */ bool (*activateTest)(std::map& params); }; #endif /* TESTFUNCTION_H_ */ base-15.09/notification/cpp/samples/TestService/TestService.cc000066400000000000000000000623711262264444500244070ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include #include #include #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include #include #include #include "../common/NotificationReceiverTestImpl.h" #include "CommonSampleUtil.h" #include "TestFunction.h" #include #include #include #define SERVICE_PORT 900 using namespace ajn; using namespace services; using namespace qcc; // Global members NotificationService* Service = 0; NotificationSender* Sender = 0; NotificationReceiverTestImpl* Receiver = 0; BusAttachment* testBus = 0; AboutData* aboutData = 0; AboutObj* aboutObj = 0; CommonBusListener* notificationBusListener = 0; NotificationMessageType messageType = UNSET; std::vector vecMessages; std::vector richAudioUrl; qcc::String richIconUrl = ""; qcc::String richIconObjectPath = ""; qcc::String richAudioObjectPath = ""; qcc::String controlPanelServiceObjectPath = ""; std::map customAttributes; bool didInitSend = false; bool didInitReceive = false; uint16_t ttl = 0; int32_t sleepTime; static volatile sig_atomic_t s_interrupt = false; void resetParams() { customAttributes.clear(); vecMessages.clear(); richAudioUrl.clear(); richIconUrl = ""; richIconObjectPath = ""; richAudioObjectPath = ""; controlPanelServiceObjectPath = ""; ttl = 0; messageType = UNSET; } /* * Begin Function functions */ bool createService(std::map& params) { QCC_UNUSED(params); // Initialize Service object and sent it Notification Receiver object if (!testBus) { testBus = CommonSampleUtil::prepareBusAttachment(); if (testBus == NULL) { std::cout << "Could not initialize BusAttachment." << std::endl; return 1; } } Service = NotificationService::getInstance(); std::cout << "Service Created" << std::endl; return true; } bool initSend(std::map& params) { if (!notificationBusListener) { notificationBusListener = new CommonBusListener(); } if (!aboutData) { aboutData = new AboutData("en"); } if (!aboutObj) { aboutObj = new AboutObj(*testBus, BusObject::ANNOUNCED); } qcc::String deviceid; GuidUtil::GetInstance()->GetDeviceIdString(&deviceid); qcc::String appid; GuidUtil::GetInstance()->GenerateGUID(&appid); DeviceNamesType deviceNames; deviceNames.insert(std::pair("en", params["device_name"])); QStatus status; status = CommonSampleUtil::fillAboutData(aboutData, appid, params["app_name"].c_str(), deviceid, deviceNames); if (status != ER_OK) { std::cout << "Could not fill About Data." << std::endl; return false; } status = CommonSampleUtil::prepareAboutService(testBus, aboutData, aboutObj, notificationBusListener, SERVICE_PORT); if (status != ER_OK) { std::cout << "Could not set up the AboutService." << std::endl; return false; } Sender = Service->initSend(testBus, aboutData); if (!Sender) { std::cout << "Could not initialize the sender"; return false; } status = CommonSampleUtil::aboutServiceAnnounce(); if (status != ER_OK) { std::cout << "Could not announce." << std::endl; return 1; } didInitSend = true; std::cout << "Sender Initialized" << std::endl; return true; } bool send(std::map& params) { int32_t type = atoi(params["type"].c_str()); std::ostringstream oss; oss << type; String typeString = oss.str().c_str(); if (!(params["type"].compare(typeString) == 0)) { std::cout << "Could not send message: Message Type is not an integer value." << std::endl; return false; } messageType = (NotificationMessageType)atoi(params["type"].c_str()); ttl = ((uint16_t)atoi(params["ttl"].c_str())); Notification notification(messageType, vecMessages); notification.setCustomAttributes(customAttributes); notification.setRichAudioUrl(richAudioUrl); if (richIconUrl.length()) { notification.setRichIconUrl(richIconUrl.c_str()); } if (richIconObjectPath.length()) { notification.setRichIconObjectPath(richIconObjectPath.c_str()); } if (richAudioObjectPath.length()) { notification.setRichAudioObjectPath(richAudioObjectPath.c_str()); } if (controlPanelServiceObjectPath.length()) { notification.setControlPanelServiceObjectPath(controlPanelServiceObjectPath.c_str()); } QStatus status = Sender->send(notification, ttl); if (status != ER_OK) { std::cout << "Could not send the message successfully."; return false; } std::cout << "Notification Sent for message type " << messageType << " and ttl of " << ttl << " seconds" << std::endl; resetParams(); return true; } bool setMsg(std::map& params) { // Empty qcc::Strings are valid input so we will not check it here NotificationText textToSend(params["lang"].c_str(), params["text"].c_str()); vecMessages.push_back(textToSend); std::cout << "Message " << params["text"].c_str() << " set." << std::endl; return true; } bool setCustomAttributes(std::map& params) { // Empty qcc::Strings are valid input, only check format was correct customAttributes[params["key"].c_str()] = params["value"].c_str(); std::cout << "Set custom pair " << params["key"].c_str() << " : " << params["value"].c_str() << std::endl; return true; } bool setLogger(std::map& params) { QCC_UNUSED(params); QCC_SetDebugLevel(logModules::NOTIFICATION_MODULE_LOG_NAME, logModules::ALL_LOG_LEVELS); return true; } bool initReceive(std::map& params) { QCC_UNUSED(params); Receiver = new NotificationReceiverTestImpl(); if (Service->initReceive(testBus, Receiver) != ER_OK) { std::cout << "Could not initialize receiver." << std::endl; return false; } didInitReceive = true; std::cout << "Receiver Initialized" << std::endl; return true; } bool ResponseToNotification(std::map& params) { QCC_UNUSED(params); NotificationReceiverTestImpl::NotificationAction action = ((NotificationReceiverTestImpl::NotificationAction)atoi(params["action"].c_str())); Receiver->SetNotificationAction(action); return true; } bool setRichIconUrl(std::map& params) { // Empty qcc::Strings are valid input so we will not check it here richIconUrl = params["url"]; std::cout << "Icon Url " << params["url"].c_str() << " set." << std::endl; return true; } bool setRichAudioUrl(std::map& params) { // Empty qcc::Strings are valid input so we will not check it here RichAudioUrl audioContent(params["lang"].c_str(), params["url"].c_str()); richAudioUrl.push_back(audioContent); std::cout << "Audio Content " << params["url"].c_str() << " set." << std::endl; return true; } bool setRichIconObjectPath(std::map& params) { // Empty qcc::Strings are valid input so we will not check it here richIconObjectPath = params["path"]; std::cout << "Icon Object Path " << params["path"].c_str() << " set." << std::endl; return true; } bool setRichAudioObjectPath(std::map& params) { // Empty qcc::Strings are valid input so we will not check it here richAudioObjectPath = params["path"]; std::cout << "Icon Object Path " << params["path"].c_str() << " set." << std::endl; return true; } bool setControlPanelServiceObjectPath(std::map& params) { // Empty qcc::Strings are valid input so we will not check it here controlPanelServiceObjectPath = params["path"]; std::cout << "ControlPanelService Object Path " << params["path"].c_str() << " set." << std::endl; return true; } bool shutdownSender(std::map& params) { QCC_UNUSED(params); didInitSend = false; CommonSampleUtil::aboutServiceDestroy(testBus, notificationBusListener); Service->shutdownSender(); std::cout << "service sender stopped" << std::endl; return true; } bool shutdown(std::map& params) { QCC_UNUSED(params); // clean up CommonSampleUtil::aboutServiceDestroy(testBus, notificationBusListener); if (notificationBusListener) { delete notificationBusListener; notificationBusListener = 0; } if (aboutData) { delete aboutData; aboutData = 0; } if (aboutObj) { delete aboutObj; aboutObj = NULL; } if (Service) { Service->shutdown(); Service = 0; } if (Receiver) { delete Receiver; Receiver = 0; } if (testBus) { delete testBus; testBus = 0; } didInitSend = false; didInitReceive = false; resetParams(); std::cout << "Service Shutdown!" << std::endl; return true; } bool shutdownReceiver(std::map& params) { QCC_UNUSED(params); didInitReceive = false; Service->shutdownReceiver(); std::cout << "service receiver stopped" << std::endl; return true; } bool deleteLastMsg(std::map& params) { NotificationMessageType deleteMessageType = (NotificationMessageType)atoi(params["type"].c_str()); QStatus status = Sender->deleteLastMsg(deleteMessageType); if (status != ER_OK) { std::cout << "Could not delete the message successfully" << std::endl; return false; } std::cout << "Deleted last message of type " << params["type"].c_str() << std::endl; return true; } bool clearParams(std::map& params) { QCC_UNUSED(params); std::cout << "Clearing out message data. " << std::endl; resetParams(); return true; } /* * Begin Utility Functions */ #define NUM_OF_FUNCTIONS 19 void checkNumFunctions(int32_t*i) { if (*i == NUM_OF_FUNCTIONS) { std::cout << "Max number of functions < " << NUM_OF_FUNCTIONS << "> reached. Exiting application due to error." << std::endl; exit(0); } } void createListOfFunctions(TestFunction*testFunctions) { int32_t i = 0; // createService testFunctions[i].functionName = "createservice"; testFunctions[i].usage = testFunctions[i].functionName; testFunctions[i].activateTest = createService; i++; checkNumFunctions(&i); // initSend testFunctions[i].functionName = "initsend"; testFunctions[i].usage = testFunctions[i].functionName + " device_name=&app_name="; testFunctions[i].activateTest = initSend; testFunctions[i].requiredParams.push_back("device_name"); testFunctions[i].requiredParams.push_back("app_name"); testFunctions[i].requiredSteps.push_back("Service"); i++; checkNumFunctions(&i); // send testFunctions[i].functionName = "send"; testFunctions[i].usage = testFunctions[i].functionName + " type=<0,1,2>&ttl="; testFunctions[i].activateTest = send; testFunctions[i].requiredParams.push_back("type"); testFunctions[i].requiredParams.push_back("ttl"); testFunctions[i].requiredSteps.push_back("Service"); testFunctions[i].requiredSteps.push_back("Sender"); testFunctions[i].requiredSteps.push_back("messageType"); testFunctions[i].requiredSteps.push_back("vecMessages"); i++; checkNumFunctions(&i); // setMsg testFunctions[i].functionName = "setmsg"; testFunctions[i].usage = testFunctions[i].functionName + " text=&lang="; testFunctions[i].activateTest = setMsg; testFunctions[i].requiredParams.push_back("text"); testFunctions[i].requiredParams.push_back("lang"); i++; checkNumFunctions(&i); // setCustomAttributes testFunctions[i].functionName = "setcustomattributes"; testFunctions[i].usage = testFunctions[i].functionName + " key=&value="; testFunctions[i].activateTest = setCustomAttributes; testFunctions[i].requiredParams.push_back("key"); testFunctions[i].requiredParams.push_back("value"); i++; checkNumFunctions(&i); // setLogger testFunctions[i].functionName = "setlogger"; testFunctions[i].usage = testFunctions[i].functionName; testFunctions[i].activateTest = setLogger; testFunctions[i].requiredSteps.push_back("Service"); i++; checkNumFunctions(&i); // initReceive testFunctions[i].functionName = "initreceive"; testFunctions[i].usage = testFunctions[i].functionName; testFunctions[i].activateTest = initReceive; testFunctions[i].requiredSteps.push_back("Service"); i++; checkNumFunctions(&i); // ResponseToNotification testFunctions[i].functionName = "responsetonotification"; testFunctions[i].usage = testFunctions[i].functionName + " action=<0-Nothing,1-Dismiss>"; testFunctions[i].activateTest = ResponseToNotification; testFunctions[i].requiredSteps.push_back("Service"); testFunctions[i].requiredSteps.push_back("Receiver"); testFunctions[i].requiredParams.push_back("action"); i++; checkNumFunctions(&i); // shutdown testFunctions[i].functionName = "shutdown"; testFunctions[i].usage = testFunctions[i].functionName; testFunctions[i].activateTest = shutdown; testFunctions[i].requiredSteps.push_back("Service"); i++; checkNumFunctions(&i); // shutdownSender testFunctions[i].functionName = "shutdownsender"; testFunctions[i].usage = testFunctions[i].functionName; testFunctions[i].activateTest = shutdownSender; testFunctions[i].requiredSteps.push_back("Service"); i++; checkNumFunctions(&i); // shutdownReceiver testFunctions[i].functionName = "shutdownreceiver"; testFunctions[i].usage = testFunctions[i].functionName; testFunctions[i].activateTest = shutdownReceiver; testFunctions[i].requiredSteps.push_back("Service"); i++; checkNumFunctions(&i); // deletelastmsg testFunctions[i].functionName = "deletelastmsg"; testFunctions[i].usage = testFunctions[i].functionName + " type=<0,1,2>"; testFunctions[i].activateTest = deleteLastMsg; testFunctions[i].requiredSteps.push_back("Service"); testFunctions[i].requiredSteps.push_back("Sender"); testFunctions[i].requiredParams.push_back("type"); i++; checkNumFunctions(&i); // clearParams testFunctions[i].functionName = "clearparams"; testFunctions[i].usage = testFunctions[i].functionName; testFunctions[i].activateTest = clearParams; i++; checkNumFunctions(&i); // setRichIconUrl testFunctions[i].functionName = "setrichiconurl"; testFunctions[i].usage = testFunctions[i].functionName + " url="; testFunctions[i].requiredSteps.push_back("Service"); testFunctions[i].requiredSteps.push_back("Sender"); testFunctions[i].requiredParams.push_back("url"); testFunctions[i].activateTest = setRichIconUrl; i++; checkNumFunctions(&i); // setRichAudioUrl testFunctions[i].functionName = "setrichaudiourl"; testFunctions[i].usage = testFunctions[i].functionName + " url=&lang="; testFunctions[i].requiredSteps.push_back("Service"); testFunctions[i].requiredSteps.push_back("Sender"); testFunctions[i].requiredParams.push_back("lang"); testFunctions[i].requiredParams.push_back("url"); testFunctions[i].activateTest = setRichAudioUrl; i++; checkNumFunctions(&i); // setRichIconObjectPath testFunctions[i].functionName = "setrichiconobjectpath"; testFunctions[i].usage = testFunctions[i].functionName + " path="; testFunctions[i].requiredSteps.push_back("Service"); testFunctions[i].requiredSteps.push_back("Sender"); testFunctions[i].requiredParams.push_back("path"); testFunctions[i].activateTest = setRichIconObjectPath; i++; checkNumFunctions(&i); // setRichAudioObjectPath testFunctions[i].functionName = "setrichaudioobjectpath"; testFunctions[i].usage = testFunctions[i].functionName + " path="; testFunctions[i].requiredSteps.push_back("Service"); testFunctions[i].requiredSteps.push_back("Sender"); testFunctions[i].requiredParams.push_back("path"); testFunctions[i].activateTest = setRichAudioObjectPath; i++; checkNumFunctions(&i); // setcontrolpanelserviceobjectpath testFunctions[i].functionName = "setcontrolpanelserviceobjectpath"; testFunctions[i].usage = testFunctions[i].functionName + " path="; testFunctions[i].requiredSteps.push_back("Service"); testFunctions[i].requiredSteps.push_back("Sender"); testFunctions[i].requiredParams.push_back("path"); testFunctions[i].activateTest = setControlPanelServiceObjectPath; } bool functionExists(qcc::String& funcName, TestFunction*testFunctions, int32_t*functionIndex) { for (int32_t i = 0; i < NUM_OF_FUNCTIONS; i++) { if (((testFunctions[i].functionName).compare(funcName)) == 0) { *functionIndex = i; return true; } } std::cout << "functionExists - ERROR - not found funcName:" << funcName.c_str() << std::endl; return false; } void Usage(TestFunction*testFunctions, qcc::String funcName = "", int32_t*functionIndex = 0) { if (funcName.size() > 0) { if (functionExists(funcName, testFunctions, functionIndex)) { std::cout << testFunctions[*functionIndex].usage.c_str() << std::endl; return; } } std::cout << "FUNCTION USAGE-------------------------------------FUNCTION USAGE" << std::endl; std::cout << "function name param=value¶m=value" << std::endl << std::endl; std::cout << "Add -h after any function name to print out the function usage." << std::endl << std::endl; std::cout << "Press 'enter' at any time to receive this help message again." << std::endl << std::endl; std::cout << "Available functions are:\n" << std::endl; for (int32_t i = 0; i < NUM_OF_FUNCTIONS; i++) { std::cout << testFunctions[i].functionName.c_str() << std::endl; } return; } void CDECL_CALL signal_callback_handler(int32_t signum) { QCC_UNUSED(signum); s_interrupt = true; } bool checkRequiredSteps(TestFunction& test, TestFunction*testFunctions, int32_t*functionIndex) { std::vector reqSteps = test.requiredSteps; for (std::vector::const_iterator reqSteps_it = reqSteps.begin(); reqSteps_it != reqSteps.end(); ++reqSteps_it) { if ((reqSteps_it->compare("Service") == 0) && (!Service)) { std::cout << "Action not allowed. Cannot run '" << test.functionName.c_str() << "' without creating a service first (createservice)" << std::endl; return false; } else if ((reqSteps_it->compare("Sender") == 0) && (!didInitSend)) { std::cout << "Action not allowed. Cannot run '" << test.functionName.c_str() << "' without initializing a sender." << std::endl; qcc::String preReqApi = "initsend"; if (functionExists(preReqApi, testFunctions, functionIndex)) { Usage(testFunctions, preReqApi, functionIndex); } return false; } else if ((reqSteps_it->compare("Receiver") == 0) && (!didInitReceive)) { std::cout << "Action not allowed. Cannot run '" << test.functionName.c_str() << "' without initializing a receiver." << std::endl; qcc::String preReqApi = "initreceive"; if (functionExists(preReqApi, testFunctions, functionIndex)) { Usage(testFunctions, preReqApi, functionIndex); } return false; } else if ((reqSteps_it->compare("vecMessages") == 0) && (!vecMessages.size())) { std::cout << "Cannot send message. Missing mandatory parameter message text." << std::endl; qcc::String preReqApi = "setmsg"; if (functionExists(preReqApi, testFunctions, functionIndex)) { Usage(testFunctions, preReqApi, functionIndex); } return false; } } return true; } void trim(qcc::String& str, const qcc::String& whitespace = " ") { if (str.size() > 0) { size_t strBegin = str.find_first_not_of(whitespace.c_str()); if (strBegin == qcc::String::npos) { str = ""; // no content return; } unsigned strEnd = str.find_last_not_of(whitespace.c_str()); if (strEnd == strBegin) { std::cout << "no content" << std::endl; str = ""; // no content return; } unsigned strRange = strEnd - strBegin + 1; str = str.substr(strBegin, strRange); } } bool processInput(const qcc::String& input, qcc::String& funcName, std::map& params, TestFunction*testFunctions, int32_t*functionIndex) { // Check first if the user pressed enter. if (!input.size()) { return false; } unsigned spacePos = input.find(" "); funcName = input.substr(0, spacePos).c_str(); if (!funcName.size()) { std::cout << "Incorrect input format. Please check usage format" << std::endl; return false; } // Make FUNCTION name lower case std::transform(funcName.begin(), funcName.end(), funcName.begin(), ::tolower); if (!functionExists(funcName, testFunctions, functionIndex)) { std::cout << "Incorrect Function name. Please check usage format" << std::endl; return false; } // Check if the function was sent in with a help command // This covers -h, --h, -help and --help if (input.find(" -h") != qcc::String::npos) { // Help requested return false; } // Now parse the parameters sent in and put them into a std::map qcc::String paramString = input.substr(spacePos + 1).c_str(); if (input.size() == paramString.size()) { // no parameters sent in so return early return true; } trim(paramString, " "); std::stringstream iss(paramString.c_str()); std::string singleParam; while (getline(iss, singleParam, '&')) { size_t equalPos = singleParam.find("="); if (equalPos == qcc::String::npos) { std::cout << "Parameters were not entered in the correct format. Please check usage format." << std::endl; Usage(testFunctions); return false; } params[singleParam.substr(0, equalPos).c_str()] = singleParam.substr(equalPos + 1).c_str(); } return true; } int main(int argc, char* argv[]) { QCC_UNUSED(argv); // Initialize AllJoyn AJInitializer ajInit; if (ajInit.Initialize() != ER_OK) { return 1; } std::cout << "Beginning TestService Application. (Press CTRL+C and Enter to end application)" << std::endl; TestFunction testFunctions[NUM_OF_FUNCTIONS]; createListOfFunctions(testFunctions); Usage(testFunctions); if (argc > 1) { return 0; } // Allow CTRL+C to end application signal(SIGINT, signal_callback_handler); while (!s_interrupt) { std::cout << "> "; std::string input; qcc::String funcName; std::map params; int32_t functionIndex; getline(std::cin, input); if (processInput(input.c_str(), funcName, params, testFunctions, &functionIndex)) { if (((testFunctions[functionIndex].functionName).compare(funcName)) == 0) { if (checkRequiredSteps(testFunctions[functionIndex], testFunctions, &functionIndex)) { if (testFunctions[functionIndex].checkRequiredParams(params)) { testFunctions[functionIndex].checkOptionalParams(params); testFunctions[functionIndex].activateTest(params); } } } } else if (!s_interrupt) { Usage(testFunctions, funcName, &functionIndex); } } std::map params; // clean up shutdown(params); std::cout << "Goodbye!" << std::endl; return 0; } base-15.09/notification/cpp/samples/common/000077500000000000000000000000001262264444500206575ustar00rootroot00000000000000base-15.09/notification/cpp/samples/common/.gitignore000066400000000000000000000000151262264444500226430ustar00rootroot00000000000000/obj /obj_sl base-15.09/notification/cpp/samples/common/NotificationReceiverTestImpl.cc000066400000000000000000000216401262264444500267660ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include "NotificationReceiverTestImpl.h" #include #include #include #include #include #include #ifdef _WIN32 #include #endif using namespace ajn; using namespace services; using namespace qcc; NotificationReceiverTestImpl::NotificationReceiverTestImpl(bool waitForExternalNotificationAction) : m_NotificationAction(ACTION_NOTHING), m_WaitForExternalNotificationAction(waitForExternalNotificationAction) { if (m_WaitForExternalNotificationAction) { #ifdef _WIN32 InitializeCriticalSection(&m_Lock); InitializeConditionVariable(&m_Condition); #else pthread_mutex_init(&m_Lock, NULL); pthread_cond_init(&m_Condition, NULL); #endif } } NotificationReceiverTestImpl::~NotificationReceiverTestImpl() { if (m_WaitForExternalNotificationAction) { #ifdef _WIN32 EnterCriticalSection(&m_Lock); WakeConditionVariable(&m_Condition); LeaveCriticalSection(&m_Lock); DeleteCriticalSection(&m_Lock); #else pthread_mutex_lock(&m_Lock); pthread_cond_signal(&m_Condition); pthread_mutex_unlock(&m_Lock); pthread_cond_destroy(&m_Condition); pthread_mutex_destroy(&m_Lock); #endif } } void NotificationReceiverTestImpl::Receive(Notification const& notification) { qcc::String appName = notification.getAppName(); // If applications list is empty or the name exists in the filter list then print the notification if ((m_Applications.size() == 0) || (find(m_Applications.begin(), m_Applications.end(), appName) != m_Applications.end())) { std::cout << "******************** Begin New Message Received ********************" << std::endl; std::cout << "Message Id: " << notification.getMessageId() << std::endl; std::cout << "Device Id: " << notification.getDeviceId() << std::endl; std::cout << "Device Name: " << notification.getDeviceName() << std::endl; std::cout << "App Id: " << notification.getAppId() << std::endl; std::cout << "App Name: " << notification.getAppName() << std::endl; std::cout << "Sender BusName: " << notification.getSenderBusName() << std::endl; std::cout << "Message Type " << notification.getMessageType() << " " << MessageTypeUtil::getMessageTypeString(notification.getMessageType()).c_str() << std::endl; std::cout << "Notification version: " << notification.getVersion() << std::endl; // get vector of text messages and iterate through it std::vector vecMessages = notification.getText(); for (std::vector::const_iterator vecMessage_it = vecMessages.begin(); vecMessage_it != vecMessages.end(); ++vecMessage_it) { std::cout << "Language: " << vecMessage_it->getLanguage().c_str() << " Message: " << vecMessage_it->getText().c_str() << std::endl; } // Print out any other parameters sent in std::cout << "Other parameters included:" << std::endl; std::map customAttributes = notification.getCustomAttributes(); for (std::map::const_iterator customAttributes_it = customAttributes.begin(); customAttributes_it != customAttributes.end(); ++customAttributes_it) { std::cout << "Custom Attribute Key: " << customAttributes_it->first.c_str() << " Custom Attribute Value: " << customAttributes_it->second.c_str() << std::endl; } if (notification.getRichIconUrl()) { std::cout << "Rich Content Icon Url: " << notification.getRichIconUrl() << std::endl; } // get vector of audio content and iterate through it std::vector richAudioUrl = notification.getRichAudioUrl(); if (!richAudioUrl.empty()) { std::cout << "******************** Begin Rich Audio Content ********************" << std::endl; for (std::vector::const_iterator vecAudio_it = richAudioUrl.begin(); vecAudio_it != richAudioUrl.end(); ++vecAudio_it) { std::cout << "Language: " << vecAudio_it->getLanguage().c_str() << " Audio Url: " << vecAudio_it->getUrl().c_str() << std::endl; } std::cout << "******************** End Rich Audio Content ********************" << std::endl; } if (notification.getRichIconObjectPath()) { std::cout << "Rich Content Icon Object Path: " << notification.getRichIconObjectPath() << std::endl; } if (notification.getRichAudioObjectPath()) { std::cout << "Rich Content Audio Object Path: " << notification.getRichAudioObjectPath() << std::endl; } if (notification.getControlPanelServiceObjectPath()) { std::cout << "ControlPanelService object path: " << notification.getControlPanelServiceObjectPath() << std::endl; } if (notification.getOriginalSender()) { std::cout << "OriginalSender: " << notification.getOriginalSender() << std::endl; } std::cout << "******************** End New Message Received ********************" << std::endl << std::endl; Notification nonConstNotification(notification); if (m_WaitForExternalNotificationAction) { #ifdef _WIN32 EnterCriticalSection(&m_Lock); SleepConditionVariableCS(&m_Condition, &m_Lock, INFINITE); #else pthread_mutex_lock(&m_Lock); pthread_cond_wait(&m_Condition, &m_Lock); #endif } else { std::cout << "Notification action (0-Nothing 1-Dismiss):" << std::endl; int32_t notificationAction(ACTION_NOTHING); int retScan = scanf("%d", ¬ificationAction); if (retScan != EOF) { m_NotificationAction = static_cast(notificationAction); } } switch (GetNotificationAction()) { case ACTION_NOTHING: std::cout << "Nothing planed to do with the notification message id:" << nonConstNotification.getMessageId() << std::endl; break; case ACTION_DISMISS: { std::cout << "going to call dismiss for message id:" << nonConstNotification.getMessageId() << std::endl; nonConstNotification.dismiss(); } break; default: std::cout << "Got non valid action to do:" << GetNotificationAction() << std::endl; break; } ; if (m_WaitForExternalNotificationAction) { #ifdef _WIN32 LeaveCriticalSection(&m_Lock); #else pthread_mutex_unlock(&m_Lock); #endif } } std::cout << "End handling notification!!!" << std::endl; } void NotificationReceiverTestImpl::setApplications(qcc::String const& listOfApps) { std::istringstream iss(listOfApps.c_str()); std::string singleAppName; while (std::getline(iss, singleAppName, ';')) { m_Applications.push_back(singleAppName.c_str()); } } void NotificationReceiverTestImpl::Dismiss(const int32_t msgId, const qcc::String appId) { std::cout << "Got NotificationReceiverTestImpl::Dismiss with msgId=" << msgId << " appId=" << appId.c_str() << std::endl; } NotificationReceiverTestImpl::NotificationAction NotificationReceiverTestImpl::GetNotificationAction() { return m_NotificationAction; } void NotificationReceiverTestImpl::SetNotificationAction(NotificationReceiverTestImpl::NotificationAction notificationAction) { if (m_WaitForExternalNotificationAction) { #ifdef _WIN32 EnterCriticalSection(&m_Lock); m_NotificationAction = notificationAction; WakeConditionVariable(&m_Condition); LeaveCriticalSection(&m_Lock); #else pthread_mutex_lock(&m_Lock); m_NotificationAction = notificationAction; pthread_cond_signal(&m_Condition); pthread_mutex_unlock(&m_Lock); #endif } } base-15.09/notification/cpp/samples/common/NotificationReceiverTestImpl.h000066400000000000000000000075561262264444500266420ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONRECEIVERTESTIMPL_H_ #define NOTIFICATIONRECEIVERTESTIMPL_H_ #include #include #include #ifdef _WIN32 #include #define pthread_mutex_t CRITICAL_SECTION #define pthread_cond_t CONDITION_VARIABLE #else #include #endif /** * Class that will receive Notifications. Implements NotificationReceiver * Receives list of applications to filter by and will only display notifications * from those applications */ class NotificationReceiverTestImpl : public ajn::services::NotificationReceiver { public: enum NotificationAction { ACTION_NOTHING, ACTION_DISMISS }; /** * Constructor * @param wait to external notification action */ NotificationReceiverTestImpl(bool waitForExternalNotificationAction = true); /** * Destructor */ ~NotificationReceiverTestImpl(); /** * Receive - function that receives a notification * @param notification */ void Receive(ajn::services::Notification const& notification); /** * receive a list of applications to filter by and set the filter * @param listOfApps */ void setApplications(qcc::String const& listOfApps); /** * receive Dismiss signal * @param message id * @param application id */ void Dismiss(const int32_t msgId, const qcc::String appId); /** * Get notification action * @return NotificationAction */ NotificationAction GetNotificationAction(); /** * Set notification action * This method is called from a free thread to set an action and to release the blocked thread (At NotificationReceiverTestImpl::Receive(...)), * that received the notification and waiting to the action decision. * @param NotificationAction */ void SetNotificationAction(NotificationAction notificationAction); private: /** * vector of applications to filter by */ std::vector m_Applications; /** * action to do after getting notification */ NotificationAction m_NotificationAction; /** * locks for the condition according to 'pthread_cond_t' declaration. */ pthread_mutex_t m_Lock; /** * thread condition * Blocking the notification receiving thread in case m_WaitForExternalNotificationAction is true, until SetNotificationAction() will be called. */ pthread_cond_t m_Condition; /** * Wait to external notification action * If true - external thread will need to call to SetNotificationAction() to unblock the thread that received the notification. * If false - a normal standard input will block the thread that received the notification until the user will decide what to do with the notification. */ bool m_WaitForExternalNotificationAction; }; #endif /* NOTIFICATIONRECEIVERTESTIMPL_H_ */ base-15.09/notification/cpp/samples/common/SConscript000066400000000000000000000020421262264444500226670ustar00rootroot00000000000000# Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Import('env') import os srcs = env.Glob('*.cc') objs = env.Object(srcs) env.VariantDir('AppCommon', '$APP_COMMON_DIR/cpp/samples_common/', duplicate = 0) cobjs = env.SConscript('AppCommon/SConscript', {'env': env}) objs.extend(cobjs) Return('objs') base-15.09/notification/cpp/src/000077500000000000000000000000001262264444500165125ustar00rootroot00000000000000base-15.09/notification/cpp/src/.gitignore000066400000000000000000000000401262264444500204740ustar00rootroot00000000000000/obj /libnotificationService.so base-15.09/notification/cpp/src/Notification.cc000066400000000000000000000306721262264444500214570ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include "Transport.h" #include "NotificationConstants.h" #include #include #include #include #include #include using namespace ajn; using namespace services; using namespace qcc; NotificationAsyncTaskEvents Notification::m_NotificationAsyncTaskEvents; AsyncTaskQueue Notification::m_AsyncTaskQueue(&Notification::m_NotificationAsyncTaskEvents); /* * Checks if a valid AllJoyn Object path has been specified in str. * Please note that this function is same as ajn::BusUtil::IsLegalObjectPath() * but since this is not exposed to external applications, this function is * being added here */ static bool IsLegalObjectPath(const char* str) { if (!str) { return false; } /* Must begin with slash */ char c = *str++; if (c != '/') { return false; } while ((c = *str++) != 0) { if ((!(qcc::IsAlphaNumeric(c))) && (c != '_')) { if ((c != '/') || (*str == '/') || (*str == 0)) { return false; } } } return true; } Notification::Notification(int32_t messageId, NotificationMessageType messageType, const char* deviceId, const char* deviceName, const char* appId, const char* appName, const char* sender, std::map const& customAttributes, std::vector const& notificationText, const char* richIconUrl, std::vector const& richAudioUrl, const char* richIconObjectPath, const char* richAudioObjectPath, const char* controlPanelServiceObjectPath, const char* originalSender) : m_MessageId(messageId), m_Sender(0), m_MessageType(messageType), m_DeviceId(0), m_DeviceName(0), m_AppId(0), m_AppName(0), m_CustomAttributes(customAttributes), m_Text(notificationText), m_RichIconUrl(0), m_RichAudioUrl(richAudioUrl), m_RichIconObjectPath(0), m_RichAudioObjectPath(0), m_ControlPanelServiceObjectPath(0), m_OriginalSender(0) { setDeviceId(deviceId); setDeviceName(deviceName); setAppId(appId); setAppName(appName); setSender(sender); setRichIconUrl(richIconUrl); setRichIconObjectPath(richIconObjectPath); setRichAudioObjectPath(richAudioObjectPath); setControlPanelServiceObjectPath(controlPanelServiceObjectPath); setOriginalSender(originalSender); } Notification::Notification(NotificationMessageType messageType, std::vector const& notificationText) : m_MessageId(-1), m_Sender(0), m_MessageType(messageType), m_DeviceId(0), m_DeviceName(0), m_AppId(0), m_AppName(0), m_Text(notificationText), m_RichIconUrl(0), m_RichIconObjectPath(0), m_RichAudioObjectPath(0), m_ControlPanelServiceObjectPath(0), m_OriginalSender(0) { } Notification::Notification(const Notification& notification) { m_Sender = NULL; m_DeviceId = NULL; m_DeviceName = NULL; m_AppId = NULL; m_AppName = NULL; m_RichIconUrl = NULL; m_RichIconObjectPath = NULL; m_RichAudioObjectPath = NULL; m_ControlPanelServiceObjectPath = NULL; m_OriginalSender = NULL; setDeviceId(notification.getDeviceId()); setDeviceName(notification.getDeviceName()); setAppId(notification.getAppId()); setAppName(notification.getAppName()); setSender(notification.getSenderBusName()); setRichIconUrl(notification.getRichIconUrl()); setRichIconObjectPath(notification.getRichIconObjectPath()); setRichAudioObjectPath(notification.getRichAudioObjectPath()); setControlPanelServiceObjectPath(notification.getControlPanelServiceObjectPath()); setOriginalSender(notification.getOriginalSender()); m_CustomAttributes = notification.m_CustomAttributes; m_MessageId = notification.m_MessageId; m_MessageType = notification.m_MessageType; m_Text = notification.m_Text; m_RichAudioUrl = notification.m_RichAudioUrl; } Notification::~Notification() { delete m_Sender; m_Sender = NULL; delete m_DeviceId; m_DeviceId = NULL; delete m_DeviceName; m_DeviceName = NULL; delete m_AppId; m_AppId = NULL; delete m_AppName; m_AppName = NULL; delete m_RichIconUrl; m_RichIconUrl = NULL; delete m_RichIconObjectPath; m_RichIconObjectPath = NULL; delete m_RichAudioObjectPath; m_RichAudioObjectPath = NULL; delete m_ControlPanelServiceObjectPath; m_ControlPanelServiceObjectPath = NULL; delete m_OriginalSender; m_OriginalSender = NULL; } const uint16_t Notification::getVersion() const { return NotificationService::getVersion(); } const char* Notification::getDeviceId() const { if (m_DeviceId == NULL) { return NULL; } return m_DeviceId->c_str(); } const char* Notification::getDeviceName() const { if (m_DeviceName == NULL) { return NULL; } return m_DeviceName->c_str(); } const char* Notification::getAppId() const { if (m_AppId == NULL) { return NULL; } return m_AppId->c_str(); } const char* Notification::getAppName() const { if (m_AppName == NULL) { return NULL; } return m_AppName->c_str(); } const std::map& Notification::getCustomAttributes() const { return m_CustomAttributes; } const int32_t Notification::getMessageId() const { return m_MessageId; } const std::vector& Notification::getText() const { return m_Text; } const char* Notification::getSenderBusName() const { if (m_Sender == NULL) { return NULL; } return m_Sender->c_str(); } const NotificationMessageType Notification::getMessageType() const { return m_MessageType; } const char* Notification::getRichIconUrl() const { if (m_RichIconUrl == NULL) { return NULL; } return m_RichIconUrl->c_str(); } const char* Notification::getRichIconObjectPath() const { if (m_RichIconObjectPath == NULL) { return NULL; } return m_RichIconObjectPath->c_str(); } const char* Notification::getRichAudioObjectPath() const { if (m_RichAudioObjectPath == NULL) { return NULL; } return m_RichAudioObjectPath->c_str(); } const std::vector& Notification::getRichAudioUrl() const { return m_RichAudioUrl; } const char* Notification::getControlPanelServiceObjectPath() const { if (m_ControlPanelServiceObjectPath == NULL) { return NULL; } return m_ControlPanelServiceObjectPath->c_str(); } const char* Notification::getOriginalSender() const { if (m_OriginalSender == NULL) { return NULL; } return m_OriginalSender->c_str(); } void Notification::setAppId(const char* appId) { if (appId == NULL) { delete m_AppId; m_AppId = NULL; return; } if (!m_AppId) { m_AppId = new qcc::String(appId); } else { m_AppId->assign(appId); } } void Notification::setAppName(const char* appName) { if (appName == NULL) { delete m_AppName; m_AppName = NULL; return; } if (!m_AppName) { m_AppName = new qcc::String(appName); } else { m_AppName->assign(appName); } } void Notification::setControlPanelServiceObjectPath( const char* controlPanelServiceObjectPath) { if (controlPanelServiceObjectPath == NULL) { delete m_ControlPanelServiceObjectPath; m_ControlPanelServiceObjectPath = NULL; return; } if (!IsLegalObjectPath(controlPanelServiceObjectPath)) { QCC_LogError(ER_BUS_BAD_OBJ_PATH, ("Illegal object path \"%s\" specified", controlPanelServiceObjectPath)); return; } if (!m_ControlPanelServiceObjectPath) { m_ControlPanelServiceObjectPath = new qcc::String(controlPanelServiceObjectPath); } else { m_ControlPanelServiceObjectPath->assign(controlPanelServiceObjectPath); } } void Notification::setCustomAttributes( const std::map& customAttributes) { m_CustomAttributes = customAttributes; } void Notification::setDeviceId(const char* deviceId) { if (deviceId == NULL) { delete m_DeviceId; m_DeviceId = NULL; return; } if (!m_DeviceId) { m_DeviceId = new qcc::String(deviceId); } else { m_DeviceId->assign(deviceId); } } void Notification::setDeviceName(const char* deviceName) { if (deviceName == NULL) { delete m_DeviceName; m_DeviceName = NULL; return; } if (!m_DeviceName) { m_DeviceName = new qcc::String(deviceName); } else { m_DeviceName->assign(deviceName); } } void Notification::setOriginalSender(const char* originalSender) { if (originalSender == NULL) { delete m_OriginalSender; m_OriginalSender = NULL; return; } if (!m_OriginalSender) { m_OriginalSender = new qcc::String(originalSender); } else { m_OriginalSender->assign(originalSender); } } void Notification::setMessageId(int32_t messageId) { m_MessageId = messageId; } void Notification::setRichAudioUrl( const std::vector& richAudioUrl) { m_RichAudioUrl = richAudioUrl; } void Notification::setRichIconUrl(const char* richIconUrl) { if (richIconUrl == NULL) { delete m_RichIconUrl; m_RichIconUrl = NULL; return; } if (!m_RichIconUrl) { m_RichIconUrl = new qcc::String(richIconUrl); } else { m_RichIconUrl->assign(richIconUrl); } } void Notification::setRichIconObjectPath(const char* richIconObjectPath) { if (richIconObjectPath == NULL) { delete m_RichIconObjectPath; m_RichIconObjectPath = NULL; return; } if (!IsLegalObjectPath(richIconObjectPath)) { QCC_LogError(ER_BUS_BAD_OBJ_PATH, ("Illegal object path \"%s\" specified", richIconObjectPath)); return; } if (!m_RichIconObjectPath) { m_RichIconObjectPath = new qcc::String(richIconObjectPath); } else { m_RichIconObjectPath->assign(richIconObjectPath); } } void Notification::setRichAudioObjectPath(const char* richAudioObjectPath) { if (richAudioObjectPath == NULL) { delete m_RichAudioObjectPath; m_RichAudioObjectPath = NULL; return; } if (!IsLegalObjectPath(richAudioObjectPath)) { QCC_LogError(ER_BUS_BAD_OBJ_PATH, ("Illegal object path \"%s\" specified", richAudioObjectPath)); return; } if (!m_RichAudioObjectPath) { m_RichAudioObjectPath = new qcc::String(richAudioObjectPath); } else { m_RichAudioObjectPath->assign(richAudioObjectPath); } } void Notification::setSender(const char* sender) { if (sender == NULL) { delete m_Sender; m_Sender = NULL; return; } if (!m_Sender) { m_Sender = new qcc::String(sender); } else { m_Sender->assign(sender); } } QStatus Notification::dismiss() { QCC_DbgPrintf(("Notification::dismiss() called OriginalSender:%s MessageId:%d AppId:%s", getOriginalSender(), getMessageId(), getAppId())); NotificationMsg* notificationMsg = new NotificationMsg(getOriginalSender(), getMessageId(), getAppId()); m_AsyncTaskQueue.Enqueue(notificationMsg); return ER_OK; } base-15.09/notification/cpp/src/NotificationAsyncTaskEvents.cc000066400000000000000000000140751262264444500244640ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include #include #include "Transport.h" #include "NotificationProducerSender.h" #include "NotificationDismisserSender.h" #include #include #include #include #include using namespace ajn; using namespace services; using namespace qcc; NotificationAsyncTaskEvents::NotificationAsyncTaskEvents() { } NotificationAsyncTaskEvents::~NotificationAsyncTaskEvents() { } void NotificationAsyncTaskEvents::OnEmptyQueue() { } void NotificationAsyncTaskEvents::OnTask(TaskData const* taskData) { QCC_DbgTrace(("NotificationAsyncTaskEvents", "OnTask() called")); NotificationMsg const* notificationMsg = static_cast(taskData); QStatus status = ER_OK; Transport* pTransport = Transport::getInstance(); SessionOpts opts(SessionOpts::TRAFFIC_MESSAGES, false, SessionOpts::PROXIMITY_ANY, TRANSPORT_ANY); ajn::SessionId sessionId(0); if (notificationMsg->m_OriginalSender.length() > 0) { status = pTransport->getBusAttachment()->JoinSession(notificationMsg->m_OriginalSender.c_str(), (ajn::SessionPort)nsConsts::AJ_NOTIFICATION_PRODUCER_SERVICE_PORT, NULL, sessionId, opts); } else { QCC_DbgHLPrintf(("There is no original sender in the message. Can't join session.")); status = ER_FAIL; } if ((ER_OK != status) && (status != ER_ALLJOYN_JOINSESSION_REPLY_ALREADY_JOINED)) { QCC_LogError(status, ("Failed to JoinSession to %s", notificationMsg->m_OriginalSender.c_str())); sendDismissSignal(notificationMsg); return; } else { QCC_DbgPrintf(("JoinSession to %s SUCCEEDED (Session id=%u)", notificationMsg->m_OriginalSender.c_str(), sessionId)); } NotificationProducerSender* pNotificationProducerSender = Transport::getInstance()->getNotificationProducerSender(); if (pNotificationProducerSender == NULL) { status = ER_FAIL; return; } status = pNotificationProducerSender->Dismiss(notificationMsg->m_OriginalSender.c_str(), sessionId, notificationMsg->m_MessageId); if (status != ER_OK) { QCC_LogError(status, ("Dismiss failed")); sendDismissSignal(taskData); } else { QCC_DbgPrintf(("Dismiss succeeded")); } status = Transport::getInstance()->getBusAttachment()->LeaveSession(sessionId); } void NotificationAsyncTaskEvents::sendDismissSignal(TaskData const* taskData) { QCC_DbgPrintf(("NotificationAsyncTaskEvents", "sendDismissSignal() called!")); NotificationMsg const* notificationMsg = static_cast(taskData); QStatus status = ER_OK; MsgArg msgIdArg; MsgArg appIdArg; status = msgIdArg.Set(nsConsts::AJPARAM_INT.c_str(), notificationMsg->m_MessageId); if (status != ER_OK) { return; } uint8_t AppId[16]; HexStringToBytes(notificationMsg->m_AppId, AppId, 16); status = appIdArg.Set(nsConsts::AJPARAM_ARR_BYTE.c_str(), 16, AppId); if (status != ER_OK) { return; } { MsgArg dismisserArgs[nsConsts::AJ_DISMISSER_NUM_PARAMS]; dismisserArgs[0] = msgIdArg; dismisserArgs[1] = appIdArg; /**Code commented below is for future use * In case dismiss signal will not need to be sent via different object path each time. * In that case enable code below and disable next paragraph. * * status = Transport::getInstance()->getNotificationDismisserSender()->sendSignal(dismisserArgs,nsConsts::TTL_MAX); * if (status != ER_OK) { * QCC_LogError(status,("NotificationAsyncTaskEvents", "sendSignal failed.")); * return; * } * * End of paragraph */ /* * Paragraph to be disabled in case dismiss signal will not need to be sent via different object path each time */ std::ostringstream stm; stm << abs(notificationMsg->m_MessageId); qcc::String objectPath = nsConsts::AJ_NOTIFICATION_DISMISSER_PATH + "/" + notificationMsg->m_AppId + "/" + std::string(stm.str()).c_str(); NotificationDismisserSender notificationDismisserSender(Transport::getInstance()->getBusAttachment(), objectPath, status); status = Transport::getInstance()->getBusAttachment()->RegisterBusObject(notificationDismisserSender); if (status != ER_OK) { QCC_LogError(status, ("Could not register NotificationDismisserSender.")); return; } status = notificationDismisserSender.sendSignal(dismisserArgs, nsConsts::TTL_MAX); if (status != ER_OK) { QCC_LogError(status, ("sendSignal failed.")); return; } Transport::getInstance()->getBusAttachment()->UnregisterBusObject(notificationDismisserSender); /* * End of paragraph */ } } base-15.09/notification/cpp/src/NotificationConstants.cc000066400000000000000000000017641262264444500233540ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include "NotificationConstants.h" base-15.09/notification/cpp/src/NotificationConstants.h000066400000000000000000000121431262264444500232070ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONCONSTANTS_H_ #define NOTIFICATIONCONSTANTS_H_ #include #if defined(QCC_OS_GROUP_WINDOWS) /* Disabling warning C 4706. Assignment within conditional expression */ #pragma warning(push) #pragma warning(disable: 4706) #endif /* * Common Macros */ #define CHECK(x) if ((status = x)) { break; } namespace ajn { namespace services { namespace nsConsts { static const qcc::String BUS_NAME = "NotificationService"; static const uint16_t TTL_MIN = 30; static const uint16_t TTL_MAX = 43200; static const uint16_t UUID_LENGTH = 16; static const int16_t ANNOUNCMENT_PORT_NUMBER = 900; static const uint16_t NOTIFICATION_DISMISSER_VERSION = 1; static const uint16_t NOTIFICATION_PRODUCER_VERSION = 1; static const qcc::String AJPARAM_BOOL = "b"; static const qcc::String AJPARAM_UINT16 = "q"; static const qcc::String AJPARAM_STR = "s"; static const qcc::String AJPARAM_INT = "i"; static const qcc::String AJPARAM_ARR_BYTE = "ay"; static const qcc::String AJPARAM_DICT_INT_VAR = "{iv}"; static const qcc::String AJPARAM_DICT_INT_UINT16 = "{iq}"; static const qcc::String AJPARAM_DICT_INT_STR = "{is}"; static const qcc::String AJPARAM_DICT_STR_STR = "{ss}"; static const qcc::String AJPARAM_DICT_STR_VAR = "{sv}"; static const qcc::String AJPARAM_ARR_DICT_INT_VAR = "a{iv}"; static const qcc::String AJPARAM_ARR_DICT_STR_VAR = "a{sv}"; static const qcc::String AJPARAM_ARR_DICT_STR_STR = "a{ss}"; static const qcc::String AJPARAM_STRUCT_STR_STR = "(ss)"; static const qcc::String AJPARAM_ARR_STRUCT_STR_STR = "a(ss)"; static const qcc::String AJPARAM_ARR_STRUCT_STR_ARR_STR = "a(sas)"; static const qcc::String AJPARAM_STRUCT_STR_ARR_STR = "(sas)"; static const int32_t AJ_NOTIFY_NUM_PARAMS = 10; static const int32_t AJ_NUM_METADATA_DEFLT_PARAMS = 0; static const int32_t RICH_CONTENT_ICON_URL_ATTRIBUTE_KEY = 0; static const int32_t RICH_CONTENT_AUDIO_URL_ATTRIBUTE_KEY = 1; static const int32_t RICH_CONTENT_ICON_OBJECT_PATH_ATTRIBUTE_KEY = 2; static const int32_t RICH_CONTENT_AUDIO_OBJECT_PATH_ATTRIBUTE_KEY = 3; static const int32_t CPS_OBJECT_PATH_ATTRIBUTE_KEY = 4; static const int32_t ORIGINAL_SENDER_ATTRIBUTE_KEY = 5; static const qcc::String AJ_NOTIFICATION_INTERFACE_NAME = "org.alljoyn.Notification"; static const uint16_t AJ_NOTIFICATION_PRODUCER_SERVICE_PORT = 1010; static const qcc::String AJ_PROPERTY_VERSION = "Version"; static const qcc::String AJ_SIGNAL_METHOD = "notify"; static const qcc::String AJ_CONSUMER_SERVICE_PATH = "/receiver"; static const qcc::String AJ_PRODUCER_SERVICE_PATH_PREFIX = "/"; static const qcc::String AJ_NOTIFY_PARAMS = AJPARAM_UINT16 + AJPARAM_INT + AJPARAM_UINT16 + AJPARAM_STR + AJPARAM_STR + AJPARAM_ARR_BYTE + AJPARAM_STR + AJPARAM_ARR_DICT_INT_VAR + AJPARAM_ARR_DICT_STR_STR + AJPARAM_ARR_STRUCT_STR_STR; static const qcc::String AJ_NOTIFY_PARAM_NAMES = "version, notificationId, messageType, deviceId, deviceName, appId, appName, attributes, customAttributes, notificationText"; static const qcc::String AJ_NOTIFY_SIGNAL_DESCRIPTION = "AllJoyn signal-carrying notification message."; static const qcc::String AJ_SESSIONLESS_MATCH = "sessionless='t'"; static const qcc::String AJ_NOTIFICATION_PRODUCER_INTERFACE = "org.alljoyn.Notification.Producer"; static const qcc::String AJ_NOTIFICATION_PRODUCER_PATH = "/notificationProducer"; static const qcc::String AJ_DISMISS_METHOD_NAME = "Dismiss"; static const qcc::String AJ_DISMISS_METHOD_PARAMS = "i"; static const qcc::String AJ_DISMISS_METHOD_PARAMS_NAMES = "msgId"; static const qcc::String AJ_NOTIFICATION_DISMISSER_INTERFACE = "org.alljoyn.Notification.Dismisser"; static const qcc::String AJ_DISMISS_SIGNAL_NAME = "Dismiss"; static const qcc::String AJ_DISMISS_SIGNAL_PARAMS = AJPARAM_INT + AJPARAM_ARR_BYTE; static const qcc::String AJ_DISMISS_SIGNAL_DESCRIPTION = "Notifies consumers that the notification has been dismissed."; static const qcc::String AJ_DISMISS_PARAM_NAMES = "msgId, appId"; static const int32_t AJ_DISMISSER_NUM_PARAMS = 2; static const qcc::String AJ_NOTIFICATION_DISMISSER_PATH = "/notificationDismisser"; } //namespace nsConsts } //namespace services } //namespace ajn #endif /* NOTIFICATIONCONSTANTS_H_ */ base-15.09/notification/cpp/src/NotificationDismisser.cc000066400000000000000000000101421262264444500233300ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include "NotificationDismisser.h" #include "NotificationConstants.h" #include using namespace ajn; using namespace services; using namespace nsConsts; using namespace qcc; NotificationDismisser::NotificationDismisser(ajn::BusAttachment* bus, qcc::String const& objectPath, QStatus& status) : BusObject(objectPath.c_str()), m_SignalMethod(0), m_InterfaceDescription(NULL) { m_InterfaceDescription = const_cast(bus->GetInterface(AJ_NOTIFICATION_DISMISSER_INTERFACE.c_str())); if (!m_InterfaceDescription) { if ((status = bus->CreateInterface(nsConsts::AJ_NOTIFICATION_DISMISSER_INTERFACE.c_str(), m_InterfaceDescription, false)) != ER_OK) { return; } if (!m_InterfaceDescription) { status = ER_FAIL; QCC_LogError(status, ("m_InterfaceDescription is NULL")); return; } status = m_InterfaceDescription->AddSignal(AJ_DISMISS_SIGNAL_NAME.c_str(), AJ_DISMISS_SIGNAL_PARAMS.c_str(), AJ_DISMISS_PARAM_NAMES.c_str(), 0); if (status != ER_OK) { QCC_LogError(status, ("AddSignal failed.")); return; } // Mark the signal as sessionless. status = m_InterfaceDescription->SetMemberDescription(AJ_DISMISS_SIGNAL_NAME.c_str(), AJ_DISMISS_SIGNAL_DESCRIPTION.c_str(), true); if (status != ER_OK) { QCC_LogError(status, ("SetMemberDescription failed.")); return; } status = m_InterfaceDescription->AddProperty(AJ_PROPERTY_VERSION.c_str(), AJPARAM_UINT16.c_str(), PROP_ACCESS_READ); if (status != ER_OK) { QCC_LogError(status, ("AddProperty failed.")); return; } m_InterfaceDescription->Activate(); } status = AddInterface(*m_InterfaceDescription, ANNOUNCED); if (status != ER_OK) { QCC_LogError(status, ("Could not add interface.")); return; } // Get the signal method for future use. m_SignalMethod = m_InterfaceDescription->GetMember(AJ_DISMISS_SIGNAL_NAME.c_str()); if (m_SignalMethod == NULL) { status = ER_FAIL; QCC_LogError(status, ("Could not add interface.")); return; } } NotificationDismisser::~NotificationDismisser() { } QStatus NotificationDismisser::Get(const char* ifcName, const char* propName, MsgArg& val) { QCC_UNUSED(ifcName); QCC_DbgPrintf(("Get property was called:")); if (0 != strcmp(AJ_PROPERTY_VERSION.c_str(), propName)) { QCC_LogError(ER_BUS_NO_SUCH_PROPERTY, ("Called for property different than version.")); return ER_BUS_NO_SUCH_PROPERTY; } val.typeId = ALLJOYN_UINT16; val.v_uint16 = NOTIFICATION_DISMISSER_VERSION; return ER_OK; } QStatus NotificationDismisser::Set(const char* ifcName, const char* propName, MsgArg& val) { QCC_UNUSED(ifcName); QCC_UNUSED(propName); QCC_UNUSED(val); return ER_ALLJOYN_ACCESS_PERMISSION_ERROR; } const char* NotificationDismisser::getAppId() const { return m_AppId; } base-15.09/notification/cpp/src/NotificationDismisser.h000066400000000000000000000056361262264444500232060ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONDISMISSER_H_ #define NOTIFICATIONDISMISSER_H_ #include #include #include namespace ajn { namespace services { /** * a base class to implement the dismisser interface */ class NotificationDismisser : public ajn::BusObject { public: /** * Constructor for NotificationDismisser. Creates Interface and prepares * infrastructure to be able to send Signal * @param bus - BusAttachment that is used * @param objectPath - object path name of the dismisser * @param status - success/failure */ NotificationDismisser(ajn::BusAttachment* bus, qcc::String const& objectPath, QStatus& status); /** * Destructor for NotificationDismisser */ virtual ~NotificationDismisser() = 0; /** * Callback for GetProperty * @param ifcName - interface name * @param propName - property name to get * @param val - value requested * @return status */ QStatus Get(const char* ifcName, const char* propName, ajn::MsgArg& val); /** * Callback for SetProperty * @param ifcName - interface name * @param propName - property name to set * @param val - value to set * @return status */ QStatus Set(const char* ifcName, const char* propName, ajn::MsgArg& val); /** * Get the app Id * @return appId */ const char* getAppId() const; protected: /** * The pointer used to send signal/register Signal Handler */ const ajn::InterfaceDescription::Member* m_SignalMethod; /** * message Id of the last message sent with this message type */ int32_t m_MsgId; /** * The Notification's App Id */ const char* m_AppId; /** * pointer to InterfaceDescription */ InterfaceDescription* m_InterfaceDescription; }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONDISMISSER_H_ */ base-15.09/notification/cpp/src/NotificationDismisserReceiver.cc000066400000000000000000000214361262264444500250250ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include "NotificationDismisserReceiver.h" #include "NotificationConstants.h" #include "Transport.h" #include #include #include #ifdef _WIN32 #include #endif using namespace ajn; using namespace services; using namespace nsConsts; using namespace qcc; NotificationDismisserReceiver::NotificationDismisserReceiver(BusAttachment* bus, QStatus& status) : NotificationDismisser(bus, AJ_NOTIFICATION_DISMISSER_PATH, status), m_IsStopping(false) { QCC_DbgTrace(("NotificationDismisserReceiver::NotificationDismisserReceiver() - called()")); /** * Do not add code until the status that returned from the base class is verified. */ if (status != ER_OK) { return; } #ifdef _WIN32 InitializeCriticalSection(&m_Lock); InitializeConditionVariable(&m_QueueChanged); status = bus->RegisterSignalHandler(this, static_cast(&NotificationDismisserReceiver::Signal), m_SignalMethod, NULL); if (status != ER_OK) { QCC_LogError(status, ("Could not register the SignalHandler")); } else { QCC_DbgPrintf(("Registered the SignalHandler successfully")); } m_handle = reinterpret_cast(_beginthreadex(NULL, 256 * 1024, (unsigned int (__stdcall*)(void*))ReceiverThreadWrapper, this, 0, NULL)); #else pthread_mutex_init(&m_Lock, NULL); pthread_cond_init(&m_QueueChanged, NULL); status = bus->RegisterSignalHandler(this, static_cast(&NotificationDismisserReceiver::Signal), m_SignalMethod, NULL); if (status != ER_OK) { QCC_LogError(status, ("Could not register the SignalHandler")); } else { QCC_DbgPrintf(("Registered the SignalHandler successfully")); } pthread_create(&m_ReceiverThread, NULL, ReceiverThreadWrapper, this); #endif } void NotificationDismisserReceiver::Signal(const InterfaceDescription::Member* member, const char* srcPath, Message& msg) { QCC_UNUSED(member); QCC_UNUSED(srcPath); QCC_DbgPrintf(("Received dismisser signal.")); #ifdef _WIN32 EnterCriticalSection(&m_Lock); m_MessageQueue.push(msg); WakeConditionVariable(&m_QueueChanged); LeaveCriticalSection(&m_Lock); #else pthread_mutex_lock(&m_Lock); m_MessageQueue.push(msg); pthread_cond_signal(&m_QueueChanged); pthread_mutex_unlock(&m_Lock); #endif } void NotificationDismisserReceiver::unregisterHandler(BusAttachment* bus) { #ifdef _WIN32 EnterCriticalSection(&m_Lock); while (!m_MessageQueue.empty()) { m_MessageQueue.pop(); } m_IsStopping = true; WakeConditionVariable(&m_QueueChanged); LeaveCriticalSection(&m_Lock); WaitForSingleObject(m_handle, INFINITE); CloseHandle(m_handle); bus->UnregisterSignalHandler(this, static_cast(&NotificationDismisserReceiver::Signal), m_SignalMethod, NULL); DeleteCriticalSection(&m_Lock); #else pthread_mutex_lock(&m_Lock); while (!m_MessageQueue.empty()) { m_MessageQueue.pop(); } m_IsStopping = true; pthread_cond_signal(&m_QueueChanged); pthread_mutex_unlock(&m_Lock); pthread_join(m_ReceiverThread, NULL); bus->UnregisterSignalHandler(this, static_cast(&NotificationDismisserReceiver::Signal), m_SignalMethod, NULL); pthread_cond_destroy(&m_QueueChanged); pthread_mutex_destroy(&m_Lock); #endif } void* NotificationDismisserReceiver::ReceiverThreadWrapper(void* context) { NotificationDismisserReceiver* consumer = reinterpret_cast(context); if (consumer == NULL) { // should not happen return NULL; } consumer->ReceiverThread(); return NULL; } void NotificationDismisserReceiver::ReceiverThread() { #ifdef _WIN32 EnterCriticalSection(&m_Lock); while (!m_IsStopping) { while (!m_MessageQueue.empty()) { Message message = m_MessageQueue.front(); m_MessageQueue.pop(); LeaveCriticalSection(&m_Lock); QCC_DbgPrintf(("ReceiverThread() - got a dismiss message.")); int32_t msgId; qcc::String appId; QStatus status = UnmarshalMessage(message, msgId, appId); if (status == ER_OK) { Transport::getInstance()->getNotificationReceiver()->Dismiss(msgId, appId); } EnterCriticalSection(&m_Lock); } // it's possible m_IsStopping changed while executing OnTask() (which is done unlocked) // therefore we have to check it again here, otherwise we potentially deadlock here if (!m_IsStopping) { //pthread_testcancel(); //for win only? SleepConditionVariableCS(&m_QueueChanged, &m_Lock, INFINITE); } } LeaveCriticalSection(&m_Lock); #else pthread_mutex_lock(&m_Lock); while (!m_IsStopping) { while (!m_MessageQueue.empty()) { Message message = m_MessageQueue.front(); m_MessageQueue.pop(); pthread_mutex_unlock(&m_Lock); QCC_DbgPrintf(("ReceiverThread() - got a dismiss message.")); int32_t msgId; qcc::String appId; QStatus status = UnmarshalMessage(message, msgId, appId); if (status == ER_OK) { Transport::getInstance()->getNotificationReceiver()->Dismiss(msgId, appId); } pthread_mutex_lock(&m_Lock); } // it's possible m_IsStopping changed while executing OnTask() (which is done unlocked) // therefore we have to check it again here, otherwise we potentially deadlock here if (!m_IsStopping) { pthread_cond_wait(&m_QueueChanged, &m_Lock); } } pthread_mutex_unlock(&m_Lock); #endif } QStatus NotificationDismisserReceiver::UnmarshalMessage(Message& in_message, int32_t& msgId, qcc::String& appId) { QStatus status = ER_OK; const MsgArg* messageIdArg = in_message.unwrap()->GetArg(0); const MsgArg* appIdArg = in_message.unwrap()->GetArg(1); if ((messageIdArg == NULL) || (appIdArg == NULL)) { status = ER_BAD_ARG_COUNT; return status; } //unmarshal messageid if (messageIdArg->typeId != ALLJOYN_INT32) { status = ER_BUS_BAD_VALUE_TYPE; QCC_LogError(status, ("UnmarshalMessage() - bad type to unmarshal.")); return status; } status = messageIdArg->Get(AJPARAM_INT.c_str(), &msgId); if (status != ER_OK) { QCC_LogError(status, ("UnmarshalMessage() - failed to get parameter.")); return status; } //Unmarshal appId uint8_t* appIdBin = NULL; size_t len; if (appIdArg->typeId != ALLJOYN_BYTE_ARRAY) { status = ER_BUS_BAD_VALUE_TYPE; QCC_LogError(status, ("ERROR- Problem receiving message: Can not unmarshal this array of bytes argument.")); return status; } status = appIdArg->Get(AJPARAM_ARR_BYTE.c_str(), &len, &appIdBin); if (len != UUID_LENGTH) { status = ER_BUS_BAD_VALUE; QCC_LogError(status, ("ERROR- Array of bytes length is not equal to %d but to %d", UUID_LENGTH * 2, len)); return status; } //convert bytes to qcc::String appId = BytesToHexString(appIdBin, len); return status; } base-15.09/notification/cpp/src/NotificationDismisserReceiver.h000066400000000000000000000063501262264444500246650ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONDISMISSERRECEIVER_H_ #define NOTIFICATIONDISMISSERRECEIVER_H_ #include #include #include "NotificationDismisser.h" #ifdef _WIN32 #include #define pthread_mutex_t CRITICAL_SECTION #define pthread_cond_t CONDITION_VARIABLE #else #include #endif namespace ajn { namespace services { /** * Notification Dismisser Receiver */ class NotificationDismisserReceiver : public NotificationDismisser { public: /** * Constructor for TransportConsumer * @param bus - BusAttachment that is used * @param servicePath - servicePath of BusObject * @param status - success/failure */ NotificationDismisserReceiver(ajn::BusAttachment* bus, QStatus& status); /** * Destructor of TransportConsumer */ ~NotificationDismisserReceiver() { }; /** * Callback when Signal arrives * @param member Method or signal interface member entry. * @param srcPath Object path of signal emitter. * @param message The received message. */ void Signal(const ajn::InterfaceDescription::Member* member, const char* srcPath, ajn::Message& msg); /** * To stop thread processing of messages * @param - bus attachment */ void unregisterHandler(ajn::BusAttachment* bus); private: /** * The thread responsible for receiving the notification */ #ifdef _WIN32 HANDLE m_handle; #else pthread_t m_ReceiverThread; #endif /** * A Queue that holds the messages */ std::queue m_MessageQueue; /** * The mutex Lock */ pthread_mutex_t m_Lock; /** * The Queue Changed thread condition */ pthread_cond_t m_QueueChanged; /** * is the thread in the process of shutting down */ bool m_IsStopping; /** * A wrapper for the receiver Thread * @param context */ static void* ReceiverThreadWrapper(void* context); /** * The function run in the ReceiverThread */ void ReceiverThread(); /** * unmarshal dismisser message */ QStatus UnmarshalMessage(Message& in_message, int32_t& messageId, qcc::String& appId); }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONDISMISSERRECEIVER_H_ */ base-15.09/notification/cpp/src/NotificationDismisserSender.cc000066400000000000000000000050341262264444500244750ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include "NotificationDismisserSender.h" #include "NotificationConstants.h" #include "Transport.h" #include using namespace ajn; using namespace services; using namespace nsConsts; using namespace qcc; NotificationDismisserSender::NotificationDismisserSender(BusAttachment* bus, String const& objectPath, QStatus& status) : NotificationDismisser(bus, objectPath, status) { /** * Do not add code until the status that returned from the base class is verified. */ if (status != ER_OK) { return; } //Add code here QCC_DbgPrintf(("NotificationDismisserSender() - Got objectpath=%s", objectPath.c_str())); } QStatus NotificationDismisserSender::sendSignal(ajn::MsgArg const dismisserArgs[AJ_DISMISSER_NUM_PARAMS], uint16_t ttl) { QCC_DbgTrace(("Notification::sendSignal() called")); if (m_SignalMethod == 0) { QCC_LogError(ER_BUS_INTERFACE_NO_SUCH_MEMBER, ("signalMethod not set. Can't send signal")); return ER_BUS_INTERFACE_NO_SUCH_MEMBER; } uint8_t flags = ALLJOYN_FLAG_SESSIONLESS; QStatus status = Signal(NULL, 0, *m_SignalMethod, dismisserArgs, AJ_DISMISSER_NUM_PARAMS, ttl, flags); if (status != ER_OK) { QCC_LogError(status, ("Could not send signal.")); return status; } QCC_DbgPrintf(("Sent signal successfully")); return status; } base-15.09/notification/cpp/src/NotificationDismisserSender.h000066400000000000000000000042631262264444500243420ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONDISMISSERSENDER_H_ #define NOTIFICATIONDISMISSERSENDER_H_ #include #include "NotificationDismisser.h" #include "NotificationConstants.h" namespace ajn { namespace services { /** * Implementing the sender side of the dismiss signal in dismisser interface */ class NotificationDismisserSender : public NotificationDismisser { public: /** * Constructor for TransportProducer. Creates Interface and prepares * infrastructure to be able to send Signal * @param bus - BusAttachment that is used * @param objectPath - Object path name of the dismisser * @param status - success/failure */ NotificationDismisserSender(ajn::BusAttachment* bus, qcc::String const& objectPath, QStatus& status); /** * Destructor for TransportProducer */ ~NotificationDismisserSender() { }; /** * Send Signal over Bus. * @param notificationArgs * @param ttl * @return status */ QStatus sendSignal(ajn::MsgArg const dismisserArgs[nsConsts::AJ_DISMISSER_NUM_PARAMS], uint16_t ttl); }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONDISMISSERSENDER_H_ */ base-15.09/notification/cpp/src/NotificationEnums.cc000066400000000000000000000027661262264444500224720ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include using namespace ajn; using namespace services; const qcc::String MessageTypeUtil::MESSAGE_TYPE_STRINGS[3] = { "emergency", "warning", "info" }; qcc::String const& MessageTypeUtil::getMessageTypeString(int32_t messageType) { return MESSAGE_TYPE_STRINGS[messageType]; } NotificationMessageType MessageTypeUtil::getMessageType(int32_t messageType) { return (NotificationMessageType) messageType; } int32_t MessageTypeUtil::getNumMessageTypes() { return (int32_t) MESSAGE_TYPE_CNT; } base-15.09/notification/cpp/src/NotificationProducer.cc000066400000000000000000000071431262264444500231600ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include "NotificationProducer.h" #include #include #include "NotificationConstants.h" #include #include using namespace ajn; using namespace services; using namespace qcc; using namespace nsConsts; NotificationProducer::NotificationProducer(ajn::BusAttachment* bus, QStatus& status) : BusObject(AJ_NOTIFICATION_PRODUCER_PATH.c_str()), m_InterfaceDescription(NULL), m_BusAttachment(bus) { m_InterfaceDescription = const_cast(m_BusAttachment->GetInterface(AJ_NOTIFICATION_PRODUCER_INTERFACE.c_str())); if (!m_InterfaceDescription) { status = m_BusAttachment->CreateInterface(nsConsts::AJ_NOTIFICATION_PRODUCER_INTERFACE.c_str(), m_InterfaceDescription, false); if (status != ER_OK) { QCC_LogError(status, ("CreateInterface failed")); return; } if (!m_InterfaceDescription) { status = ER_FAIL; QCC_LogError(status, ("m_InterfaceDescription is NULL")); return; } status = m_InterfaceDescription->AddMethod(AJ_DISMISS_METHOD_NAME.c_str(), AJ_DISMISS_METHOD_PARAMS.c_str(), NULL, AJ_DISMISS_METHOD_PARAMS_NAMES.c_str()); if (status != ER_OK) { QCC_LogError(status, ("AddMethod failed.")); return; } status = m_InterfaceDescription->AddProperty(AJ_PROPERTY_VERSION.c_str(), AJPARAM_UINT16.c_str(), (uint8_t) PROP_ACCESS_READ); if (status != ER_OK) { QCC_LogError(status, ("AddMethod failed.")); return; } m_InterfaceDescription->Activate(); } status = AddInterface(*m_InterfaceDescription, ANNOUNCED); if (status != ER_OK) { QCC_LogError(status, ("AddInterface failed.")); return; } } NotificationProducer::~NotificationProducer() { } QStatus NotificationProducer::Get(const char* ifcName, const char* propName, MsgArg& val) { QCC_UNUSED(ifcName); QCC_DbgTrace(("Get property was called.")); if (0 != strcmp(AJ_PROPERTY_VERSION.c_str(), propName)) { QCC_LogError(ER_BUS_NO_SUCH_PROPERTY, ("Called for property different than version.")); return ER_BUS_NO_SUCH_PROPERTY; } val.typeId = ALLJOYN_UINT16; val.v_uint16 = NOTIFICATION_PRODUCER_VERSION; return ER_OK; } QStatus NotificationProducer::Set(const char* ifcName, const char* propName, MsgArg& val) { QCC_UNUSED(ifcName); QCC_UNUSED(propName); QCC_UNUSED(val); return ER_ALLJOYN_ACCESS_PERMISSION_ERROR; } base-15.09/notification/cpp/src/NotificationProducer.h000066400000000000000000000050061262264444500230160ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONPRODUCER_H_ #define NOTIFICATIONPRODUCER_H_ #include namespace ajn { namespace services { /** * NotificationProducer * This class has method to dismiss the notification. * The producer will send dismiss signal to notify other entities. */ class NotificationProducer : public ajn::BusObject { public: /** * Constructor for NotificationProducer. Creates Interface and prepares * infrastructure to be able to send Signal * @param bus - BusAttachment that is used * @param status - success/failure */ NotificationProducer(ajn::BusAttachment* bus, QStatus& status); /** * Destructor for NotificationTransport */ virtual ~NotificationProducer() = 0; /** * Callback for GetProperty * @param ifcName - interface name * @param propName - property name to get * @param val - value requested * @return status */ QStatus Get(const char* ifcName, const char* propName, MsgArg& val); /** * Callback for SetProperty * @param ifcName - interface name * @param propName - property name to set * @param val - value to set * @return status */ QStatus Set(const char* ifcName, const char* propName, MsgArg& val); protected: /** * pointer to InterfaceDescription */ InterfaceDescription* m_InterfaceDescription; /** * pointer to BusAttachment */ ajn::BusAttachment* m_BusAttachment; private: }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONPRODUCER_H_ */ base-15.09/notification/cpp/src/NotificationProducerListener.cc000066400000000000000000000045431262264444500246670ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include "NotificationProducerListener.h" #include #include #include #include "NotificationConstants.h" #include using namespace ajn; using namespace services; using namespace qcc; using namespace nsConsts; NotificationProducerListener::NotificationProducerListener() : SessionPortListener(), m_SessionPort(0) { } NotificationProducerListener::~NotificationProducerListener() { } void NotificationProducerListener::setSessionPort(ajn::SessionPort sessionPort) { m_SessionPort = sessionPort; } SessionPort NotificationProducerListener::getSessionPort() { return m_SessionPort; } bool NotificationProducerListener::AcceptSessionJoiner(ajn::SessionPort sessionPort, const char* joiner, const ajn::SessionOpts& opts) { QCC_UNUSED(joiner); //joiner only used in debug build not release QCC_UNUSED(opts); if (sessionPort != m_SessionPort) { return false; } QCC_DbgPrintf(("NotificationProducerListener::AcceptSessionJoiner() sessionPort=%hu joiner:%s", sessionPort, joiner)); return true; } void NotificationProducerListener::SessionJoined(SessionPort sessionPort, SessionId sessionId, const char* joiner) { QCC_UNUSED(sessionPort); QCC_UNUSED(sessionId); QCC_UNUSED(joiner); } base-15.09/notification/cpp/src/NotificationProducerListener.h000066400000000000000000000050241262264444500245240ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONPRODUCERLISTENER_H_ #define NOTIFICATIONPRODUCERLISTENER_H_ #include #include #include namespace ajn { namespace services { /** * Class that implements SessionPortListener and SessionListener */ class NotificationProducerListener : public SessionPortListener { public: /** * Constructor of NotificationProducerListener */ NotificationProducerListener(); /** * Destructor of NotificationProducerListener */ ~NotificationProducerListener(); /** * Set the Value of the SessionPort associated with this SessionPortListener * @param sessionPort */ void setSessionPort(SessionPort sessionPort); /** * Get the SessionPort of the listener * @return */ SessionPort getSessionPort(); /** * AcceptSessionJoiner - Receive request to join session and decide whether to accept it or not * @param sessionPort - the port of the request * @param joiner - the name of the joiner * @param opts - the session options * @return true/false */ bool AcceptSessionJoiner(SessionPort sessionPort, const char* joiner, const SessionOpts& opts); /** * SessionJoined * @param sessionPort * @param sessionId * @param joiner */ void SessionJoined(SessionPort sessionPort, SessionId sessionId, const char* joiner); private: /** * The port used as part of the join session request */ SessionPort m_SessionPort; }; } } #endif /* NOTIFICATIONPRODUCERLISTENER_H_ */ base-15.09/notification/cpp/src/NotificationProducerReceiver.cc000066400000000000000000000225431262264444500246460ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include "NotificationProducerReceiver.h" #include "Transport.h" #include "NotificationConstants.h" #include #include #include #include "NotificationDismisserSender.h" #include #include #ifdef _WIN32 #include #endif using namespace ajn; using namespace services; using namespace qcc; using namespace nsConsts; NotificationProducerReceiver::NotificationProducerReceiver(ajn::BusAttachment* bus, QStatus& status) : NotificationProducer(bus, status), m_IsStopping(false) { /** * Do not add code until the status that returned from the base class is verified. */ if (status != ER_OK) { return; } status = AddMethodHandler(m_InterfaceDescription->GetMember(AJ_DISMISS_METHOD_NAME.c_str()), static_cast(&NotificationProducerReceiver::Dismiss)); if (status != ER_OK) { QCC_LogError(status, ("AddMethodHandler failed.")); return; } #ifdef _WIN32 InitializeCriticalSection(&m_Lock); InitializeConditionVariable(&m_QueueChanged); m_handle = reinterpret_cast(_beginthreadex(NULL, 256 * 1024, (unsigned int (__stdcall*)(void*))ReceiverThreadWrapper, this, 0, NULL)); #else pthread_mutex_init(&m_Lock, NULL); pthread_cond_init(&m_QueueChanged, NULL); pthread_create(&m_ReceiverThread, NULL, ReceiverThreadWrapper, this); #endif } NotificationProducerReceiver::~NotificationProducerReceiver() { QCC_DbgTrace(("start")); QCC_DbgTrace(("end")); } void NotificationProducerReceiver::unregisterHandler(BusAttachment* bus) { QCC_UNUSED(bus); #ifdef _WIN32 EnterCriticalSection(&m_Lock); while (!m_MessageQueue.empty()) { m_MessageQueue.pop(); } m_IsStopping = true; WakeConditionVariable(&m_QueueChanged); LeaveCriticalSection(&m_Lock); WaitForSingleObject(m_handle, INFINITE); CloseHandle(m_handle); DeleteCriticalSection(&m_Lock); #else pthread_mutex_lock(&m_Lock); while (!m_MessageQueue.empty()) { m_MessageQueue.pop(); } m_IsStopping = true; pthread_cond_signal(&m_QueueChanged); pthread_mutex_unlock(&m_Lock); pthread_join(m_ReceiverThread, NULL); pthread_cond_destroy(&m_QueueChanged); pthread_mutex_destroy(&m_Lock); #endif } void* NotificationProducerReceiver::ReceiverThreadWrapper(void* context) { QCC_DbgTrace(("NotificationProducerReceiver::ReceiverThreadWrapper()")); NotificationProducerReceiver* pNotificationProducerReceiver = reinterpret_cast(context); if (pNotificationProducerReceiver == NULL) { // should not happen return NULL; } pNotificationProducerReceiver->Receiver(); return NULL; } void NotificationProducerReceiver::Dismiss(const ajn::InterfaceDescription::Member* member, ajn::Message& msg) { QCC_DbgTrace(("NotificationProducerReceiver::Dismiss()")); HandleMethodCall(member, msg); } void NotificationProducerReceiver::HandleMethodCall(const ajn::InterfaceDescription::Member* member, ajn::Message& msg) { QCC_UNUSED(member); QCC_DbgTrace(("NotificationProducerReceiver::HandleMethodCall()")); const ajn::MsgArg* args = 0; size_t numArgs = 0; QStatus status = ER_OK; msg->GetArgs(numArgs, args); if (numArgs != 1) { status = ER_INVALID_DATA; goto exit; } int32_t msgId; status = args[0].Get(AJPARAM_INT.c_str(), &msgId); if (status != ER_OK) { goto exit; } QCC_DbgPrintf(("msgId:%d", msgId)); MethodReply(msg, args, 0); #ifdef _WIN32 EnterCriticalSection(&m_Lock); { MsgQueueContent msgQueueContent(msgId); m_MessageQueue.push(msgQueueContent); QCC_DbgPrintf(("HandleMethodCall() - message pushed")); } WakeConditionVariable(&m_QueueChanged); LeaveCriticalSection(&m_Lock); #else pthread_mutex_lock(&m_Lock); { MsgQueueContent msgQueueContent(msgId); m_MessageQueue.push(msgQueueContent); QCC_DbgPrintf(("HandleMethodCall() - message pushed")); } pthread_cond_signal(&m_QueueChanged); pthread_mutex_unlock(&m_Lock); #endif exit: if (status != ER_OK) { MethodReply(msg, ER_INVALID_DATA); QCC_LogError(status, ("")); } } void NotificationProducerReceiver::Receiver() { #ifdef _WIN32 EnterCriticalSection(&m_Lock); while (!m_IsStopping) { while (!m_MessageQueue.empty()) { MsgQueueContent message = m_MessageQueue.front(); m_MessageQueue.pop(); QCC_DbgPrintf(("NotificationProducerReceiver::ReceiverThread() - got a message.")); LeaveCriticalSection(&m_Lock); Transport::getInstance()->deleteMsg(message.m_MsgId); sendDismissSignal(message.m_MsgId); EnterCriticalSection(&m_Lock); } // it's possible m_IsStopping changed while executing OnTask() (which is done unlocked) // therefore we have to check it again here, otherwise we potentially deadlock here if (!m_IsStopping) { //pthread_testcancel(); //for win only? SleepConditionVariableCS(&m_QueueChanged, &m_Lock, INFINITE); } } LeaveCriticalSection(&m_Lock); #else pthread_mutex_lock(&m_Lock); while (!m_IsStopping) { while (!m_MessageQueue.empty()) { MsgQueueContent message = m_MessageQueue.front(); m_MessageQueue.pop(); QCC_DbgPrintf(("NotificationProducerReceiver::ReceiverThread() - got a message.")); pthread_mutex_unlock(&m_Lock); Transport::getInstance()->deleteMsg(message.m_MsgId); sendDismissSignal(message.m_MsgId); pthread_mutex_lock(&m_Lock); } // it's possible m_IsStopping changed while executing OnTask() (which is done unlocked) // therefore we have to check it again here, otherwise we potentially deadlock here if (!m_IsStopping) { pthread_cond_wait(&m_QueueChanged, &m_Lock); } } pthread_mutex_unlock(&m_Lock); #endif } QStatus NotificationProducerReceiver::sendDismissSignal(int32_t msgId) { QCC_DbgTrace(("Notification::sendDismissSignal() called")); QStatus status; MsgArg msgIdArg; msgIdArg.Set(nsConsts::AJPARAM_INT.c_str(), msgId); MsgArg dismisserArgs[nsConsts::AJ_DISMISSER_NUM_PARAMS]; dismisserArgs[0] = msgIdArg; dismisserArgs[1] = m_AppIdArg; /**Code commented below is for future use * In case dismiss signal will not need to be sent via different object path each time. * In that case enable code below and disable next paragraph. * * Transport::getInstance()->getNotificationDismisserSender()->sendSignal(dismisserArgs,nsConsts::TTL_MAX); * if (status != ER_OK) { * QCC_LogError(status,"NotificationAsyncTaskEvents", "sendSignal failed."); * return; * } * * End of paragraph */ /* * Paragraph to be disabled in case dismiss signal will not need to be sent via different object path each time */ String appId; uint8_t* appIdBin; size_t len; m_AppIdArg.Get(AJPARAM_ARR_BYTE.c_str(), &len, &appIdBin); appId = BytesToHexString(appIdBin, len); std::ostringstream stm; stm << abs(msgId); qcc::String objectPath = nsConsts::AJ_NOTIFICATION_DISMISSER_PATH + "/" + appId + "/" + std::string(stm.str()).c_str(); NotificationDismisserSender notificationDismisserSender(Transport::getInstance()->getBusAttachment(), objectPath, status); if (status != ER_OK) { QCC_LogError(status, ("Could not create NotificationDismisserSender.")); } status = Transport::getInstance()->getBusAttachment()->RegisterBusObject(notificationDismisserSender); if (status != ER_OK) { QCC_LogError(status, ("Could not register NotificationDismisserSender.")); return status; } QCC_DbgPrintf(("sendDismissSignal: going to send dismiss signal with object path %s", objectPath.c_str())); status = notificationDismisserSender.sendSignal(dismisserArgs, nsConsts::TTL_MAX); if (status != ER_OK) { QCC_LogError(status, ("Failed to sendSignal")); return status; } Transport::getInstance()->getBusAttachment()->UnregisterBusObject(notificationDismisserSender); /* * End of paragraph */ return status; } base-15.09/notification/cpp/src/NotificationProducerReceiver.h000066400000000000000000000070101262264444500245000ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONPRODUCERRECEIVER_H_ #define NOTIFICATIONPRODUCERRECEIVER_H_ #include "NotificationProducer.h" #include #ifdef _WIN32 #include #define pthread_mutex_t CRITICAL_SECTION #define pthread_cond_t CONDITION_VARIABLE #else #include #endif namespace ajn { namespace services { /** * class MsgQueueContent * */ class MsgQueueContent { public: MsgQueueContent(uint32_t msgId) : m_MsgId(msgId) { } uint32_t m_MsgId; }; /** * class NotificationProducerReceiver * Implements NotificationProducer interface at producer side */ class NotificationProducerReceiver : public ajn::services::NotificationProducer { public: /** * constructor of NotificationProducerReceiver * @param bus attachment * @param status */ NotificationProducerReceiver(ajn::BusAttachment* bus, QStatus& status); /** * destructor of NotificationProducerReceiver */ ~NotificationProducerReceiver(); /** * Handles Dismiss method * @param[in] member * @param[in] msg reference of AllJoyn Message */ void Dismiss(const ajn::InterfaceDescription::Member* member, ajn::Message& msg); /** * SetAppIdArg * @param application id argument */ void SetAppIdArg(MsgArg appIdArg) { m_AppIdArg = appIdArg; } /** * unregisterHandler * @param bus attachment */ void unregisterHandler(BusAttachment* bus); private: /** * implement method calls from notification producer interface */ void HandleMethodCall(const ajn::InterfaceDescription::Member* member, ajn::Message& msg); /** * The thread responsible for receiving the notification */ #ifdef _WIN32 HANDLE m_handle; #else pthread_t m_ReceiverThread; #endif /** * A Queue that holds the messages */ std::queue m_MessageQueue; /** * The mutex Lock */ pthread_mutex_t m_Lock; /** * The Queue Changed thread condition */ pthread_cond_t m_QueueChanged; /** * is the thread in the process of shutting down */ bool m_IsStopping; /** * A wrapper for the receiver Thread * @param context */ static void* ReceiverThreadWrapper(void* context); /** * The function run in the ReceiverThread */ void Receiver(); /** * sendDismissSignal */ QStatus sendDismissSignal(int32_t msgId); /** * appIdArg */ MsgArg m_AppIdArg; }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONPRODUCERRECEIVER_H_ */ base-15.09/notification/cpp/src/NotificationProducerSender.cc000066400000000000000000000056131262264444500243210ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include "NotificationProducerSender.h" #include "Transport.h" #include "NotificationConstants.h" #include #include using namespace ajn; using namespace services; using namespace qcc; using namespace nsConsts; NotificationProducerSender::NotificationProducerSender(ajn::BusAttachment* bus, QStatus& status) : NotificationProducer(bus, status) { /** * Do not add code until the status that returned from the base class is verified. */ if (status != ER_OK) { return; } } NotificationProducerSender::~NotificationProducerSender() { } QStatus NotificationProducerSender::Dismiss(const char* busName, ajn::SessionId sessionId, int32_t mgsId) { QCC_DbgPrintf(("NotificationProducerSender::Dismiss busName:%s sessionId:%u mgsId:%d", busName, sessionId, mgsId)); QStatus status = ER_OK; if (!m_InterfaceDescription) { return ER_FAIL; } ProxyBusObject*proxyBusObj = new ProxyBusObject(*m_BusAttachment, busName, AJ_NOTIFICATION_PRODUCER_PATH.c_str(), sessionId); if (!proxyBusObj) { return ER_FAIL; } status = proxyBusObj->AddInterface(*m_InterfaceDescription); if (status != ER_OK) { QCC_LogError(status, ("MethodCallDismiss - AddInterface.")); delete proxyBusObj; proxyBusObj = NULL; return status; } MsgArg args[1]; Message replyMsg(*m_BusAttachment); args[0].Set(AJPARAM_INT.c_str(), mgsId); status = proxyBusObj->MethodCall(AJ_NOTIFICATION_PRODUCER_INTERFACE.c_str(), AJ_DISMISS_METHOD_NAME.c_str(), args, 1, replyMsg); if (status != ER_OK) { QCC_LogError(status, ("MethodCallDismiss - MethodCall.")); delete proxyBusObj; proxyBusObj = NULL; return status; } delete proxyBusObj; proxyBusObj = NULL; return status; } base-15.09/notification/cpp/src/NotificationProducerSender.h000066400000000000000000000036551262264444500241670ustar00rootroot00000000000000 /****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONPRODUCERSENDER_H_ #define NOTIFICATIONPRODUCERSENDER_H_ #include "NotificationProducer.h" namespace ajn { namespace services { /** * NotificationProducerSender class * Calls NotificationProducer interface methods */ class NotificationProducerSender : public ajn::services::NotificationProducer { public: /** * constructor of NotificationProducerSender * @param bus attachment * @param status */ NotificationProducerSender(ajn::BusAttachment* bus, QStatus& status); /** * destructor of NotificationProducerSender */ ~NotificationProducerSender(); /* * calls method Dismiss at the producer side * @param bus attachment * @param relevant session id * @param elevant message id * @return status */ QStatus Dismiss(const char* busName, ajn::SessionId sessionId, int32_t mgsId); private: }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONPRODUCERSENDER_H_ */ base-15.09/notification/cpp/src/NotificationReceiver.cc000066400000000000000000000021401262264444500231310ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include base-15.09/notification/cpp/src/NotificationSender.cc000066400000000000000000000111571262264444500226150ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include #include "PayloadAdapter.h" #include "Transport.h" #include "NotificationConstants.h" #include #include using namespace ajn; using namespace services; using namespace nsConsts; using namespace qcc; NotificationSender::NotificationSender(AboutData* aboutdata) : m_aboutdata(aboutdata), m_PropertyStore(NULL) { } NotificationSender::NotificationSender(PropertyStore* propertyStore) : m_aboutdata(NULL), m_PropertyStore(propertyStore) { } QStatus NotificationSender::send(Notification const& notification, uint16_t ttl) { QCC_DbgTrace(("Send Message called")); //Validations if (notification.getMessageType() < 0 || notification.getMessageType() >= MESSAGE_TYPE_CNT) { QCC_LogError(ER_BAD_ARG_1, ("MessageType sent is not a valid MessageType")); return ER_BAD_ARG_1; } if (notification.getText().size() == 0) { QCC_LogError(ER_BAD_ARG_1, ("There must be at least one notification defined")); return ER_BAD_ARG_1; } else if ((TTL_MIN > ttl) || (ttl > TTL_MAX)) { // ttl value is not in range QCC_LogError(ER_BAD_ARG_2, ("TTL sent is not a valid TTL value")); return ER_BAD_ARG_2; } ajn::BusAttachment* pBus = Transport::getInstance()->getBusAttachment(); String originalSender = pBus ? pBus->GetUniqueName() : ""; if (m_aboutdata) { return PayloadAdapter::sendPayload(m_aboutdata, notification.getMessageType(), notification.getText(), notification.getCustomAttributes(), ttl, notification.getRichIconUrl(), notification.getRichAudioUrl(), notification.getRichIconObjectPath(), notification.getRichAudioObjectPath(), notification.getControlPanelServiceObjectPath(), originalSender.c_str()); } if (m_PropertyStore) { return PayloadAdapter::sendPayload(m_PropertyStore, notification.getMessageType(), notification.getText(), notification.getCustomAttributes(), ttl, notification.getRichIconUrl(), notification.getRichAudioUrl(), notification.getRichIconObjectPath(), notification.getRichAudioObjectPath(), notification.getControlPanelServiceObjectPath(), originalSender.c_str()); } return ER_FAIL; } QStatus NotificationSender::deleteLastMsg(NotificationMessageType messageType) { QCC_DbgTrace(("Delete Last Message called")); //Validation if (messageType < 0 || messageType >= MESSAGE_TYPE_CNT) { QCC_LogError(ER_BAD_ARG_1, ("MessageType sent is not a valid MessageType")); return ER_BAD_ARG_1; } Transport* transport = Transport::getInstance(); return transport->deleteLastMsg(messageType); } QStatus NotificationSender::getLastMsgId(NotificationMessageType messageType, int32_t* messageId) { QCC_DbgTrace(("Get Last Message Id called")); if (messageType < 0 || messageType >= MESSAGE_TYPE_CNT) { QCC_LogError(ER_BAD_ARG_1, ("MessageType sent is not a valid MessageType")); return ER_BAD_ARG_1; } Transport* transport = Transport::getInstance(); return transport->getLastMsgId(messageType, messageId); } base-15.09/notification/cpp/src/NotificationService.cc000066400000000000000000000156541262264444500230030ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include #include "NotificationConstants.h" #include "Transport.h" #include "NotificationProducerReceiver.h" #include using namespace ajn; using namespace services; using namespace qcc; using namespace nsConsts; NotificationService* NotificationService::s_Instance(NULL); uint16_t const NotificationService::NOTIFICATION_SERVICE_VERSION = 2; NotificationService* NotificationService::getInstance() { if (!s_Instance) { s_Instance = new NotificationService(); } return s_Instance; } NotificationService::NotificationService() { } NotificationService::~NotificationService() { } uint16_t NotificationService::getVersion() { return NOTIFICATION_SERVICE_VERSION; } NotificationSender* NotificationService::initSend(BusAttachment* bus, AboutData* store) { QCC_DbgTrace(("NotificationService::initSend")); if (!bus) { QCC_DbgHLPrintf(("BusAttachment cannot be NULL")); return NULL; } if (!store) { QCC_DbgHLPrintf(("PropertyStore cannot be NULL")); return NULL; } Transport* transport = Transport::getInstance(); if (transport->startSenderTransport(bus) != ER_OK) { return NULL; } MsgArg configArgs; MsgArg* configEntries; size_t configNum = 0; QStatus status; if ((status = store->GetAboutData(&configArgs))) { QCC_LogError(status, ("Error reading all in configuration data")); return NULL; } if ((status = configArgs.Get(AJPARAM_ARR_DICT_STR_VAR.c_str(), &configNum, &configEntries))) { QCC_LogError(status, ("Error reading in configuration data")); return NULL; } MsgArg appIdArg; for (size_t i = 0; i < configNum; i++) { char* keyChar; String key; MsgArg* variant; status = configEntries[i].Get(AJPARAM_DICT_STR_VAR.c_str(), &keyChar, &variant); if (status != ER_OK) { QCC_LogError(status, ("Error reading in configuration data")); return NULL; } key = keyChar; if (key.compare("AppId") == 0) { appIdArg = *variant; } } if (status != ER_OK) { QCC_LogError(status, ("Something went wrong unmarshalling the propertystore.")); return NULL; } if (appIdArg.typeId != ALLJOYN_BYTE_ARRAY) { QCC_DbgHLPrintf(("ApplicationId argument is not correct type.")); return NULL; } transport->getNotificationProducerReceiver()->SetAppIdArg(appIdArg); return new NotificationSender(store); } NotificationSender* NotificationService::initSend(BusAttachment* bus, PropertyStore* store) { QCC_DbgTrace(("NotificationService::initSend")); if (!bus) { QCC_DbgHLPrintf(("BusAttachment cannot be NULL")); return NULL; } if (!store) { QCC_DbgHLPrintf(("PropertyStore cannot be NULL")); return NULL; } Transport* transport = Transport::getInstance(); if (transport->startSenderTransport(bus) != ER_OK) { return NULL; } MsgArg configArgs[1]; MsgArg* configEntries; size_t configNum = 0; QStatus status; if ((status = store->ReadAll(0, PropertyStore::READ, configArgs[0]))) { QCC_LogError(status, ("Error reading all in configuration data")); return NULL; } if ((status = configArgs[0].Get(AJPARAM_ARR_DICT_STR_VAR.c_str(), &configNum, &configEntries))) { QCC_LogError(status, ("Error reading in configuration data")); return NULL; } MsgArg appIdArg; for (size_t i = 0; i < configNum; i++) { char* keyChar; String key; MsgArg* variant; status = configEntries[i].Get(AJPARAM_DICT_STR_VAR.c_str(), &keyChar, &variant); if (status != ER_OK) { QCC_LogError(status, ("Error reading in configuration data")); return NULL; } key = keyChar; if (key.compare("AppId") == 0) { appIdArg = *variant; } } if (status != ER_OK) { QCC_LogError(status, ("Something went wrong unmarshalling the propertystore.")); return NULL; } if (appIdArg.typeId != ALLJOYN_BYTE_ARRAY) { QCC_DbgHLPrintf(("ApplicationId argument is not correct type.")); return NULL; } transport->getNotificationProducerReceiver()->SetAppIdArg(appIdArg); return new NotificationSender(store); } QStatus NotificationService::initReceive(ajn::BusAttachment* bus, NotificationReceiver* notificationReceiver) { if (!bus) { QCC_LogError(ER_BAD_ARG_1, ("BusAttachment cannot be NULL.")); return ER_BAD_ARG_1; } if (!notificationReceiver) { QCC_LogError(ER_BAD_ARG_2, ("Could not set NotificationReceiver to null pointer")); return ER_BAD_ARG_2; } QCC_DbgPrintf(("Init receive")); Transport* transport = Transport::getInstance(); transport->setNotificationReceiver(notificationReceiver); QStatus status; if ((status = transport->startReceiverTransport(bus)) != ER_OK) { transport->setNotificationReceiver(0); } return status; } void NotificationService::shutdownSender() { QCC_DbgTrace(("Stop Sender")); Transport* transport = Transport::getInstance(); transport->cleanupSenderTransport(); } void NotificationService::shutdownReceiver() { QCC_DbgTrace(("Stop Receiver")); Transport* transport = Transport::getInstance(); transport->cleanupReceiverTransport(); } void NotificationService::shutdown() { QCC_DbgTrace(("Shutdown")); Transport* transport = Transport::getInstance(); transport->cleanup(); s_Instance = 0; delete this; } BusAttachment* NotificationService::getBusAttachment() { QCC_DbgTrace(("In Get BusAttachment")); Transport* transport = Transport::getInstance(); return transport->getBusAttachment(); } base-15.09/notification/cpp/src/NotificationText.cc000066400000000000000000000030101262264444500223060ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include using namespace ajn; using namespace services; using namespace qcc; NotificationText::NotificationText(String const& language, String const& text) { m_Language = language; m_Text = text; } void NotificationText::setLanguage(String const& language) { m_Language = language; } String const& NotificationText::getLanguage() const { return m_Language; } void NotificationText::setText(String const& text) { m_Text = text; } String const& NotificationText::getText() const { return m_Text; } base-15.09/notification/cpp/src/NotificationTransport.cc000066400000000000000000000074721262264444500233760ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include "NotificationTransport.h" #include "NotificationConstants.h" #include using namespace ajn; using namespace services; using namespace nsConsts; using namespace qcc; NotificationTransport::NotificationTransport(ajn::BusAttachment* bus, qcc::String const& servicePath, QStatus& status, String const& interfaceName) : BusObject(servicePath.c_str()), m_SignalMethod(0) { InterfaceDescription* intf = NULL; status = bus->CreateInterface(interfaceName.c_str(), intf); if (status == ER_OK) { status = intf->AddSignal(AJ_SIGNAL_METHOD.c_str(), AJ_NOTIFY_PARAMS.c_str(), AJ_NOTIFY_PARAM_NAMES.c_str(), 0); if (status != ER_OK) { QCC_LogError(status, ("AddSignal failed.")); return; } // Mark the signal as sessionless. status = intf->SetMemberDescription(AJ_SIGNAL_METHOD.c_str(), AJ_NOTIFY_SIGNAL_DESCRIPTION.c_str(), true); if (status != ER_OK) { QCC_LogError(status, ("SetMemberDescription failed.")); return; } status = intf->AddProperty(AJ_PROPERTY_VERSION.c_str(), AJPARAM_UINT16.c_str(), PROP_ACCESS_READ); if (status != ER_OK) { QCC_LogError(status, ("AddProperty failed.")); return; } intf->Activate(); } else if (status == ER_BUS_IFACE_ALREADY_EXISTS) { intf = (InterfaceDescription*) bus->GetInterface(interfaceName.c_str()); if (!intf) { status = ER_BUS_UNKNOWN_INTERFACE; QCC_LogError(status, ("Could not get interface")); return; } } else { QCC_LogError(status, ("Could not create interface")); return; } status = AddInterface(*intf, ANNOUNCED); if (status != ER_OK) { QCC_LogError(status, ("Could not add interface")); return; } // Get the signal method for future use m_SignalMethod = intf->GetMember(AJ_SIGNAL_METHOD.c_str()); } NotificationTransport::~NotificationTransport() { } QStatus NotificationTransport::Get(const char* ifcName, const char* propName, MsgArg& val) { QCC_UNUSED(ifcName); QCC_DbgTrace(("Get property was called")); if (0 != strcmp(AJ_PROPERTY_VERSION.c_str(), propName)) { QCC_LogError(ER_BUS_NO_SUCH_PROPERTY, ("Called for property different than version.")); return ER_BUS_NO_SUCH_PROPERTY; } val.typeId = ALLJOYN_UINT16; val.v_uint16 = NotificationService::getVersion(); return ER_OK; } QStatus NotificationTransport::Set(const char* ifcName, const char* propName, MsgArg& val) { QCC_UNUSED(ifcName); QCC_UNUSED(propName); QCC_UNUSED(val); return ER_ALLJOYN_ACCESS_PERMISSION_ERROR; } base-15.09/notification/cpp/src/NotificationTransport.h000066400000000000000000000050221262264444500232250ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONTRANSPORT_H_ #define NOTIFICATIONTRANSPORT_H_ #include #include #include namespace ajn { namespace services { /** * A class implementing the BusObject used to create the Notification interface * and register it on the bus */ class NotificationTransport : public ajn::BusObject { public: /** * Constructor for NotificationTransport. Creates Interface and prepares * infrastructure to be able to send Signal * @param bus - BusAttachment that is used * @param servicePath - servicePath of BusObject * @param status - success/failure */ NotificationTransport(ajn::BusAttachment* bus, qcc::String const& servicePath, QStatus& status, qcc::String const& interfaceName); /** * Destructor for NotificationTransport */ virtual ~NotificationTransport() = 0; /** * Callback for GetProperty * @param ifcName * @param propName * @param val * @return */ QStatus Get(const char* ifcName, const char* propName, ajn::MsgArg& val); /** * Callback for SetProperty * @param ifcName * @param propName * @param val * @return */ QStatus Set(const char* ifcName, const char* propName, ajn::MsgArg& val); protected: /** * The pointer used to send signal/register Signal Handler */ const ajn::InterfaceDescription::Member* m_SignalMethod; }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONTRANSPORT_H_ */ base-15.09/notification/cpp/src/NotificationTransportConsumer.cc000066400000000000000000000147521262264444500251110ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include "NotificationTransportConsumer.h" #include "NotificationConstants.h" #include "PayloadAdapter.h" #include #ifdef _WIN32 #include #endif using namespace ajn; using namespace services; using namespace nsConsts; using namespace qcc; NotificationTransportConsumer::NotificationTransportConsumer( BusAttachment* bus, String const& servicePath, QStatus& status) : NotificationTransport(bus, servicePath, status, AJ_NOTIFICATION_INTERFACE_NAME), m_IsStopping(false) { if (status != ER_OK) { return; } #ifdef _WIN32 InitializeCriticalSection(&m_Lock); InitializeConditionVariable(&m_QueueChanged); status = bus->RegisterSignalHandler(this, static_cast(&NotificationTransportConsumer::handleSignal), m_SignalMethod, NULL); if (status != ER_OK) { QCC_LogError(status, ("Could not register the SignalHandler")); } else { QCC_DbgPrintf(("Registered the SignalHandler successfully")); } m_handle = reinterpret_cast(_beginthreadex(NULL, 256 * 1024, (unsigned int (__stdcall*)(void*))ReceiverThreadWrapper, this, 0, NULL)); #else pthread_mutex_init(&m_Lock, NULL); pthread_cond_init(&m_QueueChanged, NULL); status = bus->RegisterSignalHandler(this, static_cast(&NotificationTransportConsumer::handleSignal), m_SignalMethod, NULL); if (status != ER_OK) { QCC_LogError(status, ("Could not register the SignalHandler")); } else { QCC_DbgPrintf(("Registered the SignalHandler successfully")); } pthread_create(&m_ReceiverThread, NULL, ReceiverThreadWrapper, this); #endif } void NotificationTransportConsumer::handleSignal(const InterfaceDescription::Member* member, const char* srcPath, Message& msg) { QCC_UNUSED(member); QCC_UNUSED(srcPath); QCC_DbgPrintf(("Received Message from producer.")); #ifdef _WIN32 EnterCriticalSection(&m_Lock); m_MessageQueue.push(msg); WakeConditionVariable(&m_QueueChanged); LeaveCriticalSection(&m_Lock); #else pthread_mutex_lock(&m_Lock); m_MessageQueue.push(msg); pthread_cond_signal(&m_QueueChanged); pthread_mutex_unlock(&m_Lock); #endif } void NotificationTransportConsumer::unregisterHandler(BusAttachment* bus) { #ifdef _WIN32 EnterCriticalSection(&m_Lock); while (!m_MessageQueue.empty()) { m_MessageQueue.pop(); } m_IsStopping = true; WakeConditionVariable(&m_QueueChanged); LeaveCriticalSection(&m_Lock); WaitForSingleObject(m_handle, INFINITE); CloseHandle(m_handle); bus->UnregisterSignalHandler(this, static_cast(&NotificationTransportConsumer::handleSignal), m_SignalMethod, NULL); DeleteCriticalSection(&m_Lock); #else pthread_mutex_lock(&m_Lock); while (!m_MessageQueue.empty()) { m_MessageQueue.pop(); } m_IsStopping = true; pthread_cond_signal(&m_QueueChanged); pthread_mutex_unlock(&m_Lock); pthread_join(m_ReceiverThread, NULL); bus->UnregisterSignalHandler(this, static_cast(&NotificationTransportConsumer::handleSignal), m_SignalMethod, NULL); pthread_cond_destroy(&m_QueueChanged); pthread_mutex_destroy(&m_Lock); #endif } void* NotificationTransportConsumer::ReceiverThreadWrapper(void* context) { NotificationTransportConsumer* consumer = reinterpret_cast(context); if (consumer == NULL) { // should not happen return NULL; } consumer->ReceiverThread(); return NULL; } void NotificationTransportConsumer::ReceiverThread() { #ifdef _WIN32 EnterCriticalSection(&m_Lock); while (!m_IsStopping) { while (!m_MessageQueue.empty()) { Message message = m_MessageQueue.front(); m_MessageQueue.pop(); LeaveCriticalSection(&m_Lock); PayloadAdapter::receivePayload(message); EnterCriticalSection(&m_Lock); } // it's possible m_IsStopping changed while executing OnTask() (which is done unlocked) // therefore we have to check it again here, otherwise we potentially deadlock here if (!m_IsStopping) { SleepConditionVariableCS(&m_QueueChanged, &m_Lock, INFINITE); } } LeaveCriticalSection(&m_Lock); #else pthread_mutex_lock(&m_Lock); while (!m_IsStopping) { while (!m_MessageQueue.empty()) { Message message = m_MessageQueue.front(); m_MessageQueue.pop(); pthread_mutex_unlock(&m_Lock); PayloadAdapter::receivePayload(message); pthread_mutex_lock(&m_Lock); } // it's possible m_IsStopping changed while executing OnTask() (which is done unlocked) // therefore we have to check it again here, otherwise we potentially deadlock here if (!m_IsStopping) { pthread_cond_wait(&m_QueueChanged, &m_Lock); } } pthread_mutex_unlock(&m_Lock); #endif } base-15.09/notification/cpp/src/NotificationTransportConsumer.h000066400000000000000000000062631262264444500247510ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONTRANSPORTCONSUMER_H_ #define NOTIFICATIONTRANSPORTCONSUMER_H_ #include #ifdef _WIN32 #include #define pthread_mutex_t CRITICAL_SECTION #define pthread_cond_t CONDITION_VARIABLE #else #include #endif #include "NotificationTransport.h" namespace ajn { namespace services { /** * Notification Transport Consumer. Used to Create the Notification Interface * on the receiver side and register a signal handler to receive the notify signals */ class NotificationTransportConsumer : public NotificationTransport { public: /** * Constructor for TransportConsumer * @param bus - BusAttachment that is used * @param servicePath - servicePath of BusObject * @param status - success/failure */ NotificationTransportConsumer(ajn::BusAttachment* bus, qcc::String const& servicePath, QStatus& status); /** * Destructor of TransportConsumer */ ~NotificationTransportConsumer() { }; /** * Callback when Signal arrives * @param member Method or signal interface member entry. * @param srcPath Object path of signal emitter. * @param message The received message. */ void handleSignal(const ajn::InterfaceDescription::Member* member, const char* srcPath, ajn::Message& msg); void unregisterHandler(ajn::BusAttachment* bus); private: /** * The thread responsible for receiving the notification */ #ifdef _WIN32 HANDLE m_handle; #else pthread_t m_ReceiverThread; #endif /** * A Queue that holds the messages */ std::queue m_MessageQueue; /** * The mutex Lock */ pthread_mutex_t m_Lock; /** * The Queue Changed thread condition */ pthread_cond_t m_QueueChanged; /** * is the thread in the process of shutting down */ bool m_IsStopping; /** * A wrapper for the receiver Thread * @param context */ static void* ReceiverThreadWrapper(void* context); /** * The function run in the ReceiverThread */ void ReceiverThread(); }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONTRANSPORTCONSUMER_H_ */ base-15.09/notification/cpp/src/NotificationTransportProducer.cc000066400000000000000000000106071262264444500250740ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include "NotificationTransportProducer.h" #include "NotificationConstants.h" #include "Transport.h" #include using namespace ajn; using namespace services; using namespace nsConsts; using namespace qcc; NotificationTransportProducer::NotificationTransportProducer(BusAttachment* bus, String const& servicePath, QStatus& status, qcc::String const& interfaceName, uint32_t serialNumber) : NotificationTransport(bus, servicePath, status, interfaceName), m_SerialNumber(serialNumber), m_MsgId(0) { } QStatus NotificationTransportProducer::sendSignal(ajn::MsgArg const notificationArgs[AJ_NOTIFY_NUM_PARAMS], uint16_t ttl) { if (m_SignalMethod == 0) { QCC_LogError(ER_BUS_INTERFACE_NO_SUCH_MEMBER, ("signalMethod not set. Can't send signal")); return ER_BUS_INTERFACE_NO_SUCH_MEMBER; } uint8_t flags = ALLJOYN_FLAG_SESSIONLESS; Message msg(*Transport::getInstance()->getBusAttachment()); m_MsgId = notificationArgs[1].v_int32; //grab message id from payload. QStatus status = Signal(NULL, 0, *m_SignalMethod, notificationArgs, AJ_NOTIFY_NUM_PARAMS, ttl, flags, &msg); if (status != ER_OK) { QCC_LogError(status, ("Could not send signal.")); return status; } m_SerialNumber = msg->GetCallSerial(); QCC_DbgPrintf(("Sent signal successfully")); return status; } QStatus NotificationTransportProducer::deleteLastMsg(NotificationMessageType messageType) { QCC_UNUSED(messageType); if (m_SerialNumber == 0) { QCC_LogError(ER_BUS_INVALID_HEADER_SERIAL, ("Unable to delete the last message. No message on this object.")); return ER_BUS_INVALID_HEADER_SERIAL; } QStatus status = CancelSessionlessMessage(m_SerialNumber); if (status != ER_OK) { QCC_LogError(status, ("Could not delete last message.")); return status; } m_SerialNumber = 0; m_MsgId = 0; QCC_DbgPrintf(("Deleted last message successfully")); return status; } QStatus NotificationTransportProducer::getLastMsgId(NotificationMessageType messageType, int32_t* messageId) { QCC_UNUSED(messageType); QCC_DbgTrace(("NotificationTransportProducer::getLastMsgId()")); if (m_SerialNumber == 0) { QCC_LogError(ER_BUS_INVALID_HEADER_SERIAL, ("No message on this object.")); return ER_BUS_INVALID_HEADER_SERIAL; } *messageId = m_MsgId; return ER_OK; } QStatus NotificationTransportProducer::deleteMsg(int32_t msgId) { QCC_DbgTrace(("NotificationTransportProducer::deleteMsg()")); if (m_SerialNumber == 0) { return ER_BUS_INVALID_HEADER_SERIAL; } if (m_MsgId != msgId) { QCC_LogError(ER_BUS_INVALID_HEADER_SERIAL, ("Unable to delete the message. No such message id on this object.")); return ER_BUS_INVALID_HEADER_SERIAL; } QStatus status = CancelSessionlessMessage(m_SerialNumber); if (status != ER_OK) { QCC_LogError(status, ("Could not delete last message.")); return status; } m_SerialNumber = 0; m_MsgId = 0; QCC_DbgPrintf(("Deleted last message successfully")); return status; } base-15.09/notification/cpp/src/NotificationTransportProducer.h000066400000000000000000000065411262264444500247400ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef NOTIFICATIONTRANSPORTPRODUCER_H_ #define NOTIFICATIONTRANSPORTPRODUCER_H_ #include #include "NotificationTransport.h" #include "NotificationConstants.h" namespace ajn { namespace services { /** * Notification Transport Producer. Used to Create the Notification Interface * on the producers side and send the notify signals */ class NotificationTransportProducer : public NotificationTransport { public: /** * Constructor for TransportProducer. Creates Interface and prepares * infrastructure to be able to send Signal * @param bus - BusAttachment that is used * @param servicePath - servicePath of BusObject * @param status - success/failure * @param m_serialNumber - serial number of the last successful message on the bus */ NotificationTransportProducer(ajn::BusAttachment* bus, qcc::String const& servicePath, QStatus& status, qcc::String const& interfaceName = nsConsts::AJ_NOTIFICATION_INTERFACE_NAME, uint32_t serialNumber = 0); /** * Destructor for TransportProducer */ ~NotificationTransportProducer() { }; /** * Send Signal over Bus. * @param notificationArgs * @param ttl * @return status */ QStatus sendSignal(ajn::MsgArg const notificationArgs[nsConsts::AJ_NOTIFY_NUM_PARAMS], uint16_t ttl); /** * delete last message * @param type of message to delete * @return status */ QStatus deleteLastMsg(NotificationMessageType messageType); /** * Delete Signal sent off for this messageType * @param messageId * @return status */ QStatus deleteMsg(int32_t msgId); /** * get the notification id of the last message sent with the given MessageType * @param messageType type of message * @param messageId pointer to hold the notification id of the last message * @return status */ QStatus getLastMsgId(NotificationMessageType messageType, int32_t* messageId); private: /** * Serial Number of the last message sent with this message type */ uint32_t m_SerialNumber; /** * message Id of the last message sent with this message type */ int32_t m_MsgId; }; } //namespace services } //namespace ajn #endif /* NOTIFICATIONTRANSPORTPRODUCER_H_ */ base-15.09/notification/cpp/src/PayloadAdapter.cc000066400000000000000000000647551262264444500217340ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include #include #include #include "NotificationConstants.h" #include "PayloadAdapter.h" #include "Transport.h" #include using namespace qcc; using namespace ajn; using namespace services; using namespace nsConsts; int32_t PayloadAdapter::m_MessageId(0); QStatus PayloadAdapter::sendPayload(const char* deviceId, const char* deviceName, const uint8_t* appId, size_t appIdlen, const char* appName, NotificationMessageType messageType, std::vector const& notificationText, std::map const& customAttributes, uint16_t ttl, const char* richIconUrl, std::vector const& richAudioUrl, const char* richIconObjectPath, const char* richAudioObjectPath, const char* controlPanelServiceObjectPath, const char* originalSender, int32_t messageId) { MsgArg deviceIdArg; MsgArg deviceNameArg; MsgArg appIdArg; MsgArg appNameArg; QStatus status; do { CHECK(deviceIdArg.Set(AJPARAM_STR.c_str(), deviceId)); CHECK(deviceNameArg.Set(AJPARAM_STR.c_str(), deviceName)); CHECK(appIdArg.Set(AJPARAM_ARR_BYTE.c_str(), appIdlen, appId)); CHECK(appNameArg.Set(AJPARAM_STR.c_str(), appName)); return(sendPayload(deviceIdArg, deviceNameArg, appIdArg, appNameArg, messageType, notificationText, customAttributes, ttl, richIconUrl, richAudioUrl, richIconObjectPath, richAudioObjectPath, controlPanelServiceObjectPath, originalSender, messageId)); } while (0); QCC_LogError(status, ("Error occurred. Could not marshal parameters.")); return status; } QStatus PayloadAdapter::sendPayload(AboutData* propertyStore, NotificationMessageType messageType, std::vector const& notificationText, std::map const& customAttributes, uint16_t ttl, const char* richIconUrl, std::vector const& richAudioUrl, const char* richIconObjectPath, const char* richAudioObjectPath, const char* controlPanelServiceObjectPath, const char* originalSender) { MsgArg deviceIdArg; MsgArg deviceNameArg; MsgArg appIdArg; MsgArg appNameArg; if (!m_MessageId) { srand(time(NULL)); m_MessageId = rand(); } MsgArg configArgs; MsgArg* configEntries; size_t configNum; QStatus status; if ((status = propertyStore->GetAboutData(&configArgs))) { return status; } if ((status = configArgs.Get(AJPARAM_ARR_DICT_STR_VAR.c_str(), &configNum, &configEntries))) { QCC_LogError(status, ("Error reading in about configuration data")); return status; } for (size_t i = 0; i < configNum; i++) { char* keyChar; String key; MsgArg* variant; CHECK(configEntries[i].Get(AJPARAM_DICT_STR_VAR.c_str(), &keyChar, &variant)); key = keyChar; if (key.compare("DeviceId") == 0) { deviceIdArg = *variant; } else if (key.compare("DeviceName") == 0) { deviceNameArg = *variant; } else if (key.compare("AppId") == 0) { appIdArg = *variant; } else if (key.compare("AppName") == 0) { appNameArg = *variant; } } if (status != ER_OK) { QCC_LogError(status, ("Something went wrong unmarshalling the propertystore.")); return status; } /* Validate Arguments */ if (deviceIdArg.typeId != ALLJOYN_STRING) { QCC_LogError(ER_BAD_ARG_1, ("DeviceId argument is not correct type.")); return ER_BAD_ARG_1; } if (deviceIdArg.v_string.str == 0 || deviceIdArg.v_string.len == 0) { QCC_LogError(ER_BAD_ARG_1, ("DeviceId argument can not be NULL or an empty String.")); return ER_BAD_ARG_1; } if (deviceNameArg.typeId != ALLJOYN_STRING) { QCC_LogError(ER_BAD_ARG_1, ("DeviceName argument is not correct type.")); return ER_BAD_ARG_1; } if (deviceNameArg.v_string.str == 0 || deviceNameArg.v_string.len == 0) { QCC_LogError(ER_BAD_ARG_1, ("DeviceName argument can not be NULL or an empty String.")); return ER_BAD_ARG_1; } if (appIdArg.typeId != ALLJOYN_BYTE_ARRAY) { QCC_LogError(ER_BAD_ARG_1, ("ApplicationId argument is not correct type.")); return ER_BAD_ARG_1; } if (appIdArg.v_scalarArray.numElements == 0) { QCC_LogError(ER_BAD_ARG_1, ("ApplicationId argument cannot be empty")); return ER_BAD_ARG_1; } if (appNameArg.typeId != ALLJOYN_STRING) { QCC_LogError(ER_BAD_ARG_1, ("ApplicationName argument is not correct type.")); return ER_BAD_ARG_1; } if (appNameArg.v_string.str == 0 || appNameArg.v_string.len == 0) { QCC_LogError(ER_BAD_ARG_1, ("ApplicationName argument can not be NULL or an empty String.")); return ER_BAD_ARG_1; } return (sendPayload(deviceIdArg, deviceNameArg, appIdArg, appNameArg, messageType, notificationText, customAttributes, ttl, richIconUrl, richAudioUrl, richIconObjectPath, richAudioObjectPath, controlPanelServiceObjectPath, originalSender, ++m_MessageId)); } QStatus PayloadAdapter::sendPayload(PropertyStore* propertyStore, NotificationMessageType messageType, std::vector const& notificationText, std::map const& customAttributes, uint16_t ttl, const char* richIconUrl, std::vector const& richAudioUrl, const char* richIconObjectPath, const char* richAudioObjectPath, const char* controlPanelServiceObjectPath, const char* originalSender) { MsgArg deviceIdArg; MsgArg deviceNameArg; MsgArg appIdArg; MsgArg appNameArg; if (!m_MessageId) { srand(time(NULL)); m_MessageId = rand(); } MsgArg configArgs[1]; MsgArg* configEntries; size_t configNum; QStatus status; if ((status = propertyStore->ReadAll(0, PropertyStore::READ, configArgs[0]))) { return status; } if ((status = configArgs[0].Get(AJPARAM_ARR_DICT_STR_VAR.c_str(), &configNum, &configEntries))) { QCC_LogError(status, ("Error reading in about configuration data")); return status; } for (size_t i = 0; i < configNum; i++) { char* keyChar; String key; MsgArg* variant; CHECK(configEntries[i].Get(AJPARAM_DICT_STR_VAR.c_str(), &keyChar, &variant)); key = keyChar; if (key.compare("DeviceId") == 0) { deviceIdArg = *variant; } else if (key.compare("DeviceName") == 0) { deviceNameArg = *variant; } else if (key.compare("AppId") == 0) { appIdArg = *variant; } else if (key.compare("AppName") == 0) { appNameArg = *variant; } } if (status != ER_OK) { QCC_LogError(status, ("Something went wrong unmarshalling the propertystore.")); return status; } /* Validate Arguments */ if (deviceIdArg.typeId != ALLJOYN_STRING) { QCC_LogError(ER_BAD_ARG_1, ("DeviceId argument is not correct type.")); return ER_BAD_ARG_1; } if (deviceIdArg.v_string.str == 0 || deviceIdArg.v_string.len == 0) { QCC_LogError(ER_BAD_ARG_1, ("DeviceId argument can not be NULL or an empty String.")); return ER_BAD_ARG_1; } if (deviceNameArg.typeId != ALLJOYN_STRING) { QCC_LogError(ER_BAD_ARG_1, ("DeviceName argument is not correct type.")); return ER_BAD_ARG_1; } if (deviceNameArg.v_string.str == 0 || deviceNameArg.v_string.len == 0) { QCC_LogError(ER_BAD_ARG_1, ("DeviceName argument can not be NULL or an empty String.")); return ER_BAD_ARG_1; } if (appIdArg.typeId != ALLJOYN_BYTE_ARRAY) { QCC_LogError(ER_BAD_ARG_1, ("ApplicationId argument is not correct type.")); return ER_BAD_ARG_1; } if (appIdArg.v_scalarArray.numElements == 0) { QCC_LogError(ER_BAD_ARG_1, ("ApplicationId argument cannot be empty")); return ER_BAD_ARG_1; } if (appNameArg.typeId != ALLJOYN_STRING) { QCC_LogError(ER_BAD_ARG_1, ("ApplicationName argument is not correct type.")); return ER_BAD_ARG_1; } if (appNameArg.v_string.str == 0 || appNameArg.v_string.len == 0) { QCC_LogError(ER_BAD_ARG_1, ("ApplicationName argument can not be NULL or an empty String.")); return ER_BAD_ARG_1; } return (sendPayload(deviceIdArg, deviceNameArg, appIdArg, appNameArg, messageType, notificationText, customAttributes, ttl, richIconUrl, richAudioUrl, richIconObjectPath, richAudioObjectPath, controlPanelServiceObjectPath, originalSender, ++m_MessageId)); } QStatus PayloadAdapter::sendPayload(ajn::MsgArg deviceIdArg, ajn::MsgArg deviceNameArg, ajn::MsgArg appIdArg, ajn::MsgArg appNameArg, NotificationMessageType messageType, std::vector const& notificationText, std::map const& customAttributes, uint16_t ttl, const char* richIconUrl, std::vector const& richAudioUrl, const char* richIconObjectPath, const char* richAudioObjectPath, const char* controlPanelServiceObjectPath, const char* originalSender, int32_t messageId) { QStatus status; MsgArg versionArg; MsgArg messageIdArg; MsgArg messageTypeArg; MsgArg richIconUrlArg; MsgArg richAudioArg; MsgArg richIconObjectPathArg; MsgArg richAudioObjectPathArg; MsgArg controlPanelServiceObjectPathArg; MsgArg originalSenderArg; do { CHECK(versionArg.Set(AJPARAM_UINT16.c_str(), NotificationService::getVersion())); CHECK(messageIdArg.Set(AJPARAM_INT.c_str(), messageId)); CHECK(messageTypeArg.Set(AJPARAM_UINT16.c_str(), messageType)); int32_t attrSize = 1; if (richIconUrl) { attrSize++; } if (!richAudioUrl.empty()) { attrSize++; } if (richIconObjectPath) { attrSize++; } if (richAudioObjectPath) { attrSize++; } if (controlPanelServiceObjectPath) { attrSize++; } std::vector attributes(attrSize); std::vector::const_iterator contIter; std::vector audioContent(richAudioUrl.size()); int32_t attrIndx = 0; CHECK(originalSenderArg.Set(AJPARAM_STR.c_str(), originalSender)) CHECK(attributes[attrIndx++].Set(AJPARAM_DICT_INT_VAR.c_str(), ORIGINAL_SENDER_ATTRIBUTE_KEY, &originalSenderArg)); if (richIconUrl) { CHECK(richIconUrlArg.Set(AJPARAM_STR.c_str(), richIconUrl)) CHECK(attributes[attrIndx++].Set(AJPARAM_DICT_INT_VAR.c_str(), RICH_CONTENT_ICON_URL_ATTRIBUTE_KEY, &richIconUrlArg)); } if (!richAudioUrl.empty()) { /* Fill the audioContent array using the richAudioUrl passed in Then Marshal attributes argument */ int32_t audioIndx = 0; for (contIter = richAudioUrl.begin(); contIter != richAudioUrl.end(); contIter++) { if (!(contIter->getLanguage().size()) || !(contIter->getUrl().size())) { QCC_LogError(ER_BAD_ARG_7, ("Problem sending message. Cannot send a message with audio content with an empty language/url values.")); return ER_BAD_ARG_7; } CHECK(audioContent[audioIndx++].Set(AJPARAM_STRUCT_STR_STR.c_str(), contIter->getLanguage().c_str(), contIter->getUrl().c_str())); } if (status != ER_OK) { break; } CHECK(richAudioArg.Set(AJPARAM_ARR_STRUCT_STR_STR.c_str(), audioContent.size(), audioContent.data())) CHECK(attributes[attrIndx++].Set(AJPARAM_DICT_INT_VAR.c_str(), RICH_CONTENT_AUDIO_URL_ATTRIBUTE_KEY, &richAudioArg)); } if (richIconObjectPath) { CHECK(richIconObjectPathArg.Set(AJPARAM_STR.c_str(), richIconObjectPath)) CHECK(attributes[attrIndx++].Set(AJPARAM_DICT_INT_VAR.c_str(), RICH_CONTENT_ICON_OBJECT_PATH_ATTRIBUTE_KEY, &richIconObjectPathArg)); } if (richAudioObjectPath) { CHECK(richAudioObjectPathArg.Set(AJPARAM_STR.c_str(), richAudioObjectPath)) CHECK(attributes[attrIndx++].Set(AJPARAM_DICT_INT_VAR.c_str(), RICH_CONTENT_AUDIO_OBJECT_PATH_ATTRIBUTE_KEY, &richAudioObjectPathArg)); } if (controlPanelServiceObjectPath) { CHECK(controlPanelServiceObjectPathArg.Set(AJPARAM_STR.c_str(), controlPanelServiceObjectPath)) CHECK(attributes[attrIndx++].Set(AJPARAM_DICT_INT_VAR.c_str(), CPS_OBJECT_PATH_ATTRIBUTE_KEY, &controlPanelServiceObjectPathArg)); } if (status != ER_OK) { break; } MsgArg attributesArg; CHECK(attributesArg.Set(AJPARAM_ARR_DICT_INT_VAR.c_str(), attrSize, attributes.data())); /* Fill the custom attributes array then using customAttributes Then Marshal the custom attributes argument */ int32_t customAttrIndx = 0; std::vector sendCustomAttributes(customAttributes.size()); std::map::const_iterator cAiter; for (cAiter = customAttributes.begin(); cAiter != customAttributes.end(); cAiter++) { CHECK(sendCustomAttributes[customAttrIndx++].Set(AJPARAM_DICT_STR_STR.c_str(), cAiter->first.c_str(), cAiter->second.c_str())); } if (status != ER_OK) { break; } MsgArg customAttributesArg; CHECK(customAttributesArg.Set(AJPARAM_ARR_DICT_STR_STR.c_str(), customAttributes.size(), sendCustomAttributes.data())); /* Fill the notificationText array using the notifications passed in Then Marshal notificationText argument */ int32_t notifIndx = 0; std::vector::const_iterator notIter; std::vector notifications(notificationText.size()); for (notIter = notificationText.begin(); notIter != notificationText.end(); notIter++) { if (!(notIter->getLanguage().size()) || !(notIter->getText().size())) { QCC_LogError(ER_BAD_ARG_6, ("Problem sending message. Cannot send a message with an empty language/text values.")); return ER_BAD_ARG_6; } CHECK(notifications[notifIndx++].Set(AJPARAM_STRUCT_STR_STR.c_str(), notIter->getLanguage().c_str(), notIter->getText().c_str())); } if (status != ER_OK) { break; } MsgArg notificationTextArg; CHECK(notificationTextArg.Set(AJPARAM_ARR_STRUCT_STR_STR.c_str(), notificationText.size(), notifications.data())); MsgArg notificationArgs[AJ_NOTIFY_NUM_PARAMS]; notificationArgs[0] = versionArg; notificationArgs[1] = messageIdArg; notificationArgs[2] = messageTypeArg; notificationArgs[3] = deviceIdArg; notificationArgs[4] = deviceNameArg; notificationArgs[5] = appIdArg; notificationArgs[6] = appNameArg; notificationArgs[7] = attributesArg; notificationArgs[8] = customAttributesArg; notificationArgs[9] = notificationTextArg; QCC_DbgPrintf(("Attempting to send messageId: %d", messageId)); Transport* transport = Transport::getInstance(); status = transport->sendNotification(messageType, notificationArgs, ttl); if (status == ER_OK) { QCC_DbgHLPrintf(("Message sent successfully with messageId: %d", messageId)); } return status; } while (0); QCC_LogError(status, ("Error occurred. Could not marshal parameters.")); return status; } void PayloadAdapter::receivePayload(Message& msg) { QStatus status; const MsgArg* versionArg = msg.unwrap()->GetArg(0); const MsgArg* messageIdArg = msg.unwrap()->GetArg(1); const MsgArg* messageTypeArg = msg.unwrap()->GetArg(2); const MsgArg* deviceIdArg = msg.unwrap()->GetArg(3); const MsgArg* deviceNameArg = msg.unwrap()->GetArg(4); const MsgArg* appIdArg = msg.unwrap()->GetArg(5); const MsgArg* appNameArg = msg.unwrap()->GetArg(6); const MsgArg* attributesArg = msg.unwrap()->GetArg(7); const MsgArg* customAttributesArg = msg.unwrap()->GetArg(8); const MsgArg* notificationsArg = msg.unwrap()->GetArg(9); const char* sender = msg->GetSender(); do { //Unmarshal Version if (versionArg->typeId != ALLJOYN_UINT16) { QCC_DbgHLPrintf(("Problem receiving message: Can not Unmarshal this Version argument.")); return; } uint16_t version; CHECK(versionArg->Get(AJPARAM_UINT16.c_str(), &version)); //Unmarshal messageId if (messageIdArg->typeId != ALLJOYN_INT32) { QCC_DbgHLPrintf(("Problem receiving message: Can not Unmarshal this messageId argument.")); return; } int32_t messageId; CHECK(messageIdArg->Get(AJPARAM_INT.c_str(), &messageId)); //Unmarshal messageType if (messageTypeArg->typeId != ALLJOYN_UINT16) { QCC_DbgHLPrintf(("Problem receiving message: Can not Unmarshal this message type argument.")); return; } uint16_t intVal; NotificationMessageType messageType; CHECK(messageTypeArg->Get(AJPARAM_UINT16.c_str(), &intVal)); messageType = MessageTypeUtil::getMessageType(intVal); //Unmarshal deviceId if (deviceIdArg->typeId != ALLJOYN_STRING) { QCC_DbgHLPrintf(("Problem receiving message: Can not Unmarshal this deviceId argument.")); return; } char* deviceId; CHECK(deviceIdArg->Get(AJPARAM_STR.c_str(), &deviceId)); //Unmarshal deviceName if (deviceNameArg->typeId != ALLJOYN_STRING) { QCC_DbgHLPrintf(("Problem receiving message: Can not Unmarshal this device Name argument.")); return; } char* deviceName; CHECK(deviceNameArg->Get(AJPARAM_STR.c_str(), &deviceName)); //Unmarshal appId if (appIdArg->typeId != ALLJOYN_BYTE_ARRAY) { QCC_DbgHLPrintf(("Problem receiving message: Can not Unmarshal this appId argument.")); return; } String appId; uint8_t* appIdBin; size_t len; CHECK(appIdArg->Get(AJPARAM_ARR_BYTE.c_str(), &len, &appIdBin)); if (len != UUID_LENGTH) { QCC_DbgHLPrintf(("App id length is not equal to %u", UUID_LENGTH * 2)); return; } //convert bytes to stringstrea uint32_t i; static const char* const chars = "0123456789ABCDEF"; appId.reserve(2 * len); for (i = 0; i < len; ++i) { const unsigned char c = appIdBin[i]; appId.push_back(chars[c >> 4]); appId.push_back(chars[c & 15]); } //Unmarshal appName if (appNameArg->typeId != ALLJOYN_STRING) { QCC_DbgHLPrintf(("Problem receiving message: Can not Unmarshal this app Name argument.")); return; } char* appName; CHECK(appNameArg->Get(AJPARAM_STR.c_str(), &appName)); //Unmarshal Attributes if (attributesArg->typeId != ALLJOYN_ARRAY) { QCC_DbgHLPrintf(("Problem receiving message: Can not Unmarshal this Attributes argument.")); return; } MsgArg*attribEntries; size_t attribNum; char* richIconUrl = 0; char* richIconObjectPath = 0; char* richAudioObjectPath = 0; char* controlPanelServiceObjectPath = 0; char* originalSender = 0; std::vector richAudioUrl; CHECK(attributesArg->Get(AJPARAM_ARR_DICT_INT_VAR.c_str(), &attribNum, &attribEntries)); for (size_t i = 0; i < attribNum; i++) { int32_t key; MsgArg* variant; CHECK(attribEntries[i].Get(AJPARAM_DICT_INT_VAR.c_str(), &key, &variant)); switch (key) { case RICH_CONTENT_ICON_URL_ATTRIBUTE_KEY: { CHECK(variant->Get(AJPARAM_STR.c_str(), &richIconUrl)); break; } case RICH_CONTENT_AUDIO_URL_ATTRIBUTE_KEY: { MsgArg*richAudioEntries; size_t richAudioNum; CHECK(variant->Get(AJPARAM_ARR_STRUCT_STR_STR.c_str(), &richAudioNum, &richAudioEntries)); for (size_t i = 0; i < richAudioNum; i++) { char*key; char*StringVal; status = richAudioEntries[i].Get(AJPARAM_STRUCT_STR_STR.c_str(), &key, &StringVal); if (status != ER_OK) { QCC_LogError(status, ("Can not Unmarshal this NotificationText argument.")); break; } richAudioUrl.push_back(RichAudioUrl(key, StringVal)); } break; } case RICH_CONTENT_ICON_OBJECT_PATH_ATTRIBUTE_KEY: { CHECK(variant->Get(AJPARAM_STR.c_str(), &richIconObjectPath)); break; } case RICH_CONTENT_AUDIO_OBJECT_PATH_ATTRIBUTE_KEY: { CHECK(variant->Get(AJPARAM_STR.c_str(), &richAudioObjectPath)); break; } case CPS_OBJECT_PATH_ATTRIBUTE_KEY: { CHECK(variant->Get(AJPARAM_STR.c_str(), &controlPanelServiceObjectPath)); break; } case ORIGINAL_SENDER_ATTRIBUTE_KEY: { CHECK(variant->Get(AJPARAM_STR.c_str(), &originalSender)); break; } default: QCC_DbgHLPrintf(("Can not Unmarshal this attribute argument")); break; } } // for (size_t i = 0; i < attribNum; i++) //Unmarshal Custom Attributes if (customAttributesArg->typeId != ALLJOYN_ARRAY) { QCC_DbgHLPrintf(("Problem receiving message: Can not Unmarshal this custom Attributes argument.")); return; } MsgArg*customAttributesEntries; size_t customAttributesNum; std::map customAttributes; CHECK(customAttributesArg->Get(AJPARAM_ARR_DICT_STR_STR.c_str(), &customAttributesNum, &customAttributesEntries)); for (size_t i = 0; i < customAttributesNum; i++) { char*key; char*StringVal; status = customAttributesEntries[i].Get(AJPARAM_DICT_STR_STR.c_str(), &key, &StringVal); if (status != ER_OK) { QCC_DbgHLPrintf(("Can not Unmarshal this Custom Attribute argument")); break; } customAttributes.insert(std::pair(key, StringVal)); } if (status != ER_OK) { break; } //Unmarshal NotificationTexts if (notificationsArg->typeId != ALLJOYN_ARRAY) { QCC_DbgHLPrintf(("Problem receiving message: Can not Unmarshal this NotificationsArg argument.")); return; } MsgArg*notTextEntries; size_t notTextNum; CHECK(notificationsArg->Get(AJPARAM_ARR_STRUCT_STR_STR.c_str(), ¬TextNum, ¬TextEntries)); std::vector text; for (size_t i = 0; i < notTextNum; i++) { char*key; char*StringVal; status = notTextEntries[i].Get(AJPARAM_STRUCT_STR_STR.c_str(), &key, &StringVal); if (status != ER_OK) { QCC_DbgHLPrintf(("Can not Unmarshal this NotificationText argument")); break; } text.push_back(NotificationText(key, StringVal)); } if (status != ER_OK) { break; } //Create notification and send it on Notification notification(messageId, messageType, deviceId, deviceName, appId.c_str(), appName, sender, customAttributes, text, richIconUrl, richAudioUrl, richIconObjectPath, richAudioObjectPath, controlPanelServiceObjectPath, originalSender); Transport* transport = Transport::getInstance(); transport->onReceivedNotification(notification); return; } while (0); QCC_LogError(status, ("Error occurred. Could not unmarshal parameters.")); return; } base-15.09/notification/cpp/src/PayloadAdapter.h000066400000000000000000000154661262264444500215710ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef PAYLOADADAPTER_H_ #define PAYLOADADAPTER_H_ #include #include #include #include #include #include #include #include #include #include namespace ajn { namespace services { /** * PayloadAdapter - a class used to prepare the payload from variables to alljoyn message parameters * and unpack the alljoyn message parameters into the individual variables */ class PayloadAdapter { public: /** * Constructor of PayloadAdapter */ PayloadAdapter() { }; /** * Destructor of PayloadAdapter */ ~PayloadAdapter() { }; /** * SendPayload Marshals the Arguments to be sent * @param propertyStore * @param messageType * @param notificationText * @param customAttributes * @param ttl * @param richIconUrl * @param richAudioUrl * @param richIconObjectPath * @param richAudioObjectPath * @param controlPanelServiceObjectPath * @param originalSender * @return status - success/failure */ static QStatus sendPayload(ajn::AboutData* propertyStore, NotificationMessageType messageType, std::vector const& notificationText, std::map const& customAttributes, uint16_t ttl, const char* richIconUrl, std::vector const& richAudioUrl, const char* richIconObjectPath, const char* richAudioObjectPath, const char* controlPanelServiceObjectPath, const char* originalSender); /** * SendPayload Marshals the Arguments to be sent * @param propertyStore * @param messageType * @param notificationText * @param customAttributes * @param ttl * @param richIconUrl * @param richAudioUrl * @param richIconObjectPath * @param richAudioObjectPath * @param controlPanelServiceObjectPath * @param originalSender * @return status - success/failure */ static QStatus sendPayload(ajn::services::PropertyStore* propertyStore, NotificationMessageType messageType, std::vector const& notificationText, std::map const& customAttributes, uint16_t ttl, const char* richIconUrl, std::vector const& richAudioUrl, const char* richIconObjectPath, const char* richAudioObjectPath, const char* controlPanelServiceObjectPath, const char* originalSender); /** * SendPayload Marshals the Arguments to be sent * @param deviceId * @param deviceName * @param appId * @param appIdlen * @param appName * @param messageType * @param notificationText * @param customAttributes * @param ttl * @param richIconUrl * @param richAudioUrl * @param richIconObjectPath * @param richAudioObjectPath * @param controlPanelServiceObjectPath * @param originalSender * @param messageId * @return status - success/failure */ static QStatus sendPayload(const char* deviceId, const char* deviceName, const uint8_t* appId, size_t appIdlen, const char* appName, NotificationMessageType messageType, std::vector const& notificationText, std::map const& customAttributes, uint16_t ttl, const char* richIconUrl, std::vector const& richAudioUrl, const char* richIconObjectPath, const char* richAudioObjectPath, const char* controlPanelServiceObjectPath, const char* originalSender, int32_t messageId); /** * ReceivePayload Unmarshals the arguments received * @param msg */ static void receivePayload(ajn::Message& msg); private: /** * SendPayload Marshals the Arguments to be sent * @param deviceId * @param deviceName * @param appId * @param appName * @param messageType * @param notificationText * @param customAttributes * @param ttl * @param richIconUrl * @param richAudioUrl * @param richIconObjectPath * @param richAudioObjectPath * @param controlPanelServiceObjectPath * @param originalSender * @param messageId * @return status - success/failure */ static QStatus sendPayload(ajn::MsgArg deviceIdArg, ajn::MsgArg deviceNameArg, ajn::MsgArg appIdArg, ajn::MsgArg appNameArg, NotificationMessageType messageType, std::vector const& notificationText, std::map const& customAttributes, uint16_t ttl, const char* richIconUrl, std::vector const& richAudioUrl, const char* richIconObjectPath, const char* richAudioObjectPath, const char* controlPanelServiceObjectPath, const char* originalSender, int32_t messageId); /** * static MessageId */ static int32_t m_MessageId; }; } //namespace services } //namespace ajn #endif /* PAYLOADADAPTER_H_ */ base-15.09/notification/cpp/src/RichAudioUrl.cc000066400000000000000000000027431262264444500213610ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include using namespace ajn; using namespace services; using namespace qcc; RichAudioUrl::RichAudioUrl(String const& language, String const& url) { m_Language = language; m_Url = url; } void RichAudioUrl::setLanguage(String const& language) { m_Language = language; } String const& RichAudioUrl::getLanguage() const { return m_Language; } void RichAudioUrl::setUrl(String const& url) { m_Url = url; } String const& RichAudioUrl::getUrl() const { return m_Url; } base-15.09/notification/cpp/src/SConscript000066400000000000000000000024361262264444500205310ustar00rootroot00000000000000#****************************************************************************** # Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #***************************************************************************** Import('nsenv') srcs = nsenv.Glob('*.cc') libs = [] # Static library objs = nsenv.Object(srcs) libs.append(nsenv.StaticLibrary('alljoyn_notification', objs)) # Shared library if nsenv.get('LIBTYPE', 'static') != 'static': shobjs = nsenv.SharedObject(srcs) libs.append(nsenv.SharedLibrary('alljoyn_notification', shobjs)) Return('libs') base-15.09/notification/cpp/src/Transport.cc000066400000000000000000000452221262264444500210220ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef _WIN32 /* Disable deprecation warnings */ #pragma warning(disable: 4996) #endif #include #include #include #include #include "NotificationConstants.h" #include "PayloadAdapter.h" #include "Transport.h" #include "NotificationProducerReceiver.h" #include "NotificationProducerSender.h" #include "NotificationProducerListener.h" #include "NotificationDismisserSender.h" #include "NotificationDismisserReceiver.h" #include "NotificationConstants.h" #include "NotificationTransportConsumer.h" #include "NotificationTransportProducer.h" #include using namespace ajn; using namespace services; using namespace nsConsts; using namespace qcc; Transport* Transport::s_Instance(NULL); Transport::Transport() : m_Bus(0), m_Receiver(0), m_Consumer(0), m_IsSendingDisabled(false), m_IsReceivingDisabled(false), m_NotificationProducerSender(0), m_NotificationProducerReceiver(0), m_NotificationProducerListener(0), m_NotificationDismisserSender(0), m_NotificationDismisserReceiver(0) { Notification::m_AsyncTaskQueue.Start(); for (int32_t indx = 0; indx < MESSAGE_TYPE_CNT; indx++) m_Producers[indx] = 0; } Transport::~Transport() { if (m_Bus) { cleanup(); } } Transport* Transport::getInstance() { if (!s_Instance) { s_Instance = new Transport(); } return s_Instance; } QStatus Transport::setBusAttachment(ajn::BusAttachment* bus) { if (m_Bus && bus->GetUniqueName().compare(m_Bus->GetUniqueName()) != 0) { QCC_LogError(ER_BUS_LISTENER_ALREADY_SET, ("Could not accept this BusAttachment, a different bus attachment already exists")); return ER_BUS_LISTENER_ALREADY_SET; } if (!bus->IsStarted() || !bus->IsConnected()) { QCC_LogError(ER_BAD_ARG_1, ("Could not acccept this BusAttachment, bus attachment not started or not connected")); return ER_BAD_ARG_1; } m_Bus = bus; return ER_OK; } void Transport::setNotificationReceiver(NotificationReceiver* notificationReceiver) { m_Receiver = notificationReceiver; } void Transport::onReceivedNotification(Notification const& notification) { if (m_Receiver == 0) { QCC_DbgHLPrintf(("Could not receive message, Receiver is not initialized")); return; } if (m_IsReceivingDisabled) { QCC_DbgHLPrintf(("Could not receive message, Receiving is Disabled")); return; } m_Receiver->Receive(notification); } QStatus Transport::sendNotification(NotificationMessageType messageType, MsgArg const notificationArgs[AJ_NOTIFY_NUM_PARAMS], uint16_t ttl) { if (m_Producers[messageType] == 0) { QCC_LogError(ER_BUS_OBJECT_NOT_REGISTERED, ("Could not send message, Sender is not initialized")); return ER_BUS_OBJECT_NOT_REGISTERED; } if (m_IsSendingDisabled) { QCC_LogError(ER_BUS_NOT_ALLOWED, ("Could not send message, Sending is Disabled")); return ER_BUS_NOT_ALLOWED; } return m_Producers[messageType]->sendSignal(notificationArgs, ttl); } QStatus Transport::deleteLastMsg(NotificationMessageType messageType) { if (m_Producers[messageType] == 0) { QCC_LogError(ER_BUS_OBJECT_NOT_REGISTERED, ("Could not delete message, Sender is not initialized")); return ER_BUS_OBJECT_NOT_REGISTERED; } return m_Producers[messageType]->deleteLastMsg(messageType); } QStatus Transport::getLastMsgId(NotificationMessageType messageType, int32_t* messageId) { if (m_Producers[messageType] == 0) { QCC_LogError(ER_BUS_OBJECT_NOT_REGISTERED, ("Sender is not initialized")); return ER_BUS_OBJECT_NOT_REGISTERED; } return m_Producers[messageType]->getLastMsgId(messageType, messageId); } QStatus Transport::deleteMsg(int32_t msgId) { QCC_DbgTrace(("Transport::deleteMsg() msgId=%d", msgId)); QStatus ret = ER_OK; for (size_t i = 0; i < ajn::services::MESSAGE_TYPE_CNT; i++) { if (m_Producers[i] == 0) { QCC_DbgHLPrintf(("Could not delete message, Sender is not initialized")); continue; } else { QCC_DbgHLPrintf(("deleting message")); } ret = m_Producers[i]->deleteMsg(msgId); if (ret == ER_OK) { break; } } if (ret == ER_OK) { QCC_DbgPrintf(("Transport::deleteMsg() - message successfully deleted. msgId=%d", msgId)); } else { QCC_DbgPrintf(("Transport::deleteMsg() - didn't find message to delete. msgId=%d", msgId)); } return ret; } QStatus Transport::startSenderTransport(BusAttachment* bus) { QCC_DbgTrace(("Transport::startSenderTransport")); QStatus status; if ((status = setBusAttachment(bus)) != ER_OK) { QCC_LogError(status, ("Could not start Sender Transport. BusAttachment is not valid")); goto exit; } if (m_Producers[0]) { QCC_DbgPrintf(("Sender Transport already started. Ignoring request")); goto exit; } { for (int32_t messageTypeIndx = 0; messageTypeIndx < MESSAGE_TYPE_CNT; messageTypeIndx++) { status = ER_OK; m_Producers[messageTypeIndx] = new NotificationTransportProducer(m_Bus, AJ_PRODUCER_SERVICE_PATH_PREFIX + MessageTypeUtil::getMessageTypeString(messageTypeIndx), status); if (status != ER_OK) { QCC_LogError(status, ("Could not create BusObject.")); goto exit; } status = m_Bus->RegisterBusObject(*m_Producers[messageTypeIndx]); if (status != ER_OK) { QCC_LogError(status, ("Could not register BusObject.")); goto exit; } } } //Code handles NotificationProducerReceiver - Start cleanupNotificationProducerReceiverInternal(); cleanupNotificationProducerSenderInternal(); m_NotificationProducerReceiver = new NotificationProducerReceiver(m_Bus, status); if (status != ER_OK) { goto exit; } status = m_Bus->RegisterBusObject(*m_NotificationProducerReceiver); if (status != ER_OK) { QCC_LogError(status, ("Could not register BusObject.")); goto exit; } else { QCC_DbgPrintf(("Transport::startSenderTransport - registered NotificationProducerReceiver successfully.")); } m_NotificationProducerListener = new NotificationProducerListener(); m_NotificationProducerListener->setSessionPort(AJ_NOTIFICATION_PRODUCER_SERVICE_PORT); { //Handling Bind session SessionPort servicePort = AJ_NOTIFICATION_PRODUCER_SERVICE_PORT; SessionOpts sessionOpts(SessionOpts::TRAFFIC_MESSAGES, true, SessionOpts::PROXIMITY_ANY, TRANSPORT_ANY); status = m_Bus->BindSessionPort(servicePort, sessionOpts, *m_NotificationProducerListener); if (status != ER_OK) { QCC_LogError(status, ("Could not bind Session Port successfully")); goto exit; } else { QCC_DbgPrintf(("bind Session Port successfully for notification producer service")); } } //Code handles NotificationProducerReceiver - End //Handling NotificationDismisserSender - start here cleanupNotificationDismisserSenderInternal(); cleanupNotificationDismisserReceiverInternal(); m_NotificationDismisserSender = new NotificationDismisserSender(m_Bus, AJ_NOTIFICATION_DISMISSER_PATH, status); if (status != ER_OK) { QCC_LogError(status, ("Could not create NotificationDismisserSender.")); goto exit; } status = m_Bus->RegisterBusObject(*m_NotificationDismisserSender); if (status != ER_OK) { QCC_LogError(status, ("Could not register NotificationDismisserSender.")); goto exit; } //Handling NotificationDismisserSender - end here exit: //label exit if (status == ER_OK) { QCC_DbgTrace(("Started Sender successfully")); } else { //if (status != ER_OK) QCC_LogError(status, ("Started Sender with error.")); cleanupSenderTransport(); } return status; } QStatus Transport::startReceiverTransport(BusAttachment* bus) { QStatus status = ER_OK; if ((status = setBusAttachment(bus)) != ER_OK) { QCC_LogError(status, ("Could not start Receiver Transport. BusAttachment is not valid")); goto exit; } if (m_Consumer == NULL) { m_Consumer = new NotificationTransportConsumer(m_Bus, AJ_CONSUMER_SERVICE_PATH, status); if (status != ER_OK) { QCC_LogError(status, ("Could not create Consumer BusObject.")); goto exit; } status = m_Bus->RegisterBusObject(*m_Consumer); if (status != ER_OK) { QCC_LogError(status, ("Could not register Consumer BusObject.")); goto exit; } String AJ_NOTIFICATION_INTERFACE_MATCH = "type='signal',sessionless='t',interface='" + AJ_NOTIFICATION_INTERFACE_NAME + "'"; QCC_DbgPrintf(("Match String is: %s", AJ_NOTIFICATION_INTERFACE_MATCH.c_str())); status = m_Bus->AddMatch(AJ_NOTIFICATION_INTERFACE_MATCH.c_str()); if (status != ER_OK) { QCC_LogError(status, ("Could not add filter match for notification service.")); goto exit; } } //Handling NotificationProducerSender - Start if (m_NotificationProducerSender == NULL) { cleanupNotificationProducerReceiverInternal(); m_NotificationProducerSender = new NotificationProducerSender(m_Bus, status); if (status != ER_OK) { QCC_LogError(status, ("Could not create NotificationProducerSender BusObject.")); goto exit; } status = m_Bus->RegisterBusObject(*m_NotificationProducerSender); if (status != ER_OK) { QCC_LogError(status, ("Could not register NotificationProducerSender BusObject.")); goto exit; } } //Handling NotificationProducerSender - End //Handling NotificationDismisserReceiver - Start if (m_NotificationDismisserReceiver == NULL) { cleanupNotificationDismisserSenderInternal(); m_NotificationDismisserReceiver = new NotificationDismisserReceiver(m_Bus, status); if (status != ER_OK) { QCC_LogError(status, ("Could not create NotificationDismisserReceiver BusObject.")); goto exit; } status = m_Bus->RegisterBusObject(*m_NotificationDismisserReceiver); if (status != ER_OK) { QCC_LogError(status, ("Could not register m_NotificationDismisserReceiver BusObject.")); goto exit; } String AJ_DISMISSER_INTERFACE_MATCH = "type='signal',sessionless='t',interface='" + AJ_NOTIFICATION_DISMISSER_INTERFACE + "'"; QCC_DbgPrintf(("NotificationDismisserReceiver Match String is: %s", AJ_DISMISSER_INTERFACE_MATCH.c_str())); status = m_Bus->AddMatch(AJ_DISMISSER_INTERFACE_MATCH.c_str()); if (status != ER_OK) { QCC_LogError(status, ("Could not add filter match.")); goto exit; } } //Handling NotificationDismisserReceiver - End //Handling NotificationDismisserSender - Start if (m_NotificationDismisserSender == NULL) { cleanupNotificationDismisserReceiverInternal(); m_NotificationDismisserSender = new NotificationDismisserSender(m_Bus, AJ_NOTIFICATION_DISMISSER_PATH, status); if (status != ER_OK) { QCC_LogError(status, ("Could not create NotificationDismisserSender.")); goto exit; } status = m_Bus->RegisterBusObject(*m_NotificationDismisserSender); if (status != ER_OK) { QCC_LogError(status, ("Could not register BusObject.")); goto exit; } } exit: if (status != ER_OK) { QCC_LogError(status, ("Not listening to any producers")); cleanupReceiverTransport(); } else { QCC_DbgPrintf(("Started Receiver successfully")); } return status; } void Transport::cleanupTransportProducer(int32_t messageTypeIndx, bool unregister) { QCC_DbgTrace(("Transport::cleanupTransportProducer - Start")); for (; messageTypeIndx >= 0; messageTypeIndx--) { if (!m_Producers[messageTypeIndx]) { continue; } if (unregister) { m_Bus->UnregisterBusObject(*m_Producers[messageTypeIndx]); } delete m_Producers[messageTypeIndx]; m_Producers[messageTypeIndx] = 0; } QCC_DbgTrace(("Transport::cleanupTransportProducer - End")); } void Transport::cleanupNotificationProducerReceiver() { QCC_DbgTrace(("Transport::cleanupNotificationProducerReceiver start")); SessionPort sp = AJ_NOTIFICATION_PRODUCER_SERVICE_PORT; QStatus status = m_Bus->UnbindSessionPort(sp); if (status != ER_OK) { QCC_LogError(status, ("Could not unbind the SessionPort ")); } QCC_DbgPrintf(("cleaning NotificationProducerListener")); if (m_NotificationProducerListener) { delete m_NotificationProducerListener; m_NotificationProducerListener = 0; } if (m_NotificationProducerReceiver) { m_NotificationProducerReceiver->unregisterHandler(m_Bus); cleanupNotificationProducerReceiverInternal(); } delete m_NotificationProducerReceiver; m_NotificationProducerReceiver = NULL; QCC_DbgTrace(("Transport::cleanupNotificationProducerReceiver end")); } void Transport::cleanupNotificationProducerReceiverInternal() { QCC_DbgTrace(("Transport::cleanupNotificationProducerReceiverInternal start")); if (m_NotificationProducerReceiver) { QCC_DbgPrintf(("cleaning NotificationProducerReceiver")); m_Bus->UnregisterBusObject(*m_NotificationProducerReceiver); } QCC_DbgTrace(("Transport::cleanupNotificationProducerReceiverInternal end")); } void Transport::cleanupNotificationDismisserSender() { if (!m_NotificationDismisserSender) { return; } cleanupNotificationDismisserSenderInternal(); delete m_NotificationDismisserSender; m_NotificationDismisserSender = 0; } void Transport::cleanupNotificationDismisserSenderInternal() { if (!m_NotificationDismisserSender) { return; } m_Bus->UnregisterBusObject(*m_NotificationDismisserSender); } void Transport::cleanupNotificationDismisserReceiver() { QCC_DbgTrace(("Transport::cleanupNotificationDismisserReceiver start")); if (!m_NotificationDismisserReceiver) { return; } m_NotificationDismisserReceiver->unregisterHandler(m_Bus); cleanupNotificationDismisserReceiverInternal(); delete m_NotificationDismisserReceiver; m_NotificationDismisserReceiver = 0; QCC_DbgTrace(("Transport::cleanupNotificationDismisserReceiver end")); } void Transport::cleanupNotificationDismisserReceiverInternal() { QCC_DbgTrace(("Transport::cleanupNotificationDismisserReceiverInternal start")); if (m_NotificationDismisserReceiver) { m_Bus->UnregisterBusObject(*m_NotificationDismisserReceiver); } QCC_DbgTrace(("Transport::cleanupNotificationDismisserReceiverInternal end")); } void Transport::cleanupSenderTransport() { cleanupNotificationDismisserSender(); cleanupNotificationProducerSender(); cleanupNotificationProducerReceiver(); cleanupTransportProducer(MESSAGE_TYPE_CNT - 1, true); } void Transport::cleanupReceiverTransport() { QCC_DbgTrace(("Transport::cleanupReceiverTransport start")); cleanupNotificationDismisserReceiver(); cleanupNotificationProducerSender(); cleanupTransportConsumer(true); QCC_DbgTrace(("Transport::cleanupReceiverTransport end")); } void Transport::cleanupTransportConsumer(bool unregister) { QCC_DbgTrace(("Transport::cleanupTransportConsumer start")); if (!m_Consumer) { return; } if (unregister) { m_Consumer->unregisterHandler(m_Bus); cleanupTransportConsumerInternal(); } delete m_Consumer; m_Consumer = 0; QCC_DbgTrace(("Transport::cleanupTransportConsumer end")); } void Transport::cleanupTransportConsumerInternal(void) { QCC_DbgTrace(("Transport::cleanupTransportConsumerInternal start")); if (!m_Consumer) { return; } m_Bus->UnregisterBusObject(*m_Consumer); QCC_DbgTrace(("Transport::cleanupTransportConsumerInternal end")); } void Transport::cleanupNotificationProducerSender() { QCC_DbgTrace(("Transport::cleanupNotificationProducerSender start")); if (!m_NotificationProducerSender) { return; } cleanupNotificationProducerSenderInternal(); delete m_NotificationProducerSender; m_NotificationProducerSender = 0; QCC_DbgTrace(("Transport::cleanupNotificationProducerSender end")); } void Transport::cleanupNotificationProducerSenderInternal() { QCC_DbgTrace(("Transport::cleanupNotificationProducerSender start")); if (!m_NotificationProducerSender) { return; } m_Bus->UnregisterBusObject(*m_NotificationProducerSender); QCC_DbgTrace(("Transport::cleanupNotificationProducerSender end")); } void Transport::cleanup() { if (m_Bus == 0) { return; } Notification::m_AsyncTaskQueue.Stop(); cleanupSenderTransport(); cleanupReceiverTransport(); m_Bus = 0; s_Instance = 0; delete this; } ajn::BusAttachment* Transport::getBusAttachment() { return m_Bus; } NotificationProducerSender* Transport::getNotificationProducerSender() { return m_NotificationProducerSender; } NotificationProducerReceiver* Transport::getNotificationProducerReceiver() { return m_NotificationProducerReceiver; } NotificationDismisserSender* Transport::getNotificationDismisserSender() { return m_NotificationDismisserSender; } NotificationReceiver* Transport::getNotificationReceiver() { return m_Receiver; } base-15.09/notification/cpp/src/Transport.h000066400000000000000000000212221262264444500206560ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef TRANSPORT_H_ #define TRANSPORT_H_ #include #include #include #include "NotificationConstants.h" namespace ajn { namespace services { class Notification; class NotificationReceiver; class NotificationProducerSender; class NotificationProducerReceiver; class NotificationProducerListener; class NotificationDismisserSender; class NotificationDismisserReceiver; class NotificationConstants; class NotificationTransportConsumer; class NotificationTransportProducer; /** * Class Used for all Transport related tasks including initializing and shutting * down the BusObjects of the services and sending and receiving messages */ class Transport { public: /** * Destructor of Transport */ ~Transport(); /** * static function to get an Instance of the Transport class * @return pointer to Transport instance */ static Transport* getInstance(); /** * Sets the internal NotificationReceiver to the one * provided in the parameter * @param notificationReceiver */ void setNotificationReceiver(NotificationReceiver* notificationReceiver); /** * Start the Sender Transport: * Create a BusAttachment if one doesn't exist. * Create the NotificationTransportProducers (one per MessageType) * @param bus - The busAttachment to be used * @return status */ QStatus startSenderTransport(ajn::BusAttachment* bus); /** * Start the Receiver Transport: * Create a BusAttachment if one doesn't exist. * create the NotificationTransportConsumer to handle the signals * @param bus - the busAttachment to be used * @return status */ QStatus startReceiverTransport(ajn::BusAttachment* bus); /** * Send Notification * @param messageType * @param notificationArgs * @param ttl * @return status */ QStatus sendNotification(NotificationMessageType messageType, ajn::MsgArg const notificationArgs[nsConsts::AJ_NOTIFY_NUM_PARAMS], uint16_t ttl); /** * Delete the last Signal sent off for this messageType * @param messageType * @return status */ QStatus deleteLastMsg(NotificationMessageType messageType); /** * Delete Signal sent off for this messageType * @param messageId * @return status */ QStatus deleteMsg(int32_t msgId); /** * Get the notification id of the last message that was sent with given MessageType * @param messageType * @param messageId * @return status */ QStatus getLastMsgId(NotificationMessageType messageType, int32_t* messageId); /** * Pass on the notification received to the NotificationReceiver * @param notification */ void onReceivedNotification(Notification const& notification); /** * Called on shutdown. Cleans up Alljoyn objects and frees memory where necessary */ void cleanup(); /** * Cleanup the TransportConsumer objects. Also Unregisteres the BusObject depending on input param * @param unregister - should BusObject be Unregistered from Bus */ void cleanupTransportConsumer(bool unregister = false); /** * Cleanup all Sender Transport objects. and Unregister the BusObject */ void cleanupSenderTransport(); /** * Cleanup all Receiver Transport objects. and Unregister the BusObject */ void cleanupReceiverTransport(); /** * Cleanup AnnouncementListener object. Also Unregisteres the listener from the aboutclient * @param unregister - should listener be Unregistered from aboutclient */ void cleanupAnnouncementListener(bool unregister = false); /** * Cleanup cleanupNotificationProducerSender. and Unregister the BusObject. */ void cleanupNotificationProducerSender(); /** * getBusAttachment - returns BusObject */ ajn::BusAttachment* getBusAttachment(); /** * get function for NotificationProducerSender */ NotificationProducerSender* getNotificationProducerSender(); /** * get function for NotificationProducerReceiver */ NotificationProducerReceiver* getNotificationProducerReceiver(); /** * get function for NotificationDismisserSender */ NotificationDismisserSender* getNotificationDismisserSender(); /** * get function for NotificationReceiver */ NotificationReceiver* getNotificationReceiver(); private: /** * Private Constructor - singleton Class */ Transport(); /** * Sets the internal busAttachment to the one * provided in the parameter * @param bus * @return success/failure */ QStatus setBusAttachment(ajn::BusAttachment* bus); /** * Cleanup the TransportProducer objects. Start from messageTypeIndx param and work backwards * Also Unregisters the BusObject depending on input param * @param messageTypeIndx - messageTypeIndx to start from * @param unregister - should BusObject be Unregistered from Bus */ void cleanupTransportProducer(int32_t messageTypeIndx, bool unregister = false); /** * cleanupSenderProducerReceiver */ void cleanupNotificationProducerReceiver(); /** * cleanupSenderProducerReceiver */ void cleanupNotificationProducerReceiverInternal(); /** * cleanupNotificationDismisserSender */ void cleanupNotificationDismisserSender(); /** * cleanupNotificationDismisserSender */ void cleanupNotificationDismisserSenderInternal(); /** * cleanupNotificationDismisserReceiver */ void cleanupNotificationDismisserReceiver(); /** * cleanupNotificationDismisserReceiver */ void cleanupNotificationDismisserReceiverInternal(); /** * Cleanup cleanupNotificationProducerSender. and Unregister the BusObject. */ void cleanupNotificationProducerSenderInternal(); /** * Cleanup the TransportConsumer objects. Also Unregisteres the BusObject depending on input param * @param unregister - should BusObject be Unregistered from Bus */ void cleanupTransportConsumerInternal(void); /** * Static instance of Transport. Makes Transport a singleton */ static Transport* s_Instance; /** * Alljoyn BusAttachment that will be used to connect to Bus */ ajn::BusAttachment* m_Bus; /** * NotificationReceiver that will receive the incoming notifications * Must be created external from library and passed in */ NotificationReceiver* m_Receiver; /** * The BusObjects for the Producer. One per MessageType */ NotificationTransportProducer* m_Producers[MESSAGE_TYPE_CNT]; /** * The BusObjects for the Consumer. */ NotificationTransportConsumer* m_Consumer; /** * Boolean to dictate whether we send notifications or swallow them */ bool m_IsSendingDisabled; /** * Boolean to dictate whether we receive notifications or swallow them */ bool m_IsReceivingDisabled; /** * NotificationProducerSender */ NotificationProducerSender* m_NotificationProducerSender; /** * NotificationProducerReceiver */ NotificationProducerReceiver* m_NotificationProducerReceiver; /** * NotificationProducerListener */ NotificationProducerListener* m_NotificationProducerListener; /** * NotificationDismisserSender */ NotificationDismisserSender* m_NotificationDismisserSender; /** * NotificationDismisserReceiver */ NotificationDismisserReceiver* m_NotificationDismisserReceiver; }; } //namespace services } //namespace ajn #endif /* TRANSPORT_H_ */ base-15.09/notification/ios/000077500000000000000000000000001262264444500157335ustar00rootroot00000000000000base-15.09/notification/ios/inc/000077500000000000000000000000001262264444500165045ustar00rootroot00000000000000base-15.09/notification/ios/inc/alljoyn/000077500000000000000000000000001262264444500201545ustar00rootroot00000000000000base-15.09/notification/ios/inc/alljoyn/notification/000077500000000000000000000000001262264444500226425ustar00rootroot00000000000000base-15.09/notification/ios/inc/alljoyn/notification/AJNSNotification.h000066400000000000000000000157571262264444500261340ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/notification/Notification.h" #import "AJNSNotificationEnums.h" #import "AJNSRichAudioUrl.h" #import "AJNSNotificationText.h" /** AJNSNotification class */ @interface AJNSNotification : NSObject ///--------------------- /// @name Properties ///--------------------- /** Array which holds incoming AJNSNotificationText objects */ @property (strong, nonatomic) NSMutableArray *ajnsntArr; - (id)initWithHandle:(const ajn ::services ::Notification *)handle; ///--------------------- /// @name Initialization ///--------------------- /** Designated initializer @param messageId The message id @param messageType The message type @param deviceId The device id @param deviceName The device name @param appId The app id @param appName The app name @param sender The sender name @param customAttributes The notification custom attributes @param notificationText The notification text(s) @param richIconUrl The rich icon url @param richAudioUrl The rich audio url @param richIconObjectPath The rich icon object path @param richAudioObjectPath The rich audio object path @param controlPanelServiceObjectPath The control panel service object path @return a `AJNSNotification` object */ - (AJNSNotification *)initWithMessageId:(int32_t)messageId messageType:(AJNSNotificationMessageType)messageType deviceId:(NSString *)deviceId deviceName:(NSString *)deviceName appId:(NSString *)appId appName:(NSString *)appName sender:(NSString *)sender customAttributes:(NSMutableDictionary *)customAttributes notificationText:(NSMutableArray *)notificationText richIconUrl:(NSString *)richIconUrl richAudioUrl:(NSMutableArray *)richAudioUrl richIconObjectPath:(NSString *)richIconObjectPath richAudioObjectPath:(NSString *)richAudioObjectPath controlPanelServiceObjectPath:(NSString *)controlPanelServiceObjectPath; /** AJNSNotification initializer @param messageType The message type @param notificationText The notification text(s) @return a `AJNSNotification` object */ - (AJNSNotification *)initWithMessageType:(AJNSNotificationMessageType)messageType andNotificationText:(NSMutableArray *)notificationText; ///--------------------- /// @name reterieval methods ///--------------------- /** Get the ProtoVersion @return protoversion The notification proto version */ - (int16_t)version; /** Get the device Id @return deviceId The notification device id */ - (NSString *)deviceId; /** Get the Device Name @return deviceName */ - (NSString *)deviceName; /** Get the app Id @return appId */ - (NSString *)appId; /** Get the app Name @return appName */ - (NSString *)appName; /** Get the map of customAttributes @return customAttributes */ - (NSMutableDictionary *)customAttributes; /** Get the Message Id @return notificationId */ - (int32_t)messageId; /** Get the Sender @return Sender */ - (NSString *)senderBusName; /** Get the MessageType @return MessageType */ - (AJNSNotificationMessageType)messageType; /** Get the Notification Text @return notificationText */ - (NSArray *)text; /** Get the Rich Icon Url @return RichIconUrl */ - (NSString *)richIconUrl; /** Get the Rich Icon Object Path @return richIconObjectPath */ - (NSString *)richIconObjectPath; /** Get the Rich Audio Object Path @return richAudioObjectPath */ - (NSString *)richAudioObjectPath; /** Get the Rich Audio Urls @param inputArray array of URLs @return RichAudioUrl */ - (void)richAudioUrl:(NSMutableArray *)inputArray; /** Get the ControlPanelService object path @return ControlPanelServiceObjectPath */ - (NSString *)controlPanelServiceObjectPath; ///--------------------- /// @name Setters ///--------------------- /** Set the App Id of the Notification @param appId The app id */ - (void)setAppId:(NSString *)appId; /** Set the App Name of the Notification @param appName The app name */ - (void)setAppName:(NSString *)appName; /** Set the Control Panel Service Object Path of the Notification @param controlPanelServiceObjectPath The control panel service object path */ - (void)setControlPanelServiceObjectPath:(NSString *)controlPanelServiceObjectPath; /** Set the Custom Attributed of the Notification @param customAttributes The notification custom attributes */ - (void)setCustomAttributes:(NSMutableDictionary *)customAttributes; /** Set the deviceId of the Notification @param deviceId The device id */ - (void)setDeviceId:(NSString *)deviceId; /** Set the deviceName of the Notification @param deviceName The device name */ - (void)setDeviceName:(NSString *)deviceName; /** Set the messageId of the Notification @param messageId The message id */ - (void)setMessageId:(int32_t)messageId; /** Set the richAudioUrl of the Notification @param richAudioUrl The rich audio url */ - (void)setRichAudioUrl:(NSMutableArray *)richAudioUrl; /** Set the richIconUrl of the Notification @param richIconUrl The rich icon url */ - (void)setRichIconUrl:(NSString *)richIconUrl; /** Set the richIconObjectPath of the Notification @param richIconObjectPath The rich icon object path */ - (void)setRichIconObjectPath:(NSString *)richIconObjectPath; /** Set the richAudioObjectPath of the Notification @param richAudioObjectPath The rich audio object path */ - (void)setRichAudioObjectPath:(NSString *)richAudioObjectPath; /** Set the sender name of the Notification @param sender The sender name */ - (void)setSender:(NSString *)sender; - (QStatus) dismiss; /** * Populate a temporary array to hold incoming AJNSNotificationText objects * This method is called when a new notification is coming */ - (void)createAJNSNotificationTextArray; @property (nonatomic, readonly)ajn::services::Notification * handle; @end base-15.09/notification/ios/inc/alljoyn/notification/AJNSNotificationEnums.h000066400000000000000000000034141262264444500271270ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef AJNSNOTIFICATIONENUMS_H_ #define AJNSNOTIFICATIONENUMS_H_ /** AJNSNotificationEnums class */ @interface AJNSNotificationEnums : NSObject /** @enum AJNSNotificationMessageType enum @abstract AJNSNotificationMessageType DBus request status return values. */ typedef NS_ENUM (NSInteger, AJNSNotificationMessageType) { /** EMERGENCY - Urgent Message */ EMERGENCY = 0, /** WARNING - Warning Message */ WARNING = 1, /** INFO - Informational Message */ INFO = 2, /** MESSAGE_TYPE_CNT - Number of Message Types Defined */ MESSAGE_TYPE_CNT = 3, UNSET = 4 }; /** Convet AJNSNotificationMessageType to an NSString format @param msgType DBus request status @return message type in an NSString format(Capital letters) */ + (NSString *)AJNSMessageTypeToString:(AJNSNotificationMessageType)msgType; @end #endif base-15.09/notification/ios/inc/alljoyn/notification/AJNSNotificationReceiver.h000066400000000000000000000031641262264444500276060ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef AJNSNOTIFICATIONRECEIVER_H_ #define AJNSNOTIFICATIONRECEIVER_H_ #import #import "alljoyn/notification/NotificationReceiver.h" #import "AJNSNotification.h" /** AJNSNotificationReceiver class */ @protocol AJNSNotificationReceiver /** * Pure abstract function that receives a notification * Consumer Application must override this method * @param notification the notification that is received */ - (void)receive:(AJNSNotification *)notification; /** * Dismiss handler * @param msgId message ID to dismiss * @param appId app ID to use */ - (void)dismissMsgId:(const int32_t)msgId appId:(NSString*) appId; @end #endif base-15.09/notification/ios/inc/alljoyn/notification/AJNSNotificationReceiverAdapter.h000066400000000000000000000036461262264444500311140ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/notification/NotificationReceiver.h" #import "alljoyn/notification/Notification.h" #import "AJNSNotificationReceiver.h" /** NotificationReceiverAdapter class */ class AJNSNotificationReceiverAdapter : public ajn::services::NotificationReceiver { public: /** NotificationReceiverAdapter @param notificationReceiverHandler a AJNSNotificationReceiver handler */ AJNSNotificationReceiverAdapter(id notificationReceiverHandler); /** receive a notification @param notification the notification will be populated inside this param */ void Receive(ajn::services::Notification const& notification); /** Dismiss handler @param msgId message ID to dismiss @param appId app ID to use */ void Dismiss(const int32_t msgId, const qcc::String appId); /** The handler of the receiver */ id ajnsNotificationReceiverHandler; }; base-15.09/notification/ios/inc/alljoyn/notification/AJNSNotificationSender.h000066400000000000000000000046341262264444500272650ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/notification/NotificationSender.h" #import "alljoyn/notification/Notification.h" #import "alljoyn/notification/NotificationEnums.h" #import "AJNSNotificationEnums.h" #import "AJNSNotification.h" #import "alljoyn/about/AJNPropertyStore.h" #import "alljoyn/about/AJNAboutPropertyStoreImpl.h" /** AJNSNotificationSender class */ @interface AJNSNotificationSender : NSObject ///--------------------- /// @name Properties ///--------------------- /** NotificationSender Handler*/ @property (nonatomic)ajn::services::NotificationSender * senderHandle; ///--------------------- /// @name Initialization ///--------------------- /** * Designated initializer * @param propertyStore property store */ - (AJNSNotificationSender *)initWithPropertyStore:(AJNAboutPropertyStoreImpl *)propertyStore; ///--------------------- /// @name Instance methods ///--------------------- /** * Send notification * @param ajnsNotification `ajnsNotification` object * @param ttl message ttl * @return status */ - (QStatus)send:(AJNSNotification *)ajnsNotification ttl:(uint16_t)ttl; /** * Delete last message that was sent with given MessageType * @param messageType MessageType of message to be deleted * @return status */ - (QStatus)deleteLastMsg:(AJNSNotificationMessageType)messageType; /** * Get the property store in this sender * @return The property store */ - (ajn ::services ::AboutPropertyStoreImpl *)getPropertyStore; @end base-15.09/notification/ios/inc/alljoyn/notification/AJNSNotificationService.h000066400000000000000000000064351262264444500274460ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/notification/NotificationService.h" #import "AJNSNotificationReceiverAdapter.h" #import "AJNSNotificationReceiver.h" #import "AJNSNotificationSender.h" #import "AJNBusAttachment.h" #import "alljoyn/services_common/AJSVCGenericLoggerAdapter.h" /** AJNSNotificationService class */ @interface AJNSNotificationService : NSObject ///--------------------- /// @name Properties ///--------------------- /** * Get Instance of AJNSNotificationServiceImpl * @return instance */ + (id)sharedInstance; /** * Initialize Producer side via Transport. Create and * return NotificationSender. * @param bus ajn bus * @param store property store * @return NotificationSender instance */ - (AJNSNotificationSender *)startSendWithBus:(AJNBusAttachment *)bus andPropertyStore:(AJNAboutPropertyStoreImpl *)store; /** * Initialize Consumer side via Transport. * Set NotificationReceiver to given receiver * @param bus ajn bus * @param ajnsNotificationReceiver notification receiver * @return status */ - (QStatus)startReceive:(AJNBusAttachment *)bus withReceiver:(id )ajnsNotificationReceiver; /** * Stops sender but leaves bus and other objects alive */ - (void)shutdownSender; /** * Stops receiving but leaves bus and other objects alive */ - (void)shutdownReceiver; /** * Cleanup and get ready for shutdown */ - (void)shutdown; /** @deprecated SuperAgent was deprecated in May 2015 for 15.04 * release * Disabling superagent mode. Needs to be called before * starting receiver * @return status */ - (QStatus)disableSuperAgent DEPRECATED_ATTRIBUTE; /** * Get the currently-configured logger implementation * @return logger Implementation of GenericLogger */ - (id )logger; /** * Set log level filter for subsequent logging messages * @param newLogLevel enum value * @return logLevel enum value that was in effect prior to this change */ - (void)setLogLevel:(QLogLevel)newLogLevel; /** * Get log level filter value currently in effect * @return logLevel enum value currently in effect */ - (QLogLevel)logLevel; /** * Virtual method to get the busAttachment used in the service. */ - (AJNBusAttachment *)busAttachment; /** * Get the Version of the NotificationService * @return the NotificationService version */ - (uint16_t)version; @end base-15.09/notification/ios/inc/alljoyn/notification/AJNSNotificationText.h000066400000000000000000000040101262264444500267550ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/notification/NotificationText.h" /** AJNSNotificationText class. */ @interface AJNSNotificationText : NSObject ///--------------------- /// @name Properties ///--------------------- /** Initialize notification text with language and text @param language The language of this notification text @param text The text of the notification text @return pointer to the noficiation text object */ - (AJNSNotificationText *)initWithLang:(NSString *)language andText:(NSString *)text; /** * Set Language for Notification * @param language set the language of the notification text */ - (void)setLanguage:(NSString *)language; /** * Get Language for Notification * @return language of this notification text */ - (NSString *)getLanguage; /** * Set Text for Notification * @param text set the text for this notification text */ - (void)setText:(NSString *)text; /** * Get Text for Notification * @return text */ - (NSString *)getText; @property (nonatomic, readonly)ajn::services::NotificationText * handle; @end base-15.09/notification/ios/inc/alljoyn/notification/AJNSPropertyStore.h000066400000000000000000000054411262264444500263340ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef AJNSPROPERTYSTORE_H_ #define AJNSPROPERTYSTORE_H_ #import #import "Status.h" /** AJNSPropertyStore protocol overview */ @protocol AJNSPropertyStore #pragma mark – Protocol enum ///--------------------- /// @name Protocol enum ///--------------------- /** * Filter has three possible values ANNOUNCE, READ,WRITE * READ is for data that is marked as read * ANNOUNCE is for data that is marked as announce * WRITE is for data that is marked as write */ typedef NS_ENUM (NSInteger, AJNSFilter) { ANNOUNCE, /** ANNOUNCE Property that has ANNOUNCE enabled */ READ, /** READ Property that has READ enabled */ WRITE, /* WRITE Property that has WRITE enabled */ }; #pragma mark – Protocol methods /** Calls Reset() implemented only for ConfigService @return status */ - (QStatus)Reset; /** Reads all properties method @param languageTag is the language to use for the action can be NULL meaning default. @param filter filter describe which properties to read. @param all all reference to MsgArg @return status */ - (QStatus)ReadAllWithLanguageTag:(NSString *)languageTag andFilter:(AJNSFilter)filter andAllMsgArg:(ajn ::MsgArg &)all; /** Update properties method @param name name of the property @param languageTag languageTag is the language to use for the action can be NULL meaning default. @param value value is a pointer to the data to change. @return status */ - (QStatus)UpdatePropertyName:(NSString *)name andLanguageTag:(NSString *)languageTag andValue:(ajn ::MsgArg *)value; /** Delete property method @param name name of the property @param languageTag languageTag is the language to use for the action can't be NULL. @return status */ - (QStatus)DeletePropertyName:(NSString *)name andLanguageTag:(NSString *)languageTag; @end #endif /* AJNSPROPERTYSTORE_H_ */ base-15.09/notification/ios/inc/alljoyn/notification/AJNSRichAudioUrl.h000066400000000000000000000035361262264444500260300ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/notification/RichAudioUrl.h" /** AJNSRichAudioUrl class stores RichAudio urls, a url per language */ @interface AJNSRichAudioUrl : NSObject ///--------------------- /// @name Properties ///--------------------- /** richAudioUrlHandler */ @property (nonatomic)ajn::services::RichAudioUrl * richAudioUrlHandler; @property (strong, nonatomic) NSString *url; @property (strong, nonatomic) NSString *language; #pragma mark – Initializers ///--------------------- /// @name Initialization ///--------------------- /** Designated initializer - Returns a AJNSRichAudioUrl object by a given parameters. @param language Language of Audio Content @param url URL for Audio Content */ - (AJNSRichAudioUrl *)initRichAudioUrlWithLang:(NSString *)language andUrl:(NSString *)url; - (void)setUrl:(NSString *)url; - (void)setLanguage:(NSString *)language; @end base-15.09/notification/ios/samples/000077500000000000000000000000001262264444500173775ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/000077500000000000000000000000001262264444500233465ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/.gitignore000066400000000000000000000000441262264444500253340ustar00rootroot00000000000000NotificationService.mobileprovision base-15.09/notification/ios/samples/NotificationService/ConsumerViewController.h000066400000000000000000000034661262264444500302220ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusAttachment.h" #import "alljoyn/services_common/AJSVCGenericLoggerDefaultImpl.h" @interface ConsumerViewController : UIViewController @property (weak, nonatomic) UIViewController *mainVC; @property (weak, nonatomic) IBOutlet UIButton *consumerLangButton; @property (weak, nonatomic) IBOutlet UIButton *dismissChosen; @property (weak, nonatomic) IBOutlet UIButton *actionOnChosen; @property (weak, nonatomic) IBOutlet UITableView *notificationTableView; // Shared @property (strong, nonatomic) AJNBusAttachment *busAttachment; @property (strong, nonatomic) AJSVCGenericLoggerDefaultImpl *logger; @property (strong, nonatomic) NSString *appName; @property (strong, nonatomic) NSString *consumerLang; - (QStatus)startConsumer; - (void)stopConsumer:(bool) isProducerOn; @end base-15.09/notification/ios/samples/NotificationService/ConsumerViewController.m000066400000000000000000000321161262264444500302210ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "ConsumerViewController.h" #import "alljoyn/notification/AJNSNotificationService.h" #import "alljoyn/notification/AJNSNotificationReceiver.h" #import "alljoyn/services_common/AJSVCGenericLoggerUtil.h" #import "DetailsCell.h" #import "NotificationEntry.h" #import "alljoyn/controlpanel/AJCPSGetControlPanelViewController.h" static NSString *const DEFAULT_APP_NAME = @"DISPLAY_ALL"; static NSString *const CONSUMER_DEFAULT_LANG = @"en"; @interface ConsumerViewController () @property (weak, nonatomic) AJNSNotificationService *consumerService; @property (strong, nonatomic) UIAlertView *selectConsumerLang; @property (strong, nonatomic) NSMutableArray *notificationEntries; // array of NotificationEntry objects @end @implementation ConsumerViewController - (void)viewDidLoad { [super viewDidLoad]; [self.view setHidden:YES]; [self.notificationTableView setContentOffset:self.notificationTableView.contentOffset animated:NO]; _notificationEntries = [[NSMutableArray alloc] init]; } - (void) viewWillAppear:(BOOL)animated { [self.navigationController setNavigationBarHidden:YES animated:NO]; [super viewWillAppear:animated]; } - (QStatus)startConsumer { QStatus status; // Initialize Service object and send it Notification Receiver object self.consumerService = [AJNSNotificationService sharedInstance]; /* This is an example of using the AJNSNotificationService default Logger (QSCGenericLoggerDefaultImpl) // Get the default logger [self.consumerService logger]; // Get the default logger log level [self.consumerService logLevel] // Set a new logger level [self.consumerService setLogLevel:QLEVEL_WARN]; // Print the new log level // NSString *newLogLevel = [NSString stringWithFormat:@"Consumer Logger has started in %@ mode", [AJSVCGenericLoggerUtil toStringQLogLevel:[self.consumerService logLevel]]]; // [[self.consumerService logger] debugTag:[[self class] description] text: newLogLevel]; // Instead, you can use a self implementation logger as shown below: */ [self.consumerService setLogLevel:QLEVEL_DEBUG]; if (!self.busAttachment) { [self.logger fatalTag:[[self class] description] text:@"BusAttachment is nil"]; return ER_FAIL; } // Call "initReceive" status = [self.consumerService startReceive:self.busAttachment withReceiver:self]; if (status != ER_OK) { [self.logger fatalTag:[[self class] description] text:@"Could not initialize receiver"]; return ER_FAIL; } // Set Consumer UI [self.logger debugTag:[[self class] description] text:@"Waiting for notifications"]; return ER_OK; } - (void)stopConsumer:(bool) isProducerOn { [self.logger debugTag:[[self class] description] text:@"Stop Consumer service"]; if (self.consumerService && isProducerOn) { [self.consumerService shutdownReceiver]; [self.logger debugTag:[[self class] description] text:@"calling shutdownReceiver"]; } else { [self.consumerService shutdown]; [self.logger debugTag:[[self class] description] text:@"calling shutdown"]; } self.consumerService = nil; [self.notificationEntries removeAllObjects]; [self.notificationTableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; } // Add AJNSNotification text to the scroll view - (void)addToUITableView:(AJNSNotification *)ajnsNotification { NotificationEntry *notificationEntry= [[NotificationEntry alloc] initWithAJNSNotification:ajnsNotification andConsumerViewController:self ]; notificationEntry.dismissed = NO; [self.notificationEntries addObject:notificationEntry]; [self.notificationTableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:YES]; [self scrollToLastRow]; } -(void)logNotification:(AJNSNotification *)ajnsNotification { NSMutableString *notificationContent = [[NSMutableString alloc] init]; [notificationContent appendFormat:@"Application name: %@\n[current app name is %@]\n", [ajnsNotification appName], self.appName]; [notificationContent appendFormat:@"Message id: '%d'\n",[ajnsNotification messageId]]; [notificationContent appendFormat:@"MessageType: '%@'\n",[AJNSNotificationEnums AJNSMessageTypeToString:[ajnsNotification messageType]]]; [notificationContent appendFormat:@"Device id: '%@'\n",[ajnsNotification deviceId]]; [notificationContent appendFormat:@"Device Name: '%@'\n",[ajnsNotification deviceName]]; [notificationContent appendFormat:@"Sender: '%@'\n",[ajnsNotification senderBusName]]; [notificationContent appendFormat:@"AppId: '%@'\n",[ajnsNotification appId]]; // [notificationContent appendFormat:@"CustomAttributes: '%@'\n",[ajnsNotification.customAttributes description]]; [notificationContent appendFormat:@"richIconUrl: '%@'\n",[ajnsNotification richIconUrl]]; NSMutableArray *array = [[NSMutableArray alloc]init]; [ajnsNotification richAudioUrl:array]; if ([array count]) { [notificationContent appendString:@"RichAudioUrl: "]; for (AJNSRichAudioUrl *richAudioURL in array) { [notificationContent appendFormat:@"'%@'",[richAudioURL url]]; } [notificationContent appendString:@"\n"]; } else { [notificationContent appendFormat:@"RichAudioUrl is empty\n"]; } [notificationContent appendFormat:@"richIconObjPath: '%@'\n",[ajnsNotification richIconObjectPath]]; [notificationContent appendFormat:@"RichAudioObjPath: '%@'\n",[ajnsNotification richAudioObjectPath]]; [notificationContent appendFormat:@"CPS Path: '%@'\n",[ajnsNotification controlPanelServiceObjectPath]]; AJNSNotificationText *nt = ajnsNotification.ajnsntArr[0]; [notificationContent appendFormat:@"First msg: '%@' [total: %lu]\n", [nt getText], (unsigned long)[ajnsNotification.ajnsntArr count]]; [notificationContent appendFormat:@"Received message Lang: '%@'\n",[nt getLanguage]]; [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Received new Notification:\n%@", notificationContent]]; } #pragma mark - AJNSNotificationReceiver protocol methods - (void)dismissMsgId:(const int32_t)msgId appId:(NSString*) appId { // find the message: for (NotificationEntry *entry in self.notificationEntries) { if ([entry.ajnsNotification messageId] == msgId && [[entry.ajnsNotification appId] isEqualToString:appId]) { [entry setDismissed:YES]; [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"msgId:%d appId:%@ dismissed",msgId,appId]]; } } [self.notificationTableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; } // Parse AJNSNotification into a string - (void)receive:(AJNSNotification *)ajnsNotification { [self logNotification:ajnsNotification]; //show notification only if (appName is DISPLAY_ALL) || (received app name matches appName) if ((([self.appName isEqualToString:DEFAULT_APP_NAME]) || ([[ajnsNotification appName] isEqualToString:self.appName]))) { if (self.consumerLang == nil) { self.consumerLang = CONSUMER_DEFAULT_LANG; } [self addToUITableView:ajnsNotification]; } else { [self.logger debugTag:[[self class] description] text:@"The received msg app name does not match the application name"]; return; } } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } - (void)showSelectLanguageAlert { NSArray *langArray = [[NSMutableArray alloc] initWithObjects:@"English", @"Hebrew", @"Russian", nil]; self.selectConsumerLang = [[UIAlertView alloc] initWithTitle:@"Select Language" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; for (NSString *str in langArray) { [self.selectConsumerLang addButtonWithTitle:str]; } [self.selectConsumerLang show]; } #pragma mark - UIAlertView delegate function - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { if (buttonIndex == 0) { return; // Cancel pressed } if (alertView == self.selectConsumerLang) { self.consumerLang = [self convertToLangCode:[alertView buttonTitleAtIndex:buttonIndex]]; [self.consumerLangButton setTitle:[alertView buttonTitleAtIndex:buttonIndex] forState:UIControlStateNormal]; } } #pragma mark - Application util methods - (NSString *)convertToLangCode:(NSString *)value { if ([value isEqualToString:@"English"]) { return @"en"; } else if ([value isEqualToString:@"Hebrew"]) { return @"he"; } else if ([value isEqualToString:@"Russian"]) { return @"ru"; } return nil; } #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections - Currently we use only 1 section return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. return [self.notificationEntries count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { DetailsCell *cell = (DetailsCell *)[tableView dequeueReusableCellWithIdentifier:@"detailsCell" forIndexPath:indexPath]; cell.notificationEntry = self.notificationEntries[indexPath.row]; // Configure the cell... cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; } #pragma mark - IBActions - (IBAction)consumerLangButtonPressed:(UIButton *)sender { [self showSelectLanguageAlert]; } - (IBAction)dismissChosenPressed:(UIButton *)sender { for (NotificationEntry *entry in self.notificationEntries) { if (entry.chosen) { NSLog(@"sending dismiss to %@",[entry.ajnsNotification text]); [entry.ajnsNotification dismiss]; } } } - (IBAction)actionOnChosenPressed:(UIButton *)sender { __block NSInteger cnt = 0; [self.notificationEntries enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { NotificationEntry *entry = (NotificationEntry *)obj; if (entry.chosen) { cnt++; } }]; if (cnt > 1) { [[[UIAlertView alloc]initWithTitle:@"More than one notification chosen" message:@"select single notification to get notification with action" delegate:Nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; return; } for (NotificationEntry *entry in self.notificationEntries) { if (entry.chosen) { NSLog(@"Action requested."); // Checking if entry has CPS objectpath NSString *cpsObjectPath = [entry.ajnsNotification controlPanelServiceObjectPath]; if ([cpsObjectPath length]) { GetControlPanelViewController *controlPanelViewController = [[GetControlPanelViewController alloc] initWithNotificationSenderBusName:[entry.ajnsNotification senderBusName] cpsObjectPath:[entry.ajnsNotification controlPanelServiceObjectPath] bus:self.busAttachment]; [self.navigationController setNavigationBarHidden:NO]; [self.navigationController pushViewController:controlPanelViewController animated:YES]; } else { NSLog(@"%@ has no CPS object path", [entry.ajnsNotification text]); [[[UIAlertView alloc] initWithTitle:@"Info" message:@"This notification doesn't have an action." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; //deselect cell entry.chosen = NO; [self.notificationTableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:YES]; } } } } -(void)scrollToLastRow { [NSThread sleepForTimeInterval:1]; int lastRowNumber = [self.notificationTableView numberOfRowsInSection:0] - 1; NSIndexPath* ip = [NSIndexPath indexPathForRow:lastRowNumber inSection:0]; [self.notificationTableView scrollToRowAtIndexPath:ip atScrollPosition:UITableViewScrollPositionTop animated:YES]; } @end base-15.09/notification/ios/samples/NotificationService/DetailsCell.h000066400000000000000000000022641262264444500257100ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "NotificationEntry.h" @interface DetailsCell : UITableViewCell @property (weak, nonatomic) IBOutlet UILabel *detailsLabel; @property (weak,nonatomic) NotificationEntry *notificationEntry; @end base-15.09/notification/ios/samples/NotificationService/DetailsCell.m000066400000000000000000000046421262264444500257170ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "DetailsCell.h" @implementation DetailsCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { } return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; if ([self.notificationEntry dismissed]) { [self setAccessoryType:UITableViewCellAccessoryNone]; [self.notificationEntry setChosen:NO]; return; } if(selected) { if (self.accessoryType == UITableViewCellAccessoryNone) { [self setAccessoryType:UITableViewCellAccessoryCheckmark]; [self.notificationEntry setChosen:YES]; } else { [self setAccessoryType:UITableViewCellAccessoryNone]; [self.notificationEntry setChosen:NO]; } } } -(void)setNotificationEntry:(NotificationEntry *)notificationEntry { _notificationEntry = notificationEntry; self.detailsLabel.text = notificationEntry.text; if([self.notificationEntry chosen]) { [self setAccessoryType:UITableViewCellAccessoryCheckmark]; } else { [self setAccessoryType:UITableViewCellAccessoryNone]; } if([self.notificationEntry dismissed]) { [self setBackgroundColor:[UIColor yellowColor]]; } else { [self setBackgroundColor:[UIColor whiteColor]]; } } @end base-15.09/notification/ios/samples/NotificationService/MainStoryboard_iPhone.storyboard000066400000000000000000001173211262264444500317240ustar00rootroot00000000000000 base-15.09/notification/ios/samples/NotificationService/MainViewController.h000066400000000000000000000024071262264444500273050ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import @interface MainViewController : UIViewController @property (weak, nonatomic) IBOutlet UITextField *appNameTextField; @property (weak, nonatomic) IBOutlet UISegmentedControl *appModeSegmentController; - (IBAction)appModeSegmentCtrlValueChanged:(id)sender; @end base-15.09/notification/ios/samples/NotificationService/MainViewController.m000066400000000000000000000235601262264444500273150ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "MainViewController.h" #import #import "AJNBus.h" #import "AJNBusAttachment.h" #import "alljoyn/services_common/AJSVCGenericLoggerDefaultImpl.h" #import "ProducerViewController.h" #import "ConsumerViewController.h" #import "NotificationUtils.h" static NSString * const DEFAULT_APP_NAME = @"DISPLAY_ALL"; static NSString * const DAEMON_QUIET_PREFIX = @"quiet@"; // For tcl static NSString * const DAEMON_NAME = @"org.alljoyn.BusNode.IoeService"; // For tcl @interface MainViewController () @property (strong, nonatomic) AJNBusAttachment *busAttachment; @property (strong, nonatomic) AJSVCGenericLoggerDefaultImpl *logger; @property (strong, nonatomic) ProducerViewController *producerVC; @property (strong, nonatomic) ConsumerViewController *consumerVC; @property (strong, nonatomic) NSString *appName; @property (nonatomic) bool isProducerOn; @property (nonatomic) bool isConsumerOn; @property (nonatomic) bool hasAppName; @end @implementation MainViewController #pragma mark - Built In methods - (void)viewDidLoad { [super viewDidLoad]; self.appModeSegmentController.momentary = true; // Set flags self.isConsumerOn = false; self.isProducerOn = false; self.hasAppName = false; } - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.destinationViewController isKindOfClass:[ProducerViewController class]]) { self.producerVC = segue.destinationViewController; } if ([segue.destinationViewController isKindOfClass:[ConsumerViewController class]]) { self.consumerVC = segue.destinationViewController; } } // Autorotation support - (BOOL)shouldAutorotate { return YES; } - (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return YES; } // Limit app rotation to portrait - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } #pragma mark - IBAction Methods // application mode (consumer/producer) - (IBAction)appModeSegmentCtrlValueChanged:(id)sender { QStatus status; if (!self.isConsumerOn && !self.isProducerOn) { [self.logger debugTag:[[self class] description] text:@"loadNewSession"]; status = [self loadNewSession]; if (ER_OK != status) { [[[UIAlertView alloc] initWithTitle:@"Startup Error" message:[NSString stringWithFormat:@"%@ (%@)",@"Failed to prepare AJNBusAttachment", [AJNStatus descriptionForStatusCode:status]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil] show]; return; } } // If application name hasn't been set - use the default if (!self.hasAppName) { self.appName = DEFAULT_APP_NAME; self.hasAppName = true; [self.appNameTextField setEnabled:NO]; } int appMode = self.appModeSegmentController.selectedSegmentIndex; switch (appMode) { case 0: // Producer if (!self.isProducerOn) { // Start producer [self.logger debugTag:[[self class] description] text:@"Starting producer...."]; // Forward shared properties self.producerVC.busAttachment = self.busAttachment; self.producerVC.logger = self.logger; self.producerVC.appName = self.appName; // Present view [self.producerVC.view setHidden:NO]; // Set service flag self.isProducerOn = true; status = [self.producerVC startProducer]; if (ER_OK != status) { [self.logger debugTag:[[self class] description] text:@"Failed to startProducer"]; [self producerCleanup]; } } else { [self producerCleanup]; } break; case 1: // Consumer if (!self.isConsumerOn) { //Start consumer [self.logger debugTag:[[self class] description] text:@"Starting consumer..."]; // Forward shared properties self.consumerVC.busAttachment = self.busAttachment; self.consumerVC.logger = self.logger; self.consumerVC.appName = self.appName; // Present view [self.consumerVC.view setHidden:NO]; // Set service flag self.isConsumerOn = true; status = [self.consumerVC startConsumer]; if (ER_OK != status) { [self.logger debugTag:[[self class] description] text:@"Failed to startConsumer"]; [[[UIAlertView alloc] initWithTitle:@"Startup Error" message:[NSString stringWithFormat:@"%@ (%@)",@"Failed to startConsumer", [AJNStatus descriptionForStatusCode:status]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil] show]; [self consumerCleanup]; } } else { [self consumerCleanup]; } break; } if (self.isConsumerOn || self.isProducerOn) { // Disable application name editing [self.logger debugTag:[[self class] description] text:@"Application has started - disable application name editing"]; [self.appNameTextField setEnabled:NO]; } // Both services are off - closing session if (!self.isConsumerOn && !self.isProducerOn) { [self closeSession]; } } - (IBAction)appNameChange:(UITextField *)sender { if ([NotificationUtils textFieldIsValid:self.appNameTextField.text]) { self.appName = self.appNameTextField.text; self.hasAppName = true; } else { self.appName = DEFAULT_APP_NAME; self.appNameTextField.text = @""; self.hasAppName = false; } } #pragma mark - Util methods - (QStatus)loadNewSession { QStatus status = ER_OK; // Set a default logger self.logger = [[AJSVCGenericLoggerDefaultImpl alloc] init]; // Set a bus if (!self.busAttachment) { status = [self prepareBusAttachment:nil]; if (ER_OK != status) { [self.logger debugTag:@"" text:@"Failed to prepareBusAttachment"]; return status; } else { [self.logger debugTag:[[self class] description] text:@"Bus is ready to use"]; } } return status; } - (void)closeSession { QStatus status; [self.logger debugTag:[[self class] description] text:@"Both services are off"]; // reset the application Text view [self.appNameTextField setEnabled:YES]; self.appNameTextField.text = @""; self.hasAppName = false; // stop bus attachment [self.logger debugTag:[[self class] description] text:@"Stopping the bus..."]; if (self.busAttachment) { status = [self.busAttachment stop]; if (status != ER_OK) { [self.logger debugTag:[[self class] description] text:@"failed to stop the bus"]; } self.busAttachment = nil; } // destroy logger if (self.logger) { self.logger = nil; } } - (QStatus)prepareBusAttachment:(id )authListener { self.busAttachment = [[AJNBusAttachment alloc] initWithApplicationName:@"CommonServiceApp" allowRemoteMessages:true]; // Start the BusAttachment QStatus status = [self.busAttachment start]; if (status != ER_OK) { [self.logger errorTag:[[self class] description] text:@"Failed to start AJNBusAttachment"]; [self.busAttachment destroy]; return ER_FAIL; } // Connect to the daemon using address provided status = [self.busAttachment connectWithArguments:nil]; if (status != ER_OK) { [self.busAttachment destroy]; return ER_FAIL; } if (authListener) { status = [self.busAttachment enablePeerSecurity:@"ALLJOYN_SRP_KEYX ALLJOYN_ECDHE_PSK" authenticationListener:authListener]; if (status != ER_OK) { [self.busAttachment destroy]; return ER_FAIL; } } // advertise Daemon status = [self.busAttachment requestWellKnownName:DAEMON_NAME withFlags:kAJNBusNameFlagDoNotQueue]; if (status == ER_OK) { //advertise the name with a quite prefix for TC to find it status = [self.busAttachment advertiseName:[NSString stringWithFormat:@"%@%@", DAEMON_QUIET_PREFIX, DAEMON_NAME] withTransportMask:kAJNTransportMaskAny]; if (status != ER_OK) { [self.busAttachment releaseWellKnownName:DAEMON_NAME]; [self.logger errorTag:[[self class] description] text:@"Failed to advertise daemon name"]; } else { [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Succefully advertised daemon name %@", DAEMON_NAME]]; } } return status; } - (void)producerCleanup { [self.logger debugTag:[[self class] description] text:@"Stopping producer...."]; [self.producerVC.view setHidden:YES]; [self.producerVC stopProducer:self.isConsumerOn]; self.isProducerOn = false; } - (void)consumerCleanup { [self.logger debugTag:[[self class] description] text:@"Stopping consumer..."]; [self.consumerVC.view setHidden:YES]; [self.consumerVC stopConsumer:self.isProducerOn]; self.isConsumerOn = false; } @end base-15.09/notification/ios/samples/NotificationService/NotificationEntry.h000066400000000000000000000027111262264444500271700ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "alljoyn/notification/AJNSNotification.h" #import "ConsumerViewController.h" @interface NotificationEntry : NSObject @property (strong, nonatomic) NSString *text; @property (nonatomic) BOOL dismissed; @property (nonatomic) BOOL chosen; @property (strong, nonatomic,readonly) AJNSNotification *ajnsNotification; - (id)initWithAJNSNotification:(AJNSNotification *) ajnsNotification andConsumerViewController:(ConsumerViewController *)consumerViewController; @end base-15.09/notification/ios/samples/NotificationService/NotificationEntry.m000066400000000000000000000104151262264444500271750ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "NotificationEntry.h" #import "NotificationUtils.h" @interface NotificationEntry () @property (strong, nonatomic) AJNSNotification *ajnsNotification; @property (weak,nonatomic) ConsumerViewController *consumerViewController; @end @implementation NotificationEntry - (id)initWithAJNSNotification:(AJNSNotification *) ajnsNotification andConsumerViewController:(ConsumerViewController *)consumerViewController { self = [super init]; if (self) { self.consumerViewController = consumerViewController; self.ajnsNotification = ajnsNotification; } return self; } -(void)setAjnsNotification:(AJNSNotification *)ajnsNotification { _ajnsNotification = ajnsNotification; //show AJNSNotification on self.notificationTextView NSString *nstr = @""; NSString *lang; bool matchLangFlag = false; nstr = [nstr stringByAppendingString:[AJNSNotificationEnums AJNSMessageTypeToString:[ajnsNotification messageType]]]; nstr = [nstr stringByAppendingFormat:@" "]; // get the msg NotificationText for (AJNSNotificationText *nt in ajnsNotification.ajnsntArr) { lang = [nt getLanguage]; if ([lang isEqualToString:self.consumerViewController.consumerLang]) { nstr = [nstr stringByAppendingString:lang]; nstr = [nstr stringByAppendingFormat:@": "]; nstr = [nstr stringByAppendingString:[nt getText]]; nstr = [nstr stringByAppendingFormat:@" "]; matchLangFlag = true; } } //for if (!matchLangFlag) { nstr = [nstr stringByAppendingString:[NSString stringWithFormat:@"\nUnknown language(s) in notification,\n the last one was '%@'",lang]]; self.text = nstr; [self.consumerViewController.logger debugTag:[[self class] description] text:@"The received message lang does not match the consumer lang settings"]; return; } // get the msg NotificationText NSString *richIconUrl = [ajnsNotification richIconUrl]; if ([NotificationUtils textFieldIsValid:richIconUrl]) { nstr = [nstr stringByAppendingFormat:@"\nicon: %@", richIconUrl]; } // get the msg richAudioUrl __strong NSMutableArray *richAudioUrlArray = [[NSMutableArray alloc] init]; [ajnsNotification richAudioUrl:richAudioUrlArray]; int i = 0; for (int x = 0; x != [richAudioUrlArray count]; x++) { [self.consumerViewController.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"%d", i]]; i++; NSString *lang = [(AJNSRichAudioUrl *)[richAudioUrlArray objectAtIndex:x] language]; NSString *audiourl = [(AJNSRichAudioUrl *)[richAudioUrlArray objectAtIndex:x] url]; [self.consumerViewController.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"lang[%@]", lang]]; [self.consumerViewController.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"audiourl[%@]", audiourl]]; if ([lang isEqualToString:(self.consumerViewController.consumerLang)]) { nstr = [nstr stringByAppendingFormat:@"\naudio: %@", audiourl]; } } //for [self.consumerViewController.logger debugTag:[[self class] description] text:([NSString stringWithFormat:@"Adding notification to view:\n %@", nstr])]; self.text = nstr; } @end base-15.09/notification/ios/samples/NotificationService/NotificationService.xcodeproj/000077500000000000000000000000001262264444500313115ustar00rootroot00000000000000project.pbxproj000066400000000000000000000716761262264444500343270ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService.xcodeproj// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 1918E02717AE7C2D0082AB83 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1918E02617AE7C2D0082AB83 /* UIKit.framework */; }; 1918E02917AE7C2D0082AB83 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1918E02817AE7C2D0082AB83 /* Foundation.framework */; }; 1918E02B17AE7C2D0082AB83 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1918E02A17AE7C2D0082AB83 /* CoreGraphics.framework */; }; 1918E04F17AE84C40082AB83 /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1918E04E17AE84C40082AB83 /* libstdc++.dylib */; }; 1918E0A817AE8BFB0082AB83 /* libstdc++.6.0.9.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1918E0A617AE8BFB0082AB83 /* libstdc++.6.0.9.dylib */; }; 1918E0A917AE8BFB0082AB83 /* libstdc++.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1918E0A717AE8BFB0082AB83 /* libstdc++.6.dylib */; }; 191A7AD31885443600B9AAAE /* ProducerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 191A7AD21885443600B9AAAE /* ProducerViewController.m */; }; 191A7AD91885889400B9AAAE /* NotificationUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 191A7AD81885889400B9AAAE /* NotificationUtils.mm */; }; 1958161C17C2670E00DC6AB4 /* libc++.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1958161917C2670E00DC6AB4 /* libc++.1.dylib */; }; 1958161D17C2670E00DC6AB4 /* libc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1958161A17C2670E00DC6AB4 /* libc++.dylib */; }; 1958161E17C2670E00DC6AB4 /* libc++abi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1958161B17C2670E00DC6AB4 /* libc++abi.dylib */; }; 1958165A17C3927600DC6AB4 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1918E04C17AE84B60082AB83 /* SystemConfiguration.framework */; }; 19DCFB8118A7DFAF009EC74D /* ConsumerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 191A7ACC188543A000B9AAAE /* ConsumerViewController.m */; }; 87B9411A1A76B29C00DED7C3 /* libc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 87B941191A76B29C00DED7C3 /* libc.dylib */; }; 9A056B561833B40000A77A36 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9A056B3D1833B40000A77A36 /* MainStoryboard_iPhone.storyboard */; }; 9A056B571833B40000A77A36 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A056B401833B40000A77A36 /* AppDelegate.m */; }; 9A056B581833B40000A77A36 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A056B411833B40000A77A36 /* Default-568h@2x.png */; }; 9A056B591833B40000A77A36 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A056B421833B40000A77A36 /* Default.png */; }; 9A056B5A1833B40000A77A36 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A056B431833B40000A77A36 /* Default@2x.png */; }; 9A056B5B1833B40000A77A36 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9A056B441833B40000A77A36 /* InfoPlist.strings */; }; 9A056B5E1833B40000A77A36 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A056B4A1833B40000A77A36 /* main.m */; }; 9A056B621833B40000A77A36 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A056B541833B40000A77A36 /* MainViewController.m */; }; 9AB3D32A18A0E96300E7E0EA /* DetailsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AB3D32918A0E96300E7E0EA /* DetailsCell.m */; }; 9AB3D32D18A0ECAB00E7E0EA /* NotificationEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AB3D32C18A0ECAB00E7E0EA /* NotificationEntry.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 1918E02317AE7C2D0082AB83 /* NotificationService.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NotificationService.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1918E02617AE7C2D0082AB83 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 1918E02817AE7C2D0082AB83 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 1918E02A17AE7C2D0082AB83 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 1918E04C17AE84B60082AB83 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 1918E04E17AE84C40082AB83 /* libstdc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.dylib"; path = "usr/lib/libstdc++.dylib"; sourceTree = SDKROOT; }; 1918E0A617AE8BFB0082AB83 /* libstdc++.6.0.9.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.6.0.9.dylib"; path = "usr/lib/libstdc++.6.0.9.dylib"; sourceTree = SDKROOT; }; 1918E0A717AE8BFB0082AB83 /* libstdc++.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.6.dylib"; path = "usr/lib/libstdc++.6.dylib"; sourceTree = SDKROOT; }; 191A7ACB188543A000B9AAAE /* ConsumerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsumerViewController.h; sourceTree = ""; }; 191A7ACC188543A000B9AAAE /* ConsumerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsumerViewController.m; sourceTree = ""; }; 191A7AD11885443600B9AAAE /* ProducerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProducerViewController.h; sourceTree = ""; }; 191A7AD21885443600B9AAAE /* ProducerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProducerViewController.m; sourceTree = ""; }; 191A7AD71885889400B9AAAE /* NotificationUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationUtils.h; sourceTree = ""; }; 191A7AD81885889400B9AAAE /* NotificationUtils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NotificationUtils.mm; sourceTree = ""; }; 1958161917C2670E00DC6AB4 /* libc++.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.1.dylib"; path = "usr/lib/libc++.1.dylib"; sourceTree = SDKROOT; }; 1958161A17C2670E00DC6AB4 /* libc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.dylib"; path = "usr/lib/libc++.dylib"; sourceTree = SDKROOT; }; 1958161B17C2670E00DC6AB4 /* libc++abi.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++abi.dylib"; path = "usr/lib/libc++abi.dylib"; sourceTree = SDKROOT; }; 87B941191A76B29C00DED7C3 /* libc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libc.dylib; path = usr/lib/libc.dylib; sourceTree = SDKROOT; }; 9A056B3D1833B40000A77A36 /* MainStoryboard_iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard_iPhone.storyboard; sourceTree = ""; }; 9A056B3F1833B40000A77A36 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = NotificationService/AppDelegate.h; sourceTree = ""; }; 9A056B401833B40000A77A36 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = NotificationService/AppDelegate.m; sourceTree = ""; }; 9A056B411833B40000A77A36 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "NotificationService/Default-568h@2x.png"; sourceTree = ""; }; 9A056B421833B40000A77A36 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = NotificationService/Default.png; sourceTree = ""; }; 9A056B431833B40000A77A36 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "NotificationService/Default@2x.png"; sourceTree = ""; }; 9A056B451833B40000A77A36 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 9A056B4A1833B40000A77A36 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = NotificationService/main.m; sourceTree = ""; }; 9A056B4B1833B40000A77A36 /* NotificationService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "NotificationService-Info.plist"; path = "NotificationService/NotificationService-Info.plist"; sourceTree = ""; }; 9A056B4C1833B40000A77A36 /* NotificationService-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NotificationService-Prefix.pch"; path = "NotificationService/NotificationService-Prefix.pch"; sourceTree = ""; }; 9A056B531833B40000A77A36 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; 9A056B541833B40000A77A36 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; 9AB3D32818A0E96300E7E0EA /* DetailsCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailsCell.h; sourceTree = ""; }; 9AB3D32918A0E96300E7E0EA /* DetailsCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailsCell.m; sourceTree = ""; }; 9AB3D32B18A0ECAB00E7E0EA /* NotificationEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationEntry.h; sourceTree = ""; }; 9AB3D32C18A0ECAB00E7E0EA /* NotificationEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotificationEntry.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 1918E02017AE7C2C0082AB83 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 87B9411A1A76B29C00DED7C3 /* libc.dylib in Frameworks */, 1958161D17C2670E00DC6AB4 /* libc++.dylib in Frameworks */, 1958161C17C2670E00DC6AB4 /* libc++.1.dylib in Frameworks */, 1958161E17C2670E00DC6AB4 /* libc++abi.dylib in Frameworks */, 1918E04F17AE84C40082AB83 /* libstdc++.dylib in Frameworks */, 1918E0A917AE8BFB0082AB83 /* libstdc++.6.dylib in Frameworks */, 1918E0A817AE8BFB0082AB83 /* libstdc++.6.0.9.dylib in Frameworks */, 1958165A17C3927600DC6AB4 /* SystemConfiguration.framework in Frameworks */, 1918E02717AE7C2D0082AB83 /* UIKit.framework in Frameworks */, 1918E02917AE7C2D0082AB83 /* Foundation.framework in Frameworks */, 1918E02B17AE7C2D0082AB83 /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 1918E01A17AE7C2C0082AB83 = { isa = PBXGroup; children = ( 9AB3D32718A0E93D00E7E0EA /* UITableViewCell */, 191A7AC7188541EE00B9AAAE /* ViewControllers */, 191A7ACA1885426600B9AAAE /* Utils */, 191A7AC91885425800B9AAAE /* StoryBoards */, 191A7AC81885424D00B9AAAE /* Resources */, 1918E02517AE7C2D0082AB83 /* Frameworks */, 1918E02417AE7C2D0082AB83 /* Products */, ); sourceTree = ""; }; 1918E02417AE7C2D0082AB83 /* Products */ = { isa = PBXGroup; children = ( 1918E02317AE7C2D0082AB83 /* NotificationService.app */, ); name = Products; sourceTree = ""; }; 1918E02517AE7C2D0082AB83 /* Frameworks */ = { isa = PBXGroup; children = ( 87B941191A76B29C00DED7C3 /* libc.dylib */, 1958161A17C2670E00DC6AB4 /* libc++.dylib */, 1958161917C2670E00DC6AB4 /* libc++.1.dylib */, 1958161B17C2670E00DC6AB4 /* libc++abi.dylib */, 1918E04E17AE84C40082AB83 /* libstdc++.dylib */, 1918E0A717AE8BFB0082AB83 /* libstdc++.6.dylib */, 1918E0A617AE8BFB0082AB83 /* libstdc++.6.0.9.dylib */, 1918E04C17AE84B60082AB83 /* SystemConfiguration.framework */, 1918E02617AE7C2D0082AB83 /* UIKit.framework */, 1918E02817AE7C2D0082AB83 /* Foundation.framework */, 1918E02A17AE7C2D0082AB83 /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; 191A7AC7188541EE00B9AAAE /* ViewControllers */ = { isa = PBXGroup; children = ( 191A7AD11885443600B9AAAE /* ProducerViewController.h */, 191A7AD21885443600B9AAAE /* ProducerViewController.m */, 9A056B531833B40000A77A36 /* MainViewController.h */, 9A056B541833B40000A77A36 /* MainViewController.m */, 191A7ACB188543A000B9AAAE /* ConsumerViewController.h */, 191A7ACC188543A000B9AAAE /* ConsumerViewController.m */, ); name = ViewControllers; sourceTree = ""; }; 191A7AC81885424D00B9AAAE /* Resources */ = { isa = PBXGroup; children = ( 9A056B3F1833B40000A77A36 /* AppDelegate.h */, 9A056B401833B40000A77A36 /* AppDelegate.m */, 9A056B411833B40000A77A36 /* Default-568h@2x.png */, 9A056B421833B40000A77A36 /* Default.png */, 9A056B431833B40000A77A36 /* Default@2x.png */, 9A056B441833B40000A77A36 /* InfoPlist.strings */, 9A056B4A1833B40000A77A36 /* main.m */, 9A056B4B1833B40000A77A36 /* NotificationService-Info.plist */, 9A056B4C1833B40000A77A36 /* NotificationService-Prefix.pch */, ); name = Resources; sourceTree = ""; }; 191A7AC91885425800B9AAAE /* StoryBoards */ = { isa = PBXGroup; children = ( 9A056B3D1833B40000A77A36 /* MainStoryboard_iPhone.storyboard */, ); name = StoryBoards; sourceTree = ""; }; 191A7ACA1885426600B9AAAE /* Utils */ = { isa = PBXGroup; children = ( 191A7AD71885889400B9AAAE /* NotificationUtils.h */, 191A7AD81885889400B9AAAE /* NotificationUtils.mm */, ); name = Utils; sourceTree = ""; }; 9AB3D32718A0E93D00E7E0EA /* UITableViewCell */ = { isa = PBXGroup; children = ( 9AB3D32818A0E96300E7E0EA /* DetailsCell.h */, 9AB3D32918A0E96300E7E0EA /* DetailsCell.m */, 9AB3D32B18A0ECAB00E7E0EA /* NotificationEntry.h */, 9AB3D32C18A0ECAB00E7E0EA /* NotificationEntry.m */, ); name = UITableViewCell; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 1918E02217AE7C2C0082AB83 /* NotificationService */ = { isa = PBXNativeTarget; buildConfigurationList = 1918E04917AE7C2D0082AB83 /* Build configuration list for PBXNativeTarget "NotificationService" */; buildPhases = ( 1918E01F17AE7C2C0082AB83 /* Sources */, 1918E02017AE7C2C0082AB83 /* Frameworks */, 1918E02117AE7C2C0082AB83 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = NotificationService; productName = NotificationService.v3; productReference = 1918E02317AE7C2D0082AB83 /* NotificationService.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 1918E01B17AE7C2C0082AB83 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0460; ORGANIZATIONNAME = AllJoyn; TargetAttributes = { 1918E02217AE7C2C0082AB83 = { SystemCapabilities = { com.apple.BackgroundModes = { enabled = 1; }; }; }; }; }; buildConfigurationList = 1918E01E17AE7C2C0082AB83 /* Build configuration list for PBXProject "NotificationService" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 1918E01A17AE7C2C0082AB83; productRefGroup = 1918E02417AE7C2D0082AB83 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 1918E02217AE7C2C0082AB83 /* NotificationService */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 1918E02117AE7C2C0082AB83 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 9A056B5B1833B40000A77A36 /* InfoPlist.strings in Resources */, 9A056B5A1833B40000A77A36 /* Default@2x.png in Resources */, 9A056B591833B40000A77A36 /* Default.png in Resources */, 9A056B581833B40000A77A36 /* Default-568h@2x.png in Resources */, 9A056B561833B40000A77A36 /* MainStoryboard_iPhone.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 1918E01F17AE7C2C0082AB83 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 19DCFB8118A7DFAF009EC74D /* ConsumerViewController.m in Sources */, 191A7AD91885889400B9AAAE /* NotificationUtils.mm in Sources */, 191A7AD31885443600B9AAAE /* ProducerViewController.m in Sources */, 9A056B5E1833B40000A77A36 /* main.m in Sources */, 9A056B571833B40000A77A36 /* AppDelegate.m in Sources */, 9AB3D32A18A0E96300E7E0EA /* DetailsCell.m in Sources */, 9A056B621833B40000A77A36 /* MainViewController.m in Sources */, 9AB3D32D18A0ECAB00E7E0EA /* NotificationEntry.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 9A056B441833B40000A77A36 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 9A056B451833B40000A77A36 /* en */, ); name = InfoPlist.strings; path = NotificationService; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 1918E04717AE7C2D0082AB83 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 6.1; ONLY_ACTIVE_ARCH = YES; PROVISIONING_PROFILE = ""; "PROVISIONING_PROFILE[sdk=*]" = ""; SDKROOT = iphoneos; SKIP_INSTALL = NO; TARGETED_DEVICE_FAMILY = "1,2"; USE_HEADERMAP = NO; VALID_ARCHS = "armv7 i386"; }; name = Debug; }; 1918E04817AE7C2D0082AB83 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 6.1; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; PROVISIONING_PROFILE = "B140D0FD-1531-4C61-9F6E-56A424B03EFA"; "PROVISIONING_PROFILE[sdk=*]" = "B140D0FD-1531-4C61-9F6E-56A424B03EFA"; SDKROOT = iphoneos; SKIP_INSTALL = NO; TARGETED_DEVICE_FAMILY = "1,2"; USE_HEADERMAP = NO; VALIDATE_PRODUCT = YES; VALID_ARCHS = "armv7 i386"; }; name = Release; }; 1918E04A17AE7C2D0082AB83 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "libc++"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ""; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_INCREASE_PRECOMPILED_HEADER_SHARING = YES; GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "NotificationService/NotificationService-Prefix.pch"; GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/common/inc\"", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework/\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(SRCROOT)/../../inc\"", "\"$(SRCROOT)/../../../cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/ios/inc\"", "\"$(SRCROOT)/../../../../controlpanel/cpp/inc\"", "\"$(SRCROOT)/../../../../controlpanel/ios/inc\"", "\"$(SRCROOT)/../../../../sample_apps/ios\"", ); INFOPLIST_FILE = "$(SRCROOT)/NotificationService/NotificationService-Info.plist"; INSTALL_PATH = "$(LOCAL_APPS_DIR)"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(OPENSSL_ROOT)/build/$(CONFIGURATION)-$(PLATFORM_NAME)", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "\"$(SRCROOT)/../alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../controlpanel/ios/samples/alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../controlpanel/ios/samples/alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", ); OTHER_LDFLAGS = ( "-lalljoyn", "-lajrouter", "-lssl", "-lcrypto", "-lalljoyn_services_common_objc", "-lalljoyn_services_common_cpp", "-lalljoyn_notification_objc", "-lalljoyn_notification_cpp", "-lalljoyn_controlpanel_objc", "-lalljoyn_controlpanel_cpp", "-lalljoyn_about_objc", "-lalljoyn_about_cpp", "-lAllJoynFramework_iOS", ); PRODUCT_NAME = NotificationService; PROVISIONING_PROFILE = ""; SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SKIP_INSTALL = NO; TARGETED_DEVICE_FAMILY = 1; VALID_ARCHS = "armv7 i386 arm64"; WRAPPER_EXTENSION = app; }; name = Debug; }; 1918E04B17AE7C2D0082AB83 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "libc++"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ""; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_INCREASE_PRECOMPILED_HEADER_SHARING = YES; GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "NotificationService/NotificationService-Prefix.pch"; GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/common/inc\"", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework/\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(SRCROOT)/../../inc\"", "\"$(SRCROOT)/../../../cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/ios/inc\"", "\"$(SRCROOT)/../../../../controlpanel/cpp/inc\"", "\"$(SRCROOT)/../../../../controlpanel/ios/inc\"", "\"$(SRCROOT)/../../../../sample_apps/ios\"", ); INFOPLIST_FILE = "$(SRCROOT)/NotificationService/NotificationService-Info.plist"; INSTALL_PATH = "$(LOCAL_APPS_DIR)"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(OPENSSL_ROOT)/build/$(CONFIGURATION)-$(PLATFORM_NAME)", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "\"$(SRCROOT)/../alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../controlpanel/ios/samples/alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../controlpanel/ios/samples/alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", ); OTHER_LDFLAGS = ( "-lalljoyn", "-lajrouter", "-lssl", "-lcrypto", "-lalljoyn_services_common_objc", "-lalljoyn_services_common_cpp", "-lalljoyn_notification_objc", "-lalljoyn_notification_cpp", "-lalljoyn_controlpanel_objc", "-lalljoyn_controlpanel_cpp", "-lalljoyn_about_objc", "-lalljoyn_about_cpp", "-lAllJoynFramework_iOS", ); PRODUCT_NAME = NotificationService; PROVISIONING_PROFILE = ""; SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SKIP_INSTALL = NO; TARGETED_DEVICE_FAMILY = 1; VALIDATE_PRODUCT = YES; VALID_ARCHS = "armv7 i386 arm64"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 1918E01E17AE7C2C0082AB83 /* Build configuration list for PBXProject "NotificationService" */ = { isa = XCConfigurationList; buildConfigurations = ( 1918E04717AE7C2D0082AB83 /* Debug */, 1918E04817AE7C2D0082AB83 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 1918E04917AE7C2D0082AB83 /* Build configuration list for PBXNativeTarget "NotificationService" */ = { isa = XCConfigurationList; buildConfigurations = ( 1918E04A17AE7C2D0082AB83 /* Debug */, 1918E04B17AE7C2D0082AB83 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 1918E01B17AE7C2C0082AB83 /* Project object */; } project.xcworkspace/000077500000000000000000000000001262264444500352305ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService.xcodeprojcontents.xcworkspacedata000066400000000000000000000002441262264444500421720ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService.xcodeproj/project.xcworkspace base-15.09/notification/ios/samples/NotificationService/NotificationService.xcodeproj/xcshareddata/000077500000000000000000000000001262264444500337445ustar00rootroot00000000000000xcschemes/000077500000000000000000000000001262264444500356475ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService.xcodeproj/xcshareddataNotificationService.xcscheme000066400000000000000000000063171262264444500433460ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService.xcodeproj/xcshareddata/xcschemes base-15.09/notification/ios/samples/NotificationService/NotificationService/000077500000000000000000000000001262264444500273155ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService/AppDelegate.h000066400000000000000000000021331262264444500316400ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import @interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; @end base-15.09/notification/ios/samples/NotificationService/NotificationService/AppDelegate.m000066400000000000000000000063431262264444500316540ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AppDelegate.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum]; return YES; } -(void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { do { NSLog(@"Listening in the background... %f", [application backgroundTimeRemaining]); [NSThread sleepForTimeInterval:1.0]; } while ([application backgroundTimeRemaining] > 1.0); completionHandler(UIBackgroundFetchResultFailed); } - (void)applicationWillResignActive:(UIApplication *)application { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } - (void)applicationDidEnterBackground:(UIApplication *)application { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - (void)applicationWillEnterForeground:(UIApplication *)application { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } - (void)applicationDidBecomeActive:(UIApplication *)application { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } @end base-15.09/notification/ios/samples/NotificationService/NotificationService/Default-568h@2x.png000066400000000000000000000442421262264444500324570ustar00rootroot00000000000000‰PNG  IHDR€pzŹĺ$iCCPICC Profile8…UßoŰT>‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśáiTXtXML:com.adobe.xmp 1 5 72 1 72 640 1 1136 2012-07-27T15:07:06 Pixelmator 2.0.5 )ńq™?7IDATxíŰ=Şže†ŃŤřQń§±qÎĂ™87;;'ŕ RÄBR(J‰…źWĽáw­žł‰Ý^»ą8‰w<řöĽÎű漏ĎűňĽ7Îó @€ü˙^ź~:ď÷óľ;ďůĂóăýóŢ;ď­ó>9Oü @ŕF®¶»ďŹó®ć{}w~|ŢŰç}}ŢŁó®˙ć#@€¸űłĘËó~<ďŐőŔĎĎűč<ńw| @€¸~ÁwµŢWç=»đŠżĎÎó›żŕ#@€ܨŔŐzWóý}×? —†Ź pű÷Wř]'ě#@€ř?~#‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`WŢď& @€ŔÍ Ü_řôĽżn~U  @€\Í÷ô Ŕgçýzžß @ŕF®Ö»šďŮĂóăç˙ţđᙏλ;ĎG€ p;Wü˝<ďńyŻŢ=ďÝóŢ9ĎG€ p;ĎĎ*OÎűáĽÇ×_ż8ďĎóţ>ď·ó^źç#@€¸ «í®Ć»Zďjľ˙LZ9:\‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśŕiTXtXML:com.adobe.xmp 1 5 72 1 72 320 1 480 2012-07-27T15:07:80 Pixelmator 2.0.5 X±=Ć"IDATxíÖŃICQDŃDK°Áć»Iq¦˝ď/L {nđäoÖŔŕýv»ýś÷}Ţ×y>(‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśŕiTXtXML:com.adobe.xmp 1 5 72 1 72 640 1 960 2012-07-27T15:07:37 Pixelmator 2.0.5 PFđ5IDATxíŰ1ŠÝe‡á HHíěÜŽ;qoV.ÂŇÎ.V‚b&“řýa^p Ţßsá›3¦;Ďi^îŕýÝÝÝĎç˝;ď§óŢź÷ĂyŻÎó!@€ř˙ <ź>ś÷ńĽ_Î{x}~\ń÷öĽŻ_ćWgú @€܆ŔŐvWë=ľĚ»űóËoç]ń÷ăyoλţ͇ @ŕvľśU>ť÷ÇyO×7€×ź}Ż*Á‡ p×|Wë}Ţăő˙św}5蛿ŕC€¸aë›ŔĎWô]żř @€Śř>FmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@W>ź÷Ą0  @€nVŕjľç×çLJóŢž÷íy÷çů @€ÜžŔź÷xŕÇë—óŢť÷ć<x| @€7$pĹß§óţ:ďéŐůńÝyž÷ţĽëOÂßś'‚ @ŕúćďú«ďŻçý~ßĂy×7€O/óó™> @€·!pµÝ[ďá_ŠĎ4ěýďlÄIEND®B`‚base-15.09/notification/ios/samples/NotificationService/NotificationService/Images.xcassets/000077500000000000000000000000001262264444500323565ustar00rootroot00000000000000AppIcon.appiconset/000077500000000000000000000000001262264444500357745ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService/Images.xcassetsContents.json000066400000000000000000000014711262264444500404670ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService/Images.xcassets/AppIcon.appiconset{ "images" : [ { "idiom" : "iphone", "scale" : "2x", "size" : "60x60" }, { "idiom" : "ipad", "scale" : "1x", "size" : "76x76" }, { "idiom" : "ipad", "scale" : "2x", "size" : "76x76" }, { "idiom" : "iphone", "scale" : "2x", "size" : "40x40" }, { "idiom" : "ipad", "scale" : "1x", "size" : "40x40" }, { "idiom" : "ipad", "scale" : "2x", "size" : "40x40" }, { "idiom" : "iphone", "scale" : "2x", "size" : "29x29" }, { "idiom" : "ipad", "scale" : "1x", "size" : "29x29" }, { "idiom" : "ipad", "scale" : "2x", "size" : "29x29" } ], "info" : { "version" : 1, "author" : "xcode" } }LaunchImage.launchimage/000077500000000000000000000000001262264444500367305ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService/Images.xcassetsContents.json000066400000000000000000000021331262264444500414170ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService/Images.xcassets/LaunchImage.launchimage{ "images" : [ { "orientation" : "portrait", "idiom" : "ipad", "minimum-system-version" : "7.0", "extent" : "full-screen", "scale" : "1x" }, { "orientation" : "portrait", "idiom" : "ipad", "minimum-system-version" : "7.0", "extent" : "full-screen", "scale" : "2x" }, { "orientation" : "landscape", "idiom" : "ipad", "minimum-system-version" : "7.0", "extent" : "full-screen", "scale" : "1x" }, { "orientation" : "landscape", "idiom" : "ipad", "minimum-system-version" : "7.0", "extent" : "full-screen", "scale" : "2x" }, { "orientation" : "portrait", "idiom" : "iphone", "filename" : "Default@2x.png", "minimum-system-version" : "7.0", "scale" : "2x" }, { "orientation" : "portrait", "idiom" : "iphone", "filename" : "Default-568h@2x.png", "minimum-system-version" : "7.0", "subtype" : "retina4", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } }Default-568h@2x.png000066400000000000000000000442421262264444500420720ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService/Images.xcassets/LaunchImage.launchimage‰PNG  IHDR€pzŹĺ$iCCPICC Profile8…UßoŰT>‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśáiTXtXML:com.adobe.xmp 1 5 72 1 72 640 1 1136 2012-07-27T15:07:06 Pixelmator 2.0.5 )ńq™?7IDATxíŰ=Şže†ŃŤřQń§±qÎĂ™87;;'ŕ RÄBR(J‰…źWĽáw­žł‰Ý^»ą8‰w<řöĽÎű漏ĎűňĽ7Îó @€ü˙^ź~:ď÷óľ;ďůĂóăýóŢ;ď­ó>9Oü @ŕF®¶»ďŹó®ć{}w~|ŢŰç}}ŢŁó®˙ć#@€¸űłĘËó~<ďŐőŔĎĎűč<ńw| @€¸~ÁwµŢWç=»đŠżĎÎó›żŕ#@€ܨŔŐzWóý}×? —†Ź pű÷Wř]'ě#@€ř?~#‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`WŢď& @€ŔÍ Ü_řôĽżn~U  @€\Í÷ô Ŕgçýzžß @ŕF®Ö»šďŮĂóăç˙ţđᙏλ;ĎG€ p;Wü˝<ďńyŻŢ=ďÝóŢ9ĎG€ p;ĎĎ*OÎűáĽÇ×_ż8ďĎóţ>ď·ó^źç#@€¸ «í®Ć»Zďjľ˙LZ9:\‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśŕiTXtXML:com.adobe.xmp 1 5 72 1 72 640 1 960 2012-07-27T15:07:37 Pixelmator 2.0.5 PFđ5IDATxíŰ1ŠÝe‡á HHíěÜŽ;qoV.ÂŇÎ.V‚b&“řýa^p Ţßsá›3¦;Ďi^îŕýÝÝÝĎç˝;ď§óŢź÷ĂyŻÎó!@€ř˙ <ź>ś÷ńĽ_Î{x}~\ń÷öĽŻ_ćWgú @€܆ŔŐvWë=ľĚ»űóËoç]ń÷ăyoλţ͇ @ŕvľśU>ť÷ÇyO×7€×ź}Ż*Á‡ p×|Wë}Ţăő˙św}5蛿ŕC€¸aë›ŔĎWô]żř @€Śř>FmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@W>ź÷Ą0  @€nVŕjľç×çLJóŢž÷íy÷çů @€ÜžŔź÷xŕÇë—óŢť÷ć<x| @€7$pĹß§óţ:ďéŐůńÝyž÷ţĽëOÂßś'‚ @ŕúćďú«ďŻçý~ßĂy×7€O/óó™> @€·!pµÝ[ďá_ŠĎ4ěýďlÄIEND®B`‚NotificationService-Info.plist000066400000000000000000000045061262264444500351600ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIcons CFBundlePrimaryIcon CFBundleIconFiles NotificationServiceIcon80x80 NotificationServiceIcon58x58 NotificationServiceIcon29x29 NotificationServiceIcon120x120 NotificationServiceIcon114x114 NotificationServiceIcon57x57 CFBundleIdentifier org.alljoyn.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 00.01 CFBundleSignature ???? CFBundleVersion 0110 LSApplicationCategoryType LSRequiresIPhoneOS UIBackgroundModes fetch UIMainStoryboardFile MainStoryboard_iPhone UIMainStoryboardFile~ipad MainStoryboard_iPhone UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight NotificationService-Prefix.pch000066400000000000000000000022571262264444500351420ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #ifndef __IPHONE_5_0 #warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ #import #import #endif base-15.09/notification/ios/samples/NotificationService/NotificationService/en.lproj/000077500000000000000000000000001262264444500310445ustar00rootroot00000000000000InfoPlist.strings000066400000000000000000000000551262264444500343070ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationService/NotificationService/en.lproj/* Localized versions of Info.plist keys */ base-15.09/notification/ios/samples/NotificationService/NotificationService/main.m000066400000000000000000000027371262264444500304300ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AppDelegate.h" #import "AJNInit.h" int main(int argc, char *argv[]) { @autoreleasepool { if ([AJNInit alljoynInit] != ER_OK) { return 1; } if ([AJNInit alljoynRouterInit] != ER_OK) { [AJNInit alljoynShutdown]; return 1; } int ret = UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); [AJNInit alljoynRouterShutdown]; [AJNInit alljoynShutdown]; return ret; } } base-15.09/notification/ios/samples/NotificationService/NotificationServiceIcon114x114.png000066400000000000000000000316771262264444500315160ustar00rootroot00000000000000‰PNG  IHDRrrŹÝ…} AiCCPICC ProfileH ť–wTSهϽ7˝Đ" %ôz Ň;HQ‰I€P†„&vDF)VdTŔG‡"cE ‚b× ňPĆÁQDEĺÝŚk ď­5óŢšýÇYßŮç·×Ůgď}׺Pü‚ÂtX€4ˇXîëÁ\ËÄ÷XŔáffGřDÔü˝=™™¨HĆłöî.€d»Ű,żP&sÖ˙‘"7C$ EŐ6<~&ĺ”SłĹ2˙Ęô•)2†12ˇ ˘¬"ăÄŻlö§ć+»É—&äˇYÎĽ4žŚ»PŢš%ᣌˇ\%ŕgŁ|e˝TIšĺ÷(ÓÓřśL0™_Ěç&ˇl‰2Eî‰ň”Ä9Ľr‹ů9hžx¦g䊉Ib¦×iĺčČfúńłSůb1+”ĂMáxLĎô´ Ž0€Żo–E%Ym™h‘í­ííYÖćhůżŮß~Sý=ČzűUń&ěĎžAŚžYßlě¬/˝ö$Z›łľ•U´m@ĺá¬Oď ň´Ţśó†l^’Äâ ' ‹ěělsźk.+č7űź‚oĘż†9÷™ËîűV;¦?#I3eE妧¦KDĚĚ —Ďdý÷˙ăŔ9iÍÉĂ,śźŔń…čUQč” „‰h»…Ř A1ŘvjpÔzĐN‚6p\WŔ p €G@ †ÁK0Ţi‚đ˘Aޤ™BÖZyCAP8ĹC‰’@ůĐ&¨*ŞˇCP=ô#tş]ú Đ 4ý}„Óa ض€Ů°;GÂËŕDxśŔŰáJ¸>·Âáđ,…_“@ČŃFXńDBX$!k‘"¤©Eš¤ąŤH‘q䇡aĆă‡YŚábVaÖbJ0ŐcVLć6f3ů‚ĄbŐ±¦X'¬?v 6›Ť-ÄV`Ź`[°—±Řaě;ÇŔâp~¸\2n5®·׌»€ëĂ á&ńxĽ*Ţď‚Ásđb|!ľ ߏĆż' Zk‚!– $l$Tçý„Â4Q¨Ot"†yÄ\b)±ŽŘAĽI&N“I†$R$)™´TIj"]&=&˝!“É:dGrY@^O®$ź _%’?P”(&OJEBŮN9Ją@y@yCĄR ¨nÔXŞşťZO˝D}J}/G“3—ó—ăÉ­“«‘k•ë—{%O”×—w—_.ź'_!Jţ¦ü¸QÁ@ÁSٰVˇFá´Â=…IEš˘•bbšb‰bâ5ĹQ%Ľ’’·O©@é°Ň%Ą!BÓĄyҸ´M´:ÚeÚ0G7¤űÓ“éĹôč˝ô e%e[ĺ(ĺĺĺłĘRÂ0`ř3RĄŚ“Ś»ŚŹó4ćąĎăĎŰ6Żi^˙Ľ)•ů*n*|•"•f••ŹŞLUoŐŐťŞmŞOÔ0j&jajŮjűŐ.«ŤĎ§ĎwžĎť_4˙äü‡ę°ş‰z¸újőĂę=ꓚľU—4Ć5šnšÉšĺšç4Ç´hZ µZĺZçµ^0•™îĚTf%ł‹9ˇ­®í§-Ń>¤Ý«=­c¨łXgŁNłÎ]’.[7A·\·SwBOK/X/_ŻQďˇ>Qź­ź¤żGż[ĘŔĐ Ú`‹A›Á¨ˇŠˇżažaŁác#Ş‘«Ń*ŁZŁ;Ć8c¶qŠń>ă[&°‰ťI’IŤÉMSŘÔŢT`şĎ´Ď kćh&4«5»Ç˘°ÜYY¬FÖ 9Ă<Č|Ły›ů+ =‹X‹ťÝ_,í,S-ë,Y)YXm´ę°úĂÚÄšk]c}džjăcłÎ¦Ýćµ­©-ßvżí};š]°Ý»N»Ďöö"ű&ű1=‡x‡˝÷Řtv(»„}Őëčá¸ÎńŚă'{'±ÓI§ßťYÎ)Î ÎŁ đÔ-rŃqá¸r‘.d.Ś_xpˇÔUŰ•ăZëúĚM׍çvÄmÄÝŘ=Ůý¸ű+K‘G‹Ç”§“çĎ ^—ŻW‘WŻ·’÷bďjď§>:>‰>Ť>ľvľ«}/řaýývúÝó×đçú×űO8¬ č ¤FV> 2 uĂÁÁ»‚/Ň_$\ÔBüCv…< 5 ]ús.,4¬&ěy¸Ux~xw-bEDCÄ»HŹČŇČG‹ŤKwFÉGĹEŐGME{E—EK—X,YłäFŚZŚ ¦={$vr©÷ŇÝK‡ăěâ ăî.3\–łěÚrµĺ©ËĎ®_ÁYq*ß˙‰©ĺL®ô_ąwĺד»‡ű’çĆ+çŤń]řeü‘—„˛„ŃD—Ä]‰cI®IIăOAµŕu˛_ňä©””Ł)3©Ń©Íi„´ř´ÓB%aа+]3='˝/Ă4Ł0CşĘiŐîU˘@Ń‘L(sYf»ŽţLőHŚ$›%Y łj˛ŢgGeźĘQĚćôäšänËÉóÉű~5f5wugľvţ†üÁ5îk­…Ö®\ŰąNw]ÁşáőľëŹm mHŮđËFËŤeßnŠŢÔQ Q°ľ`hłďćĆBąBQá˝-Î[lĹllíÝfł­jŰ—"^ŃőbËâŠâO%Ü’ëßY}WůÝĚö„í˝ĄöĄűwŕvwÜÝéşóX™bY^ŮĐ®ŕ]­ĺĚň˘ň·»WěľVa[q`iŹdŹ´2¨˛˝JŻjGŐ§ę¤ęŹšć˝ę{·íťÚÇŰ׿ßmÓŤĹ>ĽČ÷Pk­AmĹaÜá¬ĂĎë˘ęşżg_DíHń‘ĎG…GĄÇÂŹuŐ;Ô×7¨7”6ÂŤ’ƱăqÇoýŕőC{«éP3Łąř8!9ńâÇřďž <ŮyŠ}Şé'ýźö¶ĐZŠZˇÖÜÖ‰¶¤6i{L{ßé€ÓťÎ-?›˙|ôŚö™šłĘgKϑΜ›9źw~ňBĆ…ń‹‰‡:Wt>ş´äŇť®°®ŢË—Ż^ńąr©Ű˝űüU—«g®9];}ť}˝í†ýŤÖ»ž–_ě~iéµďm˝épłý–ă­Žľ}çú]ű/Ţöş}ĺŽ˙ť‹úî.ľ{˙^Ü=é}ŢýŃ©^?Ěz8ýhýcěă˘' O*žŞ?­ýŐř×f©˝ôě ×`Ďłgʆ¸C/˙•ůŻOĂĎ©Ď+F´FęG­GĎŚůŚÝz±ôĹđËŚ—Óă…ż)ţ¶÷•Ń«ź~wű˝gbÉÄđkŃë™?Jިľ9úÖömçdčäÓwi獵ŠŢ«ľ?öýˇűcôÇ‘éěOřO•źŤ?w| üňx&mfćß÷„óű2:Y~ pHYs  šś)$IDATxíťY\×yßOĎľŻŘ…\@”H‘˘©Í˘dE‘“”íŠRWĄTIE/ÎK–ÇĽä1©<äĹIĹU‰ăŠ]©,VU,ŰJ9ĺ”-K˘$Š‹h‚$0fĂ`ö­gş§»óűť; »{Hý>śîŰ÷žsď÷?ßrľsÎťÔ@C 4$Đ@C 4$Đ@C 4$Đ@íČÔ~jŮ3›9z~îŮqƇ|_ŮvlŤĎ×ŕě¶cŤŹu’@Ëëiâú‡á—ŕáuáűv Wů>[nŔ9xŢÜbö·\‚tŘ+jä3đß !s ź‡çaAPA¶lĐ.Ř+·Şď>B?Ęą_K -Ť ąąeIs(Ű2 ąąŢÎŻ#[üYĘť¤I~Ř?‡_`"„jTG ÷‡pč“xË_OÚ+!{µ2ŃBŽńąČ± ™EéÖá0ŹE•—pźłxţqN> ż ˙cX ÔQř[¬F7ŔE)ŐHMj3ĘÖ¶3ćI›Ú*¸cm=Bçš`x »zg[Cv®5¬/v…5ľŻ\çÂ’Z,ŔÇŕ_‚/ÂoĂSđUxţ…¦úY«Ľ­7áŔÜIšäexuď9ŠÇĽŚN.B“…ŤĺÓ!‡;-ů!ü¬Đ1Xźk°ô ęÇ$’®J}»ňvš~Ó VSo&Áůĺ‘PŘüf4ŰĄ‚‘ ţWXß: kŽóđ/ Ý@–ýţSQO„đČ?;ůSF¤?bđ‚U˝qÖgř2üx…ţ6ü ćd:¤ićv±ĚáČ‹VĎâ_Q<¦©3­áď´†µé§śńŕ˙!üç°ÁŇĎ5=@î„Ŕ * ¬ ®b Őކ61Äi#úݲ śTúu.}Ö—ľ żŕź;z0Ľ  –ŽO$lp4ó>PřárČŻľ ůĎ„Rđ7ül”;&G¦řů Ő^ČŽ`zî…Đsh I<‰g"p, +ăÇ‘Ž#óŮď9R,Ó/[ÇöR8¬z,„_ áŔÓI;›ë-$%úB± V#›`Áĺf~>ŇuÖČń"Ůśk? amAí· °L4Ńś&±˝/„.¸łŘL_jB®MFkÚkß˘Í ő ?ĘP†QÉě…Ţú/ŽS9Xú·śáPĺ[đďŔăđonë ¤`ĺł Ď#3‚‘®î¨{Đ"Ľ‰ s”m€@;ůÜ9Č "5Kßgéń¨@wBŃoŇ)Lö<ÂCĎ…pÕW:H4'Uř[T§ýOđ˙„§ŕ–ę ¤VJÓ™Ě&@ěŔĽîâ3Ç3·ßřĽÁçUÍ.&¸´¸hăZ čóśßFĆGÍß ¬¬/lňNH@[d®;ň®'±<ަßí‹W¬L0ąŔ`5ü%ü@&ę¤ęÍ›ć(;ѸAŔ90­Č)ţ›ś·k ńÖ(M¦ç@xťß˛üĆĺ Č5€Öy0Ѧnµmx g¶Ěaf::[Ú©•2QÓw,Í­o,uŔ/ ŃcbD{™ňĚM=Xľł~@®^O2/«3ôř«!ôĘ`'xµ‹fŔ)™ÚÚ*ýžČ<çÉY€ČE´y ĄX™fxŹL'ÓŁ‘ÍhR×1ęHP΢iŻbRH î-ňŞgIĂ˝ŹF^@C§ÂěÚ" ®…kŮ0µ’ ă«Ma|ˇ%\ßVÍŰdŠ “»&;„iB5´›ëćôĆŐ¤ué?«‘É{†1D×ĎčsźáôÓ0•Ĺ1tµ«ďéowhł>r/H%Ľ 6­…ôcDG„Ňšş~ÜăÁ¸ flSQ˘&ˇÓ6„/-l9hn>JŔ˛?´7ŔÇ 2|鏝!NďĆX©!d”ŽĄŚŤ‹I„Y|ă4š;6K‹!_XÄ.1˛Ö™JŮ`ÉĆ&ŇĎšÂFéb˙ f4‚©Ľ·3_«’×ŮĘ>ů:ľ{@s¬iwÁt;Úir Ĺ:x$gmÇô›Dł9íö9Xź‰źN‚âă#Ű”˙!=›xîGz3B˛Ë ‘C oÁ:šæő®Á’»;ÄQʧIŐ}ŠÜëILcÚŮ÷‘żíËDźg@#(éS(ä8Í•»‘Úą€2ť™á EďsdWé“1ď*iĹ*{ď[‰‰µD:Źţü]ŘĎ4đń‘ýr/¤ŕ_‚_`Ô@8ňK ™ů꼟Ľď Li/gűŤř’YÁ5Çţ'đ?…OÁJďüüSř5ÄńC–·ŃÎłan˝ Ú‡í‹"a4ÎÓÎeFŞ» ž3n’ ›2jGćÍhçŘEfW¦¸çý|Ç_:ެV秸ţQ"ŮŮĚÖ$ő'¸ŕMxÖÍ|lT? űŹ „<Ř©ßHvdą+K0Mw˙ezúß&,ř:‹•ă<Ż éł"šš_łCŚŔ/Ă߀ż? ~ÔÜ(É»…÷u” )ŘŐ5ł– sY†8ÔˇvÔhzď„ڹ۾vĚ+ľsz`ÖͶš ŞFţ>0BÂtln…Ř ¤[ˇ÷ĆY“jWÖő·úé*:Č…Ăöć”ÍsÚł€+ËV¸ Ús8éŃĂŹgđMmDŽ] şű{yJ},!bÜ™ĄşéWŻÁ3Dł3Đ%üçšÚĆŠNŔlŤ NH’^R©™éL‹ĺ:}g câ‚ď&Ň«ĺic–ç-ă,\jĆňđŔѲ Ţá:ü±ŘúéĽŢľSh>'n—ĂiRÝJgŰ™d@Ń{(ńEj®KoĐ1w-]đA®}ßúI®y"\ đü>ŇŕŤ±d¤‰eçVľ“AšC'Ú鄵Z y^šě™Ů ™Y]A3an™HŻ–Ł5CÔ‡Kź»ěl?.ÄŽ(€¨i\ĽrĎÁ¬3Ç«ť žăˇ>¤‡^I"»dż¶€é1BD8šSfŔá`Q!ősíˇçs>—fMďň$`Łí{–Hő‹Čćó\@1@şJI¬"/çĂ2©łĹŤ–0źí ĄLK¦Ş$­-E5w#a§ÉúÓ€)‡V.ą–ȬN[We0ÓHV 3ű>×,`Ub|‹V/ĂŘě{KőŇsÖđü·1‚…żyaśÔł0nn†rú]†ĎďŕSx`g(śv-l I+lM±nפ>ú5t‘ŔC 3tűőů}śń+[ŚÚÇô•ĆĐ˙+Ěop(): °­@s®úĎÝȶ%}f÷ĐúÍË+W°(üŘÁ=µ¦~˝u ň çęJć/aZâĐěO(Ťb đ=#îzOäS˝o­4ČţăôÁď#|zóń”fzÖŔÚŃĚÂŚ˘[iÍťEÇĎ$Ŕn,ň;L28‚—ü4u|m¤ ó…/\ÝŇ—8 ¤ărŚW)?Ŕ]‚Ď“dÉĆúJ’»Ô  jN5ňg0úXgQtqc>ÎóŽË1M˘ÇaV™ŠT‹™çšµ>˘ĄË°~V˙$:„‹™]Äě4Ćć&´ĐŤ ŕ€Śc‹ąĎiŔX‰f»H©€ sĹö¨i‚S«ßtZĚŕÇ•~ó޵»2ľ 0Űą—JvÚd‚ÄŕçĆű’ô†¸zb”RÍĽ'Tg ŐČĚękDO„Ó(Ď@öó<.¤r‰ä>:ę~ŘĄ=ôbÁḻĚęZ€o\‚ÍždĄ‘îA#‡ ëóúZ˛*ůúI¤3ŁÎ±Ľ kD´‘×r˝?-qaˇ–_Śfą7× Ísót2wŔ«•=*k%7ďWŔ]qż±¤őŕÁb>öĄ:_wşw@¶#Ó^zôĂ<°« ®ó»ľË±›rgöŹčÜaŽő8Źëg.8}<K®ŁTýŹ‘îń/fędbŢsíF;‘âWhä()|ćb†+ąB6,ç[sBK[bŇ\MÓRTR,~á7NP‹MĘ[äžćąo‚šNž«˘‰Ąn­«Üm]ŘŔT…§ŕ?13ő§{äöu­ŃGĄŇKKĘăě’ ăN9=°űĐ`3.F˝‹Ł€ ;Ék@äĆ ĚŃ—Ž·Óů†‰đŚCŤŰŃŤŻÁWń›}L«!§Űʰ%—Xî–<đEZ˙ęą«´=sKÁ±bďŁ"ś?řzř‘÷Z;~ť‡Šă§”ôÔúŇÇ dĄ<¨KY­Őü© jë~„Ą– őD»hčÜ8˘`\*knťř5‹ÔŢGr}©>BŤ_‚§áQ8ŃÎŤÍŁě9 +ąvŔiŠć>v.ΨFšb§ÁÜčľ–I:–ăK“ě&>*‚Ésôr^~•ŕë"µňű”¨u}‡$/Ő„µó7Ť¦[TÎ#¶q0Ł0±NY,~Ë1†v9fŽĐÎ…QöDn ˛ IĘ™ä{iŰŚč=,H¶nMínä9vDÇľłh&qVĚúh>«m,ňwÇÎąĺ +ŮA=®Ć;OY×Ŕ§~@vía·ćněuËĂö"äí¦u7a•ű]:Ôěů f,`âÜ锯üq÷ţköËŮ S*<‚ô7¨v Vxˤńŕ¦ĚŽŕűZă6…8B˝ŐČNĄyŐÜ Í2ś2iˇĎv/I%g«ůŤ3?t×ß±;Ř+0PżĹ[őr“˝îÍĐ',`ÉĽÝť{?4c©ĽŇ’Ój"Ż5S3ŚŕduÍHw’¶f&PL¦™ë=ĚŔT6łDFĄ_ćě7á3đ5†$¤ôŽ0Î<ş™>éQ«…÷TÍÔ ĄăŃ1Ě»ľŇyĚAüeµ9L—“tâFżŰ„;ĐěOÁFłuˇúYČÄáÂ:÷ćt•ĂŚ~x„‡P1‡öđď®(°e'€ąÜŃ=!®4źťD,t"÷~4ń›éľĂÄ<úĐŤE3BŞĚ×`5á"<Á}äóQƉ¤óHPŻ~y7Ň_şČąĚy\Ý:fľ‡özęf/ÝQ‰ăJ3ByLlňš6ü@Ě۱ęB{RX^L‘}—ň˙Ô”‡N7&9Ď „ížH—C ¨BÓTńď®Čëâá8>5Iľ˛€7śEPI4©‰7‘­i+ćšX5nÔř$| ćä§-’,Á÷őĆd»ă];]%Jď×¶ýĽ€űČŃi7‰´Ťbcŕ“ž´Ł"'®ţ¶Ąëśq&‚Ű;Uąëš+§›EtR6¨x ŕ‡ qÖŢ /a ĺ,ÇÜÜ ®‘VMSä°uć­ÂóőYqŹa’Ŕ…Ä+h ëą’i˛‰˙Ň´­LŃ.bwŮ>‡Há×ŕĚěaĚăC IÚ×6G3ëýT#ŰÖW®Ń‡]Ż»Ě Ś$mUŚ`9ßU{N&dçÚ°*˝;ľ6¦Zk5ýV A&F`ör#1TŽük‘ĹX‚¸śŰ ď™Çn*PIl3g Ž@z¶r‹@n Đϵ’§Ći+>ˮҕĐ̶aL ě0Á•onŔťżŘ‚qZěŻ(Ż Ťű°'ąŹn"ăΰíŇ_ w5Rsµ2yžqóÚ}Śv%ZYé:Ͳ¬{Hs+‘čéżM) {˘ząý„Ex–ééďŃË_ǽ˸í=fôݞr!\_YăK­¬wmć3ĚKŤő*çíéw ¤=Á =rĘv '®¦Ěa‰ŰŐMŚ˝Š—şÍ #đ‡§1ůC1’ÝŘ!!‘‰‘¬¦żĹ(ń‘ŽŃI˛ŕ2t‚gŔ‚WÔJÎ×Üű ¶µN Ň7-š¸kŞ7Ţz ~ fůÇ”2"|ŹŢ˙ Ú ŔěVťE…&W2p@7ĹĄŠś}Uę‹ü^‰Ry[Ş%‚ŮAą@ĐĺEń¨SLľúĚ`cť·b7QꏖîG” ą†•x—ĐK.8;Ôn™Łhµl+9>EŰhĄk”ŞůJs˘ÝYžŐi.ŽćߡÄ7Ü=Ý ˝ĹW€˝9}Á¬ŮŐNŔWŕsµw0ko#Äwń™sřĎMĆgťa‘%†‹¬RWć9wÓ*‹µ„kŚ*o.Ó$k ăW$hjÍĆtfÂô; §ŔÎS^€ç˘™Ý(ž`ŘÔ΢®LčD<•´ËmĎäd ßś'°˛}ˇ\‰ zV§é>—›éPšú?„Ť5”Ů]Ń˝rűͤć6–1AÖ§[FžÇ§ëXŮ[óˇ-,Zn‰ÁŚć6 M©íBž˘‰6 łdđűY§iMš“Ôn€Ő1ĎĽßÄp‰((ľ§î ĺ*‡÷c*źb–¦ŹÎŚ/íL»™zŁń):M–N×?Bű= SiYR+Ż d†ôN9ľ|dď~ĺÝÇdŮgá Z«6HRKĎEŢ,^kĽßežWŹÍeű#¨­[jĘv*•ÄsÔJAXĄżĚéĂhnp$ŃJŁXß´—ýă ]€Ă ’ęŹč#<­d“2qŹ]±R2ÂŐ¤»ĹasޡFŇYĘ˝Tj"9‹ăťQ¶Oňüg)íŘwE?K wްfŘ1Őyy“{ ŮÁŢÝ9^áI”ÇŚ°)tŹ|$păcT„ě2 ~4ô˛ËÎńľRvŔ˙_¸‹:}‚mîťhv[śbł.ë,Géo®ş› O:ŹŚA CŹĐY¬¶ů›cÜ+ßó„ăđźÁă~ąşź€Lď[gF)? µVň.¬rú©=.ŞŇo*ŔJ”ţ¤IvA•Ă“|Ř,ZĐ{0 ůQßŮsí‡jĆUq d¤đ0Ż^îS(ő‡Ł¬j7×›ÖąłÍxüh`6µŚ9G3Şź˘khĆ+\hŽV?zĺřÖ,ˇn ŐHzĂťÓý¤Oˇ?]‡YżĘ*´bq™`h1éCěęęŽ3‚S‹ßÔěy®K1'°ž>ř ? ~~&”ŚEě‘ęW9ň¸~Ó)¨Öŕ&ÓÁ8ł5ú0Ml%JAvł‚€ăG´Ó1ź‡ :ůfjŹ5ÚYČ/PLиĘiĺM ą‡,}.šqúÝŕăIt\ŐĽŇÚ*ľŰżD”_Őúđ!¶OQ;ÝK ç5ź† ţü+đ‹ÄçŃÓř·§Iq=C—eŹGI˙‡4ŁÎ©ňNL¶‰á‰€Ť?MĂQČ5RîĽ*R°M‰1ŃÝy(–ľävgOü«?KW[đ•ST1 OŔ/’8‚ć7ĹIe}ĺNJë÷¸ľér źŰs"1Ýv’J÷Ż!ÚuţƢĎĚM„?őđťĐ˝R_ó4ü)řëđ7ďoĆ?OůĘŁç ŇoOăž ­™gä$&‘Ť$#ĺ¸Ö‰|„4?sx‘^¸™“L?µĹ&íř¨M Ô˝'“ŔŃĽjVťřu}Ířëú«>Ú…Ďp7ʱťá)6Ůş.6Yă#pŰÁăk$ëw<ÉdďC »ˇéľxÉa†“Ë•ČäÄřOč쳌o#˙ŤSďČOV©˝R«»箣öýKĘoŔźçˇűBS8Ę@Üő«'Xłđő`w33^smy.jZ)j#Î,ćfË™ZÔ‰h¶ŔzśÜć“hö>–Pf˘,§1ś|“4ݦďśq™Aą‡1]CŘŔ4…ç{ÖůPşÂ5éXř®Ňóhd' Ňvę(‹$‡żs­ľÔb o2üuŁńŐ¶ćą´Ó g˙.X1/&ëFĘ=;‡?Jő’; ˙ţw0—µ°öţ ň,˝óÜĎI„v>Ä©)űnV_ăŮA~sEQNön2Ůëöą$mUî–ř-‹ŕ†ŮNwŠüh;ž‰ s~¨H&$_î;†ë=™WµQ|–±Ş¦ÍŠîŚGŢřçčC´Ń€ÔT"S+1&ö?ĂsŃiłŮ&ŻN`zK+tć@í3"őň4 ˙ř_Ă ›C÷ é˘/b3ťÜĹÇÎ}XÍěgŁA§ź†éÁ-„xąÂ0AĂQŔ\¤®÷`ÍéN0éöQsóLŽ#͡3s˛üZŽh.’3ű“T϶ĘĐ÷0÷@iôęJĽŃďRsłßTň»´ü‹gŹ`¦Ű†:ۉM?ÇQl_|ĄKą«Em >€KqIÉ‚q‹Ęuň^ě4ľz;?‹ ¶3’ăşn§­WµłÚţ4®†Ur{khŤ÷›Ţ3?~„ě”Iő±îš€¤żčŁéB°mZÖLU¤[sBđ›đç"Çż .íäh9Ň0Zż/v"6 ksOř\äQŤ\ě,gbx{”Síʶ&˘Ą=HĹń!~ ktú7s҆Y! Ť3ü5ߎ÷ÂɦĂz‘a7Ď’‰Z©ÍAęeIŃ]že_Ç»®Xä…˘FLŞ4¬Öčł;¸Üť^îřŇGIP|“r"Ě(Çr†„ýzLŚWŇv5Ńméů>Ś&V‘W"ĎľĆěţuĆ•+Ľ? ‰+áý÷¨łł”°Îľ‰ÄEQ˘d2»eHfů‘n zň$,6â»ě\ÚQŤ¨:Î̤‰(G2ľ7v7ŇŞ:¦LhBE©‰ö ¤·¬¶°ľ9›É÷f\Y&†áw ćV'0ńěšŃD? :łq2{)|Ä/f]f(f>µZŰŢą#j=ç;†Ű.lw&'ćU7­Ç\r_Ş@vf‡UÖÝ"čv,ęߍĚđ¸z!!Uóc2m4)}ý¤+ŐLPh†üłI‚µŕöÓoű5yë)®EÜ·ˇ[żTřĎ´ÝmM˝&íÚ‘Ş‘&Đ^­v´Ň×ǤŕAš^K:Ň(s¬*źg’Ź~ŇŞw©žq-ťšó\8íľĘÝČqlŻ5’ŤWëĽ[§%Ĺ^5ň¶Ę˘C4í«U6‘ýO:‰űJ8-w\•|ÝúŃÓôŮB˝čéĺjd—źČ Ěß&Qě-P*^šżf´Ć¨ŇWf§7kŕ‘ř+NŠi•é©e†!›ńŹ´íÖ1m3&>ü@ý%žk72ąî’Í„Ś¶Ś\k˘˝©ô}zfďľkŁ˙îT=ËÜóĺyršDmń%IîIQY“™âÜk`6.›hdBcr5Ň -"3˘K’ťë‚łŐ9*]e»îHÍź~Ňű”L Śř µŠď&`ż%ŰE*MĎ©V˝uą¶p’fŐN’SÖZŽLşĹ!ˇŠjqÁÖiI±W µIďḛ̈'aĽőşHw˙Ó”J@Î1č6‰ě\ťÂŐŚngâôŹŻÇţp9Ź·’m™ąi~ĺ‡]ÓU‰},ˇą9$m@b˝ŰŰ)÷Y?Öäąt_“šV#H853‰˛ouÚ¦ŠĺęóXJ®ŻőĎ-˛d7<©¶§żď,¶h^˛a;QMÄSě‰R ˛@ĎűoĐL#>_ńiĐ3˙!ŁĽ‰ ó!MŐą¤?}`Ő—Í#ÄŃEV•řŠ c/ۨtWR•@YDŘ$Nđş˛)sýd†s2Z«Ů"ëł°k}+H‰şí$r%Ť·^«‰‰˙Ä>Őâ­Şë]ěHou>ĎĂ>–Ć…Ńď1ňű í bţŇźńöU´r “ipáŽc·’ű¤NÂşhi“:^m'·´Púc z®¤čô“ř14Ú‰c3JqxQĺÚt›Dß©1iîŐĚO‰5ŽvŚUţÓŰäjäě‡[}ŹĐ=¦˝™ŢŢćCŚ~ú»u ŔŽ }áÄ—đ5÷÷\2#Á—ú˛[ý©o¸ćĄŽ!o?ö „ĂgW€Ď^U˛v’oÁčZh MŁs¬„÷¸ä Bqą…w’ŕ¬p/ŃÄ ŚĽEŢ»«ěJüé‹K 6 +áĚTkř°íÔôJ.бjS|®,mƺ˴˝í˘›‚Y˛ÍbžŘ A1ŘvjpÔzĐN‚6p\WŔ p €G@ †ÁK0Ţi‚đ˘Aޤ™BÖZyCAP8ĹC‰’@ůĐ&¨*ŞˇCP=ô#tş]ú Đ 4ý}„Óa ض€Ů°;GÂËŕDxśŔŰáJ¸>·Âáđ,…_“@ČŃFXńDBX$!k‘"¤©Eš¤ąŤH‘q䇡aĆă‡YŚábVaÖbJ0ŐcVLć6f3ů‚ĄbŐ±¦X'¬?v 6›Ť-ÄV`Ź`[°—±Řaě;ÇŔâp~¸\2n5®·׌»€ëĂ á&ńxĽ*Ţď‚Ásđb|!ľ ߏĆż' Zk‚!– $l$Tçý„Â4Q¨Ot"†yÄ\b)±ŽŘAĽI&N“I†$R$)™´TIj"]&=&˝!“É:dGrY@^O®$ź _%’?P”(&OJEBŮN9Ją@y@yCĄR ¨nÔXŞşťZO˝D}J}/G“3—ó—ăÉ­“«‘k•ë—{%O”×—w—_.ź'_!Jţ¦ü¸QÁ@ÁSٰVˇFá´Â=…IEš˘•bbšb‰bâ5ĹQ%Ľ’’·O©@é°Ň%Ą!BÓĄyҸ´M´:ÚeÚ0G7¤űÓ“éĹôč˝ô e%e[ĺ(ĺĺĺłĘRÂ0`ř3RĄŚ“Ś»ŚŹó4ćąĎăĎŰ6Żi^˙Ľ)•ů*n*|•"•f••ŹŞLUoŐŐťŞmŞOÔ0j&jajŮjűŐ.«ŤĎ§ĎwžĎť_4˙äü‡ę°ş‰z¸újőĂę=ꓚľU—4Ć5šnšÉšĺšç4Ç´hZ µZĺZçµ^0•™îĚTf%ł‹9ˇ­®í§-Ń>¤Ý«=­c¨łXgŁNłÎ]’.[7A·\·SwBOK/X/_ŻQďˇ>Qź­ź¤żGż[ĘŔĐ Ú`‹A›Á¨ˇŠˇżažaŁác#Ş‘«Ń*ŁZŁ;Ć8c¶qŠń>ă[&°‰ťI’IŤÉMSŘÔŢT`şĎ´Ď kćh&4«5»Ç˘°ÜYY¬FÖ 9Ă<Č|Ły›ů+ =‹X‹ťÝ_,í,S-ë,Y)YXm´ę°úĂÚÄšk]c}džjăcłÎ¦Ýćµ­©-ßvżí};š]°Ý»N»Ďöö"ű&ű1=‡x‡˝÷Řtv(»„}Őëčá¸ÎńŚă'{'±ÓI§ßťYÎ)Î ÎŁ đÔ-rŃqá¸r‘.d.Ś_xpˇÔUŰ•ăZëúĚM׍çvÄmÄÝŘ=Ůý¸ű+K‘G‹Ç”§“çĎ ^—ŻW‘WŻ·’÷bďjď§>:>‰>Ť>ľvľ«}/řaýývúÝó×đçú×űO8¬ č ¤FV> 2 uĂÁÁ»‚/Ň_$\ÔBüCv…< 5 ]ús.,4¬&ěy¸Ux~xw-bEDCÄ»HŹČŇČG‹ŤKwFÉGĹEŐGME{E—EK—X,YłäFŚZŚ ¦={$vr©÷ŇÝK‡ăěâ ăî.3\–łěÚrµĺ©ËĎ®_ÁYq*ß˙‰©ĺL®ô_ąwĺד»‡ű’çĆ+çŤń]řeü‘—„˛„ŃD—Ä]‰cI®IIăOAµŕu˛_ňä©””Ł)3©Ń©Íi„´ř´ÓB%aа+]3='˝/Ă4Ł0CşĘiŐîU˘@Ń‘L(sYf»ŽţLőHŚ$›%Y łj˛ŢgGeźĘQĚćôäšänËÉóÉű~5f5wugľvţ†üÁ5îk­…Ö®\ŰąNw]ÁşáőľëŹm mHŮđËFËŤeßnŠŢÔQ Q°ľ`hłďćĆBąBQá˝-Î[lĹllíÝfł­jŰ—"^ŃőbËâŠâO%Ü’ëßY}WůÝĚö„í˝ĄöĄűwŕvwÜÝéşóX™bY^ŮĐ®ŕ]­ĺĚň˘ň·»WěľVa[q`iŹdŹ´2¨˛˝JŻjGŐ§ę¤ęŹšć˝ę{·íťÚÇŰ׿ßmÓŤĹ>ĽČ÷Pk­AmĹaÜá¬ĂĎë˘ęşżg_DíHń‘ĎG…GĄÇÂŹuŐ;Ô×7¨7”6ÂŤ’ƱăqÇoýŕőC{«éP3Łąř8!9ńâÇřďž <ŮyŠ}Şé'ýźö¶ĐZŠZˇÖÜÖ‰¶¤6i{L{ßé€ÓťÎ-?›˙|ôŚö™šłĘgKϑΜ›9źw~ňBĆ…ń‹‰‡:Wt>ş´äŇť®°®ŢË—Ż^ńąr©Ű˝űüU—«g®9];}ť}˝í†ýŤÖ»ž–_ě~iéµďm˝épłý–ă­Žľ}çú]ű/Ţöş}ĺŽ˙ť‹úî.ľ{˙^Ü=é}ŢýŃ©^?Ěz8ýhýcěă˘' O*žŞ?­ýŐř×f©˝ôě ×`Ďłgʆ¸C/˙•ůŻOĂĎ©Ď+F´FęG­GĎŚůŚÝz±ôĹđËŚ—Óă…ż)ţ¶÷•Ń«ź~wű˝gbÉÄđkŃë™?Jިľ9úÖömçdčäÓwi獵ŠŢ«ľ?öýˇűcôÇ‘éěOřO•źŤ?w| üňx&mfćß÷„óű2:Y~ pHYs  šś,0IDATxíťYŚ\×™ßOďűʵIŠ;µR¶%[¶âu,ŰňÄžAś yČCŕ‡A€`Až'ČC€ä!OćÁ ‚< L6'Čx3ŽF¶dÉ’eKµjv“ÝM˛÷˝ŞşŞňűť[—jµjëfµDZőIoŐ­sĎ=÷űźo9ß9çvMjJ )¦šhJ )¦šhJ )¦šhJŕÓ#–=j;ő´•©«Ŕ9y'ĺwžh~ß 4ŕ.šöü¸{G3'ř.§´É‡Uřrz˘yÜ_ ¨ywK,¸?„vT& rJE>¨˝kđmx ž‡/Áëđ,|ľ[ĆňMş 4ŕVî? ź }Cˇk(„ľCI“¶6BČ[>—|/‚­ź3â–aAUٵxöGÁż ¸źŻ”ľ7M;‚Ř 5ŕî× ¸ĂgC8úŮäÜć"ú»Č- ®€ŻÜ@7óˇX \t!w>*« ůnéwá÷KÇç9ľ«Őö+Ô2x9Ďé&)ĆÜ‹ć ¶t×PL5y }űRY°ŰB,´ßC¸Pâg9ţcO@ă°?ţI‰§9Ň‹šTIŤ¸Ň]Ęťď ˇË>ô@‡Ąîv»Ďż—húň^ež ą<? ˙ xľ˙¬– ¶¦ľI% |r·0Ş’Ą6ă´ť„kďË‘s!|oŤĆoĚ·‡őąö°2Őc łůü®ě€}ž€5ç×á-řSMźŔµÄn –kiYA]¸Jśý›Zizfą?äÖúĂVćTČGĹU›wÂlúëuřSI÷.Ŕĺŕ8Ć@ >ůŐä×%”uömU? aę4:şů°ü§đŹáçŕO%Ý_ď„hđx˘ĺÇź"¦Ćý.©ţúÝ˙cŔv”(Ýhď»đďĂ?‚_„cÇńSAm xJłWúż§C˙Ńî0t˛45 ćZU´`…[qżí4ˇŁĂÜOŕ6č‡ůŢ×Ú:;Ca«Í˘*Yí~°T­ăk‡YżŐtĽšVĄł/ŃhŁňv7Á/ä[ÂÖfw(ĎSś1\ńsM®LÂŽˇÓěűhź~Ý €-"?Y*: *±ß[‘·˘ 4x"„±'C8óÍĢhÂó™ö]äŠoŔß‚‰äb ¦żţ­¤}đÁ€Yc„ú+bW„şEtëxWsš¦–Ő,ł^ťŐÔĽŞFĆťÚřÝ6j5úË˙śq5y‘|ôë˙E}žÎ÷ʏ…~úżÁ?‚Úęo 5`µÔ!‹‰ŠUä•E^¤¨A đř-¨ą‚ŮĂ [ŕNć(ş`ÍŞcâ.|©@đۨť˛şú=j˝ Ëv }őcYŁîΰ<ŮÖnw“@ů•+‹×ŕ_—Žîj<Ŕj©9g#Ú@ÎË´iS€ůX¨ ĺ˛đź;-Wříp(us]'@÷’Ëđ\ÍUĂŁ¦kvIaňđ©ä^Z™–·:Âúěç°4çhŘĎ©ń <“7ŤAŤĽi. c‹µđ }Op•âÚÂ/ŻÓ 2řé ĺÖŃňŤ缠/¦'Ú·s4‡CŚÚçČ™mfŹÂżđ˝N}+3Ó.=çXz€`ěYjădř=řŔ“°“÷-ˇwM “ZŰşŁĎ]§óĎmęĄűÄ~w°ĺh龏ˇˇ'ĐŢ8ăčçăđżÂtŮIś@ÎsoaößáU»0łI§ŘBţšßö´ŻŇ©ę%}˝®Ŕ ’CŹĐ± «Óm ­hp „`ć†÷'5ŕP`@u†ČYˇAřçŃş.nŐ†đ[aŹíłCćĽÜ@=ĽŹc?× pŚě9~óІ·á?7ݨxíLF=ú~§őÓŃ„s¬I”T}=}3šďî‘–]1Ú¦§éy1Ňć¦qn“sMO"ą»&ĐŹĂ‘ü/"ś,>- ™ÖĐ ’ĂÝ-á,ţS@Ë‘8şżw–€îÔ~‚­AxF뇠źß»‘±sĚ:Ń&;í¸Îw-(HÍŚQ;źëŽ9†îGq‡N%ťÓ‰ŤBžlXţÁXg2U©6Ëô¦ű0j‡Áńřuř}xMěîŞS°, L{ p5z€ˇĆGQ¬S(ÖaľăÚC7C˛µk„EoâäËřx0 s˝ć;»ěŤ¶ťthf˙Ŕ—élž§ž•vŕ'ŕŻŔ›Ü?S’ŤX»Ť Ó02ĽŹĂŹ‡Î‘0„“«¦Á¬Hĺ´Ż Mל«Ý@ŽŔŕÚq9´úö»řë)"ůô sŢH‡Yĺę,×%úĺĂŹ‘ ™ ř[ĹY?OŃďŔ/Ăř{ß\7`ž3>¨šl—‘hx ŕá=L%"ÁIY eý·¦]îŐŹ{ž¦¸L(GtľŽ)ĎâB[řMJ*É·Ę˙j—;F·¬L|ĺ3oé—Őęë0ţ{;ĘnŔ<çBÂŃx~€Ź5ŕ;·(}ďčż·@4ĺj6n?ä0*|óę-ŔYtĘhŞ ¦Lž8ž®EfÜ4ŮC§“yč­ÍVĚvľůQ.ŐZábćËN}OROąëv|oošš‘zŕ9$;Śůě⡹‰nŤcj1Ůksh$ż›&đšţ™zőă§ľ†…8_ζ„ĄkT‡QG9b*îÝ)Čýx ¤Áç&iJ5ŻűR}$ďÓ]ňÓ‚=wa¶óëŮ+,ęaJXnÔ-xfĐęˇţ#Éň!¸ĺ^ŠËľÓsÂ8|ĎiňţÜÓ~Ś€h8sĚRm"P3W9>hf ŃJ#ÉúR­fkĆŰé]­Üóť¤lĆ­ ·ŞĎu¨U­ŽŻc~3ć:Xjď …I cŔÉáŢ ý¸˝íŠc\S“k;ëą–°Î1ʰÚcAF tŽbť ÚcĘ{‘™CpűP­îćDí]Ľ Đřf?÷hađµ1óP,cęT˙ěRßő[í‡)ŤJGLĹ÷Ž&ďŔFš_ 9V<®g{Âôj&\_ʇÉČ…0±\ “Ëma‚!Ś<… čü«źEË# Ô­­"sJÖ¦V€Ó?›*=ŚÂ©ÉYî=;Á°j |ÁÓ\Gm®QĄĂ¨ţŁřĺCÎLYřëđLŹąw|ň~ĚóEÚŔß^F3_ ůÂ_†\ńµ°™=¬m˝‰_ËŮé0ży3ĚŻ-†[këaµľ±š×—[č íśc, čj˝Úť‚nš3_şËnv5ŮĚY˛~€źÇ…:nvH•ă~Nh8mé=«‘¦]mî9@GyŰěĹď)źÜ€Q‹Ş|†ăçáÇ`sL,Ś F›Eţ›Ç ß‚Ża†ßáxÓüÇ·8^âčąIüáŤ)ÜÄW/‡u’Ú+¨óŇfKXÎt„MżQňá ^˙*Ő!)őÁżb&Č^ŻéîězĐ&CZŻu¬IśŁĽh˛«(»0ŐŽ“Í˝çł$DRźü*wR›iř'GUZ_wŁxşđ,ü÷ŕ/Ăź…qhq‚&ËĎ ÇŚŚQbĉ4b˘ŕ}ŽďDMß*Ž3]8Áâu4|1¬0]Ęf‚_ŕuŞXc˛Ér9Q‘Ş˛€IĄCňĄĆżQ“DZł ’ÍuŔĹd/ÝĚ·ćW-ŽcćRg*WĄ ëĂťdÉĽé“ y}ňKđ2LŹůä÷íF$´ł,©­ż_bŇyuÓ‹”Ľ\b?+;ŇŽűڱ}A> †¨ĎÁ'n"=ŮN aúŇôŻQ”ĆÉ ź†x­nŠÚ_ş`€®Ç8Č÷ů<ú4iĐ'ŕ‹‰®§Ň‰ż áęź&ë´p˙#—ý!̸쓡Ć<|f(Ś^ 9řÁÓ8śX›ĹXˇĽ7ç1…hK¦ŢUX ˘ÍÉ’™?ç(ŁRńĽ–ŕü| żş:.†Ž!2e˝q>ů¬6×jEKŤ0ŃÝ4‰îžčŽ úó•Iý‡v_Ńa´ŕ±ÇÉŻ„pć懿k"ż5Śśm ý‡ŰIv˛ …Ą­< ţëđWáa{Ä[đUř]Äô~Čç§0Ą·ÂŽsqł— ­+¬2ËĐ_śŚp&Ş ÔóQŇ €9U‰wóĚË·é”YÎ-]›©DškÇÉ#g ş.»\·‡őiŘ‰@Ó{>^˛K6ŽĚďş@N˙U‹âFqüÝěz,ć$ą—±%Ľr$dt]EMôa?”Ş»ÉQMř zźĹg߆gĂV1‡_ľ@Ŕ6č],˙j‹3M‚3hĄ«ÓZJ_?rPŁ-o„mö+Kô«Kď1n¦Ăt pU)ăâ˙QĘç6:ą~”ŽKĎŽW+eű?6˘5wMhđöť š«t]tzŚ8•¤ěRZ‡júqöÜłhőc¬â s¨ |!˘B»ĎQĎ3|ţ| VHŻÁjó›đ« ĂƉ¸;â°ęćZÝM¤ÜŁe«´Ř€‹Ë’ĺ‡Ńâ^Ĺ"ÜŔôjDč0vD' j™׍x-M´ŁÉ §íµ7`*ýxh~áśĹD˝Kňâ}ýWx4ä®~gvÖđÁj…Y«;ŠÉGAu}”ćíÄ_pđ<öů¤¸Bsk©±÷1b˙Gý¶Ú€zŵŢGo†ĺÍAŔbxŐJâ¤%FĘť€SŹÉV‹eM|/ÚęXٶޜdđŮ`|>€ovhdąJäd†»#ŐćÉ,őěCO•ĂţSă`ůęź3 "ľ¸/fnˇÄ®™ľ Ű ě«XŢ,â …iĐ.•U@ÇM˙á:íméd=–Ń:ę}ő“é=až„_#Ä­BGŘȵt?C«öĐéŘ—Bu‘Ů/ýą>ąví×<ť´đÎ,ŮNÍvY˛“Đ L†äčË7X´Ą»ˇ‡˙ çĘ^Öŕ“•Z·›Űě0Ń€+(/˘­×x ŔëĺYÚ0W-đô7Áéë–&‹?nľ¦‚€áŘŠRÄ„Że0Ćí"Ç=µŇŮ%MpšŁ`Y`É`Íe˝đmĽ5M›8ďN‰ľ|H Z¸ P:2XgKkîaJĽ s"Zź24ćÔ>ŚďmEý[č jŐ9®–ä{7¬ M:4qť âňąuŁí-KeFË—Şë ¦¤>ÚÄĘŘ“¬e^mcËLZ‚JĹ„?•Ĺô¨ ßäLv6l˛®j%;J€ÔÁÝŤÉV“»ho;m›Ĺep+ć°}ë@'ţÖ@±iĘí fóďńŕ1•+Ŕ­ýóÇŢčn‰–oߎ"E .ÜH;WUÚŮ}Pµ'F¬F ‰óµí%?ÉoŕÚQ“蛤A¦ŰÉ€vXmÖD­ęÓ DĚţk‡ą’ "+Äp3w‹?Î3¶îb÷›ćş ´ĚEW‹ą8RÚf­ęÖÉýUX–´Ó€PS]©‹ĂEĘ»'ާ'Ç|üŽôÚýˇŹŕ3<|­Ŕ&žĺ4…îiRŁsT»;Đ–§‡Ä»ľČŃĎ §Źŕť\é1]teéQsŢŤŔFŮýL.|?płhë­qL݆5Ťé+=śŚź]3µ•é%‚E˝âąKoÁjŚ ařÔVx˝Caňť(µ(¨JvF;ˇ +B¦qÉk#hÇ@ŇžJ¸°`ô,-ř™A¤m»˙lÔ©Wo(Ý[ď|4–¨&܉„A€…ÝĆŇŽÉΠA·ŢÇt«ář{}ť‹ăFĎq&xcľ ˙LT…é ń=ZW9®`®ł,bŹp'÷é˘ÁW%˛-r\ăE9ŹúăŐçiźM+QěŚüî[ţňŮVÚÇEqJőyŽô–Ć­»kB˘%ÜŤ-Ő\şÇW3ÔfE§¬W«5EˇŞŃmň!b€?+`]÷śç„FN!ë]eáFôÜ:sȬÉX…˘Dýă{03”'ůŔ¶¶)Đ^zFőއ"ŘśĹ],p;Ŕyď~B+KśwčdDíľ*3|Ř I~`óăPŻě•{9ŮX€óä€ĂŢ~‹Ćv"`sş)ŔńˇyŔ(J¨ń^¦źvjкݳԂćŢšÄ?c—¸żĘű&~Ńü¶ÂtŹQaë<Âü<5ü6zťÁW»‚ä OłýÁ +5רJ&@\˘aťćŢ9:śíŕ:ŁUyFMş/Qç3G)ü2ŚZłúĄÔ`€‚ń:çkfĘ!ţÓíŁš2ɡÂÝPÚ9˙uر2ĆŃüuŢh_\}™ŽŰăŹeţI±S“ů?äxľUDÁÔtLe b\$PćZO9aáާ‰çmg 0˝3ľ#»ÂE»;Ý€˝#OÇr6NF˛¬Íjo!péŹfĚ5UAFčš5ŽcC$e€ŁŔ¶3_ë˘T›4řF!/˘ÍynBv2ÎţxyŻäý!ě1Ęâ,‹Š9á78vě0í:X‡YÔJçä,Ú¦jäýµL1WŤĺZXÓ“ńť#€]‰ß÷•Üřťb•‚-Š|©Ň%»=߀y˛č׼Ř8K~‘aÄ(+!ÂŮ€é•Bo®ÂmbťĹ öřࣗYHS‘J2ŐęôČ/5ɲ_×ĚŘ îlMžź$°T‹M|(Ɇů†ťbLo>LÝ˙fĹ'íÎlI%ö˛ßT¬›Ńç×ŮŕĚ2vŞIDĐŚű2&ď!č¬t±µ›âś\™cěžĎbbbžúŹ9ŞwMŤ¸\#}&ľ…Ů{…„ÂŻńmżaĚů«$'ĂÜÚ2‹áŰXđ^ SËt ’đó®Ó„;TŃ<ďd[˘é×\÷Á¤«Ô?5‰ ±€ˇ|‘Ëqâ,ßX›Űčbś ú,ę áÁôüŕVń SX•˘ę–X?T%Űé˝)®ŃĎ5Ó{FónC­Dj±‹čŻ=ď¸xżlŹx ľ cęîŽö`ÁŐdŰŔwŕ7ŔI~˝ÄŻüëń7DťočUśćmŰĂk g×x4~Ňé9kŠfÁŐŇ ŠĆ2–382ĎmÖɵ }ëřFł^ť_ej>aĹE2OKt\‰5ĺ Ź…V¦1Ô1Łf¦«VŘŽąHGťă~„1•ęÜqĄŽęy—ćú>ě-†tóŢE`_€ÖÝŃę}ˇDÓŤ EŽÍŚŮ¤‡s8‹ľM˛a‰€|ČńZĽ,QŃVś2cĂĘ˙ ˘^-oµŠ“ËD·k¸î$W}š6t÷˙Ć{ĄxZ7č^&án˘u0ƇŘţ`’Ĺ6TŁ"ŤÔą3Ł îŔrř ¨jSŠšę br}Z2.ŕĂTrw¦zżŢ)leôËöČUçx'Ńţź_E oô;řżëřlJ¬aÎŰXvÓ†[bjĐ@l{0Ć…IaëăRZ4ä6ŻŐ†1€ęܲ¦Úő_ćŻýk7u[Ńž"ľ0Ë YĎĹŻwĹ|xÚi*ÝTü˝ŻVç&ÁÝ”›3łjµf›â¸€®”ÉШđßa•â®´řăv–%5ÝŢęCŕ¸bžřuŽ‚˝ßÎtű–†Đjú2Ĺž/U«—Ô:ÇĘÚűMúÖž#ÇcˇU¦ŁoFł]lω…łđsđ"Ö…×BGą÷q6•·D“Ż5©D‚Ë˙±3šş\C“Q¡3´Ş«i±C*Ó—®W[žôWa­Ý żě•Ş´vŻUîů:ÁVÓ[ 7Şť@Ŕ®î ‹Ůá°ĘŰb7YgeĄU Ő(ýY­·Ľ“®qžCn=Gđ}kîXŤŕ­ÍNť>ŞÔ4ţ%–ýäÂ#Ľ-  ŕŞ"­·Ü˝ýÍű©ąlŞ +€Ü2Bl|šó^K‡«H´ĎßoĽd z_rľV±x?ÜK§ÍhPËY€oěä‹1ăD$#ú :Ëd0UŻÉ¶¬©Ä ‚źĹßu\®n„ďŢĄk€˛ÄiN@&î¬Pń{¸ďańN?á˝&?›¨ŻyZvŁ»ĂŔ%K?‚ĺÁŐWÓb‡‹™ĆĘ}yÎäŤEŻrääŢč^8}ĘČvľŠ™,°×¸ˇ ˛{ˇ/ô3Ń\Ö;1 (j±Ńőě"‹)ô…,ńĎű˛+AM±Î˝ÓpĺžăqůâŁX‹“ډŰÉĘ%üP‘ě˘ŢĎŤîË€ĽQ:ôîĺ|•!“™-‡rf¶rëX–'¦Z÷µ'âiďyŇG#ůđv4Ůąâ|XŘ8Íô‹čHJ¨Á&6j™kS€5±jóĚMEřjôÁó?Hü.InxŚ+ě‹0ŰW ă˙{čT]q^şŇýÔ^ŮÎg¦.OóoСO&C—PéZ.‹Ů6ý°K‹ 9» ÇůbÝ5ÝűP>¨ćZ ŻlńĘÄüXôͶŞ8«d«šŕ¸0’e,;Ź›ŐŻ3„ą€ĽC'Ǭ×Á4î)b¦)Y 2…k¸öÓ9†ăâA=¬F¶Ú¦Op‘¨ÝW#›ř¨öŰçj͉˙gâ•f‚÷D÷ Ŕ>HôŤto†[H,Wč!áb"1§řĚ"Ő9 óéfť>ăąë(†ÂjBő“ţ}¦ĺë]$@ěTşŠçá3X Bá0Ŕ­1S¦%¨E‚|‹áŮ:–Ă”©¨‹±x%2Ȳf¶räŚ;Ă˙…—`e°+ú$ć ˘ŮI{'Ogul‹“cß縓<ŻŔç |xż3ŕ2›Gb$$Ž2ŚŃ,VĆX›µ;žŐ|á.áóܱŞćŮÉx MżĘy˛kŔ˙WXp±łá4ű“;âždÝC5ňg§9î3ϱíuż~ż"q‘Ńvś€XiĹë˘^ŻŔ>ű®čăXéa§âúĺop|Ć>Ţy]7B€Ô+‚ĚO1Ęž˘Ä:šě+d‘S“É0¦šfĄDZµ/%źşE«N¦ŃzĎnćέ&łN1mx›ňG0Őg±CIú’:ŞÝË߇{Źk t ]ýÄIŹZä+™Ý€·:#Ŕ·á`ĺ˛+Úo€őöüż˙üĎŕ ˙€(óŰhŇ·|žĹ´ţ5Ňż‡yýż}Ö†Ĺq±Çr¤ůtĽ<‡PŮü)>2vÚˇL%JŽ«(ľZ8«mäjnkâ#ő‘.Ń]ąˇŚSĹÔˇt”¶>Ćú‰¦ů©šĹHÝ…Öâ ťČ×iµQ˙Či€×8T!ľŐ)4˙][láç`ÝÓ®¨Ć]vU×ÎÂç8q~~ö5 CÚŁŢĚBVŔľ¦%»•ă-<٤3ëÄłŠ{ް“q!Á,ÇťdϦ‹Çm*/ Ĺź łcapµ/ľĘˇrYBÖ‘›Ëm\’;@Ůu@öăľăŇ´âˇG¤]ĹľŃ&–Ňô\l™d2$ĂB˝.ŢHŹĹµ%˙¤uo;cS¦®˝ö%/ć›Ý’c'Ş–ôpţÚ»•TČŮy{ańŠNyű-Ş}ö‚F“˘3 ó%ř{đ3đXŇ„˝Ŕş}Ĺ5ĎÎô$É,JŽż‚’édÚpSř@ŘȲă˙W˝V Ë=Z¬ůz‰´ć÷ÂüŻ`†/Łlľ¦ó ĐsźÔ ĎŤgi˛ÁŢť˛`8>ő7ßFçyÍôĆÖQ@V°ďŔH§,ČškËX`ÉMëˇř¶Y5§’đ-/-hť“3€É6â8qŕĆvt©EWbi;šBţ9–ĺ),Ĺ)˛Zq†÷)G±~îaÔ^_đ˛ČŁÉ™¬¶ôA+îÂ8ŕ–ý;v⠎ʡnŞĐőęľ~{A5÷)řoÂ#ađTkŚH;P°ř×TřYŕŞ%$|V…áěĎI´} »6ÜÍF±đ~yFâeIŰ8ż Čď2ŮžŤ“îŽu­3e>~„ÁĹôCÚş†ŹśF¨A1&|Uˇůę–Vţ‰ă(ÇŢŘ—ĄóâxÚ˛‘9l'‡H’÷ řÜ ŔKtFúŞkÄŞ‘>ŘŤm ŃëâßtJż×ul$Ŕ8,©˘bv3„Ůí çž\_ë»ýGĺš§<ĂÝřľeŚëôđľŤY_ŕ…\‰nňĂ»hă›Ě#Ż‘Î$wŤ0ŁŚ­TŢA đMuĆD mÝÄ,ꇾăQ'$Ü\ÖâN·8ś;ĹqŠş79ď!Nń>;ęOżj%śńE¨ľóĂ!oˇwv«Ĺ{ŹĄ%ĽŻťkWÔH€ČťźŽÉ‚ľšô~_­ßĂś 'jĆf-RP˛‘§ëťŹ¸°żÉهŕJ!h2)Q?#šdÍW>ľŕÔĄ?ŐČ69Ô1šîćĆ.´ôoĆ?®Éw;ëéo$ÇÔ˘/ÁWH°ĚnÄÉ„¸‡¬ĘMÄŃ]îä‹ ŢóřäôŻÄTşÔ@Ë@/!‘¦·íް¨yăďĂŹĆ4Ű#†żiýŰGqł5Ĺ,Y7QŘ˝¸X - ö< ę ŐŔGZÍmnD-6¨©‡8îwB‹ç®&ľĎ…é*®ď‰ LĐ—$gĆY^´Ŕë31hްV×d§uä_zŠl\ł]‹Ě¬9d‹¶x˙'j]˛ý÷F¬ô ®†1gť±Çé;˘ůS¸EŚf·ß¶ÎĎFź $j rčŇ5ŘJE‡©^g‹ĹJn+`[Rh©‘҇}e’ĐŁU ›Eþ׉ryŹůă6Ł®ôČc)2[qŢ÷CőíüRŞß?ó糀W\ Vʶ*Łů$đŤ÷÷s]ÄŐwM6ů"ĚS\¤kśü 'Q <”Ú)\.t!‰„é5q|­/¬DŞa'o–0Őą¸Ş˘RiĎ+0M|$ ·o%C7®Ĺ H`«ĎÖN<ŔÂ]<ź;·0ŐÉőś,K%|ăźŢÓđܬëŻC8N1F9örő®üđ^ĄżýY@3šŽö8ÝćÄąŤ’Ů…ŕ{"ëóÇ?X!° ·Ú*NaÜĽ™ťe23Ť)t%G-ŠVc¤;ńĎń8Čq™ÉŽ5-Ú{çjdGŐ[mň-zţmĺZ¤MĽxL\áŃZ—l˙=^µýÄ]ŽA Í tß'µ†p7aq®%„ť77Iż‚L$~.Ő ť%·M—äNˇĹ+qÉŚď™®uoÝC™~@hă~Y@VËRr+ŠC&JÁż/ĆńůF6GŤúkÝ€+tWNrčzü{Ű;?—%sÖľµ(É]Ű€ eËU8Ůx€Ť¤L¸ ”YĽ8˙1Ż6Ô©É\1Ë+¸¨w„RQC+üCöÖś żţĎIzÍ×&8\:ů4ţŔ}uđÜ{€})ńŻ&ŢŰ|RÚĚÎQTžNAą“Oň şIGYľ®…¸˙Oř*\/-0ţ寷I_şŐŢťăOÄ X^aXÖNőĄ‚Ë~·$űf›¶QśÝˇăÝüµ'y ŕnńwň޸ŐŢ#öŘY_r©•hĘńŮ|ĚS7kâTa8%Ąjý«%,bůVgĚ и^“Pť 0hřšÜâY”݇W˙0ĆžüăÇQŇçŃę1ćc§‘´ou󦟣#:/Ús¦3©şůęҡ-±ŔQíµő’ćüy´x•%6=˙qúűYŔ=Ç•ţńçtíUZŁ}-ö7€đ•ü O’Î.ůňÓ„Ú){‰~ř:3JýĽŰžQ–z đľË/ěR<Ő†ĎŃŹŹ˘Ô߇\vrŮ꫟l$Ŕ ˙Wđ#ĄŮX}(\˙ËM–™Éýr šĎuiŞB2i`"!}7´Kl\2ł8NäüKŔ]ŕ÷,_ŘZ!Ňä&âçPiŰmĎ óśľ¬LXkëń8ýwôɤ3}¤*VčqMíýVŞ‘|Ţ˰/ ůJŰ=vŇ'.‡B×H[ü«4ţ#r7٤ţť—ßÝ÷FlKŢ‚q˛Ľ¦hsńKĽtł ;â”›Ónćęµ’qŹšj+lęÎi:ßăEëá¸řÇänɸ€ŢUzNň×[Śŕą\ćŔyÚ€•HľCĄ”Śz?ĽěpşŚŇź+A2ümřbčbąĘ Úë{´îԏ߯‹RóRWá;… °˝Ú‡ţ»đże0˙^×˙pxĺ?ýshţËÉód<™4B vgߍ—ŤNÎúᅥ˙ V ÷BšLT"q^N*`3x]…Ż0Ú -ŇN_gś·nźąŮá߀żVf°N<Žľ|·äŰęImŃ[˝BUsţ%|~ţ'$@.0MÖćŢN´“ !'5#Éű}ĹŕáGSkP*× ÷ZÇč˙»D‹vS­×Ú!÷JKăŘ·©äŤ»­#ţŮűSŚÇ±íńXł–ýŘ› ň,l‹°˝4¦?Ǹűç3qÄw(íW83żż ŰIü­Q¤¦Ů¦ńءÜMwd¸YG>î‚ŐĽRĘNbeďd]FzĆ5iżNolcdµq ~Ćʼnk‘ěŘ."ޤl-“/ÚĂ?šĘ«đK{¸¶Ü%ś´Ö"źď:¬‹ ąkZŁë,ĐÝuĺÍ šhJ )¦šhJ )¦šhJ )¦šhJ )¦šhJ )¦šhJ )¦šhJ )¦šhJ )¦ö[˙ô1ňŞ!žĆIEND®B`‚base-15.09/notification/ios/samples/NotificationService/NotificationServiceIcon29x29.png000066400000000000000000000102011262264444500313440ustar00rootroot00000000000000‰PNG  IHDRV“g AiCCPICC ProfileH ť–wTSهϽ7˝Đ" %ôz Ň;HQ‰I€P†„&vDF)VdTŔG‡"cE ‚b× ňPĆÁQDEĺÝŚk ď­5óŢšýÇYßŮç·×Ůgď}׺Pü‚ÂtX€4ˇXîëÁ\ËÄ÷XŔáffGřDÔü˝=™™¨HĆłöî.€d»Ű,żP&sÖ˙‘"7C$ EŐ6<~&ĺ”SłĹ2˙Ęô•)2†12ˇ ˘¬"ăÄŻlö§ć+»É—&äˇYÎĽ4žŚ»PŢš%ᣌˇ\%ŕgŁ|e˝TIšĺ÷(ÓÓřśL0™_Ěç&ˇl‰2Eî‰ň”Ä9Ľr‹ů9hžx¦g䊉Ib¦×iĺčČfúńłSůb1+”ĂMáxLĎô´ Ž0€Żo–E%Ym™h‘í­ííYÖćhůżŮß~Sý=ČzűUń&ěĎžAŚžYßlě¬/˝ö$Z›łľ•U´m@ĺá¬Oď ň´Ţśó†l^’Äâ ' ‹ěělsźk.+č7űź‚oĘż†9÷™ËîűV;¦?#I3eE妧¦KDĚĚ —Ďdý÷˙ăŔ9iÍÉĂ,śźŔń…čUQč” „‰h»…Ř A1ŘvjpÔzĐN‚6p\WŔ p €G@ †ÁK0Ţi‚đ˘Aޤ™BÖZyCAP8ĹC‰’@ůĐ&¨*ŞˇCP=ô#tş]ú Đ 4ý}„Óa ض€Ů°;GÂËŕDxśŔŰáJ¸>·Âáđ,…_“@ČŃFXńDBX$!k‘"¤©Eš¤ąŤH‘q䇡aĆă‡YŚábVaÖbJ0ŐcVLć6f3ů‚ĄbŐ±¦X'¬?v 6›Ť-ÄV`Ź`[°—±Řaě;ÇŔâp~¸\2n5®·׌»€ëĂ á&ńxĽ*Ţď‚Ásđb|!ľ ߏĆż' Zk‚!– $l$Tçý„Â4Q¨Ot"†yÄ\b)±ŽŘAĽI&N“I†$R$)™´TIj"]&=&˝!“É:dGrY@^O®$ź _%’?P”(&OJEBŮN9Ją@y@yCĄR ¨nÔXŞşťZO˝D}J}/G“3—ó—ăÉ­“«‘k•ë—{%O”×—w—_.ź'_!Jţ¦ü¸QÁ@ÁSٰVˇFá´Â=…IEš˘•bbšb‰bâ5ĹQ%Ľ’’·O©@é°Ň%Ą!BÓĄyҸ´M´:ÚeÚ0G7¤űÓ“éĹôč˝ô e%e[ĺ(ĺĺĺłĘRÂ0`ř3RĄŚ“Ś»ŚŹó4ćąĎăĎŰ6Żi^˙Ľ)•ů*n*|•"•f••ŹŞLUoŐŐťŞmŞOÔ0j&jajŮjűŐ.«ŤĎ§ĎwžĎť_4˙äü‡ę°ş‰z¸újőĂę=ꓚľU—4Ć5šnšÉšĺšç4Ç´hZ µZĺZçµ^0•™îĚTf%ł‹9ˇ­®í§-Ń>¤Ý«=­c¨łXgŁNłÎ]’.[7A·\·SwBOK/X/_ŻQďˇ>Qź­ź¤żGż[ĘŔĐ Ú`‹A›Á¨ˇŠˇżažaŁác#Ş‘«Ń*ŁZŁ;Ć8c¶qŠń>ă[&°‰ťI’IŤÉMSŘÔŢT`şĎ´Ď kćh&4«5»Ç˘°ÜYY¬FÖ 9Ă<Č|Ły›ů+ =‹X‹ťÝ_,í,S-ë,Y)YXm´ę°úĂÚÄšk]c}džjăcłÎ¦Ýćµ­©-ßvżí};š]°Ý»N»Ďöö"ű&ű1=‡x‡˝÷Řtv(»„}Őëčá¸ÎńŚă'{'±ÓI§ßťYÎ)Î ÎŁ đÔ-rŃqá¸r‘.d.Ś_xpˇÔUŰ•ăZëúĚM׍çvÄmÄÝŘ=Ůý¸ű+K‘G‹Ç”§“çĎ ^—ŻW‘WŻ·’÷bďjď§>:>‰>Ť>ľvľ«}/řaýývúÝó×đçú×űO8¬ č ¤FV> 2 uĂÁÁ»‚/Ň_$\ÔBüCv…< 5 ]ús.,4¬&ěy¸Ux~xw-bEDCÄ»HŹČŇČG‹ŤKwFÉGĹEŐGME{E—EK—X,YłäFŚZŚ ¦={$vr©÷ŇÝK‡ăěâ ăî.3\–łěÚrµĺ©ËĎ®_ÁYq*ß˙‰©ĺL®ô_ąwĺד»‡ű’çĆ+çŤń]řeü‘—„˛„ŃD—Ä]‰cI®IIăOAµŕu˛_ňä©””Ł)3©Ń©Íi„´ř´ÓB%aа+]3='˝/Ă4Ł0CşĘiŐîU˘@Ń‘L(sYf»ŽţLőHŚ$›%Y łj˛ŢgGeźĘQĚćôäšänËÉóÉű~5f5wugľvţ†üÁ5îk­…Ö®\ŰąNw]ÁşáőľëŹm mHŮđËFËŤeßnŠŢÔQ Q°ľ`hłďćĆBąBQá˝-Î[lĹllíÝfł­jŰ—"^ŃőbËâŠâO%Ü’ëßY}WůÝĚö„í˝ĄöĄűwŕvwÜÝéşóX™bY^ŮĐ®ŕ]­ĺĚň˘ň·»WěľVa[q`iŹdŹ´2¨˛˝JŻjGŐ§ę¤ęŹšć˝ę{·íťÚÇŰ׿ßmÓŤĹ>ĽČ÷Pk­AmĹaÜá¬ĂĎë˘ęşżg_DíHń‘ĎG…GĄÇÂŹuŐ;Ô×7¨7”6ÂŤ’ƱăqÇoýŕőC{«éP3Łąř8!9ńâÇřďž <ŮyŠ}Şé'ýźö¶ĐZŠZˇÖÜÖ‰¶¤6i{L{ßé€ÓťÎ-?›˙|ôŚö™šłĘgKϑΜ›9źw~ňBĆ…ń‹‰‡:Wt>ş´äŇť®°®ŢË—Ż^ńąr©Ű˝űüU—«g®9];}ť}˝í†ýŤÖ»ž–_ě~iéµďm˝épłý–ă­Žľ}çú]ű/Ţöş}ĺŽ˙ť‹úî.ľ{˙^Ü=é}ŢýŃ©^?Ěz8ýhýcěă˘' O*žŞ?­ýŐř×f©˝ôě ×`Ďłgʆ¸C/˙•ůŻOĂĎ©Ď+F´FęG­GĎŚůŚÝz±ôĹđËŚ—Óă…ż)ţ¶÷•Ń«ź~wű˝gbÉÄđkŃë™?Jިľ9úÖömçdčäÓwi獵ŠŢ«ľ?öýˇűcôÇ‘éěOřO•źŤ?w| üňx&mfćß÷„óű2:Y~ pHYs  šśćIDATH í–ËośgĆßÜg>Ďí›Oě±qj'Ɖmhś4ˇŤş€.Z@B” Kv,Yu… ţţVl@\$(BPj Qš¶I›ćâ$Ó±ă±ç~ń\żąđ|N 43/G:šOďĽç}Îĺ9ç}áż î)i­mHŁŇ€t$íK˙câ™rŇY{ő»ł6Ýz›^é€ĆnŽjö]ěî5íż-L±;öŇ4P‹…‹›¤źE c†˝>ýí«T·Ëěż÷ůkżÂ磊ÇFú§Ť“éuąžců•ŻĂŘeŕ {%DcÄ—çIo®’\{Ag‡ďÔIdw)—Ă`0Gb&…é°fĹŢ[TŞW ŃöŻŠúŠVlü´L‚zü—śü §Âi‘(ˇV´îbž7IüŇuŰËÎöĎ g9>AHŔf[+7Uó%vs•ý÷Ż.űiH˛Ä°sewśY.ŕ°WÎ:ěŤ5ˇ]3ńnÎcfČ~ô3ĽîćĂÖQÄŁäĹCk]5O™nXtĘż¨Ś˙!“  čwo2kKť•®·+BTäqŔcj›Ă’˙ů9Ú¶‹ť»Ż“ ]$ˇpĂrđˇ2dlČIµSŻž!˙ÎŰ‚sýX¦€ŇalLt•Nď zĂ?˛Ó,Ńś&e†0IDŔĄ†ĆăóöîeéT󜌟!¨4;iWlNśÔGţŞˇ‹ă—Źő1 Ôů@wP§Ö/±ßĘŃ8|{x‹öŕśjÇTżútx9ě%tz;oľ®o9Đ ÉUUŰ ĘLBítVCă§:óń|¨łţ"±ŕ×±Bç©ô ”şQÔ»xÜ_bn&©-•ĽÜľlRŮ­bŞśJ-ă×z]ç·Ö”‘9ąß6ŮůÓ5Ćc ńG2 ÔŤË˙–ßă套ؽLČs™|ý-Ş˝+ G)2‘K„•B—[HřçÜ}ű=ÎÎn0ăsi‹PI곪ŻÇ ÷犮Ç_ýT•RĽ›XkŻq.˝ÎÉX†´ąŔFú,ó[ÚyH¶ň#˛µâQ÷Y64‘Rg“´}QĘíCŤBE¨Úrâ¬úW­LxńślU“G2 ęuo1{vž ă¤ĘŁ-¦×ŤÍů#››ä›7ŠÉAťc–ŐV–K×\†Şî?aŇşˇşlŮ˱Ȝ¨Ś†ô#™µí†ž*JŰ’ÚZ×ZY)ĽŢTťěĘ'6} ­űGë5±x¨{ÖŠ,ĚQh¸©j­©Ń8”ÍŘiO9°,}$>±źĆŢq·÷Eâ34ä\^žŢ*ÉĹč”[G†ĆŘMap‰Îçăt4úbĎBmŰ`ďźlĺâ ×…yRZ÷([ĺŰn^ů±lwűiDj3|H[ l´{\§–˙ˇĆÚŻµ_!HşĂ=# ;fŃî¨Ý/Qřŕ!ĄýďshżA^o*Wřęôž*ę]UŇŕL&MŽG‰q~ź''"ŃjvÓ¦ůŔŮüä#läfߌŢGŞ]=7Ôăí¦ö9/ŤŢQK~ý'iéÂoďÝÓ—jńů_ĚŔßśö(ťN’K2IEND®B`‚base-15.09/notification/ios/samples/NotificationService/NotificationServiceIcon57x57.png000066400000000000000000000154531262264444500313640ustar00rootroot00000000000000‰PNG  IHDR99Ś… AiCCPICC ProfileH ť–wTSهϽ7˝Đ" %ôz Ň;HQ‰I€P†„&vDF)VdTŔG‡"cE ‚b× ňPĆÁQDEĺÝŚk ď­5óŢšýÇYßŮç·×Ůgď}׺Pü‚ÂtX€4ˇXîëÁ\ËÄ÷XŔáffGřDÔü˝=™™¨HĆłöî.€d»Ű,żP&sÖ˙‘"7C$ EŐ6<~&ĺ”SłĹ2˙Ęô•)2†12ˇ ˘¬"ăÄŻlö§ć+»É—&äˇYÎĽ4žŚ»PŢš%ᣌˇ\%ŕgŁ|e˝TIšĺ÷(ÓÓřśL0™_Ěç&ˇl‰2Eî‰ň”Ä9Ľr‹ů9hžx¦g䊉Ib¦×iĺčČfúńłSůb1+”ĂMáxLĎô´ Ž0€Żo–E%Ym™h‘í­ííYÖćhůżŮß~Sý=ČzűUń&ěĎžAŚžYßlě¬/˝ö$Z›łľ•U´m@ĺá¬Oď ň´Ţśó†l^’Äâ ' ‹ěělsźk.+č7űź‚oĘż†9÷™ËîűV;¦?#I3eE妧¦KDĚĚ —Ďdý÷˙ăŔ9iÍÉĂ,śźŔń…čUQč” „‰h»…Ř A1ŘvjpÔzĐN‚6p\WŔ p €G@ †ÁK0Ţi‚đ˘Aޤ™BÖZyCAP8ĹC‰’@ůĐ&¨*ŞˇCP=ô#tş]ú Đ 4ý}„Óa ض€Ů°;GÂËŕDxśŔŰáJ¸>·Âáđ,…_“@ČŃFXńDBX$!k‘"¤©Eš¤ąŤH‘q䇡aĆă‡YŚábVaÖbJ0ŐcVLć6f3ů‚ĄbŐ±¦X'¬?v 6›Ť-ÄV`Ź`[°—±Řaě;ÇŔâp~¸\2n5®·׌»€ëĂ á&ńxĽ*Ţď‚Ásđb|!ľ ߏĆż' Zk‚!– $l$Tçý„Â4Q¨Ot"†yÄ\b)±ŽŘAĽI&N“I†$R$)™´TIj"]&=&˝!“É:dGrY@^O®$ź _%’?P”(&OJEBŮN9Ją@y@yCĄR ¨nÔXŞşťZO˝D}J}/G“3—ó—ăÉ­“«‘k•ë—{%O”×—w—_.ź'_!Jţ¦ü¸QÁ@ÁSٰVˇFá´Â=…IEš˘•bbšb‰bâ5ĹQ%Ľ’’·O©@é°Ň%Ą!BÓĄyҸ´M´:ÚeÚ0G7¤űÓ“éĹôč˝ô e%e[ĺ(ĺĺĺłĘRÂ0`ř3RĄŚ“Ś»ŚŹó4ćąĎăĎŰ6Żi^˙Ľ)•ů*n*|•"•f••ŹŞLUoŐŐťŞmŞOÔ0j&jajŮjűŐ.«ŤĎ§ĎwžĎť_4˙äü‡ę°ş‰z¸újőĂę=ꓚľU—4Ć5šnšÉšĺšç4Ç´hZ µZĺZçµ^0•™îĚTf%ł‹9ˇ­®í§-Ń>¤Ý«=­c¨łXgŁNłÎ]’.[7A·\·SwBOK/X/_ŻQďˇ>Qź­ź¤żGż[ĘŔĐ Ú`‹A›Á¨ˇŠˇżažaŁác#Ş‘«Ń*ŁZŁ;Ć8c¶qŠń>ă[&°‰ťI’IŤÉMSŘÔŢT`şĎ´Ď kćh&4«5»Ç˘°ÜYY¬FÖ 9Ă<Č|Ły›ů+ =‹X‹ťÝ_,í,S-ë,Y)YXm´ę°úĂÚÄšk]c}džjăcłÎ¦Ýćµ­©-ßvżí};š]°Ý»N»Ďöö"ű&ű1=‡x‡˝÷Řtv(»„}Őëčá¸ÎńŚă'{'±ÓI§ßťYÎ)Î ÎŁ đÔ-rŃqá¸r‘.d.Ś_xpˇÔUŰ•ăZëúĚM׍çvÄmÄÝŘ=Ůý¸ű+K‘G‹Ç”§“çĎ ^—ŻW‘WŻ·’÷bďjď§>:>‰>Ť>ľvľ«}/řaýývúÝó×đçú×űO8¬ č ¤FV> 2 uĂÁÁ»‚/Ň_$\ÔBüCv…< 5 ]ús.,4¬&ěy¸Ux~xw-bEDCÄ»HŹČŇČG‹ŤKwFÉGĹEŐGME{E—EK—X,YłäFŚZŚ ¦={$vr©÷ŇÝK‡ăěâ ăî.3\–łěÚrµĺ©ËĎ®_ÁYq*ß˙‰©ĺL®ô_ąwĺד»‡ű’çĆ+çŤń]řeü‘—„˛„ŃD—Ä]‰cI®IIăOAµŕu˛_ňä©””Ł)3©Ń©Íi„´ř´ÓB%aа+]3='˝/Ă4Ł0CşĘiŐîU˘@Ń‘L(sYf»ŽţLőHŚ$›%Y łj˛ŢgGeźĘQĚćôäšänËÉóÉű~5f5wugľvţ†üÁ5îk­…Ö®\ŰąNw]ÁşáőľëŹm mHŮđËFËŤeßnŠŢÔQ Q°ľ`hłďćĆBąBQá˝-Î[lĹllíÝfł­jŰ—"^ŃőbËâŠâO%Ü’ëßY}WůÝĚö„í˝ĄöĄűwŕvwÜÝéşóX™bY^ŮĐ®ŕ]­ĺĚň˘ň·»WěľVa[q`iŹdŹ´2¨˛˝JŻjGŐ§ę¤ęŹšć˝ę{·íťÚÇŰ׿ßmÓŤĹ>ĽČ÷Pk­AmĹaÜá¬ĂĎë˘ęşżg_DíHń‘ĎG…GĄÇÂŹuŐ;Ô×7¨7”6ÂŤ’ƱăqÇoýŕőC{«éP3Łąř8!9ńâÇřďž <ŮyŠ}Şé'ýźö¶ĐZŠZˇÖÜÖ‰¶¤6i{L{ßé€ÓťÎ-?›˙|ôŚö™šłĘgKϑΜ›9źw~ňBĆ…ń‹‰‡:Wt>ş´äŇť®°®ŢË—Ż^ńąr©Ű˝űüU—«g®9];}ť}˝í†ýŤÖ»ž–_ě~iéµďm˝épłý–ă­Žľ}çú]ű/Ţöş}ĺŽ˙ť‹úî.ľ{˙^Ü=é}ŢýŃ©^?Ěz8ýhýcěă˘' O*žŞ?­ýŐř×f©˝ôě ×`Ďłgʆ¸C/˙•ůŻOĂĎ©Ď+F´FęG­GĎŚůŚÝz±ôĹđËŚ—Óă…ż)ţ¶÷•Ń«ź~wű˝gbÉÄđkŃë™?Jިľ9úÖömçdčäÓwi獵ŠŢ«ľ?öýˇűcôÇ‘éěOřO•źŤ?w| üňx&mfćß÷„óű2:Y~ pHYs  šśIDAThíšYŚ\WZÇ˙µWWuuwUďÝv/n۱CâĄÝž%¶g˘Ś Ěh4 ¤A  „ĽĂ!±Ľ!OHĽ  ŚH2™h„3a†ŚłŤ·8^zß·Şî®}ă÷ݮۮŘ&Ő1žÉźuúÜş÷śsĎ˙üżíśké±<^˙7+ŕŰĹL˝´ń׊gíáš4š´-B?ĺIpV¨7ĄEEJŞV—¨ «Ëk÷ %ĆЧI‡ż"_Ó_*ÚÁ‚”s*ćsŞVTMŞZžŕú¦Ęĺqݤí,e•’§ä(úç.Ť@zä …kěŹ ł Î ˛ qऴµ8¦Ť)=Ç‹[Ş?VĄtEĺŇ%UňAÇCĄ)ĆôĎŤáF ™›ŞňGŞŠ{éä—ÍR«6mć^´őÖ|łV®ŹjĺƨRSżĄŤŮyž_P!÷«r‰Ösü3gw7 ™ŞĚ­l¦X#Ä@Ú}/˛Ň"u`ş¶éźÖnďŃĚŹ~[ ~CąµË°˙şJą¦Ó$%C1ţ™H#ď”Ç?Şhçy ťő`›LĘAG ›+uó´…°ßÁf©uHÚsRÚűEźÂm˝*džQ9ާQTz‹Úu`\ţtĄ1H? #€ě˙ĽG9ć•·‚Ö•đ+ćŚXco{ µ«Ö!wĹGŹyŐ˛7ˇüÖ•Ň_RĄěŁß˝ł”ź*«ŤA*8ަÄy&čѵ’Ö˙‹‚‰-˝+-üDZűN0·Ą “^Ň&Ľzë#Râ Ě~ÎËxíJ/źĹžÇPcłÓ)ŠŮ‚»T\>:i ŇăU0r^ÁVʞ;Á˘Â\'[ĚÓ»Aŕx_Zľ čŰp`ë P¨˝–O U0ř±ßöCRďÔ ŇKg±ő6X˝E ĚJ=ZiŇŹĂŮŻ|ćR7+Š–B:5ŕQ_ډÂL/Îf°U˛šÉ'Đeׇ”YÂ9–ő…Ť4io1ǰ¨ ĎŁ–ĐWt¸ŁMa‹<sĽ+µ±câÖ~Ôł0}î3•…łß%ňˇ4ÁĎ}g :…Úh7ęa1ŰI.N©DVĄ*6ŕĽŰFţ?Én@Ú |ň{‡ |]­“¦†ĆwŔhW °™b`zµ—şś×m2¨3¸ůßŃ_Q÷‘Cjí?Fžú¬‚Ńĺ ž•×?†— ’\Rľř†Öroj:9Żů-l+߬°őöžW«ćśÚY„y|Ěâ ád €wÚo0¤ŐGqF`Y,%H6ąçÍ÷u&w WŰŕ9ťřâă #&ž•†ĎzÔ;UűÁ~˘'UÜú5Ô“¸ţrém^ŐÜĆ´ćŇ eKmŠřý8!ÔP®ĐfN;&?ÇüŮľµŽŔ Śš«¶ńŔd;>L*hj;çvßmݤż–Öµ?áŃÄ2Ţa,łĆ$ĐćřąĽçiŻ˘Ý=*fľH^ű<ČöUŔľŘ*¬îQŇXČ‹§ľ;?p*BŚMŕć k¨ĹSËśÚĽlÝt¸ň&w7íŃnĄ1H_`TaË]Ét¦ţ… ĎŠ&Ř? V~D*‡©¬MáQ™xçS€=ĺUb$ˇĚúi•\­L˘Ę/i-3ŁĹĚŞW<äSŔbmM ¨…:ŽçM[bPÓ<µĹÖÖ˝>­^ďUĆVA?¤ŕÖw'»ŮÔ~ž|ÓŁňGŇóíŇ”alg«Ýi© ×đôÓďáěŮ*¶vŕŚÇÁ¤–_ŔžěXľ­tám-Ą‡p=JQ„助qŔ#ÜMŇÓ gľŐÔ:Ě;˝ –>ÜKVôwgÜ®ŤęÝě8ěQćšt`–ńŕK˘6ça9ěaˇoąÉQĎ,,[hŘűůé‘€˛ËO)źdÇQĽGţ®V2ť*U†Őń;ńÓťĄm†Ĺ É˙ÍiÂČ~JĽćíôhk.˘Ôdçô&ÝlóÝP»püĽâěBđ‚°CcŔV¸^Ě{¶ńlěĆţúuÎ(MCŇţs^Ú÷jcę,ĽOńm%s=$#ęh˝ç5ÖÚX¸őě vÚŕă}¦¶–čG;ýZř źřąÂëLąw&őłr®¬VŹ`[§µ1Y–= '9µ [7^ęd6Ôőbl´0™~{oNŔg’Ă/x·)9>†ú^čw±#ňűÔóíě=m8KřÁ®ńIĆčôŢ»lZ*[÷kůyaő{´Ţ¨ý®¤O5ĎęO«śRČw@qŽĐ,÷jáýučnĚf#xm wPŠIĺK=ůMŇş”¦’%Ü}•{śý°3öŇĎpw§ş ľŐâ ÷§qZtŃţŻĐ>Ř‚§|JĄŇ÷T¨\ÁNżŔ5ĆŔáü±…36§ça®1†ąŤfÚ}?ö_ĘřµxoTyťźĘf#îKMď×Ů_™â«ÚČżˇŐě4•şA.›ŃB:˘|9ÓxL¶dfW®+6ů8e§”ÁŢöˇşŮőVČ @_†Ń*ŽlL{ZęÔ–1,%, S$ íżt—M3Íš9˙ťăU—Ü×=¨Ţ-Hëk¬ňFç󀱋ŇŰ€»ŕËšI™Jv4DC¬ÚTŮ€â„u“8¨.T÷9âŢ­NŽ?găíşëgö?łDzNH‰ďŁoŤMŰ“¦˝Î‘‹ô ţ×MvÝLhöpbç2cŁoi=3§Ů4[˛J»= 1®8)ś…šßžbÂǰŮAÍż»‡ă•+„ôŮ{†ă” ž¬ź$T–µťˇŘq ĘâÜÇ ů8ŰŤpÔůZO»Żş·~ Ý13,ňö—a¶ç´fPß: 6é8꺎÷ź'‰|Đ…°–®·«Pz sŘŻÎČ0 ´=&Í@VOâ€"‡(h)•-š}¶X˝ĺÓĆ49¦.P(Ň^i‚Ů j85ŘSg+s¨đU%ł8‰aN|8¦íVŮu„.w&e„„ÔKSvő¦<śŘüg5ÔćŰńÖf–ë®lâ^Đ÷®'jc1Ž—i·|š»„w«ţ¸ÜîŘřŻůqr-Ç)Ľ€:~ž2Hłp쀮tB[ů§ŐčSWłÁŰ›t’AmMűżŔd˝~Í˝Ce_ŁśĐŢÖŽOkěÓ\YLnšpÔu˘–pĎĆ*ĽšýoĽm–ĽRx¶űe· m’Ý”_‡·?'őúŽ2ľŠŰ?Çő×°ŤgIÓ˘’N¬]ĆN“lłžˇ]‹"F>b#ŮÄ”qJř žsżŹ¸Uző LĹGéĂÁV­­µ/3ä8é^ŰúŘaí>[YúÚ¶ŰÜ4ŰĽOv’‘ÔGůSůB¦DtźN÷űtźÄăěđŞ'Úˇly  bW,«ó}˛ÄŮĎŚöá<Žkn#™X¬łÜwŹśÄKöℲ+>-]©ÂÚűl˝žŃ0[·ýv/'zöt€;5Fsj’%˝fšôď‚ń'… …´Ĺű 5uüˇ:‡Â:Ů#Ťön'Ňf+ćXۤ31Î\“Ń^¬qC…âËş“šź/µse´łŢşŠ’cJ}'ś6Ś*_©°-[TšlÇiڱ U Ŕ¶fÚŰo¶?šxđJjwo×׍@Úklç˙űęý\ČIŔ÷Ůu$6’UŘ$ě`y°•3 }•»8GЬë5%35™älČťµŰ>ă&YŤmâ#1Tţ ¶Š·8'ş ҆˛w’+(‹Š—XWě3DKź—ó!÷K#!tţ¸"íŐý4L0xE3‹»WĚĄGŮďůýOń7¸#|ÖEŇÁ-΀¶oşDD±§ˇ$9ŤF  ‰oö’ć­jłŽIëeęăqvŮÂ7j f•%Ív°«šëĺŞN䣌ŻGáŹ8¨S…—äQycÎ÷ÚĂfÉ«R™Äň ŞŻ*•›Ó Ý®ÖĎ} SČŻ˘\'öű9ěg‡âŃF®üÉĹäąłŹeQ,ŐłÜĹ ˇEÍ]ŇŚő>i’a*ĚŚĘ´!8®gQ¬uÚiú/źJU™~}ĽŞđkUąňŚĂŽ1îöŰfźW0¦}ëlŕd/Üá€KŮý0’ŰÖ®í(ÓĂbÚî„aśyŮs?&ë6űíî˝bęńiR$ŻĽA &›)EŐ÷< ˇ(´B’ ł–źvěň÷–<Ě´:É€čÔŽ0;>ÉĺK+ÄMöÖÇîÚ‡Z4vű?[€Čvţˇ–ň‹­„ź’ł@X[GhďcÍÁ_Cą]ۦ:HŇ.8ÍîůÓ¤J×Ů·˝­ń /ęČ79–ü Žyż ٍ©šń¶D˝e6?žäĎw(v·^ ě^Vus-Ăţ1¬*nŮrPą‚}Q9ŚŮ˝Hʇ˙MBNšĚčvĎŰL’ÄWJ—ʲ¸FŁsźÚÄ*;5@ˇ)va«°#Ť@ZĂeŇŻ;oU4ŃĄ}żěQŰ~‹KÄ'ŘłďŽQ0Ą~VnĺmÚ˙ëÎčw/rÄË×tu‰}gřkęĺ ë0OM‘î!Ć %Ż_W5˝ůwšOclŹĚÓ÷%µđźö=dž'UˇŻ-’ 65ÓłŚĚ|ÂgiľĎľíŻőŢ?ţ±Ö§úůţT´ŤcĆŰ)kćÍ”–?z‹vߢԫ*?1OńŚ]†ĹĂjîëŃŕ3L´ŽđÔ8jHŞ—ĎŻS”ż śÔ¨bâţ`^–“ę`ÍQĺX`IhĺCîöďüuyŔŁűn™aŹQ~xŚ4Qś@…/ÄsÜ{ŤňĺAą˝#Ëţ†ňqűXÚŽ±m7¨âb‹›is˙ŔŤżÚéµÍĐ7Ńšoáéf¤Ő‰ SÉW0«¸ú=ĘbÝÓmUc×č”t-4}ł%Ä=îJlˇQş(5]˝Żź19Ką]÷ÄŢŮG©»÷ KTA×)¤WŹĺń <^Ç+đxŻŔăŘÍ ü-­ »:”IEND®B`‚base-15.09/notification/ios/samples/NotificationService/NotificationServiceIcon58x58.png000066400000000000000000000157011262264444500313620ustar00rootroot00000000000000‰PNG  IHDR::á»J( AiCCPICC ProfileH ť–wTSهϽ7˝Đ" %ôz Ň;HQ‰I€P†„&vDF)VdTŔG‡"cE ‚b× ňPĆÁQDEĺÝŚk ď­5óŢšýÇYßŮç·×Ůgď}׺Pü‚ÂtX€4ˇXîëÁ\ËÄ÷XŔáffGřDÔü˝=™™¨HĆłöî.€d»Ű,żP&sÖ˙‘"7C$ EŐ6<~&ĺ”SłĹ2˙Ęô•)2†12ˇ ˘¬"ăÄŻlö§ć+»É—&äˇYÎĽ4žŚ»PŢš%ᣌˇ\%ŕgŁ|e˝TIšĺ÷(ÓÓřśL0™_Ěç&ˇl‰2Eî‰ň”Ä9Ľr‹ů9hžx¦g䊉Ib¦×iĺčČfúńłSůb1+”ĂMáxLĎô´ Ž0€Żo–E%Ym™h‘í­ííYÖćhůżŮß~Sý=ČzűUń&ěĎžAŚžYßlě¬/˝ö$Z›łľ•U´m@ĺá¬Oď ň´Ţśó†l^’Äâ ' ‹ěělsźk.+č7űź‚oĘż†9÷™ËîűV;¦?#I3eE妧¦KDĚĚ —Ďdý÷˙ăŔ9iÍÉĂ,śźŔń…čUQč” „‰h»…Ř A1ŘvjpÔzĐN‚6p\WŔ p €G@ †ÁK0Ţi‚đ˘Aޤ™BÖZyCAP8ĹC‰’@ůĐ&¨*ŞˇCP=ô#tş]ú Đ 4ý}„Óa ض€Ů°;GÂËŕDxśŔŰáJ¸>·Âáđ,…_“@ČŃFXńDBX$!k‘"¤©Eš¤ąŤH‘q䇡aĆă‡YŚábVaÖbJ0ŐcVLć6f3ů‚ĄbŐ±¦X'¬?v 6›Ť-ÄV`Ź`[°—±Řaě;ÇŔâp~¸\2n5®·׌»€ëĂ á&ńxĽ*Ţď‚Ásđb|!ľ ߏĆż' Zk‚!– $l$Tçý„Â4Q¨Ot"†yÄ\b)±ŽŘAĽI&N“I†$R$)™´TIj"]&=&˝!“É:dGrY@^O®$ź _%’?P”(&OJEBŮN9Ją@y@yCĄR ¨nÔXŞşťZO˝D}J}/G“3—ó—ăÉ­“«‘k•ë—{%O”×—w—_.ź'_!Jţ¦ü¸QÁ@ÁSٰVˇFá´Â=…IEš˘•bbšb‰bâ5ĹQ%Ľ’’·O©@é°Ň%Ą!BÓĄyҸ´M´:ÚeÚ0G7¤űÓ“éĹôč˝ô e%e[ĺ(ĺĺĺłĘRÂ0`ř3RĄŚ“Ś»ŚŹó4ćąĎăĎŰ6Żi^˙Ľ)•ů*n*|•"•f••ŹŞLUoŐŐťŞmŞOÔ0j&jajŮjűŐ.«ŤĎ§ĎwžĎť_4˙äü‡ę°ş‰z¸újőĂę=ꓚľU—4Ć5šnšÉšĺšç4Ç´hZ µZĺZçµ^0•™îĚTf%ł‹9ˇ­®í§-Ń>¤Ý«=­c¨łXgŁNłÎ]’.[7A·\·SwBOK/X/_ŻQďˇ>Qź­ź¤żGż[ĘŔĐ Ú`‹A›Á¨ˇŠˇżažaŁác#Ş‘«Ń*ŁZŁ;Ć8c¶qŠń>ă[&°‰ťI’IŤÉMSŘÔŢT`şĎ´Ď kćh&4«5»Ç˘°ÜYY¬FÖ 9Ă<Č|Ły›ů+ =‹X‹ťÝ_,í,S-ë,Y)YXm´ę°úĂÚÄšk]c}džjăcłÎ¦Ýćµ­©-ßvżí};š]°Ý»N»Ďöö"ű&ű1=‡x‡˝÷Řtv(»„}Őëčá¸ÎńŚă'{'±ÓI§ßťYÎ)Î ÎŁ đÔ-rŃqá¸r‘.d.Ś_xpˇÔUŰ•ăZëúĚM׍çvÄmÄÝŘ=Ůý¸ű+K‘G‹Ç”§“çĎ ^—ŻW‘WŻ·’÷bďjď§>:>‰>Ť>ľvľ«}/řaýývúÝó×đçú×űO8¬ č ¤FV> 2 uĂÁÁ»‚/Ň_$\ÔBüCv…< 5 ]ús.,4¬&ěy¸Ux~xw-bEDCÄ»HŹČŇČG‹ŤKwFÉGĹEŐGME{E—EK—X,YłäFŚZŚ ¦={$vr©÷ŇÝK‡ăěâ ăî.3\–łěÚrµĺ©ËĎ®_ÁYq*ß˙‰©ĺL®ô_ąwĺד»‡ű’çĆ+çŤń]řeü‘—„˛„ŃD—Ä]‰cI®IIăOAµŕu˛_ňä©””Ł)3©Ń©Íi„´ř´ÓB%aа+]3='˝/Ă4Ł0CşĘiŐîU˘@Ń‘L(sYf»ŽţLőHŚ$›%Y łj˛ŢgGeźĘQĚćôäšänËÉóÉű~5f5wugľvţ†üÁ5îk­…Ö®\ŰąNw]ÁşáőľëŹm mHŮđËFËŤeßnŠŢÔQ Q°ľ`hłďćĆBąBQá˝-Î[lĹllíÝfł­jŰ—"^ŃőbËâŠâO%Ü’ëßY}WůÝĚö„í˝ĄöĄűwŕvwÜÝéşóX™bY^ŮĐ®ŕ]­ĺĚň˘ň·»WěľVa[q`iŹdŹ´2¨˛˝JŻjGŐ§ę¤ęŹšć˝ę{·íťÚÇŰ׿ßmÓŤĹ>ĽČ÷Pk­AmĹaÜá¬ĂĎë˘ęşżg_DíHń‘ĎG…GĄÇÂŹuŐ;Ô×7¨7”6ÂŤ’ƱăqÇoýŕőC{«éP3Łąř8!9ńâÇřďž <ŮyŠ}Şé'ýźö¶ĐZŠZˇÖÜÖ‰¶¤6i{L{ßé€ÓťÎ-?›˙|ôŚö™šłĘgKϑΜ›9źw~ňBĆ…ń‹‰‡:Wt>ş´äŇť®°®ŢË—Ż^ńąr©Ű˝űüU—«g®9];}ť}˝í†ýŤÖ»ž–_ě~iéµďm˝épłý–ă­Žľ}çú]ű/Ţöş}ĺŽ˙ť‹úî.ľ{˙^Ü=é}ŢýŃ©^?Ěz8ýhýcěă˘' O*žŞ?­ýŐř×f©˝ôě ×`Ďłgʆ¸C/˙•ůŻOĂĎ©Ď+F´FęG­GĎŚůŚÝz±ôĹđËŚ—Óă…ż)ţ¶÷•Ń«ź~wű˝gbÉÄđkŃë™?Jިľ9úÖömçdčäÓwi獵ŠŢ«ľ?öýˇűcôÇ‘éěOřO•źŤ?w| üňx&mfćß÷„óű2:Y~ pHYs  šś&IDAThíšŮ“\ĺyƟ޷鞥{öM4É‘DH ˘lW\8A)U©,U©Üĺ&•äÂI•s•ܦ*ůRąI9ؕ؉cŔ8`Ś ´€Đ2š­5š˝géžŢ;ż÷t1ę‘ÁćBŻôőé>ç[ŢçÝżďŚô€HŕHŕK Ď.x°ľľF˙×ę¶ďŤŻ_ŢKł@­_mŚć§mŃVi6K+ŃĘ´băZájÂřŇ1Ý č4.Źďźn‹qÍ«R` @ŐŚjŐ´ŞµKŞ•¦U)]§ďMÚ2Í€[3ŕżVj(LúŠuöëá? +‚r·ŔQA‘[(ÖľçęßłK(÷˘*µ7UÍs-ťcđ m“ök˝  °•Ő}#Ţ‹"]ĹŞ+  ŕJŔ‹q-\>®ĄKǵ>]Ńć¬jĺ÷TÎ˙Đg ]sç篆vÔxŞáŠeZÍÜŇ%Ŕc’§EŠvK©C<ŔEsK>­\ÖÜąaĄßů¦ňË×UĘżŚ`^¤ĂY’q´Ěĺ‹%7ŠŢkúyGi;­=§‚ Y\jhÔH UÖ`­‡‚Q©í÷<, žđ*ŢźT);®RîkňxűT-™9gh&µ/4x5ÔU¨ő´†NĺĹJ^óŃ2nW5pĆjW<· đxĄOŽ{Ôľ'®ri\…Ě7ÓIL»EĎuÚv3±Ńź5ÔëU0qZť‡šü‰tëgč⢴D[%Đ®h·–0D¬±jAÖ4 @K¸Ú6AřCRŰ^ó(ŃSne\ĺěÓŞ”T›e Ą.7üĘúŃŘ>´ňűjjý7¤^”·ÚUŘ{°çĄ…÷hÖçyî¨Y€‡ćm ®ĂGĆęŘÇG˝ Ć;µ9˙ŚĘ…‡°€iĐYj˛Ľüą\4Eô« #őŻk+ó,ůubŔ«)ü/!Ť´Ń¸G`â+hö#iĺ@_4š6-“ˇęŔmYú™†°N‚WrÔŻěüÖN’ŁÍo 0áüóˇfšóm<.«°|SaíŃTB ĚĐžÓ~óC´f÷şă'`Ť¬•´Zş†©Łé[č‰~üŐ¬6°ćÓ±©ďQ/ßŃî-Lą Á/śĘËYĹVş_ÚPé’‚šR4ü¬Ć’ýj€\\–Ŕ­ Ŕ;Ľď±ĄŇ€ĹĽçđé* c Ř€šÄXDÚŤ÷E´2qTĺ¦\a€™)żm(k9äˇëQKŕyŤĄú”€ÉŠ!Qó?'ÚÚ•[.`fĎ"řd/ćÝËŐ‚ěM|:CUĺGfľ>„bB3źnF@#~e¦ö©°~@Ő˛5ż˝o°»J9€¦žS,ĐĄŠ§Şl©¦ ëW«‡ iäEĄŽ¦ę?ë÷ř4Ŕ}€ëÔ2Ak’VC»ŃN4j®Ŕ}Ç”{Yi̧ěÂ0í `‘Śi÷v7@áP­ĆŞ ĺ=šŰĚi"“ÖÄĘ*×-ͬµşUQ'¬ˇSŻóďS#Ť@ &פ)Ŕnw¬Ş2íš9Ŕ"»ä¨OëéŔŽaĆVMX:ěŽ\ůßkv%śG&ŘŞ™Ě#ĺyL´q¤ěZżbÁj RWËőÇcŠŐń*€LMSŰ}ÚV7ÓźcŠw1ăÂiďóf¶ÎN+FÖ Ŕgţ©¨ôŮ—H?ÎCn쎚ըW ĺď•=ĄXď ĘÁ§É…Ď’#żJ0(o  ĺKŻj˝ř2ż¬ôz^·˛Q*!qľ Ď#˙Ž%ÍÄ-R§đ÷…Ä«›h’MÖ‘‡Z‰Aź27ĐěR;Ňz‹‡ąÝ@ݱę§őÉGeď˙=ű‹ Ć~ףaj×ÁS~ ť <†‰O˘ç(ź& ôŞR9§Rů?´šŔ9-äâč˝Eż_!ŔąĹ-iš5ßí!ŠŻ˘¬©I€’rHQf¤f QĚ8ŢĐâ…Q6¬x›ÖtQŃŰűŰ‚K;fwm\¤Č˙ž6 )"ň~u·ŕł6¸A¦=K=«řęMr­írĚtÍ„Í_Ł]^-ĽßĘáśír^§áOw§f˛:'Ĺěo Áś|Ůöv‰[ůgĽ9›lŕ˙m#˛ďQł’/śĹ ĎŔčüĐ×<ää¸2׏öyö‡€Ý‹o–šĘBv!ő üšÁŞ”…íCÜDš&„†r>ߎV˙—HäîÔ,P“Ô<í,ň&×CÔ¸ -lIU5ŕúXÝ4ÓÚN>~w ý×IÖ"ÚŮ÷;RG‹–/?łqů‡ĘÇŐěÂç bťl®lz7×±Î$Z š%5Ŕ†;<śrD9}ÄĆőÍlęÔ,PhÉŮĘż5ŇÄ4䬦×ÎŃf4eЦW›E?…'pg&ř1»€ç)Pm,95ÁLü~čYvCĹG1Łś,ţ–¦$|B8¸áŻ6‡i/ȸ™[”ŚTMí{¸i@YĂ´Z)4ľŤţc¬Ň>A»ę6 9•É0ö"çŹŃěŰš^_ˇ ŠPŘ·:PÄŹ†aĆ%cŘL;÷¦"O´ŢŘ­Ą6e¦{T®ü+ѸŤÂáćn›đúH»2•ŠyĚ ë8XhOíY¸ŐŁął!m­LsçL}Đťź÷tű f&Ř”ł1ľJ~­ž#px( ú`8B0ń:§î(Głh+„\AłáQ*ŞG|T;]0şČÖďŘťP/ő_Č5DdĄăÔŕZţ쾏~[+^Í_°Ţ?˘!‘;é—zçluóžđ/´¶µ@};˘Ż]í8ŮöhjZ63. ť)âGĎ-PĄß _Á5ň¦Ç5Ô†VK€,0e¨ĺ—ąÚY±-zĂł?oeüĎ1ą“±Ď¨;˙šř€€u “Ţ'‡Őť1‚ óöÝŔ¦gđWRŐđSmĚD”™± ö"içq|µSěň­:šłÁäď)‚Y‚ dG1ŽŻšč·t™9nŢE}zŰřĘcçóţ>,Zŕd˛2¬ĆJÎ+E3‹ŇV"M‘g1ă#Šú»ÔÓbëdŚS×;Fp­&e¦^żćŢéP>÷şĂg"8®ţÄÇcLBv7GÉY (9űV¦°ąĽ,ź[đęQ]µ˙âĂçmş ¦–íq,ć[ űţ€\ů&zŠĘhŚČWć2ĎÍw+Č5M´Á>ő(@ŰÇź\2#äČ…%آĚëĚ4Đęµ ‹ö G©ˇŰ{X×PÚ2î9ň±ůÖ7ôĄěňŠCĽm´[ Öźčáý6¶đ%ŁßĐ!śĺPר†ŰŽphöĺÜ €uüô#ú’`IKŐÚ$&čăleok˛‚ŚqóÝ2Ý&Q@7ZŤ´ű•~3Ą|ţ5žŞ/1 v„cvâĺÄFÓ¤ÍüÔ^nŮCó{&róLŤśú7ߡݦÝ5îFíjůcĘ»¨Nősî@ëk©·a‚G<”Ôâćam–®ŇßŇ!–Ćůęq*ź^%ńI‡qžÔëăÇFŘŹ ďńpŇONž[ĹWg• =¦Ě×jłŮűçëo?mé¶u!V×gĐö%óS3_s‡˘u~ć5Ę±É Ô—lŐö˛EĂ-v"IĆć•vL2JĄr¤§SţSî°kv¨‚nŻpöźş¶\Bëő»vqŇ KÁSć`ZďQnř“W×´´•u˝mDÝ<ëeeŚtľNaŻ7\˛€Ô>ʇ pš±ŤšŠŘŐ-ô5|’…ĐH7Ľ“;É‚E7á4řM}eŰcÓôSrě,§ đ˛í‰™oţÖ§0vt (!ÍÔ´QZÔ¦íöwĚ—ţ-u ŰÉŢń´t{rś†îx´ýÇg|g?ďGýJ RĽH›Ŕ¤ á|ć<}v«A%Şžklş?pj]—q{hĚw´ăERGśŚ”\ZSm[—|§ňSaVÂv˛×“a«4ĚÍ>¦]hÔâ¤Ď';‘3«Ř`3=cŔxp±ý)ÇĽř¨ÍM(˝6U¬\˘ŕ¸”ű6Î!ľDŃP9óMî2˙(ĺĺ ¡/óşý­PŃßŢ0Z łĆ‹]C­ĚĂΊJÚî¸Ô,PúS­Ô*ç4=IXżÎ"|Ţ|Ä1MÚß5¬ĂÔ• 9ÍŢ˙kÉ]¨q-QOQ&TBKs|f| cďcâöŞr€97Ĺ&ÉŚÓßfâ‹mňkvß–1jĚ@¶ˇ6&Ó°s»ńa7š!ÄV&ElÎi3ťPď“ŇĹËŇŹĂÄ›V|Ö€fđŻ‹l¦}pě]‹k;&Ż"e*¦‚Ö üu €ĚL[®1ŢNíĺq´“_’€D±Îł,Íú:ĵÄU€–cÖä*®¶1?aM͵ćú=]ýďżć°* Żü‘4ńűúóä>Ŕ™Vr8Ny/_&rz…/×hۉč[YVzc^ŻN8%Öó |ŮëÄU°µ™Ő1YŘL˘k}­¤łs‹šZłěu‡-'”÷Ó±y&ą®cš ‘ćęU›ů*’ż}4I%Lw§Ôęâ ČŻľcL7Ę"{ś ją‘×ĘĄ÷čű™pvR•öBeF‹¨)—8¬Ô7= ?‚Řzµ?ĚqÉľşŹćW<šy3«üćwq‡×|öÚËZČľĄŐʢŹt˛y' ¸Ěgť4H˱‹V5˙ţ4Kź†Úńűh’°ra9˙Wšzăoµ:y\ýăQÎYmßčá@»¬ôŰĽ68CżżŁ]ĽËĽ6‡˙.Üä­˝ `ȧÚsţî'řł3â5®ĺ˘YŇš%—’{BŢ*oŘŔ`ď[ÍlMßöa´ž¶qÎwĐ?Ü›÷¸Ú«użE{š†HťPA¬×Ďh/Ňv$8îÜIfź'h˙Čß6ŤÉí¤j™`Vűnż¶íRŃ·Áń<Ě]°ĆźËÔŞďŇď/iÄŠ¨íĆ.‰h"Ë7Fö҇HŇ™°ph ŢŁw™çó4’ëmÂNáÚşf!źFyő8>úiťÜ x ř"$đ˙`˙˘ř§ĚIEND®B`‚base-15.09/notification/ios/samples/NotificationService/NotificationServiceIcon80x80.png000066400000000000000000000225131262264444500313470ustar00rootroot00000000000000‰PNG  IHDRPPŽň­ AiCCPICC ProfileH ť–wTSهϽ7˝Đ" %ôz Ň;HQ‰I€P†„&vDF)VdTŔG‡"cE ‚b× ňPĆÁQDEĺÝŚk ď­5óŢšýÇYßŮç·×Ůgď}׺Pü‚ÂtX€4ˇXîëÁ\ËÄ÷XŔáffGřDÔü˝=™™¨HĆłöî.€d»Ű,żP&sÖ˙‘"7C$ EŐ6<~&ĺ”SłĹ2˙Ęô•)2†12ˇ ˘¬"ăÄŻlö§ć+»É—&äˇYÎĽ4žŚ»PŢš%ᣌˇ\%ŕgŁ|e˝TIšĺ÷(ÓÓřśL0™_Ěç&ˇl‰2Eî‰ň”Ä9Ľr‹ů9hžx¦g䊉Ib¦×iĺčČfúńłSůb1+”ĂMáxLĎô´ Ž0€Żo–E%Ym™h‘í­ííYÖćhůżŮß~Sý=ČzűUń&ěĎžAŚžYßlě¬/˝ö$Z›łľ•U´m@ĺá¬Oď ň´Ţśó†l^’Äâ ' ‹ěělsźk.+č7űź‚oĘż†9÷™ËîűV;¦?#I3eE妧¦KDĚĚ —Ďdý÷˙ăŔ9iÍÉĂ,śźŔń…čUQč” „‰h»…Ř A1ŘvjpÔzĐN‚6p\WŔ p €G@ †ÁK0Ţi‚đ˘Aޤ™BÖZyCAP8ĹC‰’@ůĐ&¨*ŞˇCP=ô#tş]ú Đ 4ý}„Óa ض€Ů°;GÂËŕDxśŔŰáJ¸>·Âáđ,…_“@ČŃFXńDBX$!k‘"¤©Eš¤ąŤH‘q䇡aĆă‡YŚábVaÖbJ0ŐcVLć6f3ů‚ĄbŐ±¦X'¬?v 6›Ť-ÄV`Ź`[°—±Řaě;ÇŔâp~¸\2n5®·׌»€ëĂ á&ńxĽ*Ţď‚Ásđb|!ľ ߏĆż' Zk‚!– $l$Tçý„Â4Q¨Ot"†yÄ\b)±ŽŘAĽI&N“I†$R$)™´TIj"]&=&˝!“É:dGrY@^O®$ź _%’?P”(&OJEBŮN9Ją@y@yCĄR ¨nÔXŞşťZO˝D}J}/G“3—ó—ăÉ­“«‘k•ë—{%O”×—w—_.ź'_!Jţ¦ü¸QÁ@ÁSٰVˇFá´Â=…IEš˘•bbšb‰bâ5ĹQ%Ľ’’·O©@é°Ň%Ą!BÓĄyҸ´M´:ÚeÚ0G7¤űÓ“éĹôč˝ô e%e[ĺ(ĺĺĺłĘRÂ0`ř3RĄŚ“Ś»ŚŹó4ćąĎăĎŰ6Żi^˙Ľ)•ů*n*|•"•f••ŹŞLUoŐŐťŞmŞOÔ0j&jajŮjűŐ.«ŤĎ§ĎwžĎť_4˙äü‡ę°ş‰z¸újőĂę=ꓚľU—4Ć5šnšÉšĺšç4Ç´hZ µZĺZçµ^0•™îĚTf%ł‹9ˇ­®í§-Ń>¤Ý«=­c¨łXgŁNłÎ]’.[7A·\·SwBOK/X/_ŻQďˇ>Qź­ź¤żGż[ĘŔĐ Ú`‹A›Á¨ˇŠˇżažaŁác#Ş‘«Ń*ŁZŁ;Ć8c¶qŠń>ă[&°‰ťI’IŤÉMSŘÔŢT`şĎ´Ď kćh&4«5»Ç˘°ÜYY¬FÖ 9Ă<Č|Ły›ů+ =‹X‹ťÝ_,í,S-ë,Y)YXm´ę°úĂÚÄšk]c}džjăcłÎ¦Ýćµ­©-ßvżí};š]°Ý»N»Ďöö"ű&ű1=‡x‡˝÷Řtv(»„}Őëčá¸ÎńŚă'{'±ÓI§ßťYÎ)Î ÎŁ đÔ-rŃqá¸r‘.d.Ś_xpˇÔUŰ•ăZëúĚM׍çvÄmÄÝŘ=Ůý¸ű+K‘G‹Ç”§“çĎ ^—ŻW‘WŻ·’÷bďjď§>:>‰>Ť>ľvľ«}/řaýývúÝó×đçú×űO8¬ č ¤FV> 2 uĂÁÁ»‚/Ň_$\ÔBüCv…< 5 ]ús.,4¬&ěy¸Ux~xw-bEDCÄ»HŹČŇČG‹ŤKwFÉGĹEŐGME{E—EK—X,YłäFŚZŚ ¦={$vr©÷ŇÝK‡ăěâ ăî.3\–łěÚrµĺ©ËĎ®_ÁYq*ß˙‰©ĺL®ô_ąwĺד»‡ű’çĆ+çŤń]řeü‘—„˛„ŃD—Ä]‰cI®IIăOAµŕu˛_ňä©””Ł)3©Ń©Íi„´ř´ÓB%aа+]3='˝/Ă4Ł0CşĘiŐîU˘@Ń‘L(sYf»ŽţLőHŚ$›%Y łj˛ŢgGeźĘQĚćôäšänËÉóÉű~5f5wugľvţ†üÁ5îk­…Ö®\ŰąNw]ÁşáőľëŹm mHŮđËFËŤeßnŠŢÔQ Q°ľ`hłďćĆBąBQá˝-Î[lĹllíÝfł­jŰ—"^ŃőbËâŠâO%Ü’ëßY}WůÝĚö„í˝ĄöĄűwŕvwÜÝéşóX™bY^ŮĐ®ŕ]­ĺĚň˘ň·»WěľVa[q`iŹdŹ´2¨˛˝JŻjGŐ§ę¤ęŹšć˝ę{·íťÚÇŰ׿ßmÓŤĹ>ĽČ÷Pk­AmĹaÜá¬ĂĎë˘ęşżg_DíHń‘ĎG…GĄÇÂŹuŐ;Ô×7¨7”6ÂŤ’ƱăqÇoýŕőC{«éP3Łąř8!9ńâÇřďž <ŮyŠ}Şé'ýźö¶ĐZŠZˇÖÜÖ‰¶¤6i{L{ßé€ÓťÎ-?›˙|ôŚö™šłĘgKϑΜ›9źw~ňBĆ…ń‹‰‡:Wt>ş´äŇť®°®ŢË—Ż^ńąr©Ű˝űüU—«g®9];}ť}˝í†ýŤÖ»ž–_ě~iéµďm˝épłý–ă­Žľ}çú]ű/Ţöş}ĺŽ˙ť‹úî.ľ{˙^Ü=é}ŢýŃ©^?Ěz8ýhýcěă˘' O*žŞ?­ýŐř×f©˝ôě ×`Ďłgʆ¸C/˙•ůŻOĂĎ©Ď+F´FęG­GĎŚůŚÝz±ôĹđËŚ—Óă…ż)ţ¶÷•Ń«ź~wű˝gbÉÄđkŃë™?Jިľ9úÖömçdčäÓwi獵ŠŢ«ľ?öýˇűcôÇ‘éěOřO•źŤ?w| üňx&mfćß÷„óű2:Y~ pHYs  šś°IDATxíśŮs\ÇuĆĎěŔ`ĸB"%Ń´D©lĘÚ˛ŘN%ĄrĺÁÉCĘoIĄňJň’ÇüyrĄň¤*y+‰m^J2-Qµ‘% AěëĚ`łO~_.x1)j¦ĄN±yďÜą·o÷×ßYútĚä8@ŕřZ"h°Őz.J űž/r^Ůţ¬Łwî»ĺ˙ß©€/Ó»6nľ@9FńaŠó ĄLŮ ¬S ŰĄÄQűAćă×_°®˙™B`ˇHÜTS-ç­ZPpŹcµ”äl/>ćx“"€?ˇ¬R˛ŰE€V)_[iŔ =nµŽÁN~"nmCfą5ł-W€ĄM Z9lĄ­ÓV*}…$Ô`[:yî»Ö>xŇĎE¬­Ď,(­ŢKÔwJUN™c,aÖsÂlě;fŁçÍşńCîůX;vó, żČmßHnt"Ç$gô•ôęŔ ·˙ßł‚ą FĚ:›ŤHŔq ™µŕ‹Â|Ň8n;!=+qě#‘(qűa0;4IäřrÔnĽňĄfţ‰y˙…;…#…ü•ć?tĘ:G,9płfŹ2Ă›”Ă€2 `e=ŘýVXÄr]7[~źr­ĆŇ$Ďp˛Ušál% *Ü‘¸ĎŰ`Ö®đ¢~@xFٶµ†Z瞦čý»acsVK¶ąBe–€rgű¦%đť€9Łb ş#*9„çm´â Áőgf+Ű`f×Ű©€<Ŕ=^XT¤nÁ1ž…ŃÔ—K&¬~µîHFÉŮGyë"ŤĄuC¨PĐ2‹+¤Bv(Öb]A‹ó•:í)“ÎCę4ŔtÄ–Ňń#¨ő0çqld šÄn ĚÔ¬„Pę sPM¤Őłc3©€-ÖN§]gąZ/¨´•W‹©C0t†öHUßB?6Ű\l Ř#ů^âŻ[NINFF#–[ĂiťÁđJĄg(P}g(9Ýi@Ak5ziR›3Ö×öŤ'Úď 7îjP 1šŃ è˙H`ŃŔÍiłYŮ˨6@É‘D48€ďgŁ@Śu1ŘĹŽř7ŰËü!_¸é`zűMö_ĐßôÜŕˇř9;šhł¶mŞ“ü»ońŔŚĂ¶C€ŘŹ Ťdj§PH2MžďűŠţ±Ű|ŠD)˝s™5ü"öđMË?łŐ­[eÂĽ’ĹVÁŽ*sş(FŇc“N÷’ă”@uóIÂćě#`µśÇřB ¶őĂ^šśYl±­ő‡Qj,u&ŠoNĂcHŞé„ťůaÄNţ‰Ůř3Ě.ľÍ´Ť2ú-fgÂÖ6ĐgHq=+ľG_ž§ńŹó,4±_QţŰ ¨üFî¦-dŞŘĘ6l%¨°Ţ,u ‹M|Úaç; ÚÚ@śůNGśDE ÎĄž‰ťGjqâút‡m­Nâ?妔âN• ś4ŕwaŢI‹8c­Đ"4Ú]ٰcUŁť#çő)5^ŞÝÇ|÷Ťµiň|fďS.â­ß„…ł¶¶łĄl‚YHĚZđš @ţí)QşĐśËě ĆŁ °Ă¨s=yZKafcş‹ü"WŻqu‰ŇpŚŘ€Zé?±3¦ĄŹ¶ç˛7aÂă b(§§ô•<âđ cLů¶6FtGmź§ý2^RŢÂ]Ĺm˘Ţ˝8Ł‹†ĂÖJ=Jy Ä˝€ŚJ' –0˝‹ł¨5jë@Tµ=Ä5;†j§É›ă¬ ¸«(ěnŕđĺ¤9ĹŔއ#.8ő_ęwȰ\!P ,}@gŢT4EËše4%ڧl‡ˇJG <ťQ‹:ţá z_ă!űµĺËKÄ“]0˛‹®µX†1 ’˝@”Ęw˘Ňcs3Tą;y'×ü& Dč#§’ž‰XÚyfw ţz÷—–ćěŔŤ[4›|šĆŁt3[hĹN+X„‘|Ç"[Ě ń›ŔlĄ#ç±—OrŮ‚Br„ÜŢ ŘËcôbšň†•*źZ*ÂFöâĺ5Ë Z ď¦Ň±BÄdKĽ?Â;ÜŠźşéˇĺ™C°3u#‚SŔś >F'ľü‚Ő> §aXlÎěl·ŮQĘ0>ć0Çc” ĐŹ3Hj…Á^Acć1{)[ŞyN9ž.Ś|Ą±|j /@! Şb3Ţ­g‡-WéÄ›.:=P¸ÓMŰéÖx$łÔŹĘ¶—¨Ő}J@H•‹)ŮĂA+nÁľŞlqŇ«ć~Źű`€A=:ä+čú&/ŞL &ĎyKĄ­8WpfJ˝7–i;÷jńHi{9Łüz7ŞxŽĹ)±÷(—,mSůaâI@„†šsűăFnÚyg±|vžđƶ–śŠDť· đţ˛ŮÇy— Şň媚p¸ćDdăŕ6® ý6Çë•®)X–ÇT¦şŹc{•He[:‡3t–AÄT;Yl#SD«B[@,”3–.Žb/»H^„M™ ”J˝t0PęźÄP ĘúŰƨµŔLÉÚ§1«P•ęe>-P4¤÷%ÍŘÖŹyU9Ô1€zŽŃč{%T˝&ąą-*˙7 čQŔ[ţ„ÎR „!ýgjö±Z$ăÍ<¶¸ő ĹÚ+VÄą¤‹ aýÖŽŃ“‡ŢkŔÄ|ŮĂ lîâ̆mr.Ă˝Ý-Ł&FńŢů€­_Ĺ™qÁđ~÷ŻĘÍh•S¤Ś"¶ű[QËŁ¨¨Ç@gٶş×Ac¬{¤Š}¨W'*•Ąłó8Ł4€v…©ŹÁľOĎâq!c˙şcb–x2d˝ÖÝZs,<ľKTżěˇł*ĎybśÁ"¬Ú8ßÇű50X+P˛ňO˘÷çPVŘÓŚŘ kÂEÖ#ÖEŚ1Ńp UľÜ©×®ď|sűÄcä!\ŮD‰>Ç.aו <43uk»x‚‡â[–/v4µh¨Î<č]»„ m04ź§N'qe÷4(ţ6)Ač ŰY_áĹ.¸ßŘUŐ]>4 îÓÍ%_&~‰s©ŇaB l Z)¬Ľt•ëuNGďÜß(ÝŁ©~ŘŽ6 —0 J ?ľ âě°¶&aâ¬Ô%Ë–ÚrśĹŞ8鮀s*ţ:u¦‹-”Uđ łć¶Ś(VďP´»bů0aşň!OŠ…x˘{K3˘nÍaŽ#« Űr¦L.pËćŇyć¶4µÎ’m©TrÔźôęoŁŤ íóÓtf(äÄ ¤nŚ0Ëá‚˝Ęŕ]µLi”iď(k*1g>ĽĺPťš*dš'2 öRßpťCáfÜÚ=±6ŐiĹL+Re¸·4  żVY›%ć˛ďÚ–KYý†<ŕG¤ŞmŮý|Ş`‹Ů°% +X-©«RR€:Ö‹Â-2×ćnŠŃ¨óęü(aÉzŔŇłxâĽTěçdvŇV¶FűX‹î©Ę w"”ą„c1g ć[;Ĺd×®†,ł'VĽHý3qwŮŃ —űS %ę_¦ĽEů5yŔ×őC¦cK°±B!±™ŹÁÄ{Ďo5$R=ĹŹAŁtUuĹáLbéäâ( R±˙"fŁ Oz›ul«rýŔhĐr Ĥ a: •\&Ű@^Şm&%±[XĚ\ĄnŮ[ŮÄ»Ę~čŻ\] ´Â…łę›LËŢ'^pążŐ›)«-ŘÍ Nŕ6ąq—¸L ľ@nU•sÜ =ÖŻwÁĆAr {xťLř1ęa!ŠÝbŰNÂĂF•Šmq‰ÉF’AIŰžˇřn’‡˘ŘË+aă*©7©1Ţçîqá~¨¦Ö‹@Ő(ޤĽď˘Î¶”°ő|‚™ ł -ŐöÔÚ_l˘§I…88•06¬˙4ŠĹ8­Žg΂VőeęÍÉ™$+ÓC0-Ô{+ H> ŃţÖ‰Ú ĹmlÚQ+‰be^SĽ©>l­fA×)wu&@?jČĺcÔ.#{q2=Äk—m)Üg%˘|·°L8C‰1VÝ`âćźçĆPe©Ú{p–Ť1mŚą°^ŤĹBÍçaˇv>%ĆkÎĂźBšŞľxY3ˇOąQ&i“˛§jާäŔÖ u j¶řAŚŕZ&áMÔt‡¬;t1ˇż 9)˝uvNŃ^ýZJŽŁ^47ÖÄÖHWäLµÝR74»żü‚O˛yő_$žb¤ )&aŰè¦`2Ô"Ľvey;ł†čäc4x¸}µţ}ľ•]ôwŤ35Ű,ľAB"MśFňĽ_ôQ*8Ŕű4Üś©©´ÖT:ÂŚĺ‹„ĄXm_ĎqL{X.*Q"–ń±Â:L&Ě“÷ő‹u1[»´u®űżöΛđ[Tň=ë:ŢëÔ¨ŤF ­Ď Ľş~» *Ą«F;#,Q>Ĺ'‚9ç|Ü×ü§§ć°aŻŰÉ5ćĎuŚË~Ĺ .T¬ sşµ yěŔY9FČNYˇ°fé|Ö%"ęۢ*•±¦VŔBšAqýÂCĘ*Í ˘ç@+ÜÍŤ¨ç.ŔľăvřÉÚ/•Z¸¤äe˝˝©k“ dĹĐhh{6É׊!ü‚^’VO¦ŮˇPdëÇť!V¶ó®°ń µ`>ëg·ŃÔŔ&`ŠĐ(Ă"TŐi€¨¦˛±Z™s ¬{´ëU6#J›»ťh0d·4 ^FvŽ»XLŤç]_hQŐp˝Q?Ć ¤/÷·8ě’YëkěN€A(ŕ1H X\@Č›¶v‡S Vm«X€Á<¬çëꋵ~ĂäĹmPr?3S%>‘Z·`„Ĺržw¶ëŽď‰ű>kÚ]cŁ8 mţVp"Ă\ßP]ňD  Î‹UN5ÝŢBčx‡¤H L‘tHYšmWőęv9ýl"\ .ÔoL4ŹŐŽý¨Ä4äĘY@,»ěx~NSdŁ0Oż°żC…©ALWF<Ś#˛ Tt“·EČ6.j”Üżâ0~8„ÚqÔEŠě`˝(ü(€ô KŽcĹÍXÄÝú›5ó¤ě“LóÔUm˝hŃ(ĆhŞűÉ™¶mhVD˝¦łůRÚ˛r${¨§*Ô ČŁëWőNDď€ę[5ˇźtŮ/Ť¨ń70Węúˇc ЛŲÄN”2/ö@^QZ}–ŃžˇäEEC˙Ü==P/K0uJ5/Î×^=îHÓ[´ő”°JÝš‚µCľPD¬ŽŔĽ<Ť*VÝź]ĎsMŢ\™jýŢO ľC¨ŰmÜ$Ik:¸ Äjă-“łyŇߌ:ěy†8Śş´DKŚFżk!ŘThH†Qţ„śŢŰ„+ő ˝vűQ ăž’$ÜD ů<ďĆ„˙Ä W¸&Oás;Ćßłp«mŽ1q™ětEô~ÉÎł<#ł …îІ$ídŘ‹ćn6cU±Z'»¤ö‚]—îë­%CQH­ŰŇű]üä*ŕÖ+¶hţb3Žă0Qż÷±–ş.đy†Ç6WŃá@č#zýőČëî%9”#č®:Ö¶ÁŦMęÓzIh»óRC±ĐíŢÇS•ŘńşĘ{gyźĚ‹_ô|Šď6y˝Xнĩ¶ČMŐąI>ÜnHŁęU/Sž±é_ôY÷ń›xÖlâąZvdţȧt&*'§ţ•p6ńq¬ťN_*2ĺz•«W(u=ăJM6ٱĘ*ßŰÜ‚¸»ŕMvN]hé4I!~vÉ1Lń |Hý.¦s6˝±ÁšL©–TpO ©0 ŚCPÖV`±öëÜŐźr»¶…DČĺÓś¸¸ugĐ›pšĘ~âvS}üźŹ˛÷/â~ŞŻ?$ˇ Éú ¬Ű"ť©ć–É)~7ôr™¸ítčy}ż=šśű%‰“ůłLEţ0ö9;ôp·ő= ĂĐPOµc_ďÓTNČ*)ŕ~„Ël‘KćE@í·ő˛ß#ĽőűÖ}j„ŕ;ŕv@¸©ś72ţfp®»ŞK×ŕöw#Ý €ÉźPzmcúŻííź`ˇĹŽ<Ťá% ë=ÁK'jĆY{§^«ÚôkěbX˙/~ĚsďRÄÍ» zg˙úŹŮízƺƺířďaĘałôÄď|–7vżŽFý'–ł©}×|[ď‰TŇx‘߀Ŕ-ß._-¬râ6îü3Ç×({´–«·Ă´ŁŢ×đ’iRVU‹ł}$˘üŽľÔÔ¸‡×/>KNËdt"›í—>¬’C,ŮŤ_°¨ŐËG?Iý·r®ě´<5F‰˛‹¦Í¨J5Ň˙Aů 凬#<éţěSÍĺëeńyŠ@űwĘ eŹŢsőîR$˝ Ó)»:p—GÔQE z÷^ďŇŕ°¨uk™r‡gĺ»˝D!cą łűiĚ^•ÝëZ_ž¤ gn´Ä´Ź(b`ŁŇÇ/Púďł8Ků5eŽ˘Aö‹(üĘE€ě2—wÄ#Âe®¨ŕľä8@ŕ8@ŕFŕ˙Â,W±q…Ř]IEND®B`‚base-15.09/notification/ios/samples/NotificationService/NotificationUtils.h000066400000000000000000000022161262264444500271670ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusAttachment.h" #import "AJNAuthenticationListener.h" @interface NotificationUtils : NSObject + (bool)textFieldIsValid:(NSString *)txt; @end base-15.09/notification/ios/samples/NotificationService/NotificationUtils.mm000066400000000000000000000023521262264444500273520ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "NotificationUtils.h" #import @interface NotificationUtils () @end @implementation NotificationUtils //validate a string (not empty or nil) + (bool)textFieldIsValid:(NSString *)txt { return (!([txt isEqualToString:(@"")]) && txt != nil); } @end base-15.09/notification/ios/samples/NotificationService/ProducerViewController.h000066400000000000000000000052551262264444500302100ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusAttachment.h" #import "alljoyn/services_common/AJSVCGenericLoggerDefaultImpl.h" @interface ProducerViewController : UIViewController @property (weak, nonatomic) UIViewController *mainVC; @property (weak, nonatomic) IBOutlet UITextField *notificationEnTextField; @property (weak, nonatomic) IBOutlet UITextField *notificationLangTextField; @property (weak, nonatomic) IBOutlet UITextField *ttlTextField; @property (weak, nonatomic) IBOutlet UITextField *audioTextField; @property (weak, nonatomic) IBOutlet UITextField *iconTextField; @property (weak, nonatomic) IBOutlet UILabel *defaultLangLabel; @property (weak, nonatomic) IBOutlet UILabel *ttlLabel; @property (weak, nonatomic) IBOutlet UILabel *audioLabel; @property (weak, nonatomic) IBOutlet UILabel *iconLabel; @property (weak, nonatomic) IBOutlet UILabel *messageTypeLabel; @property (weak, nonatomic) IBOutlet UISwitch *audioSwitch; @property (weak, nonatomic) IBOutlet UISwitch *iconSwitch; @property (weak, nonatomic) IBOutlet UIButton *messageTypeButton; @property (weak, nonatomic) IBOutlet UIButton *sendNotificationButton; @property (weak, nonatomic) IBOutlet UIButton *deleteButton; @property (weak, nonatomic) IBOutlet UIButton *langButton; // Shared properties @property (strong, nonatomic) AJNBusAttachment *busAttachment; @property (strong, nonatomic) AJSVCGenericLoggerDefaultImpl *logger; @property (strong, nonatomic) NSString *appName; - (IBAction)didTouchSendNotificationButton:(id)sender; - (IBAction)didChangeAudioSwitchValue:(id)sender; - (IBAction)didChangeIconSwitchValue:(id)sender; - (IBAction)didTouchDeleteButton:(id)sender; - (QStatus)startProducer; - (void)stopProducer:(bool) isConsumerOn; @end base-15.09/notification/ios/samples/NotificationService/ProducerViewController.m000066400000000000000000000542531262264444500302170ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "ProducerViewController.h" #import #import "AJNVersion.h" #import "alljoyn/about/AJNAboutServiceApi.h" #import "samples_common/AJSCCommonBusListener.h" #import "alljoyn/notification/AJNSNotificationSender.h" #import "alljoyn/notification/AJNSNotificationService.h" #import "alljoyn/services_common/AJSVCGenericLoggerUtil.h" #import "NotificationUtils.h" static NSString * const DEVICE_ID_PRODUCER= @"ProducerBasic"; static NSString * const DEVICE_NAME_PRODUCER= @"ProducerBasic"; static NSString * const DEFAULT_LANG_PRODUCER= @"en"; static NSString * const RICH_ICON_OBJECT_PATH= @"rich/Icon/Object/Path"; static NSString * const RICH_AUDIO_OBJECT_PATH= @"rich/Audio/Object/Path"; static short const SERVICE_PORT= 900; static const uint16_t TTL_MIN = 30; static const uint16_t TTL_MAX = 43200; static NSString *const DEFAULT_TTL = @"40000"; static NSString *const DEFAULT_MSG_TYPE = @"INFO"; @interface ProducerViewController () @property (weak, nonatomic) AJNSNotificationSender *Sender; @property (strong, nonatomic) AJNSNotificationService *producerService; @property (strong, nonatomic) AJSCCommonBusListener *commonBusListener; @property (weak, nonatomic) AJNAboutServiceApi *aboutService; @property (strong, nonatomic) AJNAboutPropertyStoreImpl *aboutPropertyStoreImpl; @property (strong, nonatomic) UIAlertView *selectLanguage; @property (strong, nonatomic) UIAlertView *selectMessageType; @property (strong, nonatomic) AJNSNotification *notification; @property (strong, nonatomic) NSMutableArray *notificationTextArr; @property (strong, nonatomic) NSMutableDictionary *customAttributesDictionary; @property (strong, nonatomic) NSMutableArray *richAudioUrlArray; @property (strong, nonatomic) NSString *defaultTTL; // Hold the default ttl as set in the UI @property (strong, nonatomic) NSString *defaultMessageType; // Hold the default message type as set in the UI @property (nonatomic) AJNSNotificationMessageType messageType; @property (strong, nonatomic) NSString *otherLang; @end @implementation ProducerViewController - (void)viewDidLoad { [super viewDidLoad]; [self.view setHidden:YES]; } - (QStatus)startProducer { // Set TextField.delegate to enable dissmiss keyboard self.notificationEnTextField.delegate = self; self.notificationLangTextField.delegate = self; self.ttlTextField.delegate = self; self.audioTextField.delegate = self; self.iconTextField.delegate = self; // Set default ttl self.defaultTTL = DEFAULT_TTL; self.ttlTextField.text = DEFAULT_TTL; [self.ttlTextField setKeyboardType:UIKeyboardTypeNumberPad]; // Set default messageType self.defaultMessageType = DEFAULT_MSG_TYPE; self.messageType = [self convertMessageType:self.defaultMessageType]; self.messageTypeButton.titleLabel.text = DEFAULT_MSG_TYPE; // Set switch to off self.audioSwitch.on = false; self.iconSwitch.on = false; // Initialize a AJNSNotificationService object self.producerService = [[AJNSNotificationService alloc] init]; // Set logger (see a logger implementation example in ConsumerViewController.m) [self.producerService setLogLevel:QLEVEL_DEBUG]; // Confirm that bus is valid if (!self.busAttachment) { [self.logger fatalTag:[[self class] description] text:@"BusAttachment is nil"]; return ER_FAIL; } // Prepare propertyStore [self.logger debugTag:[[self class] description] text:@"preparePropertyStore."]; self.aboutPropertyStoreImpl = [[AJNAboutPropertyStoreImpl alloc] init]; QStatus status = [self fillAboutPropertyStoreImplData:[[NSUUID UUID] UUIDString] appName:self.appName deviceId:DEVICE_ID_PRODUCER deviceName:DEVICE_NAME_PRODUCER defaultLanguage:DEFAULT_LANG_PRODUCER]; if (status != ER_OK) { [self.logger errorTag:[[self class] description] text:@"Could not fill PropertyStore."]; return ER_FAIL; } // Prepare AJNSBusListener self.commonBusListener = [[AJSCCommonBusListener alloc] init]; // Prepare AboutService [self.logger debugTag:[[self class] description] text:@"prepareAboutService"]; status = [self prepareAboutService:self.commonBusListener servicePort:SERVICE_PORT]; if (status != ER_OK) { [self.logger fatalTag:[[self class] description] text:@"Could not prepareAboutService."]; return ER_FAIL; } // Call initSend self.Sender = [self.producerService startSendWithBus:self.busAttachment andPropertyStore:self.aboutPropertyStoreImpl]; if (!self.Sender) { [self.logger fatalTag:[[self class] description] text:@"Could not initialize Sender"]; return ER_FAIL; } // Call announce status = [self.aboutService announce]; if (status != ER_OK) { [self.logger fatalTag:[[self class] description] text:@"Could not announce"]; return ER_FAIL; } else { [self.logger debugTag:[[self class] description] text:@"Announce..."]; } return ER_OK; } - (void)stopProducer:(bool) isConsumerOn { QStatus status; [self.logger debugTag:[[self class] description] text:@"Stop Producer service"]; if (self.Sender) { self.Sender = nil; } // AboutService destroy if (self.aboutService) { // AboutService destroyInstance [self.aboutService destroyInstance]; //isServiceStarted = false, call [self.aboutService unregister] status = [self.busAttachment unbindSessionFromPort:SERVICE_PORT]; if (status != ER_OK) { [self.logger errorTag:[[self class] description] text:@"Failed to unbindSessionFromPort"]; } self.aboutService = nil; } if (self.aboutPropertyStoreImpl) { self.aboutPropertyStoreImpl = nil; } // Shutdown producer if (self.producerService && isConsumerOn) { [self.logger debugTag:[[self class] description] text:@"calling shutdownSender"]; [self.producerService shutdownSender]; } else { [self.logger debugTag:[[self class] description] text:@"calling shutdown"]; [self.producerService shutdown]; } self.producerService = nil; // Unregister bus listener from the common if (self.busAttachment && self.commonBusListener) { [self.busAttachment unregisterBusListener:self.commonBusListener]; [self.busAttachment unbindSessionFromPort:([self.commonBusListener sessionPort])]; self.commonBusListener = nil; } } // ENUM convertMessageType - (AJNSNotificationMessageType)convertMessageType:(NSString *)tMsgType { if ([tMsgType isEqualToString:@"INFO"]) { return INFO; } else if ([tMsgType isEqualToString:@"WARNING"]) { return WARNING; } else if ([tMsgType isEqualToString:@"EMERGENCY"]) { return EMERGENCY; } else return UNSET; } - (void)producerPostSendView { self.notificationEnTextField.text = nil; self.notificationLangTextField.text = nil; // Lang field-save perv selection // Color save perv selection self.ttlTextField.text = self.defaultTTL; if (self.iconSwitch.on) { self.iconSwitch.on = false; [self didChangeIconSwitchValue:nil]; } if (self.audioSwitch.on) { self.audioSwitch.on = false; [self didChangeAudioSwitchValue:nil]; } [self.messageTypeButton setTitle:self.defaultMessageType forState:(UIControlStateNormal)]; self.messageType = [self convertMessageType:DEFAULT_MSG_TYPE]; // Clear sent parameters: [self.notificationTextArr removeAllObjects]; } -(void)logNotification:(AJNSNotification *)ajnsNotification ttl:(uint16_t)ttl { [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Sending message with message type: '%@'",[AJNSNotificationEnums AJNSMessageTypeToString:[ajnsNotification messageType]]]]; [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"TTL: %hu", ttl]]; for (AJNSNotificationText *notificationText in self.notificationTextArr) { [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"message: '%@'",[notificationText getText]]]; } [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"richIconUrl: '%@'",[ajnsNotification richIconUrl]]]; NSMutableArray *array = [[NSMutableArray alloc]init]; [ajnsNotification richAudioUrl:array]; for (AJNSRichAudioUrl *richAudioURL in array) { [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"RichAudioUrl: '%@'",[richAudioURL url]]]; } [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"richIconObjPath: '%@'",[ajnsNotification richIconObjectPath]]]; [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"RichAudioObjPath: '%@'",[ajnsNotification richAudioObjectPath]]]; [self.logger debugTag:[[self class] description] text:[NSString stringWithFormat:@"Sending notification message for messageType '%d'",[ajnsNotification messageType]]]; } #pragma mark - IBActions // Send a notification - (IBAction)didTouchSendNotificationButton:(id)sender { uint16_t nttl; NSString *nsender = @"iosTestApp"; NSString *richIconUrl; // Dismiss keyboard [self touchesBegan:sender withEvent:nil]; // Build notification object // Set flags bool hasEnNotificationText = false; bool hasOtherLangNotificationText = false; bool ttlIsValid = false; // Create containers self.notificationTextArr = [[NSMutableArray alloc] init]; self.customAttributesDictionary = [[NSMutableDictionary alloc] init]; // this dictionary holds custom attributes that are sent in notification. see below for an example on how to send the color custom attribute self.richAudioUrlArray = [[NSMutableArray alloc] init]; // Set enNotificationText if ([NotificationUtils textFieldIsValid:self.notificationEnTextField.text]) { NSString *enNotificationText; enNotificationText = self.notificationEnTextField.text; // Insert into the array text and lang [self.notificationTextArr addObject:[[AJNSNotificationText alloc] initWithLang:@"en" andText:enNotificationText]]; hasEnNotificationText = true; } else { // Create UIAlertView alert [[[UIAlertView alloc] initWithTitle:@"Error" message:@"At least one of the messages should be sent in english" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil] show]; return; } // Set other lang message if ([NotificationUtils textFieldIsValid:self.notificationLangTextField.text] && self.otherLang) { NSString *langNotificationText; langNotificationText = self.notificationLangTextField.text; [self.notificationTextArr addObject:[[AJNSNotificationText alloc] initWithLang:self.otherLang andText:langNotificationText]]; hasOtherLangNotificationText = true; } // Set ttl unsigned long rcv_ttl; rcv_ttl = [[self.ttlTextField text] intValue]; if ((rcv_ttl >= TTL_MIN) && (rcv_ttl <= TTL_MAX)) { ttlIsValid = true; nttl = rcv_ttl; } else { NSString *ttlErrReport = [NSString stringWithFormat:@"ttl range is %hu - %hu. %lu is invalid", TTL_MIN, TTL_MAX, rcv_ttl]; [[[UIAlertView alloc] initWithTitle:@"Error" message:ttlErrReport delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil] show]; } // Set English audio if (self.audioSwitch.on == true && ([NotificationUtils textFieldIsValid:(self.audioTextField.text)])) { AJNSRichAudioUrl *richAudioUrlObj = [[AJNSRichAudioUrl alloc] initRichAudioUrlWithLang:@"en" andUrl:self.audioTextField.text]; [self.richAudioUrlArray addObject:richAudioUrlObj]; // Set other language audio if (self.otherLang) { AJNSRichAudioUrl *richAudioUrlObj = [[AJNSRichAudioUrl alloc] initRichAudioUrlWithLang:self.otherLang andUrl:self.audioTextField.text]; [self.richAudioUrlArray addObject:richAudioUrlObj]; } } // Set icon if (self.iconSwitch.on == true && ([NotificationUtils textFieldIsValid:(self.iconTextField.text)])) { richIconUrl = self.iconTextField.text; } // Set color example - this is how to set the color // [customAttributesDictionary setValue:@"Blue" forKey:@"color"]; NSString *curr_controlPanelServiceObjectPath = @""; // Set the Notification object if ((hasEnNotificationText) && ttlIsValid && (self.messageType != UNSET)) { self.notification = [[AJNSNotification alloc] initWithMessageType:self.messageType andNotificationText:self.notificationTextArr]; // This is an exaple of using AJNSNotification setters : [self.notification setMessageId:-1]; [self.notification setDeviceId:nil]; [self.notification setDeviceName:nil]; [self.notification setAppId:nil]; [self.notification setAppName:self.appName]; [self.notification setSender:nsender]; [self.notification setCustomAttributes:self.customAttributesDictionary]; [self.notification setRichIconUrl:richIconUrl]; [self.notification setRichAudioUrl:self.richAudioUrlArray]; [self.notification setRichIconObjectPath:RICH_ICON_OBJECT_PATH]; [self.notification setRichAudioObjectPath:RICH_AUDIO_OBJECT_PATH]; [self.notification setControlPanelServiceObjectPath:curr_controlPanelServiceObjectPath]; [self logNotification:self.notification ttl:nttl]; [self.richAudioUrlArray removeAllObjects]; // Call send QStatus sendStatus = [self.Sender send:self.notification ttl:nttl]; if (sendStatus != ER_OK) { [self.logger infoTag:[[self class] description] text:[NSString stringWithFormat:@"Send has failed"]]; } else { [self.logger infoTag:[[self class] description] text:[NSString stringWithFormat:@"Successfully sent!"]]; } [self producerPostSendView]; } else { [self.logger infoTag:[[self class] description] text:[NSString stringWithFormat:@"Invalid Notification input:\n EnNotificationText=%u\n OtherLangNotificationText=%u\n ttlIsValid=%u\n hasMessageType=%u", hasEnNotificationText, hasOtherLangNotificationText, ttlIsValid, self.messageType]]; } [self producerPostSendView]; } - (IBAction)didChangeAudioSwitchValue:(id)sender { self.audioTextField.alpha = self.audioSwitch.on; } - (IBAction)didChangeIconSwitchValue:(id)sender { self.iconTextField.alpha = self.iconSwitch.on; } - (IBAction)didTouchDeleteButton:(id)sender { [self.logger errorTag:[[self class] description] text:[NSString stringWithFormat:@"message type is %u", self.messageType]]; if (self.messageType == UNSET) return; QStatus deleteStatus = [self.Sender deleteLastMsg:self.messageType]; if (deleteStatus != ER_OK) { [self.logger errorTag:[[self class] description] text:@"Failed to delete a message"]; } } #pragma mark - About Service methods - (QStatus)prepareAboutService:(AJSCCommonBusListener *)busListener servicePort:(AJNSessionPort)port { if (!self.busAttachment) return ER_BAD_ARG_1; if (!busListener) return ER_BAD_ARG_2; if (!self.aboutPropertyStoreImpl) { [self.logger errorTag:[[self class] description] text:@"PropertyStore is empty"]; return ER_FAIL; } // Prepare About Service self.aboutService = [AJNAboutServiceApi sharedInstance]; if (!self.aboutService) { return ER_BUS_NOT_ALLOWED; } [self.aboutService startWithBus:self.busAttachment andPropertyStore:self.aboutPropertyStoreImpl]; //isServiceStarted = true [self.logger debugTag:[[self class] description] text:@"registerBusListener"]; [busListener setSessionPort:port]; [self.busAttachment registerBusListener:busListener]; AJNSessionOptions *opt = [[AJNSessionOptions alloc] initWithTrafficType:(kAJNTrafficMessages) supportsMultipoint:(false) proximity:(kAJNProximityAny) transportMask:(kAJNTransportMaskAny)]; QStatus aboutStatus = [self.busAttachment bindSessionOnPort:SERVICE_PORT withOptions:opt withDelegate:busListener]; if (aboutStatus == ER_ALLJOYN_BINDSESSIONPORT_REPLY_ALREADY_EXISTS) [self.logger infoTag:[[self class] description] text:([NSString stringWithFormat:@"bind status: ER_ALLJOYN_BINDSESSIONPORT_REPLY_ALREADY_EXISTS"])]; if (aboutStatus != ER_OK) return aboutStatus; return [self.aboutService registerPort:(SERVICE_PORT)]; } -(QStatus)fillAboutPropertyStoreImplData:(NSString*) appId appName:(NSString*) appName deviceId:(NSString*)deviceId deviceName:(NSString*) deviceName defaultLanguage:(NSString*) defaultLang { QStatus status; // AppId status = [self.aboutPropertyStoreImpl setAppId:appId]; if (status != ER_OK) { return status; } // AppName status = [self.aboutPropertyStoreImpl setAppName:appName]; if (status != ER_OK) { return status; } // DeviceId status = [self.aboutPropertyStoreImpl setDeviceId:deviceId]; if (status != ER_OK) { return status; } // DeviceName status = [self.aboutPropertyStoreImpl setDeviceName:deviceName]; if (status != ER_OK) { return status; } // SupportedLangs NSArray *languages = @[@"en", @"sp", @"fr"]; status = [self.aboutPropertyStoreImpl setSupportedLangs:languages]; if (status != ER_OK) { return status; } // DefaultLang status = [self.aboutPropertyStoreImpl setDefaultLang:defaultLang]; if (status != ER_OK) { return status; } // ModelNumber status = [self.aboutPropertyStoreImpl setModelNumber:@"Wxfy388i"]; if (status != ER_OK) { return status; } // DateOfManufacture status = [self.aboutPropertyStoreImpl setDateOfManufacture:@"10/1/2199"]; if (status != ER_OK) { return status; } // SoftwareVersion status = [self.aboutPropertyStoreImpl setSoftwareVersion:@"12.20.44 build 44454"]; if (status != ER_OK) { return status; } // AjSoftwareVersion status = [self.aboutPropertyStoreImpl setAjSoftwareVersion:[AJNVersion versionInformation]]; if (status != ER_OK) { return status; } // HardwareVersion status = [self.aboutPropertyStoreImpl setHardwareVersion:@"355.499. b"]; if (status != ER_OK) { return status; } // Description status = [self.aboutPropertyStoreImpl setDescription:@"This is an Alljoyn Application" language:@"en"]; if (status != ER_OK) { return status; } status = [self.aboutPropertyStoreImpl setDescription:@"Esta es una Alljoyn aplicaciĂłn" language:@"sp"]; if (status != ER_OK) { return status; } status = [self.aboutPropertyStoreImpl setDescription:@"C'est une Alljoyn application" language:@"fr"]; if (status != ER_OK) { return status; } // Manufacturer status = [self.aboutPropertyStoreImpl setManufacturer:@"Company" language:@"en"]; if (status != ER_OK) { return status; } status = [self.aboutPropertyStoreImpl setManufacturer:@"Empresa" language:@"sp"]; if (status != ER_OK) { return status; } status = [self.aboutPropertyStoreImpl setManufacturer:@"Entreprise" language:@"fr"]; if (status != ER_OK) { return status; } // SupportedUrl status = [self.aboutPropertyStoreImpl setSupportUrl:@"http://www.alljoyn.org"]; if (status != ER_OK) { return status; } return status; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } - (IBAction)selectLanguagePressed:(UIButton *)sender { [self showSelectLanguageAlert]; } - (IBAction)selectMessageTypePressed:(UIButton *)sender { [self showMessageTypeAlert]; } - (void)showSelectLanguageAlert { NSArray *langArray = [[NSMutableArray alloc] initWithObjects:@"English", @"Hebrew", @"Russian", nil]; self.selectLanguage = [[UIAlertView alloc] initWithTitle:@"Select Language" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; for (NSString *str in langArray) { [self.selectLanguage addButtonWithTitle:str]; } [self.selectLanguage show]; } - (void)showMessageTypeAlert { NSArray *messageTypeArray = [[NSMutableArray alloc] initWithObjects:@"INFO", @"WARNING", @"EMERGENCY", nil]; self.selectMessageType = [[UIAlertView alloc] initWithTitle:@"Select Language" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; for (NSString *str in messageTypeArray) { [self.selectMessageType addButtonWithTitle:str]; } [self.selectMessageType show]; } #pragma mark - UIAlertView delegate function - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { if (buttonIndex == 0) { return; //Cancel was pressed } if (alertView == self.selectLanguage) { self.otherLang = [self convertToLangCode:[alertView buttonTitleAtIndex:buttonIndex]]; [self.langButton setTitle:[alertView buttonTitleAtIndex:buttonIndex] forState:UIControlStateNormal]; } else if (alertView == self.selectMessageType) { self.messageType = [self convertMessageType:[alertView buttonTitleAtIndex:buttonIndex]]; [self.messageTypeButton setTitle:[alertView buttonTitleAtIndex:buttonIndex] forState:UIControlStateNormal]; } } #pragma mark - Application util methods - (NSString *)convertToLangCode:(NSString *)value { if ([value isEqualToString:@"English"]) { return @"en"; } else if ([value isEqualToString:@"Hebrew"]) { return @"he"; } else if ([value isEqualToString:@"Russian"]) { return @"ru"; } return nil; } // Set dismiss keyboard for each UITextField - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { for (UIView *aSubview in[self.view subviews]) { if ([aSubview isKindOfClass:[UITextField class]]) { [(UITextField *)aSubview resignFirstResponder]; } } } @end base-15.09/notification/ios/samples/NotificationServiceWorkspace.xcworkspace/000077500000000000000000000000001262264444500275555ustar00rootroot00000000000000contents.xcworkspacedata000066400000000000000000000017651262264444500344510ustar00rootroot00000000000000base-15.09/notification/ios/samples/NotificationServiceWorkspace.xcworkspace base-15.09/notification/ios/samples/alljoyn_services_cpp/000077500000000000000000000000001262264444500236145ustar00rootroot00000000000000base-15.09/notification/ios/samples/alljoyn_services_cpp/alljoyn_notification_cpp.xcodeproj/000077500000000000000000000000001262264444500326705ustar00rootroot00000000000000project.pbxproj000066400000000000000000000733001262264444500356700ustar00rootroot00000000000000base-15.09/notification/ios/samples/alljoyn_services_cpp/alljoyn_notification_cpp.xcodeproj// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 9AA93A801855C20800378361 /* Notification.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AB9CE0518547B6D004660C5 /* Notification.h */; }; 9AA93A811855C20800378361 /* NotificationEnums.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AB9CE0618547B6D004660C5 /* NotificationEnums.h */; }; 9AA93A821855C20800378361 /* NotificationReceiver.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AB9CE0718547B6D004660C5 /* NotificationReceiver.h */; }; 9AA93A831855C20800378361 /* NotificationSender.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AB9CE0818547B6D004660C5 /* NotificationSender.h */; }; 9AA93A841855C20800378361 /* NotificationService.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AB9CE0918547B6D004660C5 /* NotificationService.h */; }; 9AA93A851855C20800378361 /* NotificationText.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AB9CE0A18547B6D004660C5 /* NotificationText.h */; }; 9AA93A861855C20800378361 /* RichAudioUrl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AB9CE0B18547B6D004660C5 /* RichAudioUrl.h */; }; 9AB3A6B0189E7B6E00F152F7 /* NotificationProducerSender.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB3A6A2189E7B6E00F152F7 /* NotificationProducerSender.cc */; }; 9AB3A6B1189E7B6E00F152F7 /* NotificationProducerReceiver.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB3A6A4189E7B6E00F152F7 /* NotificationProducerReceiver.cc */; }; 9AB3A6B2189E7B6E00F152F7 /* NotificationProducerListener.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB3A6A6189E7B6E00F152F7 /* NotificationProducerListener.cc */; }; 9AB3A6B3189E7B6E00F152F7 /* NotificationProducer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB3A6A8189E7B6E00F152F7 /* NotificationProducer.cc */; }; 9AB3A6B4189E7B6E00F152F7 /* NotificationDismisserSender.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB3A6AA189E7B6E00F152F7 /* NotificationDismisserSender.cc */; }; 9AB3A6B5189E7B6E00F152F7 /* NotificationDismisserReceiver.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB3A6AC189E7B6E00F152F7 /* NotificationDismisserReceiver.cc */; }; 9AB3A6B6189E7B6E00F152F7 /* NotificationDismisser.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB3A6AE189E7B6E00F152F7 /* NotificationDismisser.cc */; }; 9AB3A6B7189E7B6E00F152F7 /* NotificationAsyncTaskEvents.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB3A6AF189E7B6E00F152F7 /* NotificationAsyncTaskEvents.cc */; }; 9AB3A6B8189E7B9900F152F7 /* NotificationAsyncTaskEvents.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AB3A69D189E7B5600F152F7 /* NotificationAsyncTaskEvents.h */; }; 9AB9CDD618547B37004660C5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AB9CDD518547B37004660C5 /* Foundation.framework */; }; 9AB9CF4E18547B6E004660C5 /* Notification.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9CE2B18547B6D004660C5 /* Notification.cc */; }; 9AB9CF5018547B6E004660C5 /* NotificationConstants.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9CE2E18547B6D004660C5 /* NotificationConstants.cc */; }; 9AB9CF5118547B6E004660C5 /* NotificationEnums.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9CE3018547B6D004660C5 /* NotificationEnums.cc */; }; 9AB9CF5218547B6E004660C5 /* NotificationReceiver.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9CE3118547B6D004660C5 /* NotificationReceiver.cc */; }; 9AB9CF5318547B6E004660C5 /* NotificationSender.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9CE3218547B6D004660C5 /* NotificationSender.cc */; }; 9AB9CF5418547B6E004660C5 /* NotificationService.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9CE3318547B6D004660C5 /* NotificationService.cc */; }; 9AB9CF5518547B6E004660C5 /* NotificationText.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9CE3418547B6D004660C5 /* NotificationText.cc */; }; 9AB9CF5618547B6E004660C5 /* NotificationTransport.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9CE3518547B6D004660C5 /* NotificationTransport.cc */; }; 9AB9CF5718547B6E004660C5 /* NotificationTransportConsumer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9CE3718547B6D004660C5 /* NotificationTransportConsumer.cc */; }; 9AB9CF5818547B6E004660C5 /* NotificationTransportProducer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9CE3918547B6D004660C5 /* NotificationTransportProducer.cc */; }; 9AB9CF5A18547B6E004660C5 /* PayloadAdapter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9CE3D18547B6D004660C5 /* PayloadAdapter.cc */; }; 9AB9CF5B18547B6E004660C5 /* RichAudioUrl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9CE3F18547B6D004660C5 /* RichAudioUrl.cc */; }; 9AB9CF5C18547B6E004660C5 /* Transport.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9CE4118547B6D004660C5 /* Transport.cc */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ 9AA93A7F1855C1F600378361 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = inc/alljoyn/notification; dstSubfolderSpec = 16; files = ( 9AB3A6B8189E7B9900F152F7 /* NotificationAsyncTaskEvents.h in CopyFiles */, 9AA93A801855C20800378361 /* Notification.h in CopyFiles */, 9AA93A811855C20800378361 /* NotificationEnums.h in CopyFiles */, 9AA93A821855C20800378361 /* NotificationReceiver.h in CopyFiles */, 9AA93A831855C20800378361 /* NotificationSender.h in CopyFiles */, 9AA93A841855C20800378361 /* NotificationService.h in CopyFiles */, 9AA93A851855C20800378361 /* NotificationText.h in CopyFiles */, 9AA93A861855C20800378361 /* RichAudioUrl.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 9AB3A69D189E7B5600F152F7 /* NotificationAsyncTaskEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationAsyncTaskEvents.h; sourceTree = ""; }; 9AB3A6A1189E7B6E00F152F7 /* NotificationProducerSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationProducerSender.h; sourceTree = ""; }; 9AB3A6A2189E7B6E00F152F7 /* NotificationProducerSender.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationProducerSender.cc; sourceTree = ""; }; 9AB3A6A3189E7B6E00F152F7 /* NotificationProducerReceiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationProducerReceiver.h; sourceTree = ""; }; 9AB3A6A4189E7B6E00F152F7 /* NotificationProducerReceiver.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationProducerReceiver.cc; sourceTree = ""; }; 9AB3A6A5189E7B6E00F152F7 /* NotificationProducerListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationProducerListener.h; sourceTree = ""; }; 9AB3A6A6189E7B6E00F152F7 /* NotificationProducerListener.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationProducerListener.cc; sourceTree = ""; }; 9AB3A6A7189E7B6E00F152F7 /* NotificationProducer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationProducer.h; sourceTree = ""; }; 9AB3A6A8189E7B6E00F152F7 /* NotificationProducer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationProducer.cc; sourceTree = ""; }; 9AB3A6A9189E7B6E00F152F7 /* NotificationDismisserSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationDismisserSender.h; sourceTree = ""; }; 9AB3A6AA189E7B6E00F152F7 /* NotificationDismisserSender.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationDismisserSender.cc; sourceTree = ""; }; 9AB3A6AB189E7B6E00F152F7 /* NotificationDismisserReceiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationDismisserReceiver.h; sourceTree = ""; }; 9AB3A6AC189E7B6E00F152F7 /* NotificationDismisserReceiver.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationDismisserReceiver.cc; sourceTree = ""; }; 9AB3A6AD189E7B6E00F152F7 /* NotificationDismisser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationDismisser.h; sourceTree = ""; }; 9AB3A6AE189E7B6E00F152F7 /* NotificationDismisser.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationDismisser.cc; sourceTree = ""; }; 9AB3A6AF189E7B6E00F152F7 /* NotificationAsyncTaskEvents.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationAsyncTaskEvents.cc; sourceTree = ""; }; 9AB9CDD218547B37004660C5 /* liballjoyn_notification_cpp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liballjoyn_notification_cpp.a; sourceTree = BUILT_PRODUCTS_DIR; }; 9AB9CDD518547B37004660C5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 9AB9CDD918547B37004660C5 /* alljoyn_notification_cpp-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "alljoyn_notification_cpp-Prefix.pch"; sourceTree = ""; }; 9AB9CDE318547B37004660C5 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 9AB9CDE618547B37004660C5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; 9AB9CE0518547B6D004660C5 /* Notification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Notification.h; sourceTree = ""; }; 9AB9CE0618547B6D004660C5 /* NotificationEnums.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationEnums.h; sourceTree = ""; }; 9AB9CE0718547B6D004660C5 /* NotificationReceiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationReceiver.h; sourceTree = ""; }; 9AB9CE0818547B6D004660C5 /* NotificationSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationSender.h; sourceTree = ""; }; 9AB9CE0918547B6D004660C5 /* NotificationService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationService.h; sourceTree = ""; }; 9AB9CE0A18547B6D004660C5 /* NotificationText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationText.h; sourceTree = ""; }; 9AB9CE0B18547B6D004660C5 /* RichAudioUrl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RichAudioUrl.h; sourceTree = ""; }; 9AB9CE2B18547B6D004660C5 /* Notification.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Notification.cc; sourceTree = ""; }; 9AB9CE2E18547B6D004660C5 /* NotificationConstants.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationConstants.cc; sourceTree = ""; }; 9AB9CE2F18547B6D004660C5 /* NotificationConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationConstants.h; sourceTree = ""; }; 9AB9CE3018547B6D004660C5 /* NotificationEnums.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationEnums.cc; sourceTree = ""; }; 9AB9CE3118547B6D004660C5 /* NotificationReceiver.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationReceiver.cc; sourceTree = ""; }; 9AB9CE3218547B6D004660C5 /* NotificationSender.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationSender.cc; sourceTree = ""; }; 9AB9CE3318547B6D004660C5 /* NotificationService.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationService.cc; sourceTree = ""; }; 9AB9CE3418547B6D004660C5 /* NotificationText.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationText.cc; sourceTree = ""; }; 9AB9CE3518547B6D004660C5 /* NotificationTransport.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationTransport.cc; sourceTree = ""; }; 9AB9CE3618547B6D004660C5 /* NotificationTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationTransport.h; sourceTree = ""; }; 9AB9CE3718547B6D004660C5 /* NotificationTransportConsumer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationTransportConsumer.cc; sourceTree = ""; }; 9AB9CE3818547B6D004660C5 /* NotificationTransportConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationTransportConsumer.h; sourceTree = ""; }; 9AB9CE3918547B6D004660C5 /* NotificationTransportProducer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationTransportProducer.cc; sourceTree = ""; }; 9AB9CE3A18547B6D004660C5 /* NotificationTransportProducer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationTransportProducer.h; sourceTree = ""; }; 9AB9CE3D18547B6D004660C5 /* PayloadAdapter.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PayloadAdapter.cc; sourceTree = ""; }; 9AB9CE3E18547B6D004660C5 /* PayloadAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayloadAdapter.h; sourceTree = ""; }; 9AB9CE3F18547B6D004660C5 /* RichAudioUrl.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RichAudioUrl.cc; sourceTree = ""; }; 9AB9CE4118547B6D004660C5 /* Transport.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Transport.cc; sourceTree = ""; }; 9AB9CE4218547B6D004660C5 /* Transport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Transport.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 9AB9CDCF18547B37004660C5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9AB9CDD618547B37004660C5 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 9AB9CDC918547B37004660C5 = { isa = PBXGroup; children = ( 9AB9CDD718547B37004660C5 /* alljoyn_services_cpp */, 9AB9CDD418547B37004660C5 /* Frameworks */, 9AB9CDD318547B37004660C5 /* Products */, ); sourceTree = ""; }; 9AB9CDD318547B37004660C5 /* Products */ = { isa = PBXGroup; children = ( 9AB9CDD218547B37004660C5 /* liballjoyn_notification_cpp.a */, ); name = Products; sourceTree = ""; }; 9AB9CDD418547B37004660C5 /* Frameworks */ = { isa = PBXGroup; children = ( 9AB9CDD518547B37004660C5 /* Foundation.framework */, 9AB9CDE318547B37004660C5 /* XCTest.framework */, 9AB9CDE618547B37004660C5 /* UIKit.framework */, ); name = Frameworks; sourceTree = ""; }; 9AB9CDD718547B37004660C5 /* alljoyn_services_cpp */ = { isa = PBXGroup; children = ( 9AB9CDFB18547B6D004660C5 /* notification */, 9AB9CDD818547B37004660C5 /* Supporting Files */, ); path = alljoyn_services_cpp; sourceTree = ""; }; 9AB9CDD818547B37004660C5 /* Supporting Files */ = { isa = PBXGroup; children = ( 9AB9CDD918547B37004660C5 /* alljoyn_notification_cpp-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; 9AB9CDFB18547B6D004660C5 /* notification */ = { isa = PBXGroup; children = ( 9AB9CDFD18547B6D004660C5 /* cpp */, ); name = notification; path = ../../../..; sourceTree = ""; }; 9AB9CDFD18547B6D004660C5 /* cpp */ = { isa = PBXGroup; children = ( 9AB9CE0218547B6D004660C5 /* inc */, 9AB9CE2918547B6D004660C5 /* src */, ); path = cpp; sourceTree = ""; }; 9AB9CE0218547B6D004660C5 /* inc */ = { isa = PBXGroup; children = ( 9AB9CE0318547B6D004660C5 /* alljoyn */, ); path = inc; sourceTree = ""; }; 9AB9CE0318547B6D004660C5 /* alljoyn */ = { isa = PBXGroup; children = ( 9AB9CE0418547B6D004660C5 /* notification */, ); path = alljoyn; sourceTree = ""; }; 9AB9CE0418547B6D004660C5 /* notification */ = { isa = PBXGroup; children = ( 9AB3A69D189E7B5600F152F7 /* NotificationAsyncTaskEvents.h */, 9AB9CE0518547B6D004660C5 /* Notification.h */, 9AB9CE0618547B6D004660C5 /* NotificationEnums.h */, 9AB9CE0718547B6D004660C5 /* NotificationReceiver.h */, 9AB9CE0818547B6D004660C5 /* NotificationSender.h */, 9AB9CE0918547B6D004660C5 /* NotificationService.h */, 9AB9CE0A18547B6D004660C5 /* NotificationText.h */, 9AB9CE0B18547B6D004660C5 /* RichAudioUrl.h */, ); path = notification; sourceTree = ""; }; 9AB9CE2918547B6D004660C5 /* src */ = { isa = PBXGroup; children = ( 9AB3A6A1189E7B6E00F152F7 /* NotificationProducerSender.h */, 9AB3A6A2189E7B6E00F152F7 /* NotificationProducerSender.cc */, 9AB3A6A3189E7B6E00F152F7 /* NotificationProducerReceiver.h */, 9AB3A6A4189E7B6E00F152F7 /* NotificationProducerReceiver.cc */, 9AB3A6A5189E7B6E00F152F7 /* NotificationProducerListener.h */, 9AB3A6A6189E7B6E00F152F7 /* NotificationProducerListener.cc */, 9AB3A6A7189E7B6E00F152F7 /* NotificationProducer.h */, 9AB3A6A8189E7B6E00F152F7 /* NotificationProducer.cc */, 9AB3A6A9189E7B6E00F152F7 /* NotificationDismisserSender.h */, 9AB3A6AA189E7B6E00F152F7 /* NotificationDismisserSender.cc */, 9AB3A6AB189E7B6E00F152F7 /* NotificationDismisserReceiver.h */, 9AB3A6AC189E7B6E00F152F7 /* NotificationDismisserReceiver.cc */, 9AB3A6AD189E7B6E00F152F7 /* NotificationDismisser.h */, 9AB3A6AE189E7B6E00F152F7 /* NotificationDismisser.cc */, 9AB3A6AF189E7B6E00F152F7 /* NotificationAsyncTaskEvents.cc */, 9AB9CE2B18547B6D004660C5 /* Notification.cc */, 9AB9CE2E18547B6D004660C5 /* NotificationConstants.cc */, 9AB9CE2F18547B6D004660C5 /* NotificationConstants.h */, 9AB9CE3018547B6D004660C5 /* NotificationEnums.cc */, 9AB9CE3118547B6D004660C5 /* NotificationReceiver.cc */, 9AB9CE3218547B6D004660C5 /* NotificationSender.cc */, 9AB9CE3318547B6D004660C5 /* NotificationService.cc */, 9AB9CE3418547B6D004660C5 /* NotificationText.cc */, 9AB9CE3518547B6D004660C5 /* NotificationTransport.cc */, 9AB9CE3618547B6D004660C5 /* NotificationTransport.h */, 9AB9CE3718547B6D004660C5 /* NotificationTransportConsumer.cc */, 9AB9CE3818547B6D004660C5 /* NotificationTransportConsumer.h */, 9AB9CE3918547B6D004660C5 /* NotificationTransportProducer.cc */, 9AB9CE3A18547B6D004660C5 /* NotificationTransportProducer.h */, 9AB9CE3D18547B6D004660C5 /* PayloadAdapter.cc */, 9AB9CE3E18547B6D004660C5 /* PayloadAdapter.h */, 9AB9CE3F18547B6D004660C5 /* RichAudioUrl.cc */, 9AB9CE4118547B6D004660C5 /* Transport.cc */, 9AB9CE4218547B6D004660C5 /* Transport.h */, ); path = src; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 9AB9CDD118547B37004660C5 /* alljoyn_notification_cpp */ = { isa = PBXNativeTarget; buildConfigurationList = 9AB9CDF518547B37004660C5 /* Build configuration list for PBXNativeTarget "alljoyn_notification_cpp" */; buildPhases = ( 9AB9CDCE18547B37004660C5 /* Sources */, 9AB9CDCF18547B37004660C5 /* Frameworks */, 9AA93A7F1855C1F600378361 /* CopyFiles */, ); buildRules = ( ); dependencies = ( ); name = alljoyn_notification_cpp; productName = alljoyn_services_cpp; productReference = 9AB9CDD218547B37004660C5 /* liballjoyn_notification_cpp.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 9AB9CDCA18547B37004660C5 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = AllJoyn; }; buildConfigurationList = 9AB9CDCD18547B37004660C5 /* Build configuration list for PBXProject "alljoyn_notification_cpp" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 9AB9CDC918547B37004660C5; productRefGroup = 9AB9CDD318547B37004660C5 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 9AB9CDD118547B37004660C5 /* alljoyn_notification_cpp */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ 9AB9CDCE18547B37004660C5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 9AB9CF5718547B6E004660C5 /* NotificationTransportConsumer.cc in Sources */, 9AB9CF5618547B6E004660C5 /* NotificationTransport.cc in Sources */, 9AB3A6B2189E7B6E00F152F7 /* NotificationProducerListener.cc in Sources */, 9AB3A6B0189E7B6E00F152F7 /* NotificationProducerSender.cc in Sources */, 9AB9CF5818547B6E004660C5 /* NotificationTransportProducer.cc in Sources */, 9AB3A6B1189E7B6E00F152F7 /* NotificationProducerReceiver.cc in Sources */, 9AB3A6B6189E7B6E00F152F7 /* NotificationDismisser.cc in Sources */, 9AB3A6B5189E7B6E00F152F7 /* NotificationDismisserReceiver.cc in Sources */, 9AB9CF4E18547B6E004660C5 /* Notification.cc in Sources */, 9AB9CF5318547B6E004660C5 /* NotificationSender.cc in Sources */, 9AB9CF5B18547B6E004660C5 /* RichAudioUrl.cc in Sources */, 9AB9CF5018547B6E004660C5 /* NotificationConstants.cc in Sources */, 9AB3A6B4189E7B6E00F152F7 /* NotificationDismisserSender.cc in Sources */, 9AB9CF5C18547B6E004660C5 /* Transport.cc in Sources */, 9AB3A6B3189E7B6E00F152F7 /* NotificationProducer.cc in Sources */, 9AB9CF5418547B6E004660C5 /* NotificationService.cc in Sources */, 9AB9CF5518547B6E004660C5 /* NotificationText.cc in Sources */, 9AB9CF5A18547B6E004660C5 /* PayloadAdapter.cc in Sources */, 9AB9CF5118547B6E004660C5 /* NotificationEnums.cc in Sources */, 9AB9CF5218547B6E004660C5 /* NotificationReceiver.cc in Sources */, 9AB3A6B7189E7B6E00F152F7 /* NotificationAsyncTaskEvents.cc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ 9AB9CDF318547B37004660C5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = NO; SDKROOT = iphoneos; }; name = Debug; }; 9AB9CDF418547B37004660C5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.0; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; name = Release; }; 9AB9CDF618547B37004660C5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD)"; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; CLANG_ENABLE_MODULES = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; DSTROOT = /tmp/alljoyn_services_cpp.dst; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_cpp/alljoyn_notification_cpp-Prefix.pch"; GCC_WARN_ABOUT_RETURN_TYPE = YES; HEADER_SEARCH_PATHS = ( "\"$(ALLSEEN_BASE_SERVICES_ROOT)/notification/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "$(inherited)", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/cpp/inc\"", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib\"", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib\"", ); OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", "-DUSE_SAMPLE_LOGGER", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = alljoyn_notification_cpp; SKIP_INSTALL = YES; }; name = Debug; }; 9AB9CDF718547B37004660C5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD)"; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; CLANG_ENABLE_MODULES = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; DSTROOT = /tmp/alljoyn_services_cpp.dst; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_cpp/alljoyn_notification_cpp-Prefix.pch"; GCC_WARN_ABOUT_RETURN_TYPE = YES; HEADER_SEARCH_PATHS = ( "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/notification/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/\"", "$(inherited)", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib\"", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib\"", ); OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", "-DUSE_SAMPLE_LOGGER", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = alljoyn_notification_cpp; SKIP_INSTALL = YES; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 9AB9CDCD18547B37004660C5 /* Build configuration list for PBXProject "alljoyn_notification_cpp" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AB9CDF318547B37004660C5 /* Debug */, 9AB9CDF418547B37004660C5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 9AB9CDF518547B37004660C5 /* Build configuration list for PBXNativeTarget "alljoyn_notification_cpp" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AB9CDF618547B37004660C5 /* Debug */, 9AB9CDF718547B37004660C5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 9AB9CDCA18547B37004660C5 /* Project object */; } project.xcworkspace/000077500000000000000000000000001262264444500366075ustar00rootroot00000000000000base-15.09/notification/ios/samples/alljoyn_services_cpp/alljoyn_notification_cpp.xcodeprojcontents.xcworkspacedata000066400000000000000000000002451262264444500435520ustar00rootroot00000000000000base-15.09/notification/ios/samples/alljoyn_services_cpp/alljoyn_notification_cpp.xcodeproj/project.xcworkspace base-15.09/notification/ios/samples/alljoyn_services_cpp/alljoyn_services_cpp/000077500000000000000000000000001262264444500300315ustar00rootroot00000000000000alljoyn_notification_cpp-Prefix.pch000066400000000000000000000020151262264444500367570ustar00rootroot00000000000000base-15.09/notification/ios/samples/alljoyn_services_cpp/alljoyn_services_cpp/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef __OBJC__ #import #endif base-15.09/notification/ios/samples/alljoyn_services_objc/000077500000000000000000000000001262264444500237475ustar00rootroot00000000000000base-15.09/notification/ios/samples/alljoyn_services_objc/alljoyn_notification_objc.xcodeproj/000077500000000000000000000000001262264444500331565ustar00rootroot00000000000000project.pbxproj000066400000000000000000000734541262264444500361700ustar00rootroot00000000000000base-15.09/notification/ios/samples/alljoyn_services_objc/alljoyn_notification_objc.xcodeproj// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 9AA935ED1854BC2B00378361 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935EC1854BC2B00378361 /* Foundation.framework */; }; 9AA935FB1854BC2B00378361 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935FA1854BC2B00378361 /* XCTest.framework */; }; 9AA935FC1854BC2B00378361 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935EC1854BC2B00378361 /* Foundation.framework */; }; 9AA935FE1854BC2B00378361 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935FD1854BC2B00378361 /* UIKit.framework */; }; 9AA936011854BC2B00378361 /* liballjoyn_notification_objc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA935E91854BC2B00378361 /* liballjoyn_notification_objc.a */; }; 9AA936071854BC2B00378361 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9AA936051854BC2B00378361 /* InfoPlist.strings */; }; 9AA936091854BC2B00378361 /* alljoyn_services_objcTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AA936081854BC2B00378361 /* alljoyn_services_objcTests.m */; }; 9AA939491854BD1800378361 /* AJNSNotificationReceiverAdapter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AA937F31854BD1700378361 /* AJNSNotificationReceiverAdapter.mm */; }; 9AA9394B1854BD1800378361 /* AJNSNotification.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AA937F51854BD1700378361 /* AJNSNotification.mm */; }; 9AA9394C1854BD1800378361 /* AJNSNotificationEnums.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AA937F61854BD1700378361 /* AJNSNotificationEnums.mm */; }; 9AA9394D1854BD1800378361 /* AJNSNotificationSender.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AA937F71854BD1700378361 /* AJNSNotificationSender.mm */; }; 9AA9394E1854BD1800378361 /* AJNSNotificationService.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AA937F81854BD1700378361 /* AJNSNotificationService.mm */; }; 9AA9394F1854BD1800378361 /* AJNSSNotificationText.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AA937F91854BD1700378361 /* AJNSSNotificationText.mm */; }; 9AA939511854BD1800378361 /* AJNSRichAudioUrl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AA937FB1854BD1700378361 /* AJNSRichAudioUrl.mm */; }; 9AA93A991855CCB800378361 /* AJNSNotificationReceiverAdapter.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AA937B71854BD1700378361 /* AJNSNotificationReceiverAdapter.h */; }; 9AA93A9B1855CCB800378361 /* AJNSNotification.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AA937B91854BD1700378361 /* AJNSNotification.h */; }; 9AA93A9C1855CCB800378361 /* AJNSNotificationEnums.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AA937BA1854BD1700378361 /* AJNSNotificationEnums.h */; }; 9AA93A9D1855CCB800378361 /* AJNSNotificationReceiver.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AA937BB1854BD1700378361 /* AJNSNotificationReceiver.h */; }; 9AA93A9E1855CCB800378361 /* AJNSNotificationSender.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AA937BC1854BD1700378361 /* AJNSNotificationSender.h */; }; 9AA93A9F1855CCB800378361 /* AJNSNotificationService.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AA937BD1854BD1700378361 /* AJNSNotificationService.h */; }; 9AA93AA01855CCB800378361 /* AJNSNotificationText.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AA937BE1854BD1700378361 /* AJNSNotificationText.h */; }; 9AA93AA21855CCB800378361 /* AJNSPropertyStore.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AA937C01854BD1700378361 /* AJNSPropertyStore.h */; }; 9AA93AA31855CCB800378361 /* AJNSRichAudioUrl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AA937C11854BD1700378361 /* AJNSRichAudioUrl.h */; }; 9AABD3F318ACFBA50026304D /* AJSCCommonBusListener.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9AABD3F218ACFBA50026304D /* AJSCCommonBusListener.mm */; }; 9AABD3F418ACFBB80026304D /* AJSCCommonBusListener.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9AABD3F118ACFBA50026304D /* AJSCCommonBusListener.h */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 9AA935FF1854BC2B00378361 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9AA935E11854BC2B00378361 /* Project object */; proxyType = 1; remoteGlobalIDString = 9AA935E81854BC2B00378361; remoteInfo = alljoyn_services_objc; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 9AA93A981855CC8E00378361 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = inc/alljoyn/notification; dstSubfolderSpec = 16; files = ( 9AA93A991855CCB800378361 /* AJNSNotificationReceiverAdapter.h in CopyFiles */, 9AA93A9B1855CCB800378361 /* AJNSNotification.h in CopyFiles */, 9AA93A9C1855CCB800378361 /* AJNSNotificationEnums.h in CopyFiles */, 9AA93A9D1855CCB800378361 /* AJNSNotificationReceiver.h in CopyFiles */, 9AA93A9E1855CCB800378361 /* AJNSNotificationSender.h in CopyFiles */, 9AA93A9F1855CCB800378361 /* AJNSNotificationService.h in CopyFiles */, 9AA93AA01855CCB800378361 /* AJNSNotificationText.h in CopyFiles */, 9AA93AA21855CCB800378361 /* AJNSPropertyStore.h in CopyFiles */, 9AA93AA31855CCB800378361 /* AJNSRichAudioUrl.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; 9AA93AA91855CD0F00378361 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = inc/alljoyn/samples_common; dstSubfolderSpec = 16; files = ( 9AABD3F418ACFBB80026304D /* AJSCCommonBusListener.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 9AA935E91854BC2B00378361 /* liballjoyn_notification_objc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liballjoyn_notification_objc.a; sourceTree = BUILT_PRODUCTS_DIR; }; 9AA935EC1854BC2B00378361 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 9AA935F01854BC2B00378361 /* alljoyn_notification_objc-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "alljoyn_notification_objc-Prefix.pch"; sourceTree = ""; }; 9AA935F91854BC2B00378361 /* alljoyn_notification_objcTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = alljoyn_notification_objcTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 9AA935FA1854BC2B00378361 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 9AA935FD1854BC2B00378361 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; 9AA936041854BC2B00378361 /* alljoyn_notification_objcTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "alljoyn_notification_objcTests-Info.plist"; sourceTree = ""; }; 9AA936061854BC2B00378361 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 9AA936081854BC2B00378361 /* alljoyn_services_objcTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = alljoyn_services_objcTests.m; sourceTree = ""; }; 9AA937B71854BD1700378361 /* AJNSNotificationReceiverAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJNSNotificationReceiverAdapter.h; sourceTree = ""; }; 9AA937B91854BD1700378361 /* AJNSNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJNSNotification.h; sourceTree = ""; }; 9AA937BA1854BD1700378361 /* AJNSNotificationEnums.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJNSNotificationEnums.h; sourceTree = ""; }; 9AA937BB1854BD1700378361 /* AJNSNotificationReceiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJNSNotificationReceiver.h; sourceTree = ""; }; 9AA937BC1854BD1700378361 /* AJNSNotificationSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJNSNotificationSender.h; sourceTree = ""; }; 9AA937BD1854BD1700378361 /* AJNSNotificationService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJNSNotificationService.h; sourceTree = ""; }; 9AA937BE1854BD1700378361 /* AJNSNotificationText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJNSNotificationText.h; sourceTree = ""; }; 9AA937C01854BD1700378361 /* AJNSPropertyStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJNSPropertyStore.h; sourceTree = ""; }; 9AA937C11854BD1700378361 /* AJNSRichAudioUrl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJNSRichAudioUrl.h; sourceTree = ""; }; 9AA937F31854BD1700378361 /* AJNSNotificationReceiverAdapter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJNSNotificationReceiverAdapter.mm; sourceTree = ""; }; 9AA937F51854BD1700378361 /* AJNSNotification.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJNSNotification.mm; sourceTree = ""; }; 9AA937F61854BD1700378361 /* AJNSNotificationEnums.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJNSNotificationEnums.mm; sourceTree = ""; }; 9AA937F71854BD1700378361 /* AJNSNotificationSender.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJNSNotificationSender.mm; sourceTree = ""; }; 9AA937F81854BD1700378361 /* AJNSNotificationService.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJNSNotificationService.mm; sourceTree = ""; }; 9AA937F91854BD1700378361 /* AJNSSNotificationText.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJNSSNotificationText.mm; sourceTree = ""; }; 9AA937FB1854BD1700378361 /* AJNSRichAudioUrl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJNSRichAudioUrl.mm; sourceTree = ""; }; 9AABD3F118ACFBA50026304D /* AJSCCommonBusListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJSCCommonBusListener.h; sourceTree = ""; }; 9AABD3F218ACFBA50026304D /* AJSCCommonBusListener.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AJSCCommonBusListener.mm; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 9AA935E61854BC2B00378361 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9AA935ED1854BC2B00378361 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 9AA935F61854BC2B00378361 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9AA935FB1854BC2B00378361 /* XCTest.framework in Frameworks */, 9AA936011854BC2B00378361 /* liballjoyn_notification_objc.a in Frameworks */, 9AA935FE1854BC2B00378361 /* UIKit.framework in Frameworks */, 9AA935FC1854BC2B00378361 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 9AA935E01854BC2B00378361 = { isa = PBXGroup; children = ( 9AABD3F018ACFBA50026304D /* samples_common */, 9AA9376B1854BD1700378361 /* notification */, 9AA935EE1854BC2B00378361 /* alljoyn_services_objc */, 9AA936021854BC2B00378361 /* alljoyn_services_objcTests */, 9AA935EB1854BC2B00378361 /* Frameworks */, 9AA935EA1854BC2B00378361 /* Products */, ); sourceTree = ""; }; 9AA935EA1854BC2B00378361 /* Products */ = { isa = PBXGroup; children = ( 9AA935E91854BC2B00378361 /* liballjoyn_notification_objc.a */, 9AA935F91854BC2B00378361 /* alljoyn_notification_objcTests.xctest */, ); name = Products; sourceTree = ""; }; 9AA935EB1854BC2B00378361 /* Frameworks */ = { isa = PBXGroup; children = ( 9AA935EC1854BC2B00378361 /* Foundation.framework */, 9AA935FA1854BC2B00378361 /* XCTest.framework */, 9AA935FD1854BC2B00378361 /* UIKit.framework */, ); name = Frameworks; sourceTree = ""; }; 9AA935EE1854BC2B00378361 /* alljoyn_services_objc */ = { isa = PBXGroup; children = ( 9AA935EF1854BC2B00378361 /* Supporting Files */, ); path = alljoyn_services_objc; sourceTree = ""; }; 9AA935EF1854BC2B00378361 /* Supporting Files */ = { isa = PBXGroup; children = ( 9AA935F01854BC2B00378361 /* alljoyn_notification_objc-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; 9AA936021854BC2B00378361 /* alljoyn_services_objcTests */ = { isa = PBXGroup; children = ( 9AA936081854BC2B00378361 /* alljoyn_services_objcTests.m */, 9AA936031854BC2B00378361 /* Supporting Files */, ); path = alljoyn_services_objcTests; sourceTree = ""; }; 9AA936031854BC2B00378361 /* Supporting Files */ = { isa = PBXGroup; children = ( 9AA936041854BC2B00378361 /* alljoyn_notification_objcTests-Info.plist */, 9AA936051854BC2B00378361 /* InfoPlist.strings */, ); name = "Supporting Files"; sourceTree = ""; }; 9AA9376B1854BD1700378361 /* notification */ = { isa = PBXGroup; children = ( 9AA937B31854BD1700378361 /* ios */, ); name = notification; path = ../../..; sourceTree = ""; }; 9AA937B31854BD1700378361 /* ios */ = { isa = PBXGroup; children = ( 9AA937B41854BD1700378361 /* inc */, 9AA937F21854BD1700378361 /* src */, ); path = ios; sourceTree = ""; }; 9AA937B41854BD1700378361 /* inc */ = { isa = PBXGroup; children = ( 9AA937B51854BD1700378361 /* alljoyn */, ); path = inc; sourceTree = ""; }; 9AA937B51854BD1700378361 /* alljoyn */ = { isa = PBXGroup; children = ( 9AA937B61854BD1700378361 /* notification */, ); path = alljoyn; sourceTree = ""; }; 9AA937B61854BD1700378361 /* notification */ = { isa = PBXGroup; children = ( 9AA937B71854BD1700378361 /* AJNSNotificationReceiverAdapter.h */, 9AA937B91854BD1700378361 /* AJNSNotification.h */, 9AA937BA1854BD1700378361 /* AJNSNotificationEnums.h */, 9AA937BB1854BD1700378361 /* AJNSNotificationReceiver.h */, 9AA937BC1854BD1700378361 /* AJNSNotificationSender.h */, 9AA937BD1854BD1700378361 /* AJNSNotificationService.h */, 9AA937BE1854BD1700378361 /* AJNSNotificationText.h */, 9AA937C01854BD1700378361 /* AJNSPropertyStore.h */, 9AA937C11854BD1700378361 /* AJNSRichAudioUrl.h */, ); path = notification; sourceTree = ""; }; 9AA937F21854BD1700378361 /* src */ = { isa = PBXGroup; children = ( 9AA937F31854BD1700378361 /* AJNSNotificationReceiverAdapter.mm */, 9AA937F51854BD1700378361 /* AJNSNotification.mm */, 9AA937F61854BD1700378361 /* AJNSNotificationEnums.mm */, 9AA937F71854BD1700378361 /* AJNSNotificationSender.mm */, 9AA937F81854BD1700378361 /* AJNSNotificationService.mm */, 9AA937F91854BD1700378361 /* AJNSSNotificationText.mm */, 9AA937FB1854BD1700378361 /* AJNSRichAudioUrl.mm */, ); path = src; sourceTree = ""; }; 9AABD3F018ACFBA50026304D /* samples_common */ = { isa = PBXGroup; children = ( 9AABD3F118ACFBA50026304D /* AJSCCommonBusListener.h */, 9AABD3F218ACFBA50026304D /* AJSCCommonBusListener.mm */, ); name = samples_common; path = ../../../../sample_apps/ios/samples_common; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 9AA935E81854BC2B00378361 /* alljoyn_notification_objc */ = { isa = PBXNativeTarget; buildConfigurationList = 9AA9360C1854BC2B00378361 /* Build configuration list for PBXNativeTarget "alljoyn_notification_objc" */; buildPhases = ( 9AA935E51854BC2B00378361 /* Sources */, 9AA935E61854BC2B00378361 /* Frameworks */, 9AA93A981855CC8E00378361 /* CopyFiles */, 9AA93AA91855CD0F00378361 /* CopyFiles */, ); buildRules = ( ); dependencies = ( ); name = alljoyn_notification_objc; productName = alljoyn_services_objc; productReference = 9AA935E91854BC2B00378361 /* liballjoyn_notification_objc.a */; productType = "com.apple.product-type.library.static"; }; 9AA935F81854BC2B00378361 /* alljoyn_notification_objcTests */ = { isa = PBXNativeTarget; buildConfigurationList = 9AA9360F1854BC2B00378361 /* Build configuration list for PBXNativeTarget "alljoyn_notification_objcTests" */; buildPhases = ( 9AA935F51854BC2B00378361 /* Sources */, 9AA935F61854BC2B00378361 /* Frameworks */, 9AA935F71854BC2B00378361 /* Resources */, ); buildRules = ( ); dependencies = ( 9AA936001854BC2B00378361 /* PBXTargetDependency */, ); name = alljoyn_notification_objcTests; productName = alljoyn_services_objcTests; productReference = 9AA935F91854BC2B00378361 /* alljoyn_notification_objcTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 9AA935E11854BC2B00378361 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = AllJoyn; }; buildConfigurationList = 9AA935E41854BC2B00378361 /* Build configuration list for PBXProject "alljoyn_notification_objc" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 9AA935E01854BC2B00378361; productRefGroup = 9AA935EA1854BC2B00378361 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 9AA935E81854BC2B00378361 /* alljoyn_notification_objc */, 9AA935F81854BC2B00378361 /* alljoyn_notification_objcTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 9AA935F71854BC2B00378361 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 9AA936071854BC2B00378361 /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 9AA935E51854BC2B00378361 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 9AA939491854BD1800378361 /* AJNSNotificationReceiverAdapter.mm in Sources */, 9AA939511854BD1800378361 /* AJNSRichAudioUrl.mm in Sources */, 9AABD3F318ACFBA50026304D /* AJSCCommonBusListener.mm in Sources */, 9AA9394B1854BD1800378361 /* AJNSNotification.mm in Sources */, 9AA9394D1854BD1800378361 /* AJNSNotificationSender.mm in Sources */, 9AA9394F1854BD1800378361 /* AJNSSNotificationText.mm in Sources */, 9AA9394C1854BD1800378361 /* AJNSNotificationEnums.mm in Sources */, 9AA9394E1854BD1800378361 /* AJNSNotificationService.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 9AA935F51854BC2B00378361 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 9AA936091854BC2B00378361 /* alljoyn_services_objcTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 9AA936001854BC2B00378361 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9AA935E81854BC2B00378361 /* alljoyn_notification_objc */; targetProxy = 9AA935FF1854BC2B00378361 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 9AA936051854BC2B00378361 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 9AA936061854BC2B00378361 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 9AA9360A1854BC2B00378361 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; name = Debug; }; 9AA9360B1854BC2B00378361 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.0; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; name = Release; }; 9AA9360D1854BC2B00378361 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; DSTROOT = /tmp/alljoyn_services_objc.dst; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_objc/alljoyn_notification_objc-Prefix.pch"; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/notification/cpp/inc/alljoyn/notification/\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/notification/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/ios/inc\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", "-DUSE_SAMPLE_LOGGER", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = alljoyn_notification_objc; SKIP_INSTALL = YES; }; name = Debug; }; 9AA9360E1854BC2B00378361 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; DSTROOT = /tmp/alljoyn_services_objc.dst; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_objc/alljoyn_notification_objc-Prefix.pch"; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/notification/cpp/inc/alljoyn/notification/\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/notification/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/cpp/inc\"", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/services_common/ios/inc\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", "-DUSE_SAMPLE_LOGGER", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = alljoyn_notification_objc; SKIP_INSTALL = YES; }; name = Release; }; 9AA936101854BC2B00378361 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_objc/alljoyn_services_objc-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"/**", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"/**", "\"$(ALLSEEN_BASE_SERVICES_ROOT)\"/**", "\"$(SRCROOT)/../../../../../common/inc\"", "\"$(SRCROOT)/../../../../../alljoyn_objc/AllJoynFramework/AllJoynFramework\"", "\"$(SRCROOT)/../../../../../applications\"/**", "\"$(ALLSEEN_BASE_SERVICES_ROOT)/notification/cpp/inc/alljoyn/notification/", ); INFOPLIST_FILE = "alljoyn_services_objcTests/alljoyn_notification_objcTests-Info.plist"; PRODUCT_NAME = alljoyn_notification_objcTests; WRAPPER_EXTENSION = xctest; }; name = Debug; }; 9AA936111854BC2B00378361 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "alljoyn_services_objc/alljoyn_services_objc-Prefix.pch"; HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(SRCROOT)/../../../../../build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"/**", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(SRCROOT)/../../../../../build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"/**", "\"$(ALLSEEN_BASE_SERVICES_ROOT)\"/**", "\"$(SRCROOT)/../../../../../common/inc\"", "\"$(SRCROOT)/../../../../../alljoyn_objc/AllJoynFramework/AllJoynFramework\"", "\"$(SRCROOT)/../../../../../applications\"/**", ); INFOPLIST_FILE = "alljoyn_services_objcTests/alljoyn_notification_objcTests-Info.plist"; PRODUCT_NAME = alljoyn_notification_objcTests; WRAPPER_EXTENSION = xctest; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 9AA935E41854BC2B00378361 /* Build configuration list for PBXProject "alljoyn_notification_objc" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AA9360A1854BC2B00378361 /* Debug */, 9AA9360B1854BC2B00378361 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 9AA9360C1854BC2B00378361 /* Build configuration list for PBXNativeTarget "alljoyn_notification_objc" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AA9360D1854BC2B00378361 /* Debug */, 9AA9360E1854BC2B00378361 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 9AA9360F1854BC2B00378361 /* Build configuration list for PBXNativeTarget "alljoyn_notification_objcTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 9AA936101854BC2B00378361 /* Debug */, 9AA936111854BC2B00378361 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 9AA935E11854BC2B00378361 /* Project object */; } base-15.09/notification/ios/samples/alljoyn_services_objc/alljoyn_services_objc/000077500000000000000000000000001262264444500303175ustar00rootroot00000000000000alljoyn_notification_objc-Prefix.pch000066400000000000000000000020151262264444500374000ustar00rootroot00000000000000base-15.09/notification/ios/samples/alljoyn_services_objc/alljoyn_services_objc/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifdef __OBJC__ #import #endif base-15.09/notification/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests/000077500000000000000000000000001262264444500313425ustar00rootroot00000000000000alljoyn_notification_objcTests-Info.plist000066400000000000000000000032731262264444500414740ustar00rootroot00000000000000base-15.09/notification/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier org.alljoyn.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType BNDL CFBundleShortVersionString 00.01 CFBundleSignature ???? CFBundleVersion 1 alljoyn_services_objcTests.m000066400000000000000000000027321262264444500370400ustar00rootroot00000000000000base-15.09/notification/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import @interface alljoyn_services_objcTests : XCTestCase @end @implementation alljoyn_services_objcTests - (void)setUp { [super setUp]; // Put setup code here. This method is called before the invocation of each test method in the class. } - (void)tearDown { // Put teardown code here. This method is called after the invocation of each test method in the class. [super tearDown]; } - (void)testExample { XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); } @end base-15.09/notification/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests/en.lproj/000077500000000000000000000000001262264444500330715ustar00rootroot00000000000000InfoPlist.strings000066400000000000000000000000551262264444500363340ustar00rootroot00000000000000base-15.09/notification/ios/samples/alljoyn_services_objc/alljoyn_services_objcTests/en.lproj/* Localized versions of Info.plist keys */ base-15.09/notification/ios/src/000077500000000000000000000000001262264444500165225ustar00rootroot00000000000000base-15.09/notification/ios/src/AJNSNotification.mm000066400000000000000000000352251262264444500221660ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJNSNotification.h" #import "alljoyn/about/AJNConvertUtil.h" @interface AJNSNotification () /** notificationHandler */ @property (nonatomic) ajn::services::Notification *handle; @end @implementation AJNSNotification - (id)initWithHandle:(const ajn::services::Notification *)handle { self = [super init]; if (self) { self.handle = (ajn::services::Notification *)handle; } return self; } /** * Constructor for Notification * @param messageId * @param messageType * @param deviceId * @param deviceName * @param appId * @param appName * @param sender * @param customAttributes * @param notificationText * @param richIconUrl * @param richAudioUrl * @param richIconObjectPath * @param richAudioObjectPath * @param controlPanelServiceObjectPath */ - (AJNSNotification *)initWithMessageId:(int32_t)messageId messageType:(AJNSNotificationMessageType)messageType deviceId:(NSString *)deviceId deviceName:(NSString *)deviceName appId:(NSString *)appId appName:(NSString *)appName sender:(NSString *)sender customAttributes:(NSMutableDictionary *)customAttributes notificationText:(NSMutableArray *)notificationText richIconUrl:(NSString *)richIconUrl richAudioUrl:(NSMutableArray *)richAudioUrl richIconObjectPath:(NSString *)richIconObjectPath richAudioObjectPath:(NSString *)richAudioObjectPath controlPanelServiceObjectPath:(NSString *)controlPanelServiceObjectPath { self = [super init]; if (self) { self.handle = new ajn::services::Notification::Notification(messageId, [self convertAJNSNMessageType:messageType], [AJNConvertUtil convertNSStringToConstChar:deviceId], [AJNConvertUtil convertNSStringToConstChar:deviceName], [AJNConvertUtil convertNSStringToConstChar:appId], [AJNConvertUtil convertNSStringToConstChar:appName], [AJNConvertUtil convertNSStringToConstChar:sender], [self convertAJNSCustomAttributes:customAttributes], [self convertAJNSNotificationText:notificationText], [AJNConvertUtil convertNSStringToConstChar:richIconUrl], [self convertAJNSRichAudioUrl:richAudioUrl], [AJNConvertUtil convertNSStringToConstChar:richIconObjectPath], [AJNConvertUtil convertNSStringToConstChar:richAudioObjectPath], [AJNConvertUtil convertNSStringToConstChar:controlPanelServiceObjectPath], NULL); } return self; } /** * Construct for Notification * @param messageType * @param notificationText */ - (AJNSNotification *)initWithMessageType:(AJNSNotificationMessageType)messageType andNotificationText:(NSMutableArray *)notificationText { //covert parameters from obj-c to cpp NSMutableDictionary *tmpCustomAttributesDictionary = [[NSMutableDictionary alloc] init]; NSMutableArray *tmpRichAudioUrlArr = [[NSMutableArray alloc] init]; self = [self initWithMessageId:-1 messageType:messageType deviceId:@"" deviceName:@"" appId:@"" appName:@"" sender:@"" customAttributes:tmpCustomAttributesDictionary notificationText:notificationText richIconUrl:@"" richAudioUrl:tmpRichAudioUrlArr richIconObjectPath:@"" richAudioObjectPath:@"" controlPanelServiceObjectPath:@""]; return self; } //Retreival methods /** * Get the Version * @return version */ - (int16_t)version { return (self.handle->getVersion()); } /** * Get the device Id * @return deviceId */ - (NSString *)deviceId { return self.handle->getDeviceId() ? ([AJNConvertUtil convertConstCharToNSString:(self.handle->getDeviceId())]) : nil; } /** * Get the Device Name * @return deviceName */ - (NSString *)deviceName { return self.handle->getDeviceName() ? ([AJNConvertUtil convertConstCharToNSString:(self.handle->getDeviceName())]) : nil; } /** * Get the app Id * @return appId */ - (NSString *)appId { return self.handle->getAppId() ? ([AJNConvertUtil convertConstCharToNSString:self.handle->getAppId()]) : nil; } /** * Get the app Name * @return appName */ - (NSString *)appName { return [AJNConvertUtil convertConstCharToNSString:self.handle->getAppName()]; } /** * Get the map of customAttributes @return customAttributes */ - (NSMutableDictionary *)customAttributes { std::map customAttributesMap; std::map ::iterator cIt; NSMutableDictionary *customAttributesDictionary = [[NSMutableDictionary alloc] init]; //call cpp getCustomAttributes(returns map) //returns const std::map customAttributesMap = self.handle->getCustomAttributes(); //translate cpp returned value to obj-c (map to dictionary) for (cIt = customAttributesMap.begin(); cIt != customAttributesMap.end(); ++cIt) { //insert key/value into the dictionary [customAttributesDictionary setValue:[AJNConvertUtil convertQCCStringtoNSString:cIt->second] forKey:[AJNConvertUtil convertQCCStringtoNSString:cIt->first]]; } return customAttributesDictionary; } /** * Get the Message Id * @return notificationId */ - (int32_t)messageId { return self.handle->getMessageId(); } /** * Get the Sender * @return Sender */ - (NSString *)senderBusName { return self.handle->getSenderBusName() ? [AJNConvertUtil convertConstCharToNSString:self.handle->getSenderBusName()] : nil; } /** * Get the MessageType * @return MessageType */ - (AJNSNotificationMessageType)messageType { return (AJNSNotificationMessageType)(self.handle->getMessageType()); } /** * Get the Notification Text * @return notificationText */ - (NSArray *)text { return self.ajnsntArr; } /** * Get the Rich Icon Url * @return RichIconUrl */ - (NSString *)richIconUrl { return self.handle->getRichIconUrl() ? [AJNConvertUtil convertConstCharToNSString:self.handle->getRichIconUrl()] : nil; } /** * Get the Rich Icon Object Path * @return richIconObjectPath */ - (NSString *)richIconObjectPath { return self.handle->getRichIconUrl() ? [AJNConvertUtil convertConstCharToNSString:self.handle->getRichIconObjectPath()] : nil; } /** * Get the Rich Audio Object Path * @return richAudioObjectPath */ - (NSString *)richAudioObjectPath { return self.handle->getRichIconUrl() ? [AJNConvertUtil convertConstCharToNSString:self.handle->getRichAudioObjectPath()] : nil; } /** * Get the Rich Audio Urls * @return RichAudioUrl - NSMutableArray of AJNSRichAudioUrl objects */ - (void)richAudioUrl:(NSMutableArray *)inputArray { std::vector nRichAudioUrlVect; //call cpp getRichAudioUrl (returns std::vector) nRichAudioUrlVect = self.handle->getRichAudioUrl(); //for ( size_t &i : nRichAudioUrl ) for (size_t i = 0; i < nRichAudioUrlVect.size(); i++) { AJNSRichAudioUrl *ajnsRau = [[AJNSRichAudioUrl alloc] init]; ajnsRau.richAudioUrlHandler = &nRichAudioUrlVect.at(i); [inputArray addObject : (ajnsRau)]; } } /** * Get the ControlPanelService object path * @return ControlPanelServiceObjectPath */ - (NSString *)controlPanelServiceObjectPath { return self.handle->getControlPanelServiceObjectPath() ? [AJNConvertUtil convertConstCharToNSString:self.handle->getControlPanelServiceObjectPath()] : nil; } //Methods which set information /** * Set the App Id of the Notification * @param appId */ - (void)setAppId:(NSString *)appId { self.handle->setAppId([AJNConvertUtil convertNSStringToConstChar:appId]); } /** * Set the App Name of the Notification * @param appName */ - (void)setAppName:(NSString *)appName { self.handle->setAppName([AJNConvertUtil convertNSStringToConstChar:appName]); } /** * Set the Control Panel Service Object Path of the Notification * @param controlPanelServiceObjectPath */ - (void)setControlPanelServiceObjectPath:(NSString *)controlPanelServiceObjectPath { self.handle->setControlPanelServiceObjectPath([AJNConvertUtil convertNSStringToConstChar:controlPanelServiceObjectPath]); } /** * Set the Custom Attributed of the Notification * @param customAttributes */ - (void)setCustomAttributes:(NSMutableDictionary *)customAttributes { self.handle->setCustomAttributes([self convertAJNSCustomAttributes:customAttributes]); } /** * Set the deviceId of the Notification * @param deviceId */ - (void)setDeviceId:(NSString *)deviceId { self.handle->setDeviceId([AJNConvertUtil convertNSStringToConstChar:deviceId]); } /** * Set the deviceName of the Notification * @param deviceName */ - (void)setDeviceName:(NSString *)deviceName { self.handle->setDeviceName([AJNConvertUtil convertNSStringToConstChar:deviceName]); } /** * Set the messageId of the Notification * @param messageId */ - (void)setMessageId:(int32_t)messageId { self.handle->setMessageId(messageId); } /** * Set the richAudioUrl of the Notification * @param richAudioUrl */ - (void)setRichAudioUrl:(NSMutableArray *)richAudioUrl { self.handle->setRichAudioUrl([self convertAJNSRichAudioUrl:richAudioUrl]); } /** * Set the richIconUrl of the Notification * @param richIconUrl */ - (void)setRichIconUrl:(NSString *)richIconUrl { self.handle->setRichIconUrl([AJNConvertUtil convertNSStringToConstChar:richIconUrl]); } /** * Set the richIconObjectPath of the Notification * @param richIconObjectPath */ - (void)setRichIconObjectPath:(NSString *)richIconObjectPath { self.handle->setRichIconObjectPath([AJNConvertUtil convertNSStringToConstChar:richIconObjectPath]); } /** * Set the richAudioObjectPath of the Notification * @param richAudioObjectPath */ - (void)setRichAudioObjectPath:(NSString *)richAudioObjectPath { self.handle->setRichAudioObjectPath([AJNConvertUtil convertNSStringToConstChar:richAudioObjectPath]); } /** * Set the sender of the Notification * @param sender */ - (void)setSender:(NSString *)sender { self.handle->setSender([AJNConvertUtil convertNSStringToConstChar:sender]); } /** * Convert AJNSNMessageType to NotificationMessageType * @param ajnsnMessageType */ - (ajn::services::NotificationMessageType)convertAJNSNMessageType:(AJNSNotificationMessageType)ajnsnMessageType { return (ajn::services::NotificationMessageType)ajnsnMessageType; } /** * Convert AJNSCustomAttributes NSMutableDictionary to CustomAttributes std::map * @param ajnsCustomAttributes */ - (std::map )convertAJNSCustomAttributes:(NSMutableDictionary *)ajnsCustomAttributes { std::map nmap; NSEnumerator *enumerator = [ajnsCustomAttributes keyEnumerator]; //use NSFastEnumeration? id key; while ((key = [enumerator nextObject])) { /* put key and value in the map */ // nmap.insert(std::make_pair([key UTF8String],[[ajnsCustomAttributes objectForKey:(key)] UTF8String])); nmap.insert(std::make_pair([key cStringUsingEncoding:NSUTF8StringEncoding], [[ajnsCustomAttributes objectForKey:key] cStringUsingEncoding:NSUTF8StringEncoding])); } return nmap; } /** * Convert AJNSNotificationText NSMutableArray to NotificationText std::vector * @param ajnsnTextArr */ - (std::vector )convertAJNSNotificationText:(NSMutableArray *)ajnsnTextArr { std::vector nNotificationTextVect; //for ( auto &i : ajnsnTextArr ) for (AJNSNotificationText *t_AJNSNotificationText in ajnsnTextArr) { nNotificationTextVect.push_back(*(t_AJNSNotificationText.handle)); } return nNotificationTextVect; } /** * Convert AJNSRichAudioUrl NSMutableArray to RichAudioUrl std::vector * @param ajnsRichAudioUrlArr */ - (std::vector )convertAJNSRichAudioUrl:(NSMutableArray *)ajnsRichAudioUrlArr { std::vector nRichAudioUrlVect; //convert ajnsRichAudioUrlArr(NSString)to AJNSRichAudioUrl object for (AJNSRichAudioUrl *t_AJNSRichAudioUrl in ajnsRichAudioUrlArr) { nRichAudioUrlVect.push_back(*(t_AJNSRichAudioUrl.richAudioUrlHandler)); } return nRichAudioUrlVect; } - (void)createAJNSNotificationTextArray { self.ajnsntArr = [[NSMutableArray alloc] init]; std::vector ntVect; //cpp vector ntVect = self.handle->getText(); for (size_t i = 0; i < ntVect.size(); i++) { // ajnsNt.notificationTextHandler = &(ntVect.at(i)); //cpp //get lang and text from the object at i qcc::String cppl = ntVect.at(i).getLanguage(); NSString *ocl = [AJNConvertUtil convertQCCStringtoNSString:cppl]; qcc::String cppt = ntVect.at(i).getText(); NSString *oct = [AJNConvertUtil convertQCCStringtoNSString:cppt]; AJNSNotificationText *ajnsNt = [[AJNSNotificationText alloc] initWithLang:ocl andText:oct]; [self.ajnsntArr addObject:ajnsNt]; } } -(QStatus) dismiss { return self.handle->dismiss(); } @end base-15.09/notification/ios/src/AJNSNotificationEnums.mm000066400000000000000000000025231262264444500231710ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJNSNotificationEnums.h" @implementation AJNSNotificationEnums + (NSString *)AJNSMessageTypeToString:(AJNSNotificationMessageType)msgType { switch (msgType) { case 0: return @"EMERGENCY"; break; case 1: return @"WARNING"; break; case 2: return @"INFO"; break; default: return @"UNSET"; break; } } @end base-15.09/notification/ios/src/AJNSNotificationReceiverAdapter.mm000066400000000000000000000036541262264444500251550ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJNSNotificationReceiverAdapter.h" #import "AJNSNotificationReceiver.h" #import "alljoyn/about/AJNConvertUtil.h" AJNSNotificationReceiverAdapter::AJNSNotificationReceiverAdapter(id notificationReceiverHandler) { ajnsNotificationReceiverHandler = notificationReceiverHandler; } void AJNSNotificationReceiverAdapter::Receive(ajn::services::Notification const& notification) { AJNSNotification *t_ajnsNotification = [[AJNSNotification alloc] initWithHandle:(new ajn::services::Notification(notification))]; [t_ajnsNotification createAJNSNotificationTextArray]; [ajnsNotificationReceiverHandler receive:t_ajnsNotification]; } void AJNSNotificationReceiverAdapter::Dismiss(const int32_t msgId, const qcc::String appId) { NSLog(@"Got Dissmiss of msgId %d and appId %@",msgId, [AJNConvertUtil convertQCCStringtoNSString:appId]); [ajnsNotificationReceiverHandler dismissMsgId:msgId appId:[AJNConvertUtil convertQCCStringtoNSString:appId]]; }base-15.09/notification/ios/src/AJNSNotificationSender.mm000066400000000000000000000041451262264444500233240ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJNSNotificationSender.h" @interface AJNSNotificationSender () @property (nonatomic) ajn::services::AboutPropertyStoreImpl *propertyStore; @end @implementation AJNSNotificationSender - (AJNSNotificationSender *)initWithPropertyStore:(AJNAboutPropertyStoreImpl *)propertyStore { self = [super init]; if (self) { self.propertyStore = [propertyStore getHandle]; if (self.propertyStore) { self.senderHandle = new ajn::services::NotificationSender(self.propertyStore); return self; } } return nil; } /** * Send notification * @param notification * @param ttl message ttl * @return status */ - (QStatus)send:(AJNSNotification *)ajnsNotification ttl:(uint16_t)ttl { return (self.senderHandle->send(*ajnsNotification.handle, ttl)); } /** * Delete last message that was sent with given MessageType * @param messageType MessageType of message to be deleted * @return status */ - (QStatus)deleteLastMsg:(AJNSNotificationMessageType)messageType { return(self.senderHandle->deleteLastMsg((ajn::services::NotificationMessageType)messageType)); } - (ajn::services::AboutPropertyStoreImpl *)getPropertyStore { return self.propertyStore; } @end base-15.09/notification/ios/src/AJNSNotificationService.mm000066400000000000000000000122511262264444500235010ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJNSNotificationService.h" #import "alljoyn/services_common/AJSVCGenericLogger.h" #import "alljoyn/services_common/AJSVCGenericLoggerDefaultImpl.h" @interface AJNSNotificationService () @property AJSVCGenericLoggerAdapter *genericLoggerAdapter; @property id currentLogger; @property (strong, nonatomic) AJNSNotificationSender *ajnsSender; //@property QLogLevel currentLogLevel; @end @implementation AJNSNotificationService /** * Get Instance of NotificationServiceImpl - singleton implementation * @return instance */ + (id)sharedInstance { static AJNSNotificationService *ajnsNotificationService; static dispatch_once_t donce; dispatch_once(&donce, ^{ ajnsNotificationService = [[self alloc] init]; }); return ajnsNotificationService; } - (id)init { if (self = [super init]) { } return self; } /** * Initialize Producer side via Transport. Create and * return NotificationSender. * @param bus * @param store * @return NotificationSender instance */ - (AJNSNotificationSender *)startSendWithBus:(AJNBusAttachment *)bus andPropertyStore:(AJNAboutPropertyStoreImpl *)store { self.ajnsSender = [[AJNSNotificationSender alloc] initWithPropertyStore:store]; //NotificationSender* NotificationService::initSend(BusAttachment* bus, PropertyStore* store) if (self.ajnsSender) { self.ajnsSender.senderHandle = ajn::services::NotificationService::getInstance()->initSend((ajn::BusAttachment *)bus.handle, [self.ajnsSender getPropertyStore]); } return self.ajnsSender.senderHandle ? self.ajnsSender : nil; } /** * Initialize Consumer side via Transport. * Set NotificationReceiver to given receiver * @param bus * @param notificationReceiver * @return status */ - (QStatus)startReceive:(AJNBusAttachment *)bus withReceiver:(id )ajnsNotificationReceiver { if (!bus) { return ER_BAD_ARG_1; } if (!ajnsNotificationReceiver) { return ER_BAD_ARG_2; } AJNSNotificationReceiverAdapter *notificationReceiverAdapter = new AJNSNotificationReceiverAdapter(ajnsNotificationReceiver); if (!notificationReceiverAdapter) { if (self.logger) [self.logger warnTag:[NSString stringWithFormat:@"%@", [[self class] description]] text:@"Failed to create adapter."]; return ER_FAIL; } return (ajn::services::NotificationService::getInstance()->initReceive((ajn::BusAttachment *)bus.handle, notificationReceiverAdapter)); } /** * Stops sender but leaves bus and other objects alive */ - (void)shutdownSender { ajn::services::NotificationService::getInstance()->shutdownSender(); } /** * Stops receiving but leaves bus and other objects alive */ - (void)shutdownReceiver { ajn::services::NotificationService::getInstance()->shutdownReceiver(); } /** * Cleanup and get ready for shutdown */ - (void)shutdown { ajn::services::NotificationService::getInstance()->shutdown(); } /** @deprecated SuperAgent was deprecated in May 2015 for 15.04 * release * Disabling superagent mode. * Needs to be called before * starting receiver * @return status */ - (QStatus)disableSuperAgent { return ER_OK; } #pragma mark *** Logger methods *** /** * Get the currently-configured logger implementation * @return logger Implementation of GenericLogger */ - (id )logger { return self.currentLogger; } /** * Set log level filter for subsequent logging messages * @param newLogLevel enum value * @return logLevel enum value that was in effect prior to this change */ - (void)setLogLevel:(QLogLevel)newLogLevel; { [self.currentLogger setLogLevel:newLogLevel]; } /** * Get log level filter value currently in effect * @return logLevel enum value currently in effect */ - (QLogLevel)logLevel; { return [self.currentLogger logLevel]; } #pragma mark *** *** /** * Virtual method to get the busAttachment used in the service. */ - (AJNBusAttachment *)busAttachment { AJNBusAttachment *ajnBusAttachment; ajnBusAttachment = [[AJNBusAttachment alloc] initWithHandle:ajn::services::NotificationService::getInstance()->getBusAttachment()]; return ajnBusAttachment; } /** * Get the Version of the NotificationService * @return the NotificationService version */ - (uint16_t)version { return ajn::services::NotificationService::getInstance()->getVersion(); } @end base-15.09/notification/ios/src/AJNSRichAudioUrl.mm000066400000000000000000000042371262264444500220710ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJNSRichAudioUrl.h" #import "alljoyn/about/AJNConvertUtil.h" @implementation AJNSRichAudioUrl /** * Constructor for RichAudioUrl * @param language Language of Audio Content * @param text Text of Audio Content */ - (AJNSRichAudioUrl *)initRichAudioUrlWithLang:(NSString *)language andUrl:(NSString *)url { self = [super init]; if (self) { self.richAudioUrlHandler = new ajn::services::RichAudioUrl([AJNConvertUtil convertNSStringToQCCString:language], [AJNConvertUtil convertNSStringToQCCString:(url)]); } return self; } - (void)setRichAudioUrlHandler:(ajn::services::RichAudioUrl *)richAudioUrlHandler { _richAudioUrlHandler = richAudioUrlHandler; _language = [AJNConvertUtil convertQCCStringtoNSString:richAudioUrlHandler->getLanguage()]; _url = [AJNConvertUtil convertQCCStringtoNSString:richAudioUrlHandler->getUrl()]; } /** * Set Language for Audio Content * @param language */ - (void)setLanguage:(NSString *)language { self.richAudioUrlHandler->setLanguage([AJNConvertUtil convertNSStringToQCCString:language]); } /** * Set URL for Audio Content * @param url */ - (void)setUrl:(NSString *)url { self.richAudioUrlHandler->setUrl([AJNConvertUtil convertNSStringToQCCString:url]); } @end base-15.09/notification/ios/src/AJNSSNotificationText.mm000066400000000000000000000042641262264444500231550ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJNSNotificationText.h" #import "alljoyn/about/AJNConvertUtil.h" @interface AJNSNotificationText () /** cpp notificationText Handler*/ @property (nonatomic) ajn::services::NotificationText *handle; @end @implementation AJNSNotificationText - (AJNSNotificationText *)initWithLang:(NSString *)language andText:(NSString *)text { self = [super init]; if (self) { self.handle = new ajn::services::NotificationText([AJNConvertUtil convertNSStringToQCCString:language], [AJNConvertUtil convertNSStringToQCCString:text]); } return self; } /** * Set Language for Notification * @param language */ - (void)setLanguage:(NSString *)language { self.handle->setLanguage([AJNConvertUtil convertNSStringToQCCString:language]); } /** * Get Language for Notification * @return language */ - (NSString *)getLanguage { return [AJNConvertUtil convertQCCStringtoNSString:self.handle->getLanguage()]; } /** * Set Text for Notification * @param text the text to set */ - (void)setText:(NSString *)text { self.handle->setText([AJNConvertUtil convertNSStringToQCCString:text]); } /** * Get Text for Notification * @return text */ - (NSString *)getText { return [AJNConvertUtil convertQCCStringtoNSString:(self.handle->getText())]; } @end base-15.09/notification/java/000077500000000000000000000000001262264444500160625ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/000077500000000000000000000000001262264444500220315ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/.classpath000066400000000000000000000011101262264444500240050ustar00rootroot00000000000000 base-15.09/notification/java/NotificationService/.project000066400000000000000000000005721262264444500235040ustar00rootroot00000000000000 NotificationService org.eclipse.jdt.core.javabuilder org.eclipse.jdt.core.javanature base-15.09/notification/java/NotificationService/.settings/000077500000000000000000000000001262264444500237475ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000011511262264444500307270ustar00rootroot00000000000000#Thu Feb 07 08:47:42 IST 2013 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.6 base-15.09/notification/java/NotificationService/build.xml000066400000000000000000000047441262264444500236630ustar00rootroot00000000000000 base-15.09/notification/java/NotificationService/src/000077500000000000000000000000001262264444500226205ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/000077500000000000000000000000001262264444500234075ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/000077500000000000000000000000001262264444500250575ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/000077500000000000000000000000001262264444500254775ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/Notification.java000066400000000000000000000243171262264444500307770ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns; import java.util.List; import java.util.Map; import java.util.UUID; import org.alljoyn.ns.transport.consumer.NotificationFeedback; /** * The Notification that is sent over the network */ public class Notification { /** * version */ private int version; /** * Notification message Id */ private int messageId; /** * Notification message type */ private NotificationMessageType messageType; /** * App name */ private String appName; /** * App Id */ private UUID appId; /** * Device name */ private String deviceName; /** * Device Id */ private String deviceId; /** * Sender Id - name of the bus that the {@link Notification} was received from */ private String sender; /** * The sender Id of the Bus that originally sent the {@link Notification} message. * If the {@link Notification} was received from a Super Agent, the sender field of the object is of the Super Agent, * and this field is the value of the {@link Notification} producer that has originally sent the message. */ private String origSender; /** * Map of customized array variable */ private Map customAttributes; /** * list of NotificationText objects */ private List text; /** * Rich notification icon URL */ private String richIconUrl; /** * Rich notification audio url */ private List richAudioUrl; /** * Rich notification icon object path */ private String richIconObjPath; /** * Rich notification audio object path */ private String richAudioObjPath; /** * Control Panel Service object path */ private String responseObjectPath; /** * Constructor * @param messageType The type of the sent or received Notification * @param text The list of text messages to be sent or received */ public Notification(NotificationMessageType messageType, List text) throws NotificationServiceException { setMessageType(messageType); setText(text); }//Notification /** * @return The protocol version */ public int getVersion() { return version; } /** * @return Notification message type */ public NotificationMessageType getMessageType() { return messageType; } /** * @return Returns the application name */ public String getAppName() { return appName; } /** * @return The application identifier */ public UUID getAppId() { return appId; } /** * The device name that has sent the {@link Notification} */ public String getDeviceName() { return deviceName; } /** * The device id that has sent the {@link Notification} */ public String getDeviceId() { return deviceId; } /** * Sender Id - name of the bus that the {@link Notification} was received from */ public String getSenderBusName() { return sender; } /** * The sender Id of the Bus that originally sent the {@link Notification} message. * If the {@link Notification} was received from a Super Agent, the sender field of the object is of the Super Agent, * and this field is the value of the {@link Notification} producer that has originally sent the message. * @return Bus name of the original {@link Notification} sender */ public String getOriginalSenderBusName() { return origSender; } /** * Map of customized array variable */ public Map getCustomAttributes() { return customAttributes; } /** * List of {@link NotificationText} objects */ public List getText() { return text; } /** * {@link Notification} message id */ public int getMessageId() { return messageId; } /** * @see org.alljoyn.ns.Notification#getRichIconUrl() */ public String getRichIconUrl() { return richIconUrl; } /** * Rich notification icon URL */ public List getRichAudioUrl() { return richAudioUrl; } /** * Rich notification icon object path */ public String getRichIconObjPath() { return richIconObjPath; } /** * Rich notification audio object path */ public String getRichAudioObjPath() { return richAudioObjPath; } /** * The object identifier to be used to invoke methods of the sender. * Usually used for Notification with action. */ public String getResponseObjectPath() { return responseObjectPath; } /** * Set notification message type * @param messageType * @throws NotificationServiceException Is thrown if the message type is NULL */ public void setMessageType(NotificationMessageType messageType) throws NotificationServiceException { if ( messageType == null ) { throw new NotificationServiceException("MessageType must be set"); } this.messageType = messageType; }//setMessageType /** * Set customAttributes map * @param customAttributes */ public void setCustomAttributes(Map customAttributes) { this.customAttributes = customAttributes; } /** * Set list of NotificationText * @param text Is thrown if the text is NULL or is empty */ public void setText(List text) throws NotificationServiceException { if ( text == null || text.size() == 0 ) { throw new NotificationServiceException("The text argument must be set and may not be an empty list"); } this.text = text; }//setText /** * Set the icon url for displaying rich content * @param richIconUrl */ public void setRichIconUrl(String richIconUrl) { this.richIconUrl = richIconUrl; } /** * Set audio url to send rich content * @param richAudioUrl - A list of url per language */ public void setRichAudioUrl(List richAudioUrl) { this.richAudioUrl = richAudioUrl; } /** * Set the icon Object Path for displaying rich content * @param richIconObjPath */ public void setRichIconObjPath(String richIconObjPath) { this.richIconObjPath = richIconObjPath; } /** * Set audio Object Path to send rich content * @param richAudioObjPath - An object path for the rich audio object */ public void setRichAudioObjPath(String richAudioObjPath) { this.richAudioObjPath = richAudioObjPath; } /** * Set Control Panel Service Object Path * @param responseObjectPath */ public void setResponseObjectPath(String responseObjectPath) { this.responseObjectPath = responseObjectPath; } //=======================================// /** * When the notification message is dismissed, it is first of all deleted by the Notification Producer * and then a dismiss signal is sent to update other Notification Consumers that the {@link Notification} * has been dismissed */ public void dismiss() { try { new NotificationFeedback(this).dismiss(); } catch (NotificationServiceException nse) { System.out.println("Failed to call the dismiss method, Error: '" + nse.getMessage() + "'"); } }//dismiss /** * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder("Notification: "); sb.append("Id: '").append(messageId).append("'") .append(", MsgType: '").append(messageType).append("'") .append(", DeviceId: '").append(deviceId).append("'") .append(", DeviceName: '").append(deviceName).append("'") .append(", Version: '").append(version).append("'") .append(", Sender: '").append(sender).append("'") .append(", OrigSender: '").append(origSender).append("'") .append(", AppId: '").append(appId).append("'") .append(", AppName: '").append(appName).append("'") .append(", CustomAttributes: '").append(customAttributes).append("'") .append(", TextMessage: '").append(text).append("'"); if ( richIconUrl != null && richIconUrl.length() > 0 ) { sb.append(", RichIconURL: '").append(richIconUrl).append("'"); } if ( richIconObjPath != null && richIconObjPath.length() > 0 ) { sb.append(", RichIconObjPath: '").append(richIconObjPath).append("'"); } if ( richAudioUrl != null && richAudioUrl.size() > 0 ) { sb.append(", RichAudioUrl: '").append(richAudioUrl).append("'"); } if ( richAudioObjPath != null && richAudioObjPath.length() > 0 ) { sb.append(", RichAudioObjPath: '").append(richAudioObjPath).append("'"); } if ( responseObjectPath != null && responseObjectPath.length() > 0 ) { sb.append(", ResponseObjPath: '").append(responseObjectPath).append("'"); } return sb.toString(); }//toString //=======================================// /** * Set message signature version * @param version */ void setVersion(int version) { this.version = version; } /** * Set message Id * @param messageId */ void setMessageId(int messageId) { this.messageId = messageId; } /** * Set app name * @param appName */ void setAppName(String appName) { this.appName = appName; } /** * Set app Id * @param appId */ void setAppId(UUID appId) { this.appId = appId; } /** * Set device name * @param appName */ void setDeviceName(String deviceName) { this.deviceName = deviceName; } /** * Set device Id * @param deviceId */ void setDeviceId(String deviceId) { this.deviceId = deviceId; } /** * Set sender Id * @param sender */ void setSender(String sender) { this.sender = sender; } /** * Set the original sender name * @param origSender */ void setOrigSender(String origSender) { this.origSender = origSender; } }//NotificationImpl base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/NotificationMessageType.java000066400000000000000000000035061262264444500331430ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns; /** * Notification message types */ public enum NotificationMessageType { EMERGENCY ((short)0), WARNING((short)1), INFO((short)2); /** * Type Id */ private short typeId; /** * Constructor * @param typeId */ private NotificationMessageType(short typeId) { this.typeId = typeId; } /** * @return Returns type id */ public short getTypeId() { return typeId; } /** * Search for message type with the given Id. * If not found returns NULL * @param msgTypeId type id * @return Notification message type */ public static NotificationMessageType getMsgTypeById(short msgTypeId) { NotificationMessageType retType = null; for (NotificationMessageType type : NotificationMessageType.values()) { if ( msgTypeId == type.getTypeId() ) { retType = type; break; } } return retType; }//getMsgTypeById } base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/NotificationReceiver.java000066400000000000000000000032601262264444500324560ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns; import java.util.UUID; /** * An interface to be implemented in order to receive notification messages */ public interface NotificationReceiver { /** * Receive a {@link Notification} * @param notification */ public void receive(Notification notification); /** * The appId with the msgId uniquely identifies the {@link Notification} that should be dismissed, since * the msgId alone identifies the {@link Notification} only in the scope of the Notification sender service * @param msgId The message id of the {@link Notification} that should be dismissed * @param appId The appId of the Notification sender service */ public void dismiss(int msgId, UUID appId); }//NotificationReceiver base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/NotificationSender.java000066400000000000000000000132321262264444500321320ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns; import java.util.List; import java.util.Map; import java.util.UUID; import org.alljoyn.about.AboutKeys; import org.alljoyn.ns.commons.GenericLogger; import org.alljoyn.ns.commons.NativePlatform; import org.alljoyn.ns.commons.NativePlatformFactory; import org.alljoyn.ns.commons.NativePlatformFactoryException; import org.alljoyn.ns.transport.Transport; /** * The class is used to trigger sending a notification */ public class NotificationSender { private static final String TAG = "ioe" + NotificationSender.class.getSimpleName(); /** * The TTL low limit in seconds */ public static final int MESSAGE_TTL_LL = 30; /** * The TTL upper limit in seconds */ public static final int MESSAGE_TTL_UL = 43200; /** * Reference to native platform object */ private NativePlatform nativePlatform; /** * Constructor * @throws NotificationServiceException */ public NotificationSender() throws NotificationServiceException { try { nativePlatform = NativePlatformFactory.getPlatformObject(); GenericLogger logger = nativePlatform.getNativeLogger(); logger.info(TAG, "Notification Sender created"); } catch (NativePlatformFactoryException npfe) { throw new NotificationServiceException("Failed to create Notification Service: " + npfe.getMessage()); } } /** * Send the Notification message * @param notification The notification object to be sent */ public void send(Notification notification, int ttl) throws NotificationServiceException { GenericLogger logger = nativePlatform.getNativeLogger(); if ( ttl < MESSAGE_TTL_LL || ttl > MESSAGE_TTL_UL ) { logger.error(TAG, "The allowed TTL range is between '" + MESSAGE_TTL_LL + "' and '" + MESSAGE_TTL_UL + "'"); throw new NotificationServiceException("The allowed TTL range is between '" + MESSAGE_TTL_LL + "' and '" + MESSAGE_TTL_UL + "'"); } Transport transport = Transport.getInstance(); //get a map of the PropertyStore properties Map props = transport.readAllProperties(); UUID appId = transport.getAppId(props); String deviceId = (String)props.get(AboutKeys.ABOUT_DEVICE_ID); if ( deviceId == null || deviceId.length() == 0 ) { logger.error(TAG, "The DeviceId is NULL or empty"); throw new NotificationServiceException("The DeviceId is not set in the PropertyStore"); } String deviceName = (String)props.get(AboutKeys.ABOUT_DEVICE_NAME); if ( deviceName == null || deviceName.length() == 0 ) { logger.error(TAG, "The DeviceName is NULL or empty"); throw new NotificationServiceException("The DeviceName is not set in the PropertyStore"); } String appName = (String)props.get(AboutKeys.ABOUT_APP_NAME); if ( appName == null || appName.length() == 0 ) { logger.error(TAG, "The AppName is NULL or empty"); throw new NotificationServiceException("The AppName is not set in the PropertyStore"); } NotificationMessageType messageType = notification.getMessageType(); List text = notification.getText(); List richAudioUrl = notification.getRichAudioUrl(); Map customAttributes = notification.getCustomAttributes(); String richIconUrl = notification.getRichIconUrl(); String richIconObjPath = notification.getRichIconObjPath(); String richAudioObjPath = notification.getRichAudioObjPath(); String responseObjectPath = notification.getResponseObjectPath(); String audioUrl = null; if (richAudioUrl != null && richAudioUrl.size() > 0) { audioUrl = richAudioUrl.get(0).getUrl(); } logger.debug(TAG, "Sending message with message type: " + messageType + ", TTL: " + ttl + ", message: " + text.get(0).getText() + ", richIconUrl: '" + richIconUrl + "' RichAudioUrl: '" + audioUrl + ", richIconObjPath: '" + richIconObjPath + "' RichAudioObjPath: '" + richAudioObjPath + "'"); PayloadAdapter.sendPayload(deviceId, deviceName, appId, appName, messageType, text, customAttributes, ttl, richIconUrl, richAudioUrl, richIconObjPath, richAudioObjPath, responseObjectPath); }//send /** * Delete the last message by a given message type * @param messageType * @throws NotificationServiceException if message type was not defined */ public void deleteLastMsg(NotificationMessageType messageType) throws NotificationServiceException { if(messageType == null ) { throw new NotificationServiceException("MessageType parameter must be set"); } Transport.getInstance().deleteLastMessage(messageType); }//deleteLastMsg }//NotificationSenderImpl base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/NotificationService.java000066400000000000000000000136221262264444500323150ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns; import org.alljoyn.bus.BusAttachment; import org.alljoyn.ns.commons.GenericLogger; import org.alljoyn.ns.commons.NativePlatform; import org.alljoyn.ns.commons.NativePlatformFactory; import org.alljoyn.ns.commons.NativePlatformFactoryException; import org.alljoyn.ns.transport.Transport; import org.alljoyn.services.common.PropertyStore; /** * The entry point of the Notification service
* The class is a singleton */ public class NotificationService { private static final String TAG = "ioe" + NotificationService.class.getSimpleName(); /** * Initialize the class object */ private static final NotificationService SELF = new NotificationService(); /** * The protocol version that is sent in the {@link Notification} message */ public static final int PROTOCOL_VERSION = 2; /** * Reference to transport object */ private Transport transport; /** * Reference to native platform object */ private NativePlatform nativePlatform; /** * Constructor */ private NotificationService() {}//constructor /** * @return Returns the {@link NotificationService} object */ public static NotificationService getInstance() { return SELF; }//getInstance /** * Establishes the notification sender service to later allow sending notifications * See {@link NotificationSender} * @param bus The {@link BusAttachment} to be used by the service * @param propertyStore Service configuration {@link PropertyStore} * @return {@link NotificationSender} * @throws NotificationServiceException Is thrown if an error occurred during the sender initialization */ public NotificationSender initSend(BusAttachment bus, PropertyStore propertyStore) throws NotificationServiceException { init(); GenericLogger logger = nativePlatform.getNativeLogger(); if ( propertyStore == null ) { throw new NotificationServiceException("PropertyStore is NULL"); } logger.debug(TAG, "Init Send invoked, calling Transport"); transport.startSenderTransport(bus, propertyStore); logger.debug(TAG, "Creating and returning NotificationSender"); return new NotificationSender(); }//initSend /** * Establishes the notification receiver service to later receive notifications. * See {@link NotificationReceiver} * @param bus The {@link BusAttachment} to be used by the service * @param receiver * @throws NotificationServiceException if a malfunction occurred on building NotificationService */ public void initReceive(BusAttachment bus, NotificationReceiver receiver) throws NotificationServiceException { init(); GenericLogger logger = nativePlatform.getNativeLogger(); logger.debug(TAG, "Init Receive called, calling Transport"); if ( receiver == null ) { throw new NotificationServiceException("NotificationReceiver interface should be implemented in order to receive notifications, received null pointer"); } transport.startReceiverTransport(bus, receiver); }//initReceive /** * Set a logger Object to enable logging capabilities * @param logger GenericLogger object * @throws NotificationServiceException Is thrown if failed to set a logger */ public void setLogger(GenericLogger logger) throws NotificationServiceException { init(); if ( logger == null ) { throw new NullPointerException("Provided logger is NULL"); } nativePlatform.setNativeLogger(logger); }//setLogger /** * Shutdown notification service * @throws NotificationServiceException */ public void shutdown() throws NotificationServiceException { init(); transport.shutdown(); }//shutdown /** * Stops notification sender service * @throws NotificationServiceException Throws if the service wasn't started previously */ public void shutdownSender() throws NotificationServiceException { init(); transport.shutdownSender(); }//stopSender /** * Stops notification receiver service * @throws NotificationServiceException Throws if the service wasn't started previously */ public void shutdownReceiver() throws NotificationServiceException { init(); transport.shutdownReceiver(); }//stopReceiver //=========================================================// /** * Initializes the {@link NotificationService} object * @throws NotificationServiceException Is thrown if failed to initialized the object */ private void init() throws NotificationServiceException { if ( nativePlatform != null && transport != null ) { return; } try { nativePlatform = NativePlatformFactory.getPlatformObject(); GenericLogger logger = nativePlatform.getNativeLogger(); logger.info(TAG, "Notification Service created"); transport = Transport.getInstance(); } catch (NativePlatformFactoryException npfe) { throw new NotificationServiceException("Failed to create Notification Service: " + npfe.getMessage()); } catch (Exception e) { throw new NotificationServiceException("Failed to create Notification Service: General Error"); } }//init }//NotificationServiceImpl NotificationServiceException.java000066400000000000000000000030161262264444500341110ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns; /** * The exception is thrown if a {@link NotificationService} failure has occurred */ public class NotificationServiceException extends Exception { private static final long serialVersionUID = -4596126694105018269L; public NotificationServiceException() { super(); } public NotificationServiceException(String message, Throwable throwable) { super(message, throwable); } public NotificationServiceException(String message) { super(message); } public NotificationServiceException(Throwable throwable) { super(throwable); } } base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/NotificationText.java000066400000000000000000000056121262264444500316410ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns; /** * NotificationText. Creates object of the NotificationText class */ public class NotificationText { /** * Reference to language string
* The language must comply with the IETF standard */ private String language; /** * Notification text */ private String text; /** * Constructor */ public NotificationText() {} /** * Constructor * @param language The language must comply with the IETF standard * @param text the notification text * @throws NotificationServiceException Thrown if language is null text is null or empty */ public NotificationText(String language, String text) throws NotificationServiceException { setLanguage(language); setText(text); } /** * @return String Returns notification language. The language must comply with the IETF standard */ public String getLanguage() { return language; } /** * Set the language * @param language The language must comply with the IETF standard * @throws NotificationServiceException Thrown if language is null */ public void setLanguage(String language) throws NotificationServiceException { if ( language == null || language.length() == 0 ) { throw new NotificationServiceException("Language is undefined"); } this.language = language; }//setLanguage /** * @return the notification text */ public String getText(){ return text; } /** * Set the notification text * @param text the notification text * @throws NotificationServiceException Thrown if text is null or is empty */ public void setText(String text) throws NotificationServiceException { if ( text == null || text.length() == 0 ) { throw new NotificationServiceException("Text is undefined"); } this.text = text; }//setText /** * @see java.lang.Object#toString() */ @Override public String toString() { return "NotificationText [language='" + language + "', text='" + text + "']"; } }//NotificationText base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/PayloadAdapter.java000066400000000000000000000325661262264444500312500ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.UUID; import org.alljoyn.bus.Variant; import org.alljoyn.ns.commons.GenericLogger; import org.alljoyn.ns.commons.NativePlatformFactory; import org.alljoyn.ns.commons.NativePlatformFactoryException; import org.alljoyn.ns.transport.Transport; import org.alljoyn.ns.transport.TransportNotificationText; import org.alljoyn.ns.transport.TransportRichAudioUrl; import org.alljoyn.ns.transport.interfaces.NotificationTransport; /** * Mediate between variables structure sent over AJ network to Notification object structure and vice versa */ public class PayloadAdapter { private enum ArgumentKey { RICH_NOTIFICATION_ICON_URL(0), RICH_NOTIFICATION_AUDIO_URL(1), RICH_NOTIFICATION_ICON_OBJECT_PATH(2), RICH_NOTIFICATION_AUDIO_OBJECT_PATH(3), RESPONSE_OBJECT_PATH(4), ORIGINAL_SENDER_NAME(5) ; /** * The argument key id */ public final int ID; /** * Constructor * @param id The key id */ private ArgumentKey(int id) { ID = id; } /** * Returns Argument key by id or null if not found * @param id Id to look for * @return */ public static ArgumentKey getArgumentKeyById(int id) { ArgumentKey[] args = ArgumentKey.values(); ArgumentKey retVal = null; for (ArgumentKey arg : args) { if ( arg.ID == id ) { retVal = arg; break; } } return retVal; }//getArgumentKeyById }//ArgumentKeys //========================================== private static final String TAG = "ioe" + PayloadAdapter.class.getSimpleName(); /** * Random number to start msg Id */ private static int msgId = (int)(Math.random()*10000); /** * Convert the sent data into the format of {@link NotificationTransport#notify(int, int, short, String, String, byte[], String, Map, Map, TransportNotificationText[])} * @param deviceId device Id * @param deviceName device name * @param appId app Id * @param appName app name * @param messageType Notification message type * @param text list of NotificationText objects * @param customAttributes map of customized array variables * @param ttl Notification message TTL * @param richIconUrl may be null * @param richAudioUrl list by language may be null * @param richIconObjPath may be null * @param richAudioObjPath list by language may be null * @param responseObjectPath CPS object path * @throws NotificationServiceException */ public static void sendPayload(String deviceId, String deviceName, UUID appId, String appName, NotificationMessageType messageType, List text, Map customAttributes, int ttl, String richIconUrl, List richAudioUrl, String richIconObjPath, String richAudioObjPath, String responseObjectPath) throws NotificationServiceException { GenericLogger logger; try { logger = NativePlatformFactory.getPlatformObject().getNativeLogger(); } catch (NativePlatformFactoryException npfe) { throw new NotificationServiceException(npfe.getMessage()); } logger.debug(TAG, "Preparing message for sending..."); //Prepare attributes Map Map attributes = new HashMap(); if ( richIconUrl != null ) { logger.debug(TAG, "Preparing to send richIconUrl..."); attributes.put(ArgumentKey.RICH_NOTIFICATION_ICON_URL.ID, new Variant(richIconUrl, "s")); }//if :: richIconUrl if ( richAudioUrl != null ) { logger.debug(TAG, "Preparing to send richAudioUrl..."); //Prepare TransportRichAudioUrl array int u = 0; TransportRichAudioUrl[] audioUrl = new TransportRichAudioUrl[richAudioUrl.size()]; for ( RichAudioUrl au : richAudioUrl ) { audioUrl[u] = TransportRichAudioUrl.buildInstance(au); ++u; } attributes.put(ArgumentKey.RICH_NOTIFICATION_AUDIO_URL.ID, new Variant(audioUrl, "ar")); }//if :: richAudioUrl if ( richIconObjPath != null ) { logger.debug(TAG, "Preparing to send richIconObjPath..."); attributes.put(ArgumentKey.RICH_NOTIFICATION_ICON_OBJECT_PATH.ID, new Variant(richIconObjPath, "s")); }//if :: richIconUrl if ( richAudioObjPath != null ) { logger.debug(TAG, "Preparing to send richAudioObjPath..."); attributes.put(ArgumentKey.RICH_NOTIFICATION_AUDIO_OBJECT_PATH.ID, new Variant(richAudioObjPath, "s")); }//if :: richAudioUrl if ( responseObjectPath != null ) { logger.debug(TAG, "Preparing to sendCPS Ocject Path..."); attributes.put(ArgumentKey.RESPONSE_OBJECT_PATH.ID, new Variant(responseObjectPath, "s")); }//if :: responseObjectPath //Add the notification producer sender name to the sent attributes String sender = Transport.getInstance().getBusAttachment().getUniqueName(); attributes.put(ArgumentKey.ORIGINAL_SENDER_NAME.ID, new Variant(sender, "s")); //Process customAttributes if ( customAttributes != null ) { logger.debug(TAG, "Preparing customAttributes..."); for(String key : customAttributes.keySet()) { if (key == null) { throw new NotificationServiceException("The key of customAttributes can't be null"); } String customVal = customAttributes.get(key); if (customVal == null) { throw new NotificationServiceException("The value of customAttributes for key: '" + key + "' can't be null"); } }//for :: customAttributes }//if :: customAttributes else { // Create an empty customAttributes to prevent sending NULL customAttributes = new HashMap(); } //Prepare TransportNotificationText array int i = 0; TransportNotificationText[] sentText = new TransportNotificationText[text.size()]; for ( NotificationText nt : text ) { sentText[i] = TransportNotificationText.buildInstance(nt); ++i; } Transport.getInstance().sendNotification(NotificationService.PROTOCOL_VERSION, genMsgId(), messageType, deviceId, deviceName, uuidToByteArray(appId), appName, attributes, customAttributes, sentText, ttl ); }//sendPayload /** * Convert the received data into the format of {@link Notification} object * @param version The version of the message signature * @param msgId notifId notification Id * @param sender The unique name of the sender end point, may be used for session establishment * @param messageType Message type id * @param deviceId Device Id * @param deviceName Device Name * @param bAppId app id * @param appName app Name * @param attributes Notification metadata * @param customAttributes customAttributes * @param text List of NotificationText objects * @throws NotificationServiceException if failed to parse the received notification */ public static void receivePayload(int version, int msgId, String sender, short messageType, String deviceId, String deviceName, byte[] bAppId, String appName, Map attributes, Map customAttributes, TransportNotificationText[] text) throws NotificationServiceException { try { GenericLogger logger = NativePlatformFactory.getPlatformObject().getNativeLogger(); logger.debug(TAG, "Received notification Id: '" + msgId + "', parsing..."); // Decode message type NotificationMessageType msgType = NotificationMessageType.getMsgTypeById(messageType); if ( msgType == null ) { throw new NotificationServiceException("Received unknown message type id: '" + messageType + "'"); } //Build List of NotificationText List textList = new LinkedList(); for (TransportNotificationText trNt : text) { textList.add(new NotificationText(trNt.language, trNt.text)); } // Create the Notification object Notification notif = new Notification(msgType, textList); //convert appId received as a byte[] to a string UUID appId = byteArrayToUUID(bAppId); if ( appId == null ) { String msg = "Received a bad length of byte array that doesn't represent UUID of an appId"; logger.error(TAG, msg); throw new NotificationServiceException(msg); } notif.setVersion(version); notif.setMessageId(msgId); notif.setDeviceId(deviceId); notif.setDeviceName(deviceName); notif.setSender(sender); notif.setAppId(appId); notif.setAppName(appName); //parse attributes for ( Integer key : attributes.keySet() ) { Variant vObj = attributes.get(key); ArgumentKey attrKey = ArgumentKey.getArgumentKeyById(key); if ( attrKey == null ) { logger.warn(TAG, "An unknown attribute key: '" + key + "' received, ignoring the key"); continue; } switch(attrKey) { case RICH_NOTIFICATION_ICON_URL: { String iconUrl = vObj.getObject(String.class); logger.debug(TAG, "Received rich icon url: '" + iconUrl + "'"); notif.setRichIconUrl(iconUrl); break; }//RICH_NOTIFICATION_ICON_URL case RICH_NOTIFICATION_AUDIO_URL: { TransportRichAudioUrl[] audioUrl = vObj.getObject(TransportRichAudioUrl[].class); if (audioUrl.length != 0) { List audioUrlList = new ArrayList(audioUrl.length); logger.debug(TAG, "Received rich audio url"); for (TransportRichAudioUrl trRichAudioUrl : audioUrl) { audioUrlList.add(new RichAudioUrl(trRichAudioUrl.language, trRichAudioUrl.url)); } notif.setRichAudioUrl(audioUrlList); } break; }//RICH_NOTIFICATION_AUDIO_URL case RICH_NOTIFICATION_ICON_OBJECT_PATH: { String iconObjPath = vObj.getObject(String.class); logger.debug(TAG, "Received rich icon object path: '" + iconObjPath + "'"); notif.setRichIconObjPath(iconObjPath); break; } case RICH_NOTIFICATION_AUDIO_OBJECT_PATH: { String audioObjPath = vObj.getObject(String.class); logger.debug(TAG, "Received rich audio object path"); notif.setRichAudioObjPath(audioObjPath); break; } case RESPONSE_OBJECT_PATH: { String responseObjectPath = vObj.getObject(String.class); logger.debug(TAG, "Received a Response ObjectPath object path: '" + responseObjectPath + "'"); notif.setResponseObjectPath(responseObjectPath); break; } case ORIGINAL_SENDER_NAME: { String origSender = vObj.getObject(String.class); logger.debug(TAG, "Received an original sender: '" + origSender + "'"); notif.setOrigSender(origSender); break; } }//switch }//for :: attributes logger.debug(TAG, "Set the custom attributes"); // set the custom attributes notif.setCustomAttributes(customAttributes); Transport.getInstance().onReceivedNotification(notif); }//try catch (Exception e) { throw new NotificationServiceException("Failed to parse received notification payload, Error: " + e.getMessage()); } }//receivePayload /** * Generate a notification id string using random string and msgIdAI * @return Notification id in format: random number concatenated to msgAI(Auto incremented) */ public static int genMsgId() { if ( msgId == Integer.MAX_VALUE ) { msgId = 0; } return ++msgId; } /** * Convert the byte array to a UUID * @param bAppId Byte Array to be converted to {@link UUID} * @return UUID {@link UUID} object or NULL if failed to create */ public static UUID byteArrayToUUID(byte[] bAppId) { long msUuid = 0; long lsUuid = 0; if ( bAppId.length != 16) { return null; } for (int i = 0; i < 8; i++) { msUuid = (msUuid << 8) | (bAppId[i] & 0xff); } for (int i = 8; i < 16; i++) { lsUuid = (lsUuid << 8) | (bAppId[i] & 0xff); } UUID result = new UUID(msUuid, lsUuid); return result; }//byteArrayToUUID /** * Convert from UUID object into a byte array * @param uuid * @return byte array */ public static byte[] uuidToByteArray(UUID uuid) { long msUuid = uuid.getMostSignificantBits(); long lsUuid = uuid.getLeastSignificantBits(); byte[] byteArrayUuid = new byte[16]; for (int i = 0; i < 8; i++) { byteArrayUuid[i] = (byte) (msUuid >>> 8 * (7 - i)); } for (int i = 8; i < 16; i++) { byteArrayUuid[i] = (byte) (lsUuid >>> 8 * (7 - i)); } return byteArrayUuid; }//uuidToByteArray }//PayloadAdapter base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/RichAudioUrl.java000066400000000000000000000055711262264444500307040ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns; /** * RichNotificationAudioUrl. Creates object of the RichNotificationAudioUrl class */ public class RichAudioUrl { /** * Reference to language string
* The language must comply IETF standard */ private String language; /** * RichNotification Audio Url */ private String url; /** * Constructor */ public RichAudioUrl() {} /** * Constructor * @param language - The language must comply IETF standard * @param url - rich notification audio url * @throws NotificationServiceException Thrown if language is null url is null or empty */ public RichAudioUrl(String language, String url) throws NotificationServiceException { setLanguage(language); setUrl(url); } /** * @return String Returns audio url language. The language must comply IETF standard */ public String getLanguage() { return language; } /** * Set the language * @param language The language must comply IETF standard * @throws NotificationServiceException Thrown if language is null */ public void setLanguage(String language) throws NotificationServiceException { if (language == null || language.length() == 0 ) { throw new NotificationServiceException("Language is undefined"); } this.language = language; }//setLanguage /** * @return the rich notification audio url */ public String getUrl(){ return url; } /** * Set the notification url * @param url the notification url * @throws NotificationServiceException Thrown if url is null or is empty */ public void setUrl(String url) throws NotificationServiceException { if ( url == null || url.length() == 0 ) { throw new NotificationServiceException("audio url is undefined"); } this.url = url; }//setUrl /** * @see java.lang.Object#toString() */ @Override public String toString() { return "RichAudioUrl [language= '" + language + "', url='" + url + "']"; } }//RichNotificationAudioUrl base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/package-info.java000066400000000000000000000022001262264444500306600ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ /** * The package includes API classes of the Notification service which are used to * send and receive notification messages */ package org.alljoyn.ns;base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/000077500000000000000000000000001262264444500275335ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/DismissEmitter.java000066400000000000000000000103061262264444500333430ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport; import java.util.UUID; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.BusException; import org.alljoyn.bus.SignalEmitter; import org.alljoyn.bus.SignalEmitter.GlobalBroadcast; import org.alljoyn.bus.Status; import org.alljoyn.ns.NotificationSender; import org.alljoyn.ns.NotificationServiceException; import org.alljoyn.ns.PayloadAdapter; import org.alljoyn.ns.commons.GenericLogger; import org.alljoyn.ns.transport.interfaces.NotificationDismisser; /** * The class provides a functionality of sending Dismiss session-less-signals */ public class DismissEmitter implements NotificationDismisser { private static final String TAG = "ioe" + DismissEmitter.class.getSimpleName(); private static final String OBJ_PATH_PREFIX = "/notificationDismisser/"; /** * Send the Dismiss signal * @param msgId The notification id * @param appId The application id */ public static void send(int msgId, UUID appId) { Transport transport = Transport.getInstance(); BusAttachment bus = transport.getBusAttachment(); GenericLogger logger; try { logger = transport.getLogger(); } catch (NotificationServiceException nse) { System.out.println(TAG + ": Unexpected error occured: " + nse.getMessage()); return; } if ( bus == null ) { logger.error(TAG, "Can't call Dismiss signal, BusAttachment isn't defined, returning..."); return; } logger.debug(TAG, "Sending the Dismiss signal notifId: '" + msgId + "', appId: '" + appId + "'"); DismissEmitter dismissSenderBusObj = new DismissEmitter(); String objPath = buildObjPath(msgId, appId); Status status = bus.registerBusObject(dismissSenderBusObj, objPath); if ( status != Status.OK ) { logger.error(TAG, "Failed to register a BusObject, ObjPath: '" + objPath + "', Error: '" + status + "'"); return; } SignalEmitter emitter = new SignalEmitter(dismissSenderBusObj, GlobalBroadcast.Off); emitter.setSessionlessFlag(true); emitter.setTimeToLive(NotificationSender.MESSAGE_TTL_UL); byte[] bappId = PayloadAdapter.uuidToByteArray(appId); try { logger.debug(TAG, "Sending the Dismiss signal from ObjPath: '" + objPath + "'"); emitter.getInterface(NotificationDismisser.class).dismiss(msgId, bappId); } catch (BusException be) { logger.error(TAG, "Failed to send the Dismiss signal notifId: '" + msgId + "', appId: '" + appId + "', Error: '" + be.getMessage() + "'"); } bus.unregisterBusObject(dismissSenderBusObj); }//send /** * @see org.alljoyn.ns.transport.interfaces.NotificationDismisser#dismiss(int, byte[]) */ @Override public void dismiss(int msgId, byte[] appId) throws BusException { } /** * @see org.alljoyn.ns.transport.interfaces.NotificationDismisser#getVersion() */ @Override public short getVersion() throws BusException { return VERSION; } /** * Creates the object path: OBJ_PATH_PREFIX/[APPID]/msgId * @param msgId * @param appId * @return The object path */ private static String buildObjPath(int msgId, UUID appId) { String appIdStr = appId.toString().replace("-", ""); return OBJ_PATH_PREFIX + appIdStr + "/" + Math.abs(msgId); }//buildObjPath } base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/TaskManager.java000066400000000000000000000134111262264444500325730ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import org.alljoyn.ns.NotificationService; import org.alljoyn.ns.commons.NativePlatform; /** * The thread pool manager is used to handle different {@link NotificationService} tasks.
* The tasks can be executed instantly by invoking the {@link TaskManager#execute(Runnable)} method, or * they may be enqueued and executed later, by calling the {@link TaskManager#enqueue(Runnable)} method */ public class TaskManager implements RejectedExecutionHandler { private static final String TAG = "ioe" + TaskManager.class.getSimpleName(); /** * Self reference for singleton */ private static final TaskManager SELF = new TaskManager(); /** * Gets TRUE if the object is valid, which means it has been initialized */ private volatile boolean isValid; /** * The platform dependent object */ private NativePlatform nativePlatform; /** * The thread TTL time */ private static final long THREAD_TTL = 3; /** * The thread TTL time unit */ private static final TimeUnit TTL_TIME_UNIT = TimeUnit.SECONDS; /** * Amount of the core threads */ private static final int THREAD_CORE_NUM = 4; /** * The maximum number of threads that may be spawn */ private static final int THREAD_MAX_NUM = 10; /** * Thread pool object */ private ThreadPoolExecutor threadPool; /** * The queue of tasks to be handled sequentially */ private ExecutorService taskQueue; /** * Constructor */ private TaskManager() {} /** * @return {@link TaskManager} instance */ public static TaskManager getInstance() { return SELF; } /** * Initializes the thread pool * @param nativePlatform The reference to the platform dependent object */ public void initPool(NativePlatform nativePlatform) { nativePlatform.getNativeLogger().debug(TAG, "Initializing TaskManager"); this.nativePlatform = nativePlatform; initThreadPool(); initTaskQueue(); isValid = true; } /** * @param task Executes the given {@link Runnable} task if there is a free thread worker * @throws IllegalStateException if the object has not been initialized */ public void execute(Runnable task) { checkValid(); nativePlatform.getNativeLogger().debug(TAG,"Executing task, Current Thread pool size: '" + threadPool.getPoolSize() + "', 'Number of currently working threads: '" + threadPool.getActiveCount() + "'"); threadPool.execute(task); } /** * Enqueue the given {@link Runnable} task to be executed later * @param task to executed * @throws IllegalStateException if the object has not been initialized */ public void enqueue(Runnable task){ checkValid(); nativePlatform.getNativeLogger().debug(TAG, "Enqueueing task to be executed"); taskQueue.execute(task); } /** * @return TRUE if the {@link TaskManager} has been initialized and it is running */ public boolean isRunning() { return isValid; } /** * Tries to stop the thread pool and all its threads * @throws IllegalStateException if the object has not been initialized */ public void shutdown() { nativePlatform.getNativeLogger().debug(TAG, "Shutting down TaskManager"); isValid = false; if ( threadPool != null && !threadPool.isShutdown() ) { threadPool.shutdown(); threadPool = null; } if ( taskQueue != null && !taskQueue.isShutdown() ) { taskQueue.shutdown(); taskQueue = null; } } /** * The callback is called, when there are no free threads to execute the given task */ @Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { throw new RejectedExecutionException("Failed to execute the given task, all the worker threads are busy"); } //=================================================// /** * Checks the object validity * @throws IllegalStateException if the object hasn't been initialized */ private void checkValid() { if ( !isValid ){ throw new IllegalStateException("The WorkPoolManager has not been initialized. " + "The initPool mathod should have been invoked"); } } /** * Initialize the threadpool */ private void initThreadPool() { threadPool = new ThreadPoolExecutor( THREAD_CORE_NUM, THREAD_MAX_NUM, THREAD_TTL, TTL_TIME_UNIT, new SynchronousQueue(true) // The fair order FIFO ); threadPool.setRejectedExecutionHandler(this); } /** * Initialize the task queue */ private void initTaskQueue() { taskQueue = Executors.newSingleThreadExecutor(); } } base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/Transport.java000066400000000000000000000406661262264444500324060ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.alljoyn.about.AboutKeys; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.BusObject; import org.alljoyn.bus.Status; import org.alljoyn.bus.Variant; import org.alljoyn.ns.Notification; import org.alljoyn.ns.NotificationMessageType; import org.alljoyn.ns.NotificationReceiver; import org.alljoyn.ns.NotificationServiceException; import org.alljoyn.ns.commons.GenericLogger; import org.alljoyn.ns.commons.NativePlatform; import org.alljoyn.ns.commons.NativePlatformFactory; import org.alljoyn.ns.commons.NativePlatformFactoryException; import org.alljoyn.ns.transport.consumer.ReceiverTransport; import org.alljoyn.ns.transport.producer.SenderTransport; import org.alljoyn.services.android.storage.Property; import org.alljoyn.services.common.PropertyStore; import org.alljoyn.services.common.PropertyStore.Filter; import org.alljoyn.services.common.PropertyStoreException; /** * The main transport controller class * Manages {@link SenderTransport} and {@link ReceiverTransport} objects */ public class Transport { private static final String TAG = "ioe" + Transport.class.getSimpleName(); /** * Reference to Transport object */ private static final Transport transport = new Transport(); /** * {@link SenderTransport} logic */ private SenderTransport senderTransport; /** * {@link ReceiverTransport} logic */ private ReceiverTransport receiverTransport; /** * Reference to native platform object */ private NativePlatform nativePlatform; /** * Service configuration properties */ private PropertyStore propertyStore; /** * Reference to BusAttachment object */ private BusAttachment busAttachment; /** * Received TRUE if sender transport was already called */ private boolean isSenderTransportCalled = false; /** * Receives TRUE if receiver transport was called */ private boolean isReceiverTransportCalled = false; /** * @return Return the {@link Transport} object */ public static Transport getInstance() { return transport; }//getInstance /** * Constructor * private constructor - to avoid creation of Transport object by other classes */ private Transport() {}//Constructor /** * @return Reference to the {@link BusAttachment} */ public BusAttachment getBusAttachment() { return busAttachment; } /** * @return All properties read from the {@link PropertyStore} * @throws If failed to read the properties from the {@link PropertyStore} */ public Map readAllProperties() throws NotificationServiceException { Map props = new HashMap(); try { propertyStore.readAll(Property.NO_LANGUAGE, Filter.READ, props); } catch (PropertyStoreException pse) { throw new NotificationServiceException("Failed to read properties from the PropertyStore, Error: '" + pse.getMessage() + "'", pse); } return props; }//readAllProperties /** * Retrieve AppId from the given properties * @param props {@link PropertyStore} properties Map object * @return AppId * @throws NotificationServiceException if failed to retrieve the AppId parameter */ public UUID getAppId(Map props) throws NotificationServiceException { if ( props == null ) { throw new NotificationServiceException("props can't be NULL"); } Object appIdObj = props.get(AboutKeys.ABOUT_APP_ID); if ( !(appIdObj instanceof UUID) ) { throw new NotificationServiceException("The AppId is NULL or not an instance of UUID"); } return (UUID) appIdObj; }//getAppId /** * Starts the service in the Sender mode * @param propertyStore The reference to the application {@link PropertyStore} object * @param bus The {@link BusAttachment} to be used by this {@link Transport} object * @throws NotificationServiceException Is thrown if failed to start the SenderTransport */ public synchronized void startSenderTransport(BusAttachment bus, PropertyStore propertyStore) throws NotificationServiceException { GenericLogger logger; logger = getLogger(); if ( isSenderTransportCalled ) { logger.debug(TAG, "Sender transport was previously started, returning"); return; } //Store the received busAttachment or verify if already exists saveBus(bus); TaskManager taskManager = TaskManager.getInstance(); if ( !taskManager.isRunning() ) { taskManager.initPool(nativePlatform); } this.propertyStore = propertyStore; senderTransport = new SenderTransport(nativePlatform); try { senderTransport.startSenderTransport(); //Delegate the starting sender transport logic } catch(NotificationServiceException nse) { stopSenderTransport(logger); throw nse; } isSenderTransportCalled = true; }//startSenderTransport /** * Starts the Receiver Transport * @param bus The {@link BusAttachment} to be used by this {@link Transport} object * @param receiver {@link NotificationReceiver} * @throws NotificationServiceException Is thrown if failed to start the ReceiverTransport */ public synchronized void startReceiverTransport(BusAttachment bus, NotificationReceiver receiver) throws NotificationServiceException { GenericLogger logger; logger = getLogger(); if ( isReceiverTransportCalled ) { logger.debug(TAG, "Receiver transport was previously started, returning"); return; } saveBus(bus); TaskManager taskManager = TaskManager.getInstance(); if ( !taskManager.isRunning() ) { taskManager.initPool(nativePlatform); } receiverTransport = new ReceiverTransport(nativePlatform, receiver); try { receiverTransport.startReceiverTransport(); } catch(NotificationServiceException nse) { stopReceiverTransport(logger); throw nse; } isReceiverTransportCalled = true; }//startReceiverTransport /** * Called when we need to send a signal * @param version The version of the message signature * @param msgId notification Id the id of the sent signal * @param messageType The message type of the sent message * @param deviceId Device id * @param deviceName Device name * @param appId App id * @param appName App name * @param attributes All the notification metadata * @param customAttributes The customAttributes * @param text Array of texts to be sent * @param ttl Notification message TTL * @throws NotificationServiceException */ public void sendNotification(int version, int msgId, NotificationMessageType messageType, String deviceId, String deviceName, byte[] appId, String appName, Map attributes, Map customAttributes,TransportNotificationText[] text, int ttl) throws NotificationServiceException { GenericLogger logger; try { logger = getLogger(); } catch (NotificationServiceException nse) { throw nse; } if (!isSenderTransportCalled){ logger.error(TAG,"Notification service is not running, can't send message"); throw new NotificationServiceException("Notification service is not running, can't send message"); } senderTransport.sendNotification(version, msgId, messageType, deviceId, deviceName, appId, appName, attributes, customAttributes, text, ttl); }//sendNotification /** * Cancel the last message sent for the given messageType * @param messageType * @throws NotificationServiceException */ public void deleteLastMessage(NotificationMessageType messageType) throws NotificationServiceException { GenericLogger logger; try { logger = getLogger(); } catch (NotificationServiceException nse) { throw nse; } if ( !isSenderTransportCalled ) { logger.error(TAG,"Notification service is not running, can't delete message"); throw new NotificationServiceException("Notification service is not running, can't delete message"); } senderTransport.deleteLastMessage(messageType); }//deleteLastMessage /** * Received notification, call the notification receiver callback to pass the notification * @param notification */ public void onReceivedNotification(final Notification notification) { GenericLogger logger; try { logger = getLogger(); } catch (NotificationServiceException nse) { System.out.println("Could not get logger in receive notification error: " + nse.getMessage()); return; } synchronized (this) { if ( !isReceiverTransportCalled ) { logger.error(TAG, "Received a Notification message, but the Notification Receiver transport is stopped"); return; } receiverTransport.onReceivedNotification(notification); }//synchronized }//onReceivedNotification /** * Handle the received Dismiss signal * @param msgId The message id of the {@link Notification} that should be dismissed * @param appId The appId of the Notification sender service */ public void onReceivedNotificationDismiss(int msgId, UUID appId) { receiverTransport.onReceivedNotificationDismiss(msgId, appId); }//onDismissReceived /** * Stop Notification Service * @throws NotificationServiceException */ public synchronized void shutdown() throws NotificationServiceException { GenericLogger logger = getLogger(); if ( busAttachment == null ) { logger.warn(TAG,"No BusAttachment defined, sender and receiver must be down, returning"); return; } logger.debug(TAG, "Shutdown called, stopping sender and receiver transports"); stopSenderTransport(logger); stopReceiverTransport(logger); }//shutdown /** * Verifies that sender transport was started, then calls stopSenderTransport() * @throws NotificationServiceException */ public synchronized void shutdownSender() throws NotificationServiceException { GenericLogger logger = getLogger(); if ( !isSenderTransportCalled ) { logger.error(TAG, "Sender service wasn't started"); throw new NotificationServiceException("Sender service wasn't started"); } logger.debug(TAG, "Stopping sender transport"); stopSenderTransport(logger); }//stopSender /** * Verifies that receiver transport was started, then calls stopReceiverTransport() * @throws NotificationServiceException */ public synchronized void shutdownReceiver() throws NotificationServiceException { GenericLogger logger = getLogger(); if ( !isReceiverTransportCalled ) { logger.error(TAG, "Receiver service wasn't started"); throw new NotificationServiceException("Receiver service wasn't started"); } logger.debug(TAG, "Stopping receiver transport"); stopReceiverTransport(logger); }//stopReceiver /** * Uses setNativePlatform to receive the GenericLogger * @return GenericLogger Returns GenericLogger * @throws NotificationServiceException thrown if no native platform object is defined */ public GenericLogger getLogger() throws NotificationServiceException { setNativePlatform(); return nativePlatform.getNativeLogger(); }//getLogger //********************* PRIVATE METHODS *********************// /** * Stores the {@link BusAttachment} if it's not already exists and is connected to the Bus
* If the {@link BusAttachment} already exists, checks whether the received {@link BusAttachment} is the same * as the existent one. If not the {@link NotificationServiceException} is thrown * @param bus * @throws NotificationServiceException */ private void saveBus(BusAttachment bus) throws NotificationServiceException { GenericLogger logger = nativePlatform.getNativeLogger(); if ( bus == null ) { logger.error(TAG, "Received a NULL BusAttachment"); throw new NotificationServiceException("Received a not initialized BusAttachment"); } if ( this.busAttachment == null ) { if ( !bus.isConnected() ) { logger.error(TAG, "Received a BusAttachment that is not connected to the AJ Bus"); throw new NotificationServiceException("Received a BusAttachment that is not connected to the AJ bus"); } logger.info(TAG, "BusAttachment is stored successfully"); this.busAttachment = bus; } else if ( !this.busAttachment.getUniqueName().equals(bus.getUniqueName()) ) { logger.error(TAG, "NotificationService received a new BusAttachment: '" + bus.getUniqueName() + "', while previously initialized with a BusAttachment: '" + busAttachment.getUniqueName() + "'"); throw new NotificationServiceException("BusAttachment already exists"); } }//saveBus /** * Uses NativePlatformFactory to receive NativePlatform object * @throws NotificationServiceException thrown if failed to receive native platform factory */ private void setNativePlatform() throws NotificationServiceException { if ( nativePlatform == null ) { try { nativePlatform = NativePlatformFactory.getPlatformObject(); } catch (NativePlatformFactoryException npfe) { throw new NotificationServiceException(npfe.getMessage()); } } }//setNativePlatform /** * Register bus object that is intended to be a signal handler * @param logger * @param ifName Interface name that signal handler object belongs to * @param signalName * @param handlerMethod The reflection of the method that is handling the signal * @param toBeRegistered The object to be registered on the bus and set to be signal handler * @param servicePath The identifier of the object * @return TRUE on success and FALSE on fail */ public boolean registerObjectAndSetSignalHandler(GenericLogger logger, String ifName, String signalName, Method handlerMethod, BusObject toBeRegistered, String servicePath) { logger.debug(TAG, "Registering BusObject and setting signal handler, IFName: '" + ifName + ", method: '" + handlerMethod.getName() + "'"); Status status = busAttachment.registerBusObject(toBeRegistered, servicePath); if ( status != Status.OK ) { logger.error(TAG, "Failed to register bus object, status: " + status); return false; } status = busAttachment.registerSignalHandler(ifName, signalName, toBeRegistered, handlerMethod); if ( status != Status.OK ) { logger.error(TAG, "Failed to register signal handler, status: " + status); return false; } return true; }//registerObjectAndSetSignalHandler /** * Sender Transport cleanup * @param logger */ private void stopSenderTransport(GenericLogger logger) { if ( senderTransport != null ) { senderTransport.stopSenderTransport(); senderTransport = null; } // clear the resources that are generic between sender and receiver if ( !isReceiverTransportCalled ) { logger.debug(TAG, "Receiver is not running, clearing common resources"); TaskManager taskManager = TaskManager.getInstance(); if ( taskManager.isRunning() ) { taskManager.shutdown(); } busAttachment = null; } propertyStore = null; isSenderTransportCalled = false; }//cleanTransportProducerChannel /** * Receiver Transport cleanup * @param logger */ private void stopReceiverTransport(GenericLogger logger) { if ( receiverTransport != null ) { receiverTransport.stopReceiverTransport(); receiverTransport = null; } // clear the resources that are generic between sender and receiver if ( !isSenderTransportCalled ) { logger.debug(TAG, "Sender is not running, clearing common resources"); TaskManager taskManager = TaskManager.getInstance(); if ( taskManager.isRunning() ) { taskManager.shutdown(); } busAttachment = null; } isReceiverTransportCalled = false; }//stopReceiverTransport }//Transport TransportNotificationText.java000066400000000000000000000041021262264444500355240ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport; import org.alljoyn.bus.annotation.Position; import org.alljoyn.ns.NotificationText; /* * The utility class used to wrap NotificationText object into format of TransportNotificationText that * is sent over AJ network */ public class TransportNotificationText { /** * Text language */ @Position(0) public String language; /** * Message text */ @Position(1) public String text; /** * Constructor */ public TransportNotificationText() {} /** * Constructor * @param language * @param text */ public TransportNotificationText(String language, String text) { this.language = language; this.text = text; } /** * Creates object of TransportNotificationText from NotificationText object * @param notifText reference to NotificationText object * @return TransportNotificationText */ public static TransportNotificationText buildInstance(NotificationText notifText) { TransportNotificationText trNotTxt = new TransportNotificationText(notifText.getLanguage(), notifText.getText() ); return trNotTxt; }//buildInstance } TransportRichAudioUrl.java000066400000000000000000000037431262264444500345750ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport; import org.alljoyn.bus.annotation.Position; import org.alljoyn.ns.RichAudioUrl; /* * The utility class used to wrap RichAudioUrl object into format of TransportRichAudioUrl that * is sent over AJ network */ public class TransportRichAudioUrl { /** * Url language */ @Position(0) public String language; /** * Message url */ @Position(1) public String url; /** * Constructor */ public TransportRichAudioUrl() {} /** * Constructor * @param language * @param url */ public TransportRichAudioUrl(String language, String url) { this.language = language; this.url = url; } /** * Creates object of TransportRichAudioUrl from RichAudioUrl object * @param richAudioUrl reference to TransportRichAudioUrl object * @return TransportRichAudioUrl */ public static TransportRichAudioUrl buildInstance(RichAudioUrl richAudioUrl) { return new TransportRichAudioUrl(richAudioUrl.getLanguage(), richAudioUrl.getUrl() ); }//buildInstance } base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/consumer/000077500000000000000000000000001262264444500313665ustar00rootroot00000000000000DismissConsumer.java000066400000000000000000000053561262264444500353120ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/consumer/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport.consumer; import java.util.UUID; import org.alljoyn.bus.BusException; import org.alljoyn.ns.NotificationServiceException; import org.alljoyn.ns.PayloadAdapter; import org.alljoyn.ns.commons.GenericLogger; import org.alljoyn.ns.transport.Transport; import org.alljoyn.ns.transport.interfaces.NotificationDismisser; /** * The class provides a functionality of receiving AllJoyn Dismiss session-less-signals */ class DismissConsumer implements NotificationDismisser { private static final String TAG = "ioe" + DismissConsumer.class.getSimpleName(); public static final String OBJ_PATH = "/dismissReceiver"; /** * @see org.alljoyn.ns.transport.interfaces.NotificationDismisser#dismiss(int, byte[]) */ @Override public void dismiss(int msgId, byte[] bAppId) throws BusException { Transport transport = Transport.getInstance(); transport.getBusAttachment().enableConcurrentCallbacks(); GenericLogger logger; try { logger = transport.getLogger(); } catch(NotificationServiceException nse) { System.out.println(TAG + ": Unexpected error occured: " + nse.getMessage()); return; } UUID appId = PayloadAdapter.byteArrayToUUID(bAppId); if ( appId == null ) { logger.error(TAG, "Received the Dismiss signal for the notifId: '" + msgId + "' with an invalid ApplicationId"); return; } logger.debug(TAG, "Received a dismiss signal for notifId: '" + msgId + "', from appId: '" + appId + "', handling..."); transport.onReceivedNotificationDismiss(msgId, appId); }//dismiss /** * @see org.alljoyn.ns.transport.interfaces.NotificationDismisser#getVersion() */ @Override public short getVersion() throws BusException { return VERSION; }//getVersion } NotificationFeedback.java000066400000000000000000000223241262264444500362100ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/consumer/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport.consumer; import java.util.UUID; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.BusException; import org.alljoyn.bus.ErrorReplyBusException; import org.alljoyn.bus.Mutable; import org.alljoyn.bus.OnJoinSessionListener; import org.alljoyn.bus.ProxyBusObject; import org.alljoyn.bus.SessionListener; import org.alljoyn.bus.Status; import org.alljoyn.ns.Notification; import org.alljoyn.ns.NotificationServiceException; import org.alljoyn.ns.commons.GenericLogger; import org.alljoyn.ns.transport.DismissEmitter; import org.alljoyn.ns.transport.Transport; import org.alljoyn.ns.transport.interfaces.NotificationProducer; import org.alljoyn.ns.transport.producer.SenderSessionListener; /** * The class implements the functionality of sending feedback about the received * {@link Notification}.
* Feedback types:
* 1) dismiss - Notification Producer deletes the {@link Notification} message * and then sends a Dismiss session-less-signal to update Notification Consumers * that this {@link Notification} message has been dismissed.
* * If there is a failure in reaching the Notification Producer to dismiss the * {@link Notification}, the dismiss session-less-signal is sent by the * {@link NotificationFeedback}. */ public class NotificationFeedback extends OnJoinSessionListener { private static final String TAG = "ioe" + NotificationFeedback.class.getSimpleName(); private class NFSessionListener extends SessionListener { /** * @see org.alljoyn.bus.SessionListener#sessionLost(int, int) */ @Override public void sessionLost(int sessionId, int reason) { if (logger != null) { logger.debug(TAG, "Received session lost for sid: '" + sessionId + "', reason: '" + reason + "'"); } }// sessionLest } // ============================================// /** * Handles sequentially the ack | dismiss tasks */ private static ExecutorService taskDispatcher = Executors.newSingleThreadExecutor(); /** * {@link Transport} object */ private final Transport transport; /** * The logger */ private final GenericLogger logger; /** * Session target */ private final String origSender; /** * The notification id */ private final int notifId; /** * The application */ private final UUID appId; /** * Notification version */ private final int version; /** * Constructor * * @param notification * The {@link Notification} to send feedback * @throws NotificationServiceException * If failed to create the {@link NotificationFeedback} */ public NotificationFeedback(Notification notification) throws NotificationServiceException { super(); transport = Transport.getInstance(); logger = transport.getLogger(); version = notification.getVersion(); origSender = notification.getOriginalSenderBusName(); notifId = notification.getMessageId(); appId = notification.getAppId(); } /** * Call the dismiss */ public void dismiss() { taskDispatcher.execute(new Runnable() { @Override public void run() { // Version 1 doesn't support the NotificationProducer interface // and the original sender if (version < 2 || origSender == null) { logger.debug(TAG, "The notification sender version: '" + version + "', doesn't support the NotificationProducer interface, notifId: '" + notifId + "'; appId: '" + appId + "', can't call the Dismiss method, sending the Dismiss signal"); DismissEmitter.send(notifId, appId); return; } invokeDismiss(); }// run }); }// dismiss /** * Calls the remote dismiss method.
* If fails, send the Dismiss signal. The signal should be sent by the * consumer if the producer is not reachable. * * @param status * Session establishment status */ private void invokeDismiss() { BusAttachment bus = transport.getBusAttachment(); if (bus == null) { logger.error(TAG, "Failed to call Dismiss for notifId: '" + notifId + "'; appId: '" + appId + "', BusAttachment is not defined, returning..."); return; } Mutable.IntegerValue sid = new Mutable.IntegerValue(); Status status = establishSession(bus, sid); if (status != Status.OK) { logger.error(TAG, "Failed to call Dismiss method for notifId: '" + notifId + "'; appId: '" + appId + "', session is not established, Error: '" + status + "', Sending a Dismiss signal"); DismissEmitter.send(notifId, appId); return; } logger.debug(TAG, "Handling Dismiss method call for notifId: '" + notifId + "'; appId: '" + appId + "', session: '" + sid.value + "', SessionJoin status: '" + status + "'"); NotificationProducer notifProducer = getProxyObject(bus, sid.value); try { notifProducer.dismiss(notifId); } catch (ErrorReplyBusException erbe) { logger.error(TAG, "Failed to call Dismiss for notifId: '" + notifId + "'; appId: '" + appId + "', ErrorName: '" + erbe.getErrorName() + "', ErrorMessage: '" + erbe.getErrorMessage() + "', sending Dismiss signal"); DismissEmitter.send(notifId, appId); } catch (BusException be) { logger.error(TAG, "Failed to call Dismiss method for notifId: '" + notifId + "'; appId: '" + appId + "', Error: '" + be.getMessage() + "', Sending Dismiss signal"); DismissEmitter.send(notifId, appId); } finally { logger.debug(TAG, "Handled Dismiss for notifId: '" + notifId + "'; appId: '" + appId + "'"); leaveSession(bus, sid.value); } }// invokeDismiss /** * Calls to establish a session with a NotificationProducer * * @param bus * {@link BusAttachment} * @param sessionId * The sessionId that has been created following the request * @return Status The session establish status */ private Status establishSession(BusAttachment bus, Mutable.IntegerValue sessionId) { return bus.joinSession(origSender, SenderSessionListener.PORT_NUM, sessionId, SenderSessionListener.getSessionOpts(), new NFSessionListener()); }// establishSession /** * Leave the session if the sessionId isn't NULL and not zero
* * @param bus * {@link BusAttachment} * @param sid */ private void leaveSession(BusAttachment bus, int sid) { Status status = Status.OK; if (sid == 0) { return; } if (origSender.equals(bus.getUniqueName())) { bus.leaveHostedSession(sid); } else { bus.leaveSession(sid); } if (status == Status.OK) { logger.debug(TAG, "The session: '" + sid + "' was disconnected successfully"); } else { logger.error(TAG, "Failed to disconnect the session: '" + sid + "', Error: '" + status + "'"); } }// leaveSession /** * Create {@link ProxyBusObject} * * @param bus * {@link BusAttachment} * @return Creates and returns the {@link ProxyBusObject}, casted to the * {@link NotificationProducer} object */ private NotificationProducer getProxyObject(BusAttachment bus, int sid) { logger.debug(TAG, "Creating ProxyBusObject with sender: '" + origSender + "', SID: '" + sid + "'"); ProxyBusObject proxyObj = bus.getProxyBusObject(origSender, NotificationProducer.OBJ_PATH, sid, new Class[] { NotificationProducer.class }); return proxyObj.getInterface(NotificationProducer.class); }// getProxyObject } NotificationTransportConsumer.java000066400000000000000000000074001262264444500402320ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/consumer/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport.consumer; import java.util.Map; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.Variant; import org.alljoyn.ns.NotificationServiceException; import org.alljoyn.ns.PayloadAdapter; import org.alljoyn.ns.commons.GenericLogger; import org.alljoyn.ns.commons.NativePlatformFactory; import org.alljoyn.ns.commons.NativePlatformFactoryException; import org.alljoyn.ns.transport.Transport; import org.alljoyn.ns.transport.TransportNotificationText; import org.alljoyn.ns.transport.interfaces.NotificationTransport; /** * The class is used to receive AllJoyn notify session-less-signals */ class NotificationTransportConsumer implements NotificationTransport { private static final String TAG = "ioe" + NotificationTransportConsumer.class.getSimpleName(); /** * Identify object that receives signals arrived from producer */ public static final String FROM_PRODUCER_RECEIVER_PATH = "/producerReceiver"; /** * The service path identifying the object */ private String servicePath; /** * The object service path * @param objServicePath */ public NotificationTransportConsumer(String objServicePath) { servicePath = objServicePath; } /** * Return the object service path * @return */ public String getServicePath() { return servicePath; } /** * This method will be called by the AJ bus when a notification is received * @see org.alljoyn.ns.transport.interfaces.NotificationTransport#notify(int, int, short, String, String, byte[], String, Map, Map, TransportNotificationText[]) */ @Override public void notify(int version, int msgId, short messageType, String deviceId, String deviceName, byte[] appId, String appName, Map attributes, Map customAttributes, TransportNotificationText[] text) { Transport transport = Transport.getInstance(); BusAttachment busAttachment = transport.getBusAttachment(); busAttachment.enableConcurrentCallbacks(); try { GenericLogger logger = NativePlatformFactory.getPlatformObject().getNativeLogger(); try { String sender = busAttachment.getMessageContext().sender; logger.debug(TAG, "Received notification from: '" + sender + "' by '" + servicePath + "' object, notification id: '" + msgId + "', handling"); logger.debug(TAG, "Forwarding the received notification id: '" + msgId + "' to PayloadAdapter"); PayloadAdapter.receivePayload(version, msgId, sender, messageType, deviceId, deviceName, appId, appName, attributes, customAttributes, text); } catch (NotificationServiceException nse) { logger.error(TAG, "Failed to read the received notification, Error: " + nse.getMessage()); } } catch (NativePlatformFactoryException npfe) { System.out.println(TAG + ": Unexpected error occured: " + npfe.getMessage()); } }//notify } ReceiverTransport.java000066400000000000000000000377641262264444500356540ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/consumer/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport.consumer; import java.lang.reflect.Method; import java.util.Map; import java.util.UUID; import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.atomic.AtomicBoolean; import org.alljoyn.bus.AboutObjectDescription; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.BusListener; import org.alljoyn.bus.Status; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.ns.Notification; import org.alljoyn.ns.NotificationReceiver; import org.alljoyn.ns.NotificationServiceException; import org.alljoyn.ns.commons.GenericLogger; import org.alljoyn.ns.commons.NativePlatform; import org.alljoyn.ns.transport.TaskManager; import org.alljoyn.ns.transport.Transport; import org.alljoyn.ns.transport.TransportNotificationText; import org.alljoyn.ns.transport.interfaces.NotificationDismisser; import org.alljoyn.ns.transport.interfaces.NotificationTransport; /** * The class manages NotificationReceiver transport logic */ public class ReceiverTransport { private static final String TAG = "ioe" + ReceiverTransport.class.getSimpleName(); /** * The reference to the platform dependent object */ private final NativePlatform nativePlatform; private static final String SESSION_LESS_RULE = "sessionless='t'"; /** * addMatch rule to receive {@link NotificationTransport} * session-less-signals */ private static final String NOTIF_TRANS_MATCH_RULE = "type='signal',interface='" + NotificationTransport.IF_NAME + "'," + SESSION_LESS_RULE; /** * addMatch rule to receive {@link NotificationDismisser} * session-less-signals */ private static final String DISMISSER_MATCH_RULE = "type='signal',interface='" + NotificationDismisser.IF_NAME + "'," + SESSION_LESS_RULE; /** * The name of the notification signal */ private static final String NOTIF_SIGNAL_NAME = "notify"; /** * The name of the Dismiss signal */ private static final String DISMISS_SIGNAL_NAME = "dismiss"; /** * TRUE means stop forwarding notification messages to notificationReceiver */ private final boolean stopReceiving = false; /** * A BusListener object to handle lostAdvertisedName callbacks */ private BusListener lostAdvertisedNameBusListener; /** * Notification transport producer Receives and handles session less signals * from a regular producers */ private NotificationTransport fromProducerChannel; /** * Receives the Dismiss signals */ private DismissConsumer dismissSignalHandler; /** * Reference to NotificationReceiver object */ private final NotificationReceiver notificationReceiver; /** * Constructor * * @param nativePlatform * The reference to the platform dependent object */ public ReceiverTransport(NativePlatform nativePlatform, NotificationReceiver receiver) { this.notificationReceiver = receiver; this.nativePlatform = nativePlatform; } /** * Starts the service in the Notification Receiver mode * * @throws NotificationServiceException * Is thrown if failed to start the SenderTransport */ public void startReceiverTransport() throws NotificationServiceException { GenericLogger logger = nativePlatform.getNativeLogger(); BusAttachment busAttachment = Transport.getInstance().getBusAttachment(); logger.debug(TAG, "Starting receiver transport"); // Register to receive Notification signals directly from Producers // Additionally calls AddMatch(NOTIF_SLS_BASIC_RULE) registerReceivingProducerNotifications(); // Register to receive Dismiss signals dismissSignalHandler = new DismissConsumer(); boolean regDismissHandler = registerDismissSignalHandler(dismissSignalHandler); if (!regDismissHandler) { logger.error(TAG, "Failed to register Dismiss signal handler"); throw new NotificationServiceException("Failed to register Dismiss signal handler"); } // Add match to receive notification signals from producers addMatchRule(NOTIF_TRANS_MATCH_RULE); // Add Match rule to receive dismiss signals addMatchRule(DISMISSER_MATCH_RULE); }// startReceiverTransp /** * ReceiverTransport cleanups */ public void stopReceiverTransport() { GenericLogger logger = nativePlatform.getNativeLogger(); BusAttachment busAttachment = Transport.getInstance().getBusAttachment(); logger.debug(TAG, "Stopping ReceiverTransport"); Method notifConsumerMethod = getNotificationConsumerSignalMethod(); if (fromProducerChannel != null) { logger.debug(TAG, "Unregister Producer signal handler"); if (notifConsumerMethod != null) { busAttachment.unregisterSignalHandler(fromProducerChannel, notifConsumerMethod); } busAttachment.unregisterBusObject(fromProducerChannel); fromProducerChannel = null; removeMatchRule(NOTIF_TRANS_MATCH_RULE); }// if :: producer if (dismissSignalHandler != null) { logger.debug(TAG, "Unregister Dismiss signal handler"); Method dismisSignalMethod = getDismissSignalMethod(); if (dismisSignalMethod == null) { busAttachment.unregisterSignalHandler(dismissSignalHandler, dismisSignalMethod); } busAttachment.unregisterBusObject(dismissSignalHandler); dismissSignalHandler = null; removeMatchRule(DISMISSER_MATCH_RULE); }// if :: dismiss }// stopReceiverTransport /** * Received notification, call the notification receiver callback to pass * the notification * * @param notification */ public void onReceivedNotification(final Notification notification) { GenericLogger logger = nativePlatform.getNativeLogger(); if (stopReceiving) { logger.debug(TAG, "In stopSending mode NOT delivering notifications!!!"); return; } try { TaskManager.getInstance().execute(new Runnable() { @Override public void run() { notificationReceiver.receive(notification); } }// runnable ); } catch (RejectedExecutionException ree) { logger.error(TAG, "Failed to return a received notification, id: '" + notification.getMessageId() + "', Error: '" + ree.getMessage() + "'"); } }// onReceivedNotification /** * Handle the received Dismiss signal * * @param msgId * The message id of the {@link Notification} that should be * dismissed * @param appId * The appId of the Notification sender service */ public void onReceivedNotificationDismiss(final int msgId, final UUID appId) { GenericLogger logger = nativePlatform.getNativeLogger(); logger.debug(TAG, "Received the Dismiss signal notifId: '" + msgId + "', from the appId: '" + appId + "', delivering to the NotificationReceiver"); try { TaskManager.getInstance().execute(new Runnable() { @Override public void run() { notificationReceiver.dismiss(msgId, appId); } }// runnable ); } catch (RejectedExecutionException ree) { logger.error(TAG, "Failed to deliver the Dismiss event of the notifId: '" + msgId + "', from the appId:'" + appId + "', Error: '" + ree.getMessage() + "'"); } }// onReceivedNotificationDismiss /** * Register receiving {@link Notification} messages directly from * Notification producers Additionally calls AddMatch(NOTIF_SLS_BASIC_RULE) * * @throws NotificationServiceException */ private void registerReceivingProducerNotifications() throws NotificationServiceException { GenericLogger logger = nativePlatform.getNativeLogger(); // Register to receive signals directly from Producers logger.debug(TAG, "Registering to receive signals from producers"); fromProducerChannel = new NotificationTransportConsumer(NotificationTransportConsumer.FROM_PRODUCER_RECEIVER_PATH); boolean regProducerHandler = registerNotificationSignalHandlerChannel(fromProducerChannel, NotificationTransportConsumer.FROM_PRODUCER_RECEIVER_PATH, NotificationTransport.IF_NAME); if (!regProducerHandler) { logger.error(TAG, "Failed to register a Producer signal handler"); throw new NotificationServiceException("Failed to register a Producer signal handler"); } }// regReceivingProducerNotifications /** * Register channel object to receive Notification signals * * @param receiverChannel * Receiver channel object * @param receiverChannelServicePath * The service path of the receiver channel object * @param signalHandlerIfName * The interface name the receiver channel is listening * @param signalName * The signal name that belongs to the interface name * @return TRUE on success or FALSE on fail */ private boolean registerNotificationSignalHandlerChannel(NotificationTransport receiverChannel, String receiverChannelServicePath, String signalHandlerIfName) { GenericLogger logger = nativePlatform.getNativeLogger(); logger.debug(TAG, "Registering signal handler for interface: '" + signalHandlerIfName + "' servicePath: " + receiverChannelServicePath); Method handlerMethod = getNotificationConsumerSignalMethod(); if (handlerMethod == null) { return false; } boolean regRes = Transport.getInstance().registerObjectAndSetSignalHandler(logger, signalHandlerIfName, NOTIF_SIGNAL_NAME, handlerMethod, receiverChannel, receiverChannelServicePath); if (!regRes) { stopReceiverTransport(); // Stop receiver transport to allow later // recovery return false; } return true; }// registerSignalHandlerChannel /** * Registers Dismiss signal receiver * * @param dismissConsumer * @return TRUE on success or FALSE on fail */ private boolean registerDismissSignalHandler(DismissConsumer dismissConsumer) { GenericLogger logger = nativePlatform.getNativeLogger(); logger.debug(TAG, "Registering signal handler for interface: '" + DismissConsumer.IF_NAME + "' servicePath: '" + DismissConsumer.OBJ_PATH + "'"); Method handlerMethod = getDismissSignalMethod(); if (handlerMethod == null) { return false; } String allJoynName = handlerMethod.getAnnotation(BusSignal.class).name(); boolean regRes = Transport.getInstance().registerObjectAndSetSignalHandler(logger, DismissConsumer.IF_NAME, allJoynName, handlerMethod, dismissConsumer, DismissConsumer.OBJ_PATH); if (!regRes) { stopReceiverTransport(); // Stop receiver transport to allow later // recovery return false; } return true; }// registerDismissSignalReceiver /** * Call the method {@link BusAttachment#addMatch(String)} with the given * rule * * @param rule * The rule to add * @throws NotificationServiceException * is throws if the AddMatch return status wasn't OK */ private void addMatchRule(String rule) throws NotificationServiceException { GenericLogger logger = nativePlatform.getNativeLogger(); logger.debug(TAG, "Call AddMatch rule: '" + rule + "'"); BusAttachment bus = Transport.getInstance().getBusAttachment(); Status status = bus.addMatch(rule); if (status != Status.OK) { logger.error(TAG, "Failed to call AddMatch rule: '" + rule + "', Error: '" + status + "'"); throw new NotificationServiceException("Failed to call AddMatch rule: '" + rule + "', Error: '" + status + "'"); } logger.debug(TAG, "Status from AddMatch rule: '" + rule + "', status: '" + status + "'"); }// addMathcRule /** * Call the method {@link BusAttachment#removeMatch(String)} with the given * rule * * @param rule * The rule to add * @return The result status */ private Status removeMatchRule(String rule) { BusAttachment bus = Transport.getInstance().getBusAttachment(); Status status = bus.removeMatch(rule); nativePlatform.getNativeLogger().debug(TAG, "RemoveMatch rule: '" + rule + "' result: '" + status + "'"); return status; }// removeMatchRule /** * Returns reflection of {@link NotificationTransport#notify} method Used to * register signal handler dynamically (without signal annotation on the * method) * * @return Method object or NULL if failed to retrieve */ private Method getNotificationConsumerSignalMethod() { Method retMethod; try { retMethod = NotificationTransport.class.getMethod(NOTIF_SIGNAL_NAME, Integer.TYPE, // version Integer.TYPE, // msgId, Short.TYPE, // messageType, String.class, // deviceId, String.class, // deviceName, byte[].class, // appId, String.class, // appName, Map.class, // attributes Map.class, // customAttributes TransportNotificationText[].class); // text } catch (Exception ex) { nativePlatform.getNativeLogger().error(TAG, "Failed to get a reflection of the signal method: '" + NOTIF_SIGNAL_NAME + "', Error: " + ex.getMessage()); retMethod = null; } return retMethod; }// getNotificationTransportSignalMethod /** * Returns reflection of the {@link DismissConsumer#dismiss(int, byte[])} * * @return Method object or NULL if failed to retrieve */ private Method getDismissSignalMethod() { Method retMethod; try { retMethod = NotificationDismisser.class.getMethod(DISMISS_SIGNAL_NAME, int.class, byte[].class); } catch (Exception ex) { nativePlatform.getNativeLogger().error(TAG, "Failed to get a reflection of the signal method: '" + DISMISS_SIGNAL_NAME + "', Error: " + ex.getMessage()); retMethod = null; } return retMethod; }// getDismissSignalMethod } base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/interfaces/000077500000000000000000000000001262264444500316565ustar00rootroot00000000000000NotificationDismisser.java000066400000000000000000000041401262264444500367520ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport.interfaces; import org.alljoyn.bus.BusException; import org.alljoyn.bus.BusObject; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; /** * The interface provides the functionality to send and receive Dismiss session-less-signals */ @BusInterface(name = NotificationDismisser.IF_NAME) public interface NotificationDismisser extends BusObject { /** * The AllJoyn interface name */ public static final String IF_NAME = "org.alljoyn.Notification.Dismisser"; /** * The interface version */ public static final short VERSION = 1; /** * The Dismiss signal to be sent * @param msgId The notification id the Dismiss signal belongs * @param appId The application id of the Notification Sender */ @BusSignal(signature="iay", name="Dismiss") public void dismiss(int msgId, byte[] appId) throws BusException; /** * @return The interface version * @throws BusException */ @BusProperty(signature="q") public short getVersion() throws BusException; } NotificationProducer.java000066400000000000000000000045731262264444500366050ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport.interfaces; import org.alljoyn.bus.BusException; import org.alljoyn.bus.BusObject; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusMethod; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.ns.Notification; /** * The interface provides to a notification receiver the functionality to dismiss * the received {@link Notification}. */ @BusInterface(name = NotificationProducer.IFNAME) public interface NotificationProducer extends BusObject { /** * The AllJoyn interface name */ public static final String IFNAME = "org.alljoyn.Notification.Producer"; /** * Notification producer object */ public static final String OBJ_PATH = "/notificationProducer"; /** * The interface version */ public static final short VERSION = 1; /** * When the notification message is dismissed, it's first of all deleted and then a dismiss signal is sent * to all notification consumers to update them that the {@link Notification} has been dismissed * @param msgId The notification message identifier * @throws BusException */ @BusMethod(name="Dismiss", signature="i") public void dismiss(int msgId) throws BusException; /** * @return The interface version * @throws BusException */ @BusProperty(signature="q") public short getVersion() throws BusException; } NotificationTransport.java000066400000000000000000000052151262264444500370100ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/interfaces/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport.interfaces; import java.util.Map; import org.alljoyn.bus.BusObject; import org.alljoyn.bus.Variant; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.ns.transport.TransportNotificationText; /** * The interface used to send and receive "session less" notification signals */ @BusInterface(name = NotificationTransport.IF_NAME, announced = "true") public interface NotificationTransport extends BusObject { /** * AllJoyn interface name */ public static final String IF_NAME = "org.alljoyn.Notification"; /** * The interface version */ public static final short VERSION = 1; /** * Use the method to send or receive AJ session less signal * * @param version * The version of the message signature * @param msgId * The notification message id * @param messageType * Notification message type id * @param deviceId * Device Id * @param deviceName * Device Name * @param appId * App Id * @param appName * App Name * @param attributes * Attributes key-value pair * @param customAttributes * customAttributes * @param text * Array of NotificationText objects */ @BusSignal(signature = "qiqssaysa{iv}a{ss}ar") public void notify(int version, int msgId, short messageType, String deviceId, String deviceName, byte[] appId, String appName, Map attributes, Map customAttributes, TransportNotificationText[] text); } base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/producer/000077500000000000000000000000001262264444500313565ustar00rootroot00000000000000NotificationProducerImpl.java000066400000000000000000000103751262264444500371240ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/producer/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport.producer; import org.alljoyn.bus.BusException; import org.alljoyn.bus.BusObject; import org.alljoyn.bus.Status; import org.alljoyn.ns.NotificationServiceException; import org.alljoyn.ns.commons.GenericLogger; import org.alljoyn.ns.commons.NativePlatform; import org.alljoyn.ns.transport.TaskManager; import org.alljoyn.ns.transport.Transport; import org.alljoyn.ns.transport.interfaces.NotificationProducer; /** * The class implements the {@link NotificationProducer} interface and by this * realizes the Notification producer proprietary logic */ class NotificationProducerImpl implements NotificationProducer { private static final String TAG = "ioe" + NotificationProducerImpl.class.getSimpleName(); /** * The Sender transport */ private SenderTransport senderTransport; /** * The reference to the platform dependent object */ private NativePlatform nativePlatform; /** * Constructor * * @param senderTransport * The Sender transport * @param nativePlatform * The reference to the platform dependent object */ public NotificationProducerImpl(SenderTransport senderTransport, NativePlatform nativePlatform) { this.senderTransport = senderTransport; this.nativePlatform = nativePlatform; } /** * Initializes the object
* Register {@link BusObject}, if failed to register the * {@link NotificationServiceException} is thrown * * @throws NotificationServiceException */ public void init() throws NotificationServiceException { Status status = Transport.getInstance().getBusAttachment().registerBusObject(this, OBJ_PATH); nativePlatform.getNativeLogger().debug(TAG, "NotificationProducer BusObject: '" + OBJ_PATH + "' was registered on the bus, Status: '" + status + "'"); if (status != Status.OK) { throw new NotificationServiceException("Failed to register BusObject: '" + OBJ_PATH + "', Error: '" + status + "'"); } }// init /** * @see org.alljoyn.ns.transport.interfaces.NotificationProducer#dismiss(int) */ @Override public void dismiss(final int msgId) throws BusException { GenericLogger logger = nativePlatform.getNativeLogger(); logger.debug(TAG, "Received Dismiss for notifId: '" + msgId + "', delegating to be executed"); Transport.getInstance().getBusAttachment().enableConcurrentCallbacks(); TaskManager.getInstance().enqueue(new Runnable() { @Override public void run() { senderTransport.dismiss(msgId); } }); }// dismiss /** * @see org.alljoyn.ns.transport.interfaces.NotificationProducer#getVersion() */ @Override public short getVersion() throws BusException { return VERSION; }// getVersion /** * Cleans the object resources */ public void clean() { nativePlatform.getNativeLogger().debug(TAG, "Cleaning the NotificationProducerImpl"); Transport.getInstance().getBusAttachment().unregisterBusObject(this); senderTransport = null; nativePlatform = null; }// clean } NotificationTransportProducer.java000066400000000000000000000050351262264444500402140ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/producer/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport.producer; import java.util.EnumMap; import java.util.Map; import org.alljoyn.bus.Variant; import org.alljoyn.ns.Notification; import org.alljoyn.ns.NotificationMessageType; import org.alljoyn.ns.transport.TransportNotificationText; import org.alljoyn.ns.transport.interfaces.NotificationTransport; /** * The class is used to send {@link Notification} session less signals */ class NotificationTransportProducer implements NotificationTransport { /** * Stores AJ BusObject identifiers * Maps from Message type to ServicePath string */ private static Map servicePath; static { servicePath = new EnumMap(NotificationMessageType.class); servicePath.put(NotificationMessageType.EMERGENCY, "/emergency"); servicePath.put(NotificationMessageType.WARNING, "/warning"); servicePath.put(NotificationMessageType.INFO, "/info"); } /** * Returns the servicePath for each of the transport objects * @return */ public static Map getServicePath() { return servicePath; } /** * Use this method to send session less signals * @see org.alljoyn.ns.transport.interfaces.NotificationTransport#notify(int, int, short, String, String, byte[], String, Map, Map, TransportNotificationText[]) */ @Override public void notify(int version, int msgId, short messageType, String deviceId, String deviceName, byte[] appId, String appName, Map attributes, Map customAttributes, TransportNotificationText[] text) {} } SenderSessionListener.java000066400000000000000000000122311262264444500364330ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/producer/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport.producer; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.Mutable.ShortValue; import org.alljoyn.bus.SessionOpts; import org.alljoyn.bus.SessionPortListener; import org.alljoyn.bus.Status; import org.alljoyn.ns.NotificationServiceException; import org.alljoyn.ns.commons.GenericLogger; import org.alljoyn.ns.commons.NativePlatform; import org.alljoyn.ns.transport.Transport; /** * Prepares the Notification sender to receive incoming connections
* - Bind session port
* - Register session port listener
* - Handle incoming connections */ public class SenderSessionListener extends SessionPortListener { private static final String TAG = "ioe" + SenderSessionListener.class.getSimpleName(); /** * The reference to the platform dependent object */ private NativePlatform nativePlatform; /** * The port number to listen for incoming connections */ public static final short PORT_NUM = 1010; /** * Constructor * @param nativePlatform The reference to the platform dependent object */ public SenderSessionListener(NativePlatform nativePlatform) { super(); this.nativePlatform = nativePlatform; } /** * Initializes the object
* - Bind session port
* - Register session port listener
* @throws NotificationServiceException */ public void init() throws NotificationServiceException { BusAttachment bus = Transport.getInstance().getBusAttachment(); Status status = bus.bindSessionPort(new ShortValue(PORT_NUM), getSessionOpts(), this); nativePlatform.getNativeLogger().debug(TAG, "Session port: '" + PORT_NUM + "' was bound on the bus: '" + status + "'"); if ( status != Status.OK ) { throw new NotificationServiceException("Failed to bind session port: '" + PORT_NUM + "', Error: '" + status + "'"); } }//init /** * Cleans the object resources */ public void clean() { GenericLogger logger = nativePlatform.getNativeLogger(); logger.debug(TAG, "Cleaning the SenderSessionListener"); BusAttachment bus = Transport.getInstance().getBusAttachment(); Status status = bus.unbindSessionPort(PORT_NUM); if ( status != Status.OK ) { nativePlatform.getNativeLogger().error(TAG, "Failed to unbind the port number: '" + PORT_NUM + "', Error: '" + status + "'"); } nativePlatform = null; }//clean /** * @see org.alljoyn.bus.SessionPortListener#acceptSessionJoiner(short, java.lang.String, org.alljoyn.bus.SessionOpts) */ @Override public boolean acceptSessionJoiner(short sessionPort, String joiner, SessionOpts opts) { if ( nativePlatform == null ) { // Protection - this may happens if the clean has been called, but daemon had some events in its stack return false; } GenericLogger logger = nativePlatform.getNativeLogger(); logger.debug(TAG, "Received SessionJoiner request from: '" + joiner + "', requested port: '" + sessionPort + "'"); if ( sessionPort == PORT_NUM ) { return true; } return false; }//acceptSessionJoiner /** * @see org.alljoyn.bus.SessionPortListener#sessionJoined(short, int, java.lang.String) */ @Override public void sessionJoined(short sessionPort, int id, String joiner) { if ( nativePlatform == null ) { return; } GenericLogger logger = nativePlatform.getNativeLogger(); logger.debug(TAG, "The session was established with: '" + joiner + "', SID: '" + id + "'"); }//sessionJoined /** * @return {@link SessionOpts} */ public static SessionOpts getSessionOpts() { SessionOpts sessionOpts = new SessionOpts(); sessionOpts.traffic = SessionOpts.TRAFFIC_MESSAGES; // Use reliable message-based communication to move data between session endpoints sessionOpts.isMultipoint = false; // A session is multi-point if it can be joined multiple times sessionOpts.proximity = SessionOpts.PROXIMITY_ANY; // Holds the proximity for this SessionOpt sessionOpts.transports = SessionOpts.TRANSPORT_ANY; // Holds the allowed transports for this SessionOpt return sessionOpts; }//getSessionOpts } SenderTransport.java000066400000000000000000000250771262264444500353120ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/producer/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport.producer; import java.util.EnumMap; import java.util.Map; import java.util.UUID; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.Variant; import org.alljoyn.ns.NotificationMessageType; import org.alljoyn.ns.NotificationServiceException; import org.alljoyn.ns.commons.GenericLogger; import org.alljoyn.ns.commons.NativePlatform; import org.alljoyn.ns.transport.DismissEmitter; import org.alljoyn.ns.transport.Transport; import org.alljoyn.ns.transport.TransportNotificationText; import org.alljoyn.ns.transport.interfaces.NotificationProducer; /** * The class manages NotificationProducer transport logic */ public class SenderTransport { private static final String TAG = "ioe" + SenderTransport.class.getSimpleName(); /** * The reference to the platform dependent object */ private final NativePlatform nativePlatform; /** * TRUE means to stop sending notification messages */ private final boolean stopSending = false; /** * Map NotificationMessageType to transport object */ private Map transportSenderChannels; /** * The object implements the {@link NotificationProducer} interface */ private NotificationProducerImpl notifProducerBusObj; /** * Prepares the AllJoyn daemon to receive incoming session requests */ private SenderSessionListener sessionListener; /** * Constructor * * @param nativePlatform * The reference to the platform dependent object */ public SenderTransport(NativePlatform nativePlatform) { this.nativePlatform = nativePlatform; } /** * Starts the service in the Notification Sender mode * * @throws NotificationServiceException * Is thrown if failed to start the SenderTransport */ public void startSenderTransport() throws NotificationServiceException { GenericLogger logger = nativePlatform.getNativeLogger(); BusAttachment busAttachment = Transport.getInstance().getBusAttachment(); logger.debug(TAG, "Starting a sender transport"); // Creating transportChannel objects transportSenderChannels = new EnumMap(NotificationMessageType.class); try { for (NotificationMessageType messageType : NotificationMessageType.values()) { transportSenderChannels.put(messageType, new TransportChannelObject(messageType, busAttachment, nativePlatform)); } } catch (NotificationServiceException nse) { logger.error(TAG, nse.getMessage()); throw nse; } // Initialize the NotificationProducer BusObject notifProducerBusObj = new NotificationProducerImpl(this, nativePlatform); notifProducerBusObj.init(); // Create session listener to be ready to handle incoming connections sessionListener = new SenderSessionListener(nativePlatform); sessionListener.init(); // //Send the Announce signal with all the NotificationService related // BusObjectDescription objects // if ( aboutObj != null ) { // aboutObj.announce(); // } }// startSenderTransport /** * SenderTransport cleanups */ public void stopSenderTransport() { GenericLogger logger = nativePlatform.getNativeLogger(); BusAttachment busAttachment = Transport.getInstance().getBusAttachment(); logger.debug(TAG, "Stopping SenderTransport"); if (transportSenderChannels != null) { for (NotificationMessageType pr : transportSenderChannels.keySet()) { transportSenderChannels.get(pr).clean(busAttachment); } transportSenderChannels = null; } if (sessionListener != null) { sessionListener.clean(); sessionListener = null; } if (notifProducerBusObj != null) { notifProducerBusObj.clean(); notifProducerBusObj = null; } // if ( aboutObj != null ) { // //Send the Announce signal after removing NotificationService related // BusObjectDescription objects // aboutObj.announce(); // } }// stopSenderTransport /** * Called when we need to send a signal * * @param version * The version of the message signature * @param msgId * notification Id the id of the sent signal * @param messageType * The message type of the sent message * @param deviceId * Device id * @param deviceName * Device name * @param appId * App id * @param appName * App name * @param attributes * All the notification metadata * @param customAttributes * The customAttributes * @param text * Array of texts to be sent * @param ttl * Notification message TTL * @throws NotificationServiceException */ public void sendNotification(int version, int msgId, NotificationMessageType messageType, String deviceId, String deviceName, byte[] appId, String appName, Map attributes, Map customAttributes, TransportNotificationText[] text, int ttl) throws NotificationServiceException { GenericLogger logger = nativePlatform.getNativeLogger(); if (stopSending) { logger.debug(TAG, "In stopSending mode NOT sending notification!!!"); return; } TransportChannelObject senderChannel = transportSenderChannels.get(messageType); if (senderChannel == null) { throw new NotificationServiceException("Received an unknown message type: '" + messageType + "', can't find a transport channel to send the notification"); } // send this notification to the correct object based on messageType senderChannel.sendNotification(version, msgId, messageType.getTypeId(), deviceId, deviceName, appId, appName, attributes, customAttributes, text, ttl); }// sendNotification /** * Cancel the last message sent for the given messageType * * @param messageType * @throws NotificationServiceException */ public void deleteLastMessage(NotificationMessageType messageType) throws NotificationServiceException { TransportChannelObject senderChannel = transportSenderChannels.get(messageType); if (senderChannel == null) { throw new NotificationServiceException("Received an unknown message type: '" + messageType + "', can't find a transport channel to delete the notification"); } // delete the last message of this messageType senderChannel.deleteNotification(); }// deleteLastMessage /** * Try to find and delete the notification by the given notifId, and then * send dismiss session-less-signal * * @param notifId */ public void dismiss(int notifId) { GenericLogger logger = nativePlatform.getNativeLogger(); Transport transport = Transport.getInstance(); logger.debug(TAG, "Dismiss method has been called, trying to find and delete the notification by its id: '" + notifId + "'"); deleteNotificationById(notifId); // Sending dismiss signal try { UUID appId = transport.getAppId(transport.readAllProperties()); DismissEmitter.send(notifId, appId); } catch (NotificationServiceException nse) { logger.error(TAG, "Unable to send the Dismiss signal for notifId: '" + notifId + "', Error: '" + nse.getMessage() + "'"); } }// dismiss /** * @param notifId * The notification id of the notification message to be deleted */ private void deleteNotificationById(int notifId) { GenericLogger logger = nativePlatform.getNativeLogger(); logger.debug(TAG, "Trying to delete the notification by id: '" + notifId + "', searching for the relevant object"); boolean isObjFound = false; for (TransportChannelObject channelObj : transportSenderChannels.values()) { channelObj.acquireLock(); // Lock the object to prevent changing its // state Integer chanObjNotifId = channelObj.getNotificationId(); if (chanObjNotifId != null && chanObjNotifId == notifId) { // Found // the // object // to be // cancelled logger.debug(TAG, "Found the object with notifId: '" + notifId + "' to be cancelled"); channelObj.deleteNotification(); isObjFound = true; channelObj.releaseLock(); // release the lock break; } else { channelObj.releaseLock(); // release the lock and continue // iterating } } if (!isObjFound) { logger.debug(TAG, "Failed to find the Notification with Id: '" + notifId + "'"); } } } TransportChannelObject.java000066400000000000000000000204361262264444500365630ustar00rootroot00000000000000base-15.09/notification/java/NotificationService/src/org/alljoyn/ns/transport/producer/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.transport.producer; import java.util.Map; import java.util.concurrent.locks.ReentrantLock; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.SignalEmitter; import org.alljoyn.bus.Status; import org.alljoyn.bus.Variant; import org.alljoyn.ns.NotificationMessageType; import org.alljoyn.ns.NotificationServiceException; import org.alljoyn.ns.commons.GenericLogger; import org.alljoyn.ns.commons.NativePlatform; import org.alljoyn.ns.transport.TransportNotificationText; import org.alljoyn.ns.transport.interfaces.NotificationTransport; /** * Utility class used to store and manage sending notification messages */ class TransportChannelObject { private static final String TAG = "ioe" + TransportChannelObject.class.getSimpleName(); /** * The object thread lock */ private final ReentrantLock LOCK; /** * Notification message type */ private final NotificationMessageType messageType; /** * The object path of the BusObject that is used to send the Notification * signals */ private final String servicePath; /** * Signal emitter that generated the transportChannel */ private SignalEmitter emitter; /** * NotificationTransport object that is registered on the bus */ private NotificationTransport transportObj; /** * Reference to Native platform object */ private final NativePlatform nativePlatform; /** * The serialId of the last sent message */ private volatile Integer lastMsgSerialId; /** * The notification id of the last sent message */ private volatile Integer lastNotifId; /** * Constructor * * @param messageType * @param busAttachment * @throws NotificationServiceException */ public TransportChannelObject(NotificationMessageType messageType, BusAttachment busAttachment, NativePlatform nativePlatform) throws NotificationServiceException { this.messageType = messageType; this.nativePlatform = nativePlatform; GenericLogger logger = nativePlatform.getNativeLogger(); this.LOCK = new ReentrantLock(true); this.transportObj = new NotificationTransportProducer(); this.lastMsgSerialId = null; servicePath = NotificationTransportProducer.getServicePath().get(messageType); // Perform registerBusObject with a given messageType Status status = busAttachment.registerBusObject(transportObj, servicePath); if (status != Status.OK) { logger.debug(TAG, "Failed to registerBusObject status: '" + status + "'"); throw new NotificationServiceException("Failed to prepare sending channel"); } // Initializing sessionless signal manager for sending signals later. logger.debug(TAG, "Initializing signal emitter for sessionless signal, MessageType: '" + messageType + "'"); emitter = new SignalEmitter(transportObj, SignalEmitter.GlobalBroadcast.Off); emitter.setSessionlessFlag(true); }// Constructor /** * Acquires the lock of the object
* Very important to call the releaseLock method to release the lock */ public void acquireLock() { LOCK.lock(); }// acquireLock /** * Releases the lock of the object */ public void releaseLock() { LOCK.unlock(); }// releaseLock /** * Returns the notification id of the last sent message */ public Integer getNotificationId() { return lastNotifId; }// getNotificationId /** * Called when we need to send a signal * * @param version * The version of the message signature * @param msgId * Notification Id the id of the sent signal * @param messageType * Message type id * @param deviceId * Device id * @param deviceName * Device name * @param appId * App id * @param appName * App name * @param attributes * All the notification metadata * @param customAttributes * The customAttributes * @param text * Array of texts to be sent * @param ttl * Notification message TTL * @throws NotificationServiceException */ public void sendNotification(int version, int msgId, short messageType, String deviceId, String deviceName, byte[] appId, String appName, Map attributes, Map customAttributes, TransportNotificationText[] text, int ttl) throws NotificationServiceException { GenericLogger logger = nativePlatform.getNativeLogger(); logger.debug(TAG, "Sending notification message for messageType: '" + messageType + "' message id: '" + msgId + "', ttl: '" + ttl + "'"); emitter.setTimeToLive(ttl); NotificationTransport transportChannel = emitter.getInterface(NotificationTransport.class); LOCK.lock(); // The lock protects the lastMsgSerialId try { transportChannel.notify(version, msgId, messageType, deviceId, deviceName, appId, appName, attributes, customAttributes, text); lastMsgSerialId = emitter.getMessageContext().serial; lastNotifId = msgId; logger.debug(TAG, "The message was sent successfully. messageType: '" + messageType + "' message id: '" + msgId + "' SerialId: '" + lastMsgSerialId + "'"); } catch (Exception e) { logger.error(TAG, "Failed to call notify to send notification"); throw new NotificationServiceException("Failed to send notification", e); } finally { LOCK.unlock(); } }// sendNotification /** * Called when we need to delete a signal */ public void deleteNotification() { GenericLogger logger = nativePlatform.getNativeLogger(); LOCK.lock(); // The lock protects the lastMsgSerialId try { if (lastMsgSerialId == null) { logger.warn(TAG, "Unable to delete last message for messageType: '" + messageType + "'. No message was previously sent from this object, lastMsgSerialId is NULL"); return; } logger.debug(TAG, "Deleting last notification message for messageType: '" + messageType + "', MsgSerialId: '" + lastMsgSerialId + "'"); Status status = emitter.cancelSessionlessSignal(lastMsgSerialId); if (status == Status.OK) { logger.debug(TAG, "The notification message deleted successfully, messageType: '" + messageType + "', MsgSerialId: '" + lastMsgSerialId + "', lastNotifId: '" + lastNotifId + "'"); lastMsgSerialId = null; lastNotifId = null; } else { logger.warn(TAG, "Failed to delete last message for messageType: '" + messageType + "'. Status: '" + status + "'"); } } finally { LOCK.unlock(); } }// deleteNotification /** * Unregister bus object from AJ bus, Set to null emitter, transportChannel, * transportObj */ public void clean(BusAttachment busAttachment) { deleteNotification(); busAttachment.unregisterBusObject(transportObj); transportObj = null; emitter = null; lastMsgSerialId = null; lastNotifId = null; }// clean } base-15.09/notification/java/NotificationServiceCommons/000077500000000000000000000000001262264444500233655ustar00rootroot00000000000000base-15.09/notification/java/NotificationServiceCommons/.classpath000066400000000000000000000004471262264444500253550ustar00rootroot00000000000000 base-15.09/notification/java/NotificationServiceCommons/.project000066400000000000000000000006011262264444500250310ustar00rootroot00000000000000 NotificationServiceCommons org.eclipse.jdt.core.javabuilder org.eclipse.jdt.core.javanature base-15.09/notification/java/NotificationServiceCommons/.settings/000077500000000000000000000000001262264444500253035ustar00rootroot00000000000000base-15.09/notification/java/NotificationServiceCommons/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000011511262264444500322630ustar00rootroot00000000000000#Thu Feb 07 09:41:55 IST 2013 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.6 base-15.09/notification/java/NotificationServiceCommons/build.xml000066400000000000000000000040161262264444500252070ustar00rootroot00000000000000 base-15.09/notification/java/NotificationServiceCommons/src/000077500000000000000000000000001262264444500241545ustar00rootroot00000000000000base-15.09/notification/java/NotificationServiceCommons/src/org/000077500000000000000000000000001262264444500247435ustar00rootroot00000000000000base-15.09/notification/java/NotificationServiceCommons/src/org/alljoyn/000077500000000000000000000000001262264444500264135ustar00rootroot00000000000000base-15.09/notification/java/NotificationServiceCommons/src/org/alljoyn/ns/000077500000000000000000000000001262264444500270335ustar00rootroot00000000000000base-15.09/notification/java/NotificationServiceCommons/src/org/alljoyn/ns/commons/000077500000000000000000000000001262264444500305065ustar00rootroot00000000000000GenericLogger.java000066400000000000000000000037551262264444500340200ustar00rootroot00000000000000base-15.09/notification/java/NotificationServiceCommons/src/org/alljoyn/ns/commons/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.commons; /** * Implement this interface to provide logging functionality for the Notification service */ public interface GenericLogger { /** * Debug level message * @param TAG Tag to be added to the message, i.e. class that writes the message * @param msg */ public void debug(String TAG, String msg); /** * Info level message * @param TAG Tag to be added to the message, i.e. class that writes the message * @param msg */ public void info(String TAG, String msg); /** * Warn level message * @param TAG Tag to be added to the message, i.e. class that writes the message * @param msg */ public void warn(String TAG, String msg); /** * Error level message * @param TAG Tag to be added to the message, i.e. class that writes the message * @param msg */ public void error(String TAG, String msg); /** * Fatal level message * @param TAG Tag to be added to the message, i.e. class that writes the message * @param msg */ public void fatal(String TAG, String msg); } NativePlatform.java000066400000000000000000000025261262264444500342320ustar00rootroot00000000000000base-15.09/notification/java/NotificationServiceCommons/src/org/alljoyn/ns/commons/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.commons; /** * Implement this interface to provide platform dependent functionality for the Notification service */ public interface NativePlatform { /** * Returns reference to GenericLogger object */ public GenericLogger getNativeLogger(); /** * Set a GenericLogger object * @param logger */ public void setNativeLogger(GenericLogger logger); } NativePlatformAbstrImpl.java000066400000000000000000000033571262264444500360530ustar00rootroot00000000000000base-15.09/notification/java/NotificationServiceCommons/src/org/alljoyn/ns/commons/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.commons; /** * The abstract parent class for all the classes implementing platform dependent logic */ public abstract class NativePlatformAbstrImpl implements NativePlatform { /** * Reference to logger */ protected GenericLogger logger; /** * Constructor */ public NativePlatformAbstrImpl() { createLogger(); } /** * Creates and set logger object */ protected abstract void createLogger(); /** * @see org.alljoyn.ns.commons.NativePlatform#getNativeLogger() */ @Override public GenericLogger getNativeLogger() { return logger; } /** * @see org.alljoyn.ns.commons.NativePlatform#setNativeLogger(org.alljoyn.ns.commons.GenericLogger) */ @Override public void setNativeLogger(GenericLogger logger) { this.logger = logger; } } NativePlatformFactory.java000066400000000000000000000113571262264444500355640ustar00rootroot00000000000000base-15.09/notification/java/NotificationServiceCommons/src/org/alljoyn/ns/commons/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.commons; /** * The factory class for the classes extending {@link NativePlatformAbstrImpl}
* According to the platform that the service is running on, the appropriate platform dependent class is * instantiated and returned */ public class NativePlatformFactory { /** * Supported OS platforms */ private static enum OSPlatform { WINDOWS ("Windows",""), ANDROID ("Android","org.alljoyn.ns.nativeplatform.NativePlatformAndroid"), LINUX ("Linux", ""); /** * Name of the platform to look for in System properties */ public final String NAME; /** * Class name to load the native platform implementation class dynamically */ public final String CLASS_NAME; /** * Constructor * @param name * @param className */ private OSPlatform(String name, String className) { NAME = name; CLASS_NAME = className; } }//enum :: Platform //=====================================================// /** * Reference to native platform object */ private static volatile NativePlatform nativePlatform = null; /** * Sytem.os.name */ private static String osPlatform; /** * System.java.vm.vendor */ private static String vmVendor; /** * Constructor * We want to prevent possibility to create objects of this class */ private NativePlatformFactory(){} /** * Returns reference to the native platform object * @return reference to the NativePlatform object * @throws NativePlatformFactoryException throws exception if failed to recognize the platform or * to instantiate the native platform object */ public static NativePlatform getPlatformObject() throws NativePlatformFactoryException { if ( nativePlatform != null ) { return nativePlatform; } OSPlatform osPlatformType = identifyPlatform(); if ( osPlatformType == null || osPlatformType.CLASS_NAME.isEmpty() ) { throw new NativePlatformFactoryException("Failed to find NativePlatform class for os: '" + osPlatformType + "', vmVendor: '" + vmVendor + "'"); } synchronized (NativePlatformFactory.class) { if ( nativePlatform == null ) { nativePlatform = getClassInstance(osPlatformType.CLASS_NAME); }//if :: nativePlatform == null }//synchronized return nativePlatform; }//getPlatformObject /** * Uses reflection to load class dynamically and create its instance * @param className */ private static NativePlatform getClassInstance(String className) throws NativePlatformFactoryException { NativePlatform nativePlatformObj; try { @SuppressWarnings("unchecked") Class nativePlatformClass = (Class) Class.forName(className); nativePlatformObj = nativePlatformClass.newInstance(); } catch (ClassNotFoundException e) { throw new NativePlatformFactoryException("Failed to load class: '" + className + "'",e); } catch(IllegalAccessException ilae) { throw new NativePlatformFactoryException(ilae); } catch (InstantiationException ie) { throw new NativePlatformFactoryException(ie); } return nativePlatformObj; }//getClassInstance /** * Identifies the platform this code is executed on * @return if platform isn't recognized, return NULL */ private static OSPlatform identifyPlatform() { osPlatform = System.getProperty("os.name", ""); vmVendor = System.getProperty("java.vm.vendor", ""); if ( osPlatform.isEmpty() ) { return null; } if ( osPlatform.indexOf(OSPlatform.WINDOWS.NAME) > -1 ) { return OSPlatform.WINDOWS; }//if :: windows if ( osPlatform.indexOf(OSPlatform.LINUX.NAME) > -1 ) { //Check Android if ( !vmVendor.isEmpty() && vmVendor.indexOf(OSPlatform.ANDROID.NAME) > -1 ) { return OSPlatform.ANDROID; } return OSPlatform.LINUX; }//if :: linux return null; }//identifyPlatform }//NativePlatformFactory NativePlatformFactoryException.java000066400000000000000000000031611262264444500374350ustar00rootroot00000000000000base-15.09/notification/java/NotificationServiceCommons/src/org/alljoyn/ns/commons/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.commons; /** * The exception is thrown if there was a failure in loading and instantiating the class * implementing platform dependent logic */ public class NativePlatformFactoryException extends Exception { /** * Serializable id */ private static final long serialVersionUID = 8554726459608620712L; public NativePlatformFactoryException() { super(); } public NativePlatformFactoryException(String message, Throwable throwable) { super(message, throwable); } public NativePlatformFactoryException(String message) { super(message); } public NativePlatformFactoryException(Throwable throwable) { super(throwable); } } base-15.09/notification/java/NotificationServiceCommons/src/org/alljoyn/ns/commons/package-info.java000066400000000000000000000021571262264444500337020ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ /** * The package includes generic classes that are used by other packages of the Notification service */ package org.alljoyn.ns.commons;base-15.09/notification/java/native_platform/000077500000000000000000000000001262264444500212545ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/000077500000000000000000000000001262264444500314005ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/.classpath000066400000000000000000000011571262264444500333670ustar00rootroot00000000000000 base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/.project000066400000000000000000000015131262264444500330470ustar00rootroot00000000000000 NotificationServiceNativePlatformAndroid com.android.ide.eclipse.adt.ResourceManagerBuilder com.android.ide.eclipse.adt.PreCompilerBuilder org.eclipse.jdt.core.javabuilder com.android.ide.eclipse.adt.ApkBuilder com.android.ide.eclipse.adt.AndroidNature org.eclipse.jdt.core.javanature base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/.settings/000077500000000000000000000000001262264444500333165ustar00rootroot00000000000000org.eclipse.jdt.core.prefs000066400000000000000000000011511262264444500402170ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/.settings#Wed Feb 27 15:25:55 IST 2013 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.6 AndroidManifest.xml000066400000000000000000000033011262264444500351070ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/build.xml000066400000000000000000000256021262264444500332260ustar00rootroot00000000000000 AllJoyn™ Notification Service Version 15.09.00]]> AllJoyn™ Notification Service Java API Reference Manual Version 15.09.00
Copyright AllSeen Alliance, Inc. All Rights Reserved.

AllSeen, AllSeen Alliance, and AllJoyn are trademarks of the AllSeen Alliance, Inc in the United States and other jurisdictions.

THIS DOCUMENT AND ALL INFORMATION CONTAIN HEREIN ARE PROVIDED ON AN "AS-IS" BASIS WITHOUT WARRANTY OF ANY KIND.
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
]]>
ic_launcher-web.png000066400000000000000000001546771262264444500351020ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid‰PNG  IHDRôxÔú€IDATxÚěÝXgú6pMĎî&›dÓ7EcEDé(M;ŠÝŘbŹ˝Ävě VDÄ‚ ,(©"HAAŠ H?gžďťĂŞď33ţ=źÉîf“çŢëwíµě98Îs×;ď4jDˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …BˇP( …Bůý Ń+RôSˇĐ±EˇP(t’¦PčآP(:IS(tlQ( ť¤):¶( ĺżu˘U˝žŞ7y©ĺă>LŻňŃâ˙ö ˛|“w>Ýţ :ISţ“ŕL|÷¨žJ9‰fÇ&/ţŃŕ÷UA–MxŢŢNŤé'JˇPţD'P`'MŐ«Čt1,1,•5/©r˛/sţ‰ÄЉľ‡b-my^1–ĆJ¦Šý9<Ą?“B‘”Pvś85Ćäe2fý”ł§©6R(ň“jTÁ^1ůcGň˘ŠFG˙ţDDŃČŕ#±Öăy‡cl¨Ľ[˝Îs‹6xM~RĄ…Ąc“'=NUŻ&ÂÄwÓaĘ_yɵ“V&×Mry"©füćŕü×xA9Ľ7ťng†ř´oˇô=бJˇPţ$'Yĺ푨.™Pžo˘šŽćŘM»,ŢŃŘ.kO7˙Ś·Ę燔ţ\4z•÷G8Ń*˙|•€Ý>÷Źx\ŠÖ›]áó”Ţk&üÔ!&tć…=RĚT?q˝dpµW¤ đö…Z-ŮÓn#Oµ§ÝŮ÷ˇbC_r·€ř1:sP(*T¨P P(*T¨P P(*T¨P P(”ßń€zUB6Śö[Żń ¶ňâޞ­=e OEwŃxßęú‰ëëqÝĚ^˘Ăďą(ăßŇŻ)˙Ţďí÷S)‘Ş /®zô°[U٦ń®ä;•]Éď_űÄĺÜ~µ».[ ŰýÍďÍsŐ›‰lÓëC€Bˇüi"žĚÄ-PyJwˇ»Q˙EîFăx;.šVîĽd*<±+ŔL8yŰx'ş–Ś´ň¬g)]ľŹ˙L˙Ŕ»±FA €˝^•xéÁ«đµtüŢ_óŞŇ ˙Ťß0Ľ¨ 6BŐ›ëßáEWŚ8U1"†ç›l_ď“ÔMxâxBWÍâ=ú%Ľ…nú7ť'·¶ä ™Ü¦ŤükôŠ;yŤč. …B€ * …B€ * …B€ * …ň;Ťöd+.tâ( %îFmąń¶ś5ąézÖ4ő‰­~¦éGblA˘ęhL—XŢáŰ˝{‚L[ó<®›}¦Ë÷ń˙1(ąÉŢŻů\Ý(}-ůb¶ E–HĂB¸÷÷¦ëÂCÝ~–˙Ă_a!*W7Z?ľf¬-ďZ‘óŤŕsyűì4ž×-…'<®u®›ëÚî2oÖ¦vűNiÝ”7tZ‹OµĂ]Bz\R P( pÂS¸úRúÔ5GŚ2'źXçmrĆ3´3đö‡[Áń[Ýc7íâö›Ťŕą™żěo'”‡–ŇŻü ýżń#O§×ÓÁţ ^»ş•bC9Ď^÷ß)‰şü†Aôr…MűŰnů»Y=jdlͨ5ĽK9}\¸Űx›Ď‹ŻŃSNUŹ] ·XbĽ.Wű´âźBˇP @€ …BˇP @€ …BˇP @€ …BˇüŻGĄbC_Béäľ|żi˙űL=±ŇËdÔö‹f%<·@‹˛Ł±]€w$Ć6ßë†őIŢp«©Ű ?ŕąť5x[i›by)Đu›. 㦼Që˙Á«†ť_×G^=xZŞÁÓ‘W »ťë`÷HĚmBěšÂ«íłj`Űl^-ě™#·{.ŻÜŮk÷ü,1ą<ĆJ Ż‚˝ýyŹaO·rp·ŕUŔ®–Ą°á+ŢŘţn"¨^ç)˙<_ĽPéQşĎ#ý{N€1§ÔLhÎ -ęňpPďDB·Ę#â1ĹY¶ß kÉ^̧< ~śŃÚ”7rv»v˛˛"bÇ:ŇüQ(”?Ó/´+ź_\¦­´řtú ëĎźX¸Ů¬ą‹ŹŃ=ž«źIţáh¨9m›ĎóŠ´Ůľő˘á7ĽMAíŢ“~oâŔŹŽ÷ŻáŠß§ű{µl‚©Ţ­—ďyő°ËD Cx¬Lc%`5Żöěf˙(Żv]`C˙ Żv†2á<öą7ä<"$nÔ€G°D+§xŐŕîU®ĽJp_Tî“xe°Ăľ6ňňÁőŁ[°ţŢËn,~ž.w7¨ĘCjí¸’ę'Řň®=pľ~µ`@-o¸•ŕ~Őxł·č…ĎpŃ á\řúëŻßä5kÖěŤçü¦ë …B€ * …B€ * …B€ * …ň?_ĐÖ¬’ÝĐXľ‰l˛|o•—ńrŢ:o·]fjŢžŕNőGbşÔđEŮDě łXĹó 1·T^řâ5ŕÚ´v4ç©aď@Ěcx=¸mäŐÁŽťŐ°ů<Ż \®TÂşhŢcX_«Óxĺ°2»Vćb« ŮńŘë2%ĽG°)UIĚ•)„9ĹŘÜ`~öË˝BXÉ{ “ ań-LZKŻ`+ŔjŢ}ÍÚ©yšµăy9u yŮu.ú· f˝Ă Ë™ţ–.; Š ó@ő6ďĆŁaă 9ĚóKď™ă›ä áąřšÔ¬:ܱš7aY›qc´öÔ˘VÎěnĚsrjÔXľâż­ř§P(i”nÉ“ľfś›Ák‹vš:óVî7™íęg\ĎŰ`®–®Üf {_X'?äz§ŢŢŤót˝µ¬¶µŻ‡m&< x,Áö¬aC?šW;“ŘĐŻáUÁ†şÇ° x°Ę@%±Dć,ÖI1Ě•y0Q&&HL„ű0Ub{í $f3óX¤)•šW+ň aUďľfŤ'ú;y÷Ô.=‘ú ]o–N{Ź—ř`⻺•Í)o”ŔÜżńÂJ/»^2(žÇ~ąôŽ’^«îÖĚ0ąąYʎßë=Ń}X‹Öň?”nůŁP(*T¨P P(*T¨P( … * …ňçŽtń–´¨‚,›LßhňwŢ’ýFm×6ňĺm:ećqµđö†t®=fý·űŞ…çú3íđ˘îLęŕfÎ«×¸Ż¨ÓěŢÍ«­15ŕz›W+ó°ů Şä•ĂŇęǰBŔV •°F­Ő<†uj^Ą‚ǰ–YTŔj‘†Ç†>3ç©"­ą‘L¤I~RęT‰č«N–HbˇŻë/$‚’ë’`H-˘Uś¤ý€—˘ž’ÔOMJ®źĺÍK¬™í–P=4/ľfˇí­‚őďđ"JFZ„• źÍ»t·OđąLÇ*ž[`'őĆSĆŔ›±Y˙Đ„ĺm\y'´yßÉé‹·xJ‹XeŰ`S( EÇß °/ŐHr •ĘÝč‹ĺű ÷đ\N\Üh<Źŕΰ?ĚŮ}µÓéugŰOâĹÜ™4€ ýî<6đ˝ę„ÝWy¬T°ˇ_Ç+‡e€-eWß 2XČ®î—"b >¶ž x—z^•‚JŘŔ¬GJĆ 3ç©"ĄÎ€H:ôgĂÝIf’ G=/ş×'€öę[qŕ ÄAwŕĹCo¦/r[3ŚŽ$×O’\›\7+Ž—T7; ľzţB¤jÓŤ‡®ĺ]/éöpčFŢ…¬ŢqgŇşo›ż¬9Ö™´JoËČą­áM™ŇLöĚşÚ§P(*T¨P P(*T¨P( … * …ByA¤‹¨׋žďé9ňÍźU¶˙ä-Ř١ßâ˝zńĽ >ą{‚Íž_˘}UTţŔ^~͢’Ř‚”ÁŇęRXX‡ý˘)…ůŻš _lş 6i0ˇB»Ę˙™2VJŕä!ĚWXą?—}üĹ”>Żf0Ó9Ó F#Yđ#¤3’ƤŔ@$@"8!·ˇÓ‰‡>pK"Vpb4XT˝ZęFŤ˝„:Ľ˘g=Ö§6ĽlđcŢŤňá…‘cnó®Î:źŐ«çbU˝ůڱŔűe§~Ě”U­/đFÎmÓƲw»÷•eéŔoD[üR(ʶx{;˝>zt׿óćnŐ·_ŕŢ&–·î¤Á=÷`Sw.ÉASč\Ç+¨^¤®†-Ţ#X"Đ%0Wbżs©—~­*ب‘€ĄěëÍGůěz¨ Hţ ŕ.ŚA˛aú4&••žX’X ŕ%B˙•€gÄ«{YĐýHd}7µTxŤVÝUVѰž^6ąQ>¬Š ý<ŢŐÂAĎÝéYÉó¶¬sń1xs·ęݰ´ŐŢĐé-›5jÔęužtřS P(*T¨P P(*T¨P( ĺ?V~ŮÚÁ~ˇ‡^ ĎĹ·Ă]Ź3çźě Ž}ŕ\Ç+¨YČ Ŕf ŹA^ć R kęĄ_Ky ŔR…5ó9:)‘(VP3™O‰kîÂXD\đß)ö/WĘĹŕŚÜ(Ę Ŕč|+%ç˛Řŕçx\S(®zá–µöĺQ P(”˙Ćü— {‘ü5–M˛a觼ć»ĹĺM»Ä‹/ů1)±ŞŻŔ»[?XSŁ0Y(„éŇę*6Ěy5ŕ*ÔŔVäˇvp?S¬Ýw2R?‹ĺ·ôe…©…- †]°OâsPâ€L=¸#uŕE°)€ů#‘tÁ†ţ$łˇďŚÜfĄ Ţ-ˇ?Ä ýXu‘¬í)sŁŞ^Ů®—Ű«y!ŹşŞŻY#WvŃ„<ęĽkĄÝ…ŕ5ďXś•°+Ŕxk˝Í]~ŮŢi8oŢó÷ĄÇś››ÁkRJŹ!¦Á …B€  …BˇP @€BˇP(T¨P P( ?Ü˝cŞ&y0îm^L˙{1,0äe•˙22ĄhÎu^RٸŚäęţď^ýpˇĆi°éěcs‘ X©đ$ľ ‚”´›ůÁ D\ą/}To¬€Ř„ÔÁv6ôÝ<†»×sŕR TŔ"¤€•‘ ři(C‘V’`r›•€m xć–ŕĆ~$VÝWˇôzÉĐŤ }äęC;͵Rŕ±/\}hŻćO°7ž«_'Ź5G¬gń\Ď[7ÝÖőďüĚLEi˙űL¬`ß óÉěţ×Ŕçy+xR^Dţą5¬xC˙‰jVFňXIá݇Ůlč˙„d°Ł‘TV’a’ČJ@‚¶</ bC߉­wbCż?QÝG&ěqO¬B·pĄ6đy]„Ky˙=Á/ËńI¶­?‘ĐĄŽw8ÚÎÇ+Âη'ŘVo€MË'Ü‚ě~PAŁWeŘŔ—˘ý ĺO6쥜ËońŮŞé\12¦Ź{˘ćL­íUĽjŘVS .Ŕ+aWű™Â0 ďľ0U(ŐŔ{̆;ű|ä„90á…Ja9HżžtŐľö(\í{éxµď-+{­nŽČTÂVö~]źŞ€Í łwŘ{ăeÂxHgE€— cŮĐŤ$˛Rp›^Ľ0ni† ±ő!¦nQÝO&¬˘—̵ŇîHpIwvĹoŹ\yĐ ňíK÷»Ŕ…[Dřg2­źÔÎp2ąr4ÎŽÄbűB¬{^łÚ÷ŚĺN•·Óë<7·qŻéúďÎ … *T( … *T( … *T( ĺ«ČřIWüçŔÔďr`z^ ¬t+…ŐžO<‚U‡Ş`K-ď1¸ÔÁ/ŻćąÂd„ vˇÖŻVÁCX†äĂL6'!y0]űq^¬éדŢ=PŻÝ˝o?˘aÔőLě“Ř µ¬@đjŘ×{YŹ`=R kŮ{›‰Ücďó{żĽLȆţx$ Ʊˇ?I‚QlčŹDâ…álčEbëťŮĐDT÷— «čŤ„–‹ "€+EöH`a7¸śg‡(8“)–€g|S-ŮĐď¬9‡íďľďz§ëO…v Ř}Ţ+oç 3·h×xŞ ĺ©P(”?hĐü^ígĂ´Qwá繼*ŘZŤŻĐ·˛A»^ŕ•Ŕ2! kxŮđ“P +WĆ^»âçĺł«ýL6ĽxwŮŔce)‚%¬¬@*`»’ŢŚ4Üj‡ŐłAΫcĽv •Ú÷ĺ‚”i Ęj„"f…ÄJâk× ě=h÷űb{ŻÓöwŔ†ţ$&łˇ?Ic% …•^űŮÝÖ–€gn # N3‰­̆ţ $˘ĘI&´ĽŹLp‰#rőa|ŕ€Řłßąkţ÷l‘sŮ6pöv*M,VȉÄÎőÇowŞă0‰úÝWĚýxîWĚvl˛|—·1Ěä-ĺ»0* … *T( … *T( … *T( ĺ÷1ěá9 ţ°Lô}&LěČ+‚ĺŠaĺ%ŢcŘRW ®ÂlČ ÷a’ Ó„l€ä˛Ź‹‹ÜxŰ\¶őmŽvŕŤGĺÂLä¨ŘçŻ@ľî:¤ś•© ‰rí] «‘‡lhÁRDü3 Ů Ć1 %)_»ąŻÝę÷™\V~˛µCź§T¦Č @*L€DĄ )+1uC ¦v0Q5@&´Ľ/V¦PŠ!°Đ Č—€ 9ňŕ—e g3mSiV +·;kŽ'vRóE›kĽxQću{‚MS‘«¦!;üŤ†ňv^4´ň¶¦@ˇPţWűňíOÓaŠcLžÂ+ ÷¨š÷6¨“ÁYĂKáé–¶â|Ä-/ź Ët6¤xâmnŮlŔńr`¶lXjňň*bĹ?ľô}+1‡ äŮ29Ú[óţoą r´ź‹ÝeEF*‹ |©LŠd°źILBÄ ?!‰ÂXHF#Ú ÄÔ…čš!HDĺ@™Đ˛~}!řaOD[ ş#ů슿r!§+śżŰń»c g2lSiÖb@X€ă Ř‘›ćuĽĂ±ću!&ŔŰsͤlű#_‰EŇŰéÎ …B€ *T( *T¨P P(T¨P @ˇP(żŹaݍŘpç)-řK„q˙L‚ŰóîĂÂÝy  ĺ=‚MŹËÁUŕ±§ą38Ó5)0\ŕ±A.Â2ŕ‰+ŢĹEn)8đ˝ă;!GnZhŽÄňĚ5žˇ¦jžÇu“ę— łxŰ/^tńí8”·ţ”Q#qŔsÄ;ÄĹ<* ĺwU‚Ř>OĄpµźŁő“aT?^>,Ť.„•ďlŃ”Ă6$ F±!?I…QŔË`WŁE°Ég@Ű×& l¸I`ĐŮlpóîi‡ý/HĂťŽdţkŐži(Seî°÷‚MSÚşČT ľ/ěgöýMERYaIaß#/™˝ŻDqŃç¶đřc‘[ę1W? ‰© ŃŐÑʡńxVćĚ D®=ě‡÷+…˝Ŕ‚žpé~wäbŽřöČą¬®ÚĎwýóIHb1ďxKđľ…‰˙pŚůS‡˘Ía_©Ŕó 5Ńě 4Róv\2|ĽůL‡»<—Ó^k޵wä­;Ńî;é°W©TŻJQ  P(˙ˇ ]á/ßĎ?ś>ŠŞíÓš—Ą™µ7ć?äÂúÚpxŮ0WĂ'ô‡›Bß§Ä˙-wl63Ig.F ·µ%`ŇPĆ#iÚ[ßf i˙Z ĎKŃî‡˙’Ş@^&io­“’—‚źeĄCW ҵ+ü1qŕc“µź—ÄJĚmqčsX¸Ą‹ÄŐ‹WüŁčjvĹ_5‰x<nT AB ”ľÔ•‚^H`~O¸ŰąŔ Ŕůl{ÄďNW8“ŃńI±dß9žhÇowB €"|)6ôV·+FőĽ— Ő›ĎvŢĆÓݱˇ?‰·î¨A{éż-qŕ+Ý@g& …B€ * …B€ * …B€ * …ňâaŻ´©xÂy&,›śű7x ę‰}o«'áe ‹RsaĄ[!s[3ZS^¬z rS= Đ™HŠđ3@Ă‘›őĂ ZÜr–słn4$ÔMEâęĆBLí0ä–úGHĐŚ–#s[-“ce¤#YaáaÉ2 Ĺă™TĄh –¬ I;ŕźI‡˝f<’ŔÄ«Ç!qőcµ?O^LMâ?^äc6đ+†"aŹ3‡'$čA_¬°/Üď‰\Îí îő@Ä&Ă9•j'­ß$8ťÔ9oÇ⬯hc8Ő‹4g,ĎPSdďuSp»b,đv^6\ĎuD6ťîđhýńö鼵Ţí,ŮŻ÷=OĺeôWĄ—ŇG ÓŮ‹BˇüŰ @4ĽĆJŔ›ĽŰę #Ő“Żň˛„Ĺ÷ďĂjŕĺŔrÍ=XŞćÝŇŚbŐ΀Ôc7ëł7I¦˛˙oS7˘j† ±5c ľv[3Vöş›őõ{Řóâ5ŁdąŰ0F& ~’Ia›([}ź˘Ýs‚%kWďcI Ä/•奢đtřł«}6đyquc ¶v4Só#»â‰D<7ʇ"b-„\+v’>RĐW;đy—rX¸Ű9źe§Ómßk8qŰ9•ŘÎ$9!'nuc7mQ†°?Ňyé`$l=ßŮt¦CíşăíËxk޵[»ČłMžĘłÝ{ňß ŕáO€BˇP @€ …BˇP @€ …BˇP @€ …Bˇ(Ĺ› xžŇż7jY9xďvýĎ>iÂ<5ď,©Ď†ĺHŞ0KHb›YÓ«z!QŐÎĚ $˛f ]3 nW-B2jvB™ú6RˇÎ€jM>RVźEuáHJő:©ś€Ő !7ëG0#‘8V ¤Ä-rĄÄGçň¶ÓýIbĽÎ¤4r·ÄA.W?N&¶v ĆŠStŐ($ŞňG|<‰¨áeðGCŘ€Ś\+v†ŕ˘HPa¸R€]ľßGćâÝ^Č…lG8›ŮËpżÔŢHDÎ ¸[„?N†Šš|¤¤2 Š*‘°ĚU2ń5÷öOíaö^7GçW úŔ[ămşÂKďoů~}[* … *T¨P(*T¨P @ˇPţ ŔvăݨŇ2˘jŘ^býĎçĄ ł°¬ž—"Ěn “§T"«2ÎHDő$Şz8$U­B˛jöÁcu&RĄąĎ†~)RˇÎ‚’ş8$µz3ÄVNAÄU;‰­ű- ŔŘßE¸Y7ö7-ˇĄżaČ•m°ĂX8—Ö‰ľżňĘ"‘GUŮlč?BĘ«sŮÇł¨ě-’ľŮj {®p:°ˇo†üşĐ> ýŢRŻ6ölčżÍcż  …ňŇQ^ńŹy'¶zýôŁŹy‘ĺ#GĆTŹĎçĹ×O/O/I+$jf#15c!˛j8r˝¬7„/ŚŻP6đy×Ĺ_< ~ŕ W  âŔĚĂÄ)§âźÝSć\&v6ÝŽ'š!⢿đ»Ë‘»ĄĎ)ŇăAóŻŹ?űŹZ]Ł-Ľł7Ço̧NF…ťí$Ú˙Ę`Ľ%űôö.ŘŐj"oÎÖćźIü)=6Îr E1âc}Ą¤Ż ,íűUp±Ó ŢŤGŁ|c«¦/®fš_7SÍ‹­ž,DWţ<ńyď×Jú W‹{@PqwäbcţÔĺKHx´IŻđPľÖę^¨áŞ'Żň*¤>ň@®?WŠí‘đ˛Á˛mnĂËËH‡«%>&W‘ŹGHŚTŘO7áe#dÄA.Z2ąţ•łâ!ȵ˘Ál¸B®:ł«űČ•|§ç {Ě?»—Ś_f™3iŘ©”np,Á9ťÔ ‚2f"™ĹçäÇ Ť¦Qkj™D©$†$o„ Ű«ź _ [.´@\/¶·Sdç%cp=ßŮ|¶ŕâŰAĂ[wĽŁ°ú!˘Ú«źµ`W›XŢĽí­::©Z˝ÎS)”x:ËQ(*T¨P P(*T¨P P(T¨P @€Bˇü1ĂÎ]ŻH)íúw>Ýţ Ţ•ü~­®;{ňn”Ž Ž©ś\†$?ÚĄĽŔK¨!±HOřŮĺ§áVń:$„ Ľ†ďď™ĐG´[ÝbdˆČÜ(&W!Á>Q>\ÁD»PŻ SöʆcĎö×Až |ޓϻ’Ď~Ţ$ŕ~¦ré^_¸xŻr>«§Ś¸Ł’ŢN§bľÉÝŔ;ˇ3â“ŘüSF#‰^P]W‚Ô««ŹYIÄc ˙¨p6|áS§ĂçÂ˙–ë…Ö°ë˛)˛ă"+ç: ŔQ*Köę°ˇźÁ›»µŤý”µÍľŕ©T–Md€v¤P(âžţRŇ×ŕd¶Ĺ§Ľ€<§nÁ…CďňB‹FE•Ox‘ĺ…e?ixěęY.ĽŔ‚îp9ż+o/ăżcńÔ…ű–zrłp˝ě- » @éŻ:uTÖ ·Š6•śaXA_¸RŘ ąV<€řB!ťe®— –iŘ6W˘äŤ[;´•– ~ 'ěA˙îś@ípwB.çôgĂ˝rń.öwű ţY˝ŕüĚ/هĚéTź¤nČÉÄnp<Á9vËĹX ×2½’¤˘&OńVQ)M=€¦s÷™ŰŹŤzĆ{l>ß Ůâ߆ |dűcŘâ×ŮtĆ6ř´Gİ樑†Ç €°Ŕ­ đfmi±`Ú†úňĆ© Ţ–ţ›vňvj,EgC … *T¨P(*T¨P @ˇP¨P @€ …Bůcé‚?YHtzý\–ďňý~Ł® {Č )ú±âĆŁ‰^XéX6đxW ŮŔČďŤ\Îł‡‹÷íK÷»Ę\¸o…ĺZCŔÝáHhî,xX‘…”WĺkWyóęÔ•PU[ŚVÄÂť?$ěţl¸t·×Gö®>čĎ8I ‘>ú¶ˇ8# Ĺ`\ń‹]+’ VňŔąú a¸K]É€) ű€\'¸$|ÎE6đ/d÷EüłzË;řůe`gӺÉSÉö/s2±+râvWđŽ·CŽĆ±mśOY›‘;EěXÉDŞkKe»ţÝĎĎ„»9)ČĆCý`í~‡gŘ«żž„>ló7B¶ž7ý!OăG‹Ö7 €š·do;Y˝ĄĺÎ.-ćň¦¸6ű+ …"‹.·ü%:˝ëÇq4/ §˙š üaŔ .)\/§ć]{0B#(—s{Â…{]˙{][‰.2sí 9vp*ÍńĎ艹ľHvQ(¨ŐuČăę((»‰ÜĘŰ™?!çďôłwş —rz˛Á× Ěď+Łô\ű B'yqP.W D‚ ĘnµÓ~LŞ@. s)Ů`ŻäsűcŠWöJĂľűŮőFÎeö’ {é­|ÚŰů’d|ŘŐ˝Ô‰„.Čńř.p,;k ^QX¤şa‡\M^ ÷Ž#ĘŇŘqňąuü=‘»ô`îöžšżł»ş7D¶ů‚빎ȓ+~ŢĆSlčź4DÖy‹WýĆő<ŐŢvšn­ެ--‚§»üŕĂ›ąAţ|'ďFŤĄčlHˇP @€  …B€ *T( *T¨P P(˙űQxôŻě.ż»Ýß?—w!«ďŃŔűCŢ•ĽaÂŐ‚‘j^`Ţ Ťô±®îŮĂůl[™sŮ6¶2ţw»ČśÍ´FÎev‡«ł‘°ěĺXp‰ËŰ){Nü•;“ŕ\Z?Ä/Ăü2í‘ wá⽞Čĺű˝eňúĘćőĂň•ô',O>°ňhwŕĂd=·aážÔ…»}ĺ˛ű â°?—ŮË`Ă>˝'r6ÍQ6ěO§t‡S)o˘˝Â°·“ńľe‹‹łeß9Ă @dgä`Dg8f‰ś~7'!A·WAHŇÄëŇdđđ¬ô҇ĺŰ>µÂK¶ž7’Ůâ'·ů ¶é”1¸ř ëĽM4kލyK<ő……»[oć–©Ó\šÇđ&Żúţ‡ŃŞVç)í¨ôŘo:CR(ěđÂôçÓí?ňKs<ÇcWĹa—s š€ÜÁjŢĹ{}5糀w.« řeYKŘčDü\9D,'-‘“‰vp:±â›Řý6ČÉd+đI±DΦwcÍńĎęţŮŘĄś^rą˝e.çöQĐWGýK9şą¨ÝnW⮜8ČĄÄ߀`˝e·í‰WögĹĎ9#űTětЏ_wÄ7É^ćdBWď[]dŽŢ´ÁÄm…ОŇ^ńóÜ螡¦Čî«ag >˘˝]öx;Xu´ "^µKąúËl‘:k†ľ)˛é”lô1GÖ{› lčkxKYXäŢx37µ(ýy}óĽ‰+ššŽ[ج)Oé\ R5zUŠÎ *T¨P P(T¨P @€BˇP @€  …ňż5đ•^s(ľűű<ź„î-N§:fđΦőĘ˝5°‚V_ ď\fáL†-`6p:Ă 9“a­#™ł™¶ű3NĄÚHŘ‚orW ;đM邜bN§Ú!gŇşÁ™tÄ/ł;ś»I Öݞȭ^:č­,[Î_YlhKÝQÚ‚WaWľt%ŽČ“Ĺ|R§’1ß$q5ż=rň¶¸Ŕ;~K\ŕ‡»i‹_\ŕ‡‰ßńŠ´dż3˛?\,G¸›"n¦°+s=gÄ·ˇ„±Ś«ź‰Ě–ł¦2›N›!Yp9‰­=f« S\1ßSŕťIď&śJł‚9ť®ÄZ'ň‚!ꂜN·•]Ůű¦Xłb`‡ś‡}š="~Lęl†X0i!ťĎrT Ö˝ż˘^2˛ˇťĄ@a°‹WčRĘĂŢQa¸ËťNíi‡=ľmOöRO>ďx|Wé­|"ńę^ęx…/!|ž¸â_řĽ}abčŚě˝Î„`»ĚŔíŠ ˛ó˛켄ąž3•S,fČć3âĐ7G6úšĂ6ôybXuŘQíÓ‡ľš7ÝĄą0uíwŔ§j6môV8Ęż°lÂŁ@ˇP @€  …B€ *T( *T¨P P(żď¨TŞWuYäă“Řłďd‚ă°“‰öjžO˘úlZow:ŐQĐ.¬ăř$Ű0ť‘“É–2> |S¬td##.úăi?ž¬ÄVB\ h's*µ+r:­kĂâ@ÎŮ {m1xˇôî2üsď˙/gÓ%´wDdŻIÝî™T9ťň%+vĄĹ}ňao§]ŕÇSöGbmeG[#ĘĂŢ„wFöłaż/ÔńĽnÁ<¶'Řö\Ĺv_iXČŰyÉv\Ä\Ď™H+. Ü|ĆŮtÚ\|Ť‘ 'ŤĹť˙ŐGŚ`Ą—!˘ÚË €»^=oúFVÖ}‡ŚYôťŰŹż4ÝŔS,ţŢŤóč. ĺOXN&ôČóąÝc’t•öÉŰěĘ8Ą§†Ç®ú„“I¶€Y1ťIťKä¤ń–<ťXË(•ů°·ź$Lü+<ĄBpZ,gŇíu“ć ŁT ”śIĂ”‡˝üu§S({ťŻä_4đO$t•Ń®îgžwT»˘;c##ŢÎ'%|䆥vŕóö…vŇ|ž8đ=®™#{®š{¦\Lnä_J©l:Ťm<ĹľŹ˛ţ„»â7FÄ+ţ •‡ľzŃn6ř9¬h¤`ô˘¦GŘĐwç)źč6@ … *T¨P P¨P @€ …Bˇ@€ * ĺ)âŔ ˛lÂSzÝń¸ŢË‘xGWŮ–«7m„ăń]ęyŢń6ďxKŔ:1XB'ťżÝYĄĚ %‰Vr·Ą¬ŘČśL´•ńIę"#]©¬«˘SÉÝäR0ßd{ą¤çPxťOR7Lň¸]íŕVŘ‚W6ȵ+őí†Ýúđ6˝Ú}’ÝűŽÄlĂŃâj~kDÜ®÷ „t7?‘¸š_joąŚlŘ‹Ţiö&Č®Ë&ÚĎŰqѶ_Ŕ\ý e6ťî(ăâm`ÖÇÖzw„ŐG°•^`Ů~d±»ľ°`—ž†7ÍĄą0eíwŔ9÷Ű›ĂgÁsrrjĚ/č IˇPhtâVŻuĽăqÝw‰µŢћւ÷-ŰzĚZ}ěVgŔ:1¶čT:ËčZŽł/uâ¶.%ŕĺ €O’ťNK@’‚änr’A/â"ĄB ô:ĄUúâpń6=oĄ­zĄ·í‰Wó±Ř“Ď;e-s0ÂJF§úk €‰N@:üu.§ÄˇßŮp˛Ľ“€ `‘{;yŘФŕÇąM“†Ďú&Ž'-":CR(T¨P @€BˇP @€  …B€ *T(Ę˙Vt˝ Ŕ;ĆÉŹw,¦o tÇ5ŻČ΂W¤y˝„Ú+Ęx‡˘™ěp¬…Ě‘›rGov’‹““—&NÁ-KV·"kąx™ăń¶2'OPßEť|±ű8Oéó¤‹ńžGi>颽c C\;Čcm0í`—ěÔŐ°Ź§<Ř-e”÷IßŰđ_s™=×Ěw6ěw‹ž§´ŕ/Ŕ |lÇE#6ŕ±­ç e¶śí(łŃ×qaÖźŔÖ7`[}ÄVjŹ,ŰŻKö¶Cěj#ĚŰŢ ůyÝ÷0yu3dجŻ*†L˙ŞŚ×ĂéűĎy=}óńsNŻ(řÍŻĽ,:ŁS(˙ŽëtŽÇ Ŕ•—-^TţÄŔŠ _|~Űđ‹ÎŕëÇlč—ó¤ŔÁ©Ő'T(*T¨P @€Bˇ@€ *T(”?\hx,0ţ‡Ĺ†ľ?Ö'č·,ş—€—,q/_t/ża×­H‡˙óJŔż»Č†¬¸Sźő˙TpSZđ÷»)í˙ ‚×Ëąé—ĽžÎÍ?Ł@ˇüęZ¨R˙ůZéűPzÝůt×7‚˛ToňŽEŚäŤtŠ;n µ°/ĚT-ˇŮn Č S8Ś4“ńŠRbŠ‹ %ÇXČE+é$Ű9˘ČR•ĚŃ›J¬ĺâČwZDĎ˝>k™#J$»ď)]±?ŹŇĽRJĂ]i°ďĎ+ˇ8ě%[÷Ї=îRîWMíŔ|ÎŔçěĽl;.aŰ/Â6Ěő\G™Mg:Čl`9)üöČZďölŕë#+µeô%{ŰŔB÷ÖČĽ­`ÎÖ–ČÔµßäUß!g|Ąvţůźó·xÝ}ÓVů˘o üĽóü|ćÍ..TM0ń‚Cęĺ …řyA`ŮDĘ›}Mž h‡C *T¨P @ˇP @€ * *T¨P @ˇčľ`ĺ?Qtä/űyoÍz'(qâ»<ďȱĽŁN ÂşĽýaÖ‚g¨©š·/ÔTĂJđž”^C0C”JÁÁHsĺR`ˇ“ĂŃťC1˘ÎČaG´,‘ĂZVR)PÄJ€ŚÂĐ– ö—§ĽHOň…|JÄGń* üávč‡aOvđă)én~× ŔUÝ €tř‹¤Ă_´íe ŔiyXŻXôu,mĺ`;+®-‘©k› lč#§ł0őźHw禦Čŕ¦J •¬ŰůMőjC ŕ‰_ü8/¨‰\ôkrŇŻĺÝX:ěź |ŢË E2P•héÁü۶MńŕŐí ——ńcŇ×)ý'ŁÇ}zňĆ/xG#śÓyGn ČÚÝľž·/¤Kýž`S5f˘ń¸f H1ě˝n‚x†Ęi C8¶˙†™Ś´840—Q,‘2Ł0/‡˘:ÉxEu–9¤3KťŽ–“ľFi+_ˇ[ĘC[J[đęt%ŞŰ`ß"'ö"wíp—lçëţd…?gř;$.Ëţö‹† źłUřç±Í~aóYlă©2âŔç­;akŘŔç­>Ö0đy˶ĄűôŬěnĚÝÖZ˝›˛ö‡úI«š×ńýüĄzŕä/nÎ_őAÝU©895jŚx7jü[^eřľŕóvăcąčża‰ďľěoCźWjhĘQ¨P @€  … *T¨P P @€ *T(®Ď¶Hé˛řĹűu9é"qń‹üĎ”q•âźŮH‘.ŕŕµqźzŤů‚w8lp&ďPŘŔ»lč«y¬C_#!Č €‰¬(ń 5Ď0LZ´Ą ÜLN©(Ȱ!w ;(–˛âŮIĆKQç—ňĽň ­|`ë:ě•űKű_5đ•×+·;ČLŚ8đíŔÇv\2fßy2đyÚˇÓý3 ř.ľl×?±°Ď[}T,XCŔ–x象ß™»­ ĚŢÜFŕM[ßJ=um dÄěo4Ăf~ŤtqúŞ϶źr°T5j €ü|$žăÜ^ăÂćŹŔĆfĽbXÝń¬0çÁ ÇbXч—‹ťxąĚőtG^†zš}LŐc^Äăˇz9Nźó‚˛zż÷ĽóăË,®¦ü!‡˝Ň!ôş}­óo°aţ&ݶ}Pnň.˙ »ţög4–Đ©Y?g‹ßWu9Ŕ=.Mţlďʼn_ň\v—·˙ęŕűűBşĎóZíŠk$ŘT;đĺL_ŠrY0•Ń–ě 3“‘ sąrnXč&˘“Ü ąş‘®nCü@¸ÜţđN2:v…myĺŢ\FéĘ^ůV>97q˙~)…Űű¤Ă~ç%6đ/#Ű™mŚĄ«ý-~ň-~7ť–ŰŕÓAfť·˛–Y}´=˛ęH{Xá…-?Đž }}d‰G;XäŽÍÝŞł6IµaZ#–˙ă—6G:÷řŞĎŞ»B`çŚqnŻńśžŇpÎóú+ď!lěöÖOăÁ*/6ô/ń `áM&— S“ła grrŠfĚM^’ztDLͰĽ¨Ę!®ůýťĽľí_vĐd¤@€ *T¨P¨P @€ **T¨P @€ ĺuqßó…ŕ×U€ëGŹ`Ó·ĽXeń°~u7^1,QËĆđ aÉŚBX:ó™Ĺ3s4 §đîiNȨťëĚK©ťŰëVŮ,#¤|NóË%s˙Ć·ďK€”.ďËëü”żzM{ą4“çqiČa·KvéĽ]—¬ł¶_0*ĺí¸hXąărŕí ěnA†Čî`#Řs ďđ`ž§t·€tˇ §dçÁ'” €3ݰ"ŔŰŻ3 96T1 ĺ×) hůçĘé>Äuˇ0Řźłr_q%0öd·>ž{śôń˝"Ůâľ-đĂŚŮŔÇ´_ňHßm ¶ž×­‹ţ6IH*/lkŽaâ"Ŕ^زídŹţ]¸»ü˛cżvúú¶UĽiÚÜź¶ˇUoâ˛aă—¶¸ĆłęńŤŻS÷ŻZ(ťĹĎ‹ÎS˝ťë>áeÖ«ĚłŐ‹Ćđr5K6çÁ_^!,‹.„ĺ)Ľ°<—ÉăĄĂř‚4Wř”0¶ŕfýŔ\^lÍ€»áĺ}ăx!%˝Ż]ČuđäůetYt8ĆÜ‘çuâĺú‹mßáY6ˇ…‚ŠđrWöŹa}ŰrpéÉ+ѬY_ŞYĺĹ+UÜX’ơEĹĚC^¶fN/K=';­vV/Ąfö鸊ًy±ełśC ç}Ë *U˝§Tt”J”Ň{u90Ň·ńŕ ë˝­N ÇÍýןl—ĆŰࣗďrŞ-đ6űéÁÖ‹úČÎ+¬t@<®ÂŢP#d_¸‰Śt[a-ńăűÂä …Nż=0{y×ÍX(PxťWŮşŢV§< „(¸¦Ű*})w…á®´jß-PNiŘ‹·îébÇE#D;đýĺ[úJWüo=ß¶žĂ\ý:°€m>+·ń´ĚßöČzźö°ö¸>˛úX;X¨öéÁ˘=mŢüz0ǵ2m]›ň)+[ń&®jymâęçy–µYř“Şí,žěö>F—Űš“aŐ©uk yéő‹U™š ĽlaţĂ{0xů 6ô‘bXa=’(ü·…áO%Ă ¬Ę }lWb…Ýŕü][äTšŐťCѧx"-Fnęř Ď;Ěä-ů]TŤ^•˘ J€ *T¨P P @€ *T(T¨P @€ Ęďqużlçľ&90ý-^!,Ó+„ŐC°e.…°ôŻ@PEK’x`妄W«Şę'ňaEőíşqŹy µcË"Ëßç…—ʸZŕĘ Čŕs6ŐÉ…w2ľď`Ďŕ^mx‡Bşż/ŰUPĄË®‚đĘúĂľá­=0°Ĺ /‹ńĽĺűÍUK÷ĆňT»Íłďč Ľ%»:ÁR÷Noą§9¬:hЬ9l kŹ!ëOt„ '±-gĹ…Yt…÷Ž‹&˛˛;ĐT6ŚÄiŇçËďUÄűB™0 äů ÷0廤+ůÝŠ‹u°/Lěý†b:‘ëżí]ş”‡]ĚÎËŘŽK&¬`ŰüMŔőĽ1˛ĺ¬1l>c„¸ř˛ă[s¬#¬9Š-?`Ëxű `‘{{dánře{GdŢVC˝Ń™ąÎ¦­4x“—Ă„Ȩ™K‡MŐĎç šŇĘ}ŕäć+xcć·µřiIëõ>oÎ&‹ţó\lBysÖtMťľ´`0c™˝Ŕ›µĘfŻëŚĚÝhó6!żě0€;Ű#â‰vĹÁgVz€ËIcdŁŹ1»z3E¶ů›Á®ËćČî@qřX ╱t‰+ćĄ+핱ŇŔöŠzy‡˘_L|ťŇ¶Ä/MńÖCy9ŃĄüHďśy†É«ˇ- R ·*o,q…ýÝ`;Ůßőö fx<¸˛ă‚·ů´ lôĹÖyło„,ŰoK=±ůěXťżý™yŰ Řz{äçµ0eą12y©)L\Ř?Ď ĆÍč"đFM¶ă»"Fš?ě=¤cĎÚ±Ĺc›o‡đÚÚ}üÎËÜ!ĺ6ý­“QŁľĺů%çź10—w9§OŮŐâŔ‹Ş®ŽŻźXÇËĐ,¨Ď–ašĄ©›U4±U?=S9Nô ŹšXĐKíw§k=ďtz—úă·;#‡cĚ5{Ż‹Ď#yfÇ%Ă´ >—xëOv´µTY6á=yF*T¨P @€ … *T¨P @ˇ@€ *T¨P~Ď+ţ˝Gø×x‰µs[%×Ď›ÉK­›}8ĄnÖ]^rÝ´˛¤ş©jl†&ąn&’^»PȨ]ڤŐ,BRk áeĂ‘ĐҡB@^oäbNOÍé´njžo’}íń[öUĽ}ˇ6i[Ď™óÖ7>sĂ÷?đTno+?ć»öplW^PîOý}˘¦^â¸<.lٶĹĽůkú•OŐxĂÇw~CM‘îNíÁ®OĶW °éůbĺŘ,{|‹Řö•č÷-ôň=â8ô{č;Ş9Ňěŕ<±%2dj+1ł52jnk»ż¤ LXŠMZ®“W´C¦­mÓ×ał7vŔ6u€ůŰ:ľ¸@lÁ#dŃ.cXěf‚¨ÜŤAĺˇÄäĺě‘[âţb‹w›hż?Ţ‚Ćě˝`ó¶Á\WCdÎfQGdćą©« )«ÚĂ•>2~q;ł -2j~1»52lz+<µ%2`B č7ë5˘98űé6ŕ;čę„Y:âă´3cŇĺkĚö0µţNâ{0µú1łn6m‘.öFĐ˝§%ŇłoçÚ^ý-«x}Z&ôu¶şÁëÖ»ÍÂ.=[Îŕ5łoöŻ•S«×ĄçĎíŢźl:i;ŽçvŮĆí@¸eďxĽMíą¬®j^`^MHń0$Ľd´Q:ąÁ>&”?ôÔ•™dWÇ;ž`§>kĽ=W;×o9k\Ă[sÔ`1úćĽ)®ňZ)!Ĺc'ň‚r',ô‹›Ľc!S`ŐÎaČ/kśaě”^ÓPk°±7@Ś,Z‚^‡fHK˝oŕ‡6_#Í~řš6˙ iÖňS™VíżDZ| ú&˙D Ěżcëo3;ńdݱíÓŚťŕ±îCľÇáXď€>ŁZ '´fĹ6M>]FĎÓ—3ż2ö}·Ŕż¨LR"SVt„źWIĘLŐŐJ%F/4eąLZjŚ_lČľolĚüěý Łć´—>]źýĽ°Ú"Ć·…Ţ#[!˝F´‡ÁÍ‘nÎßł˘Ř ±ęŐ:9|‹ÚĐÓ7ý'č}‰´Ň˙Z¶Ăšţđ©Ě?żýXâřúŰĎ‘oš~ß6űů®ůWТUSÄШXY™#Ý­ˇWź.H˙Av0`(Ö­wŰs]zµ<Î3püěmž‰ÓoIĎ«ŹX~˝ţĺžëYł3n†Ŕ;iˇńM±­ăůgőŇä^`ţ@¸R€ä91ý˙¬ľŘťľŕ›ä€śĽÝ ÇX!#;Ç5SÄ-ĐXłőĽa=o­·Fú¬…yŰ[ož¸ĽyŢ8Ő÷J&NŢŤKѤĄ@€ *T¨P¨P @€ **T¨P @€ ĺߥîŇĹmA‰NďžOď©Ď ¸7hF`î°BŢĺ»NĺţŮŽj$ËQsţć§—ŕźŐ[˘Żěľ5@ć\FÄ/­řŢ¸ŐCđаE<Ż[©w×ń6ž2TŻ<ÜNĂ[ä®0g‹žoŢƖͤ?7OĎŻßÜčmň/(oŘ^pÁč°„ŠeŔ‹}¸HH›RĎó‰ŞŢę×x«™Ŕümí‘IËŰŔ¨ą-~ăšBĎß –=?‹îź!íĚ>=ÓgÚšţšµů+Ň´ő_ŕ‹fo!ź}ű&üăË7°/Ţ€?{ůŕÓ7áýO$>fţýýoÁß?Â>řřm™?•űÇgďĽŘçr‹ľxůäË_ă/żˇweß›čź˙űě]Ů{ýHÁ‡źĘ)ý|Ąď3ď}(ő&üMÁ{ľĽ˙‘Âßó'o°cűř‹·Ůű}ůâŰwዦAšµ~ůľíűĐĆđCDĎä#čhőÄÄîvě†tuţ'ôů 2`BSađ”ďŃsŰÂ8±C ,˙í;ż˙”~§÷áŰÖo#_·| ţńĎĆČźż ů ňÎ{ŤŕÍw±×ŢjŻľŽ˝Ň¸‘¸ 8ÖčŹŕ•ß._˙żđ>_‘˙ý‰§Ť_Ă^{óxăměíżľÂŽěďż|ň:ňŮ׬d~óĚçßľßëýůA˙o oţw¤ĺ`j˙!Ňą×?ŔÎů¤ÇŹźBß Ř éź ĂfŚW5g»2rNs> łę÷±ŻSżŹôĄç†Yë۶žáŇî"ď—ťín­<¤'đŘŐ¸šŞyÁć‚'ŇĽáÖŔ.b°rž×-eÜĚ‘ÝWĚ´Ďxŕ±".§ ő' „ŐGÚ«y Üô4Ó7´xc|çÓ—Ëy}'}ó•ôg"ţT¨P @€ **T¨P @€ … *T¨P @ů7. ˛lÂóö–Ď §O^ë?†·ďjW÷=Ať€ç~ŐTł;Ȱžç~ŐHă~ŐxÚG—^Ă<®u’aC›±DÜŻ`»;Ă΋Čöóć°ů”1˛á„ˇ°ęp{ Oĺ©§YŕÖZŕM[ßęîřĺ-nń†ĎůŢý^çy ůâdččŻxÂşäđĽ"ěňü2€ç§°b đ‚ň‡—óz/ ß ş#W űõ˘AČŐ|gĘĂÎe:ÂŮtäxĽxßâÄŮÁpd¨ ěŔvř[ÁĆ“ťuGÍaĹ~cdÉn#X°Í™íb3Öę#—¶ń‹[##g7‡ł°A“›!ÎLż±ß"}Ç|=†˙é>ôKmâŮ d%¨˙§MßOÁŞĎ'Hç^LĎŹ‹É:|řbÝ?3÷ř,±N˝>Ë>!VýţÖý±.?‘ <űˇźý?öî:0Ş+müxW~kÝ÷Ý·»í[â“L BÜĄÁÝâ®$™¸%N„8 n-Rj´ĄşőR¨áž™9żs&…>Ď˝7oďm‘çv?,›¶a†ĚóťŮsΕ™¸¸;2‰{b…âíדÍéŤĚ ś-Śî‹,ŽëË–%š#+R,†şĘš…Ř ±eSÄB‰Őö,±ć'I\jŁIkr`Yë±őŽ,»Í ż–ŮŠĄ7;˛´F$©ZËř0“°ăŻvzhEŞĄÁGg ÷î9y˘Ç$éëe@–ť]@şĂÓPDˇÝ»+×Ř2čZ@EŰű‹wą2H܆YÜŞŮ'W˛G®x‡+"n ž×î‚änrf™ü1…řcnL®ŐęˇČ"{c@ş憙o?ż[ 4vÉŁwjŇŻi<<őŃĆĂŢ+ š#j+źİ†Š§\: Ęýýyĺş2¨ę€«:8é,Ô!HŐ~w™Š'±ň}CXÉ®AHńŽ,ł+’ÓÖĎÖäh€’jíŤq$8Űö ťÍ[ĐĽsWţ0üjxvľYŰ‹K{CuĎx} Ő?ďuĽý=/‰a|čřB#tđÄăo¦0čĐ÷“Ů3§&"GÎÍdG/.@^ľ0ź˝|;üĂTvč»ÉČž/Ćł=źźŤg[ß‹lyw,[˙*ÖüŇVspR±Ď‹oŠäm²›#©5n,©Ň‰.tbyŽІ‡-˛$Ö YcĹć…Z s‚Í™÷ŠŢČ4ź^lň3dâ˘<ş#cçvccfcŁf>fŠh¸÷#ÜĂĆjH¶/ď˙eçc#g>ĚFÍĆĆĚ{„Ťť˙(2aQ7>б©Ë{°©>ŘŚŔžČĚ žl~äăČ‚č>li‚9˛\Ç{şeĹBřp‡"ŠlYt‰IXÇy­Ă8ŁËŮŕ$“ĎßB[ťYńÎ~?«p»iő:˛Š·ś6,µÁ‰‡†#’PmoH¨¶ÓC~i–ßd dřfó‘i=§I_/Ó5öéÚĂPxľÝ{ńU6 Jm´7ćmv6@Űú‹vôgĐj%»`{äVď–*ÜÖź­Úě‚ältf<– JF]ŤVEÚýÓě$`úĐŘŮwiT(@ĹS·K¸¨ € _<ĆČŕřly|7I]śW€ďŕó €…¨ä°zűP$Ł;ËiŚ¤Öş1]•+SäĚ"óť€4Ť) ĄqÖ€ůa–Č\ÓýGĽ}{ł)Ëz"“›± { ăç‰ŔF‹…Ťśńé˙k‡Ľxxţ ń5^ÓŢpnÄLL üŃsAÄŔ·ŕ1D üIKş#Ó|{pfřЬŕ^lAÔăČÂ>˛˙oß'Ů‚dX!AŮÖ,4‹PŞAř@˝} ž€€.ŐPż~·†C‹BˇŠÝ · 1By›ű˛7Řw@ą «691dł‚Mrąĺ¤ ˛×;±ĚVLĽ°¤68 IuZăĘ*;Ydc αdĐâ¸>_Ěîő4Ů·»l`Ă“!Ö-OEŘCE[ĽÎAĹ[‡ťŻxʉA•űťYÍ3®F¨öŮĆşçÜ´ö7Öđâ@¤ńĄA¬ńe¬őµˇlýČĆ·<٦·˝mŽ’ŮýéxdĎgŘăÓ'ÄÂĂ™Č3?ĚbĎťš9ĂăăěBäčąĹě•óK×..ă–c—ä޸´BśŇ×]ô“đç×/Č˝vŢ_ćĺłËŮKg—!GN/–yţÔB‰ěą“óg+[Äůô·3ůc<9pÜ›řŰ˙ő2O}5Mfďç“ev}2AfDZq2Ű>‹l} kw˛ń­üĎŇúŞ'k>: i<2”5ĽŕŽÔĚjžĆ”łmwE ·ąň×~HÎFţs5:3]ť’XíČVVbQĹöŚd$t•µ!$×JÍ‹ěĹć„őD<§ö Ľ¦ö\"}˝\‘¤±_‘ls ͵}/ľ’~ µQË_3] PÁ¶ţ<řďX˝k€<ďt•*ŘÚźĺnrA˛78›â Jip4&Ö8衩v 2-\Ř#»„vPPPPPPPPPPPPPPPPPPPPPPPĐu»@ëł‹k|za0Tą{B,6© €M·.˛” Y!jUŔ—s‚{żM]Úk@Ż^÷ýjŮnµno„*l÷: mő8WľĎ‰AO9łę§]ŤČaϸ1HD@ý 1< –WÜMµ˝9Śmř·'Ňţ޶EbÇGc‘ťŹcűľŚ<ůĺ>€ž@žđf‡ľť<ÇŮó?ĚA^ŕCďČ©ůČ‹§r‹—ÎČ˝|v©ĚQ>|ĺ–bg–)XÎů /ź–{é”°yţ$î?,Bžý~öÝ|>ĚçaßÎĺĂ}6rč›Y|¸OGöĺÍă'°/¦±}źKMĺĂŰóŮ™]OäĎ#¶ýĂqȶƱ­ďŤA¶Ľ;†m~g4˛ém>đ˙=Y˙ş—ěv˛M/{đ@ĹÖ>çÎÖ>;©>8­‘(UX̦jhµąđAĺŚŐýşZ,aŤ#‹ŻŔ˘Šä’kmαŇCó"ä0lŠYä9Ą×˘.ŕ(DmlĄ ë6 €–§–>Üxhé"¨bׄʂö! ĘÝŘ߹ޮĘnÓr6Őľ?ÉVä$×&—ąN‚|é^qrXňZ-’TcoŚŻ°3@¦ČĺXoţݜоźBS–öáčřČCPóÎřžíu˝ śőCżAÚ†|ź×®ePţţÝĎ a,ŮÝŹAĄ{ű±ň§ú#•\YŐAl͡lÍÓXÍ3rµJžu“‘~aňĽ’ČÚÉÔ,Óđ˘»LÓKCĺřP‘j~ŮS¦ĺ/¤ő•álÝ«#dZĄ^Qk¤ÜQą–—ĺš^˝8‚ż3.#;‘ńyO™µĎ ăC«=,î㎭94D¦j˙ ™Š'"ĺ\éŢieů.W¤xgÓj{¨`·“®Ć7­Čßěl:uRú—®HOźč5: )<ęuuRüľ‰-Ó˛čŐXXž–…ä`™6†€ +dv¨Ř5a†¸Źď62ˇ»l€O‚…Ö'Ńęy(8Ëę¸rk%×Űs6: Ľ-ýŚbPâżŐ;±âťd¤á äoé‡äµ÷ăŻÓ.Hv›BÔó¨ćĎ·7ú‰-»ŔܰľíôH…((((((((((((((((((((((((袸ĺĐ(€ÄjyD(.äÂ?  ŰŁÍ6íOë ĺ¬ó8¬w˙nŐf-ňÚÄ©e #Ź•ěéÇĘöőGL 9U±3  Ň ŞÔv“‘.F4yVÉ@ě9Ď Âžç!đü`ě…!¬^˘á»Ü‹Ce_ôĆ«”/™&©—ţñĺůŕ†LüOěÚ —’ vÓ­\źÁİ—Ş>ä.öËT>5©ŕĘ÷ą!âs˛ÓĺvËŹ8™®|Č4ô·`ů’;Î]»ë\îFLěâĢ^éié »zRę Z!JřĐÇÂňřĐÇnmŘj}­^‚‚ł¬Ź© €ö;0ćńÁŚťMp÷Ŕ~źEPĹŽ‰•ů›‡0(w€u|đY뵆ě6qëÎ˙[–’őrŇŰVšŽ­lÂÄ;]ťWng€Â ¬ŤY ZÝ÷űYŹM[Ök”«×˙> 5íŇußňt^(»Ůëk¤eč79í”»IË_0Ĺj_ÄX¸Í™AEŰĹń§.) ¤źěéĎß­aŇp0ĹĂ“rOąĘTî€ ŚNnČ%‡ĘT?­Ö ąĂ žľ1kÉU”“ŢOÝ䀻LĹŹs“)RNÍ×()ăďŇĄ¤÷zJHßŮ Ň#hMř;|H |ůPá~3¶JiŘ·9Éľôö˝™Š?ĎŽ<â1đ“j°„5˛˙±%N,ş [ĺÄB˛±€ ş˘C'›Íܧôś*}˝\®łwňIÔĽ eÚ~SfÍ ¤µ<6đÁ`kçjýkÄ WZá/%Ý>)(€ŘB eń>ćÉkŤüńÔCayöĆÉÍ 6ßô!ĄX‘`ç쓤y ̲ý*şÔšAIuJŕb”n©1¦´Â_J |©üö~xţ¤Ď•1…0¬¬Ňv@ˇ«ě ľ: f[´Ź›×3 RŹ?JŃôĄ       ‹€€€€€€€. ş~ëX±ŞŘ5Y!úßD¨€V•P/i‘„*Ą°QóÔ@Zť×q(}­Ç·­e®łG˘0'ŁôöČů[ÄnL„Ŕ¬Xiaŕîk‹bÚ- Q¶Wâ‚AWUT@—ď˙=čËöý'Ü~VçJxü¸nçáµÍ)ŢÁ‡öÎÁHĹbϨźđ˙.]¸Őy®#R°ÍI1VďrĂvűrŠ@qŘKÉŹîíü~†˙fL:ü˙Ż‹Ë ém»M§xňa‰áŁ6ÄŞheĄR8Ę ‡ýLĚ?]!‚UŔÄ.vH (S)ěŚüq2@«6»ĄĎĂŤ€řs¨*ÖÉ i­QöňµÜ8vľY4aţăfwY´đˇ™`3ü@n€M”ŮjoČâĂé2$¶ÉŽ mV Ó¶?dĄ)ě € lK‰ĐësH@oÍýCJZăy©úmZł-Ň[ěř ¦“AÂČ1Č[ť‘ilű)đ§rŇí×·Jí˝1j#AqýMü˝r"Ęńw÷PńN>ô¶;"Y›¬Yz›9RĽm+Ý1 i9¸Śµňą®ůŕRţÂęŠÁľŢÉÚhmz!±Z{őÎAHń7ů°WěJ¶őW¸üĎ{µďöŻ |H:P®˝«”ľŰĎh‘Kkt”YëhřXő/ŢńCń,¶ S €AşµÁ/ݙ܋Mč‰ ťĐ{ä>ńqĹđMÔĽ‰m€˛¨µ3ňÇÉĺnźâ#”Ĺ˝äϵ«Ś4;¤ďşń Ěbˇ1sşu§]tÝ=·>$@q¸Ë†˝\F‹\złśüVˇňŻ´7Ɣڠ°|ů.€Ń}Đű H€mżű” ĄÚó8R3ôŰÔFĄ5kÄ-‘ Fé-“Wm»„|Éi×N ,ÚI@iˇ Ň±ÂJ‹Ą§ vĄô? îźçŞ@éô;7Dܶh§ "†űŞ-öX$µz»;Rżk}ÚyîťjvôĂuČű_`|yčş÷ľŘĎžůw9ňÔk«XÝľYHŐ®‰¦`(—?Ď9›ě‘Î] ’•ŕüű-Ú61-ô’Ú*řŇ…`¦Ĺ`ŇŰő*ťć§rŘ+­řĎZ'_đ'~z3f8 ôÔ?AzęźXő_©Eâʵ,¦‹*v`ŽHH¶# Ěp@üҬ +Ň,‘™A|čű›!ž|čCĂ” ÎÚiy‚í»P@şÍWŃ%|đŞŔôüKĂNyŃź”é”Fh“‹ââL±s JŞs0ňÇT…®˛ă`Ë 9ˇ}ÇÎë Ťźß˝Ŕ=9 ˇ­ę¨ €&…X«vĆčŤ ĺŔ‡>4_!Ć.ě>úF ĄÁ†AiMĘ͇>”»Ń‘ż(;!bg€üS΀¤°¨‹P*†öî·ZäRŇaßi ˛zW–żM‹äl¶‘˝ĎoçďöQČö#IěĐĺČ·§>fç.ţ€ŚFĆ˙sťÁ``ßśüůäřËlŰó‰HËüąďŹd­×˛´Vs${FlE ·ŠpC ¶şĘ(ľłß¬°š_:6»Čî/¨řŇb*  ţ‚lĹżRÔuZ$®Śý,˛Č…`ÁŮĘj‰Üh,Ť±r^gó.ä˙[€ěÓyd(@­<B`VůÚ1s €FÍíů(]wbL­,h÷`PÎWCú)”†{«Sąŕ/­IN,ú’`Ąi  Ď·5fY2hATźł3{MXÔkҀяô‚Dě:˛I^ăy©úmr˝5RmĹ}Ń Éí‘E…€¦DHuqb  řRŠa°[•!VßK‰ăpK$äÇŢĘ{ŢV-ËÝl‡Wşc8Ňx`Űq$9ňn={÷ł}Č×߿;?ó)rĺęÖˇżŠM€]ľząpů;qň=ä“/±Ł¬CöżVŔÖôC*wMćĎ·’ÝĆnÖŰ"9Xî&G$ áßâŠämî/Ă öź,đëjŕC­ň˙bÇŽěÖÝ*ný+@zěŻ8ůOÍ"ŔČ"- ĎÇ‚łřĐOÇDřĄY"3{2o?3ÄsBßyR,ŠłvZgůä—jůeÔjk%ŐŘł×» > ŤŇ0Ë‹9Ĺn@q·Ç9µ }%`%úPH®ťqy’-DŚśŐ=1łÇc]€lřßDmÉbč:ĹвŘR#žŻaAYVČ‚¨ľçgô> MXÜsÚŔ1=ú@M»Š»oľľ¤:>ô!ĺp’Ŕµť?[»© Q 2ŠŐŘ©NŃą’]n2JŰŕrŰmńÎ>ŁÍ/;' íĎE˛#ď4"źťx•ť»đ=ҡżÂÔ\J ćapâäČ[źěa{^ĘBę÷-`«6B2ZíXJł9’ŮfDz7h‘üv1ô Ň-Š‚tu˙Í€Ň˙  ţj@÷+€żBĚPć Đ×iQŚůŰĐ ĹĐňčg€~‹ČüO ‘~`V`ßz €;0.°ĺi˙éPůÎ)Eů›<”ÝÖßÖl«‡Ň[ěŤňá®UEmčę´HR-řk4H|…=G#ÔÖČ‚¨>gô: M\hćí>ľ»9Ô´©¸űľg[t•ĂŽ#Uîß&Ő‰Ű~ţ$ąžŔzG„QzËäśw@âx`ĄÓ•vHň/U¬ č†ő“ßęV鶦clű!9›5,{“ ’µAänr`Ő{§"Íł§ß,A^ýp;ţĂ;Čg?c.ťD®t\dCfÔs„Ź{ę˘@úĎ˙ŽýeäŇ•łěě…oă?ĽË>úúäé7Ęe» *vLf…›=‘´[VHĆ:; {–»ˇźLN–ÍÉü­Sľ­ŻlÁźÂ©Jpívż®N˘Ö‘%ň%TÉwÄň.ÁLP€giůĐÇLj‰(€ĹÜÂöżZŚTďšÉŠŰG"ÉMV,©ˇ/"˘JoĺAµˇżLN¦6”ÎřWÚň§ő·0ĘT@¶B¤ŢşX–`ŰŹýcbTßDlˇ ‹€€€€€€€. ş(((((((čşńh~fĹëźő Uěś”S°y˛×»S›lőPzł<Ň›µę49Ȥ6heÄŞČU$Ž@ ú)˛­¦ű÷: Ť›×ÍŰuÄCć8 Pş ©bŘ ¤Ňý»Ä±Řç'ş:ţ"ęhŕŕŔ ĹŘ$g blw‘QÚ- ;-P wÉŔC\:ŘĹżcU»’µÁZvo–XąŢ¦Ež\ŔZ,CŢúd'ňŢçO± —N!—.ź5­Ü‡ÄB;éŔVěâ×nd%˙Í]Ć˙˝ň÷†éůďíjÇ%äÔąŻŘw§?AŽĽÓÄž}ł)Ű2Y˝y,KZk)Wo$7ÚČ;R\?$ŁĹŮtĘŇ$§´â_1jdd»xU˙Pçíí‘>đĂň° ,ŽůĄZV¤Z 3x¬0C<Ć÷™yNę;?±„üSÝÇZť€V¤XťŽ,¶dPBµĆŃę]ą×nĹüŁřŕl+ůŕÄ.€1|čCŠŕÁ‡ľMß;(Ö=0ŞÜ59űv€”›€°Ű:î¬Ř*@‹d¶Y±´u}‘ĚőÓů÷PÓSKdÇá~đĹ!äcţÎ^Żď@ ˝Ú±{gS÷˝\¸tšť˝đňę›Ů‹ď´ ĺ[§ %íăYbť…ÜZs$ąÁFáÝýmk~›6ˇďtČk‚ůxiřéú äC˙Ŕ…`tQPPPPPPĐE@@@@@@@ŔşJ÷oďÖ(ÚîŠäoUZ`Ë2Ö[!âtąUű#ë®`‡ Çľ|ůäř‹Ҹ|Zvšáëne/ż×†¬Ů1©Ř6Ť˙Üh±85©Ţ §V*@F‹‹„ÓݰŔ¨&<'öő†((îúh{>ôź­‡CĆAe»¦ĺlödR¤5Űe˝E.­YAŁś,ÄŃżµXRŤ=‹Ż´CâĘíĹýÁŤPXž- Ě´BćGĘ@ě4ú1K¨mWíC/ľűÔż >ô?C*ÝżJ¨¶bPR­Ťřˇ7H3×90HD€8 ĘÝč$?xłłěŢńŇă‚…Âm ˘@JÄCţG$k Kjě‰d®łgů!­|ŮŽ#:ä}ţnţ«ďŢBô†«Ş¨ÔŤ®´żť/ŁÂ_¦ßźääB¦2Ä.H,ž|óŘnäů7˛µ»—"«7Mf+«m¸*s]ѦÓř0˙9¦S˙$d·ţ]+ţI5<âµČµŁˇXŃ|čCŠɇ~Ć´Ń7Ů™îoĆžđí k6ňŰŰýĂŮźˇŕ´Á—ÄZź€ü”®áĐĚ?˝ŢIvDs^{çNH)ň6÷“ÉÝŕ‚ä´u’ç€G–,‚˛4ĆĄń6 šĐ·~ä ł@€€€€€€€€€€€€€€€€€€€€€€€€®;3*vNÉąáhţe@ÜţW±7ăç÷! €–•ľýöó˙„t•Ă>…’*‡|qkŔń7—Î[ůíbAQ?¤tŰHVł{:˛ăH";ôF ňÉń—Ř7'?DÔ€ńž Ĺ0ÝMPʍ]¸(]ŘĆÚŻD÷®`yëG ™Mř€Đ"âö±żv¬Tö  ýe@w7€V]ř›×ŤśŃĂ5·çŁŇâí}ß(îŘ]1¬6l,TąsZNa»rÚ¨ €´&{ZĄS˙ÄŔGÖ*@\…‰-łcŃ«íŤPč*Öożž§ˇ‰ {Ět÷¨5´k×®˙毭+†ľ‡ ţhĺ+%ÖŘđŕq0H3Z$"@ě€rÄn€MŇńŔy[ä¤C\(äĂ]*«"î3^˛c(˛ůů@öć§›‘Ďż{™ť>˙rµă˘Ęag‘ö˙äXŢ{ĺRsüpçă¦î2ŚŘfřő÷o#ŻŰÂöĽ”tî*ŔGɦ6ŠŁť‘Î[˙: ş:ą¤Z‰±íO‹P· ŔŽ…­Â3ě_*ć›liôI6GĽyLăC4ŇläÎŕí·Ůź €”–ĆZ}ů§Zť‘śPm'vU!qܲŘ)‰ă€ĹN(ż˝żĚ*>đĄ¤˙,±Ë Cß  N‹$®ŃcË´HŔ˛•Ö šÜ·tĚěîsďGR )šľtQPPPPPPĐE@@@@@@@×Mżl$ßD„­ŇÜx1ŔýPbąÇ{HWĐ̇>¤66tRj`« RŔĺmq@L · DÖ?íÇŽľ·ůěÄkěÜĹď‘ýeukÜM§áaJ'ćQ¨ ĄÇҨpęˇäމLţ5/źcßüđňę»;Ř–Hń†É,ˇĆąPçI˙y$ŢTŘłđUX蟆ů*,Ľ™žč—˘knŹ·eVKă­4;čń’Q3»Ď†(îÂ]mĎ…Ś*vOË-lΠěőŚ)Ť¶z(•€l°7Ú+ĐʤÔŰË$Ż•G˙B‰5bĺż1@±Ö‰ʲAD=~aşżŮ)hü˘Çf¸Mř—ôäŃ'˙Á_9˙%• {J,w˙(ľĘŠA Ő6ü1p0 ÍFé®ĚV-<Ón€ŤXî&…­írů[ä Äjb@ űÜÍ$gŁx‘˛Gj¶-aű·#ú>Ó_eŇ‚|ÂŃ·z]·. ¤»ĄO]¤×Ő«ěôésČ‘—±ŞúL$ąl .č-ŇORÖ:Ę(€řRj ˛Č‰(p`yNHhv?śŮńKµ5ŠťĐt…:±÷Čs˘ą<xÄđÁtlĹ Ő Ž–®đo—“îĚÄŔ‡Ä??˝ĹáŻAüq×" ©1.‰łfĐŚ€>Ĺç?2ňőŘtÝ>ĐÖćýĹE€ĎŹ‚ŞvMË*ÜĚ?s›€X]«2Ś™6 šŮç˙Á?Ť_Đ}ŽÇ¸‡5Đ“O¶ýCşPWćő>”T>T+«­ĺФUŮm*`łş-lwfEŰ`[łâÍ#‘˘Ö¬°:iÝ\Ěž<¸yëťWŮç_|‚\şt‘ LaášŇ‚?ĺĹl4ěŽěńćuőęäěąÓěýco!/}šµµ×!…ĺ ,,a&›?’%VDRęú±Ôg$ąN>hTřé$Ŕ2,¦D };¬Đ‰E¸"«±đwÄ?Íž}kD)ĽřЇ:ŕí?A~:×Á‹˘-żV$[Ş €u*`óĎ@®ępT¶ĆűV šáß›ŕNľÄŔ—’}ÍŃč¬6lTąkZúFH@jŁ­Jë D)Rä’ëH†ż®NĽăÇDHwĔڱ(>ôˇĐÎ@xtxű÷ĽŤ_Đk‘焞NĐ®]MbŔ_ˇäĘQďCşJŻŹâ*-´rŤµd ÉN‰ YâH`Ŕ*î vHĺ‹#‚%˛7jU›YŐž±HÍŢ'Xó“Hbé6jÁ!öbO,rDŠ+ulÇî Č÷ßÇÄ|Hy¸ÉwČ™ážńűż‘ONŚ#;wöňÉ'ÇXMc!—şś ý(Ňäż“×ß‘@ť'+oóAršF±ô7$IěĐ©±CtuŽ2˛¨v0 |(ľ˘óč_(z5Ç_¨A˘‹úłŘbw¬p$‹-‹¦;ńˇoL÷ď©ć# ‘<víÚőghyĽóŕ…Qćß@ľ: Y¬äŢěl„2×9ˆvîFůŃŰŠÇţn’S €f'DÓ¬ö( ĂƸ(Ć’AÓELă                         ëö€¦#˙˝ţépw¨lÇ´d>ô CJŤJmĽ…°öW ýt˙^Č„Ĺ=—xM}ĽÔ´«XeX1覠‹[‹…€RňÜR”˙÷Ś6+Dś,Ř|h!˛íH,{óŁ]ČÎĂĄlUµ•1‰-ŻϢR¦# mlË®zäĂŹŢaź}ţ1˘f â‰vĆ;± ÚßŇ×\˝zUćíw_C^{ăVż®Y˝&‘-Ť, ĆĽ—ş ~ŃYjž?˛ag1{áŤÍHeű"–Y? 't®\cčj%P«Zĺ(Ă:Ŕ‰*ęLJţ$¦`8‹ÉŤ¤9Čzű™±i>=ix*€V>:‹Ó˛¨R€Vu°JMlT©ŤjÚ—ÄŮ2h†ż9Ŕ˝­O‡ „*vLK,ÜXľ3@.KD¬NmípŘňBň»µ˛Áóý©ŻŘďBj7$°TOd܇™ë„űYľNlI'˛çÉÍě™çžBÔKĄO ôŃh¸Łľéť˝^Ź_S5.\dçĎ_@6´×!k›‹Ř¤y¶Č¨˝™Öë>däĚî,$iR·.›ýűÝ—ß~Á.]ş€¬ßϲ֎FÄŔ“~"¦«učŚ@ |Hlű‹ŻÄâ” D9bŠ#Ńyž,*w⟪5ú&[!Ţ+ĚŘÔĺ=ˇcÍG@žcÍÝŰÚÚţ-‰u´ Şď ČGg~:‚}ČM|đ™­NüçËá îJÇţŠ/•Í>$v(€řtJ¨âPę`€‚2µĆeńZͰ(Ƈ>D@@@@@@@@@@@@@@@@@@@@@@@@ײđpä ¨rçÔ¤˘ö‘z({ť›!ąŢƉŕSö)őęýIOý3ý[Ť‰¶bËm‘EZ#¤ "űgô4@S÷^6Ę»wHÝ"@ĎŹb+,_eÍżZ”Ú ˘ź‚ŘH— ´0PBzëPĹŘčÄÚźŹD”ŕň• ě‡ÓÇ‘÷>~™=÷Ę6¤nŽĺT.E“ÜŮŇhg$4y4 O‡¬Ű˛ŮĽłš}ňéGČ×ÇżR˝PÝ-r«~ŇQ:ÍŹÓŹ˝Ă^˙÷KHMs6+ŻKF–EA–F f Bť‘q,§<©kËb/݇Ľ˙Ńěäéď3gO˛sçÎ ŤŰcXrĹHÄt[nÉĎCRŤç(ű+ýAŞ @á$Š@$úR<Á` úÇ8‹á×8‹!••şżAËb‡.Ś6˙ňI¶8QÄ?_Ą+đŤPF‹Blp1-„”Žýˇ %ý!]€ôMÔJS8 ,gŁOB?Í °)6™~ŔcŔ=O¨ €”Ť,Ծۿ•]˘2˘úÔ€Ň6ŔďCşĘaĘPĎ?tŰ€#k.yáťZUMoč`W;.#˙ţđivŕĹFD»tĄ52bŢ_ذYDB'#+3çł—_yy÷ý·T]év9Â'ťńËĄ­Śjľž˙: Čł/ěgŰwŻG–‡Ź`sý n“ďC†z˙™­H€$<Ážyy ňîG/+|Żňďí"ÇúĚI¤®=Š%¬ŽÄ–kX ˙€”@ |)Y”ß.`3¤´T÷whyśó°…Ń'!źdËó˛¨ŕ`„2ZŔů–@¦R4O]ě••"ś PHv?ăŠDţç ˇ                        ¸C`Ó ‘ ĘÝ˙A4Ř#)őv,Yj­ś®N.©FN |H¬®Ť)łE˘W‹[ňÁ„ćňȰAćGŮ*[,xňä÷?{‚`çBC~~± Ň-ŤŐÜŞ—)řęë/ŘkoĽ„4mXÍňĘ"ßءl^Y­eKb°’ĆdÍú8öĆ»Ď ď}t”ť:ó-rţÂiUʇ€3gO!Ő"yěy!Q%¶,ŞÔÇü&V;"ŇS˙®ťü' €RLń$ŔÂţ|č»#ť0ńO±7ú$Y"O(ěđg=ňśhížQřäłŇuě˘hË‹ŻÎňJD‘%â+myě;ˇ®@,„”Vüçl‹ţ S49!"Ä'ŕÇ@‚ł\Ä"@dN MΰIŹŚ…Ź3{€€ ËHţĹ@Ł|đˇ9ňÇŔŰĎ ż°»,j¶f˙×- €úÎťפ5Ú˙˘°ĘćHöÖr`9rčŤŐŠ[ďÄ;~HíV»K—ϲóO"{ž+g[ć"‹Wš! b»łQ ţŠłŮă2ć#• ěßo˝Žś8ńµę-…Ň-„jď? ý„AŻđ÷vąÓ@Ň"Ç>zŹí?´ IÍ `KC˝‘s`CĽ‡,ڱ`Ël‘]‡«Gšůópąrő˛â7¦¸ÍR˘3N#kÚ"Yô*O$rµ-‹,±@naDÝDřÝ`Ś`7TWę÷ä“8`úW 7âß[­ę ľŇÉŔٸ|Ą 2'Č&Ósň˙Ž„<&˙Ď˙PPPPPPPPPPPPPPPPPPPPPPPPĐuçŔĹ[F로őĺPŻ1ţ8ŕ®Sö7¦«UX]Sj‹DkXDť α5ú§[!j@é$Ŕ¤ň@‰eĂ>V €äµö Łt·8Yz‹ŕk;d ˇ´3`Ő& gĹh|j rŕő"Ą± ˙«‹îdŐ(wţâ)vîÂČŰÇ#Żľł›U´ů"ąu3آ¸^ČÂhs6?DD§?ÁVŻŃ!‡źŰË>˙ü3äâĹ‹ŞBAzToWQ ˝Îś9Ĺ^{ăedó¶z–ąYîÁ&.6Cfőaó#Í‘üş%¬zcňĆ{‡Ř{ż„śżp ąpńŚŞçŞ«€˛¨»tQUë#YTÎ0$˘Đ†…™#+«d¤ÇţšŽţ-—(ăCżÄ‰*¶?ă)ŠÜ‘¨Ľa|č{!Šŕkfś˛¬â>ÖÚň§Ç>äÇ`qŚĺeČ7Yq<RŚPzł#}'$[,”¬îW™Ěţ]Ç ­ŃI©·]¶CÄó[ę‚®ěg€fZ§ňď ÷~ŕҢÓÝ÷{)šľwtLż Ŕćö €†_6r» €ĹČ× »xÓúóĐůε[íľ=ů)ňů‰·Xëž8¤týb67ć!Ä;ř_lôü˙F‡ `IپȮ}ŮG}\¸p^Ý–GÉ9ý‚šëä©ŘóGžFj› ŮňбȤ…}ŮŔÉżG¦¬x͋ꅬŮÎ6?µ ůúŰc˛cšUnRTřôCˇ*Äpż‘ýŤ`č(›!×x;7i*ŔŐŰ!2n"B˛úÉ Č2eČ„ż…((((((((((((((((((((((((čşý í îďźOp„*wzGµŹ>eŻs»Ě‡>Ă4<ě%仇}­śôŞú°eá#ÔUČN\Đ}ů°I»BâČOţÚ÷'ýwˇÄňaÇbËůŕâ+»É­Żť™v´bJÇ+‘%š»‘@‹9"ľ®é©%ČA…E€Jp3·ĂU<ňEjú+Č…‹§ŘÇ_ľŠĽđćVÝ€Ä{˛é!"–>ÄFĎ}‰N™Çr‹ă7˙ý űěłOé˘?oľý*rčŮ˝,(f2ßĎ“ąŽý+2|ćlz@$ˇp«ßŹ}kűňÄČĹKçřżű*˘ôřJwl诇”şçKMT¶F°¬aHXž5 Íď‹ý++ř {™Ř2,¦ÔŢtňd €B,ŞĐ•ĹE"s‡±đ,OÄ/ŮŽů$Y OřöĐOYÖé?¬·ňi­I/Xţ(¤´p€Čb+‰×©ÔG#$ ŁŐ QÚ $»MN,ú2ZśM·˙…’yHwR‰ç%fµ“ Ęp6,‹sAfú[§˙?Đđá7j®+W/°/ży9úÎ6¶v{˛rµ{"ř1 ˙Á†M˙o$,a:ËČ‹@^ăeöé§#JG˘e¬YzIDATđúżŹ"ďbľaS‘™K2ÇáżC<žř;óč†$OfÍ;tČ›ďdßţđ9"î· ö> R7®^˝íˇ·<śnŹ(§                ¸‡ áŤűUŔĄŰ"*~ůČm¸_!Ţx|HđKŔEöőwď#Żżż‡µîŤCŇ«&±ů1fČźGبą"!+§˛äśäů#ŘŰ.ś=wšťżpö:q÷»gů×A;ö¶±e!™Ë2·ńCĆĚ{-Ś´F˛*粍{ł‘·Ź=Ëľ?ů%rµăĘ €á7ZJp笠¸7.Óý^Jú5{yl=’dUěśVÔ>ć$”˝nŕEÝZ%+ěЉţކ˝XťZ­ÁÖhL?HP\…ň.€đ|;#śmk H·A”vLXdćăĺÝÍ 3¦ďźeŹeůđŁÇ›1|čCq•ÖF]ť˝^ Ý ŽNmÔ"b'€šă•H ‡@Jł9"ľî—őˇ t­üÄj®ÓçN°Oż~ Ůńt!+m]ŠĚ śŤ÷gdäŚnläôžČ˛  Ě'dňuKÇ3'Ďż!ýFŢφĎú'˛ ̉շ'"Ž´°ßŚ“ŐžH¨ćôľ›{n]„äZ±ŕU}q˘_|ąWn/#>-VýŻĆ"‹ěůĎ8Yŕʢ †"9,L|"řę4lY˘2m…™~ĘňęĺX‘ ~ ľŇŽ€“ę ,{=>̡l•”v¤48"şµň7Qüy-ég„‚2\ Kc±™ţ¶<ô€((((((((((((((((((((((((čş3 ę®ŤRĄ0qQŹ#¦?6şgŕµŰ)°®‡^ÜvîÂ÷ěëďŢCżŇĚÖďIF˘˛G°ĹQdÚ2K6y‘˛Ŕß- đĽnľßPć9ő1dÔĚžlI¤źăͶ(C^zsűţô—ČĹËgU.Đ3(Ürřî €k‹ţnÇđ§ýn8Ň~ńpşńHw1J`şźu Ŕť:>ô%Ô@qűŘ“PW ÝĐąĘ_$ŐĘ%VˉŹTu|(¶Ü–ż@Ř ‘E¶˛ÉŃ3l‘y}D0hâÂ^ÁŁźxÜ ňXŘë/˛Ç˛’}„@ü@\EPÇ?ĐXš8¸Ëh•ď Q ĄM}‘¬uZÖ¸o rŕŐß&nĺ'j‡ŕńď?d}yÉ­ťĂb ĽńÉ€çě?\7rŢ_Xzé|¤Ľ9’}{ň äôąďT˙ž ¦Őú?ąv ď˙5™Ç÷Ć ˘%‚…gz ÁŮV,(§"†ą8Öż&ˇĹv) ´HdÁ>ô=ÎŔŔ—Ŕ˛ČŃ˝í!q|čC>¦°¸ ů¦Ł€­WaÇÎťŚPZ“|`5Ă>k˝\F‹"¶¦Ô;"ÉuJ':°Ő.H`šłqI´łš±Â&yŕ؇Ü!g şî˘$€µ㏷»˝N:üłČÖŇmĄ´čńбłĚG@j ±â@“Vv‹`µ N C°AeĽv»€ü®Šo_Śżć䙯LUoŚ`«ęć!}îgc—ţéşIľ˙Ĺj6$ ÷š>tţâ™.nŻ‹uţş^ÂxűŔe…hU€ś. T+ˇ’[˙ŢV>÷QČ'Ţi¢óËo˛…BhÄ6BżEč” \@?$0ÍE€š±Â*qŕčşA&>ř_wŮ.€í/&hˇ5{f…ow âpIWÇ?\Ç ÎQ €ÄJP%§«m ćŕźf«‡DL÷ďÉ iKÍ#'ÎŐŚĽ˝Ýţ*}śKůĐJŐ€ôääµv¦ă€!±@z<đµO ĚVٱˇ<’ůЇ2E<ąąÝ@ݝOÄ‘¸ú«Ňp{îŐŤlĎ3UČ⤇ؼř˙şniň#읏žE>úâUĹwöW˝ľCaŐţíóxŞ €Kěěą3Hek¤l@€@>ô!q„oL‰Q Ąc#‹ě0qüoĄá9CYh櫳ĺCß™ęc¦źĽ´2d´Ą=$ $nÔŁĐ’hŰ ˘ú\†|’ĚŔ–˙śkŤPZ“#˙yuB˛Ö9›"ĘćĂ]*sť\†¸·Ţ¤n@\ą#‹)îŹđďú; Y~ÖQ®^÷ŰCö#ﻟ€€€€€€€€€€€€€€€€€€€€€€€€®Ű=rďßr4ĹŞÜ=3”ý ěÖA¤Ä ‰}čF aŤBT*@™-‹âCŠ,´eay$(ËĆŕ—f­‡ÄI€wz(E@Žä–˘âŁ÷RH‡¬Ţ çCżůiřţäĐ‘őlűţ2daÂlNě߯[śř0{ëŘaäŘçG@ĎCę<ľW:`ď°0í8…T´„ËeßXýÝp¸)@&vű€l`¦BdÝʨ·a¶CâĘTŔ ëH·á÷ŰAwYl?ŞűŰ–W3l ĘÝłŠŰÇ ń8źdú­±3Ą˙  ľ”řRJYl„Ú°ĐUX`¦ĄaEŞąšŢŰ8}HŔ¤yÖc!oďî7µ|čcé1Čş› )SŮmNL×Ř_×°o ˛˙Ő;?ĎŃ˙1 Âî}O7± ;Šy±˙b3#ďżnAü˙˛7?8€|đ鋊;nt‹âí/žg§N˙€”5…˛Đtw$(‹@vD¬Ţ—÷;UP¤ĺŕ(@XöP’áŽřęlřĐď‹Lőéɇľâęei‰{„¤óÁ,‰żńHmtŕ?ÓŽČőO …˙J VýCb—l@­‹çŻ›P,€h>ôˇ€4ýâhç«ĐL?«~Ăţd 9O¸ďotÝŢĐö|ţ_÷Ľ•ŮŞÚ3Ówő–q_BY­Îčęl$@W«1@I|¸KuąčO"ľŇVF¬ú‡bÄ"@>ôˇđ’kŤdX|Súę!˛E€‹űDNśi>R ]٨ŁPbąç›ŃĄ– Š-çPc§‡’jě ŇŰ‹…€â4@Hz2 ŢĹńŔR٦•ĂrÜiGß\t J‹÷jbmŰ‹9Ń˙dÓĂ˙vݼ؇Ř[Ç"~ţ’â0‹ţ Ű;Ś]ś\Żsçϰďľ?ŐůłÝD@PŽ9b >ĚŻ3 x;1đĄ" 5Hdˇ–E:a<˘ň=°lwś>ńI˛aKú"¦Xb†¸ ·˛Ť˛± Mß Zm7iATß+€ŽB>ř¸rĺČŕCşŐĽÖQ €ÎE€®H@j?ý˘(ç«Đt›í żŰBÎÎwUěú°řĎűßYŐŞŮ=sIÉ–qź@9­NĘ VŁFY¨9ö÷& B@Ž5nađMć«SxŚăCR €äň1G!]ůp…°2ňŻ—P ęŹţąČ˘Půďc€őŰŠY‘˙dO„ţíşąŃ±·?:űâŢ €3gN±ă'ľ@ňÖ,g>ńN€ŕ\  ˙E‰/%ţâżr8cešĄ2–ËŔť}h€@ÝîĐ’X»É7iżA$)€ŁrDňÁPPPPPPPPPPPPPPPPPPPPPPPPPÜÉPŇŞŮ={Éę-“>…˛[źL޵a­Xőo@x$VŰ2LĂ$”ŽýŤŻ°•«ţˇR[ţa„ç[›nG ůgXČ*@oŹŹ” ĄrěQHW1â¦@śĄtR-rň“Äx4ôE”vP4±u|čC3#`ÓBţzÝśče‹ŹÝC‹ĹÉÇżůÉ«ć°Ň ěb l¸k$DŘ#â×" 4€ČBÄyHg F–'Ú°%+ű"< “–!îcíě ‘ăě5aIS, źx—Y ŁÍőŹÎÂQdÉ SÔi‘ÔFGŮĐÎluV­rbŕK)€|'•<üSúD8w@Ţ+¬#]<Đ@ÎُŰ`ÍîyňX7ř”šH¬±•@Â/a<‚L÷#˙Éíb+ŕŻ-÷Ú6Ŕź€Ýj Š@]XŢ`hT@DBä+ŔU0EE źälˇ›˘|c]ćńˇo€|’,ڞ¨řő µńÖŔt_Ű(·áŘAö#¦Ł€)((((((((((((((((((((((čş`÷k˝ ę=s—–đˇ‰HäCRklŮJ Ą˙â‡FJ |(şD9d‹wôâ`Ć ‰<Fńˇ)ŔŁ®bř›Ń%|đ±eę@v‹ŕz{Uǧ5Ëe­sB2×ńü†>Hz‹ý=}°úř'ü»Ž@a_>ôˇ› …]á|čC¦Ű˙öÇňńˇ? Í‚Ň!Ë­» =4h´˝%4r‚łUtĘ$;Č/®˙üĹ1Č7Y9t|čCâ$Ŕ´fGDi€i•żdŘg´8ˤń‰·˙…k´,¶BcDJyą!<:F8]‚¦űÚ9yüw_ČĂăľż(Śšß) ëN€u‘ŔÎ[+o4ĘŐ@8Ŕ/ÝŰpćN €Áj@/ ÷ć×”ţ˛H¸ńHQ­7 ŞŔ( €€”~WůĐżyűÚŘ»˙Ą7Ô‹€€€€€€€€€€€€€€€€€€€€€€€€®;bŕÁ‹»CU»ç-,Ů:ń#(»uČ|ŕ3LŁ ¦•˙?YY%§´ŕOzěŻ]b­ćCż·αFw„ő2zű™1Hm$óˇu€LP͇>fŕ”Tó€„ôh`AĽ`<ęű ť°Ů˙já=JGĎ €M ţëus"do}x9öŮ˝˝ żĆ‡­HtF‚˛-Yp®9"»pqç ™"{$˘ĐŽ…ĺkůµ¨‚Á,’}€1(m ˛L9®đˇŹ¸yZtÜ'iz'M´‡|â\ć/Ś2×C>I†B>řńćE <š‘Ś–ÎťP†řRj ÖI¬ÖňďEc„bKśŚŃ…ä—ÔďňüP§ł·ŹŐňžÎ÷= ŮÚŢ÷' €»(ÚŢnűÓţ÷Ë»AŐ{ç,(Ů:éÄŕű_=ĘäEpcĐL@đë@ôo!˙Y\†ś‡ô|ňoŃíŢ Ç3Đ´eVËzŮŢ÷D@@@@@@@@@@@@@@@@@@@@@@@@×o{1vßď¤d»ŘÁ?ľůŮŽ ęÝóĽK¶LyĘnu?Î<M·ţĺCHXĂ`Mçéר>őŻĚFF)" ­‘°ôˇ»;T|°‰­ŰZ„(íěđaľ ÎŇ.±š_>Ü52ť_÷ńkˇy¶Hxľ#“­ČĽA,< Jw3¤ @–&X±Ĺń}©ËÍ®L^Ňă2ä<ÄúQČsĽ¶[hĘ$;HŔ˘hs=ä«p;`ń&©V‹¨€UR<ýďšâč_(@¬ú@Ś)1Č/©˙ĺyˇNg!oŰĺ–Ž÷=QPPPPPPPPPPPPPPPPPPPPPPPĐEđk@č]v·E»řëž €{ýn€gNĘ@,üµ "߉I‡Vdţ ‘; Îh LuC–ÝŇč7ŔH€µó}ŹB÷D,ô.Ý:íM(§u¨BŽý5@"¤+ţă+mdÄ*Y)Y”v|H¬úŹ(°FBWY™^€ ż4sŹ®ŹšÚÓřÄŠ š°Đ,zäôŢ ĄH©uâđBT‰bʬŤ |čKč9%š@JQâEČháP×_Wżo ňů0( ˛{("x„üőş{+ÄsŹť>ó;ţÍçHA­.H`–•ü(`>ĚŁřЇ” ˘Ŕ Ď·cay$ް‹/ńDb‹†łüHdöpcx¦â“hÇ–®´@¦.5»2iQŹË4<ĆŘwK™˘…–Ç÷_°}ČG!Ź®çĐč¤7;)¬đ—űôfg™”zG$y­Łéč_hĺ{[fg„bV;Ł 1Č?yŔůEáýżf:-töxěAÄŮů˙QPPPPPPPPPPPPPPPPPPPPPPPĐuÇŔÚŕźŕg@# €k ÉX»wňÔ+ކŔµbĐ]˝Ŕě»4”ľ_éó.ś9{’ťřö ¤3śĄ,Äy)`µ'W4‚ĹŚB˘rG#łG"ľIö|č["ST€Ň"@Y$+@ůíäźěvnQ¸ë7Đl—yvÍ€<<îű#Ŕ]GO>ů¨fĎ‚ie[§˝e·ý:‰.|±âß­¬˛1ʆ}…\ląśřXő/=ö7˘Č†ż@X#ˇą<2-‘©ć†ĺ|čCłC{řĐ7B¨Ű\>ň”T6ě…¨Ő– Š)µâʇ¦CBĎ1(±‡” ŠÇËe†>Ä_ÖöERyÔěšě{9WÝ@ĺ@Żď@:‡›QâÎ: X)f„=Ŕ¦ýőşŮwGHN|WńkŇëÜůÓěŰďżFňk—3ßD$(ŰšçZ"ŇÁnîy(ě(páďř=řâŃ,aőddeác|ţTd”ĄńÖČäĹfW&,č~rdůäć©í™:ÍňMp™ą(Ö\ů¦°biŔP2ŇŇ•űiMňÁžŃě"#ľN*ĄŢ 1@µYYĄe±ĄZ#łşż1şp(<řÔ˘0·Ď yý˝{őęőżţž€€€€€€€€€€€€€€€€€€€€€€€€®Ű;ÚXŰŢ8±÷~hÍžů“ʶ=qĘiúĄ<4iÄWÚŞ €29驦(ÂLG˙ćc!*ŕÇE€’čĄ*RĘG‚L‹o“Hov”p`ş+D,\˝yŇv0‚}öŐ;Čw?|É._ľ„\í¸ÚĹÎL:d~«Ĺ‚·2fÝ ô<ČÉŁîň•Kěü…łČ{ÇŢ`Ď˝´Ń?Á–ĆŮ "ĉśä27ůÎ|čEâŠF±ř˘ H\ţ$clŢddE’ ú¶Č$ăô¸ iÝ,şA"˘’f>ůÄ÷›°0Úň4䣳Ľ^`Ĺ 2[#úHňZcJ#” ]M4*@Â-˛˛’ü{Rěj)đ2BÉCO,ô64?hŕ$[[Ű?AwT°ßI)=Yü×˙Uěś5şt«÷ PvóĐĎ’jěŚfbŐż2@…-ÔĽŰWZńU,?ö7Ľ@ţBścĹ2,Ĺëeôö3cĐÄE"ĚÇCJZ5á”\1ň…č+Ĺ”ZWVŮuHđ°cČŹ; ¤Z•÷hT·3 ˝E‹Ł€“ę4HNóHÖ˛-9üâ&öÍw_#.žSůI^á“‚_? n&¦‡>Ŕ¦ţőşYá<><űěö ĄÇWú(˝łWşNťů}üŮ{Hă†"—ľYăČć„›!!ąâgŐ ă[J)ÂMź ü$LŔ*[D@Lˇ;VŕĹbňG#ŃąăŚQ9‰®lYĽ2qqŻËăć›]‚úą÷é aůXeeĺ˙Ĺ:».°}Zž`óµŘ‰EŻ»˘ě; ]ťÖ\ďŔ kź@éM.2©|ŕK%ŻuBtuŽüż=WaoŚZmwŠ.rÓÇćŹcPpňČcKÂ<ž‚‡z ˙qŕ˙DĽ‰”˘‹€€€€€€€. ş(((((((čúM@§»ď÷î÷üב’ö™^E›Ľ÷A™ŤC?ŕŤPçŔ·é€â*lŚqĺ⤿ź(@Ů­ Óí3,ŤOr_ĂŇ„>zhfPĎŽ©ËÍ®BăçőöáÝw(4fLß?KËĚÚ©‡ ôęń/H,Ć”ŠSí;$dxĐŐBŔź­ü¸áW–Z:)^ëĎÖm)F=·•˝ýŢ+Č'żeWŻ^A”N“S· ÍxgŔo´PéÔFĄÇRútđ¸pńÓßŢ ňöł}D>?tż÷ööţDS•€€€€€€€. ş(((((((čúm/1đ!ń„Jż&§yšůކéľPBŮ Ť‘W MGxŤŠ,Ô裊ě‘B[ţżaaůÖF©UVX®•10ËĘdZüŇlťµaqśµšnnĐÇMYŇóŤ1szěA¦› ň`ń ¤SXŘRÜşx?”ß4÷ą„JW†ő7&T9u`Ş@¶HŻ^Nu(ě HkÔ"+×Ř0żŚ^ČŇ„ŢlNČăȲh0É«fµ-Čó/íeoľý""ś]˝zQ»0P rHíbAŐ·>ĐÄZ·"żF¨Y¸§vŕů çS§żgGŽîGž<´‰VĆ"I9KŮ ÁČôĺvlÜĽČ„…ÝŮÄĹÝŃ}řłDBrlXhÖ9ô5?OáÄŔĐU) ‡"¦ČtŔD$$e4 ŇŤD&.č{yĚěž— ŹŃ˝ ÷‘Yx‡şýu~X hqŚý´e+íZ  ,×ŁŠ†ś†’+Ç^ÎZ;Őĺ6yVµL7"ÍŢ2Y SĚú)ƤĘŃHBůHCDŢ`=’;ôrxć“PhÚđ—=« ߸!3gúiz@ó"ěďW8I–Ný»ł?Đý^Jú5%ó˙•V>»?–íV”áxÉ´»”eË °UyNWˇ\Ť>8Ç ̲4HdX ţüťĽoŠĄňI¶Ň/K°é€ý˙öî<Ž»Î˙¸€$$$¤¸ÄE’ŐëJ˛ŠŐ{łzת÷®ŐjW«ŐJ«ľę˝w[ŽÓ‹ĂBá¸p$ă.G.”;ˇÇqpw˙#Ř‘v~˙9Žżß™1^'g’ďçy^Ď=řăH¶~ď3łFĎť2ťbR6»qY5N J-·{&Ai3 %ŮŰ[ňqŰxRőhő‰Ú‡ĎD3hčL7púÄćăŔĂÇá; ÝëŢfĘ•UtY#ŮMűXBɧĽ:gVŞňGN?4Ć>űěYäwżű-{ë­·‹og˝Š7[řŠúF€+ţÂwO Kcç·˙ůďČĎńcvćáidjąťĄ» ‰Jžy;’XĽźĺ4Ř"ĹGVˇwEÜXó0Ö6-|7αčđ— €ö9™?aY̤K }$ťµ Ą!Îç“‹íţ‰ &ĹÇĆ’Ż 5FoÇšď*¨e4řlŰTř/!Ózć˙NŢW ůGjŘŇăőW5ó`%2ý@ÜČAú×2YűT˘›{«m$ţ'v(öŃz㉏|ëźžg_é9d|©žk`ĺ­H©Ú—ĺ5:"J•+ÖÚ#ezGVmtAj{]Y}ż˘qgę1L¸ @—žţ‡Č]ôçŤČ@ĆĹl!‘…Cč’ €a>LiHząó'ű/(0FqŠLq>(˙" Š*“âŽÚ^;¨y<0Z;T u/%N ®Ą>ŤťQţÝäýE߆f,˙ńÜCĺ?…&Ď– ÷żŮ·–ţOPďję7Ú&Ł€4ăs-CÁĺÚ×Ôj Őt†ZúäŘ«żť<íñ«^ŮYkôw®í Ě€*ôžŹ—·{üŞ7†śoę‰dz ‘µ&! ĆH^RĄD*Űů/`Z¬Ś˙‚VÔ„)ëýXvµĄ•»}3ˇŔn ŠĎ±uv¶ú$ÔĐpłřÖHąĐ©Ďjľ m=ŐňÂŇăĺ š{DÉ™¶CwÓ'$ĐoiÜ˙ţŔČޒ߇ÝëX׊3,aŤC¬˛Űɨ»›%U|©Ö…°:}ň7Ďůú7ż( 3gń!+ľ‚~÷:@É{x/€+8ävţÂŮ[üňŮgďgŹ|f )¨÷Gňj}XtŢHbń=¬HcŹ”w8łĆOlĐ“5 y`Ăî<7D=îÎZ'<ëŢDüŽ?ô ĸ€B“űäľV*•Vź€ä^7OxßÓ8âáµO);fBş ÁÍ´‡†OešĽŻčŰS÷?Sđht[ůĎ˝+)ĎB=ËIç4ăÁPë¨iE×=Ç ZÝťűä^Šż3üÎ DŤ€€€€€€€F@@@@@@@űP\)h%ůĂ <«ŞÍ÷n¨˘ÝÓŻL§H†J5^ăĄZĹY¨RřÍ*}đ+.ô§Uş°źAšŕ_Aĺšŕź—¨˙i:ńOůµľ_„rk˝Ö3+Ýšˇ”r·¸¸\;(FyđÉŰ!?oşILîCrúsš§ ­Ďµ<·üDć• €í»ý§ Ůö˛đ퀥$Ź~ŔGňß‘+Ü &„‚ř×" ď4Ö»ĺĹz6HçŞ'ëXö@´3n¬uĘ©éudŐÝ"?¤ˇ;„Ímę3ŹŽłWż÷-ä§?Cćđ” Â/\DÉ…Â˙ö!i´ó ąí]%2wüđg˙ ůµ„_g÷mäâ#ŽńďU¸Â_ü6Ę˙ňÚ+ě…—ľ„Ě­XßDRŞöc…Í ¤¤Í )mwbu}®pŐľjÄinĎ«Ró‡»fŠ˙\Oy"ÂăzŰç0ą˙ś‹Ľ$Úf0ý\ čÇbBĚĄ r NcZS*’^ćü›¤‚c˙98Ţą…»}Ú’LÂ×ń…Ä [7W™ěo…tóˇűÚŽ@}Ë)N}ë™nĐŕé<Ó©lß?Ą3çxçb˛dśOrVM†ZĆö+MV·@_ôHîŁĂžv9”übHîvÁZťb_…Vq *T954;ŽCĄ­Çź+mőű:Tˇ y­Bň:TŢň&T¦yُ9đe¨¨É˙kyµŢA9Ő^˝)ĺNqPj‰ťÜm-b{ŹC¶,ÎA§>§ţµ€âď˝@úN)„÷}@z6ů(ŘôFŚkެk«°aU˝G‘Ô껑̺CLŰźŽŚ,4°o|ëËČko|ײgć›wřC˙"Ľ×7đ+{áżS>¤Ďóżpá<ňň+_gĎ|餭/—•©B‘Äâ,®đ.¤To‡”fÂ[B;ĄĐđ·Ä$Ö:é!!ü<í4v=@xĹoQĚż‡(uţwţĐ˙äě|'¤QÜaiż‹(÷őŇŇďľĆ¬n h°şůj¬®ý±Ľ“yž?Ť€€€€€€F@@@@@@@Ł       }ď˙ˇ‘“ŃpôS™5nź†r*Ü÷7€2ę+˛y_făťŰ`çĺŐ9řd48ř_免!ŕ.DĄ¸C©TÜ ‰dc)ů #ŔóüˇÉýËo=­{Ú|JýÔňąJÍ?ZŔ™N‡í`»â§í]é"@ąÇ[Ţ Ž„˝=jŘtżô÷1pFjďAŃÝ ÂĹ‚b=˘G :nŢ“U÷C*şěXˇÚi4†łŃ…Fä‰Ďm°ďýËËČţî7]i˙ÜółÇź^DŠ:ö±Ľ¶O˝«´ó č yăg˙(˝ @ć‰~żúőOŮ ˙%dóţQ¦ëW"ĹÍ~,˝Â)h±“<©O¸*_5â‰h§˝$ÄWĐë„u~LÇľ–;´%‡ű‚TűĽ”Ü]íłŘ^LcBtń‡>d\8ÉG@*Ň5#Ľp"ř­ýÉHZ™ÓĎ m~Ů„ÚÜŮÇŘßz­wMÉ=F÷âŰŻKCAňtVËž¸÷1é“ű„+ůńŻńżSöë ŤöŢŕĎřôq±Ä«ŁqVÖPrŐÝöPJé>›ĄŐH•Ő­}Cţ9Ö×§>×ö ´őŮÖż’Ŕcťč·0ú¶ŽK×|ò«ě9‚”vfé5RŤë)Dî|–˝ňť—˙říŻ-úNÁő ąçü˙ü—?f_ýúÓČÜF«mK@2*Y¬ň.$Ou”·Ů"ę1áý6ĽݬŚ9/ q\Ś€ëtř_ď‘ €Ůë' mß„n°ôµ’0}Ü’ GúŇ((((((h4 í€Č2«#B\"@jíÝvĐ @[źŐ|ćŁ| Ŕő€ŞŢ#H©á0˨=”i¬s¤9űŘ{ůź_@ţý7ż”y ô]ź{ţˇk €ň ÷–ľ;;o#?ůůŮß|í)dvÍŔúńqw#ů|”čl €ë©ĺN?ăýCů`Ů5´ëbBÄđđ wýkąZUćO˝p•,ţő•ďáůąsç,ş `ëIM?´ńDËěňăU š¤P€]hŕT Y|˝pU˝řJ{q\Ś/f‘ ń!>ôg<2X|GÁĐý>’č‹“˝ŘĆ$ˇ# ńS}§Ž#˝›>¬“H=áĚŠŰ"ąÍ÷˛´ĘCH“1žőOŐ ÷ÍgŮŹŢüňĚWΰs_XDĘş÷łBĂíďŞč=Č^}ý+ŘkË^ýŢ? •űŞÎ ¤¨ń‹ĘąI©~ĎGş>¦™đBÚg}řĂ“;P;˝$ KŢ‘űg;–Dd~Ž~áÚÉ=őO8đĹd`>›;ÉKĹf2Í]ÓŮ»ş?™kî>‰¤”8|3Qió<$÷BĹęÚŻ´§Ń((((((h4 Ť€€€€€€FűĐ€ř)‚×ů/‘ä)…DlžÓ´#O´Ś,=VĹAs ľ YŰŔŮ8¶e@&z6H聯loC i¦\XEפP{„e×EŤQ¬k¬ůü—`˙đíŻ!Ź==Ďîr©ě»—•vßő®ęĂěĹWžD^xů3ě«_˙<ňГˬ^ź6ú±„ÂHFíaV ±A]™vŇ ŢWQ|ˇťřŔľřvÍ×KWp#ŕ €ś]¨Ą/‰kěJ@ŇKżĘú_€(h´($oË{ď÷_@ńŰb^éž3ŰM^Č}ő 3÷W^€&ď+|{`+Ę őosâW»˝› ɡ(–Ű"g,»[ŔŇď ČóÁ, Yg¤äď ’» wË[ćőmú"]+Ţü+aO¤˛Űšĺ¨îA˛kʱě*g¤BëËŞŰöy7¦_t˝lÁŤéĆŁ¦ľ`•u‰Í»—%•ďC”-6¬Éä‰´Ž śrń°ÇWĆĄ¶đď*±ęcŁ ą_ŻSlYĘŇŔ°( ćĄO.ý«ťÂÚg‚řC?éśMbťÓ©ŘdönçDţTŁŹâĘZ”VćĐźTxT Éý˝Ź‰±ş R*­>A_Îi4 ŤF@@@@@ŁŃ(((((h4šě!ţ±k<üŻk\|zą'lÍś®s€¦N×…Lź­ü4q¦đ×ý1Ô»Ę×H÷†'ybŢ)étýŰŇ(Ř;Xežx˝@xŕ˙Eôť˛Ŕ^G„· îXR &{Vf8‚ŞXA“3RˇóbUzDżŕÁ˙î€ÓŽ#Mţ,©ŘI-磣éRŞ·—Ľ{źfňâţ~ž˙wXŔ„T|đĘřâ§*ZL.VŻâ°0:řşR´Í(D„Cßiź ~碿Ë:gR¸Î©t¤c<ˬÍŢ…Ştao•´üĘ,slN):ZÉ}Ý|Čęâ…4íĂ:Kľ+`Ú®Ý7şYą Ż>Ółx’AĆĹHł~ÁűmȰäµŰµŞ`P÷şBzuü;w @rQđ#l’s­pźeŹß=p‘ŹD˙i¬ď”ŹĚwx›"Çy~zÂťg¤˛ŰUtŮ#ť+Âyü]Â!Ű4ę„4;±Ş.¤®Ďť?Ü}áŕnÂUďüź¤sYx5ŽÉĐđ÷uI÷şTφ”ÜĎ“~MÉw |ö>&ĄßnIb>š)wÓNú!íSáüźŠMeš;'rw Í`*×ܓȠÂĹ›9őNßGšśĽx÷BâÝ@ŁQPPPPĐh4 ŤF@@@@@ŁŃ>ä0u¦ćÓŁŐjČ´V0ÓłňßP×\ôÚfŽďBísŢ»‹žf¨sĹ“ëZăcčŢ»kŔ Ů»XPLö톥Żě!}V†…řYâ˙$6…đEtłž¬uŇive C.H—pľ‹˙ĎÚwD8¤MpźvÚi›‘ľ5Żpŕw,ú ¡*˝j_zŘŁß×;äŔWâú€ÔĹ_Ř(řşLř FB—|H?Ç:§39Č0‘iÖŹfíBÍ˝q\]g8ÂŔ—r‚r[ěRZťď„¬,{ ŤFűČ€đhaŔô|ĚM‹§µ‡ ÓBABĎlć Î©ř_©GýÔ:îcÖLyĽ éć<ÍúO„gŕ‹nËę^÷ćż ‹Iź­ßłĺ%!{ëá•é«Ř–âg,dA\Љ-LńǨ{]ú Z8Ě ËX÷†”8&zÖ}ůÍąôjÚ»ş_|Ř/çULî°ď^÷•Úę‘ĺ'Cćç­cÝkľ||ÇV¤„±˝?ŃÇD7+Ő:á%ÂÇŇÄ D7ÉżÚźNǦ˛¸Î‰|3Ô>’ĹiM© Ş1rĄZ3TÜęf(juI”:›ŰÄďĹWüÓ-4ŤFŁ     Ńh4íĂ1ą'Š@x âµ5ŐĐČBˇGď|ÎÔ1™đíhČAęQß·T#»zÂťŹ¬}N!ÜAŔA]+ľüá‡tŻůł@řĎŇD¸8ĚŰĽÂjˇ~‰ăü!ý>˝eđ»¶°^^Ď&¶w`Š>&]«ŇOî ßQ ¨ťËľ‹ÇĂ’ôçt ź3ţóuŻKőlHmĘűy'®nť·€tŻđż?‘e)Ă’?3,bú9? í”/˘™ôe-Ł>"ľ¬u4„4Ł\Űh˘ŇŽ$[8HŐmně Cj:ý^.ms*Ńş')µnnRq‹ŐUžLjEýŃh´+~W@´Ž™ňŰ+| ĂäÉÖ¶±čź@Şˇ€ß×÷»3¨ŃäfnvÝ4“ŠÝ¶i/¤cágX bP÷J¨„qĺ„˙Ĺ{Ĺ1®úʾҔ‚ŇŰĘö®´éŰň˝v§äřIôË˙śŢ-©žMé«âîu©ŢMâ[8Č»ö>Ć—ů´{ Ű;x7‘ŢM©ľ­ ‹ôn[¤g=[ áü` ă ÖµĚ:1ĂBëÇÚgřWîÓzĚ_˘yČO$€µ E!•)b·y rjě 1×vű3¨şË{·Ňŕń6TŃá±VÖîQ•wřÜKŻöi4ŤFŁ     Ńh4Ť'wQ $ Î)oé^­Ř'Ň:Ćă5z$d»qĐ÷¨i@ń›†73Ô4čĆ5 aęq®uâ8Ň1Ć sáHĎJ ŇËë[‹‰b˝ká"a{‡ĆkAHĎz Ś˝Ú’ôý96±ŢÍ )™˛oKŞ+T˘wSdC&Ńż.#8yQWŐż-Ń'¶Íz×EřĎĎjҽŌˑHçb$ŕG łáL?†´M†2í¦ ćÄT¦ 3ÔĚk ć ®ľ/Ŕ Őőúýom·Ď/ˇŁ÷sU]Ѝ˛Ë#­˘ÝÝj0ýă˙ľBVô_Ťö^&Ü É}W`f¦üvÓB‘=¤‰ŞU‡>5ö{˙¸®×ťAµ˝.ń.ýt$ë[IAúWSŘŕ6°žÄú×⑾µXţ0DşWĂyaHĎZ¨„Ü+J!$ÖĄz7-Ó'g+Ű”*Ńż.%s`ËÎý[QW5p*š žŽÁNĹJNÇ1Ó¶Čéx‰ÁS ›Rý2úֱ޵ţsŹtŻÄ1ăR,ҹà ó~:Š˙s‰hÇ#f SŹ„›ĹT¦°¨Ůş[ßŔ ş>?VŰă%˘řĎÚnĎď!=ŠÉĆßDHe <,ýîľş˙ť+üi4Ť€€€€FŁŃ((((h4Ť€€€€FŁŃđDO´Ú»Ŕ_,ČGÁMóóĘŰ öŃ([Ípp¤jR úĎC ^/Ôő+^CúÜÎóÔ4äÍš‡|.>ľ÷8UHř"Ý=źŚô,¤˛•ldp5›™ÖsD˛Řŕz†˙Ď®'#}«üáÂ$Pďj,/éY‹’EGĎoëµPßF”D˙F´ÄŔf¬Ô©x ąwđÔI Ó©$ětÚNÁN R±mAvZŽmĄ3ÓV2(‘Î6¤ú×DVÓYď ÖłśĆşS#˙g¤k>éśIf†é$D?•(Ń6õMDżK;Í©GB±á M¦€_|§iĐďQÄäojôM…ú˝˝L *“ý­rOô“ąFŁŃ®ďÄwěÝ1`ÁÚGcBtă1•PÓ€˙ąú>źoA5=n¨éqaPý€»˙ę+ŃŚ†°Îéd¤{6ť .+‘ˇŐB6˛QŚ oň”ČĐş ™ČŔŞđť†d¤w%A˘g5Vj%ZjMŞ×}ë1üˇ‹ôoÄIČ˝z¶č`ß“"!9ŘůC|x;;ť!µť)u:Kbh+[Â$cp#Kb` ë_Íb}ËXďRëYĚDş2qëâ˙ÜtΤ!†™^2˘›Ś‰ű+t^5đÔ<đ<˙gv Î3®§Ý™ÎĆÜ*÷j_ćö>:đi4ŤFŁQPPPĐh4ŤFŁ]—˝s! č1ÂŇ«’;fNŢnś¸ęźĎSô/CŞľŘď6÷Ĺü/T¤qŕ [íŘ%EĽjŁ ńáŔ5™|Ô2ěÇtaHÇt4ëšKBzůC``)1­đ±P„ ŻńÁ°Ž ŻI ­ ¦5>>VóDrŮŕZ¶„ř \Ëâ׳Ěi#[jS É>•+#9Ą4ŹnrŁŰE ŰS,RÂĆÎ`ăgĘxĺČÄ™ •2Ş$Ćů—Ř–;]ŽŚž*e#[ĹČ{ëyHßJ:׳ś‚´OóüT4˘U;öíK4ăaßj›A:őř‰pH5č« >5LÜ%ľëF©ĽxçŤčńÜô„?Ťvc€%ŻR>űüŮ»źţĘŁ‡ ő@ň?¶ôťüH©˛ăň›mŮ%J•-«ětä Ş.'Nüť‚&“ÓŚť@„0ĚÄ#Ýó©¬11­ň‡~ 2˛^ĆF×ËáÇĆ×K$L«…"Bä‹đĐZ®gZĎ3CCy»›ůf±aÂá.U(Áć"%ÜŘv)ß.ĂDýĹĂ^zOŢW-ŁFFí5Ş‘†ĂvĄČČ˙yŢĚGúWӹޕ¤ťǶÉHD3ňď…K´ăˇ_ŐMWCmSÁům G Ý|č>KżŰ&DD>ŤFŁ    Ńh4 ŤFŁ    Ńh´> ¤O&Űűb&şČéË/oÝőüË[ ŽŃ¬o´Źdü”Tr„K,Ľ—]vĹĺä řü\RńaĄ–e9őÇĄĘ•é\ŞNVßë…¨†üzôŇ>%Ľ5lb\H`Ý ‰H˙j2°šÉřCŢČgŁ[EČŘV1›8]†Śź*ă\¬‚˙ńJdr›?@Ď`SgjŮÔ}uČĚŮ6s?6÷@ö ÔüCÍlń‘dů15[}Bť“Ó*±rNÍkA–źhbKŹc ŹÖ"óŹÖ°©ʉłĹlh+XĎ`ĆĹ$D?ËZGĂşV®÷BĘ´'Ěešŕ]HYĘĺW‡2(.ÇA•n“z™íI“Iq Ô°pł8†ÂŹCÂßą'oŇWŤöNčG2˙J*:Ě%dPLΊÍ=ČGÂ!%—aYµ¶H~“+Ń:!•7VŰă‰4™Žł–?¤m2„µO‡!]óq|Ä#Âch± ËŕT č—#ă§Ęů»xčW!BLť©A¦ůúľzdöţF‰ů›ĄÂV±ĄGŐČĘă­líś{RŽFbőIµ„b ŹŐ" ™8[$ą}Pxpcpĺ~ËpRc<ÎJuHI«żą¤%hĘ« ár+BqňXFPܡ¸KăŽD]᯺j_ř™E@ŁŃh4ŤF@@@@ŁŃh˛“ €âĂśđżűC±ąÂˇäÉ@É–Ycä6rDĘő®¬Úč4ô{łf“/˘bm!a6†uÎĆ"˝Ë©"ilp-G$—Ź€ddł?ŕKDJąŃÍŇ]Ź^%2qşj—ŹdęL­yęL2s¶ž×pŮý 湥lBćj2/>˘â ĄG[řPK=!Ö–kfK" ŹÖKĚ>\…Ě<ÄÇĎ}EČčvÁŢ˙ć ÷ŽŮxD;ÉšŞNV¬uÇÔţćbUĐ.”W* € ŤF»jČýś/ţýňťâč›ÍúfĎlćo!Ąę—×dÍŢŐhÍŇ*sPJŮ!..ďbr°ôýXÚ~žz‰H;Č˙˙îE˘ł±ěĂH‚ň(ÖHJů1–Ze×ŮKä79#*WV¦óFĘŰ˝YĄÁ›úüĄýGH7ţuýlÄW Ă\ôKťs1/cqß횏˙>Ô˝śř˝«;ů˝ľ•”ďB=KÉ?ęšKú¤źŠ»Đ:Π–ˇ0¦ EúY]OReđe•Ç‘Ň6/VŞĹ”MîH~ŁˬvD2*řŘ;†ś,˛eńůÖHlîQţózá?×\Xę$IéiN/@rJĂYnY$•l›šx(ţ˛ĂŃ’§ůńřC0™bn˘Ż4Ť€€€€FŁŃ((((h4Ť€€€€FŁŃ>0źýÍ^ţЇ ŐÇ8ĄĘ†]’ßlÍ2ŞŽpPZĺa.±ŕ âóň_ä Q™XdĆA‘{y‡ąĎ?ĘG€5’TbË’K±ôJ;$ŁĘŽeŐ8"9uάPĄŔZ<ą˘V¤Ępüő–á ĎCÚÉđGřC˙ Ô9ýXç|Ě“ČBÜÓüˇ˙yȸÄ[NĽŠ“źď_I}2Î'C?yň÷z(ę­Zcj:ýYUVŢ~\;Ĺ­ V¤öD šÝ%rj]l^z…’VnĎ’ŠŹ!' …°AâřÉ>‚DfŢË…§D’ <Í%HNY8ÇúHDę±ôŕřñ—%Ś´$Ţy˘ŤFŁ}tŕéśůô—ľż˝2­ĺ~cp5ű?  #W¦·cPˇÚ† Zl¸śzáÉ—e×ĺŕ#Hjůţ€Ŕ ްř,”p Iä˙ů$,éwh Š>tĆ?řHäyř řccu“Biu Đ`uł’˙q1ńĎ©2ĹÜzîÜňAHĄËĘ(­Źţ””ďöKßčO1Č/úÎ/úÓfČ?ćN. öN&ÜÍ‚ďAÂRJD¦–ɶFbsřWřy¶HBľ-KT“*°Eâ•Ö\\ţ$ŁĚ‹Ë­:äW†żť_q M¶Ž÷ŹŮr‰oôţ@™?ć?P¸ €ľBĐh4 ŤFŁ    Ńh4 ŤFű°Ŕ_żúŕí_ţŃą» ˇŤśż3­gýTmtâ*»ěŮ%ťö¬¤Í–е¶śpq $Ü-ĹG”Qu”Ą–aIĹGůĂ‹Ď?Ââr±ěŁQÖiG°Ô#,4é0–|”E§;")Ǹŕ„Ă;PPüa‹ŔŠ?XÄyŚÉę&‰˘źc2)oyć™G@-†śô˛Ćď@)J÷_řÇŢΠ€ŘOsqw™ˇŔř»ą áŔB’ö±Đäýp÷Edú!$&ëČQ—gľÜa˛@¤P*ţsŤd”Ë€p蟇Äŕs× ŤF`A|˙űßżĺÍ7߼ÝÎ}nôtÎŹ ¦!sɉAŐÝöTe´çĘ;ěTÚ~ڶÚ"ů*[–]odT۰´ ,ĄÔ†%—`'‹x…X‚ŇV".×F":ó(“Ĺ˙łąNHl–=‘zt O¶Ů´ó‡ü"ťĘ42®içÎťűÄ+ŻĽr7ÔÖSRŐ˙*”Q¬řEđÉ»Äě\hň3žv‹HnµĽěâ]ř¶=p5żXr±ťDJ‰˝ ; ń?w˛ĐšKPA2Ë˝č#ůUáçó«"ţ…ĄŠ ˝3ř ŤFŁ    Ńh4Ť€€€€FŁŃ>ĘŔ»ů‡?üá'ˇ‰3y_?“űCH5ęjnvfP]żŐö9Ŕ ĘN{VŞłCŠ´Ç˛Ëmß‹eTٲô ,ExŇ_ &w@‰ź@źgłwń›Í@ž—ýţ˙1˙ĄPÓ˙*”YŞřEH’pč_šĽŹ K9`†"Ňpâ§/ ~l&ř’'-ŮŠ“9ŘíYj©Ś2ţÇRJí¤bîdáQ$«Â›ĺŐś@ň«Ă/PĐh4Úu‹v“ĐÔŮü/LžÍ} jťp3«Ç]Ô4âÄAŤĂN\ý€#ęúůp@*:X™+nłg…­X^“Ë©Ç2ŞŽń!€í={ľßj–¨´Ý»U ŠËĺ<ß ‰Ë±ç"ÓŽî@á©€YÂÁÉĚd2}\L.^xá…{ ý^Ä˝ e•)~š|7ÂRöqá©ü«~ 2ă'<‚ŠÍ=Äâň#‰Ö⏭@î°O+wŞcʤ”ŮrÉ%ÖHNµ7SÖb5”Ő‘ç! ŤFŁ    Ńh4 ŤFŁ    Ńh4IÜM=˙…éň^‡´ÓîfÍ”+{פ+SO¸pP˸3'ľP°ŃäÄęú±š^'>°ňGVÚŽµ:°‚,·ÁžĺÔaéR’·¦-˛•}z]R3’kĎEeXď@×9®p "DÁ«Żľz;¤ëËKŕý—ˇ¬rĹOĂSďaHÚ~áŠ˙](*ó “-\řwY<ŕ'(Ź IEÖÂEyHj™ťDFĄDfµŁejôĘc\Z… ’WçĂ ‚Ú µ‘硽8ÉţďđK¤ Ńh´k€™‡”ĎÎ<”˙:¤›ő0·Í¸1H;íĘA|đŕÂ Ő krFťY]VÝíÄ*;±2=:¬@íČ”*,»ÖeŐ`)ĄÇá»â;”üŹ:#‰ů\t¦ő‘öâĎKkwNtµ&ţ%(»ÂóÇé÷0(2c?˙Š˙ŕ.“}/›s/”‡÷ŢJ)ąxű%”Va'‘UăŐ:˛śz'©:őŽHVí1.ŁÚQ6ú°âć ¤°>âBa]äy(,€FŁŃ((((h4Ť€€€€FŁŃ((((h4íOŔüŁĎÎ?Ş|Ň/(Ěíóî ŇÍşqP](Čkťte-|@ŞQÖ4ŚŐ¸°Z> *Ł3«08!%:'V¬Ĺ”*©Ěj{$ŁĘnďB@(©ČŽĄą '•\L–Í’ałgç}@pÔlH‹¬ŃĆ}Ę©Rü(:kĂŁłîBqą÷r ů‡”Tt”#,˝ŇV¸(É®sČkrBň›śůŹ»‹ g©f'$ŻŃžË©·EŠTÇY™:)n¸PTu˘ Ńh´ë‹ŹóđđK ł~ŃAíón2ÇG€ä»n{©'\™j " a«éąPąŢ™•µcE©ţ‚„ď!ś\bÇR‹]¤G.6ŰfŠÉ”@äűţÇ?5RÂkŰb_€r«oÄäěgPtösL¶đŞ˙˛řüC\bđŠ˙˛”ŇŁ,µĚɬ¶c™5X^ŁŁDA‹łDQ«« )µ3˘TŮsyMǵ/+×#%Ť‘Š˘ÎC4ŤF@@@@ŁŃh4ŤF@@@@ŁŃhW €Âg/|ę\Q;–<¤_pçywN7çÎŮ‹ ¦™ÂÔn¬e krăCŔ©éqĺC+kweĄí.˛ŮÉordé•vX…K/sERŠś¸¸Ű(6Óö˙*ĐE€Ş®äşö¸ˇĽ:Ż7âň0(>ď 9>˙Ţ](©ř0—Rv„A™Ő6,«ÖÉkr`ůÍXQ«łDI›+RŞsă?Đń?·Í)Ň8rj;¤ĽÍźU·‡"e͑ʣÎCQÖq!'÷_”x€€FŁŃ®5–ž(|–Ź€×!! Ë ’Or§âď \ü΀;˘™tg­jäb@µ}n|`ĺ|豂'Dî΀Ě*–Q;qńą¶;Plörw¨z3"ę;â^„”ő^oÄçó‡> Ľ×ś <´ Ą”áŇ*Ž2(›?đsęŹ!Âm•-X‰ÖEBîpŻčpżŞr˝Ű^°AĹZG®°Ő©Ôůł}RŢÂ@đq4ŤF@@@@ŁŃh4ŤF@@@@ŁŃh:Î>»ôdáëqÍËܵęÉ޵âÉ KîśXǢô L. tłHŰŚXë„kĂš†n»´|4u&ż7űľ‘T|A)Ą‡Í©ĺGwˇ¬á { RŞěřŢ)msbĄ:g¤Âŕ†T„ʱRmô`5Ýž"ŐFwţçcĺÎ\‰Î©6ś`őťH…:ęB™Š?ř ŤF»Ž°bI¬^{´˙ Çš‡/FTÓí¶P™Î"@¸ÂitbąµHFĹŤÍĆäˇâfż7’K1(µě™…ż e×Úpą ¶ *h±c…j{D8đĹ·YVvşIľXmʧ äR@B”¶;"5BtE 4ŤF@@@@ŁŃh4ŤF@@@@ŁŃh~¬}¶đٵ§ _‡ş×˝ÍĆ5 Ëüˇ/¶äΠžřÂŁ»vĘi&1ő¸'kĂ=$ÄVvşňś#&<¶٠ɩuă’‹ěv “J‡íČ$g$E>„şž ͉ФľU¶ťx#łĆšAYuÖćś›]H©˛ĺ [Ź1¨TçŔĘôŽHe§ ˙ńÂęzÝ%<%˝$H}ż'«ëó@ŞŚ.\…Á ©3˛ĆžH¤J}ľBýG(.Ç.."uđ%á©4Ťö‘ áN€!Ř Ůu6Ňh‘ €vi˙*´4ŤF@@@@ŁŃh4Ťö`ý©˘gřC˙5č/.„‡Â…k’P»°BţЇrkÝĄPč°•ŕěĹĸ;hŢĎčâ m0íE¨Š€¬Zke×˙ĐáěúF¬®Ď©ďs—9ü×ŐFWitSĐh4Úűź?rvő©âÇVź*ú¨{Ăg׸îĹ ţ€7Ky0hďme,x"ísž|`m3 ͤ‚µN`Í#ž¬y«ď÷@„W­%mNćĘ•iüTĐämN+s9%:®ůFtîąKî ‘a%÷ť1K wRaËyŞď{#żŮžAJŐ13ŕďBĹmv\i»=ŞşśXu·3Rßď&Ń4ä)ˇń’á-Ń<ě…4™’x¨éq媌ÎHCokîŹDŞŰ˘/T¶Fź‡ł­ăĂSö…\–Ľ?€FŁŃ((((h4Ť€€€€FŁŃ(((h4Ť@ß‚zŢď—€nö  ˘˛$úŘ˙ąŔ„("Şëwăřř@š‚™ÚŤÔčŁ˙§Ş-ú÷P|νˇÁÉ·ű\t‡Bîă+ľ;ăťč˘Ńh4 ŤFŁ    Ńh4 ŤFű ?đĹ í˛üW…§—?Sř¨wÓ÷íž âü]><˛äaQč- €6™P[gépă*tţH‘Ę÷|fą×ď Ôb·)‡`«CĐŃ«O}Đ`śPđ‡ţg ćľČo—ę\9Ěq·¤ýŘTŮĺ`®î®úżL8đ1áŔWŤbęq/‰Ö ź«şĐĹ Hý€WŰëb†řŕZLQ ŞŃGţ{e[Ä/ˇĄµŻŇ'ť/ L¸ŐQîó"ó„F ŤöŃ:ü-y%´đXţřücůA}›~o÷nř˛ËŽ3ĂŠŰŽ Ľ(ž~AÁôóXű@lďPĂMžČĹÇ»šˇ «ą¨ËorůŻ´2§×Ç®ĐP›Ű «›®gL17AçÎ)?!ţ9ÝăyîĆ©śIHŐţ×Uťž âăf·Ü`÷6TÝăh®ísbPŁÉ•,hťđ–ĐL·$ ĆĽ%·6 ş›ëú]w ¦ łj0‚ŞŰ˙ĄBôm(ĽČö¨c‚Ő]—8§XÝy…ĎĂ5nh4Ť€€€€FŁŃ((((h4Ť€€€€FŁŃnĚąJ&fĚ­ť~8ĎWýţ`\ńÝ˝¤‹gXVxšů˙ËAKžśÜ“- /ţĐ™ńfm3>fďp9Ž4 ysČ 7WÓ­Ř*;=v Ő®ÄŔOÓËź„2ĘĘn†„‹ô®ç!Łä|HîIu˝óJkţĐ/…Ô!§ęzĽţŞíń8_Ó㲠5 x›L D5âÉ OQ„ÔăŇĂľmÚWÄŹ˙<Č8!Ŕ˙\L;éĎZÇý8H5âłŰhňÚAúýÍ }TŮî˙t™Ö÷(IiłĎ&Ôę¶Kěc¬nĺ?T—A‡?ŤFűčNxĽ¬ř ‘ €ŃÍĚĂëŃ~Áďwúyż aÉ›“ňŮ…:˝Íí Âm~—éy žČĄóćů şY_ 픿„jÄß 5ű›ëzý.@Ő]>o´¸0HŮěürVő1 f&ýXZ}\|Őţ{:X„ĎhóóĘŰLKĘcPëđ‰¶ćÁăżBL>˙ŹÇ ő¨˙®f<đm¨uÂ×ĚÇi§ü~.P˘c>D°vUúąPN7l†4»ęŃ€¨®×›«6*TŇňć ¶éă\×b¸„q ëZ 1ćO úąsű¬ż˙ăłAŘ\(/ ›‰âô3Ńf kŤâę{‚vˇš®€˙*T»˙=TĐ⼚Yc{Ę­ł¶±’żŔOîBłëöą^¶¶n6-—Ţ iĆăŐCľóPËď -Łľ˙é§Ă/tÎĹ™ˇžĺD®wĺ$zVâ9±ţő“f±ÁÍ‘Tłi+ÜJç7±ŢŐdθ´OEňźŁ3ÔĐçűJM·×—ˇr˝{R±ÖÁâ÷›ţÔŰ*[ŃE4Ťv…s†É>&U2őp@“z$@{IË_—jŘ›ZGý¸î…“ ęYLâúWRÍPĎRâ®a.rŇφí´Ď„ úŮp^b‹ĺĹ#]ł)ć®ŮT¤}"•Amcɬľ;©í ů·âVŹSPQ«{ý^A~ŕ·•YrËfëT°Ťn&0ŇNúźŇLřýd\Ś˙c˙J:ĆN°‰3ĹČčé<óčé\děLţ®ŘäE"ŻӖ!S”™'ΖrĐđ©®5›A†™¦‹@šý«ëQ c^‡®ö1˘Wű4ŤF@@@ŁŃh4 ŤFŁQPPĐh4E€ô‚31Ő żsËxë%M&ŻĆAϨiĐű”z8ř'˙Ĺü׆é$ęśNćĄ$ó˙?¬s&•—†tÍerĆą,¤kFJ;zň÷f$ń—µĆ űˇš®Ŕ‰˘Ď`¨Lĺé|…Cĺż°Ě’ĎK)ŕSÚĹŕCPŰ„OśfâxÔµţ€q!ęď ÓFúo†·˛ţMÜWhž<[ÄAsWI,>V/±đ(6÷pŤyňţ˛hř´ň·˝+iŻCłqĄ›š‡N¤4ô{{C:ťÍmâKîž Ńh4Ú5ľň”{UŐĐpse§s&TŐĺ^_×ăó Ô4ô#ÝX"é'R¸®©,†LgKgrxąH÷\>O‰tMçJ´'ü jŠ˙Au§źŞ2ř*ĹŻö/˝â· nďÖČ}W@?ëz }ÎÝęń7čgî‡Öß4m¤ü?hęţbnúR-=Ö ŇČVϵH,?ŢŚ,Ž)nŃÍŰ܆·6Lűş@Ćĺ„î•đL¨ă¤Ń´™4ŤťÍŮŔr7§,Ú†¦(Üś:[0 Ťź-čŘʬDÖ3Rz}!ýlś]ËxĐ~¨uŮů“–ÄŤFŁŃŢçÉ˝R–ůi«Ş˛şŞĐí·.ÖI†Ę NU5=Ša¨ađÄJł)ěA¨e$ňaÍHô#XĚbëHô4ÔÜ\ÖÔX)u6ű ě6ű»ŻđŻö–ĽżÜšÝ«=j u.d ˇţ­#4pęd÷Č™ôAd;˝{čTJ=4°‘”׾ęéćC­-yKoOĄŃh4ŤFŁŃ(((h4ŤF@@@ŁŃh´÷' ä®–~ĽĘd+TŢás{CWŔ]PłŃűń…`-ăńÍ÷´™bî†:„_Ďđ)HîŠqĄ’? á‚9«ă[ÇĘžŇ MWžă?o"ü}›i‹˙řAË)wŠMn%Ü™ć|-ćhď×2)nöE´‹ż—k‹ŤFŁÝ8p˙~q>ŚŔ, €ĺ÷K@ŁŃh4ŤF@@@ŁŃh4 ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4ŤFŁŃh4Ú °˙ čAŁĘŽ–IEND®B`‚project.properties000066400000000000000000000010631262264444500351050ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid# 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 base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/000077500000000000000000000000001262264444500321715ustar00rootroot00000000000000drawable-hdpi/000077500000000000000000000000001262264444500346155ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/resic_launcher.png000066400000000000000000000200311262264444500375730ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/drawable-hdpi‰PNG  IHDRHHUíłGŕIDATxÚíśTU÷–ĆM&“L2ëM^ň’Ä*MĘĄ÷ŢDD@TTŽ‚HďíŇ;HoŇl Ř5ÖDŁFcI4ĆŢ{ŹŘ)rĎůf˙ĎEc2É›Ě"oŤ¬•ăÚëŢsď=˙ßůöŢß>÷Ŕ°ammmCu»‡üżëš'ęŘgřîźýŢŔ°7®!bÄÇ^ î˙6äŕ°¬?6ĹsË9—#ËY:łE°źýoŻůßöy±ßĚűŕĐCŻĆ¶6d-Ó”Cüć$‹ßĚZl¬Ó°ÓěfűaŰ—ěł{uńކřM ŕáMésŻ>6°źôµěńÜßŢ˙Ŕ3|ĺŹöŞ4kgĆ«}Ŕ>oIHކ’UFÉ­{-{—´¬,é0|wŔÂ˙ěCH‚Ć©ĎQÔ‹š¨^,ЦîF“Ç#Ôč]Aî?żÉ”r䩷Ʀ‹S.®48ď• ® {sHÖ ¶¨´FăĎKÖ¬\ü­ĺÝĆ=&^×çüŁU&}¨ČęEéwĎű ˛=A泇÷ÜADďuw_GčcŞ1wŻ#ţäe.±ň¬$ŃáäłÄĎ<ůÇ—×ÝWVo1}^ á-Ŕůiůú¦ťńŚ}í… Îw|o{˛«/{íäÜŠî ˛ůÇČŕ!ť{1×…$ţ*ř3Ęť„ ÷#śřx'‘¸ńß÷Îz|č©ß¶]wg/jÝkŐS®Yëˇň!}ÄĐ…#U‘ř­K=ń˛®ří>űt&×Ĺ'\îŇřH)ĎQ č±]HÇ9ĚÁ)xŕ¦á0çŠ}Žüľ§“ř]]öÜ®űŽý-űĚeµš¸”o˛CU=/jĆ}¤Ú>AÉ·÷‘,éB ˙™¸h.ZcŐIsné!Ó[u;Ťç”o’:Jzѡ.!Ę® …ço †»‚pţiáÁ¸†xÜB*nRz]'W)ŘăDá<‡ů”bsń#ç‹ďű<±˙étěîrÁW·°ůŞÖź·!@h;bĘ5ě2¸WľY/čŹz¨×Đa¸|iGn!“;Á{á2biÁ”6óRÎ#géůyqaB\@8ÁY@ű“zqäą/>óÄއÓńő=l»1_\˛ĂšÓčÄQ‰7đĂ JŁSꥋ|0Žóóp´?‡{ýpđ©ö>‰]÷ÜńĺŤ)Řt‰tnö^NÁ¦“>XrŔ‹v˘j«—ß©µ[ܬ!űZ{"ôćgsNp1·OJ˘řýϦaßWśď©Eß…çÔĐĎv—ă`÷ îóĆ‘~_‚áŹú„8Ň€ď{ýqč™ö?öÂ7]ł°ëî4‚ăŠ-Wś±ţÜ$śą×ç’§xŘ}_ť‹úŻő ľpĄÎłŚQ´{ǰ׳hłÚpÓń˝}}·é ăľ}ä…ť?MĆÎ;θŰsU­W\±™ Đś…ŤçI5g&cÍ©IXyĚ+~°Áňď,±xżZöXŁ~ë$ŻÖGůF,\oÂN#>˝Y“_P¨¸~^üč^«ńIzÝ1§á«O8ěŮpÖ™_sÚ«©Ó¬9c‰µg¬°ö¬ ŘĎÖžž@˙m‡ çíP/PWş@ĐÎKcĂ9GĘÚÓXsrVgŞ™€öĂ6XvÁ1Gó^3,ÚeŠÚ/ŤP±Ée Q˛Öů+ A)Ć…ćÉźőI”Óz­TÄÜlÇSôÚŹŘ^ ‡Ë­8j†Žc,ĚŃyÜ+Ź[RXQÁ;aŐ''2XPË>5‘`Ř ÁŇhŐ±‰XůŁÝK0Ëżł¦ne‰ÖoÍŃô u­]ƨűĘŐ[ Qń…>ÁŃeé…ěeşHiĐŕłĺzEŤq{­f4ć?:ĎpZv`ÂýĹŚą%‡Ś±ě{Á§´6Eű3 s´˙`A©bIaE¬…šŇń­>,ÚŹP¶FŰ÷Ö¤+Ěâý‚j÷ aNÍvˇ0—mĐEŃ*mRŹ2Z5PŁŠ ôqÜ´Ůw÷aě*ă+לđňşŇż¤˙üżü ¬@·đđ_˛Ďáqă#®yŻ!Zľ5Bë~cZ$ĹAĐX€Ąß™bŮwf㤠‹°҇ĹŇ,,„TbŠi!0ͤšĆÝçk‚łC ‡Ú:ĘżĐCé:¬ÔBN›&Ą—q•ŞËI¦Î]fo/÷K3v1î&Äď=EŐ§÷Đřů9„ţ×NXĽő§Bboö%>@¦Ĺ]¤Ďą.Iő<Ůg¶ďQćL=,·ÍqjřrŇŃšmzÝu;ô°hŹšTó>#´Ľ cgB‹ga:fŇŘg&2ĄiŮ%SżÓµL9ŰH9[¨0oŇĂBROńZÔ©…ěĺšH]¤…ęĎĂňU.xF*†»»«Ľýͽؿ]Aš×md|uiWNrŢ×÷?u;´ń˘]TóA‹?ǰ7ˇ±Aá2—ކřúäöë čŢ}oęŐ/Îą¶.új’p=X\ř^z«ą}rĄůŤr+d4!g©.Ő=Tm1¤EÓ˘M’Ěâ,ĚH]ôČşSë~),¶Oó^‚ôŤ‰ Vwęw“zŚ(µ ±pťĄ•Ň›u_ˇŤ¨BC„$›ń^ˇúÜüă´ßď8!~{ë…YÁyŢ˝Ŕ%H®piܧ3ą­×í%T#źTnŃkt!g©´ó’÷ßtíß×ĺ%Ůwߏ;pżăćl~Í©É\Ë^KIî2­M‰ U‡uĂÇhçŨ‹ĄKfň~‘F°p¦ŃHŚ×%ŤO ˘3ĆźB×ňsM GYŘL năŕ0S“gżł0i¦ý?yŘ¸ŽŁ}ÇŔĐVÚf# ¦˙)˝ßpŚSţc?ÂXĄO $ú†ňpž®ŹĂŽž žiőz Ĺ«ő~h;l%ŮxžŮg˛ öXL©K*äŇ[4»}äĚI¨-ű] –°~Öú­1ÇjĂ’ýVhÝkşíć$o].¶BőfPšŞÎŠĂNs·]žŃ˝ăĆlnÍ)[´ś„š-ČZ¬‹Ř2 ¦Ş`ć8{Ź…­ű(Mţ 6ź@ŰüP7úŞú‡˛îaĽŽ4Řs5Ă÷ˇaňwčX~C»Ź`î4¶Ó>Ădď‘>_sbÇb^¦ •˝p<Č$"˘H™›6¶j^†švBµÚŐ…ëuąÚ/™MP˝Í<“r–kň‘Ĺj˝Žľ#§˛ŃdPí{É×޶ ×ő®ŇŕŠVkI»F‡6µUM$׫ńAbůű3BL«×9%TmŃď§éšgzäG-©ĄKŤâćKÎŘvu*9ééŘqÝ;ŻĎ¤…ťĚY_őÄWW<±ĺâ lşŕŽŤç\±î”ÖśŚŐÇĐůăDęn¶BËg]­q·)u3ćôÉ,ę"·M©Ťš-WGp–ç łÜ'AY?şTĺzáJmľśě@Ĺ&ęzztü:ČX¬É‡ĺ 9 e_™Ż2ěÎëPçň;4‘G‘Ű®I˘Ä5>0Uţń´ąrveNa4ő’íç+6ëR˝ĐŁEčSíѧBk LÝŤ»Ť¨®S}ˇZD5¦eź™Đ­Z÷±ŽĹÂÍ{fÍču¦Â™ŻĄÚ#řŠsÉZ6Zh#ŹÚ{ÖRę`Ít,Ő,ŇD`š<ďě+Óä;Ţ ˛XůN~‡_¶ ;Abęˇc$K@Ž;ŹÍţ3íb€Ś»sŰŐąĽ’(Ň[ÔAćýSäO µ+lsY»\«·xŤ6_ş^›H‡r]WhÉÔŮţ+a€š/ ¤ŹŰÉô±î´Ů@8Ë奋aĎfË6˛®Ą'ÂâŐ?Ăa*¦Ĺ"­Qń•š(ÔD@ŞOśŞĄŰ}ÚŹg`Ęč}K×éQYЦc×ŕBsÔz[`n;SŹ2—0¨AµP±ęËÓš#Ű4;RÉhAžŇ榢‚ś·‚ŃÔ’­Ú3Ác´í µďŃ*ę4îÎ^&âs–« ęÉ\˘AE‘Rg€úśýǸĺ7M™źÖ¨Ţ›·B“/čÔ¤3ţ ¤Ť,t…çĹk4P¶Î»qüň&t÷>Ďţń<^lě9ű÷đé-8µ Í[f#żťć-ú|Vs–Kk[!˝’ëÔSĆ©Ă?YŽwňłČ/NÍlAžâc2‘­‰-"@őŞtöTY¬B’–ă¦ȇ‰«P5jq¬ł:Äś7Íp¨ü]@ŇŤŇ®•KĐą-“ŠłäwmtóÎe„çiS“PanžŮ R˘ Ě Đ8R¬Ř'NŮ9$[A’ÖL]•ś7SO™LćŁŘ`;7Uű±ľĹ»#čpůÇ%ťV—Óš©'…Ô“T§B˛VAxÁx: ±Üż±aâÚ‰Hý!Ő'ŽŮ晤ʵ˙[4T´Č+¶¤x%ţw÷˝|í4B2YÝQÔSF–ŁT‘yf+ä«ę*$â™9-gŞPPŠÎcuĂwG ĐÎ3EŻ´ľÄĄ.RÔ“XK€*TV 4H6,łÖá% VČ™g’ŞH„Š?ŠpaÚ7§ Šúg€.]=‰ŕ UD ROôBČy¦đŠÇ;zʦ$čx†ä(đlfdć0·ťµxa’§´ÔD`˛Î#mÓ÷>T‘ft·śXôaI§ÍJ/>…1ő$ԨЙS4†Łi>,˝~˘KbZ¤Ć±BÎ<K˛—3@vD hÓ’©öPT©âJŤžkÂqŽsd˘@Ů TDÂě–Ó&ÄĚeBĄóÓhµa ĐŃŰ[˙ł¤Óög>ą^EPO|µ22ä+’¤ÇpŽľ˛áéµöŽ •ę÷ „"?$¤Íp(_C ęézى~k”řż*"›!@Š,QEÜB3Däšň Đd/™ČW1słśZüRa’§şĄĹ$čŢŃÖöţ }wsĂ{%ťvÇ)˝ř¤:e¤LZ™LˇąŠđŠ•ĺ˝   ŞQV«©diĆ •­˛ĄáôţovĄ_¤Xý?$u×\ľ~ !Y¨D…ş—Pbą-Ků9Ń śý,™(˙$–biŤlŔ&@ËX‹×f·ř ]>(Ů芜śÜ;$ýV˛¨Ín_J˝*—XŁLí]YHݍ’ń 6Ę{FËJśćŚť—µČŮ1©Zó>ą[ 3’ĚTf,–bŹŐËCđĂń˝čííţăĹ‹+ @mż‘b/śöłgO°ďĐvD§»!(]AÄTYL]µÔqE“yďhun˘‡LŚW´–hnşňů”zm.k‰>ź˝Ä€ĎhŐŁ“¬ĹĹ–Ić&Zu p0H 7×Xg“çéŹY¨&‰,Ď…*ń!Ůă9ź%Î%@öĽÝĚ1z•í“3­~JiĐü ©ŠÔ’3ľ1ę¨iIÁŐë„9ë„ *¨óý Á:ÜŮóÇ_7e¸ŽFH¶ŇŻY!žůÇšpvÓdcµß HV /ł¸U°d_´l:źŐäĚÇ–Zö‡gZďóŹ56řÓľżM0ýŘ;Z%/0ÁđrP‚éď(ÝîYóµď»ú©í·v9‘}‹Yżfľ}ů Ż»â 3“ ŞC™*b?‹Ąş( ß8u4µgáÚÍ‹‚Sf°H(Ҥ&}}˝8éJëc1#DłŁĆ!(M ó2•–Ż,DéQÄY#®p2kŢ7ÁM&xÍXÚ˙V¨/×LŠĎkńhJŻs©Ť*0ő÷OTîîţgţ†©ČŰ[ö?ÜLfÎ×ô›9_#Ě=Häćč©8†ťvݨa}¸UE‡÷Mq®„™IÖę_ŞH¸DÂFUé[>žRD‘YÖčX_‰®÷@…őľŇDpnÝą†EËrkϱ”ÎĘ/TĄ ˙U¨,ÔČA=… räýŁÍzlÜFů ¨Czﻹ“€‰…nôü—ÜůńűvÎB<ě­aŻüŽT˝2LTÖćs2µ^—cŁ+Ô¤V)$ć®YwŁ.'M6ěĆ”«"äžn‹őŰZ‘SëĆ5‘h[]ßHcxFËQ#PTÂĚ ‹č2içb©ő"˝Â ¨‹•Ř 'Î;ÂřŽ•ŰHű˙ĎŰ_Ţřő‡łb^Rńn~Łg]bĄ—PÍ,t,yˇ¤®ŤŇ—]SJŞ!ĽH‘ů‚E*)aę\¤*Đâ…«–Â0_%ťÚ…ŃbŔ= -ž…ĺÓ~…ö|d¦#7}žh»íŚQźÓa˝f·á‘šr꽢 ­Î-ČSíg6 ˇš‚`Ęů9DB¤4„k: ’0pҢ„"ćqŘ5ov­‡Ý÷CăÁ@$TIżâ‰Y¨ŽČ"éuč\sJWŞ?qŹÜÇMÔućőŤTŃąöVÁbť]sĹŠ\h®Ź+5FbĄ ’Ş hb×p´iš¦¨ŐFr !’j)jôčą>íŁOĎ čąR덑Rg‚äSzS$TĐXaŚČ„fëńóÄz\PŠç/:ĺ«2çĹŤSŻéŤŇBA|+\l ;/MłĆ?YůŢĽtuDX"ĄÜ âjg¤VŮ#ąŇI•HŞ2ŁE›!ąÚ)5–H­łFZ˝-ÄővHo°GF29"˝ž^[ë„ÔjG$•O¦‚<‰ŢsŤý!úw抵;禨k†† ĆďőßX·Ř´©üťČ §F—€Qü´ů˛đKPCX) xRË] ®rCző4dÔPÔ’G©óŕłfńąŤž|~ł7_ŘꋢĹţ(Z <ć·ř {Ńlě*Ŕ N3çő:ꨊĹ*o4ڎň -ĂŢŘt®üť¤â©őÎľ#xŰéźŔÚm8ěfŚ€“·,¦+Â3R ´@„¤›HâÚťJ)ź|&µjĘUqÍ”+éµn·“Ëś$qEöT_l0?Ý ţńúą@„)~ň°óá]Ľôy;WQ8űn}ČýJ¦0Ă}W÷ďYµnUěrČôů#áě÷9&z|«©źÁÜůs8|ű‘0ś0˘KÓč3™aĚ>X {‹Eh´«Ąăčű:VďóvÂÔq8,]FŔÖ}4&L ŰiŁř©Ţú’ îjżŐU‡$Ľ™×âVČî×ńKC.XîÁ2pňŤ‰3GÁĆ}¬\FĂÜq$#óę"çŰOpsßxŇGĽĹ”OhßW“fË a?s4ďćk ±wWÚ€Š–N/,Ď…ć)`n†|“ä0+r,Ü掅— &L“…Ő”Ń]šVčçˇńŤ8'3űcď;ĚٸŠIžŁŕě;†f°qBLń—ĺ=ćJfq-l÷( ·ĚE+"¬@‘VEř§(C–‡ŰĽ±ě9¶n2]Fż7ŃÄŃsÜm÷áÜdŻ43Bĺ1+BłÂ0}ţ8Ţ+ÔXâ4ÔU®žU_©ĘE/T˘ąI‰f(v‰d<R”0;RSĺaď1ć Kr4q P¸íč=‚ci9;RŢqJđKT†oÂx¬ŔűDšJ¦xq@Ő«gf“›–Ä”)ńQ Ç#˘XYÂ3iˇ‰JđU‚Ł—üO†V#GĽ˛Č7âňÜMf‡©Ýv ĹÍŽC`„1dnş*ÓŘ7)ŠĽŚ™dĘśˇ 荊ŐI‰5˘ç4˝óě.ÔČRe#ThUA`Ş2<ŁTxW_Ń-Ăa/˙ťµě„Âúľ±Ú×fFČHXÝš›AĘËVĄa^†*ü“•řŔł_µYC[hÁâ©“hnzS®ĚE ·éŞ×nÂňiˇéjĽg´’dŠŻÜÖÚ_›ďôůÜí-ţIŠ’y*|h® ±Z(ÔAXž˝V$ń‹×>9=HE}ŘýĂlě¨s|oAžFSTˇ^oüBs.şČ@Ud$‰)˛âÂł­%Ţ1ÚǧÉ›ýz‘ěňÉ‚lMë<˝‹)•“úÓjřĚg.»ŃŤK­qâÂsMîQ-ňóËţǰˇĽ1Ăč«ř7˙eźć[ŁłíNFç;ž‹)p:¸ æĘ;J[éw]0˝6ĽTk|R…EnnłűÎ’ĺ>‡K—ůîIŻs­Ť*23ľđĂ˙ł/Š.ŕ#ű©š–($ŰT+4Óhś{„đG—Ţüg ”ż*o'•ŽČlś¨(®łQbřîĐűS8mmmżłý7Ń€Í\ 'IEND®B`‚drawable-ldpi/000077500000000000000000000000001262264444500346215ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/resic_launcher.png000066400000000000000000000047751262264444500376200ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/drawable-ldpi‰PNG  IHDR$$á ÄIDATxÚíyPTWĆ1ˤ2©,Sf’I\â‚)č}ˇi”eqCEQŮ› Íišš}ki QYZÁÝ€¸…EѨcLY'jŚf$!lvÓď›ŰXÉL&5đÇTÍ­şußëŰőîďžsľsĎ{˙oÓÜNŢöŘT×»üÝßóß~ĽÜůő†íůꥯÎ `0«äE@mźíµÚýEłĺ›TpF±Ë\jŢJf?ýÝ`Öéo7n-h·¨ ŕż8ýČ ÇľvĹ‘›žŘŰcN29:íÝó˙Š+ă˘ńsë0¨˝†‡ăçŃ;Ľ ýc~¸4ćŹ Ă[Ń=荮f Î߉ÇíÔ˝›QŘ.H®fo™VuuÜÝÔôÉݵÔŃ;ö¸|?gţ!BÇýu8ő`N}ëŽ{î8~g=}ĺŠćëŽhĽě„3ą(n·E~« ĺ¬óĘiRۡ~×·›Ż;}Ű4`ć6hąa‡–/ěŃöĄÚo­$Ł ~±’€8ˇńŠ=j/Úb÷yK(;—ˇčŮ„VĐôŹűpŃa}.yšOÔý^ĚšŰŃš>s˛ę.Yˇţ˛5é¶h¸lGF;Ôőۡö‚-‰k¨ÎY@yj)JŽ›"ŻŐiµDäéÜçŰK!}Čőr^Ó?űwÁ<€LřiŐW†w¨ÚżÜ(¨ěŘţn~łő'ąMć(9&DŐéeŘÓmA·DMŻ­Č˝Ő¤UTg-Pѵ Ą'–˘ ÍiűřS"HĘľŕÍX|qp{Ä7”ä~ßÇĂş~KůsˇZúÖÍ>|kíă#·6PęĎ\¨ś‚{U§ěÍŰ®ú KĘÍὓ†UŢ‹°ÂíX»ÎĄËX¬śeNďOöĄŽ¤;čű{°p~Ë×ĎĂ:Cl‹áh¶Dą¶ Ő÷Űp+ËŐl ťóá”@Őţ‹r›šě&äu\ěĚ5•”Zy•5ť¨:ł5}–hřĚMź;˘u€Ä΀+ZŻŻĆ«.h¸äýV`ϧ6¨ě˛ Ö4CN“ ¤Ő\„gŇ© Á EÉ*Öâů+ek]}çÓ§ÚÝ´ [-Đd4pşŹđ,Łqq–•Wf#O[ĐÎ'‹PvÂe'…“˝ô„ĘŽ[Ł©;ŠĂć(:,$27En‹ ˛ůH­á"±śĐ4:ĺ´0,©‚529ßl‚b–ÖŐoŃ”@őgBće5 4ň:6Rö°ÉÎhÚtK?ÚÜH’â`rÜulş®ĺáńO߀˘txôĂm»ŠÂVkd6č-Ě#Ďŕ"ľŚŤ`ŤZ¸X”PÎË?h:iąč"–ÖqË\Ă)öťŤx/łA I«eSł Ę0ÖŠŇĚĽd{Ůšě\ä·ńˇ8´ =7ŞńÓčC"D Ď6Š˘0řÓ=śĽP„´˝»8+a#(…÷ Ăŕř2†&ŻU€,5QLŤ“çßL ¤>+úkf˝ŕ‰¬†‰Š‰0ą±.4Eč-­f?ÉläWpŃtv'*÷Kqu żŇj5č»Ô‰Be”-Ű!©b ÂŇLŕ¸$(®”ˇŃ['łq>Kcł~ÎÜç¨,~vFťéxĘ&>®dßQ!ɦ>뉼ž˝•şo¨06>ŚÎžZ¨ÔIřňöU˘Ĺµ>”îŤAgw=ĆźŚ Ą#‰Jb‹ą“ń±1ĐH[B×e0AF=±P>Oł|ő;S{­]Ň·Đpr5“<Ś´#žëýq%kLďF˝•>¨üŮA}ڶŽ2Hó|Đv˛ #Ł?üâƦŮDILÄq’ÂGđ’ Řb†.“{ú~"sy××ßž¨ífÖëňZÓ%*vŃI0~HíHŕůuŚĄ7ĘëŮřôzĺŻÜ¤ÓM@Ő,†Žöł­á¨1 &˘ y–rá`Ł é2»ŇjyŘ™ÍçŻřË›Ď9·”–× 'UŇÉîčLYB€8~IJÖXĘ^Ůç˙H‡ŠĆČIĄ=ŢŘßžB”Ä@tĺl­ Qňú§é "“7Ęr0xmJ őźäűĚľKTŇIž ! Ů"YÖ7±ś5"ÝÍ$;cáÜç“jzÖBĘßéç÷’%1S DH˛€Úd¨JßĎźL™‚!:ÝŕOĎ=T%JÓ«1ĹtŠdiĘ7Öp$LjµZRa2˘Ź«Ô},ČŞĚqđxĆĆF~±˛áß@Ă#C¨kQ ‘1ŠÎB$µŐąú,vçšôeîs¤$J+]DŞu#YňůěV1—¶-V¨ÚÎWŻń3r-o _’Yă<”\Í€Ś¸-e/‰ …1bsmpŞ»‰(jlh||G;k&5'±gD˛<ŤH›Ž¨<3„K´önóLDRᩪµIĹN6"‘á+¤™%•Ľ żPŞŢL«rú*©‚˝Űô@zkéÓBtI«\⌙I¤´É@Ž)ÖĎ1 âśeI\ţŔŢsŢ4ü¤DËqZ'Ę`<ÖK8©ÜIJ2V<í »ČńPĘ# |r- g—Ü“˘¬@‘śG…ĄX űŠyżË=*D*ŕl‹cÝ •’ śđqÉJHĘV"ą|%«\KĄ«Ü‘±Űé*O$—­‡8Ëž$Dó–@wéĎÖžÖ¦V«_ Hä]tńyŽ›ćb•Ď"¬ßFÓÄd9DKJ׊C’–÷¸Ňá@«Ż!VyŃuŽî4ÓéµĚoWdvn‡d1<ĂÂĹűŘ­›?ʱYđ–~nŤ/c—őšw(gŻůX˝u)Ě:w&Ć^ő‹J«,ÎEć!4Ý[ÄKŕ˛eŃ/@;ŠUľs¨ÍÂ7ÚŢÝÚÍ3 $«6ďŚ*2&•$m˛¤đ6f9Ľ«Ď¶ł¶Ç Ľ"RR‘=ŰăůnŰŘÜ™{±'«0M GÁ„8ŹG}”a¦ŰA;řsŚ„$ Âĺ&#qEVTĽÂŽ Nć÷z‰ ßŃŹ D-/…H®‘éŽi;ĺNŰĽŁXŻ= śPhÉĘÜ㕱{ł_DÍ[˙óÄţčf‰s‹2ĆIEND®B`‚drawable-mdpi/000077500000000000000000000000001262264444500346225ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/resic_launcher.png000066400000000000000000000077361262264444500376210ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/drawable-mdpi‰PNG  IHDR00Wů‡ĄIDATxÚíZTTwö&u“l˛›ÍI6»ŮQL¦104‘jŁHDADŠŇDŽH›ač CďôP¤bC1ŠbÔ¨ŃhÔD“CěJ‰ÂĽoď{&'1˙ě˙Hţ'rţçěoÎ=ďÍ›73ßwďwďďŢ•˙®˙Çëܵ¨WúŻş[—Óyn˘ďTž:=ě'é>o«ÎžO âŢąÓkć|^˙ˇĹ˘_‚đ }úQcŻý|ϱaßv}j{&©Zâ­2YX@9íFţ5‡-.Tő˝”=TÎÂu9iĂČ®¸ŤôĘ›HĎú©^W‘ÎűŇçgzżv*Ëj3Řć,ĺ˝<©2Ęi1|1w‹aGÇIëŽ!d6#ýŰ{HQŢA’ň”_Á‹9ŹĄĘłd§•ËŻťńî>p}Etén“ŻůÂIóţOë{¬~ůňí¸ĘŻîű2š!Đ…ăŘČŮwĆ9,ÇÇĚąoŹw¬™ľëÖăŐý¦G6î·z“Iŕ*b޸‹ĚmV^'ŕÁ}”’UbĹBľA$.Ŕ§82şÜ\]WćŁó‚9SÔäpIźę¤¸ßż"ąý+„0ßđ‹XŻéxQdař áś]ÄZ|ŠśóÄá!ě»fŹí— ăĽšŽ3Ą{ôű3·éţ㉒`“đĽ2"ćłnüÔ¸'ÎŽ…âÜX,>Qúŕ ăC’YŤó˘ăzNŕřŕČĐ ¸±»ŻŘˇçâ"ěş° GMQ¶WźÉjÓ./+›x)ţÝ•çŕíĄj§ÇÂŻöŔÁŰÎż„‘ń«8vĎÇF=püľ7Ů*|4ş’€{aŕ¶;>¸ć‚Ýß8˘űs+ś¬Ćń!|pNŽ’^=dm–ŚĆ–‰f?‘(°_Ň÷ť[Úˇ[+™Ţ«6ĘwřWîîGßUgěżľnş˘˙Ć2:_†}.Řse v|ąÝź-Äć3 °óÓŐ¸;rťűĄ(Ř.AV›.S"h}"‰Ýu{ľpúĽç‹…L÷E t_ś­aËĐ5ěĽlŹ]—ŃŃ‘ÝsɀۢóS´ťZ@ş·@íaSlÜ7T~‘×m¬ÖY.äÝô”Şţ±ąŔ~xË ­ÖSóG[N›˘őS´ť1#ŻZÍAǧT]ÎY’Y`kzn…öO,ŃJŔß?1—4ošTퟍ˛ŢY(Ř¦Ź zHmÔEdžć‘Óţáňi>ęęT;`ö öC#Ô›ŤĆŹŚÉ«&h:aF ÍŃ|ŇÍ'ćĐůş>ŤÇ,¸9yÝ ŐŤQąße{ Q´Cź" ‹ĚVmČjDÍVg–ŞĆĐ×<ős+ŇňĚďŽűĆ!¤Ľů=’gń ÖŕÄ­WŮk5}+—ď1˝QľObÓˇYäU#ÔžM ŤÉLP÷ˇ '“šSzÝŐýĆś×+öý~§>ň·é"§S‚ôfm$Viţ]·PµđcÇ|ź» Ů‚AČËϞ˴~lŤ†#–”lĘčA~Çi‡ĺ}—}Ć*öšCVeżM8ůŞaŢâw`důtÍŢ„hÖëŕëżMÉß ˇó*4$Ż‚§÷7 _ŘřučÍ}&voÂĘím, śď÷Č|Ć%xFâúb­Â˘̦ć(ß;›rD„dňN9űN˙ëc¨ę÷~%·ËôhV›Ýdöľ6âĘŚwĚ»MŠ6ë°â]şĘŞý†¨;bLZ7Cű™ůč:o­źŮŁç3G2'ô\pF÷9Gtžµ§ęc––”sQ;`Nr2FÉnCŠ}¶*Ä Ś“ď”ÂĐ ŤňĚV¦ Ç€{=ĄA› HŇüÄÁSőŐÇ&PÔ·úĺÜłĂéÍZLzł>DŚ>ă9˝=łĆ&)s·č p».Šw顴WĄ{ HßśĆY+í5DńNCşÇ€Ö€;˛U'Ż[Ź´Ď&ŻU’^µIJŚ T>łČçťÜŕ4^-ĺ“·UźîÓCr˝ń“N@ GŔüpZ“IkŇ‚ĽN ëŠřŚ{Ä´Ny•MPj“H™Ý®ŤÜn ztQ¸Cďˇmhů´nď2ś¸¸GÎסj§#š”Ý.áŔ§STĺub.Ł ´ĚcĽTs’5jÓšÄ ëý íş×DŤăVnŻýĺ± Ôît˙ł˘ÝĽ?ĄQĤ4h!‰ĘÜş"!Ü#Ôv$•Y'× •™­bäté o«ůd,™Ü.=4îóÂ'_nĹčý»T î14zÇÎżŹŞK¸'›ÔFm$ŐŠI>ZĘ!PNĽU«ĺęŤFŃĹ’ŐĄď3>qŮyżţĘv[ß—í$7™äz…YD^`yŘôť˛Kż¤2ŁEL FQ )±˛h?ŠĎż=€ű†8ŕż^ Ă`ä‡Ű8}i;jv¬$iPýߤ…ř mbBÎ{ďwŇ“5ے뵸eµIŘ{źxő#fÎoĽ<*ú˘˘}NźĽ^Č$Ő ‘¸QH^0Ëç÷&•XyK«ăiďk!{ł6G˘ kÚ¸7t—úźűÚÍ[ב[‡¤Ťł %ýÇ•‹•G9˘‡•Ş©D¤-™¤ĹĘ'łUÂÝł*nćA[Ű·^zlŐ}ž/(6ĎŮ%Ż0˛!Ş„$îájdĄ6+Şř㩍"°2ĘhâÔĄN śŘЏ,gôě©ĂĐđŁDŘó;wn˘ął‘rGţh7¶÷#®B€ŘR–€‚Sô`硚ę—4ł#©V‹:T]d´H¸ń‰őO@OOĐźísw’Té&…Y€\>łŽ]hţÍŠłĄ·O´ýé ä Ą0€˘v^Óc¤űŘŞ—֤ÕÚŘR"­˝ŮĚLĺŮ tŁŇ§m–e •<&¶”GÓ’&ÖfĚd–­U=˛Naáşľ”÷€Í 9•Xy=GĎ7˙\8­żůK ,G“Hđ­0ĆęD†$é/{H€•ŹĽN›˘/†OŚn“ŠłĘ3ŹM@*•>˝ˇy‚ĽOł*fMĄÍ¤nQu ˇŔjéúţ„*Ř< ˝»ýńő•‹°_F ë7°ůpńËłŰŕđëf–›2Ö˧†ůKy›â+´™”z=F¶I¬+ĐWÄš¦°ÎDF‚§âŠĚ,צ o„d™őAᚣvďDĺ7Ż´•UÍćČj( uBJrMJuPßž…ë7®r€•D¦k÷O”ܵoż»Śňş$¸ŻÁ+f[8ŃD 4ŮŠ±tQ ö‰˝G•®;«né5Yąí÷ˇ©¦Í«cM¦Lx"3ŁbE8o¶G^†ŰIľĂJłóŰ/Vt­ť—Qksź­Nl™ewjÚ/¸JşA&ز« #´tí.ćÜşŤ¦Ž|ÄÂ_¦Žŕt’d¦&G ,›ä#Tn­ś»xŠëĽ,áźĺ¶Ó¤%ŞľRť—ţ/cđS*R•§ĄděOě¤VÚünjőÂavo *ĹEÝ­ŮśH¨ü‘H¶"Rç!˝Äą›ŕ·Î„Îę=Š­:yÜĆČ=§QQŮX“°ŕţ<ç·M'*•ß1,“Ľr‡f Ć©Ĺf°rzhÔvT éšë‹…Tą4)*<Icg1ĹZ””l˙˙° ß ¤ŃRá©ÖĚŠPí_ß'ôëś4ßí/«e:ĺ´kŢ Ď6@lˇ)b‹ŤČčĽDqĄ¬é“ ľĚŽł‘PnŠ„2sÄ•c}"6P˙cČř'ę ŻZ/j÷Śäýă‰ţ¸+•ňž–›ş…Ľ§ôŤÓFTÖ|ÄçŰ!ˇĐ‰Ĺd%‹yą“Rą”I«vCƦśĄTş!ˇ*PĆ|&Pj|((Y×64ÇđĹIů댬x©ŐŇ@µ±®obľË[X¸bWÍ„ë-eT漒ř»Y©SytÎ5Ź0 Ü‚ĹpöçÁÖC 6nęĚBť8.ż&keÖşšĘ5ď/ź ź)°tťóE˙‚©Ý;cÂYjg˛ĄĄĺů….ęÇŤ¬_g,śţI÷L…•›*lÝŐ;7IÔź´˙ËĘm^f™+üaMę»4tĚ€k°Ea*ć-ž:6k>ŕ*ž¶sW?lîřwĆfĹ8úŞaqŔ ,ń§Ň}’ nö0Y_¬őCXŽ:µđMP‡KĐ Ř,W{„Ŕ?ţ€­çż– g”:<ŁŐá&b{éM.ňÎĺłbKĹ#yT.ŮvC^ëfb±ŹćĂożĆ‚cŰŻÝC.k§2+cߣٗ?)Źí0ýÉ•P‹óĚbń`Dž&Ăö5!™ř&ňçő/yĽŰ_ŠB@Ľ~ W¦đ)R4˙¦±S–ř×ŐBŰI%Ŕţ^ś, ‹Č4ľ™eŞŚĚžŻ J2żş,XÓţ—ŔÖČő¦EdĎ> /wPflredeŽĂ2Ýl« šô70“Ş<ë©ńîš$Łe!©sWIőßVůuiÄĂţ&¶ÄB/e“ŁMb‘Ý ß'ő7±˙®?xý´NŐ#ŤäIEND®B`‚drawable-xhdpi/000077500000000000000000000000001262264444500350055ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/resic_launcher.png000066400000000000000000000323731262264444500377770ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/drawable-xhdpi‰PNG  IHDR``âw84ÂIDATxÚíť|Tgö÷Óv»»ŐýW–¶ !ž‰»M\ Î$!Ä•¸»MÜÝÝ @°ŕî®-Ĺ­¸C‘ Ě˝ç=Ď˝3$°Ýýoß·tß-ť~N'$3“ążďŃçąs#&öÇíŹŰ·?nÜţ¸ýĆ7xç Ä~pä¦×GŔ{ď·ýÝbď„ŕ÷O˙'Çy~ Ĺçż{ôVôWßß ÎÜqmVĂśFJĽ÷0ż…řÇ÷çł‚űý?ů,XrĚŇ˝r@÷>ľ§·€Ř»={Í8sö™ď_đťĺ㹇ĚËÚöjĹÇď˙«51ˇ˝ţ5k˙J|mÇ^„(ďĽç±zţa«Ĺó´Úů-ę_ň~Ű(üŹŢř|ţ»üvÝĎËëetl3~0ď°ĹŹs÷›ÍjYˇţáŘ(xUtţ»¬ `¤Ţ“!Fľ7öçÄÄ~Ś©çËÝ÷=s—ť´{P: s.˛3Ă—Ďý+yOoQ{‡QŘŻ+[łÂ`aĎ“çýűÍ6uď0QçoáţéE­ý @ÝřĐĄ2&ĂĐl÷ę]źC«űShv{ťĂĐfńÚµ@ÝäŰĐđ1 Š…AŇ ±ÝXsö=đâ­˝čtŞi˝ŃĂäZő<żTŐżż]âŹI|>ďĎ…}:ö k Žôí5}Ö»—[Ő˛EýKV¸-˘AJíÓPěägPŃńJ×?’ĂhçCÉĺGPtő>đŻÜěďBÎŃ;»ő6äλ ůy7ˇŘýĘó2ÎHřĽI=ßů(lľÎ[Ů»Űl„ß©±<8SIIzŢ{o˘TT2_'˝eŁá­î]&7ëÖk{>~\Ć–¤a¨D±Ź>†Â‡O z ĹhEÔRŹ €ş IÔEđ¦ÎĂLęxPgÁ“:>ô|z†=wZłáäó¸Â†SĚw Í·ý†[ά‡Šçkź/ŕ¸s}'ýU ŢRńGS˙Ýě]©‚ąšs›7ę=]ÚîŘ |ÇCČ˝űr)@„§B<€,ú>dŇ ţ íÄŃŔçŃ'Á…>Nôp€ďh{8,p ˝p¦[d/CÄř‡P’ű„ŞşxŤ ąK'ŇĎ ~BOż Ńp˛á9ŠNAĐĐŹO@[ČÜ?‡¸Épá4ř OřvGďźű‡ť`Ď;ŘńŔ¶Ţł¦7ß±˘×]µ ź0ę?d=ŻcÇte¶˝Ąt)7!aň(iCOşAÇQw ť~‚^}bŕD˘×ÚPě9h ŃiĽ§a>ÚEśŤ5żN@IčŮQ(nsëÁEE‹cŚ<ţ<ŠvŁć8>÷*ľ{ážzÁž!wŘyląă€ég:¬ąl +Î[ŔŇS¦°čćg˝űô©–­ÚTÍ ÍŤĄ‹T¦ţVëQ˙±82 §BŻ˙É5ČŁŽÓ~ôqÚÎĐ1p” @ F ‚St8ś¤gĂIĚë§ cŔśC±Ď"bgáŁđ1(>ŠâŁřpđ™ěš»¸Ă¶».°é†z˙4XyŢĹ7‡ĹÇÍĐűŤ ˙ôěŐ‡¶­:TíjMşd‘z{R‡Ě'żË˘,j7w?źĄtŠJ8}Ĺ?EEÓźó°`úŔ‘łáÔó\¸ř˘ Î>Ż‚ď_„Ŕ÷#Ţ(Ş?ĄQŕ`ĚďHc'ĐŽÓap …?JÍĆÇĂááô|_ß vÝź Űî¸Âć›Î°áЬľ` «Î:ÁîK|8xĄ 6śŠ€ţfеKZ·ę@ýZMŞl±úăś>•Y¤üîęYý¸˘űÁˇgͧé4Ái*…:4ěEŇ;ś~Vʧa„‚gÔ-8ő´ö>uĂĎIAőCýá  sĽ ±ď_ Ç?‚CĂpŕ‰?ěň=Ľ`çO°í¶zţ XŐÖ^t€Á3°÷r<~~ž †ŕÎĐqŘt2:wčCë@ĹRM*ŽęžÄEI& ý^RźĐ–[.懞†]>&H¤? …ť0?ßł†ť÷fÂŤg›€˘G€Fl0šŰîO‡ýŹI1őDĎö†Ď|áŕSb$ÇűŁč~(şě} ‰đ÷Řz˘÷«ˇ÷«BnŻ2¤·*B|µ<”-IńÂĹm=&KŇĐ«' ¬ţ ŔŮż}kţËł0~#Żz9󀜱@ŢĽ;öÍ›ł7ňÓţ]Ő˝;í†:¶RŰuˇs'1=čÚ­ÝŁgŹ>ł&Ó»×Á †† KĚř#BŹ nĚ)°"Ź'Âł)ÇÚ¶ =¦ťő:ŘókcęŃÂÜŹ×2Öű‹Ô°řŞBN· ¤·p ľJ‘Ë“xDOZkî$!'*Ä-ďß…ą;gřW 9č„ ĚmďĂY:;.Műě7 ú%Ź ţ‹űPj|roANće*-ýě‹ÄŔĂŹt÷Ţă*ÚäčÚâű׎ő^ľÍë¦moX«{łaťŐĽY Ú·k3 şvë˘pzŻ™>c={ XŰmČÚC¦#b3^.ôtR`‰1Ź˘·mz= Ďä|"ţZź¤žU¤ďg”/Áôň@v§ ¤4¨Đ1ĄJ÷ŁJäż÷O“ĺ[:IŽ#ÇrňQá? ˛Ľ®AÖ’[wî&dß:IůÝ>đlĆĄ­wěw,;kžÝ»ÇHn sJÍ‚ŔŠĎ{ďĘă›(ľ ü}· ˙ć-(|zr$ěÉľ‡3oląî¶}ى™˝Űě&“!oľľÇű‹ü‡Üvý5™őĆĎł[Śé‚^=(™§…ŕşJšÖë2žÚ±]5@…‚Łő}Fřµăń"#Źí&žŹÖ‰Ďĺ|Qęi٤Ǵťőktńwa×3¨ Ąšó5 «] R4 ±Rbňőég¤Ę÷(™ŮÁ|qfŠ?öń† ^1{ď{ź=9őâ ťK]¦˛éCĎĽé­w¦S«.ZPóŽŢmÚ¨ÝQşT]ň_ťÝ÷˙`ŕ˝cĂ)R§^$µź|{ďÄ‹XÁ™çiôŮçYôţGôĆëNô˛ÓÖ#ý­nW-Ó­N,Uřš@Řy/HaŮ÷aMĄť—"’(gO=°tTS{i´)`ĺ*>2ŕ"^± Şˇ|%(PŘ25HŞÖ€Ôzl´ łYříhşŁÖ® ŮmşŐŞ éM:R§ I5ZPˇ ŃEęřZŞĆďxp—'Y°ť9Ě%ÁŔj2č™I‚ž‰,šq`š—väqď:¸,1wµ"]PÍs®í&{—ť¶x±í¶µď~˝çž˝ńŞ+Ż ŤuŠnߦK•-Öx€-lxBçŁ_}v ą}Ĺu»7^ôŘxĹí§µík/8Ňk/şŔş‹®°ú<–w űöšQ kőFr{TÎ%×pÜ[ZÔßÇé7áĐý”Ű[ÎÇWY  jŕ+Öî mţ5Čk|“ä>†ń“?€q?€/Ç_|÷ß|ăľýľžř1|#ÎÚx‰OŕŰÉźŔ„)Ä>… “Eö7üţ§0~ҧř¸OűzÂÇřüŹáËŻ?‚ĎÇ}źŤű>˙ _űkü=>ÄÇ “ĺţňę_€şŃ80šţ-8řNĎh9Ú?Iůą[¸L§ĄÓWăRęŐ‚ úUŻb„ ćîÇÎě{XđťĚŮgťŰ ±ĄŐĆb®Ae¶)SAŮS;ĽfKŽă ýşç™’ť˘ÝĽĎ{wÚVbžĄÚ·éP$]tîŔ{;ó® 4Ż7‚ęAŇÎQIuŠ÷Cřr•ĽĎç[vjúÓ­×˝i˛<ĽîŠ-lĽâʬĎĎ?lĎ7úŐĆP2_˝x®„ĺpŔ7AÜÂ$Á)`2Ló Ţx0qü…ú ômƮ՗ eńcÚ–_€ŽŐç góŘ} \Çq`Ćű¬=Ć˝ß*1“Á7EBřŇ]* ‰5 ެü.eČëS†Üeŕw*Cj“ťP­@ů$OÝ`é4Q1ş@96­QńNŮ"5ŠĚMëő°¦`J[K¦h-¦ç÷©P UÚ#Zj®ł§Ä7\ľŘŻ;?ó5;·űý˝uťCsĺRmŞ|± EZ8b¤•-Ânbľ:N’*Ö¤H…ĺK?tŹš”]7Ď|Ărëľć :#];uiŇíĚĹ9`öýdgjđ´¬ÝY"żĂş=daQ¤^”/fŁ ją:“ް83žýŠ­$éC*UĐ‹µ c˝3¬;T§.o‚GOnˇđf˙Ó  ^Ŕ݇ŕ»sK`ÉÎDaĹ4Ĺ*P¶ä|ŤWÄ/«&L?Şlţ¨P†|"'€´˛š4?¦Lv(żO• [Lę!VąT #J DŠi^¨TŁ ďëżż™Řü·–5ÎŮĄştÁ\%Š_Óż›¬&*‘N‚€5 #†ď8)ŻÝŞkĂ0>ž©e‹FŁ ŠD© +Y$—0Ą‹•śÝ˝Á¶©o졧w˘@Óěö˝·óÉ÷ ź]cÖŔĘ=|hśĆĽÇĽ9J­ęŚ‘ÂKҦEČéBí¤“ćó@@:”Řdí˘Č L—/Š)“yš×«LŹ'žOś‚Ŕľ^V»2Y„ Ŕ}ČĘfËZ×Ě2Ź „ňçŕö*3-hz ¨á` –čN¶Ďmł®ÉjS~†ŹĄHÍ(]ČFA‰‚eÂ(XABSÄBy(ÇěŰčűNöµ»GáéđöL†—˘‹„ý&A@đ>ľ ?^ß ëT@Ý;ČîR„¬.9Vü>aţď` –±ĺĘŽüÓ$ €5ÓÜÔä‚ŇËŔ0j4ś¤6ÄAH7Ĺě#ŕQ8&Ţ÷̲…ztţ Ě™†“ebŤś%ýÂ9D˘Ó?Éb|N»Eqf+çqŢ’¶T05¨ Ś‚Ą˘‚Ě¦Łšĺ:°|_"ć÷ĺpçÁ9x>ň„9M…úĎE˙' hąňě>\˝} ví‚ÎŐžŚř˘î‡ŕĚve@Pư;Sh —_TayňôŚ7 w]ÂG-«\cËčŁřŠôK(>ż‹Ú¤dQ `>śĽČ#\O"żmZIYEŘ=‘4ÄF:”,â`{é—׏CY[0Xy~ ©Ó`çžőđäéćô‘ ńtb##ŘÝ»KWö‚G6¸ŚňćX¸pů4>ą rÚuŃó•ؤ"€Rmń%Ć‚¦ŇÂä“,SEt«ĐĹŘE•-fç Ňą@‹ Y B»†J˝akÜc1¨Ü^Ez¬÷“ô“ŐΔFŻ$¤iŢl‰…á¦yí¶…Ře ń»0jz•™ŮŔDXČÖ5öpéÖAFÄ, ŹŻ”r %yŐ°ďĐxđđĽ@a®&rţ‹ĎáÎÝ›°nó"Írl%!˝Â ľ?±í%݇!­^ …WÄÜÍv@,|˙UFG¤ ń•¤űĄČ×E•ČĽČîâФŤ%ť‰€tUd–HoVˇŁ 5i·ŮrůoŔ‘„ŹÚ×TnčQBń•Đű‰')áÁ 5 € %:(SĂQ|!‰€ĽÖQąڴݤ%‹ye8#€ĆÖL«I »"čĂÇ·aÍÎFH­4…4ě’ÚŕŔwŰŕ>Ö±AžC„˝uű:lŮą˛J}Á+FŇ*laĂîxüäá( |ÜÎCTĄ ©XŻČL€Pm qĹFŕ›,EŰűK¬pđŐU L•oG”ž¤ź’ł—ܬ‚µC#@6UßţËO~ő `ĹAţ‡mkÜŁĘ Gr,€ ś’ë°—V¤3§ľŰbSޤ<”Ý©D‘haę€S1Y‘,PÂÁÉě~)>-,ľ¤ťĽzë,ŢX)f‘e ŤÝYpđ»÷ń縍żeç*Č«ź H*¶‚e›ëŕĆťó (6BXX###°óŕ $”k0ÎB°´&PĎy ¶Řŕ7q‰‹Ż®,ÎíŃ@'‡&ËĄ‹FˇŽ  "ĽĐ©‰\Ţß?~#;b»c?h[ă\¶ŔđIN·â¨řťčýcÄ–+bLĄ]‚Ĺ9¸KNĚi˛ćăA>[„˘JĐ€“«Ŕëi…|ořĹ8we?Ě[͇¸M5…ćî|ظuUÇÁ¬0mɱ‚ŐepáęQLEĂc@Ň/_ŹŘq`âJTťĽ0ýp! k$WCLˇÄ8ŔóÔ•b”Ę"ešN¦j"~Év &óOZ“ ‘§AńBeŢ,€öµžŕ1đ@6Č"â·cČ·(˛Ŕˇ± Zjëxüô'X°¦<ţ›÷ô3Â3=˙Ď˙ ›‚€řjyHEńIúIŞUÂPĐź$âöžjRţÉ2L Ŕ.Ź‰ŇŠď/šŹć4"€ f%¨A_Cŕ$ôf¬÷ĺ•-ŕŢÍîD@~қΠÖřfi˙ô)BS¦bÄhcâ=š†Xµżţ·rSxĄ|ÍMĚ˙…žÁÚm˝–«óŠ<“z€„j˛„˘S0áh°óť403H_Á/U~nT‰4«¦śQ…ýxjXˇ|MÁŚ`Ů.wŇ›бÖÇU «CÎlĂV®UÓŹÓÖ˝6…r™-±ĘB a©/ÓPż äĎUř…¨1ľůĹÖ!€p‡ ’˙@Rµ&0†\-đJ@>“ú˝ŤäRća  Éäś/@Ľżp.» AΨN©W‡ĐlÍ3B¤˝Äţ,ök_Š8x°ĺýŽőŢNe Śo±éGÎhcĹ'é'ą^jY@ČXĘ÷±N0ĐÇČ›CXüb«€dŚ€‹żŔö>ČWbRź,ÂĹUbWŁóФeç+Ţĺl*éźŚŠĄd• _…óH„zT™]Ŕ”:uť©ůÔ)@†§®.öţŻ€˝ÚŕŔ{ťü¬Ęć›\&齟ÎyŁ<€¶Č"Ś€Ô)”sř*3·)Ň9-Ö‰ŘmÜE‚—z8/ÓPłÄâ—§ ŤBż †™čđ<%&ČúY„‹«DŞÖřRěfXBl €¶1úY9  !™ZO]‚ä]ß0€ «ň&—ł„Ň[°—nb4ľR" ĄiżÔÉ”s ŻĹ*žHGä H ;¶äő)@őb 8wmçż·ŕ6Ŕ/¨¤{~ĘtO$DŞ”Čôiu\H­´†ŘB.íť EŮůLd#@”‚€^r » ‘Ń‚j5éĐ,݇öÂu _ICťëüLËç›]ŔâKĽźNkĆ^şIóż<ÓĹUČAx4íű:€z•»Ř) HÇDÚW@TČvaé}Řud<úI¸|đĎűů—5x&ýďDłÁČČs¸që ô,.€°]šXnŹvFTJ˝† ±ÜD‘i¶Ň7BWVěM}Ş’(źë,‘ÝĚíĂĽ9’XŁ@ĂĽOÇVČҤ˙Ë“ŁüRd(^čäŰ6žÓ,-9ŐôűĆĺ¶sďd¶Ş3Č0ĆD@»ź7‡Ť„¸*)ěż'Ct–ĚYTgĎc–^_ZĐÍx-Ć>ţ‚üář~hěĘßh°őšĽpq({ h±ĺŠ €ÔJ[H,žN$ę lfNęárUţÇ?B|P§0ˇŇŕJA§ýHŮ\ŞtŽ3]ĐmGg4Q eÜg1ć{R ]‚Ő?{—Ŕ|'˛Öć/Ńú!™J[BłŐ†Łňô¨°lM:8]™öOV¦=cT(—`…6ł&5Y¸LJRWËâđĘ~·Űą‚ĚVÎh ęaÓ( ¸JČ”ĚÁ\č‹V4Ăĺ«ç_•Ýf¤aņnđc—"Č’Ă©ł?@׼rOµ—ŕ)ŕ!ľÉS!$[˘Š@…•B‚R*l!©ŘŽL4±r—hŐ×—ů„w`gBT‘N`Víü’Źcĺ}Ţ× ;Ý.ĄÔXď‰)4¬ ËÖłŚäkú[|NěŻÎG>‰ úŢ1JľńÚűüâő.űÄhßš®yž¤˛ÎŢ[&ÚÔm˘${UBţ»mK#Cëünäw™Ľ–‚FËéQb¦jŇŇÁ9’†“vą;¬Ú8îÜ˝!<őd„I++6t±5ńEvĺÚŹ0oIÄdŮÁ¬hy2ŐÂlľ z˝<6Ř$É‘ĺ!fů\ŔH$ [şŠ×N¡Š3¬‚ůęĆVęJĺ6:vąÚf·8Z¦T›iFd«Žçńţ,ö^üő µ÷ÉÜfsg†ËY¸…+9đ‚• ś‚”ĄíýYŻ}N¸uYŚýB˙+ůť¦/üCB#@Ąív%fm)µ‰|b‘©)€9•ްeç2,Ô$±»ôÓýŰ0¸¦ⲝaV”<ř¦LĹç±Q`9ó<1’ďIúaRyLr5—P„â žZşN,SWWµ”ěEG«¨€¨Č Ź‘ÉůżůGUßaŠ 9F=Xě}ňFĆ^ćE ya”CÝ‚€Ó€ĘhQbďŘ(í†ëáĽÜ_ 󉆌Ev‰;¬ľřĆ+BnU|t,_ßľßŔŃ3[açľőźí 8‰˘ÇKa'&ĎÍäxŇjVłÓ.1¶đ˛'L?1Ą ’ ÉÓ ˇČžňŤ1Ľká:!ăÝ×»Áźë˙“źÇ~gĚőŢůÇĎĂ;5˝Áâĺ=ľ›rÚ,iM¬wg˝„ Ä¤Ö8ěC§Đ:XdهśđEž_Ą^IÁ#\ ‚’ôĐłe ®ĐlgI‚KčÍAá˙ޞLądĄ3ąž#\ő$ë>JěĘgŤŇK$:˘@RĄ)$•NŘ\{ÁĚ0őc–3Ç[ü÷^1… WôĽ&ß ´›kń•*#IuěôL¦h‚M@đÇě°‰,Klřg`' Ň›”1ŹË‚_Úf!mvľeĘBt ;P‘Ą"8Ůç%›ídË‘Ü#0Čs’jŘ 8ľR Ĺ—‡čb5H,µ„GA`’ácÇ ÉZQ*űoľ‰ÔΉü4­Â©9Ş@k(˛Hn§Pšx(Ů$žťÖ¬ÄśŘK¶Hť`jE;祑őrţ9…$˝™Ă™TG>ĎE6CTýÜř*ó —”üą*łKĹšsOÖě“ëTđ1*(ľ Ä•+c7¤Q…ę_lIÇŘSᙦ#ž1r[ݢ$ßČ@őź„^éýmL‘iWH–ÂťĐAT±"•P©…cĽ¤Öë@ZąR‰šz9ZłdkAk%¦ÎXz Zł:ŠJî5đ1äyš(°>O˙­™-şŚe4ëAF“ţ\‡$×ęBbĄ.Ä•iŁđš–«A‡fëĐł3u©ŞŹ}ĺ7ÍŠ“ÓůÝ?J˝üWa˝÷aąÚ)Á ßeČ< ÍÁ´Q˘iŐ–Yo™ VŃ`ŽĆ…´zC„‚?kÔCaY#bf4ëŁ@fłdµCv« Ţ›â˝đŰĚŃ,!§Í ř­ÖÝb YÍÖřşÖVg)ŐXnqĹ&]hDGäéSłł5źe(ź HSlËP“ű\¤éźE1ŇÂFšáw¤*Ťř§Ę’ mĚÁfQcŮő.Ŕo ćYővfÚK8IJ­éě&:»Ů–ÎiťŽfOç¶9ŇyíÎßî‚ĆCs…ü67Čks‡ĽV7Čmq~Ł+ľž3¤áďH*·‚Řbă‡Ń…z#ň5šÂs5]qČüô÷çů?»¦$önËÁ–÷ůžöţ :ŹíüĆsČD;‚ŇU :ß’Ę, ˝z:dŐ9"ÓČÜ&´ŮťÎkžI´Î˘ Ű<é˘oş¤Ó—.íö§Ë{ˇ˛/*ç„0V1'Ęű ¤ŰaĚ„¬'ô~+Ě3¦Ó iżxíő!Yjv eśq|ň™.řť‹?¶o޲…˙§Â&ďé!©zŹl˝ľ ×q`ÎVîßŔ4oqpšŕťŔŔT ÍҨ<.F‰ĺ˝ôÚégłę/d78_Ďmć]Ďku˝žßę~!ŤdÖ:b:łC·%…źc!zŕ“ ná ŕŕ' ÓĽ¦ŇÎ>:ôtwő&C+‰o^ţ·ĺ ęěD9đ^q»ç´ĂG®Ŕ!ŕ°™őBř Lśľc‡Żë8żţ–13g °ŕMˇ§{IÍťÍך[Şg™Xab›\e2-ąÖ|ZRŃôÄ™ˇš·ĚyßŇć3ĂÇO@›p'2÷ć3&‚©Ëxćuś˝u FĎň«qodýţ˙wäÚBe˝^¦É•ĆwüR'gĽ8¸FLÇŔoÁÖó[°t˙¦ÎŔŘ~<ŰMŁéâ”®ĺř"%ć*Vďľ\ŔhŠO÷0rđä\Ô˛řZÇú Ú`úßŕ×`†Żaé*Î\—Âz¦XşM›™’´‹ŹÎýLő uî'_ľ•E™ű˝ 2ęą7BópĘšľ)“aVÜ$! $ëCXą‹Ł„88HPúÖă‹T¸“ţGä±ěu‰ŕÝdľŹ‘ł·ňE=›ĎQü/i®Iiăńů(¸Ç$L;“łĹ×Ä(˘yţ:{ő -łOľxkÔÎó5ä·Ţ.•ĆÉv*ĚΕ"źĎ%gĄGĚ1{ ŘůN«™$…H`šDŘN`EmŦ»h¸ř©ś1ţměđwÚlĆ×čńM^â`ď7J‚šCŔ$p J»ë =ßrŤľ†ůťć7âŞd!¶\˘J¤!ĽPBr¦‚_ŞxĆI[„8řObĽŘ’7™2˛›PÄ} ‰†°D[·@ĺ“\§/QüŻhŹń`ç'.!SŔ5\ ÜŁ¤±¨OĹB,‰&C{†ë ś|5Ţv†…Ý–7jä ž@¨…2Y*–…Đ\đO“AŇŔ ť‚^, 6îS(®řĎĚ´Wuź­zŇÜum3ëÚ1p"¸†MŹč©ŕ/>‰ŘQˇ‘V×3FžöŤ6¸řżĺÚV÷YŢHŞ“„jYŮÔŹ)#§¶ČÁě9đK‘Át$3B¦‚ť—eęôóbřŽ*ŢQÚ'§yń'Đ®áO|“dަËC@şř&Š´_śˇ€đ–h_ _<Çňjr˝<ťX#K“M}r^QląD—Č3kúÁŮrX0}DČKŤQ†ňŐͧüMT„EŇ x*‰z'ť‚'ŇĽpqÚ3~2ł!”! !Ůň0›Ż÷ AüS”耣· Ť ®Ý[ܵ úi—ôYžcČŃL*Ş&{µä k,VŔT„ž›& ž±ň´kň•űÔLŽĺWŤ`÷#2‹Ý”C3ŤŹ»FL˘­F W¨Ś˘q(ďKÔáiŢSĚ_ß}#˙N)šöY$_?'(]ái_A–§HGâk”ŞBl™Ä•k2÷‘…ŞT_Yŕź¬zĐ5RÎ\xI·đŹy ˙”m|ą¶Et±ňŢřr-:µĆNŞŇĄâĘ5ř}ABąˇ ľÔ”ŽČ5¦ýŐ®ş†MMxýZ΢Ů,Ź,ÖRŽČW^_Ş˙4ŁÎšÎl`VM©śV;*ŻÍ‘Ęnv “*Íéđ­‹~Iňľ1ŁÝ[y#i\c38[Ńrv¶Ę’ŘB“‡IĄ6tR©-ť\6ťN©p¤KěG"rLđKV%gaüł|M^+˛Vę/Ńejśř ť’¬ë‹:y‚Š9ľtÍĽ`şŞ?.ěđxśZm˝)2_g–čŹ3ýqCá"Ąţ$5! UÎ1$KŁ4"×hqLŮĘó–¨\ăŕ LM^ÂÇ˙ëZ=UÜ?Ą)}–XĄŁ–YĎ Ěmź^RŘ=Łľ¨Ó%=ŁŮÚ6ąĆ\<¶R÷řCüW!Ď&9"'?ů'éBÎ2K(łüśđÄžuÁ˙÷νŃsuřř\"vYŻĺGü.î_™żśý¶ţőÔ?nÜţ¸ýqűăö˙ĺí˙ţŃ´{¬ŔIEND®B`‚base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/layout/000077500000000000000000000000001262264444500335065ustar00rootroot00000000000000activity_main.xml000066400000000000000000000024421262264444500370130ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/layout base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/menu/000077500000000000000000000000001262264444500331355ustar00rootroot00000000000000activity_main.xml000066400000000000000000000020441262264444500364400ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/menu values-v11/000077500000000000000000000000001262264444500340165ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/resstyles.xml000066400000000000000000000021561262264444500360670ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/values-v11 values-v14/000077500000000000000000000000001262264444500340215ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/resstyles.xml000066400000000000000000000022471262264444500360730ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/values-v14 base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/values/000077500000000000000000000000001262264444500334705ustar00rootroot00000000000000strings.xml000066400000000000000000000020371262264444500356260ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/values NotificationServiceNativePlatformAndr Hello world! Settings styles.xml000066400000000000000000000027221262264444500354610ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/res/values base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/src/000077500000000000000000000000001262264444500321675ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/src/com/000077500000000000000000000000001262264444500327455ustar00rootroot00000000000000example/000077500000000000000000000000001262264444500343215ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/src/comnotificationservicenativeplatformandr/000077500000000000000000000000001262264444500442115ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/src/com/exampleMainActivity.java000066400000000000000000000027661262264444500474700ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/src/com/example/notificationservicenativeplatformandr/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package com.example.notificationservicenativeplatformandr; import android.os.Bundle; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_main, menu); return true; } } base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/src/org/000077500000000000000000000000001262264444500327565ustar00rootroot00000000000000alljoyn/000077500000000000000000000000001262264444500343475ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/src/orgns/000077500000000000000000000000001262264444500347675ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/src/org/alljoynnativeplatform/000077500000000000000000000000001262264444500400225ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/src/org/alljoyn/nsAndroidLogger.java000066400000000000000000000040641262264444500434110ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/src/org/alljoyn/ns/nativeplatform/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.nativeplatform; import org.alljoyn.ns.commons.GenericLogger; import android.util.Log; /** * Android implementation of the {@link GenericLogger} interface */ public class AndroidLogger implements GenericLogger { /** * @see org.alljoyn.ns.commons.GenericLogger#debug(java.lang.String, java.lang.String) */ @Override public void debug(String TAG, String msg) { Log.d(TAG, msg); } /** * @see org.alljoyn.ns.commons.GenericLogger#info(java.lang.String, java.lang.String) */ @Override public void info(String TAG, String msg) { Log.i(TAG, msg); } /** * @see org.alljoyn.ns.commons.GenericLogger#warn(java.lang.String, java.lang.String) */ @Override public void warn(String TAG, String msg) { Log.w(TAG, msg); } /** * @see org.alljoyn.ns.commons.GenericLogger#error(java.lang.String, java.lang.String) */ @Override public void error(String TAG, String msg) { Log.e(TAG, msg); } /** * @see org.alljoyn.ns.commons.GenericLogger#fatal(java.lang.String, java.lang.String) */ @Override public void fatal(String TAG, String msg) { Log.wtf(TAG, msg); } } NativePlatformAndroid.java000066400000000000000000000027541262264444500451310ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/src/org/alljoyn/ns/nativeplatform/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.ns.nativeplatform; import org.alljoyn.ns.commons.NativePlatform; import org.alljoyn.ns.commons.NativePlatformAbstrImpl; /** * Android implementation of the {@link NativePlatform} interface */ public class NativePlatformAndroid extends NativePlatformAbstrImpl { /** * Constructor */ public NativePlatformAndroid() { super(); } /** * @see org.alljoyn.ns.commons.NativePlatformAbstrImpl#createLogger() */ @Override protected void createLogger() { logger = new AndroidLogger(); }//createLogger } package-info.java000066400000000000000000000023471262264444500432170ustar00rootroot00000000000000base-15.09/notification/java/native_platform/NotificationServiceNativePlatformAndroid/src/org/alljoyn/ns/nativeplatform/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ /** * The package includes classes with the platform dependent logic. * The Notification service is written in pure java v1.6.
* This package provides platform dependent logic, e.g. logs for Android platform */ package org.alljoyn.ns.nativeplatform;base-15.09/notification/java/sample_applications/000077500000000000000000000000001262264444500221115ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/000077500000000000000000000000001262264444500235315ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/000077500000000000000000000000001262264444500311005ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/.classpath000066400000000000000000000024621262264444500330670ustar00rootroot00000000000000 base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/.project000066400000000000000000000014761262264444500325570ustar00rootroot00000000000000 NotificationServiceUISample com.android.ide.eclipse.adt.ResourceManagerBuilder com.android.ide.eclipse.adt.PreCompilerBuilder org.eclipse.jdt.core.javabuilder com.android.ide.eclipse.adt.ApkBuilder com.android.ide.eclipse.adt.AndroidNature org.eclipse.jdt.core.javanature base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/.settings/000077500000000000000000000000001262264444500330165ustar00rootroot00000000000000org.eclipse.jdt.core.prefs000066400000000000000000000011511262264444500377170ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/.settings#Wed Mar 06 10:29:27 IST 2013 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.6 AndroidManifest.xml000066400000000000000000000046021262264444500346140ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/assets/000077500000000000000000000000001262264444500324025ustar00rootroot00000000000000Config.xml000066400000000000000000000053621262264444500342600ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/assets 000000 en Thermostat 4564545455454 service tester Thermostat on second floor Thermostat sur le deuxième Ă©tage ×רמוס×× ×‘×§×•×ž×” שנייה الحرارة على الطابق الثاني BestThermostat 1.1.12.4 10/10/2014 2.2.2.2 3.3.3.3 http://www.alljoyn.org 00.01 base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/build.xml000066400000000000000000000104231262264444500327210ustar00rootroot00000000000000 ic_launcher-web.png000066400000000000000000000030601262264444500345550ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample‰PNG  IHDR``múŕotRNSn¦‘ pHYs  šśĐIDATxśí[ßKKIB’Ză5M–5”B@®DZš¶ĐČ­ ÔŢ(jąÚŢ<Ôţ B –˘/•‹6f”\1:n||Őů,u‰ŰźÄ5˘)áNkúľHeÓO[M)i(sĹĽÔ…F …Đi8˘0ˇ÷°C­ť…‘LĆé4˘ÉĐŁ€· €qnąľz¦V ÔL† ?ţřŞx‚–ϡ–ňd¸ €QÜÚYH¸ÓŠ•q3Š[­ČZ8‹´QU‡¬ĺł¨Zžp Řl–µvDš8!ĺIhA ĚÚY€Y>‡rE}ű¸sŇ…Y;`Ëçh™@*Ö΂T@łZ VŁŞuË·B VŁŞ~'°¬ťş†Ť«@ŕŘ%DËŹ@ \kgA°“µN ńFUľ5l<^–ęŠĺHźµłŔZĂZ*V쇺囿,ŐĹ€fH Ö΂J'kN ‘e©>¨Xľ ÔUu€š ÔUu€-_»@˛ËR}€u˛Ú2oí,ŔÖ°z2»Ä°|ŤEhíČZľFt4Şę]ĂęČ|쇔ĺëČkgAj «E äFµ^#­M2‹©¸¸ĺă „¸,%N‰´6I{ű'ßż$N ĺ‹w˛řáXűřyńě·4^6I2ˇ~ßżĆaYšLzŤěn«Cą»EîU•®Bł|dTŐŰĺ3ĹgkSńĉ4L”¬}|Ś4WEĄńňĹ32>ľl¨ĺc \–Ň3Ć{âęŔw C;Y4€Ö>[ 7âlm’ŰeŔ-đŽ@Řu3Ź…cqw+ýĎš„@“w˙ĽBęüŇ(ńđľ¨@„©rěˇXÄ Â%žĐ”Â% ±{n!´ŘfĂ’6Cť «‘0Dއ©iťÍ…¦-…n6W±^CŚÂö+52°ż’Ü iŔřĄIm—Ź §dŃ`Â{˙ Ć–…,J.Ł@„˝<1‡áfVţE;``_¦üň™Đ”Q^_´č剉Ä`(ĺ NAa3Ŕĺ ~Aa3¤2ŠĆ‚Âf–'ě®8ĺ‰é‚ÂfĚVS yô˙u#ú‚b˙÷dş ÖŇ˦IEND®B`‚project.properties000066400000000000000000000011411262264444500346020ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample# 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=../gridlayout_v7 base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/res/000077500000000000000000000000001262264444500316715ustar00rootroot00000000000000drawable-hdpi/000077500000000000000000000000001262264444500343155ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/resic_launcher.png000066400000000000000000000022661262264444500373050ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/res/drawable-hdpi‰PNG  IHDR00Ř`nĐtRNSn¦‘ pHYs  šśVIDATX…ĹŘ˙OgđŹwpx|)0J@ËIgç÷ŮŽ´ŐÚŽZ­q~I§…)ł˛)hĄÖ2uD«d_šn]Ú™&6´I­#kfÚTčKš41áoÚgŻ78îîĐOŢ?qĎ}î%Ü=÷<QJَEEi%´p•˘Ţá›AóO?+ťÎ٤ Ô9வٺůâ>*AŹ}î"’)ÓÚĚb9Mő™úąí»±t"–NÔ´¶Vüň+‘LŻ÷ôŞTEg1z7n”X:ńí?R‡J"™"s⯄¦§·¸7–LŽwOyÖŢ=Ł4ëű;ŮĚô1ÇĂ7(‘LUnnĘŠ˘i齸´÷˘éź÷g “hµ'ţ~A7É”qi3™DŁTÖ9‚ńX%–NDßlá*EöxíŐ« "™˛ż|ĄóůDŃt#«ˇl 瀛ń,ì[ŹłMD2Uµý\ÝÁ|GIeklčöۧą4sŰwQIÎVyö#LĹ˝{xMMšF÷ů[»rQČTź©gobŢŘ`1ÉÔń› ­–brŘ&®°Sbé„w#ĚůWÉl6âő»ÉţĎ®vtÁ0ćť‘őýNÍÚ»gş #' Á;Ś-ţ„ůĽĆ㻉ĄÝS>@•Ęě)€1ňz¦ąŠhiď‘LžÇŁ«éë+.¨Ą÷ ” hĺź›Ĺ㱼4dÉ›š‹ެsÓęŞř /WC…i3™ě/_‰ şýö©Ć +şńq1A®±A!@•ĘŞíçâ€ní>ĘrL¦ů”ş«[PŁűĽp Y–ßď ]{¸"–đÚZA őý“ĂĆ}ťę*ŽAg;ड़cŤ‘  -~ÇŃľĽ Fűa%|ů4śb?C˘×gOĽ@+˙ĆeÇr6–JŔŐ Ëł4T&ľ3Űr Üë-tÁÓ—łeÝÇp}‚B%:W:@!g<Á0[üI~ r3Ę0H_ľa6 =‘i8Ý’ÝFŐ~1?ĐÉłM™‡ńRčl‡č_ •)XÍŮ—;ŘćňŤ˙¶y¬áĚň¦Đ3xÔ*zËR‡Ză˛27Łf#řGQ¨,† í3J¨Ţ†ŮëÜ žĐ×~Ł+…üFě™ńCuyj››t°E8Ý ß‹LˇÇ3ĺeđ~››äpĹ“Ţ"R¨,Ď‚«µDŽ[·3ş&ˇžĂ ĐžTř<Ě ¬ľ“‡ Z ĂŕeDŁfH%péó ˇ™ô2NQYĄVÁpoq)óhŞĺAˇ—Ő\”»{y:Úř,TrÔ§őBçhzŢ?í /…Ž6ˇ3ä”ěVÁz•—g JdśÍŚď|1Ęn…ŕ_Jtz\nž… ŕl†Č4‡Ć7 }‘)ôbyőÎřá¤ý)ô2č˙·€ŚLg,0ލ>qŔŚľč¦[ç[˙Ů´oăźpHIEND®B`‚drawable-ldpi/000077500000000000000000000000001262264444500343215ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/resic_launcher.png000066400000000000000000000022661262264444500373110ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/res/drawable-ldpi‰PNG  IHDR00Ř`nĐtRNSn¦‘ pHYs  šśVIDATX…ĹŘ˙OgđŹwpx|)0J@ËIgç÷ŮŽ´ŐÚŽZ­q~I§…)ł˛)hĄÖ2uD«d_šn]Ú™&6´I­#kfÚTčKš41áoÚgŻ78îîĐOŢ?qĎ}î%Ü=÷<QJَEEi%´p•˘Ţá›AóO?+ťÎ٤ Ô9வٺůâ>*AŹ}î"’)ÓÚĚb9Mő™úąí»±t"–NÔ´¶Vüň+‘LŻ÷ôŞTEg1z7n”X:ńí?R‡J"™"s⯄¦§·¸7–LŽwOyÖŢ=Ł4ëű;ŮĚô1ÇĂ7(‘LUnnĘŠ˘i齸´÷˘éź÷g “hµ'ţ~A7É”qi3™DŁTÖ9‚ńX%–NDßlá*EöxíŐ« "™˛ż|ĄóůDŃt#«ˇl 瀛ń,ì[ŹłMD2Uµý\ÝÁ|GIeklčöۧą4sŰwQIÎVyö#LĹ˝{xMMšF÷ů[»rQČTź©gobŢŘ`1ÉÔń› ­–brŘ&®°Sbé„w#ĚůWÉl6âő»ÉţĎ®vtÁ0ćť‘őýNÍÚ»gş #' Á;Ś-ţ„ůĽĆ㻉ĄÝS>@•Ęě)€1ňz¦ąŠhiď‘LžÇŁ«éë+.¨Ą÷ ” hĺź›Ĺ㱼4dÉ›š‹ެsÓęŞř /WC…i3™ě/_‰ şýö©Ć +şńq1A®±A!@•ĘŞíçâ€ní>ĘrL¦ů”ş«[PŁűĽp Y–ßď ]{¸"–đÚZA őý“ĂĆ}ťę*ŽAg;ड़cŤ‘  -~ÇŃľĽ Fűa%|ů4śb?C˘×gOĽ@+˙ĆeÇr6–JŔŐ Ëł4T&ľ3Űr Üë-tÁÓ—łeÝÇp}‚B%:W:@!g<Á0[üI~ r3Ę0H_ľa6 =‘i8Ý’ÝFŐ~1?ĐÉłM™‡ńRčl‡č_ •)XÍŮ—;ŘćňŤ˙¶y¬áĚň¦Đ3xÔ*zËR‡Ză˛27Łf#řGQ¨,† í3J¨Ţ†ŮëÜ žĐ×~Ł+…üFě™ńCuyj››t°E8Ý ß‹LˇÇ3ĺeđ~››äpĹ“Ţ"R¨,Ď‚«µDŽ[·3ş&ˇžĂ ĐžTř<Ě ¬ľ“‡ Z ĂŕeDŁfH%péó ˇ™ô2NQYĄVÁpoq)óhŞĺAˇ—Ő\”»{y:Úř,TrÔ§őBçhzŢ?í /…Ž6ˇ3ä”ěVÁz•—g JdśÍŚď|1Ęn…ŕ_Jtz\nž… ŕl†Č4‡Ć7 }‘)ôbyőÎřá¤ý)ô2č˙·€ŚLg,0ލ>qŔŚľč¦[ç[˙Ů´oăźpHIEND®B`‚drawable-mdpi/000077500000000000000000000000001262264444500343225ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/resic_launcher.png000066400000000000000000000022661262264444500373120ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/res/drawable-mdpi‰PNG  IHDR00Ř`nĐtRNSn¦‘ pHYs  šśVIDATX…ĹŘ˙OgđŹwpx|)0J@ËIgç÷ŮŽ´ŐÚŽZ­q~I§…)ł˛)hĄÖ2uD«d_šn]Ú™&6´I­#kfÚTčKš41áoÚgŻ78îîĐOŢ?qĎ}î%Ü=÷<QJَEEi%´p•˘Ţá›AóO?+ťÎ٤ Ô9வٺůâ>*AŹ}î"’)ÓÚĚb9Mő™úąí»±t"–NÔ´¶Vüň+‘LŻ÷ôŞTEg1z7n”X:ńí?R‡J"™"s⯄¦§·¸7–LŽwOyÖŢ=Ł4ëű;ŮĚô1ÇĂ7(‘LUnnĘŠ˘i齸´÷˘éź÷g “hµ'ţ~A7É”qi3™DŁTÖ9‚ńX%–NDßlá*EöxíŐ« "™˛ż|ĄóůDŃt#«ˇl 瀛ń,ì[ŹłMD2Uµý\ÝÁ|GIeklčöۧą4sŰwQIÎVyö#LĹ˝{xMMšF÷ů[»rQČTź©gobŢŘ`1ÉÔń› ­–brŘ&®°Sbé„w#ĚůWÉl6âő»ÉţĎ®vtÁ0ćť‘őýNÍÚ»gş #' Á;Ś-ţ„ůĽĆ㻉ĄÝS>@•Ęě)€1ňz¦ąŠhiď‘LžÇŁ«éë+.¨Ą÷ ” hĺź›Ĺ㱼4dÉ›š‹ެsÓęŞř /WC…i3™ě/_‰ şýö©Ć +şńq1A®±A!@•ĘŞíçâ€ní>ĘrL¦ů”ş«[PŁűĽp Y–ßď ]{¸"–đÚZA őý“ĂĆ}ťę*ŽAg;ड़cŤ‘  -~ÇŃľĽ Fűa%|ů4śb?C˘×gOĽ@+˙ĆeÇr6–JŔŐ Ëł4T&ľ3Űr Üë-tÁÓ—łeÝÇp}‚B%:W:@!g<Á0[üI~ r3Ę0H_ľa6 =‘i8Ý’ÝFŐ~1?ĐÉłM™‡ńRčl‡č_ •)XÍŮ—;ŘćňŤ˙¶y¬áĚň¦Đ3xÔ*zËR‡Ză˛27Łf#řGQ¨,† í3J¨Ţ†ŮëÜ žĐ×~Ł+…üFě™ńCuyj››t°E8Ý ß‹LˇÇ3ĺeđ~››äpĹ“Ţ"R¨,Ď‚«µDŽ[·3ş&ˇžĂ ĐžTř<Ě ¬ľ“‡ Z ĂŕeDŁfH%péó ˇ™ô2NQYĄVÁpoq)óhŞĺAˇ—Ő\”»{y:Úř,TrÔ§őBçhzŢ?í /…Ž6ˇ3ä”ěVÁz•—g JdśÍŚď|1Ęn…ŕ_Jtz\nž… ŕl†Č4‡Ć7 }‘)ôbyőÎřá¤ý)ô2č˙·€ŚLg,0ލ>qŔŚľč¦[ç[˙Ů´oăźpHIEND®B`‚drawable-xhdpi/000077500000000000000000000000001262264444500345055ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/resic_launcher.png000066400000000000000000000030601262264444500374660ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/res/drawable-xhdpi‰PNG  IHDR``múŕotRNSn¦‘ pHYs  šśĐIDATxśí[ßKKIB’Ză5M–5”B@®DZš¶ĐČ­ ÔŢ(jąÚŢ<Ôţ B –˘/•‹6f”\1:n||Őů,u‰ŰźÄ5˘)áNkúľHeÓO[M)i(sĹĽÔ…F …Đi8˘0ˇ÷°C­ť…‘LĆé4˘ÉĐŁ€· €qnąľz¦V ÔL† ?ţřŞx‚–ϡ–ňd¸ €QÜÚYH¸ÓŠ•q3Š[­ČZ8‹´QU‡¬ĺł¨Zžp Řl–µvDš8!ĺIhA ĚÚY€Y>‡rE}ű¸sŇ…Y;`Ëçh™@*Ö΂T@łZ VŁŞuË·B VŁŞ~'°¬ťş†Ť«@ŕŘ%DËŹ@ \kgA°“µN ńFUľ5l<^–ęŠĺHźµłŔZĂZ*V쇺囿,ŐĹ€fH Ö΂J'kN ‘e©>¨Xľ ÔUu€š ÔUu€-_»@˛ËR}€u˛Ú2oí,ŔÖ°z2»Ä°|ŤEhíČZľFt4Şę]ĂęČ|쇔ĺëČkgAj «E äFµ^#­M2‹©¸¸ĺă „¸,%N‰´6I{ű'ßż$N ĺ‹w˛řáXűřyńě·4^6I2ˇ~ßżĆaYšLzŤěn«Cą»EîU•®Bł|dTŐŰĺ3ĹgkSńĉ4L”¬}|Ś4WEĄńňĹ32>ľl¨ĺc \–Ň3Ć{âęŔw C;Y4€Ö>[ 7âlm’ŰeŔ-đŽ@Řu3Ź…cqw+ýĎš„@“w˙ĽBęüŇ(ńđľ¨@„©rěˇXÄ Â%žĐ”Â% ±{n!´ŘfĂ’6Cť «‘0Dއ©iťÍ…¦-…n6W±^CŚÂö+52°ż’Ü iŔřĄIm—Ź §dŃ`Â{˙ Ć–…,J.Ł@„˝<1‡áfVţE;``_¦üň™Đ”Q^_´č剉Ä`(ĺ NAa3Ŕĺ ~Aa3¤2ŠĆ‚Âf–'ě®8ĺ‰é‚ÂfĚVS yô˙u#ú‚b˙÷dş ÖŇ˦IEND®B`‚base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/res/layout/000077500000000000000000000000001262264444500332065ustar00rootroot00000000000000activity_control_panel.xml000066400000000000000000000050651262264444500404320ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/res/layout activity_main.xml000066400000000000000000000236241262264444500365200ustar00rootroot00000000000000base-15.09/notification/java/sample_applications/android/NotificationServiceUISample/res/layout base-15.09/onboarding/ios/samples/sampleApp/MainViewController.h000066400000000000000000000026741262264444500247220ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusListener.h" #import "alljoyn/about/AJNAnnouncementListener.h" @interface MainViewController : UIViewController @property (weak, nonatomic) IBOutlet UIButton *connectButton; @property (weak, nonatomic) IBOutlet UITableView *servicesTable; - (IBAction)connectButtonDidTouchUpInside:(id)sender; @property (weak, nonatomic) IBOutlet UILabel *instructionsLabel; @end base-15.09/onboarding/ios/samples/sampleApp/MainViewController.m000066400000000000000000000673161262264444500247330ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "MainViewController.h" #import "SystemConfiguration/CaptiveNetwork.h" #import "AJNStatus.h" #import "alljoyn/about/AJNAnnouncement.h" #import "alljoyn/about/AJNAnnouncementReceiver.h" #import "alljoyn/about/AJNAboutDataConverter.h" #import "ClientInformation.h" #import "AnnounceTextViewController.h" #import "GetAboutCallViewController.h" #import "OnboardingViewController.h" #import "AuthenticationListenerImpl.h" #include static bool ALLOWREMOTEMESSAGES = true; // About Client - allow Remote Messages flag static NSString * const APPNAME = @"AboutClientMain"; // About Client - default application name static NSString * const DAEMON_QUIET_PREFIX = @"quiet@"; // About Client - quiet advertising static NSString * const ONBOARDING_OBJECT_PATH = @"/Onboarding"; static NSString * const ONBOARDING_INTERFACE_NAME = @"org.alljoyn.Onboarding"; static NSString * const DEFAULT_REALM_BUS_NAME = @"org.alljoyn.BusNode.onboardingClient"; static NSString * const SSID_NOT_CONNECTED = @"SSID:not connected"; @interface MainViewController () @property NSString *className; // About Client properties @property (strong, nonatomic) AJNBusAttachment *clientBusAttachment; @property (strong, nonatomic) AJNAnnouncementReceiver *announcementReceiver; @property (strong, nonatomic) NSString *realmBusName; @property (nonatomic) bool isAboutClientConnected; @property (strong, nonatomic) NSMutableDictionary *clientInformationDict; // Store the client related information // Announcement @property (strong, nonatomic) NSString *announcementButtonCurrentTitle; // The pressed button's announcementUniqueName @property (strong, nonatomic) dispatch_queue_t annBtnCreationQueue; // About Client strings @property (strong, nonatomic) NSString *ajconnect; @property (strong, nonatomic) NSString *ajdisconnect; @property (strong, nonatomic) NSString *annSubvTitleLabelDefaultTxt; // About Client alerts @property (strong, nonatomic) UIAlertView *disconnectAlert; @property (strong, nonatomic) UIAlertView *announcementOptionsAlert; @property (strong, nonatomic) UIAlertView *onboardingOptionsAlert; @property (strong, nonatomic) AuthenticationListenerImpl *authenticationListenerImpl; @end @implementation MainViewController #pragma mark - Built In methods - (void)viewDidLoad { [super viewDidLoad]; [self loadNewSession]; [self updateSSIDinTitle]; [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(updateSSIDinTitle) userInfo:nil repeats:YES]; } -(void)updateSSIDinTitle { static BOOL executing; if(executing) return; executing = YES; // this code does not work in the simulator NSArray *supportedInterfaces = (__bridge_transfer id)CNCopySupportedInterfaces(); // NSLog(@"supportedInterfaces: %@", supportedInterfaces); id interfaceInformation = nil; for (NSString *interfaceName in supportedInterfaces) { interfaceInformation = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)interfaceName); // NSLog(@" %@:%@", interfaceName, interfaceInformation); NSDictionary *dict = interfaceInformation; NSString *title = [NSString stringWithFormat:@"Devices on: %@",dict[@"SSID"]]; // Set the instructions Label text according to the network type if ([dict[@"SSID"] hasPrefix:AJ_AP_PREFIX] || [dict[@"SSID"] hasSuffix:AJ_AP_SUFFIX]) { self.instructionsLabel.text = @"You are currently connected to a device Access Point.\n\nPress \"Connect to AllJoyn\" to see the device in the list above.\n\nPress on the device name->onboarding to start onboarding."; } else { self.instructionsLabel.text = @"To onboard a new device:\nConnect to the device's Wi-Fi Access Point by going to Settings -> Wi-Fi\n\nTo see the devices on this network:\nPress \"Connect to AllJoyn\""; } if (![self.title isEqualToString:title]) { if ((![dict[@"SSID"] hasPrefix:AJ_AP_PREFIX] && ![dict[@"SSID"] hasSuffix:AJ_AP_SUFFIX]) && ![dict[@"SSID"] isEqualToString:[[NSUserDefaults standardUserDefaults]valueForKey:@"lastVisitedNetwork"]]) { NSLog(@"setting lastVisitedNetwork to: %@", dict[@"SSID"]); [[NSUserDefaults standardUserDefaults] setValue:dict[@"SSID"] forKey:@"lastVisitedNetwork"]; [[NSUserDefaults standardUserDefaults] synchronize]; } self.title = title; if (self.isAboutClientConnected) { NSLog(@"changing network to %@ trigger a restart", dict[@"SSID"]); [[[UIAlertView alloc]initWithTitle:@"Wi-Fi network changed" message:@"Please reconnect to AllJoyn" delegate:Nil cancelButtonTitle:@"OK" otherButtonTitles: nil] show]; [self.navigationController popViewControllerAnimated:YES]; [self stopAboutClient]; } } if (interfaceInformation && [interfaceInformation count]) { break; } } if ([self.title isEqualToString:@""]) { self.title = SSID_NOT_CONNECTED; } executing = NO; } // Get the user's input from the alert dialog - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (alertView == self.announcementOptionsAlert) { [self performAnnouncementAction:buttonIndex]; } else if (alertView == self.onboardingOptionsAlert) { [self performAnnouncementAction:buttonIndex]; } else { NSLog(@"[%@] [%@] alertView.tag is wrong", @"ERROR", [[self class] description]); } } - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // GetAboutCallViewController if ([segue.destinationViewController isKindOfClass:[GetAboutCallViewController class]]) { GetAboutCallViewController *getAboutCallView = segue.destinationViewController; getAboutCallView.clientInformation = (self.clientInformationDict)[self.announcementButtonCurrentTitle]; getAboutCallView.clientBusAttachment = self.clientBusAttachment; } // AnnounceTextViewController else if ([segue.destinationViewController isKindOfClass:[AnnounceTextViewController class]]) { AnnounceTextViewController *announceTextViewController = segue.destinationViewController; announceTextViewController.ajnAnnouncement = [(ClientInformation *)(self.clientInformationDict)[self.announcementButtonCurrentTitle] announcement]; } else if ([segue.destinationViewController isKindOfClass:[OnboardingViewController class]]) { OnboardingViewController *onboardingViewController = segue.destinationViewController; onboardingViewController.clientBusName = self.clientBusAttachment; onboardingViewController.clientInformation = (self.clientInformationDict)[self.announcementButtonCurrentTitle]; } } #pragma mark - IBAction Methods - (IBAction)connectButtonDidTouchUpInside:(id)sender { // Connect to the bus with the default realm bus name if (!self.isAboutClientConnected) { [self startAboutClient]; } else { [self stopAboutClient]; } } #pragma mark - AJNAnnouncementListener protocol method // Here we receive an announcement from AJN and add it to the client's list of services avaialble - (void)announceWithVersion:(uint16_t)version port:(uint16_t)port busName:(NSString *)busName objectDescriptions:(NSMutableDictionary *)objectDescs aboutData:(NSMutableDictionary **)aboutData { NSString *announcementUniqueName; // Announcement unique name in a format of ClientInformation *clientInformation = [[ClientInformation alloc] init]; // Save the announcement in a AJNAnnouncement clientInformation.announcement = [[AJNAnnouncement alloc] initWithVersion:version port:port busName:busName objectDescriptions:objectDescs aboutData:aboutData]; // Generate an announcement unique name in a format of announcementUniqueName = [NSString stringWithFormat:@"%@ %@", [clientInformation.announcement busName], [AJNAboutDataConverter messageArgumentToString:[clientInformation.announcement aboutData][@"DeviceName"]]]; NSLog(@"[%@] [%@] Announcement unique name [%@]", @"DEBUG", [[self class] description], announcementUniqueName); AJNMessageArgument *annObjMsgArg = [clientInformation.announcement aboutData][@"AppId"]; uint8_t *appIdBuffer; size_t appIdNumElements; QStatus status; status = [annObjMsgArg value:@"ay", &appIdNumElements, &appIdBuffer]; // Add the received announcement if (status != ER_OK) { NSLog(@"[%@] [%@] Failed to read appId for key [%@]", @"DEBUG", [[self class] description], announcementUniqueName); return; } // Dealing with announcement entries should be syncronized, so we add it to a queue dispatch_sync(self.annBtnCreationQueue, ^{ bool isAppIdExists = false; uint8_t *tmpAppIdBuffer; size_t tmpAppIdNumElements; QStatus tStatus; int res; // Iterate over the announcements dictionary for (NSString *key in self.clientInformationDict.allKeys) { ClientInformation *clientInfo = [self.clientInformationDict valueForKey:key]; AJNAnnouncement *announcement = [clientInfo announcement]; AJNMessageArgument *tmpMsgrg = [announcement aboutData][@"AppId"]; tStatus = [tmpMsgrg value:@"ay", &tmpAppIdNumElements, &tmpAppIdBuffer]; if (tStatus != ER_OK) { NSLog(@"[%@] [%@] Failed to read appId for key [%@]", @"DEBUG", [[self class] description], key); return; } res = 1; if (appIdNumElements == tmpAppIdNumElements) { res = memcmp(appIdBuffer, tmpAppIdBuffer, appIdNumElements); } // Found a matched appId - res=0 if (!res) { isAppIdExists = true; // Same AppId and the same announcementUniqueName if ([key isEqualToString:announcementUniqueName]) { // Update only announcements dictionary NSLog(@"[%@] [%@] Got an announcement from a known device - updating the announcement object", @"DEBUG", [[self class] description]); (self.clientInformationDict)[announcementUniqueName] = clientInformation; // Same AppId but *different* announcementUniqueName } else { NSLog(@"[%@] [%@] Got an announcement from a known device(different bus name) - updating the announcement object and UI ", @"DEBUG", [[self class] description]); // Cancel advertise name if the bus name has changed NSString *prevBusName = [announcement busName]; if (!([busName isEqualToString:prevBusName])) { tStatus = [self.clientBusAttachment cancelFindAdvertisedName:prevBusName]; if (status != ER_OK) { NSLog(@"[%@] [%@] failed to cancelAdvertisedName for %@. status:%@", @"DEBUG", [[self class] description],prevBusName, [AJNStatus descriptionForStatusCode:tStatus]); } } // Remove existed record from the announcements dictionary [self.clientInformationDict removeObjectForKey:key]; // Add new record to the announcements dictionary [self.clientInformationDict setValue:clientInformation forKey:announcementUniqueName]; [self.servicesTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; } break; } //if } //for //appId doesn't exist and there is no match announcementUniqueName if (!(self.clientInformationDict)[announcementUniqueName] && !isAppIdExists) { // Add new pair with this AboutService information (version,port,bus name, object description and about data) [self.clientInformationDict setValue:clientInformation forKey:announcementUniqueName]; [self addNewAnnouncemetEntry]; // AppId doesn't exist and BUT there is no match announcementUniqueName } // else No OP }); // Register interest in a well-known name prefix for the purpose of discovery (didLoseAdertise) [self.clientBusAttachment enableConcurrentCallbacks]; status = [self.clientBusAttachment findAdvertisedName:busName]; if (status != ER_OK) { NSLog(@"[%@] [%@] failed to findAdvertisedName for %@. status:%@", @"ERROR", [[self class] description],busName, [AJNStatus descriptionForStatusCode:status]); } } #pragma mark AJNBusListener protocol methods - (void)didFindAdvertisedName:(NSString *)name withTransportMask:(AJNTransportMask)transport namePrefix:(NSString *)namePrefix { NSLog(@"didFindAdvertisedName %@", name); } - (void)didLoseAdvertisedName:(NSString *)name withTransportMask:(AJNTransportMask)transport namePrefix:(NSString *)namePrefix { NSLog(@"didLoseAdvertisedName"); QStatus status; // Find the button title that should be removed for (NSString *key in[self.clientInformationDict allKeys]) { if ([[[[self.clientInformationDict valueForKey:key] announcement] busName] isEqualToString:name]) { // Cancel advertise name for that bus status = [self.clientBusAttachment cancelFindAdvertisedName:name]; if (status != ER_OK) { NSLog(@"[%@] [%@] failed to cancelFindAdvertisedName for %@. status:%@", @"DEBUG", [[self class] description],name, [AJNStatus descriptionForStatusCode:status]); } // Remove the anouncement from the dictionary [self.clientInformationDict removeObjectForKey:key]; } } [self.servicesTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; } #pragma mark - util methods - (void)loadNewSession { // About flags self.isAboutClientConnected = false; self.annBtnCreationQueue = dispatch_queue_create("org.alljoyn.announcementbuttoncreationQueue", NULL); // Set About Client strings self.ajconnect = @"Connect to AllJoyn"; self.ajdisconnect = @"Disconnect from AllJoyn"; self.realmBusName = DEFAULT_REALM_BUS_NAME; self.annSubvTitleLabelDefaultTxt = @"Announcement of "; // Set About Client connect button // self.connectButton.backgroundColor = [UIColor darkGrayColor]; //button bg color // [self.connectButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; //button font color [self.connectButton setTitle:self.ajconnect forState:UIControlStateNormal]; //default text [self prepareAlerts]; } // Initialize alerts - (void)prepareAlerts { // announcementOptionsAlert.tag = 3 self.announcementOptionsAlert = [[UIAlertView alloc] initWithTitle:@"Choose option:" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Show Announce", @"About", nil]; self.announcementOptionsAlert.alertViewStyle = UIAlertViewStyleDefault; // onboardingOptionsAlert.tag = 4 self.onboardingOptionsAlert = [[UIAlertView alloc] initWithTitle:@"Choose option:" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Show Announce", @"About", @"Onboarding", nil]; self.onboardingOptionsAlert.alertViewStyle = UIAlertViewStyleDefault; } - (void)performAnnouncementAction:(NSInteger)opt { switch (opt) { case 0: // "Cancel" break; case 1: // "Show Announce" { [self performSegueWithIdentifier:@"AboutShowAnnounceSegue" sender:self]; } break; case 2: // "About" { [self performSegueWithIdentifier:@"AboutClientSegue" sender:self]; // get the announcment object } break; case 3: // "OnBoarding" { [self performSegueWithIdentifier:@"OnboardingClientSegue" sender:self]; // get the announcment object } break; default: break; } } - (void)AlertAndLog:(NSString *)level message:(NSString *)message status:(QStatus)status { NSString *alertText = [NSString stringWithFormat:@"%@ (%@)",message, [AJNStatus descriptionForStatusCode:status]]; NSLog(@"[%@] [%@] %@", level, [[self class] description], alertText); [[[UIAlertView alloc] initWithTitle:@"Startup Error" message:alertText delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil] show]; } #pragma mark - AboutClient #pragma mark start AboutClient - (void)startAboutClient { QStatus status; // Create a dictionary to contain announcements using a key in the format of: "announcementUniqueName + announcementObj" self.clientInformationDict = [[NSMutableDictionary alloc] init]; NSLog(@"[%@] [%@] Start About Client", @"DEBUG", [[self class] description]); // Init AJNBusAttachment self.clientBusAttachment = [[AJNBusAttachment alloc] initWithApplicationName:APPNAME allowRemoteMessages:ALLOWREMOTEMESSAGES]; // Start AJNBusAttachment status = [self.clientBusAttachment start]; if (status != ER_OK) { [self AlertAndLog:@"FATAL" message:@"Failed AJNBusAttachment start" status:status]; [self stopAboutClient]; return; } // Connect AJNBusAttachment status = [self.clientBusAttachment connectWithArguments:@""]; if (status != ER_OK) { [self AlertAndLog:@"FATAL" message:@"Failed AJNBusAttachment connectWithArguments" status:status]; [self stopAboutClient]; return; } NSLog(@"[%@] [%@] Create aboutClientListener", @"DEBUG", [[self class] description]); NSLog(@"[%@] [%@] Register aboutClientListener", @"DEBUG", [[self class] description]); [self.clientBusAttachment registerBusListener:self]; self.announcementReceiver = [[AJNAnnouncementReceiver alloc] initWithAnnouncementListener:self andBus:self.clientBusAttachment]; const char* interfaces[] = { [ONBOARDING_INTERFACE_NAME UTF8String] }; status = [self.announcementReceiver registerAnnouncementReceiverForInterfaces:interfaces withNumberOfInterfaces:1]; if (status != ER_OK) { [self AlertAndLog:@"FATAL" message:@"Failed to registerAnnouncementReceiver" status:status]; [self stopAboutClient]; return; } NSUUID *UUID = [NSUUID UUID]; NSString *stringUUID = [UUID UUIDString]; self.realmBusName = [NSString stringWithFormat:@"%@-%@", DEFAULT_REALM_BUS_NAME, stringUUID]; // Advertise Daemon for tcl status = [self.clientBusAttachment requestWellKnownName:self.realmBusName withFlags:kAJNBusNameFlagDoNotQueue]; if (status == ER_OK) { // Advertise the name with a quite prefix for TC to find it status = [self.clientBusAttachment advertiseName:[NSString stringWithFormat:@"%@%@", DAEMON_QUIET_PREFIX, self.realmBusName] withTransportMask:kAJNTransportMaskAny]; if (status != ER_OK) { [self AlertAndLog:@"FATAL" message:@"Failed to advertise name" status:status]; NSLog(@"[%@] [%@] Failed advertising: %@%@", @"ERROR", [[self class] description], DAEMON_QUIET_PREFIX, self.realmBusName); [self stopAboutClient]; return; } else { NSLog(@"[%@] [%@] Successfully advertised: %@%@", @"DEBUG", [[self class] description], DAEMON_QUIET_PREFIX, self.realmBusName); } } else { [self AlertAndLog:@"FATAL" message:@"Failed to requestWellKnownName" status:status]; [self stopAboutClient]; return; } // Enable Client Security self.authenticationListenerImpl = [[AuthenticationListenerImpl alloc] init]; status = [self enableClientSecurity]; if (ER_OK != status) { [self AlertAndLog:@"ERROR" message:@"Failed to enable security. Please uninstall the application and reinstall." status:status]; } else { NSLog(@"Successfully enabled security for the bus"); } [self.connectButton setTitle:self.ajdisconnect forState:UIControlStateNormal]; //change title to "Disconnect from AllJoyn" self.isAboutClientConnected = true; } - (QStatus)enableClientSecurity { QStatus status; status = [self.clientBusAttachment enablePeerSecurity:@"ALLJOYN_SRP_KEYX ALLJOYN_ECDHE_PSK" authenticationListener:self.authenticationListenerImpl keystoreFileName:@"Documents/alljoyn_keystore/s_central.ks" sharing:YES]; if (status != ER_OK) { //try to delete the keystore and recreate it, if that fails return failure NSError *error; NSString *keystoreFilePath = [NSString stringWithFormat:@"%@/alljoyn_keystore/s_central.ks", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]]; [[NSFileManager defaultManager] removeItemAtPath:keystoreFilePath error:&error]; if (error) { NSLog(@"ERROR: Unable to delete keystore. %@", error); return ER_AUTH_FAIL; } status = [self.clientBusAttachment enablePeerSecurity:@"ALLJOYN_SRP_KEYX ALLJOYN_ECDHE_PSK" authenticationListener:self.authenticationListenerImpl keystoreFileName:@"Documents/alljoyn_keystore/s_central.ks" sharing:YES]; } return status; } - (void)addNewAnnouncemetEntry { [self.servicesTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; } // announcementGetMoreInfo is an IBAction triggered by pressing a dynamic announcement button - (void)announcementGetMoreInfo:(NSInteger)requestedRow { // set the announcementButtonCurrentTitle self.announcementButtonCurrentTitle = [self.clientInformationDict allKeys][requestedRow]; NSLog(@"[%@] [%@] Requested: [%@]", @"DEBUG", [[self class] description],self.announcementButtonCurrentTitle); // Check if announcement has icon object path if (![self announcementSupportsInterface:self.announcementButtonCurrentTitle]) { [self.announcementOptionsAlert show]; // Event is forward to alertView: clickedButtonAtIndex: } else { [self.onboardingOptionsAlert show]; // Event is forward to alertView: clickedButtonAtIndex: } } // Return true if an announcement supports icon interface - (bool)announcementSupportsInterface:(NSString *)announcementKey { bool supportInterface = false; AJNAnnouncement *announcement = [(ClientInformation *)[self.clientInformationDict valueForKey:announcementKey] announcement]; NSMutableDictionary *announcementObjDecs = [announcement objectDescriptions]; //Dictionary of ObjectDescriptions NSStrings // iterate over the object descriptions dictionary for (NSString *key in announcementObjDecs.allKeys) { if ([key hasPrefix:ONBOARDING_OBJECT_PATH]) { // Iterate over the NSMutableArray for (NSString *intf in[announcementObjDecs valueForKey:key]) { if ([intf isEqualToString:(NSString *)ONBOARDING_INTERFACE_NAME]) { supportInterface = true; } } } } return supportInterface; } #pragma mark stop AboutClient - (void)stopAboutClient { QStatus status; NSLog(@"[%@] [%@] Stop About Client", @"DEBUG", [[self class] description]); // Bus attachment cleanup status = [self.clientBusAttachment cancelAdvertisedName:[NSString stringWithFormat:@"%@%@", DAEMON_QUIET_PREFIX, self.realmBusName] withTransportMask:kAJNTransportMaskAny]; if (status == ER_OK) { NSLog(@"[%@] [%@] Successfully cancel advertised name", @"DEBUG", [[self class] description]); } else { NSLog(@"[%@] [%@] Failed cancel advertised name, error:%@", @"DEBUG", [[self class] description],[AJNStatus descriptionForStatusCode:status]); } status = [self.clientBusAttachment releaseWellKnownName:self.realmBusName]; if (status == ER_OK) { NSLog(@"[%@] [%@] Successfully release WellKnownName", @"DEBUG", [[self class] description]); } else { NSLog(@"[%@] [%@] Failed release WellKnownName, error:%@", @"DEBUG", [[self class] description],[AJNStatus descriptionForStatusCode:status]); } status = [self.clientBusAttachment removeMatchRule:@"sessionless='t',type='error'"]; if (status == ER_OK) { NSLog(@"[%@] [%@] Successfully remove MatchRule", @"DEBUG", [[self class] description]); } else { NSLog(@"[%@] [%@] Failed remove MatchRule, error:%@", @"DEBUG", [[self class] description],[AJNStatus descriptionForStatusCode:status]); } // Cancel advertise name for each announcement bus for (NSString *key in[self.clientInformationDict allKeys]) { ClientInformation *clientInfo = (self.clientInformationDict)[key]; status = [self.clientBusAttachment cancelFindAdvertisedName:[[clientInfo announcement] busName]]; if (status != ER_OK) { NSLog(@"[%@] [%@] failed to cancelAdvertisedName for %@. status:%@", @"ERROR", [[self class] description],key, [AJNStatus descriptionForStatusCode:status]); } } self.clientInformationDict = nil; const char* interfaces[] = { [ONBOARDING_INTERFACE_NAME UTF8String] }; status = [self.announcementReceiver unRegisterAnnouncementReceiverForInterfaces:interfaces withNumberOfInterfaces:1]; if (status == ER_OK) { NSLog(@"[%@] [%@] Successfully unregistered AnnouncementReceiver", @"DEBUG", [[self class] description]); } else { NSLog(@"[%@] [%@] Failed unregistered AnnouncementReceiver, error:%@", @"DEBUG", [[self class] description],[AJNStatus descriptionForStatusCode:status]); } self.announcementReceiver = nil; // Stop bus attachment status = [self.clientBusAttachment stop]; if (status == ER_OK) { NSLog(@"[%@] [%@] Successfully stopped bus", @"DEBUG", [[self class] description]); } else { NSLog(@"[%@] [%@] Failed stopping bus, error:%@", @"DEBUG", [[self class] description],[AJNStatus descriptionForStatusCode:status]); } self.clientBusAttachment = nil; // Set flag self.isAboutClientConnected = false; // UI cleanup [self.connectButton setTitle:self.ajconnect forState:UIControlStateNormal]; [self.servicesTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; NSLog(@"[%@] [%@] About Client is stopped", @"DEBUG", [[self class] description]); } #pragma mark UITableView delegates - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.clientInformationDict count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *MyIdentifier = @"AnnouncementCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier forIndexPath:indexPath]; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.textLabel.text = [self.clientInformationDict allKeys][indexPath.row]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self announcementGetMoreInfo:indexPath.row]; } - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { [self announcementGetMoreInfo:indexPath.row]; } @end base-15.09/onboarding/ios/samples/sampleApp/OnBoardingService.xcodeproj/000077500000000000000000000000001262264444500263145ustar00rootroot00000000000000base-15.09/onboarding/ios/samples/sampleApp/OnBoardingService.xcodeproj/project.pbxproj000066400000000000000000000701621262264444500313760ustar00rootroot00000000000000// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 19C40C2918B24A8100D3F62B /* OnboardingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 19C40C2818B24A8100D3F62B /* OnboardingViewController.m */; }; 19E2F04317E87CE10005851F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F04217E87CE10005851F /* UIKit.framework */; }; 19E2F04517E87CE10005851F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F04417E87CE10005851F /* Foundation.framework */; }; 19E2F04717E87CE10005851F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F04617E87CE10005851F /* CoreGraphics.framework */; }; 19E2F06917E88AF20005851F /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F06817E88AF20005851F /* SystemConfiguration.framework */; }; 19E2F06D17E88B030005851F /* libstdc++.6.0.9.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F06A17E88B030005851F /* libstdc++.6.0.9.dylib */; }; 19E2F06E17E88B030005851F /* libstdc++.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F06B17E88B030005851F /* libstdc++.6.dylib */; }; 19E2F06F17E88B030005851F /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F06C17E88B030005851F /* libstdc++.dylib */; }; 19E2F07417E88B120005851F /* libc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F07117E88B120005851F /* libc++.dylib */; }; 19E2F07517E88B120005851F /* libc++abi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F07217E88B120005851F /* libc++abi.dylib */; }; 49838F67189930CE0007FCC6 /* AuthenticationListenerImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 49838F66189930CE0007FCC6 /* AuthenticationListenerImpl.m */; }; 87B941181A76B1E200DED7C3 /* libc++.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2F07017E88B120005851F /* libc++.1.dylib */; }; 9A0118C5187402B400975CE6 /* CommonBusListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0118BF187402B400975CE6 /* CommonBusListener.m */; }; 9A3DB0BC183A0D2A0063D6BE /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DAFFD183A0D290063D6BE /* Default-568h@2x.png */; }; 9A3DB0BD183A0D2A0063D6BE /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DAFFE183A0D290063D6BE /* Default.png */; }; 9A3DB0BE183A0D2A0063D6BE /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DAFFF183A0D290063D6BE /* Default@2x.png */; }; 9A3DB0BF183A0D2A0063D6BE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DB000183A0D290063D6BE /* InfoPlist.strings */; }; 9A3DB0C1183A0D2A0063D6BE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A3DB004183A0D290063D6BE /* main.m */; }; 9A3DB0C2183A0D2A0063D6BE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A3DB009183A0D290063D6BE /* AppDelegate.m */; }; 9A3DB0C3183A0D2A0063D6BE /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9A3DB00A183A0D290063D6BE /* MainStoryboard_iPhone.storyboard */; }; 9A3DB0C4183A0D2A0063D6BE /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A3DB00C183A0D290063D6BE /* MainViewController.m */; }; 9A3DB315183A19CB0063D6BE /* libc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A3DB314183A19CB0063D6BE /* libc.dylib */; }; 9A5CC10C183D04AA002327C0 /* alljoynicon.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 9A5CC10B183D04AA002327C0 /* alljoynicon.jpeg */; }; 9A5CC10F183D073E002327C0 /* GetAboutCallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5CC10E183D073E002327C0 /* GetAboutCallViewController.m */; }; 9A5EFF7D187044BC002833C1 /* ClientInformation.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5EFF7C187044BC002833C1 /* ClientInformation.m */; }; 9AD3D2DE187191AC00D15544 /* AnnounceTextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD3D2DD187191AC00D15544 /* AnnounceTextViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 19C40C2718B24A8100D3F62B /* OnboardingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnboardingViewController.h; sourceTree = ""; }; 19C40C2818B24A8100D3F62B /* OnboardingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnboardingViewController.m; sourceTree = ""; }; 19E2F03F17E87CE10005851F /* OnBoardingService.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OnBoardingService.app; sourceTree = BUILT_PRODUCTS_DIR; }; 19E2F04217E87CE10005851F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 19E2F04417E87CE10005851F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 19E2F04617E87CE10005851F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 19E2F06817E88AF20005851F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 19E2F06A17E88B030005851F /* libstdc++.6.0.9.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.6.0.9.dylib"; path = "usr/lib/libstdc++.6.0.9.dylib"; sourceTree = SDKROOT; }; 19E2F06B17E88B030005851F /* libstdc++.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.6.dylib"; path = "usr/lib/libstdc++.6.dylib"; sourceTree = SDKROOT; }; 19E2F06C17E88B030005851F /* libstdc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.dylib"; path = "usr/lib/libstdc++.dylib"; sourceTree = SDKROOT; }; 19E2F07017E88B120005851F /* libc++.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.1.dylib"; path = "usr/lib/libc++.1.dylib"; sourceTree = SDKROOT; }; 19E2F07117E88B120005851F /* libc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.dylib"; path = "usr/lib/libc++.dylib"; sourceTree = SDKROOT; }; 19E2F07217E88B120005851F /* libc++abi.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++abi.dylib"; path = "usr/lib/libc++abi.dylib"; sourceTree = SDKROOT; }; 49838F65189930CE0007FCC6 /* AuthenticationListenerImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationListenerImpl.h; sourceTree = ""; }; 49838F66189930CE0007FCC6 /* AuthenticationListenerImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthenticationListenerImpl.m; sourceTree = ""; }; 9A0118BE187402B400975CE6 /* CommonBusListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonBusListener.h; sourceTree = ""; }; 9A0118BF187402B400975CE6 /* CommonBusListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommonBusListener.m; sourceTree = ""; }; 9A3DAFFB183A0D290063D6BE /* OnBoardingService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "OnBoardingService-Info.plist"; sourceTree = ""; }; 9A3DAFFC183A0D290063D6BE /* OnBoardingService-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OnBoardingService-Prefix.pch"; sourceTree = ""; }; 9A3DAFFD183A0D290063D6BE /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 9A3DAFFE183A0D290063D6BE /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 9A3DAFFF183A0D290063D6BE /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 9A3DB001183A0D290063D6BE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 9A3DB004183A0D290063D6BE /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 9A3DB008183A0D290063D6BE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../AppDelegate.h; sourceTree = ""; }; 9A3DB009183A0D290063D6BE /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = ../AppDelegate.m; sourceTree = ""; }; 9A3DB00A183A0D290063D6BE /* MainStoryboard_iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard_iPhone.storyboard; sourceTree = ""; }; 9A3DB00B183A0D290063D6BE /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; 9A3DB00C183A0D290063D6BE /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; 9A3DB314183A19CB0063D6BE /* libc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libc.dylib; path = usr/lib/libc.dylib; sourceTree = SDKROOT; }; 9A5CC10B183D04AA002327C0 /* alljoynicon.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = alljoynicon.jpeg; sourceTree = ""; }; 9A5CC10D183D073E002327C0 /* GetAboutCallViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetAboutCallViewController.h; sourceTree = ""; }; 9A5CC10E183D073E002327C0 /* GetAboutCallViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GetAboutCallViewController.m; sourceTree = ""; }; 9A5EFF7B187044BC002833C1 /* ClientInformation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientInformation.h; sourceTree = ""; }; 9A5EFF7C187044BC002833C1 /* ClientInformation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientInformation.m; sourceTree = ""; }; 9AD3D2DC187191AC00D15544 /* AnnounceTextViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnnounceTextViewController.h; sourceTree = ""; }; 9AD3D2DD187191AC00D15544 /* AnnounceTextViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnnounceTextViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 19E2F03C17E87CE10005851F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9A3DB315183A19CB0063D6BE /* libc.dylib in Frameworks */, 19E2F07417E88B120005851F /* libc++.dylib in Frameworks */, 87B941181A76B1E200DED7C3 /* libc++.1.dylib in Frameworks */, 19E2F07517E88B120005851F /* libc++abi.dylib in Frameworks */, 19E2F06F17E88B030005851F /* libstdc++.dylib in Frameworks */, 19E2F06E17E88B030005851F /* libstdc++.6.dylib in Frameworks */, 19E2F06D17E88B030005851F /* libstdc++.6.0.9.dylib in Frameworks */, 19E2F06917E88AF20005851F /* SystemConfiguration.framework in Frameworks */, 19E2F04317E87CE10005851F /* UIKit.framework in Frameworks */, 19E2F04517E87CE10005851F /* Foundation.framework in Frameworks */, 19E2F04717E87CE10005851F /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 19E2F03617E87CE10005851F = { isa = PBXGroup; children = ( 9A3DAFF9183A0D290063D6BE /* ViewControllers */, 9AB8994218758EB400BC53DA /* Utils */, 9AB8994118758EA800BC53DA /* StoryBoards */, 9A3DAFFA183A0D290063D6BE /* Resources */, 19E2F04117E87CE10005851F /* Frameworks */, 19E2F04017E87CE10005851F /* Products */, ); sourceTree = ""; }; 19E2F04017E87CE10005851F /* Products */ = { isa = PBXGroup; children = ( 19E2F03F17E87CE10005851F /* OnBoardingService.app */, ); name = Products; sourceTree = ""; }; 19E2F04117E87CE10005851F /* Frameworks */ = { isa = PBXGroup; children = ( 9A3DB314183A19CB0063D6BE /* libc.dylib */, 19E2F07117E88B120005851F /* libc++.dylib */, 19E2F07017E88B120005851F /* libc++.1.dylib */, 19E2F07217E88B120005851F /* libc++abi.dylib */, 19E2F06C17E88B030005851F /* libstdc++.dylib */, 19E2F06B17E88B030005851F /* libstdc++.6.dylib */, 19E2F06A17E88B030005851F /* libstdc++.6.0.9.dylib */, 19E2F06817E88AF20005851F /* SystemConfiguration.framework */, 19E2F04217E87CE10005851F /* UIKit.framework */, 19E2F04417E87CE10005851F /* Foundation.framework */, 19E2F04617E87CE10005851F /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; 9A3DAFF9183A0D290063D6BE /* ViewControllers */ = { isa = PBXGroup; children = ( 9A5CC10D183D073E002327C0 /* GetAboutCallViewController.h */, 9A5CC10E183D073E002327C0 /* GetAboutCallViewController.m */, 9A3DB00B183A0D290063D6BE /* MainViewController.h */, 9A3DB00C183A0D290063D6BE /* MainViewController.m */, 9AD3D2DC187191AC00D15544 /* AnnounceTextViewController.h */, 9AD3D2DD187191AC00D15544 /* AnnounceTextViewController.m */, 19C40C2718B24A8100D3F62B /* OnboardingViewController.h */, 19C40C2818B24A8100D3F62B /* OnboardingViewController.m */, ); name = ViewControllers; sourceTree = ""; }; 9A3DAFFA183A0D290063D6BE /* Resources */ = { isa = PBXGroup; children = ( 9A3DB008183A0D290063D6BE /* AppDelegate.h */, 9A3DB009183A0D290063D6BE /* AppDelegate.m */, 9A5CC10B183D04AA002327C0 /* alljoynicon.jpeg */, 9A3DAFFB183A0D290063D6BE /* OnBoardingService-Info.plist */, 9A3DAFFC183A0D290063D6BE /* OnBoardingService-Prefix.pch */, 9A3DAFFD183A0D290063D6BE /* Default-568h@2x.png */, 9A3DAFFE183A0D290063D6BE /* Default.png */, 9A3DAFFF183A0D290063D6BE /* Default@2x.png */, 9A3DB000183A0D290063D6BE /* InfoPlist.strings */, 9A3DB004183A0D290063D6BE /* main.m */, ); name = Resources; path = OnboardingService; sourceTree = ""; }; 9AB8994118758EA800BC53DA /* StoryBoards */ = { isa = PBXGroup; children = ( 9A3DB00A183A0D290063D6BE /* MainStoryboard_iPhone.storyboard */, ); name = StoryBoards; sourceTree = ""; }; 9AB8994218758EB400BC53DA /* Utils */ = { isa = PBXGroup; children = ( 49838F65189930CE0007FCC6 /* AuthenticationListenerImpl.h */, 49838F66189930CE0007FCC6 /* AuthenticationListenerImpl.m */, 9A0118BE187402B400975CE6 /* CommonBusListener.h */, 9A0118BF187402B400975CE6 /* CommonBusListener.m */, 9A5EFF7B187044BC002833C1 /* ClientInformation.h */, 9A5EFF7C187044BC002833C1 /* ClientInformation.m */, ); name = Utils; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 19E2F03E17E87CE10005851F /* OnBoardingService */ = { isa = PBXNativeTarget; buildConfigurationList = 19E2F06517E87CE10005851F /* Build configuration list for PBXNativeTarget "OnBoardingService" */; buildPhases = ( 19E2F03B17E87CE10005851F /* Sources */, 19E2F03C17E87CE10005851F /* Frameworks */, 19E2F03D17E87CE10005851F /* Resources */, ); buildRules = ( ); dependencies = ( ); name = OnBoardingService; productName = ControlPanelService; productReference = 19E2F03F17E87CE10005851F /* OnBoardingService.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 19E2F03717E87CE10005851F /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = AllJoyn; TargetAttributes = { 19E2F03E17E87CE10005851F = { SystemCapabilities = { com.apple.BackgroundModes = { enabled = 0; }; }; }; }; }; buildConfigurationList = 19E2F03A17E87CE10005851F /* Build configuration list for PBXProject "OnBoardingService" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 19E2F03617E87CE10005851F; productRefGroup = 19E2F04017E87CE10005851F /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 19E2F03E17E87CE10005851F /* OnBoardingService */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 19E2F03D17E87CE10005851F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 9A3DB0C3183A0D2A0063D6BE /* MainStoryboard_iPhone.storyboard in Resources */, 9A3DB0BD183A0D2A0063D6BE /* Default.png in Resources */, 9A3DB0BF183A0D2A0063D6BE /* InfoPlist.strings in Resources */, 9A5CC10C183D04AA002327C0 /* alljoynicon.jpeg in Resources */, 9A3DB0BE183A0D2A0063D6BE /* Default@2x.png in Resources */, 9A3DB0BC183A0D2A0063D6BE /* Default-568h@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 19E2F03B17E87CE10005851F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 9A3DB0C4183A0D2A0063D6BE /* MainViewController.m in Sources */, 49838F67189930CE0007FCC6 /* AuthenticationListenerImpl.m in Sources */, 9AD3D2DE187191AC00D15544 /* AnnounceTextViewController.m in Sources */, 19C40C2918B24A8100D3F62B /* OnboardingViewController.m in Sources */, 9A3DB0C2183A0D2A0063D6BE /* AppDelegate.m in Sources */, 9A5EFF7D187044BC002833C1 /* ClientInformation.m in Sources */, 9A3DB0C1183A0D2A0063D6BE /* main.m in Sources */, 9A0118C5187402B400975CE6 /* CommonBusListener.m in Sources */, 9A5CC10F183D073E002327C0 /* GetAboutCallViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 9A3DB000183A0D290063D6BE /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 9A3DB001183A0D290063D6BE /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 19E2F06317E87CE10005851F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 6.1; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 19E2F06417E87CE10005851F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 6.1; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; 19E2F06617E87CE10005851F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "OnboardingService/OnBoardingService-Prefix.pch"; GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/common/inc\"", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework/\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(SRCROOT)/../../inc\"", "\"$(SRCROOT)/../../../cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/ios/inc\"", ); INFOPLIST_FILE = "$(SRCROOT)/OnboardingService/OnBoardingService-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(OPENSSL_ROOT)/build/$(CONFIGURATION)-$(PLATFORM_NAME)", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "\"$(SRCROOT)/../alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", ); OTHER_LDFLAGS = ( "-lalljoyn", "-lajrouter", "-lssl", "-lcrypto", "-lalljoyn_services_common_objc", "-lalljoyn_services_common_cpp", "-lalljoyn_onboarding_objc", "-lalljoyn_onboarding_cpp", "-lalljoyn_about_objc", "-lalljoyn_about_cpp", "-lAllJoynFramework_iOS", ); PRODUCT_NAME = OnBoardingService; PROVISIONING_PROFILE = ""; TARGETED_DEVICE_FAMILY = 1; VALID_ARCHS = "armv7 i386 arm64"; WRAPPER_EXTENSION = app; }; name = Debug; }; 19E2F06717E87CE10005851F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "OnboardingService/OnBoardingService-Prefix.pch"; HEADER_SEARCH_PATHS = ( "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc\"", "\"$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc/alljoyn\"", "\"$(ALLJOYN_SDK_ROOT)/common/inc\"", "\"$(ALLJOYN_SDK_ROOT)/alljoyn_objc/AllJoynFramework/AllJoynFramework/\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/ios/inc\"", "\"$(ALLJOYN_SDK_ROOT)/services/about/cpp/inc\"", "\"$(SRCROOT)/../../inc\"", "\"$(SRCROOT)/../../../cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/cpp/inc\"", "\"$(SRCROOT)/../../../../services_common/ios/inc\"", ); INFOPLIST_FILE = "$(SRCROOT)/OnboardingService/OnBoardingService-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(OPENSSL_ROOT)/build/$(CONFIGURATION)-$(PLATFORM_NAME)", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib", "$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib", "\"$(SRCROOT)/../alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_cpp/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", "\"$(SRCROOT)/../../../../services_common/ios/samples/alljoyn_services_objc/build/$(CONFIGURATION)-$(PLATFORM_NAME)\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", "-DQCC_OS_GROUP_POSIX", "-DQCC_OS_DARWIN", ); OTHER_LDFLAGS = ( "-lalljoyn", "-lajrouter", "-lssl", "-lcrypto", "-lalljoyn_services_common_objc", "-lalljoyn_services_common_cpp", "-lalljoyn_onboarding_objc", "-lalljoyn_onboarding_cpp", "-lalljoyn_about_objc", "-lalljoyn_about_cpp", "-lAllJoynFramework_iOS", ); PRODUCT_NAME = OnBoardingService; PROVISIONING_PROFILE = ""; TARGETED_DEVICE_FAMILY = 1; VALID_ARCHS = "armv7 i386 arm64"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 19E2F03A17E87CE10005851F /* Build configuration list for PBXProject "OnBoardingService" */ = { isa = XCConfigurationList; buildConfigurations = ( 19E2F06317E87CE10005851F /* Debug */, 19E2F06417E87CE10005851F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 19E2F06517E87CE10005851F /* Build configuration list for PBXNativeTarget "OnBoardingService" */ = { isa = XCConfigurationList; buildConfigurations = ( 19E2F06617E87CE10005851F /* Debug */, 19E2F06717E87CE10005851F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 19E2F03717E87CE10005851F /* Project object */; } base-15.09/onboarding/ios/samples/sampleApp/OnBoardingService.xcodeproj/project.xcworkspace/000077500000000000000000000000001262264444500323125ustar00rootroot00000000000000contents.xcworkspacedata000066400000000000000000000002421262264444500371730ustar00rootroot00000000000000base-15.09/onboarding/ios/samples/sampleApp/OnBoardingService.xcodeproj/project.xcworkspace base-15.09/onboarding/ios/samples/sampleApp/OnboardingService/000077500000000000000000000000001262264444500243605ustar00rootroot00000000000000base-15.09/onboarding/ios/samples/sampleApp/OnboardingService/Default-568h@2x.png000066400000000000000000000442421262264444500275220ustar00rootroot00000000000000‰PNG  IHDR€pzŹĺ$iCCPICC Profile8…UßoŰT>‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśáiTXtXML:com.adobe.xmp 1 5 72 1 72 640 1 1136 2012-07-27T15:07:06 Pixelmator 2.0.5 )ńq™?7IDATxíŰ=Şže†ŃŤřQń§±qÎĂ™87;;'ŕ RÄBR(J‰…źWĽáw­žł‰Ý^»ą8‰w<řöĽÎű漏ĎűňĽ7Îó @€ü˙^ź~:ď÷óľ;ďůĂóăýóŢ;ď­ó>9Oü @ŕF®¶»ďŹó®ć{}w~|ŢŰç}}ŢŁó®˙ć#@€¸űłĘËó~<ďŐőŔĎĎűč<ńw| @€¸~ÁwµŢWç=»đŠżĎÎó›żŕ#@€ܨŔŐzWóý}×? —†Ź pű÷Wř]'ě#@€ř?~#‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`p& @ " #‡¶& @`WŢď& @€ŔÍ Ü_řôĽżn~U  @€\Í÷ô Ŕgçýzžß @ŕF®Ö»šďŮĂóăç˙ţđᙏλ;ĎG€ p;Wü˝<ďńyŻŢ=ďÝóŢ9ĎG€ p;ĎĎ*OÎűáĽÇ×_ż8ďĎóţ>ď·ó^źç#@€¸ «í®Ć»Zďjľ˙LZ9:\‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśŕiTXtXML:com.adobe.xmp 1 5 72 1 72 320 1 480 2012-07-27T15:07:80 Pixelmator 2.0.5 X±=Ć"IDATxíÖŃICQDŃDK°Áć»Iq¦˝ď/L {nđäoÖŔŕýv»ýś÷}Ţ×y>(‰oR¤? XG‡ŠĹŻUS[ą­ĆI“ĄíJĄéŘ*$ä:7‰©Űé¶ŞO{7ü@ŮH§kk?ě<Ę»řÎíľkktüqóŤÝ‹mÇ6°nƶÂřŘŻ±-ümR;`zŠ–ˇĘđv x#=\Ó% ëoŕYĐÚRÚ±ŁĄęůĐ#&Á?Č>ĚŇąáĐŞţ˘ţ©n¨_¨Ôß;j„;¦$}*}+ý(}'}/ýLŠtYş"ý$]•ľ‘.9»ď˝ź%Ř{Ż_aÝŠ]hŐkź5'SNĘ{äĺ”üĽü˛<°ą_“§ä˝đě öÍ ý˝t łjMµ{-ń4%ť×ĆTĹ„«tYŰź“¦R6ČĆŘô#§v\śĺ–Šx:žŠ'H‰ď‹OÄÇâ3·žĽř^ř&°¦őţ“0::ŕm,L%Č3âť:qVEô t›ĐÍ]~ߢI«vÖ6ĘWŮŻŞŻ) |ʸ2]ŐG‡Í4Ďĺ(6w¸˝Â‹Ł$ľ"ŽčAŢűľEvÝ mî[D‡˙Â;ëVh[¨}íőżÚ†đN|ć3˘‹őş˝âçŁHä‘S:°ßűéKâÝt·Ńx€÷UĎ'D;7˙®7;_"˙Ńeó?Yqxl+ pHYs  šśŕiTXtXML:com.adobe.xmp 1 5 72 1 72 640 1 960 2012-07-27T15:07:37 Pixelmator 2.0.5 PFđ5IDATxíŰ1ŠÝe‡á HHíěÜŽ;qoV.ÂŇÎ.V‚b&“řýa^p Ţßsá›3¦;Ďi^îŕýÝÝÝĎç˝;ď§óŢź÷ĂyŻÎó!@€ř˙ <ź>ś÷ńĽ_Î{x}~\ń÷öĽŻ_ćWgú @€܆ŔŐvWë=ľĚ»űóËoç]ń÷ăyoλţ͇ @ŕvľśU>ť÷ÇyO×7€×ź}Ż*Á‡ p×|Wë}Ţăő˙św}5蛿ŕC€¸aë›ŔĎWô]żř @€Śř>FmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@0 “ 0" GmM @€@W>ź÷Ą0  @€nVŕjľç×çLJóŢž÷íy÷çů @€ÜžŔź÷xŕÇë—óŢť÷ć<x| @€7$pĹß§óţ:ďéŐůńÝyž÷ţĽëOÂßś'‚ @ŕúćďú«ďŻçý~ßĂy×7€O/óó™> @€·!pµÝ[ďá_ŠĎ4ěýďlÄIEND®B`‚base-15.09/onboarding/ios/samples/sampleApp/OnboardingService/OnBoardingService-Info.plist000066400000000000000000000031521262264444500316720ustar00rootroot00000000000000 CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier org.alljoyn.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 00.01 CFBundleSignature ???? CFBundleVersion 0110 LSRequiresIPhoneOS UIMainStoryboardFile MainStoryboard_iPhone UIMainStoryboardFile~ipad MainStoryboard_iPhone UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight base-15.09/onboarding/ios/samples/sampleApp/OnboardingService/OnBoardingService-Prefix.pch000066400000000000000000000022571262264444500316600ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #ifndef __IPHONE_5_0 #warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ #import #import #endif base-15.09/onboarding/ios/samples/sampleApp/OnboardingService/alljoynicon.jpeg000066400000000000000000000031641262264444500275540ustar00rootroot00000000000000˙Ř˙ŕJFIF˙Ű„     "" $(4,$&1'-=-157:::#+?I?8C49:7 8$ $7,57377.,647,,+77/45,,--..7708400,,7,/,,,7.77,54,7˙Ŕ77˙Ä˙Ä5!A12Qa‘"$BqŃ#Rrˇ±Áđ˙Ä˙Ä3 !1AQ"‘±Ń2aqˇÁáđ#3Bb˙Ú ?Üp!LKoćĆšě+{í$©×ÂlćY˙^řpwau˛ŢŘÄ“ťŔt“î4<Ý™&ČZaĐY’ҧ[nť'Ě,ěGžaŚ ą^“eĐĆĐ_)óîŐ¤çrçuE‡)µť<ÎÄř~m{í…şđČTŞ6L±ÇŇÄwŮĚy~{S.ąJ`B”3Ě÷žz5„ĆT±y¨ěŰ}–ő±öóĂâvĘíl¨ZÖş©âűşgě‡ŔË"ŹdV>g¬-7Z†Ęln;9^×ŢÖ#|¸‚¬Í´zĂŘ÷cwÄý´6ÇVµ ä‰ĺľŇ´–cČRx"÷şSkhHČ\Că~lťK7înµŔl ńˇ:Ü÷›]*U×–žë´ĎÔ‘34"AIN› Üűóņô€ćÖ]šf×5á˛î–Ű…őZ/FůĘĹ)qĄ¬®TK$¬ťÖŘOžÄ{b­D{®¸âłn…´ó°v]ň)ż×LHuHýo:JC‹KhBu¨ě ţäá·ěˇý HÍďßtĹřéaA•,˛ŘÝjŰĐ~0˛ą’±ĺÝ­J[–bĆ‹5¤J E¬•¦ýŇylzhĘ·Kűť9ÇĂÚ‘3íů1X¨Ň—Ăť!cŤƆťö°¶ŕ}îN.Ĺľ0í‹főĆ<Ĺ0»ŽâsďĺÜ®ôJµŚĆúÝTEjôRlďEO¨‘éY§ýµĚPXµ0!!ôČ“Ş  ŇxʤŽé?~ĎA‡GÚZŹ ‘†¨ČúŞ Ě-K1ZTTęą/Ăáş°hÓꇱW®f*{ą]1Ý3ĐĺŇ›’žÓż‡aĂ#—_‚u%«~Ăq s|]ZE©tOGrk§úĹÉň>I›.ôj°ę_®şŤ ß«4o«ú•ř÷Âd©ŕŐÉ­ô„X¶śg™ú5¤¶Úm-´„ˇ)JE€Ĺ5–s‹ŤÎ«Ö6o¬Š^™P.ˇYIúś;'ďľ˙`pŘc鄚ĆgŞ'!V‘"`ýj– …ľ‚•jJ”4¨rě$zbŃ…ť3l;%B&Ín˘¶sšŚ•^d®7Â?†®UĆŢ"řYŤ·Źůˇ}‡š*ÎG§ÄOnl‘Hfl—ź‡r¤öw$_–BË’M…ČB⮑Đ!:ú©Ú\TF¤DkŤrůZô)7·ŇŻ{rÄőLÚüMŃuÖ^xśČť-†•N?©<á“g5‚NžËź@¦i°ľHş.ž1QJ^ BŻuDÔ5­Ďq¸ Ťe n7Ă#•ŃßwŠąY ń™ŐŰv%ĆÝj)JP@XPU¬~+€/ᆠ™Ż›(˛é3&B”'„ΨÇLő Č <”ë FŤ=ŢéqmC…°0ĄIy2βěYµ*ja|«©ÚO`:’}đ ‡ n„>ˇ’ő\şéeÚBo©k%× „‘kZŕß™ŰŰQfľúąE‘G˛…=ÚuB ť’ź8Ît… A¤’Ýź'ppw!e(Ôhý\şxď;ÄYPŞú<‡–MĐż˙Ůbase-15.09/onboarding/ios/samples/sampleApp/OnboardingService/en.lproj/000077500000000000000000000000001262264444500261075ustar00rootroot00000000000000base-15.09/onboarding/ios/samples/sampleApp/OnboardingService/en.lproj/InfoPlist.strings000066400000000000000000000000541262264444500314300ustar00rootroot00000000000000// Localized versions of Info.plist keys base-15.09/onboarding/ios/samples/sampleApp/OnboardingService/main.m000066400000000000000000000027371262264444500254730ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AppDelegate.h" #import "AJNInit.h" int main(int argc, char *argv[]) { @autoreleasepool { if ([AJNInit alljoynInit] != ER_OK) { return 1; } if ([AJNInit alljoynRouterInit] != ER_OK) { [AJNInit alljoynShutdown]; return 1; } int ret = UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); [AJNInit alljoynRouterShutdown]; [AJNInit alljoynShutdown]; return ret; } } base-15.09/onboarding/ios/samples/sampleApp/OnboardingViewController.h000066400000000000000000000041061262264444500261100ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import #import "AJNBusAttachment.h" #import "ClientInformation.h" static NSString * const AJ_AP_PREFIX = @"AJ_"; static NSString * const AJ_AP_SUFFIX = @"_AJ"; @interface OnboardingViewController : UIViewController @property (strong, nonatomic) AJNBusAttachment *clientBusName; @property (weak, nonatomic) ClientInformation *clientInformation; @property (weak, nonatomic) IBOutlet UITextField *ssidTextField; @property (weak, nonatomic) IBOutlet UITextField *ssidPassTextField; @property (weak, nonatomic) IBOutlet UIButton *configureBtn; @property (weak, nonatomic) IBOutlet UIButton *connectBtn; @property (weak, nonatomic) IBOutlet UIButton *offBoardingBtn; @property (weak, nonatomic) IBOutlet UILabel *onboardTitleLbl; @property (weak, nonatomic) IBOutlet UILabel *ssidLbl; @property (weak, nonatomic) IBOutlet UILabel *ssidPassLbl; @property (weak, nonatomic) IBOutlet UILabel *statusLbl; @property (weak, nonatomic) IBOutlet UILabel *instructLbl; - (IBAction)configureBtnDidTouchUpInside:(id)sender; - (IBAction)connectBtnDidTouchUpInside:(id)sender; - (IBAction)offBoardingBtnDidTouchUpInside:(id)sender; @end base-15.09/onboarding/ios/samples/sampleApp/OnboardingViewController.m000066400000000000000000000247571262264444500261330ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "OnboardingViewController.h" #import "alljoyn/onboarding/AJOBSOnboardingClient.h" #import "SystemConfiguration/CaptiveNetwork.h" @interface OnboardingViewController () @property (strong, nonatomic) AJOBSOnboardingClient *onboardingClient; @property (nonatomic) AJNSessionId sessionId; @property (strong, nonatomic) NSString *onboardeeBus; @end @implementation OnboardingViewController - (void)viewDidLoad { [super viewDidLoad]; // UI [self.statusLbl setText:@" "]; [self.instructLbl setText:@" "]; [self displayPreOnbordingElements:0]; self.offBoardingBtn.alpha = 0; [self updateStatusLabel:@"Loading Onboarding client"]; QStatus status = [self startOnboardingClient]; if (ER_OK != status) { [[[UIAlertView alloc] initWithTitle:@"Error" message:@"Failed to start onboarding client" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show]; } } -(void)displayPreOnbordingElements:(CGFloat) alpha { //text self.ssidTextField.alpha = alpha; self.ssidPassTextField.alpha = alpha; //buttons self.connectBtn.alpha = alpha; self.configureBtn.alpha = alpha; //labels self.onboardTitleLbl.alpha = alpha; self.ssidLbl.alpha = alpha; self.ssidPassLbl.alpha = alpha; } -(QStatus)startOnboardingClient { self.onboardeeBus = [self.clientInformation.announcement busName]; QStatus status = ER_FAIL; if (!self.onboardeeBus) { [self updateStatusLabel:@"Bus attachment hasn't been initialized"]; return status; } self.onboardingClient = [[AJOBSOnboardingClient alloc] initWithBus:self.clientBusName listener:self]; if (!self.sessionId) { status = [self createNewSession]; if (ER_OK != status) { return ER_FAIL; } } NSString *model = [[UIDevice currentDevice] model]; //using a simulator if ([model isEqualToString:@"iPhone Simulator"] || [model isEqualToString:@"iPad Simulator"]) { [self updateStatusLabel:[NSString stringWithFormat:@"NOTE: Using %@ does not support network detection - all possible actions are displayed",model]]; [self displayPreOnbordingElements:1]; self.offBoardingBtn.alpha = 1; self.connectBtn.enabled = NO; } else { if ([self isOnSAPNetwork]) { [self.instructLbl setText:@"Press Configure after filling in the WiFi network details"]; [self displayPreOnbordingElements:1]; self.connectBtn.enabled = NO; [self.ssidTextField setText:[[NSUserDefaults standardUserDefaults] objectForKey:@"lastVisitedNetwork"]]; } else { [self.instructLbl setText:@"To offboard the device - press Offboard"]; [self displayPreOnbordingElements:0]; //device already onboarded self.offBoardingBtn.alpha = 1; } } return status; } -(QStatus)createNewSession { //create sessionOptions [self updateStatusLabel:[NSString stringWithFormat:@"Create a new session with %@", [self.clientInformation.announcement busName]]]; AJNSessionOptions *opt = [[AJNSessionOptions alloc] initWithTrafficType:kAJNTrafficMessages supportsMultipoint:false proximity:kAJNProximityAny transportMask:kAJNTransportMaskAny]; //call joinSession self.sessionId = [self.clientBusName joinSessionWithName:[self.clientInformation.announcement busName] onPort:[self.clientInformation.announcement port] withDelegate:(nil) options:opt]; if (self.sessionId == 0 || self.sessionId == -1) { [self updateStatusLabel:[NSString stringWithFormat:@"Failed to join session. sid=%u",self.sessionId]]; return ER_FAIL; } return ER_OK; } -(bool)isOnSAPNetwork { NSString *currentSSID; // this code does not work in the simulator NSArray *supportedInterfaces = (__bridge_transfer id)CNCopySupportedInterfaces(); id interfaceInformation = nil; for (NSString *interfaceName in supportedInterfaces) { interfaceInformation = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)interfaceName); NSDictionary *dict = interfaceInformation; currentSSID = dict[@"SSID"]; NSLog(@"Current SSID: %@", currentSSID); } return [currentSSID hasPrefix:AJ_AP_PREFIX] | [currentSSID hasSuffix:AJ_AP_SUFFIX]; } -(void)updateStatusLabel:(NSString *)status { NSLog(@"%@",status); [self.statusLbl setText:status]; } -(void)stopOnboardingClient { QStatus status; NSLog(@"Calling leaveSession"); status = [self.clientBusName leaveSession:self.sessionId]; if (ER_OK != status) { NSLog(@"Failed to leave session %u, %@",self.sessionId, [AJNStatus descriptionForStatusCode:status]); } self.onboardingClient = nil; } #pragma marks - event methods - (IBAction)configureBtnDidTouchUpInside:(id)sender { QStatus status; [self updateStatusLabel:@"Calling ConfigureWiFi"]; AJOBInfo obInfo; obInfo.SSID = self.ssidTextField.text; obInfo.passcode = self.ssidPassTextField.text; obInfo.authType = ANY; NSLog(@"input SSID:%@ passcode:%@",obInfo.SSID,obInfo.passcode); if (![obInfo.SSID length]) { [self updateStatusLabel:@"Error: SSID is empty"]; [[[UIAlertView alloc] initWithTitle:@"Error" message:@"SSID can't be empty" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show]; return; } bool shouldConvert = false; if ([AJOBSOnboarding isValidWPAKey:obInfo.passcode]) { [self updateStatusLabel:@"Input passcode is a valid WPA - will convert to Hex"]; shouldConvert = true; } else if([AJOBSOnboarding isValidWEPKey:obInfo.passcode]) { if ([obInfo.passcode length] % 2) { [self updateStatusLabel:@"Input passcode is valid WEP - converting to Hex"]; shouldConvert = true; } else { [self updateStatusLabel:@"Input passcode is valid WEP - Hex conversion is not required"]; } } else { [self updateStatusLabel:@"Input passcode is none of the following: WPA, WEP"]; } if (shouldConvert) { NSString *tPasscode = [AJOBSOnboarding passcodeToHex:obInfo.passcode]; obInfo.passcode = tPasscode; NSLog(@"Passcode has been converted to:%@",obInfo.passcode); } short resultStatus; status = [self.onboardingClient configureWiFi:self.onboardeeBus obInfo:obInfo resultStatus:resultStatus sessionId:self.sessionId]; if (status == ER_OK) { [self updateStatusLabel:[NSString stringWithFormat:@"Call to configureWiFi succeeded.\nResult status is %hd",resultStatus]]; [self.instructLbl setText:@"Press Connect to complete the onboarding."]; if (resultStatus == 1) { self.connectBtn.enabled = YES; } if (resultStatus == 2) { [self updateStatusLabel:@"Waiting for connectionResult signal"]; } } else { [[[UIAlertView alloc] initWithTitle:@"Error" message:[NSString stringWithFormat:@"Call to configureWiFi failed: %@ ", [AJNStatus descriptionForStatusCode:status]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show]; [self updateStatusLabel:[NSString stringWithFormat:@"Call to configureWiFi failed: %@ ", [AJNStatus descriptionForStatusCode:status]]]; } self.configureBtn.enabled = NO; self.ssidTextField.enabled = NO; self.ssidPassTextField.enabled = NO; } - (IBAction)connectBtnDidTouchUpInside:(id)sender { QStatus status; [self updateStatusLabel:@"Calling connect"]; status = [self.onboardingClient connectTo:self.onboardeeBus sessionId:self.sessionId]; if (status == ER_OK) { [self updateStatusLabel:@"Call to connect succeeded"]; [[[UIAlertView alloc] initWithTitle:@"Onboarding succeeded" message:[NSString stringWithFormat:@"Check that your device connects to the '%@' network.\nGo to Settings -> Wi-Fi", self.ssidTextField.text] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show]; } else { [self updateStatusLabel:[NSString stringWithFormat:@"Call to connect failed: %@", [AJNStatus descriptionForStatusCode:status]]]; } [self.connectBtn setEnabled:NO]; [self.instructLbl setText:@" "]; } - (IBAction)offBoardingBtnDidTouchUpInside:(id)sender { [self updateStatusLabel:@"Calling offboard"]; QStatus status = [self.onboardingClient offboardFrom:self.onboardeeBus sessionId:self.sessionId]; if (status == ER_OK) { [self updateStatusLabel:@"Call to offboard succeeded"]; } else { [self updateStatusLabel:[NSString stringWithFormat:@"Call to offboard failed %@", [AJNStatus descriptionForStatusCode:status]]]; } [self.offBoardingBtn setEnabled:NO]; [self.instructLbl setText:@" "]; } // Get the user's input from the alert dialog - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { } - (void)viewWillDisappear:(BOOL)animated { [self stopOnboardingClient]; [super viewWillDisappear:animated]; } -(void)connectionResultSignalReceived:(int) connectionResultCode connectionResultMessage:(NSString*) connectionResultMessage { dispatch_async(dispatch_get_main_queue(), ^{ [self updateStatusLabel:[NSString stringWithFormat:@"connectionResultSignal has been received with code:%d message:%@", connectionResultCode,connectionResultMessage]]; if(connectionResultCode == VALIDATED) { [self.connectBtn setEnabled:YES]; } }); } @end base-15.09/onboarding/ios/src/000077500000000000000000000000001262264444500161565ustar00rootroot00000000000000base-15.09/onboarding/ios/src/AJOBOnboardingClientListenerAdapter.mm000066400000000000000000000034021262264444500253740ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJOBOnboardingClientListenerAdapter.h" #import "alljoyn/about/AJNConvertUtil.h" AJOBOnboardingClientListenerAdapter::AJOBOnboardingClientListenerAdapter(id onboardingClientListener) { ajOnboardingClientListener = onboardingClientListener; } AJOBOnboardingClientListenerAdapter::~AJOBOnboardingClientListenerAdapter() { } void AJOBOnboardingClientListenerAdapter::ConnectionResultSignalReceived(short connectionResultCode, const qcc::String& connectionResultMessage) { NSString* connectionResultMessageString; connectionResultMessageString = [AJNConvertUtil convertQCCStringtoNSString:connectionResultMessage]; [ajOnboardingClientListener connectionResultSignalReceived: connectionResultCode connectionResultMessage: connectionResultMessageString]; } base-15.09/onboarding/ios/src/AJOBSOnboarding.mm000066400000000000000000000056521262264444500213620ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJOBSOnboarding.h" #import "alljoyn/about/AJNConvertUtil.h" static NSString * const PASSCODE_FORMAT = @"%02X"; @implementation AJOBSOnboarding +(bool)isValidWEPKey:(NSString *) key { size_t size = [key length]; return (size == 5 || // 40-bit ascii size == 10 || // 40 bit hex size == 13 || // 104 bit ascii size == 26 || // 104 bit hex size == 16 || // 152 bit ascii size == 32 || // 152-bit hex size == 29 || // 256-bit ascii size == 64); // 256-bit hex } +(bool)isValidWPAKey:(NSString *) key { return [key length] >= MIN_PSK_SIZE && [key length] <= MAX_PSK_SIZE; } +(NSString*)passcodeToHex:(NSString*) passcode { const char *pass = [passcode UTF8String]; NSMutableString *passcodeHex = [NSMutableString string]; while (*pass) { [passcodeHex appendFormat:PASSCODE_FORMAT, *pass++ & BIT_MASK]; } return passcodeHex; } +(ajn::services::OBInfo)toOBInfo:(AJOBInfo) ajOBInfo { ajn::services::OBInfo obInfo; obInfo.SSID = [AJNConvertUtil convertNSStringToQCCString:ajOBInfo.SSID]; obInfo.state = (ajn::services::OBState)ajOBInfo.state; obInfo.authType = (ajn::services::OBAuthType)ajOBInfo.authType; obInfo.passcode = [AJNConvertUtil convertNSStringToQCCString:ajOBInfo.passcode]; return obInfo; } +(AJOBInfo)toAJOBInfo:(ajn::services::OBInfo) obInfo { AJOBInfo ajOBInfo; ajOBInfo.SSID = [AJNConvertUtil convertQCCStringtoNSString:obInfo.SSID]; ajOBInfo.state = obInfo.state; ajOBInfo.authType = obInfo.authType; ajOBInfo.passcode = [AJNConvertUtil convertQCCStringtoNSString:obInfo.passcode]; return ajOBInfo; } +(AJOBLastError)toAJOBLastError:(ajn::services::OBLastError) obLastError { AJOBLastError ajOBLastError; ajOBLastError.validationState = obLastError.validationState; ajOBLastError.message = [AJNConvertUtil convertQCCStringtoNSString:obLastError.message]; return ajOBLastError; } @end base-15.09/onboarding/ios/src/AJOBSOnboardingClient.mm000066400000000000000000000116361262264444500225200ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #import "AJOBSOnboardingClient.h" #import "alljoyn/onboarding/OnboardingClient.h" #import "alljoyn/onboarding/Onboarding.h" #import "alljoyn/about/AJNConvertUtil.h" #import "AJOBOnboardingClientListenerAdapter.h" @interface AJOBSOnboardingClient () @property ajn::services::OnboardingClient *handle; @property (nonatomic) AJOBOnboardingClientListenerAdapter * onboardingListenerAdapter; @end @implementation AJOBSOnboardingClient - (void)dealloc { delete self.handle; delete self.onboardingListenerAdapter; } -(id)initWithBus:(AJNBusAttachment*) bus listener:(id ) listener { self = [super init]; if (self) { self.onboardingListenerAdapter = new AJOBOnboardingClientListenerAdapter(listener); self.handle = new ajn::services::OnboardingClient((ajn::BusAttachment&)(*bus.handle), *self.onboardingListenerAdapter); } return self; } -(QStatus)configureWiFi:(NSString*) busName obInfo:(AJOBInfo&) ajOBInfo resultStatus:(short&) resultStatus sessionId:(AJNSessionId) sessionId { // prepare OBInfo ajn::services::OBInfo obInfo; obInfo = [AJOBSOnboarding toOBInfo:ajOBInfo]; QStatus status = self.handle->ConfigureWiFi([AJNConvertUtil convertNSStringToConstChar:busName], obInfo, resultStatus, sessionId); return status; } -(QStatus)configureWiFi:(NSString*) busName obInfo:(AJOBInfo&)obInfo resultStatus:(short&) resultStatus { NSLog(@"No sessionId has been specified - the service will find an existing route to end point rather than access directly."); return [self configureWiFi:busName obInfo:obInfo resultStatus:resultStatus sessionId:0]; } -(QStatus)connectTo:(NSString*) busName sessionId:(AJNSessionId) sessionId { return self.handle->ConnectTo([AJNConvertUtil convertNSStringToConstChar:busName], sessionId); } -(QStatus)connectTo:(NSString*) busName { NSLog(@"No sessionId has been specified - the service will find an existing route to end point rather than access directly."); return[self connectTo:busName sessionId:0]; } -(QStatus)offboardFrom:(NSString*) busName sessionId:(AJNSessionId) sessionId { return self.handle->OffboardFrom([AJNConvertUtil convertNSStringToConstChar:busName], sessionId); } -(QStatus)offboardFrom:(NSString*) busName { NSLog(@"No sessionId has been specified - the service will find an existing route to end point rather than access directly."); return [self offboardFrom:busName sessionId:0]; } -(QStatus)version:(NSString*) busName version:(int&) version sessionId:(AJNSessionId) sessionId { return self.handle->GetVersion([AJNConvertUtil convertNSStringToConstChar:busName], version, sessionId); } -(QStatus)version:(NSString*) busName version:(int&) version { NSLog(@"No sessionId has been specified - the service will find an existing route to end point rather than access directly."); return [self version:busName version:version sessionId:0]; } -(QStatus)state:(NSString*) busName state:(short&) state sessionId:(AJNSessionId) sessionId { return self.handle->GetState([AJNConvertUtil convertNSStringToConstChar:busName], state, sessionId); } -(QStatus)state:(NSString*) busName state:(short&) state { NSLog(@"No sessionId has been specified - the service will find an existing route to end point rather than access directly."); return [self state:busName state:state sessionId:0]; } -(QStatus)lastError:(NSString*) busName lastError:(AJOBLastError&) lastError sessionId:(AJNSessionId) sessionId { ajn::services::OBLastError obLastError; QStatus status = self.handle->GetLastError([AJNConvertUtil convertNSStringToConstChar:busName], obLastError, sessionId); lastError = [AJOBSOnboarding toAJOBLastError:obLastError]; return status; } -(QStatus)lastError:(NSString*) busName lastError:(AJOBLastError&) lastError { NSLog(@"No sessionId has been specified - the service will find an existing route to end point rather than access directly."); return [self lastError:busName lastError:lastError sessionId:0]; } @end base-15.09/onboarding/java/000077500000000000000000000000001262264444500155165ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/000077500000000000000000000000001262264444500210735ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/000077500000000000000000000000001262264444500225135ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/.classpath000066400000000000000000000007221262264444500244770ustar00rootroot00000000000000 base-15.09/onboarding/java/OnboardingManager/android/.project000066400000000000000000000014641262264444500241670ustar00rootroot00000000000000 OnboardingManager com.android.ide.eclipse.adt.ResourceManagerBuilder com.android.ide.eclipse.adt.PreCompilerBuilder org.eclipse.jdt.core.javabuilder com.android.ide.eclipse.adt.ApkBuilder com.android.ide.eclipse.adt.AndroidNature org.eclipse.jdt.core.javanature base-15.09/onboarding/java/OnboardingManager/android/AndroidManifest.xml000066400000000000000000000025051262264444500263060ustar00rootroot00000000000000 base-15.09/onboarding/java/OnboardingManager/android/build.xml000066400000000000000000000046411262264444500243410ustar00rootroot00000000000000 base-15.09/onboarding/java/OnboardingManager/android/project.properties000066400000000000000000000011101262264444500262700ustar00rootroot00000000000000# 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 base-15.09/onboarding/java/OnboardingManager/android/res/000077500000000000000000000000001262264444500233045ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/res/.gitignore000066400000000000000000000001061262264444500252710ustar00rootroot00000000000000# Ignore everything in this directory * # Except this file !.gitignorebase-15.09/onboarding/java/OnboardingManager/android/src/000077500000000000000000000000001262264444500233025ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/src/org/000077500000000000000000000000001262264444500240715ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/src/org/alljoyn/000077500000000000000000000000001262264444500255415ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/src/org/alljoyn/onboarding/000077500000000000000000000000001262264444500276635ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/src/org/alljoyn/onboarding/sdk/000077500000000000000000000000001262264444500304445ustar00rootroot00000000000000OffboardingConfiguration.java000066400000000000000000000036641262264444500362110ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/src/org/alljoyn/onboarding/sdk/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.sdk; /** *Holder of offboarding data: service name ,port */ public class OffboardingConfiguration { /** * The service name of the device */ private final String serviceName; /** * The port of the onboarding service */ private final short port; /** * Constructor of OffboardingConfiguration * * @param serviceName * {@link #serviceName} * @param port * {@link #port} * */ public OffboardingConfiguration(String serviceName, short port) { this.serviceName = serviceName; this.port = port; } /** * Get {@link #serviceName} * * @return the device's service name {@link #serviceName} */ public String getServiceName() { return serviceName; } /** * Get {@link #port} * * @return the devices's port {@link #port} */ public short getPort() { return port; } } OnboardingConfiguration.java000066400000000000000000000123311262264444500360420ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/src/org/alljoyn/onboarding/sdk/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.sdk; /** * Holder of onboarding data: onboardee, target, and timeouts */ public class OnboardingConfiguration { /** * Stores the onboardee WIFI credentials. */ private WiFiNetworkConfiguration onboardee = null; /** * Stores the target WIFI credentials. */ private WiFiNetworkConfiguration target = null; /** * Stores the timeout of establishing WIFI connection with the onboardee in * msec. */ private long onboardeeConnectionTimeout = OnboardingManager.DEFAULT_WIFI_CONNECTION_TIMEOUT; /** * Stores the timeout of waiting for announcement from the onboardee after * establishing WIFI connection with the onboardee in msec. */ private long onboardeeAnnoucementTimeout = OnboardingManager.DEFAULT_ANNOUNCEMENT_TIMEOUT; /** * Stores the timeout of establishing WIFI connection with the target in * msec. */ private long targetConnectionTimeout = OnboardingManager.DEFAULT_WIFI_CONNECTION_TIMEOUT; /** * Stores the timeout of waiting for announcement from the onboardee after * establishing WIFI connection with the target in msec. */ private long targetAnnoucementTimeout = OnboardingManager.DEFAULT_ANNOUNCEMENT_TIMEOUT; /** * Constructor of OnboardingConfiguration that receives all parameters * including WIFI credentials and timeouts. * * @param onboardee * {@link #onboardee} * @param onboardeeConnectionTimeout * {@link #onboardeeConnectionTimeout} * @param onboardeeAnnoucementTimeout * {@link #onboardeeAnnoucementTimeout} * @param target * {@link #target} * @param targetConnectionTimeout * {@link #targetConnectionTimeout} * @param targetAnnoucementTimeout * {@link #targetAnnoucementTimeout} */ public OnboardingConfiguration(WiFiNetworkConfiguration onboardee, long onboardeeConnectionTimeout, long onboardeeAnnoucementTimeout, WiFiNetworkConfiguration target, long targetConnectionTimeout, long targetAnnoucementTimeout) { this.onboardee = onboardee; this.target = target; this.onboardeeConnectionTimeout = onboardeeConnectionTimeout; this.onboardeeAnnoucementTimeout = onboardeeAnnoucementTimeout; this.targetConnectionTimeout = targetConnectionTimeout; this.targetAnnoucementTimeout = targetAnnoucementTimeout; } /** * Constructor of OnboardingConfiguration that receives WIFI credentials and * uses default timeout values * * @param onboardee * {@link #onboardee} * @param target * {@link #target} */ public OnboardingConfiguration(WiFiNetworkConfiguration onboardee, WiFiNetworkConfiguration target) { this.onboardee = onboardee; this.target = target; } /** * Get {@link #onboardee} * * @return the onboardee of the configuration {@link #onboardee} */ public WiFiNetworkConfiguration getOnboardee() { return onboardee; } /** * Get {@link #target} * * @return the target of the configuration {@link #target} */ public WiFiNetworkConfiguration getTarget() { return target; } /** * Get {@link #onboardeeConnectionTimeout} * * @return the onboardee Wi-Fi timeout {@link #onboardeeConnectionTimeout} */ public long getOnboardeeConnectionTimeout() { return onboardeeConnectionTimeout; } /** * Get {@link #onboardeeAnnoucementTimeout} * * @return the onboardee announcement timeout * {@link #onboardeeAnnoucementTimeout} */ public long getOnboardeeAnnoucementTimeout() { return onboardeeAnnoucementTimeout; } /** * Get {@link #targetConnectionTimeout} * * @return the target Wi-Fi timeout {@link #targetConnectionTimeout} */ public long getTargetConnectionTimeout() { return targetConnectionTimeout; } /** * Get {@link #targetAnnoucementTimeout} * * @return the target announcement timeout {@link #targetAnnoucementTimeout} */ public long getTargetAnnoucementTimeout() { return targetAnnoucementTimeout; } } OnboardingIllegalArgumentException.java000066400000000000000000000025451262264444500401740ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/src/org/alljoyn/onboarding/sdk/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.sdk; /** * Thrown to indicate that a method has been passed an illegal or inappropriate * argument. */ @SuppressWarnings("serial") public class OnboardingIllegalArgumentException extends Exception { public OnboardingIllegalArgumentException(String message) { super(message); } public OnboardingIllegalArgumentException() { super(); } } OnboardingIllegalStateException.java000066400000000000000000000025351262264444500374710ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/src/org/alljoyn/onboarding/sdk/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.sdk; /** * Thrown to indicate that a m method has been invoked at an illegal or * inappropriate state. */ @SuppressWarnings("serial") public class OnboardingIllegalStateException extends Exception { public OnboardingIllegalStateException(String message) { super(message); } public OnboardingIllegalStateException() { super(); } }OnboardingManager.java000066400000000000000000002704171262264444500346200ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/src/org/alljoyn/onboarding/sdk/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.sdk; import java.io.UnsupportedEncodingException; import java.util.List; import java.util.Map; import java.util.Timer; import java.util.TimerTask; import java.util.UUID; import org.alljoyn.about.AboutKeys; import org.alljoyn.bus.AboutListener; import org.alljoyn.bus.AboutObj; import org.alljoyn.bus.AboutObjectDescription; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.BusException; import org.alljoyn.bus.Status; import org.alljoyn.bus.Variant; import org.alljoyn.onboarding.OnboardingService.AuthType; import org.alljoyn.onboarding.client.OnboardingClient; import org.alljoyn.onboarding.client.OnboardingClientImpl; import org.alljoyn.onboarding.sdk.OnboardingManager.DeviceResponse.ResponseCode; import org.alljoyn.onboarding.transport.ConnectionResult; import org.alljoyn.onboarding.transport.ConnectionResultListener; import org.alljoyn.onboarding.transport.OnboardingTransport; import org.alljoyn.onboarding.transport.OnboardingTransport.ConfigureWifiMode; import org.alljoyn.services.common.ClientBase; import org.alljoyn.services.common.ServiceAvailabilityListener; import org.alljoyn.services.common.utils.TransportUtil; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.wifi.WifiConfiguration; import android.os.Bundle; import android.os.Handler; import android.os.HandlerThread; import android.os.Message; import android.util.Log; import android.util.Pair; /** * Streamlines the process of onboarding for Android application developers.
* The SDK encapsulates the Wi-Fi and AllJoyn sessions that are part of the * process.
* The Onboarding SDK API provides the following : * *
    *
  • Discovery of potential target networks,Discovery of potential * onboardees,by calling {@link #scanWiFi()} *
  • A single call, {@link #runOnboarding(OnboardingConfiguration)}, for start * the flow of onboarding process *
  • A single call ,{@link #runOffboarding(OffboardingConfiguration)}, for * starting the flow of offboarding process *
* *

* The onboarding flow works as follows: *

* The SDK uses a state machine handled by Andorid's handler * {@link #stateHandler} using the {@link #onHandleCommandMessage} function to * handle state changes. *

    *
  • IDLE state moves to CONNECTING_TO_ONBOARDEE when starting the onboarding * process *
  • CONNECTING_TO_ONBOARDEE state moves to WAITING_FOR_ONBOARDEE_ANNOUNCEMENT * after Wi-Fi connection has been established with onboardee device. *
  • WAITING_FOR_ONBOARDEE_ANNOUNCEMENT state moves to state * ONBOARDEE_ANNOUNCEMENT_RECEIVED after a valid announce message has been * received. *
  • ONBOARDEE_ANNOUNCEMENT_RECEIVED state moves to CONFIGURING_ONBOARDEE if * the onboardee supports onboarding service. *
  • CONFIGURING_ONBOARDEE state moves to CONNECTING_TO_TARGET_WIFI_AP if * passing the target credentials to the onboardee was successful. *
  • CONFIGURING_ONBOARDEE_WAITING_FOR_SIGNAL_TIMEOUT state moves to * CONNECTING_TO_TARGET_WIFI_AP if passing the target credentials to the * onboardee was successful. *
  • CONNECTING_TO_TARGET_WIFI_AP moves to WAITING_FOR_TARGET_ANNOUNCE after * Wi-Fi connection has been established with target . *
  • WAITING_FOR_TARGET_ANNOUNCE moves to TARGET_ANNOUNCEMENT_RECEIVED after * after a valid announce message has been received. *
* *

* The SDK receives events from external resources *

    *
  • OnboardingSDKWifiManager {@link #onboardingClient} that broadcasts Wi-Fi * success and failure to connect to a desired Wi-Fi device. *
  • onAnnouncement callback which handles AllJoyn AboutService announcements. *
* *

* The SDK uses intents to report status changes and errors during * onboarding/offboarding process. *

    *
  • {@link #STATE_CHANGE_ACTION} action with extra *
      *
    • {@link #EXTRA_ONBOARDING_STATE} extra information of enum * {@link OnboardingState} *
    *
  • {@link #ERROR} action with extra *
      *
    • {@link #EXTRA_ERROR_DETAILS} extra information of enum * {@link OnboardingErrorType} *
    *
* *

* View sample code for SDK usage */ public class OnboardingManager implements AboutListener { /** * Activity Action:WIFI has been connected */ static final String WIFI_CONNECTED_BY_REQUEST_ACTION = "org.alljoyn.onboardingsdk.wifi.connection_by_request"; /** * Activity Action:WIFI connection has timed out */ static final String WIFI_TIMEOUT_ACTION = "org.alljoyn.onboardingsdk.wifi.time_out"; /** * Activity Action:WIFI authentication has occurred */ static final String WIFI_AUTHENTICATION_ERROR = "org.alljoyn.onboardingsdk.wifi.authentication_error"; /** * The lookup key for WifiConfiguration details after connection request. */ static final String EXTRA_WIFI_WIFICONFIGURATION = "org.alljoyn.intent_keys.WifiConfiguration"; /** * The lookup key for list of onboardee access points */ public static final String EXTRA_ONBOARDEES_AP = "org.alljoyn.onboardingsdk.intent_keys.onboardeesAP"; /** * The lookup key for list of target access points */ public static final String EXTRA_TARGETS_AP = "org.alljoyn.onboardingsdk.intent_keys.targetsAP"; /** * The lookup key for list of all access points */ public static final String EXTRA_ALL_AP = "org.alljoyn.onboardingsdk.intent_keys.allAP"; /** * The lookup key for Onboarding state reported by the SDK */ public static final String EXTRA_ONBOARDING_STATE = "org.alljoyn.onboardingsdk.intent_keys.onboardingState"; /** * The lookup key for ERROR details reported by the SDK */ public static final String EXTRA_ERROR_DETAILS = "org.alljoyn.onboardingsdk.intent_keys.error"; /** * The lookup key for EXTRA_DEVICE_BUS_NAME reported by the SDK ,used to * report device service name during call * {@link #offboardDevice(String, short)} */ public static final String EXTRA_DEVICE_BUS_NAME = "org.alljoyn.onboardingsdk.intent_keys.device_bus_name"; /** * The lookup key for EXTRA_DEVICE_ONBOARDEE_SSID reported by the SDK after * successful onboarding process ,reports the onboardee ssid name */ public static final String EXTRA_DEVICE_ONBOARDEE_SSID = "org.alljoyn.onboardingsdk.intent_keys.device_onboardee_ssid"; /** * The lookup key for EXTRA_DEVICE_TARGET_SSID reported by the SDK after * successful onboarding process ,reports the target ssid name */ public static final String EXTRA_DEVICE_TARGET_SSID = "org.alljoyn.onboardingsdk.intent_keys.device_target_ssid"; /** * The lookup key for EXTRA_DEVICE_APPID reported by the SDK after * successful onboarding process ,reports the application id */ public static final String EXTRA_DEVICE_APPID = "org.alljoyn.onboardingsdk.intent_keys.device_appid"; /** * The lookup key for EXTRA_DEVICE_DEVICEID reported by the SDK after * successful onboarding process ,reports the device id */ public static final String EXTRA_DEVICE_DEVICEID = "org.alljoyn.onboardingsdk.intent_keys.device_deviceid"; /** * Activity Action: indicates that the WIFI scan has been completed */ public static final String WIFI_SCAN_RESULTS_AVAILABLE_ACTION = "org.alljoyn.onboardingsdk.scan_result_available"; /** * Activity Action: indicates state changes in the SDK */ public static final String STATE_CHANGE_ACTION = "org.alljoyn.onboardingsdk.state_change"; /** * Activity Action: indicates error encountered by the SDK */ public static final String ERROR = "org.alljoyn.onboardingsdk.error"; /** * These enumeration values are used to indicate possible errors * * see also {@link #EXTRA_ERROR_DETAILS} */ public static enum OnboardingErrorType { /** * Wi-Fi is disabled. */ WIFI_DISABLED(0), /** * Onboardee Wi-Fi authentication error. */ ONBOARDEE_WIFI_AUTH(10), /** * Target Wi-Fi authentication error. */ TARGET_WIFI_AUTH(11), /** * Onboardee Wi-Fi connection timeout. */ ONBOARDEE_WIFI_TIMEOUT(12), /** * Target Wi-Fi connection timeout. */ TARGET_WIFI_TIMEOUT(13), /** * Timeout while searching for onboardee. */ FIND_ONBOARDEE_TIMEOUT(14), /** * Error while establishing AllJoyn session. */ JOIN_SESSION_ERROR(15), /** * Timeout while establishing AllJoyn session. */ JOIN_SESSION_TIMEOUT(16), /** * Error while configuring onboardee with target credentials. */ ERROR_CONFIGURING_ONBOARDEE(17), /** * Timeout while waiting for signal in two state configuring. */ CONFIGURING_ONBOARDEE_WAITING_FOR_SIGNAL_TIMEOUT(18), /** * Timeout while waiting to receive announcement from onboardee on * target network. */ VERIFICATION_TIMEOUT(19), /** * Failed ot offboard a device from target. */ OFFBOARDING_FAILED(20), /** * Announce data is inavalid. */ INVALID_ANNOUNCE_DATA(21), /** * Wi-Fi connection timeout * {@link OnboardingManager#connectToNetwork(WiFiNetworkConfiguration, long)} */ OTHER_WIFI_TIMEOUT(30), /** * Wi-Fi authentication error * {@link OnboardingManager#connectToNetwork(WiFiNetworkConfiguration, long)} */ OTHER_WIFI_AUTH(31), /** * Wi-Fi connection timeout {@link OnboardingManager#abortOnboarding()} */ ORIGINAL_WIFI_TIMEOUT(32), /** * Wi-Fi authentication error * {@link OnboardingManager#abortOnboarding()} */ ORIGINAL_WIFI_AUTH(33), /** * SDK internal error */ INTERNAL_ERROR(40); private int value; private OnboardingErrorType(int value) { this.value = value; } public int getValue() { return value; } public static OnboardingErrorType getOnboardingErrorTypeByValue(int value) { OnboardingErrorType retType = null; for (OnboardingErrorType type : OnboardingErrorType.values()) { if (value == type.getValue()) { retType = type; break; } } return retType; } public static OnboardingErrorType getOnboardingErrorTypeByString(String str) { OnboardingErrorType retType = null; for (OnboardingErrorType type : OnboardingErrorType.values()) { if (type.name().equals(str)) { retType = type; } } return retType; } @Override public String toString() { return this.name(); } }; /** * These enumeration values are used to indicate the current onboarding * state * * see also {@link #EXTRA_ONBOARDING_STATE} {@link #STATE_CHANGE_ACTION} */ public static enum OnboardingState { /** * Connecting to onboardee Wi-Fi */ CONNECTING_ONBOARDEE_WIFI(0), /** * Connected to onboardee Wi-Fi */ CONNECTED_ONBOARDEE_WIFI(1), /** * Waiting for announcement from onboardee */ FINDING_ONBOARDEE(2), /** * Announcement received from onboardee */ FOUND_ONBOARDEE(3), /** * Creating AllJoyn session with onboardee */ JOINING_SESSION(4), /** * AllJoyn session established with onboardee */ SESSION_JOINED(5), /** * Sending target credentials to onboardee */ CONFIGURING_ONBOARDEE(6), /** * Waiting for signal from onboardee with two stage configuring */ CONFIGURING_ONBOARDEE_WITH_SIGNAL(7), /** * Onboardee received target credentials */ CONFIGURED_ONBOARDEE(8), /** * Connecting to WIFI target */ CONNECTING_TARGET_WIFI(9), /** * Wi-Fi connection with target established */ CONNECTED_TARGET_WIFI(10), /** * Wait for announcement from onboardee over target WIFI */ VERIFYING_ONBOARDED(11), /** * Announcement from onboardee over target WIFI has been received */ VERIFIED_ONBOARDED(12), /** * Connecting to the original network before calling * {@link OnboardingManager#runOnboarding(OnboardingConfiguration)}. */ CONNECTING_ORIGINAL_WIFI(13), /** * Connected to the original network before calling * {@link OnboardingManager#runOnboarding(OnboardingConfiguration)}. */ CONNECTED_ORIGINAL_WIFI(14), /** * Connecting to the selected network * {@link OnboardingManager#connectToNetwork(WiFiNetworkConfiguration, long)} * . */ CONNECTING_OTHER_WIFI(15), /** * Connected to the selected network * {@link OnboardingManager#connectToNetwork(WiFiNetworkConfiguration, long)} * . */ CONNECTED_OTHER_WIFI(16), /** * Aborting has been started. */ ABORTING(20), /** * Aborting has been completed. */ ABORTED(21); private int value; private OnboardingState(int value) { this.value = value; } public int getValue() { return value; } public static OnboardingState getOnboardingStateByValue(int value) { OnboardingState retType = null; for (OnboardingState type : OnboardingState.values()) { if (value == type.getValue()) { retType = type; break; } } return retType; } public static OnboardingState getOnboardingStateByString(String str) { OnboardingState retType = null; for (OnboardingState type : OnboardingState.values()) { if (type.name().equals(str)) { retType = type; break; } } return retType; } @Override public String toString() { return this.name(); } } /** * These enumeration values are used to filter Wi-Fi scan result * {@link OnboardingManager#scanWiFi()} */ public static enum WifiFilter { /** * Wi-Fi access point name that contains the following prefix * {@link OnboardingSDKWifiManager#ONBOARDABLE_PREFIX} or suffix * {@link OnboardingSDKWifiManager#ONBOARDABLE_SUFFIX} */ ONBOARDABLE, /** * Wi-Fi access point name that doesn't contain the following prefix * {@link OnboardingSDKWifiManager#ONBOARDABLE_PREFIX} or suffix * {@link OnboardingSDKWifiManager#ONBOARDABLE_SUFFIX} */ TARGET, /** * Wi-Fi access point name . */ ALL } /** * DeviceResponse is a class used internally to encapsulate possible errors * that may occur during AllJoyn transactions carried by the SDK */ static class DeviceResponse { /** * enumeration of possible ResponseCodes */ public enum ResponseCode { /** * AllJoyn transaction successful */ Status_OK, /** * AllJoyn transaction general error */ Status_ERROR, /** * AllJoyn session creation error */ Status_ERROR_CANT_ESTABLISH_SESSION, /** * AllJoyn transaction successful */ Status_OK_CONNECT_SECOND_PHASE, } /** * holds the response code. */ private final ResponseCode status; /** * holds the description of the error. */ private String description = null; /** * DeviceResponse Constructor * * @param status * {@link #status} * */ public DeviceResponse(ResponseCode status) { this.status = status; } /** * DeviceResponse Constructor * * @param status * {@link #status} * @param description * {@link #description} * */ public DeviceResponse(ResponseCode status, String description) { this.status = status; this.description = description; } /** * Get {@link #status} * * @return the status code {@link #status} */ public ResponseCode getStatus() { return status; } /** * Get {@link #description} * * @return the error description {@link #description} */ public String getDescription() { return description; } } /** * TAG for debug information */ private final static String TAG = "OnboardingManager"; /** * Default timeout for Wi-Fi connection * {@value #DEFAULT_WIFI_CONNECTION_TIMEOUT} msec */ public static final int DEFAULT_WIFI_CONNECTION_TIMEOUT = 20000; /** * Default timeout for waiting for * {@link AboutObj#announce(short, org.alljoyn.bus.AboutDataListener)} * {@value #DEFAULT_ANNOUNCEMENT_TIMEOUT} msec */ public static final int DEFAULT_ANNOUNCEMENT_TIMEOUT = 25000; /** * OnboardingManager singleton */ private static volatile OnboardingManager onboardingManager = null; /** * Application context */ private Context context = null; /** * HandlerThread for the state machine looper */ private static HandlerThread stateHandlerThread; /** * Handler for OnboardingManager state changing messages. */ private static Handler stateHandler = null; /** * Stores the OnboardingsdkWifiManager object */ private OnboardingSDKWifiManager onboardingSDKWifiManager = null; /** * Stores the OnboardingConfiguration object */ private OnboardingConfiguration onboardingConfiguration = null; /** * IntentFilter used to filter out intents of WIFI messages received from * OnboardingsdkWifiManager */ private final IntentFilter wifiIntentFilter = new IntentFilter(); /** * BroadcastReceiver for intents from OnboardingSDKWifiManager while running * the onboarding process. */ private BroadcastReceiver onboardingWifiBroadcastReceiver = null; /** * BroadcastReceiver for intents from OnboardingsdkWifiManager while running * {@link #connectToNetwork(WiFiNetworkConfiguration, long)} */ private BroadcastReceiver connectToNetworkWifiBroadcastReceiver = null; /** * Stores the OnboardingClient object used to communicate with * OnboardingService. */ private OnboardingClient onboardingClient = null; /** * Stores the BusAttachment needed for accessing Alljoyn framework. */ private BusAttachment bus = null; /** * Timer used for managing announcement timeout */ private Timer announcementTimeout = new Timer(); /** * Indicates a special case when {@link #abortOnboarding()} is in state * {@link State#JOINING_SESSION} */ private final int ABORTING_INTERRUPT_FLAG = 0x100; /** * Indicator flag to listen to incoming Announcements */ private static volatile boolean listenToAnnouncementsFlag; /** * Stores the OnboardingManager state machine state */ private State currentState = State.IDLE; /** * Stores the original network name before starting onboarding process. */ private String originalNetwork; /** * Handles About Service announcements */ @Override public void announced(final String serviceName, final int version, final short port, final AboutObjectDescription[] objectDescriptions, final Map serviceMetadata) { synchronized (TAG) { if (!listenToAnnouncementsFlag) { Log.w(TAG, "AnnouncementHandler not in listeneing mode"); return; } } Log.d(TAG, "onAnnouncement: received state " + currentState.toString()); Map announceDataMap = null; try { announceDataMap = TransportUtil.fromVariantMap(serviceMetadata); if (announceDataMap == null) { // ignoring error. will be handled by announcement timeout Log.e(TAG, "onAnnouncement: invalid announcement"); return; } } catch (BusException e) { // ignoring error. will be handled by announcement timeout Log.e(TAG, "onAnnouncement: invalid announcement", e); return; } UUID uniqueId = (UUID) announceDataMap.get(AboutKeys.ABOUT_APP_ID); if (uniqueId == null) { Log.e(TAG, "onAnnouncement: received null device uuid!! ignoring."); return; } else { Log.d(TAG, "onAnnouncement: UUID=" + uniqueId + ", busName=" + serviceName + ", port=" + port); } switch (currentState) { case CONNECTING_TO_ONBOARDEE: context.unregisterReceiver(onboardingWifiBroadcastReceiver); // no need for break case WAITING_FOR_ONBOARDEE_ANNOUNCEMENT: if (isSeviceSupported(objectDescriptions, OnboardingTransport.INTERFACE_NAME)) { setState(State.ONBOARDEE_ANNOUNCEMENT_RECEIVED, new AnnounceData(serviceName, port, objectDescriptions, serviceMetadata)); } else { Log.e(TAG, "onAnnouncement: for device UUID " + deviceData.getAppUUID() + " doesn't support onboarding interface"); } break; case ERROR_WAITING_FOR_ONBOARDEE_ANNOUNCEMENT: if (isSeviceSupported(objectDescriptions, OnboardingTransport.INTERFACE_NAME)) { setState(State.ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT, new AnnounceData(serviceName, port, objectDescriptions, serviceMetadata)); } else { Log.e(TAG, "onAnnouncement: for device UUID " + deviceData.getAppUUID() + " doesn't support onboarding interface"); } break; case CONNECTING_TO_TARGET_WIFI_AP: context.unregisterReceiver(onboardingWifiBroadcastReceiver); // no need for break case WAITING_FOR_TARGET_ANNOUNCE: if (deviceData != null && deviceData.getAnnounceData() != null && deviceData.getAppUUID() != null) { if (deviceData.getAppUUID().compareTo(uniqueId) == 0) { setState(State.TARGET_ANNOUNCEMENT_RECEIVED, new AnnounceData(serviceName, port, objectDescriptions, serviceMetadata)); } } break; case ERROR_WAITING_FOR_TARGET_ANNOUNCE: if (isSeviceSupported(objectDescriptions, OnboardingTransport.INTERFACE_NAME)) { setState(State.ERROR_TARGET_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT, new AnnounceData(serviceName, port, objectDescriptions, serviceMetadata)); } else { Log.e(TAG, "onAnnouncement: for device UUID " + deviceData.getAppUUID() + " doesn't support onboarding interface"); } break; default: break; } } /** * Stores information about the device to be onboarded */ private DeviceData deviceData = null; /** * Internal class that stores information about the device to be onboarded * AnnounceData,appUUID */ private static class DeviceData { public AnnounceData getAnnounceData() { return announceData; } public void setAnnounceData(AnnounceData announceData) throws BusException { this.announceData = announceData; Map announceDataMap = TransportUtil.fromVariantMap(announceData.getServiceMetadata()); appUUID = (UUID) announceDataMap.get(AboutKeys.ABOUT_APP_ID); deviceID = (String) announceDataMap.get(AboutKeys.ABOUT_DEVICE_ID); } private AnnounceData announceData = null; public UUID getAppUUID() { return appUUID; } public String getDeviceID() { return deviceID; } private UUID appUUID = null; private String deviceID = null; } /** * An internal class to store the Announcement received by the AboutService. */ private static class AnnounceData { private final String serviceName; private final short port; private final AboutObjectDescription[] objectDescriptions; private final Map serviceMetadata; public String getServiceName() { return serviceName; } public AboutObjectDescription[] getObjectDescriptions() { return objectDescriptions; } public Map getServiceMetadata() { return serviceMetadata; } public short getPort() { return port; } public AnnounceData(String serviceName, short port, AboutObjectDescription[] objectDescriptions, Map serviceMetadata) { this.serviceName = serviceName; this.port = port; this.objectDescriptions = objectDescriptions; this.serviceMetadata = serviceMetadata; } } /** * These enumeration values are used to indicate the current internal state * of the OnboardingManager state machine. */ private static enum State { /** * Start state */ IDLE(0), /** * Connecting to onboardee device Wi-Fi */ CONNECTING_TO_ONBOARDEE(10), /** * Waiting for announcement on onboardee Wi-Fi */ WAITING_FOR_ONBOARDEE_ANNOUNCEMENT(11), /** * Announcement received on onboardee Wi-Fi */ ONBOARDEE_ANNOUNCEMENT_RECEIVED(12), /** * Join session with onboardee */ JOINING_SESSION(13), /** * Configuring onboardee with target credentials */ CONFIGURING_ONBOARDEE(14), /** * Configuring onboardee with target credentials */ CONFIGURING_ONBOARDEE_WITH_SIGNAL(15), /** * Connecting to target Wi-Fi AP */ CONNECTING_TO_TARGET_WIFI_AP(20), /** * Waiting for announcement on target Wi-Fi from onboardee */ WAITING_FOR_TARGET_ANNOUNCE(21), /** * Announcement received on target Wi-Fi from onboardee */ TARGET_ANNOUNCEMENT_RECEIVED(22), /** * Aborting state ,temporary state used to Abort the onboarding process. */ ABORTING(30), /** * Error connecting to onboardee device Wi-Fi */ ERROR_CONNECTING_TO_ONBOARDEE(110), /** * Error waiting for announcement on onboardee Wi-Fi */ ERROR_WAITING_FOR_ONBOARDEE_ANNOUNCEMENT(111), /** * Error annnouncemnet has been received from onboardee after timeout * expired */ ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT(112), /** * Error announcement received on onboardee Wi-Fi */ ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED(113), /** * Error joining AllJoyn session */ ERROR_JOINING_SESSION(114), /** * Error configuring onboardee with target credentials */ ERROR_CONFIGURING_ONBOARDEE(115), /** * Error waiting for configure onboardee signal */ ERROR_WAITING_FOR_CONFIGURE_SIGNAL(116), /** * Error connecting to target Wi-Fi AP */ ERROR_CONNECTING_TO_TARGET_WIFI_AP(120), /** * Error waiting for announcement on target Wi-Fi from onboardee */ ERROR_WAITING_FOR_TARGET_ANNOUNCE(121), /** * Error annnouncemnet has been received from target after timeout * expired */ ERROR_TARGET_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT(122); private int value; private State(int value) { this.value = value; } public int getValue() { return value; } public static State getStateByValue(int value) { State retType = null; for (State type : State.values()) { if (value == type.getValue()) { retType = type; break; } } return retType; } } /** * @return instance of the OnboardingManager */ public static OnboardingManager getInstance() { if (onboardingManager == null) { synchronized (TAG) { if (onboardingManager == null) { onboardingManager = new OnboardingManager(); } } } return onboardingManager; } private OnboardingManager() { wifiIntentFilter.addAction(WIFI_CONNECTED_BY_REQUEST_ACTION); wifiIntentFilter.addAction(WIFI_TIMEOUT_ACTION); wifiIntentFilter.addAction(WIFI_AUTHENTICATION_ERROR); stateHandlerThread = new HandlerThread("OnboardingManagerLooper"); stateHandlerThread.start(); stateHandler = new Handler(stateHandlerThread.getLooper()) { @Override public void handleMessage(Message msg) { onHandleCommandMessage(msg); } }; } /** * Initialize the SDK singleton with the current application configuration. * Registers AnnouncementHandler to receive announcements * * @param context * The application context. * @param aboutService * The user application's About service. * @param bus * The user application's bus attachment. * @throws OnboardingIllegalArgumentException * if either of the parameters is null. * @throws OnboardingIllegalStateException * if already initialized. */ public void init(Context context, BusAttachment bus) throws OnboardingIllegalArgumentException, OnboardingIllegalStateException { synchronized (TAG) { if (context == null || bus == null) { throw new OnboardingIllegalArgumentException(); } if (this.context != null || this.bus != null) { throw new OnboardingIllegalStateException(); } synchronized (TAG) { listenToAnnouncementsFlag = false; } this.bus = bus; this.bus.registerAboutListener(this); this.bus.whoImplements(new String[] { OnboardingTransport.INTERFACE_NAME }); this.context = context; this.onboardingSDKWifiManager = new OnboardingSDKWifiManager(this.context); } } /** * Terminate the SDK . * * @throws OnboardingIllegalStateException * if not in IDLE state ,need to abort first. */ public void shutDown() throws OnboardingIllegalStateException { synchronized (TAG) { if (currentState == State.IDLE) { this.context = null; this.bus.cancelWhoImplements(new String[] { OnboardingTransport.INTERFACE_NAME }); this.bus.unregisterAboutListener(this); this.bus = null; this.onboardingSDKWifiManager = null; } else { throw new OnboardingIllegalStateException("Not in IDLE state ,please Abort first"); } } } /** * Handle the CONNECT_TO_ONBOARDEE state. Listen to WIFI intents from * OnboardingsdkWifiManager. Requests from OnboardingsdkWifiManager to * connect to the Onboardee. If successful moves to the next state otherwise * sends an error intent and returns to IDLE state. */ private void handleConnectToOnboardeeState() { final Bundle extras = new Bundle(); onboardingWifiBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); Log.d(TAG, "handleConnectToOnboardeeState onReceive action=" + action); if (action == null) { return; } if (WIFI_CONNECTED_BY_REQUEST_ACTION.equals(action)) { context.unregisterReceiver(onboardingWifiBroadcastReceiver); extras.clear(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONNECTED_ONBOARDEE_WIFI.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); setState(State.WAITING_FOR_ONBOARDEE_ANNOUNCEMENT); } if (WIFI_TIMEOUT_ACTION.equals(action)) { context.unregisterReceiver(onboardingWifiBroadcastReceiver); extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.ONBOARDEE_WIFI_TIMEOUT.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_CONNECTING_TO_ONBOARDEE); } if (WIFI_AUTHENTICATION_ERROR.equals(action)) { extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.ONBOARDEE_WIFI_AUTH.toString()); sendBroadcast(ERROR, extras); context.unregisterReceiver(onboardingWifiBroadcastReceiver); setState(State.ERROR_CONNECTING_TO_ONBOARDEE); } } }; context.registerReceiver(onboardingWifiBroadcastReceiver, wifiIntentFilter); extras.clear(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONNECTING_ONBOARDEE_WIFI.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); onboardingSDKWifiManager.connectToWifiAP(onboardingConfiguration.getOnboardee().getSSID(), onboardingConfiguration.getOnboardee().getAuthType(), onboardingConfiguration.getOnboardee() .getPassword(), onboardingConfiguration.getOnboardee().isHidden(), onboardingConfiguration.getOnboardeeConnectionTimeout()); } /** * Handle the WAIT_FOR_ONBOARDEE_ANNOUNCE state. Set a timer using * {@link #startAnnouncementTimeout()} Wait for an announcement which should * arrive from the onAnnouncement handler. */ private void handleWaitForOnboardeeAnnounceState() { Bundle extras = new Bundle(); extras.clear(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.FINDING_ONBOARDEE.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); if (!startAnnouncementTimeout()) { extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.INTERNAL_ERROR.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_WAITING_FOR_ONBOARDEE_ANNOUNCEMENT); } } /** * Handle the ERROR_TARGETR_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT state. * Verifies that Announcement is valid if so stay on * ERROR_TARGER_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT state ,otherwise moves * to state ERROR_WAITING_FOR_TARGET_ANNOUNCE. This state is only for * continuing from state ERROR_WAITING_FOR_TARGET_ANNOUNCEMENT if the * Announcement has been received while the timer has expired. * * @param announceData * contains the information of the Announcement . */ private void handleErrorTargetAnnouncementReceivedAfterTimeoutState(AnnounceData announceData) { deviceData = new DeviceData(); try { Log.d(TAG, "handleErrorTargetAnnouncementReceivedAfterTimeoutState" + announceData.getServiceName() + " " + announceData.getPort()); deviceData.setAnnounceData(announceData); } catch (BusException e) { Log.e(TAG, "handleErrorTargetAnnouncementReceivedAfterTimeoutState DeviceData.setAnnounceObject failed with BusException. ", e); Bundle extras = new Bundle(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.INVALID_ANNOUNCE_DATA.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_WAITING_FOR_TARGET_ANNOUNCE); } } /** * Handle the ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT state. * Verifies that Announcement is valid if so stay on * ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT state ,otherwise * moves to state ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED. This state is only * for continuing from state ERROR_WAITING_FOR_ONBOARDEE_ANNOUNCEMENT if the * Announcement has been received while the timer has expired. * * @param announceData * contains the information of the Announcement . */ private void handleErrorOnboardeeAnnouncementReceivedAfterTimeoutState(AnnounceData announceData) { Bundle extras = new Bundle(); extras.clear(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.FOUND_ONBOARDEE.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); deviceData = new DeviceData(); try { deviceData.setAnnounceData(announceData); } catch (BusException e) { Log.e(TAG, "handleOnboardeeAnnouncementReceivedState DeviceData.setAnnounceObject failed with BusException. ", e); extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.INVALID_ANNOUNCE_DATA.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED); } } /** * Handle the ONBOARDEE_ANNOUNCEMENT_RECEIVED state. Stop the announcement * timeout timer, Verifies that Announcement is valid if so moves to state * JOINING_SESSION,otherwise moves to state * ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED * * @param announceData * contains the information of the Announcement . */ private void handleOnboardeeAnnouncementReceivedState(AnnounceData announceData) { stopAnnouncementTimeout(); Bundle extras = new Bundle(); extras.clear(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.FOUND_ONBOARDEE.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); deviceData = new DeviceData(); try { deviceData.setAnnounceData(announceData); setState(State.JOINING_SESSION, announceData); } catch (BusException e) { Log.e(TAG, "handleOnboardeeAnnouncementReceivedState DeviceData.setAnnounceObject failed with BusException. ", e); extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.INVALID_ANNOUNCE_DATA.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED); } } /** * Handle the JOINING_SESSION state. Handle AllJoyn session establishment * with the device. * * @param announceData * contains the information of the announcement */ private void handleJoiningSessionState(AnnounceData announceData) { Bundle extras = new Bundle(); extras.clear(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.JOINING_SESSION.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); ResponseCode response = establishSessionWithDevice(announceData).getStatus(); if (response == ResponseCode.Status_OK) { extras.clear(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.SESSION_JOINED.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); setState(State.CONFIGURING_ONBOARDEE); } else { extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.JOIN_SESSION_ERROR.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_JOINING_SESSION); } } /** * Handle the CONFIGURE_ONBOARDEE state. Call onboardDevice to send target * information to the board. in case successful moves to next step else move * to ERROR_CONFIGURING_ONBOARDEE state. */ private void handleConfigureOnboardeeState() { Bundle extras = new Bundle(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONFIGURING_ONBOARDEE.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); ResponseCode responseCode = onboardDevice().getStatus(); if (responseCode == ResponseCode.Status_OK) { extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONFIGURED_ONBOARDEE.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); setState(State.CONNECTING_TO_TARGET_WIFI_AP); } else if (responseCode == ResponseCode.Status_OK_CONNECT_SECOND_PHASE) { extras.clear(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONFIGURING_ONBOARDEE_WITH_SIGNAL.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); setState(State.CONFIGURING_ONBOARDEE_WITH_SIGNAL); } else { extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.ERROR_CONFIGURING_ONBOARDEE.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_CONFIGURING_ONBOARDEE); } } /** * Handle the CONFIGURING_ONBOARDEE_WITH_SIGNAL state. Register to receive * oboarding siganl , start timeout if signal arrives in time call * {@link OnboardingClient#connectWiFi()} otherwise move to * ERROR_WAITING_FOR_CONFIGURE_SIGNAL state . */ private void handleConfigureWithSignalOnboardeeState() { final Bundle extras = new Bundle(); final Timer configWifiSignalTimeout = new Timer(); final ConnectionResultListener listener = new ConnectionResultListener() { @Override public void onConnectionResult(ConnectionResult connectionResult) { Log.d(TAG, "onConnectionResult recevied " + connectionResult.getConnectionResponseType() + " " + connectionResult.getMessage()); configWifiSignalTimeout.cancel(); configWifiSignalTimeout.purge(); try { onboardingClient.unRegisterConnectionResultListener(this); if (connectionResult.getConnectionResponseType() == ConnectionResult.ConnectionResponseType.VALIDATED) { onboardingClient.connectWiFi(); extras.clear(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONFIGURED_ONBOARDEE.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); setState(State.CONNECTING_TO_TARGET_WIFI_AP); } else { extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.ERROR_CONFIGURING_ONBOARDEE.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_CONFIGURING_ONBOARDEE); return; } } catch (Exception e) { Log.e(TAG, "onConnectionResult error", e); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.ERROR_CONFIGURING_ONBOARDEE.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_CONFIGURING_ONBOARDEE); } } }; try { configWifiSignalTimeout.schedule(new TimerTask() { @Override public void run() { Log.e(TAG, "configWifiSignalTimeout expired"); onboardingClient.unRegisterConnectionResultListener(listener); configWifiSignalTimeout.cancel(); configWifiSignalTimeout.purge(); onboardingClient.unRegisterConnectionResultListener(listener); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.CONFIGURING_ONBOARDEE_WAITING_FOR_SIGNAL_TIMEOUT.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_WAITING_FOR_CONFIGURE_SIGNAL); } }, 30 * 1000); onboardingClient.registerConnectionResultListener(listener); } catch (Exception e) { Log.e(TAG, "registerConnectionResultListener", e); configWifiSignalTimeout.cancel(); configWifiSignalTimeout.purge(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.ERROR_CONFIGURING_ONBOARDEE.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_CONFIGURING_ONBOARDEE); // send error } } /** * Handle the CONNECT_TO_TARGET state. Listen to WIFI intents from * OnboardingsdkWifiManager Requests from OnboardingsdkWifiManager to * connect to the Target. if successful moves to the next state otherwise * send error intent and returns to IDLE state. */ private void handleConnectToTargetState() { final Bundle extras = new Bundle(); onboardingWifiBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); Log.d(TAG, "onReceive action=" + action); if (action != null) { if (WIFI_CONNECTED_BY_REQUEST_ACTION.equals(action)) { context.unregisterReceiver(onboardingWifiBroadcastReceiver); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONNECTED_TARGET_WIFI.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); setState(State.WAITING_FOR_TARGET_ANNOUNCE); } if (WIFI_TIMEOUT_ACTION.equals(action)) { context.unregisterReceiver(onboardingWifiBroadcastReceiver); extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.TARGET_WIFI_TIMEOUT.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_CONNECTING_TO_TARGET_WIFI_AP); } if (WIFI_AUTHENTICATION_ERROR.equals(action)) { context.unregisterReceiver(onboardingWifiBroadcastReceiver); extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.TARGET_WIFI_AUTH.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_CONNECTING_TO_TARGET_WIFI_AP); } } } };// receiver context.registerReceiver(onboardingWifiBroadcastReceiver, wifiIntentFilter); extras.clear(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONNECTING_TARGET_WIFI.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); onboardingSDKWifiManager.connectToWifiAP(onboardingConfiguration.getTarget().getSSID(), onboardingConfiguration.getTarget().getAuthType(), onboardingConfiguration.getTarget().getPassword(), onboardingConfiguration.getTarget().isHidden(), onboardingConfiguration.getTargetConnectionTimeout()); } /** * Handle the WAIT_FOR_TARGET_ANNOUNCE state. Set a timer with using * startAnnouncementTimeout. waits for an announcement which should arrive * from the onAnnouncement handler. */ private void handleWaitForTargetAnnounceState() { Bundle extras = new Bundle(); extras.clear(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.VERIFYING_ONBOARDED.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); if (!startAnnouncementTimeout()) { extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.INTERNAL_ERROR.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_WAITING_FOR_TARGET_ANNOUNCE); } } /** * Handls the TARGET_ANNOUNCEMENT_RECEIVED state. *

    *
  • Call {@link #stopAnnouncementTimeout()} *
  • Send a success broadcast. *
  • Move state machine to IDLE state (onboarding process finished) *
  • Enable all Wi-Fi access points that were disabled in the onboarding * process. *
* * @param announceData * contains the information of the announcement . */ private void handleTargetAnnouncementReceivedState(AnnounceData announceData) { stopAnnouncementTimeout(); Bundle extras = new Bundle(); extras.putString(EXTRA_DEVICE_ONBOARDEE_SSID, onboardingConfiguration.getOnboardee().getSSID()); extras.putString(EXTRA_DEVICE_TARGET_SSID, onboardingConfiguration.getTarget().getSSID()); deviceData = new DeviceData(); try { deviceData.setAnnounceData(announceData); extras.putSerializable(EXTRA_DEVICE_APPID, deviceData.getAppUUID()); extras.putString(EXTRA_DEVICE_DEVICEID, deviceData.getDeviceID()); } catch (BusException e) { Log.e(TAG, "handleTargetAnnouncementReceivedState unable to retrieve AppID/DeviceID ", e); } extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.VERIFIED_ONBOARDED.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); synchronized (TAG) { listenToAnnouncementsFlag = false; } setState(State.IDLE); onboardingSDKWifiManager.enableAllWifiNetworks(); } /** * Handle the the ABORTING state. Due to the implementation of the state * machine via hander. Messages are received into the handler's queue ,and * are handled serially , when ABORTING message is received * handleAbortingState deletes all messages in the handlers queue .In case * there are any messages there . Due to the blocking nature of * JOINING_SESSION state the ABORTING message can be handled only after it * has completed!. */ private void handleAbortingState() { // store current State in initalState State initalState = currentState; // set state to State.ABORTING currentState = State.ABORTING; // in case State.JOINING_SESSION push ABORTING_INTERRUPT_FLAG into the // stateHandler queue. if (initalState == State.JOINING_SESSION) { stateHandler.sendMessageDelayed(stateHandler.obtainMessage(ABORTING_INTERRUPT_FLAG), 60 * 60 * 10000); return; } // remove all queued up messages in the stateHandler for (State s : State.values()) { stateHandler.removeMessages(s.value); } // note ABORTING state can't be handled during JOINING_SESSION it is // blocking! switch (initalState) { case CONNECTING_TO_ONBOARDEE: context.unregisterReceiver(onboardingWifiBroadcastReceiver); abortStateCleanUp(); break; case WAITING_FOR_ONBOARDEE_ANNOUNCEMENT: stopAnnouncementTimeout(); abortStateCleanUp(); break; case ONBOARDEE_ANNOUNCEMENT_RECEIVED: abortStateCleanUp(); break; case CONFIGURING_ONBOARDEE: case CONFIGURING_ONBOARDEE_WITH_SIGNAL: abortStateCleanUp(); break; case ERROR_CONNECTING_TO_ONBOARDEE: case ERROR_WAITING_FOR_ONBOARDEE_ANNOUNCEMENT: case ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT: case ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED: case ERROR_JOINING_SESSION: case ERROR_CONFIGURING_ONBOARDEE: case ERROR_WAITING_FOR_CONFIGURE_SIGNAL: case ERROR_CONNECTING_TO_TARGET_WIFI_AP: abortStateCleanUp(); break; case WAITING_FOR_TARGET_ANNOUNCE: stopAnnouncementTimeout(); // no need for break case ERROR_TARGET_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT: // no need for break case ERROR_WAITING_FOR_TARGET_ANNOUNCE: Bundle extras = new Bundle(); onboardingSDKWifiManager.enableAllWifiNetworks(); synchronized (TAG) { listenToAnnouncementsFlag = false; } setState(State.IDLE); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.ABORTED.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); break; default: break; } } /** * Handle the state machine transition. * * @param msg */ private void onHandleCommandMessage(Message msg) { if (msg == null) { return; } // in case ABORTING_INTERRUPT_FLAG has been found in the queue remove it // and call abortStateCleanUp if (stateHandler.hasMessages(ABORTING_INTERRUPT_FLAG)) { stateHandler.removeMessages(ABORTING_INTERRUPT_FLAG); abortStateCleanUp(); return; } State stateByValue = State.getStateByValue(msg.what); if (stateByValue == null) { return; } Log.d(TAG, "onHandleCommandMessage " + stateByValue); switch (stateByValue) { case IDLE: currentState = State.IDLE; break; case CONNECTING_TO_ONBOARDEE: currentState = State.CONNECTING_TO_ONBOARDEE; handleConnectToOnboardeeState(); break; case WAITING_FOR_ONBOARDEE_ANNOUNCEMENT: currentState = State.WAITING_FOR_ONBOARDEE_ANNOUNCEMENT; handleWaitForOnboardeeAnnounceState(); break; case ONBOARDEE_ANNOUNCEMENT_RECEIVED: currentState = State.ONBOARDEE_ANNOUNCEMENT_RECEIVED; handleOnboardeeAnnouncementReceivedState((AnnounceData) msg.obj); break; case JOINING_SESSION: currentState = State.JOINING_SESSION; handleJoiningSessionState((AnnounceData) msg.obj); break; case CONFIGURING_ONBOARDEE: currentState = State.CONFIGURING_ONBOARDEE; handleConfigureOnboardeeState(); break; case CONFIGURING_ONBOARDEE_WITH_SIGNAL: currentState = State.CONFIGURING_ONBOARDEE_WITH_SIGNAL; handleConfigureWithSignalOnboardeeState(); break; case CONNECTING_TO_TARGET_WIFI_AP: currentState = State.CONNECTING_TO_TARGET_WIFI_AP; handleConnectToTargetState(); break; case WAITING_FOR_TARGET_ANNOUNCE: currentState = State.WAITING_FOR_TARGET_ANNOUNCE; handleWaitForTargetAnnounceState(); break; case TARGET_ANNOUNCEMENT_RECEIVED: currentState = State.TARGET_ANNOUNCEMENT_RECEIVED; handleTargetAnnouncementReceivedState((AnnounceData) msg.obj); break; case ERROR_CONNECTING_TO_ONBOARDEE: currentState = State.ERROR_CONNECTING_TO_ONBOARDEE; break; case ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT: currentState = State.ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT; handleErrorOnboardeeAnnouncementReceivedAfterTimeoutState((AnnounceData) msg.obj); break; case ERROR_WAITING_FOR_ONBOARDEE_ANNOUNCEMENT: currentState = State.ERROR_WAITING_FOR_ONBOARDEE_ANNOUNCEMENT; break; case ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED: currentState = State.ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED; break; case ERROR_JOINING_SESSION: currentState = State.ERROR_JOINING_SESSION; break; case ERROR_CONFIGURING_ONBOARDEE: currentState = State.ERROR_CONFIGURING_ONBOARDEE; break; case ERROR_WAITING_FOR_CONFIGURE_SIGNAL: currentState = State.ERROR_WAITING_FOR_CONFIGURE_SIGNAL; break; case ERROR_CONNECTING_TO_TARGET_WIFI_AP: currentState = State.ERROR_CONNECTING_TO_TARGET_WIFI_AP; break; case ERROR_WAITING_FOR_TARGET_ANNOUNCE: currentState = State.ERROR_WAITING_FOR_TARGET_ANNOUNCE; break; case ERROR_TARGET_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT: currentState = State.ERROR_TARGET_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT; handleErrorTargetAnnouncementReceivedAfterTimeoutState((AnnounceData) msg.obj); break; case ABORTING: handleAbortingState(); break; default: break; } } /** * Move the state machine to a new state. * * @param state */ private void setState(State state) { Message msg = stateHandler.obtainMessage(state.getValue()); stateHandler.sendMessage(msg); } /** * Move the state machine to a new state. * * @param state * @param data * metadata to pass to the new state * */ private void setState(State state, Object data) { Message msg = stateHandler.obtainMessage(state.getValue()); msg.obj = data; stateHandler.sendMessage(msg); } /** * Establish an AllJoyn session with the device. * * @param announceData * the Announcement data. * @return status of operation. */ private DeviceResponse establishSessionWithDevice(final AnnounceData announceData) { try { if (announceData.serviceName == null) { return new DeviceResponse(ResponseCode.Status_ERROR, "announceData.serviceName == null"); } if (announceData.getPort() == 0) { return new DeviceResponse(ResponseCode.Status_ERROR, "announceData.getPort() == 0"); } if (onboardingClient != null) { onboardingClient.disconnect(); onboardingClient = null; } synchronized (TAG) { onboardingClient = new OnboardingClientImpl(announceData.getServiceName(), bus, new ServiceAvailabilityListener() { @Override public void connectionLost() { // expected. we are onboarding the device, hence sending // it the another network. Log.d(TAG, "establishSessionWithDevice connectionLost"); } }, announceData.getPort()); } } catch (Exception e) { Log.e(TAG, "establishSessionWithDevice Exception: ", e); return new DeviceResponse(ResponseCode.Status_ERROR); } try { ResponseCode connectToDeviceStatus = connectToDevice(onboardingClient).getStatus(); if (connectToDeviceStatus != ResponseCode.Status_OK) { return new DeviceResponse(ResponseCode.Status_ERROR_CANT_ESTABLISH_SESSION, connectToDeviceStatus.name()); } return new DeviceResponse(ResponseCode.Status_OK); } catch (Exception e) { Log.e(TAG, "establishSessionWithDevice ", e); return new DeviceResponse(ResponseCode.Status_ERROR); } } /** * Call the OnboardingService API for passing the onboarding configuration * to the device. * * @return status of operation. */ private DeviceResponse onboardDevice() { try { AuthType authType = onboardingConfiguration.getTarget().getAuthType(); boolean isPasswordHex = false; String passForConfigureNetwork = onboardingConfiguration.getTarget().getPassword(); if (authType == AuthType.WEP) { Pair wepCheckResult = OnboardingSDKWifiManager.checkWEPPassword(passForConfigureNetwork); isPasswordHex = wepCheckResult.second; } Log.d(TAG, "onBoardDevice OnboardingClient isPasswordHex " + isPasswordHex); if (!isPasswordHex) { passForConfigureNetwork = toHexadecimalString(onboardingConfiguration.getTarget().getPassword()); Log.i(TAG, "convert pass to hex: from " + onboardingConfiguration.getTarget().getPassword() + " -> to " + passForConfigureNetwork); } Log.i(TAG, "before configureWiFi networkName = " + onboardingConfiguration.getTarget().getSSID() + " networkPass = " + passForConfigureNetwork + " selectedAuthType = " + onboardingConfiguration.getTarget().getAuthType().getTypeId()); ConfigureWifiMode res = onboardingClient.configureWiFi(onboardingConfiguration.getTarget().getSSID(), passForConfigureNetwork, onboardingConfiguration.getTarget().getAuthType()); Log.i(TAG, "configureWiFi result=" + res); switch (res) { case REGULAR: onboardingClient.connectWiFi(); return new DeviceResponse(ResponseCode.Status_OK); case FAST_CHANNEL_SWITCHING: // wait for a ConnectionResult signal from the device before // calling connectWifi return new DeviceResponse(ResponseCode.Status_OK_CONNECT_SECOND_PHASE); default: Log.e(TAG, "configureWiFi returned an unexpected result: " + res); return new DeviceResponse(ResponseCode.Status_ERROR); } } catch (BusException e) { Log.e(TAG, "onboarddDevice ", e); return new DeviceResponse(ResponseCode.Status_ERROR); } catch (Exception e) { Log.e(TAG, "onboarddDevice ", e); return new DeviceResponse(ResponseCode.Status_ERROR); } } /** * Call the offboardDevice API for offboarding the device. * * @param serviceName * device's service name * @param port * device's application port * @return result of action */ private DeviceResponse offboardDevice(String serviceName, short port) { Log.d(TAG, "offboardDevice serviceName:[" + serviceName + "] port:[" + port + "]"); Bundle extras = new Bundle(); extras.putString(EXTRA_DEVICE_BUS_NAME, serviceName); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.JOINING_SESSION.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); if (onboardingClient != null) { onboardingClient.disconnect(); onboardingClient = null; } try { synchronized (TAG) { onboardingClient = new OnboardingClientImpl(serviceName, bus, new ServiceAvailabilityListener() { @Override public void connectionLost() { // expected. we are offboarding the device... Log.d(TAG, "offboardDevice connectionLost"); } }, port); } } catch (Exception e) { Log.e(TAG, "offboardDevice Exception: ", e); return new DeviceResponse(ResponseCode.Status_ERROR); } try { ResponseCode connectToDeviceStatus = connectToDevice(onboardingClient).getStatus(); if (connectToDeviceStatus != ResponseCode.Status_OK) { return new DeviceResponse(ResponseCode.Status_ERROR_CANT_ESTABLISH_SESSION, connectToDeviceStatus.name()); } extras.clear(); extras.putString(EXTRA_DEVICE_BUS_NAME, serviceName); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.SESSION_JOINED.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); extras.clear(); extras.putString(EXTRA_DEVICE_BUS_NAME, serviceName); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONFIGURING_ONBOARDEE.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); onboardingClient.offboard(); extras.clear(); extras.putString(EXTRA_DEVICE_BUS_NAME, serviceName); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONFIGURED_ONBOARDEE.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); return new DeviceResponse(ResponseCode.Status_OK); } catch (BusException e) { Log.e(TAG, "offboardDevice ", e); return new DeviceResponse(ResponseCode.Status_ERROR); } catch (Exception e) { Log.e(TAG, "offboardDevice ", e); return new DeviceResponse(ResponseCode.Status_ERROR); } } /** * Start an AllJoyn session with another Alljoyn device. * * @param client * @return status of operation. */ private DeviceResponse connectToDevice(ClientBase client) { if (client == null) { return new DeviceResponse(ResponseCode.Status_ERROR, "fail connect to device, client == null"); } if (client.isConnected()) { return new DeviceResponse(ResponseCode.Status_OK); } Status status = client.connect(); switch (status) { case OK: Log.d(TAG, "connectToDevice. Join Session OK"); return new DeviceResponse(ResponseCode.Status_OK); case ALLJOYN_JOINSESSION_REPLY_ALREADY_JOINED: Log.d(TAG, "connectToDevice: Join Session returned ALLJOYN_JOINSESSION_REPLY_ALREADY_JOINED. Ignoring"); return new DeviceResponse(ResponseCode.Status_OK); case ALLJOYN_JOINSESSION_REPLY_FAILED: case ALLJOYN_JOINSESSION_REPLY_UNREACHABLE: Log.e(TAG, "connectToDevice: Join Session returned ALLJOYN_JOINSESSION_REPLY_FAILED."); return new DeviceResponse(ResponseCode.Status_ERROR_CANT_ESTABLISH_SESSION, "device unreachable"); default: Log.e(TAG, "connectToDevice: Join session returned error: " + status.name()); return new DeviceResponse(ResponseCode.Status_ERROR, "Failed connecting to device"); } } /** * Convert a string in ASCII format to HexAscii. * * @param pass * password to convert * @return HexAscii of the input. */ private static String toHexadecimalString(String pass) { char[] HEX_CODE = "0123456789ABCDEF".toCharArray(); byte[] data; try { data = pass.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { Log.e(TAG, "Failed getting bytes of passcode by UTF-8", e); data = pass.getBytes(); } StringBuilder r = new StringBuilder(data.length * 2); for (byte b : data) { r.append(HEX_CODE[(b >> 4) & 0xF]); r.append(HEX_CODE[(b & 0xF)]); } return r.toString(); } /** * Start a wifi scan. Sends the following possible intents *
    *
  • {@link #WIFI_SCAN_RESULTS_AVAILABLE_ACTION} action with this extra *
      *
    • {@link #EXTRA_ONBOARDEES_AP} extra information containg ArrayList of * {@link WiFiNetwork} *
    • {@link #EXTRA_TARGETS_AP} extra information containg ArrayList of * {@link WiFiNetwork} *
    • {@link #EXTRA_ALL_AP} extra information containg ArrayList of * {@link WiFiNetwork} *
    *
      * * @throws WifiDisabledException * if Wi-Fi is not enabled. */ public void scanWiFi() throws WifiDisabledException { if (!onboardingSDKWifiManager.isWifiEnabled()) { throw new WifiDisabledException(); } onboardingSDKWifiManager.scan(); } /** * Retrieves list of access points after scan was complete. * * @param filter * of Wi-Fi list type {@link WifiFilter} * @return list of Wi-Fi access points {@link #scanWiFi()} */ public List getWifiScanResults(WifiFilter filter) { if (filter == WifiFilter.ALL) { return onboardingSDKWifiManager.getAllAccessPoints(); } else if (filter == WifiFilter.TARGET) { return onboardingSDKWifiManager.getNonOnboardableAccessPoints(); } else { return onboardingSDKWifiManager.getOnboardableAccessPoints(); } } /** * @return the current Wi-Fi network that the Android device is connected * to. * @throws WifiDisabledException * in case Wi-Fi is disabled. */ public WiFiNetwork getCurrentNetwork() throws WifiDisabledException { if (!onboardingSDKWifiManager.isWifiEnabled()) { throw new WifiDisabledException(); } return onboardingSDKWifiManager.getCurrentConnectedAP(); } /** * Connect the Android device to a WIFI network. Sends the following * possible intents *
        *
      • {@link #STATE_CHANGE_ACTION} action with this extra *
          *
        • {@link #EXTRA_ONBOARDING_STATE} extra information of enum * {@link OnboardingState} *
        *
      • {@link #ERROR} action with this extra *
          *
        • {@link #EXTRA_ERROR_DETAILS} extra information of enum * {@link OnboardingErrorType} *
        *
          * * @param network * contains detailed data how to connect to the WIFI network. * @param connectionTimeout * timeout in Msec to complete the task of connecting to a Wi-Fi * network * @throws WifiDisabledException * in case Wi-Fi is disabled * @throws OnboardingIllegalArgumentException * in case WiFiNetworkConfiguration is invalid or * connectionTimeout is invalid */ public void connectToNetwork(final WiFiNetworkConfiguration network, long connectionTimeout) throws WifiDisabledException, OnboardingIllegalArgumentException { if (!onboardingSDKWifiManager.isWifiEnabled()) { throw new WifiDisabledException(); } if (network == null || network.getSSID() == null || network.getSSID().isEmpty() || (network.getAuthType() != AuthType.OPEN && (network.getPassword() == null || network.getPassword().isEmpty()))) { throw new OnboardingIllegalArgumentException(); } connectToNetworkWifiBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context arg0, Intent intent) { Bundle extras = new Bundle(); String action = intent.getAction(); Log.d(TAG, "onReceive action=" + action); if (WIFI_CONNECTED_BY_REQUEST_ACTION.equals(action)) { context.unregisterReceiver(connectToNetworkWifiBroadcastReceiver); if (intent.hasExtra(EXTRA_WIFI_WIFICONFIGURATION)) { WifiConfiguration config = (WifiConfiguration) intent.getParcelableExtra(EXTRA_WIFI_WIFICONFIGURATION); if (OnboardingSDKWifiManager.normalizeSSID(network.getSSID()).equals(OnboardingSDKWifiManager.normalizeSSID(config.SSID))) { extras.clear(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONNECTED_OTHER_WIFI.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); return; } extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.OTHER_WIFI_TIMEOUT.toString()); sendBroadcast(ERROR, extras); } } if (WIFI_TIMEOUT_ACTION.equals(action)) { context.unregisterReceiver(connectToNetworkWifiBroadcastReceiver); extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.OTHER_WIFI_TIMEOUT.toString()); sendBroadcast(ERROR, extras); } if (WIFI_AUTHENTICATION_ERROR.equals(action)) { context.unregisterReceiver(connectToNetworkWifiBroadcastReceiver); extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.OTHER_WIFI_AUTH.toString()); sendBroadcast(ERROR, extras); } } }; context.registerReceiver(connectToNetworkWifiBroadcastReceiver, wifiIntentFilter); Bundle extras = new Bundle(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONNECTING_OTHER_WIFI.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); if (connectionTimeout <= 0) { connectionTimeout = DEFAULT_WIFI_CONNECTION_TIMEOUT; } onboardingSDKWifiManager.connectToWifiAP(network.getSSID(), network.getAuthType(), network.getPassword(), network.isHidden(), connectionTimeout); } /** * Validate OnboardingConfiguration . * * @param config * information for onboarding process. * @return true if OnboardingConfiguration is valid else false. */ private boolean validateOnboardingConfiguration(OnboardingConfiguration config) { if (config == null || config.getOnboardee() == null || config.getTarget() == null) { return false; } if (config.getOnboardeeAnnoucementTimeout() <= 0 || config.getOnboardeeConnectionTimeout() <= 0 || config.getTargetAnnoucementTimeout() <= 0 || config.getTargetConnectionTimeout() <= 0) { return false; } // in case authtype isn't OPEN verify that a password exists. if (config.getOnboardee().getAuthType() != AuthType.OPEN && (config.getOnboardee().getPassword() == null || config.getOnboardee().getPassword().isEmpty())) { return false; } // in case authtype isn't OPEN verify that a password exists. if (config.getTarget().getAuthType() != AuthType.OPEN && (config.getTarget().getPassword() == null || config.getTarget().getPassword().isEmpty())) { return false; } if (config.getTarget().getSSID() == null || config.getTarget().getSSID().isEmpty() || config.getOnboardee().getSSID() == null || config.getOnboardee().getSSID().isEmpty()) { return false; } return true; } /** * Start and resume the onboarding process. Send these possible intents *
            *
          • {@link #STATE_CHANGE_ACTION} action with this extra *
              *
            • {@link #EXTRA_ONBOARDING_STATE} extra information of enum * {@link OnboardingState} *
            *
          • {@link #ERROR} action with this extra *
              *
            • {@link #EXTRA_ERROR_DETAILS} extra information of enum * {@link OnboardingErrorType} *
            *
          * * * can resume the onboarding process in case one of the internal errors has * occoured *
            *
          • ERROR_CONNECTING_TO_ONBOARDEE *
          • ERROR_WAITING_FOR_ONBOARDEE_ANNOUNCEMENT *
          • ERROR_JOINING_SESSION *
          • ERROR_CONFIGURING_ONBOARDEE *
          • ERROR_CONNECTING_TO_TARGET_WIFI_AP *
          • ERROR_WAITING_FOR_TARGET_ANNOUNCE *
          * * @param config * containing information about onboardee and target networks. * @throws OnboardingIllegalStateException * in case onboarding is arleady running or trying to resume * from internal state ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED. * @throws OnboardingIllegalArgumentException * in case OnboardingConfiguration is invalid. * @throws WifiDisabledException * in case Wi-Fi is disabled. */ public void runOnboarding(OnboardingConfiguration config) throws OnboardingIllegalStateException, OnboardingIllegalArgumentException, WifiDisabledException { if (!onboardingSDKWifiManager.isWifiEnabled()) { throw new WifiDisabledException(); } if (!validateOnboardingConfiguration(config)) { throw new OnboardingIllegalArgumentException(); } synchronized (TAG) { onboardingConfiguration = config; listenToAnnouncementsFlag = true; if (currentState == State.IDLE) { WiFiNetwork currentAP = onboardingSDKWifiManager.getCurrentConnectedAP(); if (currentAP != null) { originalNetwork = currentAP.getSSID(); } setState(State.CONNECTING_TO_ONBOARDEE); } else if (currentState.getValue() >= State.ERROR_CONNECTING_TO_ONBOARDEE.getValue()) { switch (currentState) { case ERROR_CONNECTING_TO_ONBOARDEE: setState(State.CONNECTING_TO_ONBOARDEE); break; case ERROR_WAITING_FOR_ONBOARDEE_ANNOUNCEMENT: setState(State.WAITING_FOR_ONBOARDEE_ANNOUNCEMENT); break; case ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED: throw new OnboardingIllegalStateException("The device doesn't comply with onboarding service"); case ERROR_ONBOARDEE_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT: case ERROR_JOINING_SESSION: setState(State.JOINING_SESSION, deviceData.getAnnounceData()); break; case ERROR_CONFIGURING_ONBOARDEE: setState(State.CONFIGURING_ONBOARDEE); break; case ERROR_WAITING_FOR_CONFIGURE_SIGNAL: setState(State.CONFIGURING_ONBOARDEE_WITH_SIGNAL); break; case ERROR_CONNECTING_TO_TARGET_WIFI_AP: setState(State.CONNECTING_TO_TARGET_WIFI_AP); break; case ERROR_WAITING_FOR_TARGET_ANNOUNCE: setState(State.WAITING_FOR_TARGET_ANNOUNCE); break; case ERROR_TARGET_ANNOUNCEMENT_RECEIVED_AFTER_TIMEOUT: setState(State.TARGET_ANNOUNCEMENT_RECEIVED, deviceData.getAnnounceData()); break; default: break; } } else { throw new OnboardingIllegalStateException("onboarding process is already running"); } } } /** * Abort the onboarding process. * *
            *
          • Send the following intents. *
          • {@link #STATE_CHANGE_ACTION} action with this extra *
              *
            • {@link OnboardingState#ABORTING} when starting the abort process. *
            *
          *

          * see also {@link #abortStateCleanUp()} * * @throws OnboardingIllegalStateException * in case the state machine is in state IDLE,ABORTING (No need * to Abort) in case the state machine is in state * CONNECTING_TO_TARGET_WIFI_AP * ,WAITING_FOR_TARGET_ANNOUNCE,TARGET_ANNOUNCEMENT_RECEIVED * (can't abort ,in final stages of onboarding) */ public void abortOnboarding() throws OnboardingIllegalStateException { synchronized (TAG) { if (currentState == State.IDLE || currentState == State.ABORTING) { throw new OnboardingIllegalStateException("Can't abort ,already ABORTED"); } if (currentState == State.CONNECTING_TO_TARGET_WIFI_AP || currentState == State.TARGET_ANNOUNCEMENT_RECEIVED || currentState == State.CONFIGURING_ONBOARDEE || currentState == State.CONFIGURING_ONBOARDEE_WITH_SIGNAL) { throw new OnboardingIllegalStateException("Can't abort"); } Bundle extras = new Bundle(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.ABORTING.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); setState(State.ABORTING); } } /** * Prepare the state machine for the onboarding process after abort has * beeen requested. * * Try restoring the connection to the original Wi-Fi access point prior to * calling {@link OnboardingManager#runOnboarding(OnboardingConfiguration)} *

          * Does the following : *

            *
          • Stop listening to About Service announcements. *
          • Remove onboardee Wi-Fi access point from Android's Wi-Fi configured * netwroks. *
          • Enable Android's Wi-Fi manager to select a suitable Wi-Fi access * point. *
          • Move state maching to IDLE state. *
          • Send the following intents. *
              *
            • {@link #STATE_CHANGE_ACTION} action with this extra *
                *
              • {@link OnboardingState#CONNECTING_ORIGINAL_WIFI} when trying to * connect to orignal network if exists. *
              • {@link OnboardingState#CONNECTING_ORIGINAL_WIFI} when connected to * orignal network if exists. *
              • {@link OnboardingState#ABORTED} when abort process complete. *
              *
            • {@link #ERROR} action with this extra *
                *
              • {@link OnboardingErrorType#ORIGINAL_WIFI_TIMEOUT} when trying to * connect to orignal and get timeout. *
              • {@link OnboardingErrorType#ORIGINAL_WIFI_AUTH} when trying to connect * to orignal and get authentication error. *
              *
            *
          */ private void abortStateCleanUp() { // in case ABORTING_INTERRUPT_FLAG found in stateHandler remove it. if (stateHandler.hasMessages(ABORTING_INTERRUPT_FLAG)) { stateHandler.removeMessages(ABORTING_INTERRUPT_FLAG); } if (onboardingConfiguration != null && onboardingConfiguration.getOnboardee() != null && onboardingConfiguration.getOnboardee().getSSID() != null) { onboardingSDKWifiManager.removeWifiAP(onboardingConfiguration.getOnboardee().getSSID()); } final Bundle extras = new Bundle(); synchronized (TAG) { listenToAnnouncementsFlag = false; } // Try to connect to orginal access point if existed. if (originalNetwork != null) { try { onboardingSDKWifiManager.connectToWifiBySSID(originalNetwork, DEFAULT_WIFI_CONNECTION_TIMEOUT); } catch (OnboardingIllegalArgumentException e) { Log.e(TAG, "abortStateCleanUp " + e.getMessage()); onboardingSDKWifiManager.enableAllWifiNetworks(); setState(State.IDLE); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.ABORTED.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); return; } extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONNECTING_ORIGINAL_WIFI.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); onboardingWifiBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); Log.d(TAG, "onReceive action=" + action); if (action != null) { context.unregisterReceiver(onboardingWifiBroadcastReceiver); onboardingSDKWifiManager.enableAllWifiNetworks(); setState(State.IDLE); if (WIFI_CONNECTED_BY_REQUEST_ACTION.equals(action)) { extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.CONNECTED_ORIGINAL_WIFI.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); } if (WIFI_TIMEOUT_ACTION.equals(action)) { extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.ORIGINAL_WIFI_TIMEOUT.toString()); sendBroadcast(ERROR, extras); } if (WIFI_AUTHENTICATION_ERROR.equals(action)) { extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.ORIGINAL_WIFI_AUTH.toString()); sendBroadcast(ERROR, extras); } extras.clear(); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.ABORTED.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); } } };// receiver context.registerReceiver(onboardingWifiBroadcastReceiver, wifiIntentFilter); } else { // Probably onboarding started when the device wasn't connected to a // Wi-Fi. So nothing to restore. // Just return to IDLE and enable all the networks that were // disabled by the onboarding process. onboardingSDKWifiManager.enableAllWifiNetworks(); setState(State.IDLE); extras.putString(EXTRA_ONBOARDING_STATE, OnboardingState.ABORTED.toString()); sendBroadcast(STATE_CHANGE_ACTION, extras); } } /** * * Offboard a device that is on the current Wi-Fi network. * * @param config * contains the offboarding information needed to complete the * task. * @throws OnboardingIllegalStateException * is thrown when not in internal IDLE state. * @throws OnboardingIllegalArgumentException * is thrown when config is not valid * @throws WifiDisabledException * in case Wi-Fi is disabled. */ public void runOffboarding(final OffboardingConfiguration config) throws OnboardingIllegalStateException, OnboardingIllegalArgumentException, WifiDisabledException { if (!onboardingSDKWifiManager.isWifiEnabled()) { throw new WifiDisabledException(); } // verify that the OffboardingConfiguration has valid data if (config == null || config.getServiceName() == null || config.getServiceName().isEmpty() || config.getPort() == 0) { throw new OnboardingIllegalArgumentException(); } synchronized (TAG) { // in case the SDK is in onboarding mode the runOffboarding can't // continue if (currentState != State.IDLE) { throw new OnboardingIllegalStateException("onboarding process is already running"); } Log.d(TAG, "runOffboarding serviceName" + config.getServiceName() + " port" + config.getPort()); new Thread() { @Override public void run() { DeviceResponse deviceResponse = offboardDevice(config.getServiceName(), config.getPort()); if (deviceResponse.getStatus() != ResponseCode.Status_OK) { Bundle extras = new Bundle(); if (deviceResponse.getStatus() == ResponseCode.Status_ERROR_CANT_ESTABLISH_SESSION) { extras.putString(EXTRA_DEVICE_BUS_NAME, config.getServiceName()); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.JOIN_SESSION_ERROR.toString()); } else { extras.putString(EXTRA_DEVICE_BUS_NAME, config.getServiceName()); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.ERROR_CONFIGURING_ONBOARDEE.toString()); } sendBroadcast(ERROR, extras); } } }.start(); } } /** * Check if the device supports the given service. * * @param objectDescriptions * the list of supported services as announced by the device. * @param service * name of the service to check * @return true if supported else false */ private boolean isSeviceSupported(final AboutObjectDescription[] objectDescriptions, String service) { if (objectDescriptions != null) { for (int i = 0; i < objectDescriptions.length; i++) { String[] interfaces = objectDescriptions[i].interfaces; for (int j = 0; j < interfaces.length; j++) { String currentInterface = interfaces[j]; if (currentInterface.startsWith(service)) { return true; } } } } return false; } /** * Start a timeout announcement to arrive from a device. Takes the timeout * interval from the {@link OnboardingConfiguration} that stores the data. * If timeout expires, moves the state machine to idle state and sends * timeout intent. * * @return true if in correct state else false. */ private boolean startAnnouncementTimeout() { long timeout = 0; switch (currentState) { case WAITING_FOR_ONBOARDEE_ANNOUNCEMENT: timeout = onboardingConfiguration.getOnboardeeAnnoucementTimeout(); break; case WAITING_FOR_TARGET_ANNOUNCE: timeout = onboardingConfiguration.getTargetAnnoucementTimeout(); break; default: Log.e(TAG, "startAnnouncementTimeout has been intialized in bad state abort"); return false; } announcementTimeout.schedule(new TimerTask() { Bundle extras = new Bundle(); @Override public void run() { Log.e(TAG, "Time out expired " + currentState.toString()); switch (currentState) { case WAITING_FOR_ONBOARDEE_ANNOUNCEMENT: extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.FIND_ONBOARDEE_TIMEOUT.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_WAITING_FOR_ONBOARDEE_ANNOUNCEMENT); break; case WAITING_FOR_TARGET_ANNOUNCE: extras.clear(); extras.putString(EXTRA_ERROR_DETAILS, OnboardingErrorType.VERIFICATION_TIMEOUT.toString()); sendBroadcast(ERROR, extras); setState(State.ERROR_WAITING_FOR_TARGET_ANNOUNCE); break; default: break; } } }, timeout); return true; } /** * Stop the announcement timeout that was activated by * {@link #startAnnouncementTimeout()} */ private void stopAnnouncementTimeout() { announcementTimeout.cancel(); announcementTimeout.purge(); announcementTimeout = new Timer(); } /** * A wrapper method that sends intent broadcasts with extra data * * @param action * an action for the intent * @param extras * extras for the intent */ private void sendBroadcast(String action, Bundle extras) { Intent intent = new Intent(action); if (extras != null && !extras.isEmpty()) { intent.putExtras(extras); } context.sendBroadcast(intent); } } OnboardingSDKWifiManager.java000066400000000000000000001314301262264444500357700ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/src/org/alljoyn/onboarding/sdk/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.sdk; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.Timer; import java.util.TimerTask; import org.alljoyn.onboarding.OnboardingService.AuthType; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.NetworkInfo; import android.net.wifi.ScanResult; import android.net.wifi.SupplicantState; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.net.wifi.WifiManager.MulticastLock; import android.os.Bundle; import android.util.Log; import android.util.Pair; /** * Wraps the interaction with {@link WifiManager}. */ class OnboardingSDKWifiManager { private final static String TAG = "OnboardingSDKWifiManager"; /** * Android application context. */ private final Context context; /** * WiFi manager instance. */ private final WifiManager wifi; /** * Broadcast receiver for WifiManager intents. */ private BroadcastReceiver wifiBroadcastReceiver; /** * Stores the details of the target Wi-Fi. Uses volatile to verify that the * broadcast receiver reads its content each time onReceive is called, thus * "knowing" if the an API call to connect has been made */ private volatile WifiConfiguration targetWifiConfiguration = null; /** * Stores all Wi-Fi access points that are not considered AllJoyn devices. */ private final ArrayList nonOnboardableAPlist = new ArrayList(); /** * Stores all Wi-Fi access points that are considered onboardee devices. */ private final ArrayList onboardableAPlist = new ArrayList(); /** * Stores all Wi-Fi access points that were found in the scan */ private final ArrayList allAPlist = new ArrayList(); /** * SSID prefix for onboardable devices. */ static final private String ONBOARDABLE_PREFIX = "AJ_"; /** * SSID suffix for onboardable devices. */ static final private String ONBOARDABLE_SUFFIX = "_AJ"; /** * WEP HEX password pattern. */ static final String WEP_HEX_PATTERN = "[\\dA-Fa-f]+"; /** * Timer for checking completion of Wi-Fi tasks. */ private Timer wifiTimeoutTimer = new Timer(); /** * AJ daemon discovery relies on multicast. Normally the Android filters * out packets not explicitly addressed to this device. Acquiring a * MulticastLock will cause the stack to receive packets addressed to * multicast addresses. */ private MulticastLock multicastLock; /** * Initialize the WifiManager and the Wi-Fi BroadcastReceiver. * * @param context * the application Context */ public OnboardingSDKWifiManager(Context context) { this.context = context; wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); registerWifiBroadcastReceiver(); } /** * Register a BroadcastReciver to receive intents from {@link WifiManager}. * *
            *
          • {@link WifiManager#SCAN_RESULTS_AVAILABLE_ACTION} - Wi-Fi scan is complete. handled by {@link #processScanResults(List)} *
          • {@link WifiManager#NETWORK_STATE_CHANGED_ACTION} - the handset connected to a Wi-Fi access point. handled by {@link #processChangeOfNetwork(WifiInfo)} *
          • {@link WifiManager#SUPPLICANT_STATE_CHANGED_ACTION} - authentication error. Will fire a {@link OnboardingManager#WIFI_AUTHENTICATION_ERROR} intent. *
          * using synchronized to protect against concurrent onRecive(..) calls that set targetWifiConfiguration in a non steady state. */ private void registerWifiBroadcastReceiver() { Log.d(TAG, "registerWifiBroadcastReceiver"); wifiBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Log.d(TAG, "WiFi BroadcastReceiver onReceive: " + intent.getAction()); if (WifiManager.SCAN_RESULTS_AVAILABLE_ACTION.equals(intent.getAction())) { // Wi-Fi scan is complete List scans = wifi.getScanResults(); if (scans != null) { processScanResults(scans); } else { Log.i(TAG, "WiFi BroadcastReceiver onReceive wifi.getScanResults() == null"); } } else if (WifiManager.NETWORK_STATE_CHANGED_ACTION.equals(intent.getAction())) { NetworkInfo networkInfo = intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO); if (networkInfo != null && networkInfo.getState() != null && networkInfo.isConnected()) { // the state of Wi-Fi connectivity has changed. WiFiNetwork currentConnectedAP = getCurrentConnectedAP(); if (currentConnectedAP != null) { Log.d(TAG, "WiFi BroadcastReceiver onReceive success in connecting to " + currentConnectedAP.getSSID()); } // the wifiInfo extra indicates that the new state is // CONNECTED, and provides the SSID. WifiInfo wifiInfo = intent.getParcelableExtra(WifiManager.EXTRA_WIFI_INFO); if (wifiInfo == null) { wifiInfo = wifi.getConnectionInfo(); } if (wifiInfo != null) { processChangeOfNetwork(wifiInfo); } } else { Log.i(TAG, "WiFi BroadcastReceiver onReceive not a connected networkInfo: " + networkInfo); } } else if (WifiManager.SUPPLICANT_STATE_CHANGED_ACTION.equals(intent.getAction()) && intent.hasExtra(WifiManager.EXTRA_SUPPLICANT_ERROR) && intent.getIntExtra(WifiManager.EXTRA_SUPPLICANT_ERROR, 0) == WifiManager.ERROR_AUTHENTICATING) { // Wi-Fi authentication error synchronized (this) { if (targetWifiConfiguration != null) { Log.e(TAG, "Network Listener ERROR_AUTHENTICATING when trying to connect to " + normalizeSSID(targetWifiConfiguration.SSID)); // it was the SDK that initiated the Wi-Fi change, // hence the timer should be cancelled stopWifiTimeoutTimer(); Bundle extras = new Bundle(); extras.putParcelable(OnboardingManager.EXTRA_WIFI_WIFICONFIGURATION, targetWifiConfiguration); sendBroadcast(OnboardingManager.WIFI_AUTHENTICATION_ERROR, extras); targetWifiConfiguration=null; } } } } }; IntentFilter filter = new IntentFilter(); filter.addAction(WifiManager.SUPPLICANT_STATE_CHANGED_ACTION); filter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION); filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION); context.registerReceiver(wifiBroadcastReceiver, filter); } /** * Handle a list of {@link ScanResult}. * Filter out empty or duplicate access * point names, and normalize access point names, then split the results * between the onboardableAPlist and the nonOnboardableAPlist lists. After * completion send {@link OnboardingManager#WIFI_SCAN_RESULTS_AVAILABLE_ACTION} * intent with onboardableAPlist,nonOnboardableAPlist as extra data. * * @param scans * List of ScanResults */ private void processScanResults(List scans) { Log.d(TAG, "processScanResults"); if (scans != null) { synchronized (wifi) { onboardableAPlist.clear(); nonOnboardableAPlist.clear(); allAPlist.clear(); Set tempset = new HashSet(); // avoid duplicates StringBuffer buff = new StringBuffer(); // for logging for (ScanResult scan : scans) { // remove extra quotes from network SSID scan.SSID = normalizeSSID(scan.SSID); // a scan may contain results with no SSID if (scan.SSID == null || scan.SSID.isEmpty()) { Log.i(TAG, "processScanResults currentScan was empty,skipping"); continue; } // avoid duplicates if (tempset.contains(scan.SSID)) { Log.i(TAG, "processScanResults currentScan " + scan.SSID + " already seen ,skipping"); continue; } // store the new SSID tempset.add(scan.SSID); WiFiNetwork wiFiNetwork = new WiFiNetwork(scan.SSID, scan.capabilities, scan.level); if (scan.SSID.startsWith(ONBOARDABLE_PREFIX) || scan.SSID.endsWith(ONBOARDABLE_SUFFIX)) { onboardableAPlist.add(wiFiNetwork); } else { nonOnboardableAPlist.add(wiFiNetwork); } allAPlist.add(wiFiNetwork); buff.append(scan.SSID).append(","); } Log.i(TAG, "processScanResults " + (buff.length() > 0 ? buff.toString().substring(0, buff.length() - 1) : " empty")); // broadcast a WIFI_SCAN_RESULTS_AVAILABLE_ACTION intent Bundle extras = new Bundle(); extras.putParcelableArrayList(OnboardingManager.EXTRA_ONBOARDEES_AP, onboardableAPlist); extras.putParcelableArrayList(OnboardingManager.EXTRA_TARGETS_AP, nonOnboardableAPlist); extras.putParcelableArrayList(OnboardingManager.EXTRA_ALL_AP, allAPlist); sendBroadcast(OnboardingManager.WIFI_SCAN_RESULTS_AVAILABLE_ACTION, extras); } } } /** * Handle the information that the device has connected to a Wi-Fi network. * It's important to know that {@link WifiManager} API doesn't fully * guarantee that the connected network is the one you asked for. So the new * network is compared with the one that we asked for. * *

          * If the connection was successful the * {@link OnboardingManager#WIFI_CONNECTED_BY_REQUEST_ACTION} intent will be * sent * * @param wifiInfo * WifiInfo of the access point to which we have just switched */ private void processChangeOfNetwork(WifiInfo wifiInfo) { Log.d(TAG, "processChangeOfNetwork"); synchronized (this) { // This is needed so that boards can discover the bundled AJ daemon. // On some devices, the multicast lock must be acquired on every // Wi-Fi network switch. acquireMulticastLock(); if (targetWifiConfiguration != null) { // check if it's the network that we tried to connect to WiFiNetwork currentConnectedAP = getCurrentConnectedAP(); if (((wifiInfo != null) && isSsidEquals(targetWifiConfiguration.SSID, wifiInfo.getSSID())) || (currentConnectedAP != null && isSsidEquals(targetWifiConfiguration.SSID, currentConnectedAP.getSSID()))) { Bundle extras = new Bundle(); // it was the SDK that initiated the Wi-Fi change, hence the // timer should be cancelled stopWifiTimeoutTimer(); String intentAction = OnboardingManager.WIFI_CONNECTED_BY_REQUEST_ACTION; extras.putParcelable(OnboardingManager.EXTRA_WIFI_WIFICONFIGURATION, targetWifiConfiguration); sendBroadcast(intentAction, extras); targetWifiConfiguration = null; } } } } /** * Stops the wifiTimeoutTimer */ private void stopWifiTimeoutTimer() { Log.d(TAG, "stopWifiTimeoutTimer"); wifiTimeoutTimer.cancel(); wifiTimeoutTimer.purge(); wifiTimeoutTimer = new Timer(); } /** * @return list of Wi-Fi access points whose SSID starts with "AJ_" or ends * with "_AJ" */ List getOnboardableAccessPoints() { synchronized (wifi) { return onboardableAPlist; } } /** * @return list of Wi-Fi access points whose SSID doesn't start with "AJ_" * and doesn't end with "_AJ". */ List getNonOnboardableAccessPoints() { synchronized (wifi) { return nonOnboardableAPlist; } } /** * @return list of all the access points found by the Wi-Fi scan. */ List getAllAccessPoints() { synchronized (wifi) { return allAPlist; } } /** * @return current connected AP if connected to Wi-Fi else returns null. */ WiFiNetwork getCurrentConnectedAP() { Log.d(TAG, "getCurrentSSID: SupplicantState = " + wifi.getConnectionInfo().getSupplicantState()); synchronized (wifi) { // Check if we're still negotiating with the access point if (wifi.getConnectionInfo().getSupplicantState() != SupplicantState.COMPLETED) { Log.w(TAG, "getCurrentSSID: SupplicantState not COMPLETED, return null"); return null; } if (wifi.getConnectionInfo() == null || wifi.getConnectionInfo().getSSID() == null) { return null; } String currentSSID = normalizeSSID(wifi.getConnectionInfo().getSSID()); Log.d(TAG, "getCurrentSSID =" + currentSSID); for (int i = 0; i < onboardableAPlist.size(); i++) { if (onboardableAPlist.get(i).SSID.equals(currentSSID)) { return onboardableAPlist.get(i); } } for (int i = 0; i < nonOnboardableAPlist.size(); i++) { if (nonOnboardableAPlist.get(i).SSID.equals(currentSSID)) { return nonOnboardableAPlist.get(i); } } return new WiFiNetwork(currentSSID); } } /** * Extracts AuthType from a SSID by retrieving its capabilities via WifiManager. * * @param ssid * @return AuthType of SSID or null if not found */ private AuthType getSSIDAuthType(String ssid) { Log.d(TAG, "getSSIDAuthType SSID = " + ssid); if (ssid == null || ssid.length() == 0) { Log.w(TAG, "getSSIDAuthType given string was null"); return null; } List networks = wifi.getScanResults(); for (ScanResult scan : networks) { if (ssid.equalsIgnoreCase(scan.SSID)) { AuthType res = getScanResultAuthType(scan.capabilities); return res; } } return null; } /** * Parses ScanResult 'capabilities' string into an AuthType object. * * @param capabilities * {@link ScanResult#capabilities} * @return AuthType object. {@link AuthType} */ private AuthType getScanResultAuthType(String capabilities) { Log.d(TAG, "getScanResultAuthType capabilities = " + capabilities); if (capabilities.contains("WPA2")) { return AuthType.WPA2_AUTO; } if (capabilities.contains("WPA")) { return AuthType.WPA_AUTO; } if (capabilities.contains(AuthType.WEP.name())) { return AuthType.WEP; } return AuthType.OPEN; } /** * Use {@link WifiManager} to connect to a Wi-Fi access point. *

            *
          • In case an access point with the same SSID exists, delete it. *
          • Create a new access point with SSID name , *
          • Verify that it is a valid one . *
          • Call {@link #connect(WifiConfiguration, int, long)}. *
          * * @param ssid Wi-Fi access point * @param authType * @param password * @param connectionTimeout in milliseconds * @param isHidden * */ void connectToWifiAP(String ssid, AuthType authType, String password, boolean isHidden,long connectionTimeout) { //21 = android.os.Build.VERSION_CODES.LOLLIPOP if (android.os.Build.VERSION.SDK_INT >= 21) { lollipop_connectToWifiAP(ssid, authType, password, isHidden, connectionTimeout); return; } Log.d(TAG, "connectToWifiAP SSID = " + ssid + " authtype = " + authType.toString()+ " is hidden = "+ isHidden); // if networkPass is null set it to "" if (password == null) { password = ""; } // the configured Wi-Fi networks final List wifiConfigs = wifi.getConfiguredNetworks(); // log the list StringBuffer buff = new StringBuffer(); for (WifiConfiguration w : wifiConfigs) { if (w.SSID != null) { w.SSID = normalizeSSID(w.SSID); if (w.SSID.length() > 1) { buff.append(w.SSID).append(","); } } } Log.i(TAG, "connectToWifiAP ConfiguredNetworks " + (buff.length() > 0 ? buff.toString().substring(0, buff.length() - 1) : " empty")); int networkId = -1; // delete any existing WifiConfiguration that has the same SSID as the // new one for (WifiConfiguration w : wifiConfigs) { if (w.SSID != null && isSsidEquals(w.SSID, ssid)) { networkId = w.networkId; Log.i(TAG, "connectToWifiAP found " + ssid + " in ConfiguredNetworks. networkId = " + networkId); boolean res = wifi.removeNetwork(networkId); Log.i(TAG, "connectToWifiAP delete " + networkId + "? " + res); res = wifi.saveConfiguration(); Log.i(TAG, "connectToWifiAP saveConfiguration res = " + res); break; } } WifiConfiguration wifiConfiguration = new WifiConfiguration(); // check the AuthType of the SSID against the WifiManager // if null use the one given by the API // else use the result from getSSIDAuthType AuthType verrifiedWifiAuthType = getSSIDAuthType(ssid); if (verrifiedWifiAuthType != null) { authType = verrifiedWifiAuthType; } if (isHidden){ wifiConfiguration.hiddenSSID=true; } Log.i(TAG, "connectToWifiAP selectedAuthType = " + authType); // set the WifiConfiguration parameters switch (authType) { case OPEN: wifiConfiguration.SSID = "\"" + ssid + "\""; wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE); networkId = wifi.addNetwork(wifiConfiguration); Log.d(TAG, "connectToWifiAP [OPEN] add Network returned " + networkId); break; case WEP: wifiConfiguration.SSID = "\"" + ssid + "\""; // check the validity of a WEP password Pair wepCheckResult = checkWEPPassword(password); if (!wepCheckResult.first) { Log.i(TAG, "connectToWifiAP auth type = WEP: password " + password + " invalid length or charecters"); Bundle extras = new Bundle(); extras.putParcelable(OnboardingManager.EXTRA_WIFI_WIFICONFIGURATION, wifiConfiguration); sendBroadcast(OnboardingManager.WIFI_AUTHENTICATION_ERROR, extras); return; } Log.i(TAG, "connectToWifiAP [WEP] using " + (!wepCheckResult.second ? "ASCII" : "HEX")); if (!wepCheckResult.second) { wifiConfiguration.wepKeys[0] = "\"" + password + "\""; } else { wifiConfiguration.wepKeys[0] = password; } wifiConfiguration.priority = 40; wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE); wifiConfiguration.allowedProtocols.set(WifiConfiguration.Protocol.RSN); wifiConfiguration.allowedProtocols.set(WifiConfiguration.Protocol.WPA); wifiConfiguration.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN); wifiConfiguration.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.SHARED); wifiConfiguration.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP); wifiConfiguration.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP); wifiConfiguration.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40); wifiConfiguration.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP104); wifiConfiguration.wepTxKeyIndex = 0; networkId = wifi.addNetwork(wifiConfiguration); Log.d(TAG, "connectToWifiAP [WEP] add Network returned " + networkId); break; case WPA_AUTO: case WPA_CCMP: case WPA_TKIP: case WPA2_AUTO: case WPA2_CCMP: case WPA2_TKIP: { wifiConfiguration.SSID = "\"" + ssid + "\""; // handle special case when WPA/WPA2 and 64 length password that can // be HEX if (password.length() == 64 && password.matches(WEP_HEX_PATTERN)) { wifiConfiguration.preSharedKey = password; } else { wifiConfiguration.preSharedKey = "\"" + password + "\""; } wifiConfiguration.hiddenSSID = true; wifiConfiguration.status = WifiConfiguration.Status.ENABLED; wifiConfiguration.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP); wifiConfiguration.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP); wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK); wifiConfiguration.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP); wifiConfiguration.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP); wifiConfiguration.allowedProtocols.set(WifiConfiguration.Protocol.RSN); wifiConfiguration.allowedProtocols.set(WifiConfiguration.Protocol.WPA); networkId = wifi.addNetwork(wifiConfiguration); Log.d(TAG, "connectToWifiAP [WPA..WPA2] add Network returned " + networkId); break; } default: networkId = -1; break; } if (networkId < 0) { Log.d(TAG, "connectToWifiAP networkId <0 WIFI_AUTHENTICATION_ERROR"); Bundle extras = new Bundle(); extras.putParcelable(OnboardingManager.EXTRA_WIFI_WIFICONFIGURATION, wifiConfiguration); sendBroadcast(OnboardingManager.WIFI_AUTHENTICATION_ERROR, extras); return; } Log.d(TAG, "connectToWifiAP calling connect"); connect(wifiConfiguration, networkId, connectionTimeout); } /** * Connect to an already configured Wi-Fi access point. * @param SSID * @param timeout * @throws OnboardingIllegalArgumentException in case SSID not found in configured access points. */ void connectToWifiBySSID(String SSID,long timeout) throws OnboardingIllegalArgumentException{ final List wifiConfigs = wifi.getConfiguredNetworks(); WifiConfiguration wifiConfig=null; for (WifiConfiguration w : wifiConfigs) { if (w.SSID != null && isSsidEquals(w.SSID, SSID)) { wifiConfig=w; break; } } if (wifiConfig!=null){ // 21 = android.os.Build.VERSION_CODES.LOLLIPOP if (android.os.Build.VERSION.SDK_INT >= 21) { lillipop_connect(wifiConfig,wifiConfig.networkId,timeout); } else { connect(wifiConfig,wifiConfig.networkId,timeout); } }else{ throw new OnboardingIllegalArgumentException("unable to find "+ SSID +" in list of configured networks"); } } /** * Make the actual connection to the requested Wi-Fi target. * * @param wifiConfig * details of the Wi-Fi access point used by the WifiManger * @param networkId * id of the Wi-Fi configuration * @param timeoutMsec * period of time in Msec to complete Wi-Fi connection task */ private void connect(final WifiConfiguration wifiConfig, final int networkId, final long timeoutMsec) { Log.i(TAG, "connect SSID=" + wifiConfig.SSID + " within " + timeoutMsec); boolean res; synchronized (this) { targetWifiConfiguration = wifiConfig; } // this is the application's Wi-Fi connection timeout wifiTimeoutTimer.schedule(new TimerTask() { @Override public void run() { Log.e(TAG, "Network Listener WIFI_TIMEOUT when trying to connect to " + normalizeSSID(targetWifiConfiguration.SSID)); Bundle extras = new Bundle(); extras.putParcelable(OnboardingManager.EXTRA_WIFI_WIFICONFIGURATION, wifiConfig); sendBroadcast(OnboardingManager.WIFI_TIMEOUT_ACTION, extras); } }, timeoutMsec); if (wifi.getConnectionInfo().getSupplicantState() == SupplicantState.DISCONNECTED) { wifi.disconnect(); } wifi.saveConfiguration(); res = wifi.enableNetwork(networkId, false); Log.d(TAG, "connect enableNetwork [false] status=" + res); res = wifi.disconnect(); Log.d(TAG, "connect disconnect status=" + res); // enabling a network doesn't guarantee that it's the one that Android // will connect to. // Selecting a particular network is achieved by passing 'true' here to // disable all other networks. // the side effect is that all other user's Wi-Fi networks become // disabled. // The recovery for that is enableAllWifiNetworks method. res = wifi.enableNetwork(networkId, true); Log.d(TAG, "connect enableNetwork [true] status=" + res); res = wifi.reconnect(); wifi.setWifiEnabled(true); } /** * Remove the WiFi access point using {@link WifiManager} Api. * * @param ssid name of the Wi-Fi network to remove */ void removeWifiAP(String ssid) { final List wifiConfigs = wifi.getConfiguredNetworks(); // disconnect from Wi-Fi wifi.disconnect(); // delete WifiConfiguration that has the same SSID as the supplied name. for (WifiConfiguration w : wifiConfigs) { if (w.SSID != null && isSsidEquals(w.SSID, ssid)) { int networkId = w.networkId; Log.i(TAG, "connectToWifiAP found " + ssid + " in ConfiguredNetworks. networkId = " + networkId); boolean res = wifi.removeNetwork(networkId); Log.i(TAG, "connectToWifiAP delete " + networkId + "? " + res); res = wifi.saveConfiguration(); Log.i(TAG, "connectToWifiAP saveConfiguration res = " + res); break; } } } /** * Enable all the disabled Wi-Fi access points. This method tries to restore * the Wi-Fi environment that the user had prior to onboarding. Because * While running the onboarding process, the SDK disables all the user's * Wi-Fi networks other than the onboardee access point and the target. */ void enableAllWifiNetworks() { Log.d(TAG, "enableAllWifiNetworks start"); List configuredNetworks = wifi.getConfiguredNetworks(); for (WifiConfiguration wifiConfiguration : configuredNetworks) { if (wifiConfiguration.status == WifiConfiguration.Status.DISABLED) { Log.d(TAG, "enableAllWifiNetworks enabling " + wifiConfiguration.SSID); wifi.enableNetwork(wifiConfiguration.networkId, false); } } wifi.reconnect(); } /** * Start a Wi-Fi scan. */ void scan() { Log.d(TAG, "scan"); wifi.startScan(); } /** * Acquire Android Multicast lock. * AllJoyn daemon discovery relies on multicast ,and Android, by default, filters out multicast packets unless * an application acquires a lock. */ private void acquireMulticastLock() { Log.d(TAG, "acquireMulticastLock"); // On some devices the multicast lock must be renewed every time, // because after Wi-Fi switches, // the lock is still held, but no longer works - multicast packets no // longer come through. if (multicastLock != null) { // keep the environment clean. Dispose the old lock Log.d(TAG, "MulticastLock != null. releasing MulticastLock"); multicastLock.release(); } multicastLock = wifi.createMulticastLock("multicastLock"); multicastLock.setReferenceCounted(false); multicastLock.acquire(); } /** * A wrapper function to send broadcast intent messages. * * @param action * the name of the action * @param extras * contains extra information bundled with the intent */ private void sendBroadcast(String action, Bundle extras) { Intent intent = new Intent(action); if (extras != null && !extras.isEmpty()) { intent.putExtras(extras); } context.sendBroadcast(intent); } /** * A utility method for retrieving Android's Wi-Fi status. * @return true if enabled else false */ boolean isWifiEnabled(){ return wifi.isWifiEnabled(); } /** * A utility method for comparing two SSIDs. Some Android devices return an * SSID surrounded with quotes. For the sake of comparison and readability, * remove those. * * @param ssid1 * @param ssid2 * @return true if equals else false */ static boolean isSsidEquals(String ssid1, String ssid2) { if (ssid1 == null || ssid1.length() == 0 || ssid2 == null || ssid2.length() == 0) { return false; } return normalizeSSID(ssid1).equals(normalizeSSID(ssid2)); } /** * A utility method for removing wrapping quotes from SSID name. Some * Android devices return an SSID surrounded with quotes. For the sake of * comparison and readability, remove those. * * @param ssid * could be AJ_QA but also "AJ_QA" (with quotes). * @return normalized SSID: AJ_QA */ static String normalizeSSID(String ssid) { if (ssid != null && ssid.length() > 2 && ssid.startsWith("\"") && ssid.endsWith("\"")) { ssid = ssid.substring(1, ssid.length() -1); } return ssid; } /** * A utility method that checks if a password complies with WEP password * rules, and if it's in HEX format. * * @param password * @return {@link Pair} of two {@link Boolean} is it a valid WEP password * and is it a HEX password. */ static Pair checkWEPPassword(String password) { Log.d(TAG, "checkWEPPassword"); if (password == null || password.isEmpty()) { Log.w(TAG, "checkWEPPassword empty password"); return new Pair(false, false); } int length = password.length(); switch (length) { // valid ASCII keys length case 5: case 13: case 16: case 29: Log.d(TAG, "checkWEPPassword valid WEP ASCII password"); return new Pair(true, false); // valid hex keys length case 10: case 26: case 32: case 58: if (password.matches(WEP_HEX_PATTERN)) { Log.d(TAG, "checkWEPPassword valid WEP password length, and HEX pattern match"); return new Pair(true, true); } Log.w(TAG, "checkWEPPassword valid WEP password length, but HEX pattern matching failed: " + WEP_HEX_PATTERN); return new Pair(false, false); default: Log.w(TAG, "checkWEPPassword invalid WEP password length: " + length); return new Pair(false, false); } } ////////////////////////////////////////////////////////////////////// //NOTE: The below code was done to allow onboarding to function on // Android Lollipop. The change has been minimally tested for // other Android platforms and although it functions, previous // solution has been stress tested on multiple platforms and // validated avoid complications the code has been explicitly // split in order to avoid regression testing. ////////////////////////////////////////////////////////////////////// /** * Look through the supplicant and find a configuration that matches * the supplied ssid if one exists. * * @param ssid * name of the Wireless SSID that is to be found * @return WiFiConfiguration for supplied ssid if found, else null */ private WifiConfiguration findConfiguration(String ssid) { // the configured Wi-Fi networks final List wifiConfigs = wifi.getConfiguredNetworks(); // for debugging purposes only log the list StringBuffer buff = new StringBuffer(); for (WifiConfiguration w : wifiConfigs) { if (w.SSID != null) { w.SSID = normalizeSSID(w.SSID); if (w.SSID.length() > 1) { buff.append(w.SSID).append(","); } } } Log.i(TAG, "connectToWifiAP ConfiguredNetworks " + (buff.length() > 0 ? buff.toString().substring(0, buff.length() - 1) : " empty")); // find any existing WifiConfiguration that has the same SSID as the // supplied one and return it if found for (WifiConfiguration w : wifiConfigs) { if (w.SSID != null && isSsidEquals(w.SSID, ssid)) { Log.i(TAG, "connectToWifiAP found " + ssid + " in ConfiguredNetworks. networkId = " + w.networkId); return w; } } return null; } /** * Use {@link WifiManager} to connect to a Wi-Fi access point. *
            *
          • In case an access point with the same SSID exists, delete it. *
          • Create a new access point with SSID name , *
          • Verify that it is a valid one . *
          • Call {@link #connect(WifiConfiguration, int, long)}. *
          * * @param ssid Wi-Fi access point * @param authType * @param password * @param connectionTimeout in milliseconds * @param isHidden * */ private void lollipop_connectToWifiAP(String ssid, AuthType authType, String password, boolean isHidden,long connectionTimeout) { Log.d(TAG, "lollipop_connectToWifiAP SSID = " + ssid + " authtype = " + authType.toString()+ " is hidden = "+ isHidden); // if networkPass is null set it to "" if (password == null) { password = ""; } int networkId = -1; boolean shouldUpdate = false; WifiConfiguration wifiConfiguration = findConfiguration(ssid); if(wifiConfiguration == null) { wifiConfiguration = new WifiConfiguration(); } else { shouldUpdate = true; } // check the AuthType of the SSID against the WifiManager // if null use the one given by the API // else use the result from getSSIDAuthType AuthType verrifiedWifiAuthType = getSSIDAuthType(ssid); if (verrifiedWifiAuthType != null) { authType = verrifiedWifiAuthType; } if (isHidden){ wifiConfiguration.hiddenSSID=true; } Log.i(TAG, "lollipop_connectToWifiAP selectedAuthType = " + authType); // set the priority to something high so that the network we are entering should be used wifiConfiguration.priority = 140; // set the WifiConfiguration parameters switch (authType) { case OPEN: wifiConfiguration.SSID = "\"" + ssid + "\""; wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE); networkId = shouldUpdate ? wifi.updateNetwork(wifiConfiguration) : wifi.addNetwork(wifiConfiguration); Log.d(TAG, "lollipop_connectToWifiAP [OPEN] add Network returned " + networkId); break; case WEP: wifiConfiguration.SSID = "\"" + ssid + "\""; // check the validity of a WEP password Pair wepCheckResult = checkWEPPassword(password); if (!wepCheckResult.first) { Log.i(TAG, "lollipop_connectToWifiAP auth type = WEP: password " + password + " invalid length or charecters"); Bundle extras = new Bundle(); extras.putParcelable(OnboardingManager.EXTRA_WIFI_WIFICONFIGURATION, wifiConfiguration); sendBroadcast(OnboardingManager.WIFI_AUTHENTICATION_ERROR, extras); return; } Log.i(TAG, "lollipop_connectToWifiAP [WEP] using " + (!wepCheckResult.second ? "ASCII" : "HEX")); if (!wepCheckResult.second) { wifiConfiguration.wepKeys[0] = "\"" + password + "\""; } else { wifiConfiguration.wepKeys[0] = password; } wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE); wifiConfiguration.allowedProtocols.set(WifiConfiguration.Protocol.RSN); wifiConfiguration.allowedProtocols.set(WifiConfiguration.Protocol.WPA); wifiConfiguration.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN); wifiConfiguration.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.SHARED); wifiConfiguration.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP); wifiConfiguration.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP); wifiConfiguration.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40); wifiConfiguration.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP104); wifiConfiguration.wepTxKeyIndex = 0; networkId = shouldUpdate ? wifi.updateNetwork(wifiConfiguration) : wifi.addNetwork(wifiConfiguration); Log.d(TAG, "lollipop_connectToWifiAP [WEP] add Network returned " + networkId); break; case WPA_AUTO: case WPA_CCMP: case WPA_TKIP: case WPA2_AUTO: case WPA2_CCMP: case WPA2_TKIP: { wifiConfiguration.SSID = "\"" + ssid + "\""; // handle special case when WPA/WPA2 and 64 length password that can // be HEX if (password.length() == 64 && password.matches(WEP_HEX_PATTERN)) { wifiConfiguration.preSharedKey = password; } else { wifiConfiguration.preSharedKey = "\"" + password + "\""; } wifiConfiguration.status = WifiConfiguration.Status.ENABLED; wifiConfiguration.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP); wifiConfiguration.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP); wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK); wifiConfiguration.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP); wifiConfiguration.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP); wifiConfiguration.allowedProtocols.set(WifiConfiguration.Protocol.RSN); wifiConfiguration.allowedProtocols.set(WifiConfiguration.Protocol.WPA); networkId = shouldUpdate ? wifi.updateNetwork(wifiConfiguration) : wifi.addNetwork(wifiConfiguration); Log.d(TAG, "lollipop_connectToWifiAP [WPA..WPA2] add Network returned " + networkId); break; } default: networkId = -1; break; } if (networkId < 0) { Log.d(TAG, "lollipop_connectToWifiAP networkId <0 WIFI_AUTHENTICATION_ERROR"); Bundle extras = new Bundle(); extras.putParcelable(OnboardingManager.EXTRA_WIFI_WIFICONFIGURATION, wifiConfiguration); sendBroadcast(OnboardingManager.WIFI_AUTHENTICATION_ERROR, extras); return; } Log.d(TAG, "lollipop_connectToWifiAP calling connect"); //We will now save the configuration and then look back up the networkId //saveConfiguration may cause networkId to change boolean res = wifi.saveConfiguration(); Log.d(TAG, "lollipop_connectToWifiAP saveConfiguration status=" + res); wifiConfiguration = findConfiguration(ssid); if(wifiConfiguration == null) { Log.d(TAG, "lollipop_connectToWifiAP Could not find configuration after adding"); Bundle extras = new Bundle(); extras.putParcelable(OnboardingManager.EXTRA_WIFI_WIFICONFIGURATION, wifiConfiguration); sendBroadcast(OnboardingManager.WIFI_AUTHENTICATION_ERROR, extras); return; } lillipop_connect(wifiConfiguration, wifiConfiguration.networkId, connectionTimeout); } /** * Make the actual connection to the requested Wi-Fi target. * * @param wifiConfig * details of the Wi-Fi access point used by the WifiManger * @param networkId * id of the Wi-Fi configuration * @param timeoutMsec * period of time in Msec to complete Wi-Fi connection task */ private void lillipop_connect(final WifiConfiguration wifiConfig, final int networkId, final long timeoutMsec) { Log.i(TAG, "lillipop_connect SSID=" + wifiConfig.SSID + " within " + timeoutMsec); boolean res; synchronized (this) { targetWifiConfiguration = wifiConfig; } // this is the application's Wi-Fi connection timeout wifiTimeoutTimer.schedule(new TimerTask() { @Override public void run() { Log.e(TAG, "lillipop_connect Network Listener WIFI_TIMEOUT when trying to connect to " + normalizeSSID(targetWifiConfiguration.SSID)); Bundle extras = new Bundle(); extras.putParcelable(OnboardingManager.EXTRA_WIFI_WIFICONFIGURATION, wifiConfig); sendBroadcast(OnboardingManager.WIFI_TIMEOUT_ACTION, extras); } }, timeoutMsec); res = wifi.disconnect(); Log.d(TAG, "lillipop_connect disconnect status=" + res); if ( !wifi.isWifiEnabled() ) { wifi.setWifiEnabled(true); } // enabling a network doesn't guarantee that it's the one that Android // will connect to. // Selecting a particular network is achieved by passing 'true' here to // disable all other networks. // the side effect is that all other user's Wi-Fi networks become // disabled. // The recovery for that is enableAllWifiNetworks method. res = wifi.enableNetwork(networkId, true); Log.d(TAG, "lillipop_connect enableNetwork [true] status=" + res); // Wait a few for the WiFi to do something and try again just in case // Android has decided that the network we configured is not "good enough" try{ Thread.sleep(500); } catch(Exception e) {} res = wifi.enableNetwork(networkId, true); Log.d(TAG, "lillipop_connect enableNetwork [true] status=" + res); } } base-15.09/onboarding/java/OnboardingManager/android/src/org/alljoyn/onboarding/sdk/WiFiNetwork.java000066400000000000000000000113041262264444500335160ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.sdk; import org.alljoyn.onboarding.OnboardingService.AuthType; import android.os.Parcel; import android.os.Parcelable; /** * WiFiNetwork encapsulates information retrieved from a WIFI scan */ public class WiFiNetwork implements Parcelable { /** * WIFI SSID name */ protected String SSID = null; /** * WIFI authentication type @see org.alljoyn.onboarding.OnboardingService.AuthType */ protected AuthType authType; /** * WIFI signal strength */ protected int level = 0; /** * Constructor */ public WiFiNetwork() { } /** * Constructor with SSID * * @param SSID */ public WiFiNetwork(String SSID) { this.SSID = SSID; } /** * Constructor with SSID,capabilities,level * * @param SSID * @param capabilities * @param level */ public WiFiNetwork(String SSID, String capabilities, int level) { this.SSID = SSID; this.authType = capabilitiesToAuthType(capabilities); this.level = level; } /** * Constructor from a Parcel * * @param in */ public WiFiNetwork(Parcel in) { this.SSID = in.readString(); this.authType = AuthType.getAuthTypeById((short) in.readInt()); this.level = in.readInt(); } @Override public int describeContents() { return 0; } @Override /** * write the members to the Parcel */ public void writeToParcel(Parcel dest, int flags) { dest.writeString(SSID); dest.writeInt(authType.getTypeId()); dest.writeInt(level); } public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { @Override public WiFiNetwork createFromParcel(Parcel in) { return new WiFiNetwork(in); } @Override public WiFiNetwork[] newArray(int size) { return new WiFiNetwork[size]; } }; /** * Get {@link #SSID} * * @return the ssid of the Wi-Fi network {@link #SSID} */ public String getSSID() { return SSID; } /** * Set {@link #SSID} * * @param SSID {@link #SSID} */ public void setSSID(String SSID) { this.SSID = SSID; } /** * Get {@link #authType} * * @return the authentication type of the Wi-Fi network {@link #authType} */ public AuthType getAuthType() { return authType; } /** * Get {@link #level} * * @return the signal level of Wi-Fi network {@link #level} */ public int getLevel() { return level; } /** * Converts capabilities string to AuthType * @param capabilities string representing the possible Wi-Fi authentication scheme * @return authentication type complies to @see org.alljoyn.onboarding.OnboardingService.AuthType */ private AuthType capabilitiesToAuthType(String capabilities) { if (capabilities.contains("WPA2")) { if (capabilities.contains("TKIP")) { return AuthType.WPA2_TKIP; } else if (capabilities.contains("CCMP")) { return AuthType.WPA2_CCMP; } else { return AuthType.WPA2_AUTO; } } if (capabilities.contains("WPA")) { if (capabilities.contains("TKIP")) { return AuthType.WPA_TKIP; } else if (capabilities.contains("CCMP")) { return AuthType.WPA_CCMP; } else { return AuthType.WPA_AUTO; } } if (capabilities.contains(AuthType.WEP.name())) { return AuthType.WEP; } return AuthType.OPEN; } } WiFiNetworkConfiguration.java000066400000000000000000000064571262264444500362040ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/src/org/alljoyn/onboarding/sdk/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.sdk; import org.alljoyn.onboarding.OnboardingService.AuthType; import android.os.Parcel; import android.os.Parcelable; /** * WiFiNetwork encapsulates information how to connect to a WIFI network * */ public class WiFiNetworkConfiguration extends WiFiNetwork implements Parcelable { /** * WIFI password */ private String password = null; /** * WIFI SSID hidden */ private boolean hidden = false; /** * Constructor with SSID,authType,password,cipher * * @param SSID * @param authType * @param password */ public WiFiNetworkConfiguration(String SSID, AuthType authType, String password) { super.setSSID(SSID); this.password = password; this.authType = authType; } public WiFiNetworkConfiguration(String SSID, AuthType authType, String password, boolean isHidden) { super.setSSID(SSID); this.password = password; this.authType = authType; this.hidden = isHidden; } /** * Constructor from a Parcel * * @param in */ public WiFiNetworkConfiguration(Parcel in) { SSID = in.readString(); password = in.readString(); authType = AuthType.getAuthTypeById((short) in.readInt()); hidden = (in.readByte() != 0); } @Override public int describeContents() { return 0; } @Override /** * write the members to the Parcel */ public void writeToParcel(Parcel dest, int flags) { dest.writeString(SSID); dest.writeString(password); dest.writeInt(authType.getTypeId()); dest.writeByte((byte) (hidden ? 1 : 0)); } public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { @Override public WiFiNetworkConfiguration createFromParcel(Parcel in) { return new WiFiNetworkConfiguration(in); } @Override public WiFiNetworkConfiguration[] newArray(int size) { return new WiFiNetworkConfiguration[size]; } }; /** * Get {@link #password} * * @return the password of the network {@link #password} */ public String getPassword() { return password; } public boolean isHidden() { return hidden; } } WifiDisabledException.java000066400000000000000000000024161262264444500354400ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingManager/android/src/org/alljoyn/onboarding/sdk/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.sdk; /** * Thrown to indicate that Wi-Fi is disabled. */ @SuppressWarnings("serial") public class WifiDisabledException extends Exception { public WifiDisabledException(String message) { super(message); } public WifiDisabledException() { super(); } } base-15.09/onboarding/java/OnboardingService/000077500000000000000000000000001262264444500211215ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingService/.classpath000066400000000000000000000005641262264444500231110ustar00rootroot00000000000000 base-15.09/onboarding/java/OnboardingService/.project000066400000000000000000000005701262264444500225720ustar00rootroot00000000000000 OnboardingService org.eclipse.jdt.core.javabuilder org.eclipse.jdt.core.javanature base-15.09/onboarding/java/OnboardingService/build.xml000066400000000000000000000062171262264444500227500ustar00rootroot00000000000000 AllJoyn™ OnBoarding Service Version 15.09.00]]> AllJoyn™ OnBoarding Service Java API Reference Manual Version 15.09.00
          Copyright AllSeen Alliance, Inc. All Rights Reserved.

          AllSeen, AllSeen Alliance, and AllJoyn are trademarks of the AllSeen Alliance, Inc in the United States and other jurisdictions.

          THIS DOCUMENT AND ALL INFORMATION CONTAIN HEREIN ARE PROVIDED ON AN "AS-IS" BASIS WITHOUT WARRANTY OF ANY KIND.
          MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
          ]]>
          base-15.09/onboarding/java/OnboardingService/src/000077500000000000000000000000001262264444500217105ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingService/src/org/000077500000000000000000000000001262264444500224775ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/000077500000000000000000000000001262264444500241475ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/onboarding/000077500000000000000000000000001262264444500262715ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/onboarding/OnboardingService.java000066400000000000000000000124371262264444500325460ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding; import org.alljoyn.bus.BusAttachment; import org.alljoyn.onboarding.client.OnboardingClient; import org.alljoyn.services.common.ServiceAvailabilityListener; /** * An interface for both Onboarding client (onboarder) and server (onboardee). */ public interface OnboardingService { /** * SDK version */ public static final int PROTOCOL_VERSION = 1; /** * Enumeration of authentication types * -3 - wpa2_auto, onboardee should try WPA2_TKIP and WPA2_CCMP * -2 - wpa_auto, onboardee should try WPA_TKIP and WPA_CCMP * -1 - any, The onboardee chooses the authentication * 0 - Open Personal AP is open * 1 - WEP * 2 - WPA_TKIP * 3 - WPA_CCMP * 4 - WPA2_TKIP * 5 - WPA2_CCMP * 6 - WPSS */ public static enum AuthType { WPA2_AUTO ((short)-3), WPA_AUTO ((short)-2), ANY ((short)-1), OPEN ((short)0), WEP ((short)1), WPA_TKIP ((short)2), WPA_CCMP ((short)3), WPA2_TKIP ((short)4), WPA2_CCMP ((short)5), WPS ((short)6); /** * Type id */ private short id; /** * Constructor * @param id */ private AuthType(short id) { this.id = id; } /** * Returns the id of authentication type * @return id of authentication type */ public short getTypeId() { return id; } /** * Search for authentication type with the given Id. If not found returns NULL * @param typeId type id * @return authentication type */ public static AuthType getAuthTypeById(short typeId) { AuthType retType = null; for (AuthType type : AuthType.values()) { if ( typeId == type.getTypeId() ) { retType = type; break; } } return retType; } } /** * Enumeration of onboarding state * 0 - Personal AP Not Configured * 1 - Personal AP Configured/Not Validated * 2 - Personal AP Configured/Validating * 3 - Personal AP Configured/Validated * 4 - Personal AP Configured/Error * 5 - Personal AP Configured/Retry */ public static enum OnboardingState { PERSONAL_AP_NOT_CONFIGURED ((short)0), PERSONAL_AP_CONFIGURED_NOT_VALIDATED ((short)1), PERSONAL_AP_CONFIGURED_VALIDATING ((short)2), PERSONAL_AP_CONFIGURED_VALIDATED ((short)3), PERSONAL_AP_CONFIGURED_ERROR ((short)4), PERSONAL_AP_CONFIGURED_RETRY ((short)5); /** * Type id */ private short id; /** * Constructor * @param id */ private OnboardingState(short id) { this.id = id; } /** * Returns the id of state type * @return id of state type */ public short getStateId() { return id; } /** * Search for Onboarding state with the given Id. If not found returns NULL * @param stateId type id * @return onboarding state */ public static OnboardingState getStateById(short stateId) { OnboardingState retState = null; for (OnboardingState state : OnboardingState.values()) { if ( stateId == state.getStateId() ) { retState = state; break; } } return retState; } } /** * Get the onboarding state * @return onboarding state */ public OnboardingState getState(); /** * Start server mode (onboardee). The application creates the BusAttachment * @param busAttachment the AllJoyn bus attachment. * @throws Exception */ public void startOnboardingServer(BusAttachment busAttachment) throws Exception; /** * Stop server mode (onboardee) * @throws Exception */ void stopOnboardingServer() throws Exception; /** * Create an Onboarding client for a peer onboardee. * @param deviceName the remote device * @param serviceAvailabilityListener listener for connection loss * @param port the peer's bound port of the Onboarding server * @return OnboardingClient for running a session with the peer * @throws Exception */ OnboardingClient createOnboardingClient(String deviceName, ServiceAvailabilityListener serviceAvailabilityListener, short port) throws Exception; /** * Start client mode (onboarder). The application creates the BusAttachment * @param bus the AllJoyn bus attachment * @throws Exception */ void startOnboardingClient(BusAttachment bus) throws Exception; /** * Stop client mode (onboarder). */ void stopOnboardingClient(); } base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/onboarding/client/000077500000000000000000000000001262264444500275475ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/onboarding/client/OnboardingClient.java000066400000000000000000000120121262264444500336270ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.client; import org.alljoyn.bus.BusException; import org.alljoyn.onboarding.OnboardingService.AuthType; import org.alljoyn.onboarding.transport.ConnectionResultListener; import org.alljoyn.onboarding.transport.OBLastError; import org.alljoyn.onboarding.transport.OnboardingTransport.ConfigureWifiMode; import org.alljoyn.onboarding.transport.ScanInfo; import org.alljoyn.services.common.ClientBase; /** * An interface for onboarding a remote IoE device (onboardee). Encapsulates the * OnboardingTransport BusInterface */ public interface OnboardingClient extends ClientBase { /** * Returns the configured state of the onboardee * * @return the onboarding state: 0 - Personal AP Not Configured 1 - Personal * AP Configured/Not Validated 2 - Personal AP Configured/Validating * 3 - Personal AP Configured/Validated 4 - Personal AP * Configured/Error 5 - Personal AP Configured/Retry * @throws BusException */ public short getState() throws BusException; /** * Get the last error. During most of the onboarding process, the onboarder * and onboardee are on different networks so returning a sync result isn't * possible. Especially when there was an error and the onboardee did not * connect to the onboarder's network. The onboardee then opens a soft AP to * which the onboarder connects, and this method is how the onboarder can * query about what happened. * * @return last error * @throws BusException */ public OBLastError GetLastError() throws BusException; /** * Send the personal AP info to the onboardee. The onboardee doesn't try to * connect yet. It waits for {@link #connectWiFi()} When the authType is * equal to "any", the onboardee needs to try out all the possible * authentication types it supports to connect to the AP. * * @param ssid * the personal AP SSID * @param passphrase * the personal AP passphrase * @param authType * the authentication type of the AP * @return Wifi mode regular or fast channel * @throws BusException * If authType parameter is invalid then the AllJoyn error code * org.alljoyn.Error.OutOfRange will be returned */ public ConfigureWifiMode configureWiFi(String ssid, String passphrase, AuthType authType) throws BusException; /** * Tell the onboardee to connect to the Personal AP. The onboardee is * recommended to use channel switching feature if it is available. That is, * keep the soft AP open with the onboarder, while trying to connect to the * personal AP. * * @throws BusException */ public void connectWiFi() throws BusException; /** * Tell the onboardee to disconnect from the personal AP, clear the personal * AP configuration fields, and start the soft AP mode. * * @throws BusException */ public void offboard() throws BusException; /** * Scan all the WiFi access points in the onboardee's proximity, so that the * onboarder can select the proper one. Some devices may not support this * feature. * * @return ScanInfo an array of scan results. * @throws BusException * If device doesn't support the feature, the AllJoyn error code * org.alljoyn.Error.FeatureNotAvailable will be returned in the * AllJoyn response. */ public ScanInfo getScanInfo() throws BusException; /*** * Register to receive ConnectionResult signal data. * This is relevant in fast channel switching mode. * * @param listener callback class to receive data. * @throws BusException if registration fails */ public void registerConnectionResultListener(ConnectionResultListener listener) throws BusException; /** * Unregister from receiving ConnectionResult signal data. * @param listener */ public void unRegisterConnectionResultListener(ConnectionResultListener listener); } OnboardingClientImpl.java000066400000000000000000000177031262264444500344060ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/onboarding/client/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.client; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.BusException; import org.alljoyn.bus.BusObject; import org.alljoyn.bus.ErrorReplyBusException; import org.alljoyn.bus.ProxyBusObject; import org.alljoyn.bus.Status; import org.alljoyn.bus.annotation.BusSignalHandler; import org.alljoyn.onboarding.OnboardingService.AuthType; import org.alljoyn.onboarding.transport.ConnectionResult; import org.alljoyn.onboarding.transport.ConnectionResult.ConnectionResponseType; import org.alljoyn.onboarding.transport.ConnectionResultAJ; import org.alljoyn.onboarding.transport.ConnectionResultListener; import org.alljoyn.onboarding.transport.OBLastError; import org.alljoyn.onboarding.transport.OnboardingTransport; import org.alljoyn.onboarding.transport.OnboardingTransport.ConfigureWifiMode; import org.alljoyn.onboarding.transport.ScanInfo; import org.alljoyn.services.common.ClientBaseImpl; import org.alljoyn.services.common.ServiceAvailabilityListener; /** * A default implementation of the OnboardingClient interface */ public class OnboardingClientImpl extends ClientBaseImpl implements OnboardingClient { /** * Used to register the bus object upon the bus attachment */ private final static String CONNECTION_RESULT_PATH = "/OnboardingTranport/ConnectionResult"; /** * Stores instance of ConnectionResultReceiver */ private ConnectionResultReceiver receiver = null; /** * Stores instance of ConnectionResultListener {@link ConnectionResultListener} */ private ConnectionResultListener connectionResultListener = null; /** * Internal class used for receiving ConnectionResult signal . * Calls onConnectionResult to the CallBack ConnectionResultListener to deliver the signal data. */ private class ConnectionResultReceiver implements BusObject { @BusSignalHandler(iface = OnboardingTransport.INTERFACE_NAME, signal = "ConnectionResult") public void ConnectionResult(ConnectionResultAJ connectionResultAJ) { ConnectionResult.ConnectionResponseType connectionResponseType =ConnectionResult.ConnectionResponseType.getConnectionResponseTypeByValue(connectionResultAJ.code); if (connectionResponseType==null){ connectionResponseType=ConnectionResponseType.ERROR_MESSAGE; } if (connectionResultListener!=null){ connectionResultListener.onConnectionResult(new ConnectionResult(connectionResponseType, connectionResultAJ.message)); } } } @SuppressWarnings("deprecation") public OnboardingClientImpl(String m_deviceName, BusAttachment bus, ServiceAvailabilityListener serviceAvailabilityListener, short port) { super(m_deviceName, bus, serviceAvailabilityListener, OnboardingTransport.OBJ_PATH, OnboardingTransport.class, port); } @Override public short getVersion() throws BusException { ProxyBusObject proxyObj = getProxyObject(); /* * We make calls to the methods of the AllJoyn object through one of its * interfaces. */ OnboardingTransport onboardingTransport = proxyObj.getInterface(OnboardingTransport.class); return onboardingTransport.getVersion(); } @Override public void connectWiFi() throws BusException { ProxyBusObject proxyObj = getProxyObject(); // We make calls to the methods of the AllJoyn object through one of its // interfaces. OnboardingTransport onboardingTransport = proxyObj.getInterface(OnboardingTransport.class); onboardingTransport.Connect(); } @Override public ConfigureWifiMode configureWiFi(String ssid, String passphrase, AuthType authType) throws BusException { ProxyBusObject proxyObj = getProxyObject(); // We make calls to the methods of the AllJoyn object through one of its // interfaces. OnboardingTransport onboardingTransport = proxyObj.getInterface(OnboardingTransport.class); short val=onboardingTransport.ConfigureWiFi(ssid, passphrase, authType.getTypeId()); ConfigureWifiMode ret=ConfigureWifiMode.getConfigureWifiModeByValue(val); //in case the result of the ConfigureWiFi is not REGULAR /FAST_CHANNNEL set it to be REGULAR. if (ret==null){ throw new ErrorReplyBusException("org.alljoyn.Error.InvalidValue", "configureWiFi returned an invalid value: " + ret); } return ret; } @Override public void offboard() throws BusException { ProxyBusObject proxyObj = getProxyObject(); // We make calls to the methods of the AllJoyn object through one of its // interfaces. OnboardingTransport onboardingTransport = proxyObj.getInterface(OnboardingTransport.class); onboardingTransport.Offboard(); } @Override public ScanInfo getScanInfo() throws BusException { ProxyBusObject proxyObj = getProxyObject(); // We make calls to the methods of the AllJoyn object through one of its // interfaces. OnboardingTransport onboardingTransport = proxyObj.getInterface(OnboardingTransport.class); return onboardingTransport.GetScanInfo(); } @Override public short getState() throws BusException { ProxyBusObject proxyObj = getProxyObject(); // We make calls to the methods of the AllJoyn object through one of its // interfaces. OnboardingTransport onboardingTransport = proxyObj.getInterface(OnboardingTransport.class); return onboardingTransport.getState(); } @Override public OBLastError GetLastError() throws BusException { ProxyBusObject proxyObj = getProxyObject(); // We make calls to the methods of the AllJoyn object through one of its // interfaces. OnboardingTransport onboardingTransport = proxyObj.getInterface(OnboardingTransport.class); return onboardingTransport.getLastError(); } @Override public void registerConnectionResultListener(ConnectionResultListener listener) throws BusException { if (receiver == null) { receiver = new ConnectionResultReceiver(); } Status status = this.m_bus.registerBusObject(receiver, CONNECTION_RESULT_PATH); if (status != Status.OK) { throw new BusException("registerBusObject " + CONNECTION_RESULT_PATH + " signal handler has failed, Status: '" + status + "'"); } status = this.m_bus.registerSignalHandlers(receiver); if (status != Status.OK) { throw new BusException("registerSignalHandlers " + CONNECTION_RESULT_PATH + " signal handler has failed, Status: '" + status + "'"); } this.connectionResultListener = listener; } @Override public void unRegisterConnectionResultListener(ConnectionResultListener listener) { if (receiver != null) { this.connectionResultListener=null; this.m_bus.unregisterSignalHandlers(receiver); this.m_bus.unregisterBusObject(receiver); } } } base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/onboarding/transport/000077500000000000000000000000001262264444500303255ustar00rootroot00000000000000ConnectionResult.java000066400000000000000000000066001262264444500344110ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/onboarding/transport/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.transport; /** * Wraps the signal that is emitted when the connection attempt against the personal AP is completed. * This signal will be received only if the fast channel switching feature is supported by the device. */ public class ConnectionResult { /** * ConnectionResult message */ private final String message; /** * ConnectionResult response code */ private final ConnectionResponseType connectionResponseType; /** * These enumeration values are returned from a device that supports fast channel switching .It is reported after the device tries to verify * the validity of the Wi-Fi parameters received via {@link OnboardingTransport#ConfigureWiFi(String, String, short)} */ public static enum ConnectionResponseType { /** * Wi-Fi validated */ VALIDATED((short) 0), /** * Wi-Fi unreachable */ UNREACHABLE((short) 1), /** * Wi-Fi AP doesn't support the authentication received */ UNSUPPORTED_PROTOCOL((short) 2), /** * Wi-Fi authentication error */ UNAUTHORIZED((short) 3), /** * Misc error */ ERROR_MESSAGE((short) 4); private short value; /** * * @param value */ private ConnectionResponseType(short value) { this.value = value; } /** * Returns the id of authentication type * * @return id of authentication type */ public short getValue() { return value; } public static ConnectionResponseType getConnectionResponseTypeByValue(short value) { ConnectionResponseType ret = null; for (ConnectionResponseType responseType : ConnectionResponseType.values()) { if (value == responseType.getValue()) { ret = responseType; break; } } return ret; } } public ConnectionResult(ConnectionResponseType connectionResponseType, String message) { this.message = message; this.connectionResponseType = connectionResponseType; } public String getMessage() { return message; } public ConnectionResponseType getConnectionResponseType() { return connectionResponseType; } } ConnectionResultAJ.java000066400000000000000000000023541262264444500346260ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/onboarding/transport/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.transport; import org.alljoyn.bus.annotation.Position; /** * Used for passing ConnectionResult signal over the AllJoyn bus. */ public class ConnectionResultAJ { @Position(0) public short code; @Position(1) public String message; } ConnectionResultListener.java000066400000000000000000000023471262264444500361230ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/onboarding/transport/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.transport; /** * A callback for receiving ConnectionResult signal data from devices that support fast switching channel */ public interface ConnectionResultListener { public void onConnectionResult(ConnectionResult connectionResutl); } base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/onboarding/transport/MyScanResult.java000066400000000000000000000034041262264444500335620ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.transport; import org.alljoyn.bus.annotation.Position; import org.alljoyn.onboarding.OnboardingService.AuthType; /** * A struct that represents a WiFi scan result: SSID and authType. */ public class MyScanResult { /** * The personal AP SSID */ @Position(0) public String m_ssid; /** * The personal AP authentication type * -3 - wpa2_auto, onboardee should try WPA2_TKIP and WPA2_CCMP * -2 - wpa_auto, onboardee should try WPA_TKIP and WPA_CCMP * -1 - any, The onboardee chooses the authentication * 0 - Open Personal AP is open * 1 - WEP * 2 - WPA_TKIP * 3 - WPA_CCMP * 4 - WPA2_TKIP * 5 - WPA2_CCMP * 6 - WPS * @see {@link AuthType} */ @Position(1) public short m_authType; } base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/onboarding/transport/OBLastError.java000066400000000000000000000045201262264444500333270ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.transport; import org.alljoyn.bus.annotation.Position; /** * A class that represents the last onboarding error: The last error code and error message */ public class OBLastError { /** * The error code of the last validation * 0 - Validated * 1 - Unreachable * 2 - Unsupported_protocol * 3 - Unauthorized * 4 - Error_message */ @Position(0) public short m_errorCode; /** * The error message of the last validation * Error_message is the error message received from the underlying Wifi layer. */ @Position(1) public String m_errorMsg; public OBLastError() { } /** * Get the last validation error code * @return the last error code * 0 - Validated * 1 - Unreachable * 2 - Unsupported_protocol * 3 - Unauthorized * 4 - Error_message */ public short getErrorCode() { return m_errorCode; } /** * Set the last validation error code * @param errorCode */ public void setErrorCode(short errorCode) { m_errorCode = errorCode; } /** * Get the last validation error message * @return the error message received from the underlying Wifi layer. */ public String getErrorMessage() { return m_errorMsg; } /** * Set the last validation error message * @param errorMsg */ public void setErrorMessage(String errorMsg) { m_errorMsg = errorMsg; } } OnboardingTransport.java000066400000000000000000000132021262264444500351060ustar00rootroot00000000000000base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/onboarding/transport/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.transport; import org.alljoyn.bus.BusException; import org.alljoyn.bus.BusObject; import org.alljoyn.bus.annotation.BusAnnotation; import org.alljoyn.bus.annotation.BusAnnotations; import org.alljoyn.bus.annotation.BusInterface; import org.alljoyn.bus.annotation.BusMethod; import org.alljoyn.bus.annotation.BusProperty; import org.alljoyn.bus.annotation.BusSignal; import org.alljoyn.bus.annotation.Secure; /** * Definition of the Onboarding BusInterface */ @BusInterface(name = OnboardingTransport.INTERFACE_NAME, announced = "true") @Secure public interface OnboardingTransport extends BusObject { public static final String INTERFACE_NAME = "org.alljoyn.Onboarding"; public final static String OBJ_PATH = "/Onboarding"; /** * These enumeration values are used to indicate the ConfigureWifi possible * modes */ public static enum ConfigureWifiMode { /** * Wi-Fi standard mode */ REGULAR((short) 1), /** * Wi-Fi fast channel switching mode */ FAST_CHANNEL_SWITCHING((short) 2); private final short value; private ConfigureWifiMode(short value) { this.value = value; } public short getValue() { return value; } public static ConfigureWifiMode getConfigureWifiModeByValue(short value) { ConfigureWifiMode retState = null; for (ConfigureWifiMode responseType : ConfigureWifiMode.values()) { if (value == responseType.getValue()) { retState = responseType; break; } } return retState; } } /** * @return the interface version * @throws BusException */ @BusProperty(signature = "q") public short getVersion() throws BusException; /** * @return the state - one of the following values: 0 - Personal AP Not * Configured 1 - Personal AP Configured/Not Validated 2 - Personal * AP Configured/Validating 3 - Personal AP Configured/Validated 4 - * Personal AP Configured/Error 5 - Personal AP Configured/Retry * @throws BusException */ @BusProperty(signature = "n") public short getState() throws BusException; /** * @return the last error 0 - Validated 1 - Unreachable 2 - * Unsupported_protocol 3 - Unauthorized 4 - Error_message * @throws BusException */ @BusProperty(signature = "(ns)") public OBLastError getLastError() throws BusException; /** * Tell the onboardee to connect to the Personal AP. The onboardee is * recommended to use channel switching feature if it is available. * * @throws BusException */ @BusMethod() @BusAnnotations({ @BusAnnotation(name = "org.freedesktop.DBus.Method.NoReply", value = "true") }) public void Connect() throws BusException; /** * Send the personal AP info to the onboardee. When the authType is equal to * "any", the onboardee needs to try out all the possible authentication * types it supports to connect to the AP. If authType parameter is invalid * then the AllJoyn error code org.alljoyn.Error.OutOfRange will be returned * * @param ssid * @param passphrase * @param authType * - one of the following values WPA2_AUTO = -3, WPA_AUTO = -2, * any = -1, Open = 0 , WEP = 1, WPA_TKIP =2, WPA_CCMP = 3, * WPA2_TKIP = 4, WPA2_CCMP = 5, WPS = 6 * @throws BusException */ @BusMethod(signature = "ssn", replySignature = "n") public short ConfigureWiFi(String ssid, String passphrase, short authType) throws BusException; /** * Tell the onboardee to disconnect from the personal AP, clear the personal * AP configuration fields, and start the soft AP mode. */ @BusMethod() @BusAnnotations({ @BusAnnotation(name = "org.freedesktop.DBus.Method.NoReply", value = "true") }) public void Offboard() throws BusException; /** * Scan all the WiFi access points in the onboardee's proximity. Some device * may not support this feature. * * @throws BusException * if feature is unsupported, AllJoyn error code * org.alljoyn.Error.FeatureNotAvailable will be returned in the * AllJoyn response. */ @BusMethod(replySignature = "qa(sn)") public ScanInfo GetScanInfo() throws BusException; /** * Signal received after ConfigureWiFi status is 2 * * @param connectionResultAJ */ @BusSignal(signature = "(ns)") public void ConnectionResult(ConnectionResultAJ connectionResultAJ); } base-15.09/onboarding/java/OnboardingService/src/org/alljoyn/onboarding/transport/ScanInfo.java000066400000000000000000000040361262264444500326730ustar00rootroot00000000000000/****************************************************************************** * Copyright AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ package org.alljoyn.onboarding.transport; import org.alljoyn.bus.annotation.Position; /** * A class that represents a WiFi scan: an array of SSID and authType, with an age */ public class ScanInfo { /** * age reflects how long ago was the scan procedure performed by the device. The units are in minutes. */ @Position(0) public short m_age; /** * An array of {@link MyScanResult}. Each one represents a potential personal AP: SSID and authType. */ @Position(1) public MyScanResult[] m_scanResults; public ScanInfo() { } /** * Get the age of the scan * @return age in minutes */ public short getAge() { return m_age; } /** * set the age of the scan * @param age in minutes */ public void setAge(short age) { m_age = age; } /** * Get the Scan Result * @return an array of SSID,AuthType pairs */ public MyScanResult[] getScanResults() { return m_scanResults; } /** * Set the scan result * @param result */ public void setScanResult(MyScanResult[] result) { m_scanResults = result; } } base-15.09/onboarding/java/sample_applications/000077500000000000000000000000001262264444500215455ustar00rootroot00000000000000base-15.09/onboarding/java/sample_applications/android/000077500000000000000000000000001262264444500231655ustar00rootroot00000000000000base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient/000077500000000000000000000000001262264444500310435ustar00rootroot00000000000000base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient/.classpath000066400000000000000000000007221262264444500330270ustar00rootroot00000000000000 base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient/.project000066400000000000000000000015001262264444500325060ustar00rootroot00000000000000 Onboarding Manager Sample App com.android.ide.eclipse.adt.ResourceManagerBuilder com.android.ide.eclipse.adt.PreCompilerBuilder org.eclipse.jdt.core.javabuilder com.android.ide.eclipse.adt.ApkBuilder com.android.ide.eclipse.adt.AndroidNature org.eclipse.jdt.core.javanature AndroidManifest.xml000066400000000000000000000040171262264444500345570ustar00rootroot00000000000000base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient/build.xml000066400000000000000000000022571262264444500326720ustar00rootroot00000000000000 project.properties000066400000000000000000000010631262264444500345500ustar00rootroot00000000000000base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient# 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 base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient/res/000077500000000000000000000000001262264444500316345ustar00rootroot00000000000000base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient/res/drawable/000077500000000000000000000000001262264444500334155ustar00rootroot00000000000000error.png000066400000000000000000000064421262264444500352030ustar00rootroot00000000000000base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient/res/drawable‰PNG  IHDR##ŮłY pHYs  šś OiCCPPhotoshop ICC profilexÚťSgTSé=÷ŢôBK€”KoR RB‹€‘&*! J!ˇŮQÁEEČ ŽŽ€ŚQ, Š Řä!˘ŽŁŠĘűá{ŁkÖĽ÷ćÍţµ×>ç¬óťłĎŔ –H3Q5€ ©BŕÇÄĆáä.@ $płd!sý#ř~<<+"ŔľxÓ ŔM›Ŕ0‡˙ęB™\€„Ŕt‘8K€@zŽB¦@F€ť&S `ËcbăP-`'ćÓ€ťř™{[”! ‘ eDh;¬ĎVŠEX0fKÄ9Ř-0IWfH°·ŔÎ ˛ 0Q…){`Č##x„™FňW<ń+®ç*x™˛<ą$9E[-qWW.(ÎI+6aaš@.Ây™24ŕóĚ ‘ŕóýxήÎÎ6޶_-ęż˙"bbăţĺĎ«p@át~Ńţ,/ł€;€mţ˘%îh^  u÷‹f˛@µ éÚWópř~<ß5°j>{‘-¨]cöK'XtŔâ÷ň»oÁÔ(€háĎw˙ď?ýG %€fI’q^D$.TĘł?ÇD *°AôÁ,ŔÁÜÁ ü`6„B$ÄÂBB d€r`)¬‚B(†Í°*`/Ô@4ŔQh†“p.ÂU¸=púažÁ(Ľ AČa!ÚbŠX#Ž™…ř!ÁH‹$ ÉQ"K‘5H1RŠT UHň=r9‡\Fş‘;Č2‚ü†ĽG1”˛Q=Ô µCą¨7„F˘ Đdt1šŹ ›Đr´=Ś6ˇçĐ«hÚŹ>CÇ0Ŕč3Äl0.ĆĂB±8, “c˱"¬ «Ć°V¬»‰őcϱwEŔ 6wB aAHXLXNŘH¨ $4Ú 7 „QÂ'"“¨K´&şůÄb21‡XH,#ÖŹ/{CÄ7$‰C2'ąI±¤TŇŇFŇnR#é,©›4H#“ÉÚdk˛9”, +Č…äťäĂä3ää!ň[ ťb@q¤řSâ(RĘjJĺĺ4ĺe2AUŁšRݨˇT5ŹZB­ˇ¶RŻQ‡¨4uš9ÍIKĄ­˘•Óhh÷iŻčtşÝ•N—ĐWŇËéGč—čôw †Çg(›gwŻL¦Ó‹ÇT071ëç™™oUX*¶*|‘Ę •J•&•*/T©Ş¦ŞŢŞ UóUËTŹ©^S}®FU3Să© Ô–«UŞťPëSSg©;¨‡Şg¨oT?¤~Yý‰YĂLĂOC¤Q ±_ăĽĆ cłx,!k «†u5Ä&±ÍŮ|v*»ý»‹=Ş©ˇ9C3J3WłRó”f?ăqřśtN ç(§—ó~ŠŢď)â)¦4Lą1e\kŞ–—–X«H«Q«Gë˝6®í§ť¦˝E»YűAÇJ'\'GgŹÎťçSŮSݧ §M=:ő®.ŞkĄˇ»Dwżn§îžľ^€žLo§Ţy˝çú}/ýTýmú§őG Xł $Ű Î<Ĺ5qo</ÇŰńQC]Ă@CĄa•a—á„‘ąŃ<ŁŐFŤFŚiĆ\ă$ămĆmĆŁ&&!&KMęMîšRMą¦)¦;L;LÇÍĚ͢ÍÖ™5›=1×2ç›ç›×›ß·`ZxZ,¶¨¶¸eI˛äZ¦Yî¶Ľn…Z9YĄXUZ]łF­ť­%Ö»­»§§ąN“N«žÖgðń¶É¶©·°ĺŘŰ®¶m¶}agbg·Ĺ®Ăî“˝“}ş}Ťý= ‡Ů«Z~s´r:V:ޚΜî?}Ĺô–é/gXĎĎŘ3ă¶Ë)ÄiťS›ÓGggąsó‹‰K‚Ë.—>.›ĆÝČ˝äJtőq]ázŇőť›ł›Âí¨ŰŻî6îiî‡ÜźĚ4ź)žY3sĐĂČCŕQĺŃ? ź•0k߬~OCOgµç#/c/‘W­×°·ĄwŞ÷aď>ö>rźă>ă<7Ţ2ŢY_Ě7Ŕ·Č·ËOĂož_…ßC#˙d˙z˙ѧ€%g‰A[űřz|!żŽ?:Űeö˛ŮíAŚ ąAAŹ‚­‚ĺÁ­!hČě­!÷çΑÎi…P~čÖĐaća‹Ă~ '…‡…W†?ŽpXŃ1—5wŃÜCsßDúD–DŢ›g1O9Ż-J5*>Ş.j<Ú7ş4ş?Ć.fYĚŐXťXIlK9.*®6nlľßüíó‡âťâ ă{/Č]pyˇÎÂô…§©.,:–@LN8”đA*¨Ś%ňw%Ž yÂÂg"/Ń6ŃŘC\*NňH*Mz’쑼5y$Ĺ3Ą,ĺą„'©ĽL LÝ›:žšv m2=:˝1’‘qBŞ!M“¶gęgćfvˬe…˛ţĹn‹·/•Ékł¬Y- ¶B¦čTZ(×*˛geWfżÍ‰Ę9–«ž+ÍíĚłĘŰ7śďź˙íÂá’¶Ą†KW-X潬j9˛‰Š®Ű—Ř(Üxĺ‡oĘż™Ü”´©«ÄądĎfŇféćŢ-ž[–Ş—ć—n ŮÚ´ ßV´íőöEŰ/—Í(Ű»¶CąŁż<¸Ľe§ÉÎÍ;?T¤TôTúT6îŇݵa×řnŃî{Ľö4ěŐŰ[Ľ÷ý>ÉľŰUUMŐfŐeűIűł÷?®‰Şéř–űm]­NmqíÇŇý#¶×ąÔŐŇ=TRŹÖ+ëGÇľţťďw- 6 UŤśĆâ#pDyäé÷ ß÷ :ÚvŚ{¬áÓvg/jBšňšF›Sšű[b[şOĚ>ŃÖęŢzüGŰś499â?rýéü§CĎdĎ&žţ˘ţË®/~řŐë×ÎŃѡ—ň—“żm|ĄýęŔëŻŰĆÂĆľÉx31^ôVűíÁwÜwďŁßOä| (˙hů±őSЧű“““˙óüc3-Ű cHRMz%€ů˙€éu0ę`:o’_ĹFMIDATxÚě×KHTqÇńϨ9"iD¨) ­˛˛‡DVP›JtW»–QDDBë6-j¶5hE/jŮcc‹h#˝\EIôpQf8ٶčš3ÍĚ˝sNáë|ŔôŕV°Ěľ2Úeئ˝Ě•S–2Ă´ÄI–ň†2-fĽSSŮăt:´ÎDĆŻ*đđ0V‡†K±ˇŤkW‚aŠťŰŠý Ăq`Ţ 3 ¦u-G{3ÍńŔŁ˙Îë80Źq<Ş|Ť}çĂPp`OÓÜDc¦BgŽb Ξy„·Q[pđŰ»ţzg7WŻG…ŕ.>Ĺ™Ŕůb6đdꯧRLNF‚Śáb)ĺ< Ëăęjęë漶62ż/ŕ}Á7B\5â)6ć“1Ä•@Žţw·DĄ×†…€ŠťłŇóHVâ— ôŕ]Đ ÜË[rÓž ňçp¨ §;•§±5!qű­/čć˝UÉ´učtIsĐ7}Ëč›đ%4BŃ0KííĚ"ů3Py¬ŢŕůßrIEND®B`‚icon.png000066400000000000000000000022661262264444500350020ustar00rootroot00000000000000base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient/res/drawable‰PNG  IHDR00Ř`nĐtRNSn¦‘ pHYs  šśVIDATX…ĹŘ˙OgđŹwpx|)0J@ËIgç÷ŮŽ´ŐÚŽZ­q~I§…)ł˛)hĄÖ2uD«d_šn]Ú™&6´I­#kfÚTčKš41áoÚgŻ78îîĐOŢ?qĎ}î%Ü=÷<QJَEEi%´p•˘Ţá›AóO?+ťÎ٤ Ô9வٺůâ>*AŹ}î"’)ÓÚĚb9Mő™úąí»±t"–NÔ´¶Vüň+‘LŻ÷ôŞTEg1z7n”X:ńí?R‡J"™"s⯄¦§·¸7–LŽwOyÖŢ=Ł4ëű;ŮĚô1ÇĂ7(‘LUnnĘŠ˘i齸´÷˘éź÷g “hµ'ţ~A7É”qi3™DŁTÖ9‚ńX%–NDßlá*EöxíŐ« "™˛ż|ĄóůDŃt#«ˇl 瀛ń,ì[ŹłMD2Uµý\ÝÁ|GIeklčöۧą4sŰwQIÎVyö#LĹ˝{xMMšF÷ů[»rQČTź©gobŢŘ`1ÉÔń› ­–brŘ&®°Sbé„w#ĚůWÉl6âő»ÉţĎ®vtÁ0ćť‘őýNÍÚ»gş #' Á;Ś-ţ„ůĽĆ㻉ĄÝS>@•Ęě)€1ňz¦ąŠhiď‘LžÇŁ«éë+.¨Ą÷ ” hĺź›Ĺ㱼4dÉ›š‹ެsÓęŞř /WC…i3™ě/_‰ şýö©Ć +şńq1A®±A!@•ĘŞíçâ€ní>ĘrL¦ů”ş«[PŁűĽp Y–ßď ]{¸"–đÚZA őý“ĂĆ}ťę*ŽAg;ड़cŤ‘  -~ÇŃľĽ Fűa%|ů4śb?C˘×gOĽ@+˙ĆeÇr6–JŔŐ Ëł4T&ľ3Űr Üë-tÁÓ—łeÝÇp}‚B%:W:@!g<Á0[üI~ r3Ę0H_ľa6 =‘i8Ý’ÝFŐ~1?ĐÉłM™‡ńRčl‡č_ •)XÍŮ—;ŘćňŤ˙¶y¬áĚň¦Đ3xÔ*zËR‡Ză˛27Łf#řGQ¨,† í3J¨Ţ†ŮëÜ žĐ×~Ł+…üFě™ńCuyj››t°E8Ý ß‹LˇÇ3ĺeđ~››äpĹ“Ţ"R¨,Ď‚«µDŽ[·3ş&ˇžĂ ĐžTř<Ě ¬ľ“‡ Z ĂŕeDŁfH%péó ˇ™ô2NQYĄVÁpoq)óhŞĺAˇ—Ő\”»{y:Úř,TrÔ§őBçhzŢ?í /…Ž6ˇ3ä”ěVÁz•—g JdśÍŚď|1Ęn…ŕ_Jtz\nž… ŕl†Č4‡Ć7 }‘)ôbyőÎřá¤ý)ô2č˙·€ŚLg,0ލ>qŔŚľč¦[ç[˙Ů´oăźpHIEND®B`‚success.png000066400000000000000000000030701262264444500355140ustar00rootroot00000000000000base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient/res/drawable‰PNG  IHDR@@ŞiqŢtEXtSoftwareAdobe ImageReadyqÉe<"iTXtXML:com.adobe.xmp ݵqR¬IDATxÚě›ÝKQĆg‡mu3Do’”% rşX—6ôÂkAé_b¬îşéżč˛őÂč˘;¤‹ú"¨› ĽpEĢö˘7?šžŢÁaH›Ż3sfć=đ㬣ěîó<ďĽsÎ –ey¦‘ó!b€ b€ b@>G1ě´Ż=ITŔŘć#çwˇ@gŔ'\ßĹÍFL/ţUL÷ÁĆĎ0Ż˘3ßâ‡ŔOp nFć› ‹®J»Jŕ řő[ Ââ/._ëoÁs”7Ë@ŤîÝ-~ Ľđ">Í0ČÉSů˙ro%˙‘ĺ…Đ7Ľ*říż!ţ[¬ ˇ„’ż\É· ľ“ĺĄđ˙’ďyÓb^“OS(I>-pnň öĚ´&…xť+@yňľ+kî‹`4+Éű2ÂisŃŹńzBqňéśăŚäżFý¦ńýćÁMţ2M\«§=y?pL#Ţt”Á]PKsň~ x^rĂ,đaĂ%Ú‰ET ‰$ďŮ,4(ůđšLg%€Z“÷Őa‚–ńň¸ŕ®PO[ňA×+,~ÖÝB~ńśďQńśŹt%Q%ôWň$~+ÎäĂ.…ö„˙MŐ‘<]ű žĹqĎGb@ŔJ(óďŽämńOÁnkî°{Ż=ÁNţ–KüżťÔ¦#Ôn*Óy•PăÎNŻ'YĽĺJ>1ńQîĎŞ„;`ڧçöZ$µv%Đ<ÇP%ôó#ďĐuĎ·tŻâ<Ŕ] 'ŚvÉ«:úWO0tşçă:rVÍű:ŠWi€] &? uŻŇ{ĽßÁގé(ČŚä|b€ b€ b€ĎńW€`ĘôN˝ĘcöIEND®B`‚base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient/res/layout/000077500000000000000000000000001262264444500331515ustar00rootroot00000000000000connect_to_network_layout.xml000066400000000000000000000057121262264444500411220ustar00rootroot00000000000000base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient/res/layout main_layout.xml000066400000000000000000000115361262264444500361430ustar00rootroot00000000000000base-15.09/onboarding/java/sample_applications/android/OnboardingManagerSampleClient/res/layout