--- /dev/null
+Dariusz Paziewski <d.paziewski at samsung dot com>
+Tomasz Lukawski <t.lukawski at samsung dot com>
+Pawel Sierszen <p.sierszen at samsung dot com>
+Piotr Wronski <p.wronski at samsung dot com>
+Tomasz Paciorek <t.paciorek at samsung dot com>
+Artur Kobylinski <a.kobylinski at samsung dot com>
+Grzegorz Sala <g.sala2 at samsung dot com>
--- /dev/null
+Flora License
+
+Version 1.0, May, 2012
+
+http://floralicense.org/license/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction,
+and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by
+the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and
+all other entities that control, are controlled by, or are
+under common control with that entity. For the purposes of
+this definition, "control" means (i) the power, direct or indirect,
+to cause the direction or management of such entity,
+whether by contract or otherwise, or (ii) ownership of fifty percent (50%)
+or more of the outstanding shares, or (iii) beneficial ownership of
+such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity
+exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation source,
+and configuration files.
+
+"Object" form shall mean any form resulting from mechanical
+transformation or translation of a Source form, including but
+not limited to compiled object code, generated documentation,
+and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form,
+made available under the License, as indicated by a copyright notice
+that is included in or attached to the work (an example is provided
+in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form,
+that is based on (or derived from) the Work and for which the editorial
+revisions, annotations, elaborations, or other modifications represent,
+as a whole, an original work of authorship. For the purposes of this License,
+Derivative Works shall not include works that remain separable from,
+or merely link (or bind by name) to the interfaces of, the Work and
+Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original
+version of the Work and any modifications or additions to that Work or
+Derivative Works thereof, that is intentionally submitted to Licensor
+for inclusion in the Work by the copyright owner or by an individual or
+Legal Entity authorized to submit on behalf of the copyright owner.
+For the purposes of this definition, "submitted" means any form of
+electronic, verbal, or written communication sent to the Licensor or
+its representatives, including but not limited to communication on
+electronic mailing lists, source code control systems, and issue
+tracking systems that are managed by, or on behalf of, the Licensor
+for the purpose of discussing and improving the Work, but excluding
+communication that is conspicuously marked or otherwise designated
+in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity
+on behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+"Tizen Certified Platform" shall mean a software platform that complies
+with the standards set forth in the Compatibility Definition Document
+and passes the Compatibility Test Suite as defined from time to time
+by the Tizen Technical Steering Group and certified by the Tizen
+Association or its designated agent.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the
+Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+(except as stated in this section) patent license to make, have made,
+use, offer to sell, sell, import, and otherwise transfer the Work
+solely as incorporated into a Tizen Certified Platform, where such
+license applies only to those patent claims licensable by such
+Contributor that are necessarily infringed by their Contribution(s)
+alone or by combination of their Contribution(s) with the Work solely
+as incorporated into a Tizen Certified Platform to which such
+Contribution(s) was submitted. If You institute patent litigation
+against any entity (including a cross-claim or counterclaim
+in a lawsuit) alleging that the Work or a Contribution incorporated
+within the Work constitutes direct or contributory patent infringement,
+then any patent licenses granted to You under this License for that
+Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+Work or Derivative Works thereof pursuant to the copyright license
+above, in any medium, with or without modifications, and in Source or
+Object form, provided that You meet the following conditions:
+
+ 1. You must give any other recipients of the Work or Derivative Works
+ a copy of this License; and
+ 2. You must cause any modified files to carry prominent notices stating
+ that You changed the files; and
+ 3. You must retain, in the Source form of any Derivative Works that
+ You distribute, all copyright, patent, trademark, and attribution
+ notices from the Source form of the Work, excluding those notices
+ that do not pertain to any part of the Derivative Works; and
+ 4. If the Work includes a "NOTICE" text file as part of its distribution,
+ then any Derivative Works that You distribute must include a readable
+ copy of the attribution notices contained within such NOTICE file,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works, in at least one of the following places:
+ within a NOTICE text file distributed as part of the Derivative Works;
+ within the Source form or documentation, if provided along with the
+ Derivative Works; or, within a display generated by the Derivative Works,
+ if and wherever such third-party notices normally appear.
+ The contents of the NOTICE file are for informational purposes only
+ and do not modify the License.
+
+You may add Your own attribution notices within Derivative Works
+that You distribute, alongside or as an addendum to the NOTICE text
+from the Work, provided that such additional attribution notices
+cannot be construed as modifying the License. You may add Your own
+copyright statement to Your modifications and may provide additional or
+different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works
+as a whole, provided Your use, reproduction, and distribution of
+the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+any Contribution intentionally submitted for inclusion in the Work
+by You to the Licensor shall be under the terms and conditions of
+this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify
+the terms of any separate license agreement you may have executed
+with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+names, trademarks, service marks, or product names of the Licensor,
+except as required for reasonable and customary use in describing the
+origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+agreed to in writing, Licensor provides the Work (and each
+Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied, including, without limitation, any warranties or conditions
+of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any
+risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+whether in tort (including negligence), contract, or otherwise,
+unless required by applicable law (such as deliberate and grossly
+negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special,
+incidental, or consequential damages of any character arising as a
+result of this License or out of the use or inability to use the
+Work (including but not limited to damages for loss of goodwill,
+work stoppage, computer failure or malfunction, or any and all
+other commercial damages or losses), even if such Contributor
+has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+the Work or Derivative Works thereof, You may choose to offer,
+and charge a fee for, acceptance of support, warranty, indemnity,
+or other liability obligations and/or rights consistent with this
+License. However, in accepting such obligations, You may act only
+on Your own behalf and on Your sole responsibility, not on behalf
+of any other Contributor, and only if You agree to indemnify,
+defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason
+of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Flora License to your work
+
+To apply the Flora License to your work, attach the following
+boilerplate notice, with the fields enclosed by brackets "[]"
+replaced with your own identifying information. (Don't include
+the brackets!) The text should be enclosed in the appropriate
+comment syntax for the file format. We also recommend that a
+file or class name and description of purpose be included on the
+same "printed page" as the copyright notice for easier
+identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Flora License, Version 1.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://floralicense.org/license/
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
--- /dev/null
+Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Flora License, Version 1.
+Please, see the LICENSE file for Flora License terms and conditions.
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://sample-web-application.tizen.org/bt-chat" version="2.1.0" viewmodes="maximized">
+ <tizen:application id="2PlyGQLfgh" required_version="1.0"/>
+ <conent src="index.html"/>
+ <icon src="icon.png"/>
+ <name>BluetoothChat</name>
+ <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
+ <tizen:privilege name="http://tizen.org/privilege/application.read"/>
+ <tizen:privilege name="http://tizen.org/privilege/bluetooth.admin"/>
+ <tizen:privilege name="http://tizen.org/privilege/bluetooth.gap"/>
+ <tizen:privilege name="http://tizen.org/privilege/bluetooth.spp"/>
+ <tizen:privilege name="http://tizen.org/privilege/tizen"/>
+ <tizen:setting screen-orientation="portrait" context-menu="enable" background-support="enable" encryption="disable" nodisplay="false"/>
+ <tizen:setting context-menu="enable"/>
+</widget>
--- /dev/null
+.ui-btn-start {
+ margin: 0px auto;
+ margin-top: 10px;
+ padding: 40px 0px 0px 0px;
+ width: 90%;
+ height: 100px;
+ font-size: 26px;
+}
+
+#keyboard-text {
+ width: 100%;
+ margin: 0px;
+ padding: 0px;
+ border: 0px;
+ border-radius: 0px;
+ overflow: hidden;
+ font-size: 24px;
+ outline: none;
+}
+
+#keyboard-content .ui-scrollview-view {
+ padding: 0px;
+}
+
+#start-content {
+ background-color: white;
+}
+
+#keyboard-content {
+ background-color: white;
+}
+
+/*
+#keyboard-back-button {
+ position: absolute;
+ left: 5px;
+ bottom: 5px;
+}
+
+#keyboard-ok-button {
+ position: absolute;
+ right: 5px;
+ bottom: 5px;
+}
+*/
+
+#ui-textArea {
+ position: absolute;
+ width: 100%;
+ height: 160px;
+ display: -webkit-box;
+ -webkit-box-orient: horizontal;
+}
+
+#ui-textArea-text {
+ -webkit-box-flex: 1;
+}
+
+#ui-textArea-button {
+ width: 100px;
+ height: 108px;
+}
+
+#text {
+ background-color: #fff;
+ color: #555;
+ position: absolute;
+ left: 10px;
+ right: 110px;
+ top: 10px;
+ height: 140px;
+ margin: 0px;
+ border: 0px solid #000;
+ border-radius: 5px;
+ font-size: 26px;
+ overflow: auto;
+}
+
+#ui-mySend {
+ float: left;
+ width: 90px;
+ height: 58px;
+ margin-top: 10px;
+ font-size: 26px;
+}
+
+#ui-myCounter {
+ float: left;
+ margin-top: 47px;
+}
+
+#ui-myCounter p {
+ font-size: 20px;
+}
+
+#chat-footer {
+ height: 164px;
+ width: 100%;
+ position: absolute;
+ bottom: 0;
+}
+
+.ui-listview .ui-li-static.ui-li-bubble-left {
+ margin-right: 50px;
+}
+
+.ui-listview .ui-li-static.ui-li-bubble-right {
+ margin-left: 50px;
+}
+
+.ui-listview span.ui-li-bubble-time {
+ margin-left: 10px;
+ font-size: 1.2rem;
+}
+
+#start-monit {
+ text-align: center;
+ width: 100%;
+}
+
+#start-monit a {
+ font-size: 1.4em;
+}
+
+.focus {}
--- /dev/null
+<!DOCTYPE html>
+<html>
+
+<head>
+ <meta charset="utf-8"/>
+ <meta name="description" content="bt-chat"/>
+ <meta name="viewport" content="width=480, user-scalable=no" />
+
+ <title>bt-chat</title>
+ <script src="/usr/share/tizen-web-ui-fw/latest/js/jquery.js"></script>
+ <script src="/usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.js"></script>
+ <script src="/usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js" data-framework-theme="tizen-white" data-framework-viewport-scale="false"></script>
+
+ <script type="text/javascript" src="./js/main.js"></script>
+ <script type="text/javascript" src="./js/client.js"></script>
+ <script type="text/javascript" src="./js/server.js"></script>
+ <link rel="stylesheet" type="text/css" href="./css/style.css"/>
+</head>
+
+<body>
+ <div data-role="page" id="start" data-add-back-btn="footer" data-footer-exist="true">
+ <div data-role="header" id="start-header" data-position="fixed">
+ <h1>Bt-chat</h1>
+ </div>
+
+ <div data-role="content" id="start-content">
+ <div data-role="button" class="ui-btn-start" id="serverButton" style="display: none;">Set name and start server</div>
+ <div data-role="button" class="ui-btn-start" id="clientButton" style="display: none;">Set name and join client</div>
+ <div id="start-monit">
+ <p>... waiting for bluetooth radio ...</p>
+ </div>
+ </div>
+
+ <div data-role="footer" data-position="fixed" id="start-footer"></div>
+ </div>
+
+ <div data-role="page" id="keyboard" data-add-back-btn="none">
+ <div data-role="header" id="keyboard-header" data-position="fixed">
+ <h1></h1>
+ <a data-role="button" id="keyboard-ok-button">OK</a>
+ <a data-role="button" id="keyboard-back-button">back</a>
+ </div>
+
+ <div data-role="content" id="keyboard-content">
+ <textarea id="keyboard-text" data-role="none" maxlength="5"></textarea>
+ <!-- <div data-role="button" id="keyboard-back-button">back</div> -->
+ <!-- <div data-role="button" id="keyboard-ok-button">OK</div> -->
+ </div>
+
+ <div data-role="footer" data-position="fixed" id="keyboard-footer"></div>
+ </div>
+
+ <div data-role="page" id="chat" data-footer-Exist="false">
+ <div data-role="header" id="chat-header" data-position="fixed">
+ <h1 id="chat-title"></h1>
+ <a data-role="button" id="chat-back-button">back</a>
+ </div>
+
+ <div data-role="content" id="chat-content"></div>
+
+ <!-- <div data-role="footer" data-position="fixed" id="chat-footer"> -->
+ <div data-role="none" id="chat-footer"><!-- workaround -->
+ <div id="ui-textArea">
+ <div id="ui-textArea-text">
+ <textarea id="text" placeholder="type new message" data-role="none"></textarea>
+ </div>
+ <div id="ui-textArea-button">
+ <a data-role="button" id="ui-mySend">Send</a>
+ <!-- <div data-role="none" id="ui-myCounter"><p></p></div> -->
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div data-role="page" id="choose" data-add-back-btn="footer" data-footer-exist="true">
+ <div data-role="header" id="choose-header" data-position="fixed">
+ <h1>Choose your bt-chat server</h1>
+ </div>
+
+ <div data-role="content" id="choose-content"></div>
+
+ <div data-role="footer" data-position="fixed" id="choose-footer"></div>
+ </div>
+</body>
+</html>
--- /dev/null
+/*global $, tizen, app */
+
+var client = {
+ sendPing: function sendPing() {
+ "use strict";
+ var sendTextMsg, messageObj, messageObjToString, i, len;
+ sendTextMsg = [];
+ messageObj = {name: app.currentName, text: '', ping: true, bye: false};
+ messageObjToString = JSON.stringify(messageObj);
+ len = messageObjToString.length;
+
+ for (i = 0; i < len; i += 1) {
+ sendTextMsg[i] = messageObjToString.charCodeAt(i);
+ }
+ try {
+ if (app.globalSocket !== null && app.globalSocket.state === "OPEN") {
+ app.globalSocket.writeData(sendTextMsg);
+ }
+ } catch (error) {
+ console.log('sendPing: ' + error.message);
+ }
+ },
+
+ onSocketConnected: function onSocketConnected(socket) {
+ "use strict";
+ var data, recvmsg, i, len, messageObj;
+
+ app.globalSocket = socket;
+ $.mobile.changePage('#chat');
+
+ socket.onmessage = function () {
+ data = socket.readData();
+ len = data.length;
+ recvmsg = '';
+ for (i = 0; i < len; i += 1) {
+ recvmsg += String.fromCharCode(data[i]);
+ }
+ messageObj = JSON.parse(recvmsg);
+ app.displayReceivedMessage(messageObj.name, messageObj.text, messageObj.ping, messageObj.bye);
+ };
+
+ socket.onerror = function (e) {
+ socket.close();
+ };
+ socket.onclose = function () {
+ app.globalSocket = null;
+ };
+ $('#chat-title').text('Client: ' + app.currentName + ' << >> ' + app.chatServerDevice.name);
+ app.connection = true;
+ client.sendPing();
+ },
+
+ onSocketError: function onSocketError(error) {
+ "use strict";
+ $('#choose-content').find('ul li').css('background-color', '#fff');
+ app.showPopup('Server rejected the connection. Try again. ' + error.message, $('#choose'));
+ },
+
+ bondSuccess: function bondSuccess(device) {
+ "use strict";
+ //$('.ui-loader').hide();
+
+ app.chatServerDevice = device;
+
+ try {
+ device.connectToServiceByUUID(app.serviceUUID, client.onSocketConnected, client.onSocketError, 'RFCOMM');
+ } catch (exc) {
+ console.log('connectToServiceByUUID: ' + exc.message + '<br/>');
+ }
+ },
+
+ bondError: function bondError(error) {
+ "use strict";
+ //$('.ui-loader').hide();
+ $('#choose-content').find('ul li').css('background-color', '#fff');
+ app.showPopup('Bonding problem with selected device. Try again. ' + error.message, $('#choose'));
+ },
+
+ addDeviceToList: function addDeviceToList(ul, chooseContent, device) {
+ "use strict";
+ var listElement, name, address, sub2,
+ startBonding = function (element, address) {
+ app.adapter.createBonding(address, client.bondSuccess, client.bondSuccess);
+ ul.find('li').css('background-color', '#fff');
+ element.css('background-color', '#aaa');
+ //app.showLoader('Waiting for response...');
+ };
+ if ($.inArray(device.address, app.deviceAddresses) === -1) {
+ app.deviceAddresses.push(device.address);
+ listElement = $('<li class="ui-li-has-multiline" address="' + device.address + '">' + device.name + '</li>');
+ address = $('<span class="ui-li-text-sub"></span>');
+ address.text(device.address);
+ sub2 = $('<span class="ui-li-text-sub2"></span>');
+ listElement.append(address).append(sub2);
+ listElement.on('tap', function (event) {
+ event.stopPropagation();
+ var address, element;
+ address = $(this).attr('address');
+ element = $(this);
+ if (app.discovering) {
+ console.log('discovering');
+ app.adapter.stopDiscovery(function () {
+ app.discovering = false;
+ startBonding(element, address);
+ }, function (e) { console.log('stopDiscovery error: ' + e.message); });
+ } else {
+ console.log('!discovering');
+ startBonding(element, address);
+ }
+ });
+ ul.append(listElement);
+ ul.listview('refresh');
+ }
+ },
+
+ searchServer: function searchServer() {
+ "use strict";
+ var chooseContent, ul, discoverDevicesSuccessCallback;
+ app.deviceAddresses = [];
+ chooseContent = $('#choose-content');
+ ul = $('<ul data-role="listview"></ul>');
+ chooseContent.find('.ui-scrollview-view').append(ul);
+ chooseContent.trigger('create');
+
+ discoverDevicesSuccessCallback = {
+ onstarted: function () { app.discovering = true; },
+ ondevicefound: function (device) {
+ client.addDeviceToList(ul, chooseContent, device);
+ },
+ ondevicedisappeared: function (address) {
+ console.log('device disappeared');
+ },
+ onfinished: function (devices) { app.discovering = false; }
+ };
+
+ app.adapter.discoverDevices(discoverDevicesSuccessCallback, function (e) { app.discovering = false; });
+ }
+};
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*jslint devel: true*/
+/*global $: false, tizen: false */
+/*global server, client */
+var app = {
+ adapter: null,
+ serviceUUID: '5bce9431-6c75-32ab-afe0-2ec108a30860',
+ mode: null,
+ currentName: null,
+ maxMessageLength: 160,
+ doNotSendBye: false,
+ currentPage: 'start',
+ connection: false,
+ chatServiceHandler: null,
+ globalSocket: null,
+ chatServerDevice: null,
+ messageWindow: null,
+ deviceAddresses: [],
+ discovering: false,
+ numberOfClients: 0,
+
+ showLoader: function showLoader(message) {
+ "use strict";
+ var loader = $('.ui-loader');
+ loader.css('background', '-webkit-linear-gradient(top, #5A99BA 0%, #205473 100%)');
+ loader.css('color', 'white');
+ loader.find('h1').text(message);
+ loader.show();
+ },
+
+ showPopup: function showPopup(message, page) {
+ "use strict";
+ app.messageWindow = $('<div id="popup" data-role="popupwindow" data-style="center_basic_1btn"><p data-role="text">' + message + '</p><div data-role="button-bg"><a href="#" data-role="button" data-inline="true" onclick="app.closePopup();">OK</a></div></div>');
+ page.append(app.messageWindow);
+ page.trigger('create');
+ app.messageWindow.popupwindow('open');
+ },
+
+ closePopup: function closePopup() {
+ "use strict";
+ this.messageWindow.popupwindow('close');
+ this.messageWindow.remove();
+ },
+
+ showRestartPopup: function showRestartPopup(message, page) {
+ "use strict";
+ this.messageWindow = $('<div id="popup" data-role="popupwindow" data-style="center_basic_1btn"><p data-role="text">' + message + '</p><div data-role="button-bg"><a href="#" data-role="button" data-inline="true" onclick="app.closeRestartPopup();">OK</a></div></div>');
+ page.append(this.messageWindow);
+ page.trigger('create');
+ this.messageWindow.popupwindow('open');
+ },
+
+ closeRestartPopup: function closeRestartPopup() {
+ "use strict";
+ this.doNotSendBye = true;
+ this.messageWindow.popupwindow('close');
+ this.messageWindow.remove();
+ this.goToStartPage();
+ },
+
+ showTextInput: function showTextInput() {
+ "use strict";
+ console.log('showTextInput');
+ $.mobile.changePage('#keyboard');
+ },
+
+ chooseServer: function chooseServer() {
+ "use strict";
+ console.log('chooseServer');
+ app.mode = 'server';
+ app.showTextInput();
+ },
+
+ chooseClient: function chooseClient() {
+ "use strict";
+ console.log('chooseClient');
+ app.mode = 'client';
+ app.showTextInput();
+ },
+
+ scrollChatContentDown: function scrollChatContentDown() {
+ "use strict";
+ var newHeight, chatListHeight, scrollTo;
+ if (this.currentPage === 'chat') {
+ newHeight = $('#chat').outerHeight() - $('#chat-header').outerHeight() - $('#chat-footer').outerHeight();
+ $('#chat-content').css('height', newHeight + 'px');
+ chatListHeight = $('#chat-content .ui-scrollview-view ul').outerHeight();
+ scrollTo = newHeight - chatListHeight;
+ if (scrollTo < 0) {
+ $('#chat-content > .ui-scrollview-view').css('-webkit-transform', 'translate3d(0px, ' + scrollTo + 'px, 0px)');
+ setTimeout(function () {$('#chat-content').scrollview('scrollTo', 0, (scrollTo)); }, 100);
+ } else {
+ $('#chat-content > .ui-scrollview-view').css('-webkit-transform', 'translate3d(0px, 0px, 0px)');
+ $('#chat-content').scrollview('scrollTo', 0, 0);
+ }
+ }
+ },
+
+ setTextareaHeight: function setTextareaHeight() {
+ "use strict";
+ console.log('setTextareaHeight');
+ var keyboardHeight, keyboardHeaderHeight, keyboardFooterHeight;
+ keyboardHeight = $('#keyboard').innerHeight();
+ keyboardHeaderHeight = $('#keyboard-header').innerHeight();
+ keyboardFooterHeight = $('#keyboard-footer').innerHeight();
+
+ if ($('#keyboard-footer').css('display') === 'none') {
+ $('#keyboard-content').css('height', (keyboardHeight - keyboardHeaderHeight) + 'px');
+ $('#keyboard-text').css('height', (keyboardHeight - keyboardHeaderHeight - 5) + 'px');
+ } else {
+ $('#keyboard-content').css('height', (keyboardHeight - keyboardHeaderHeight - keyboardFooterHeight) + 'px');
+ $('#keyboard-text').css('height', (keyboardHeight - keyboardHeaderHeight - keyboardFooterHeight - 5) + 'px');
+ }
+
+ $('#keyboard-content > .ui-scrollview-view').css('-webkit-transform', 'translate3d(0px, 0px, 0px)');
+ $('#keyboard-content').scrollview('scrollTo', 0, 0);
+ },
+
+ showStartButtons: function showStartButtons() {
+ "use strict";
+ $('#start-monit').hide();
+ $('#serverButton').show();
+ $('#clientButton').show();
+ },
+
+ hideStartButtons: function hideStartButtons() {
+ "use strict";
+ $('#serverButton').hide();
+ $('#clientButton').hide();
+ $('#start-monit').show();
+ },
+
+ goToStartPage: function goToStartPage() {
+ "use strict";
+ $.mobile.changePage('#start');
+ },
+
+ hideTextInput: function hideTextInput() {
+ "use strict";
+ console.log('hideTextInput');
+ this.currentName = $('#keyboard-text').val().substring(0, 5);
+ $('#keyboard-text').val('');
+ if (this.mode === 'server') {
+ $.mobile.changePage('#chat');
+ } else {
+ $.mobile.changePage('#choose');
+ }
+ },
+
+ changeName: function changeName(callback) {
+ "use strict";
+ if (this.adapter.name !== this.currentName) {
+ this.adapter.setName(this.currentName, function () {
+ callback();
+ }, function () {
+ console.log('Problem with bluetooth name.<br>Application can\'t set device name.');
+ });
+ } else {
+ callback();
+ }
+ },
+
+ displayReceivedMessage: function displayReceivedMessage(name, text, ping, bye) {
+ "use strict";
+ var listElement, span, ul;
+ if (bye) {
+ if (app.mode === 'server') {
+ app.showRestartPopup('Client name "' + name + '" is unavailable.\nYour bluetooth device will be automatically restarted.', $('#chat'));
+ } else {
+ app.showRestartPopup('Server name "' + name + '" is unavailable.\nYour bluetooth device will be automatically restarted.', $('#chat'));
+ }
+ } else if (!ping) {
+ listElement = $('<li class="ui-li-bubble-left"></li>');
+ listElement.text(text);
+ span = $('<br/><span class="ui-li-bubble-time"></span>');
+ span.text(name);
+ listElement.append(span);
+ ul = $('#chat-content > .ui-scrollview-view > ul');
+ ul.append(listElement);
+ ul.listview('refresh');
+ } else {
+ $('#chat-title').text('Server: ' + app.currentName + ' << >> ' + name);
+ app.connection = true;
+ }
+ },
+
+ displaySentMessage: function displaySentMessage(message) {
+ "use strict";
+ var listElement, span, ul;
+ listElement = $('<li class="ui-li-bubble-right"></li>');
+ listElement.text(message);
+ span = $('<br/><span class="ui-li-bubble-time"></span>');
+ span.text(app.currentName);
+ listElement.append(span);
+ ul = $('#chat-content > .ui-scrollview-view > ul');
+ ul.append(listElement);
+ ul.listview('refresh');
+ },
+
+ sendMessage: function sendMessage() {
+ "use strict";
+ var value, sendTextMsg = [], messageObj, messageObjToString, i, len;
+ value = $('#text').val();
+ messageObj = {name: this.currentName, text: value, ping: false, bye: false};
+ messageObjToString = JSON.stringify(messageObj);
+ len = messageObjToString.length;
+ for (i = 0; i < len; i += 1) {
+ sendTextMsg[i] = messageObjToString.charCodeAt(i);
+ }
+ try {
+ if (this.globalSocket !== null && this.globalSocket.state === "OPEN") {
+ this.globalSocket.writeData(sendTextMsg);
+ this.displaySentMessage(value);
+ setTimeout(function () { $('#text').val(''); }, 1000);
+ }
+ } catch (error) {
+ console.log('sendMessage: ' + error.message);
+ }
+ },
+
+ restartBluetooth: function restartBluetooth() {
+ "use strict";
+ var powerOff = function () {
+ app.connection = false;
+ if (app.adapter.powered) {
+ var powerOn = function () {
+ if (!app.adapter.powered) {
+ app.adapter.setPowered(true, function () { setTimeout(function () { app.showStartButtons(); }, 1000); }, function () { setTimeout(function () { $('#start-monit p').html('... problem with bluetooth radio ...'); }, 1000); });
+ } else {
+ app.showStartButtons();
+ }
+ };
+ app.adapter.setPowered(false, function () { setTimeout(function () { powerOn(); }, 1000); }, function () { $('#start-monit p').html('... problem with bluetooth radio ...'); });
+ }
+ };
+ if (app.adapter.visible) {
+ app.adapter.setVisible(false, powerOff, function () { $('#start-monit p').html('... problem with bluetooth radio ...'); });
+ } else {
+ powerOff();
+ }
+ },
+
+ sendBye: function sendBye() {
+ "use strict";
+ var sendTextMsg = [], messageObj, messageObjToString, i, len;
+ messageObj = {name: this.currentName, text: '', ping: false, bye: true};
+ messageObjToString = JSON.stringify(messageObj);
+ len = messageObjToString.length;
+ for (i = 0; i < len; i += 1) {
+ sendTextMsg[i] = messageObjToString.charCodeAt(i);
+ }
+ try {
+ if (this.globalSocket !== null && this.globalSocket.state === "OPEN") {
+ this.globalSocket.writeData(sendTextMsg);
+ }
+ } catch (error) {
+ console.log('sendBye: ' + error.message);
+ }
+ },
+
+ addEvents: function addEvents() {
+ "use strict";
+ $(window).on('resize', function () {
+ app.setTextareaHeight();
+ app.scrollChatContentDown();
+ });
+
+ $('#start-footer-back').on('tap', function (event) {
+ event.preventDefault();
+ app.powerOff();
+ });
+
+ $('#keyboard-back-button').on('tap', function (event) {
+ event.preventDefault();
+ app.doNotSendBye = true;
+ app.goToStartPage();
+ });
+
+ $('#keyboard-ok-button').on('tap', function (event) {
+ event.preventDefault();
+ if ($('#keyboard-text').val().length !== 0) {
+ app.hideTextInput();
+ }
+ });
+
+ $('#serverButton').on('tap', app.chooseServer);
+
+ $('#clientButton').on('tap', app.chooseClient);
+
+ $('#keyboard').on('pagebeforeshow', function () {
+ app.currentPage = 'keyboard';
+ $('#keyboard-text').val('');
+ $('#keyboard-header > h1').html('Type ' + app.mode + ' name');
+ });
+
+ $('#keyboard').on('pageshow', function () {
+ app.setTextareaHeight();
+ $('#keyboard-text').focus();
+ });
+
+ $('#keyboard-text').on('keydown', function (event) {
+ if (event.keyCode === 13 && $(this).val().split("\n").length >= 1) {
+ return false;
+ }
+ });
+
+ $('#start').on('pagebeforeshow', function () {
+ app.currentPage = 'start';
+ $('#start-monit p').html('... waiting for bluetooth radio ...');
+ if (!app.doNotSendBye) {
+ app.sendBye();
+ } else {
+ app.doNotSendBye = false;
+ }
+ app.hideStartButtons();
+ $('#chat-title').html('');
+ if (app.mode === 'server') {
+ server.unRegisterChatService();
+ } else {
+ $('#choose-content .ui-scrollview-view').empty();
+ if (app.chatServerDevice !== null) {
+ if (app.chatServerDevice.isBonded) {
+ app.adapter.destroyBonding(app.chatServerDevice.address, function () {
+ app.chatServerDevice = null;
+ app.chatServiceHandler = null;
+ app.restartBluetooth();
+ }, function () {});
+ } else {
+ app.chatServiceHandler = null;
+ app.restartBluetooth();
+ }
+ } else {
+ app.adapter.stopDiscovery(function () {}, function () {});
+ app.showStartButtons();
+ }
+ }
+ });
+
+ $('#choose').on('pagebeforeshow', function () {
+ app.currentPage = 'choose';
+ app.changeName(client.searchServer);
+ });
+
+ $('#chat').on('pagebeforeshow', function () {
+ app.currentPage = 'chat';
+ $('#chat-content > .ui-scrollview-view').empty();
+ $('#text').val('');
+ if (app.mode === 'server') {
+ app.changeName(server.setServerVisible);
+ }
+ });
+
+ $('#chat').on('pageshow', function () {
+ var chatContent, ul;
+ chatContent = $('#chat-content');
+ ul = $('<ul data-role="listview"></ul>');
+ chatContent.find('.ui-scrollview-view').append(ul);
+ chatContent.trigger('create');
+ });
+
+ $('#text').on('tap', function (event) {
+ event.stopPropagation();
+ });
+
+ /*
+ $('#text').on('focus', function () {
+ $(this).addClass('focus');
+ });
+
+ $('#text').on('blur', function () {
+ $(this).removeClass('focus');
+ $('#chat-footer').css('display', 'block');
+ });
+ */
+
+ $('#choose-footer').on('tap', 'a.ui-btn-back', function (event) {
+ event.preventDefault();
+ app.doNotSendBye = true;
+ app.goToStartPage();
+ });
+
+ $('#keyboard-footer').on('tap', 'a.ui-btn-back', function (event) {
+ event.preventDefault();
+ app.doNotSendBye = true;
+ app.goToStartPage();
+ });
+
+ $('#ui-mySend').on('tap', function (event) {
+ event.stopPropagation();
+ if (app.connection) {
+ if ($('#text').val().length > 0) {
+ app.sendMessage();
+ } else {
+ app.showPopup('There is nothing to send.', $('#chat'));
+ }
+ } else {
+ app.showPopup('There is no connection to other device. Wait for connection.', $('#chat'));
+ }
+ });
+
+ $('#choose-header').on('tap', function (event) {
+ event.preventDefault();
+ });
+
+ $('#choose-content').on('tap', function (event) {
+ event.preventDefault();
+ });
+
+ $('#choose-footer').on('tap', function (event) {
+ event.preventDefault();
+ });
+
+ $('#chat-header').on('tap', function (event) {
+ event.preventDefault();
+ });
+
+ $('#chat-content').on('tap', function (event) {
+ event.preventDefault();
+ });
+
+ $('#chat-footer').on('tap', function (event) {
+ event.preventDefault();
+ });
+
+ $('#chat-header').on('tap', '#chat-back-button', function (event) {
+ event.preventDefault();
+ if (!app.connection) {
+ app.doNotSendBye = true;
+ }
+ app.goToStartPage();
+ });
+
+ $('#keyboard-header').on('click', function (event) {
+ event.preventDefault();
+ $('#keyboard-text').focus();
+ });
+
+ $('#keyboard-header').on('tap', function (event) {
+ event.preventDefault();
+ $('#keyboard-text').focus();
+ });
+
+ //FIXME - temporary workaround which allows application testing (messages sending)
+ $('#text').on('focus', function () {
+ console.log('FOCUS on: #text');
+ setTimeout(function () { $('#chat-footer').show(); }, 1000);
+ });
+
+ },
+
+ powerOn: function powerOn() {
+ "use strict";
+ if (!this.adapter.powered) {
+ this.adapter.setPowered(true, function () { setTimeout(function () { app.showStartButtons(); }, 1000); }, function () { setTimeout(function () { $('#start-monit p').html('... problem with bluetooth radio ...'); }, 1000); });
+ } else {
+ app.showStartButtons();
+ }
+ },
+
+ powerOff: function powerOff() {
+ "use strict";
+ var app = tizen.application.getCurrentApplication();
+ if (this.adapter.powered) {
+ this.adapter.setPowered(false, function () { app.exit(); }, function () { app.exit(); });
+ } else {
+ app.exit();
+ }
+ },
+
+ getBluetoothAdapter: function getBluetoothAdapter() {
+ "use strict";
+ try {
+ this.adapter = tizen.bluetooth.getDefaultAdapter();
+ this.powerOn();
+ } catch (error) {
+ console.log('Problem with bluetooth device. Application can\'t work properly.');
+ }
+ },
+
+ initFooter: function initFooter() {
+ "use strict";
+ $('#start-footer .ui-btn-back').attr('id', 'start-footer-back');
+ },
+
+ init: function init() {
+ "use strict";
+ app.initFooter();
+ app.addEvents();
+ app.getBluetoothAdapter();
+ }
+};
+
+$(document).ready(app.init);
--- /dev/null
+/*jslint devel: true*/
+/*global $, tizen, app */
+
+var server = {
+ hideMe: function hideMe() {
+ "use strict";
+ if (app.adapter.visible) {
+ app.adapter.setVisible(false, function () {}, function () {});
+ }
+ },
+
+ onRegisterSuccess: function onRegisterSuccess(recordHandler) {
+ "use strict";
+ $('#chat-title').text('Server: ' + app.currentName);
+ app.chatServiceHandler = recordHandler;
+ recordHandler.onconnect = function (socket) {
+ var peerName;
+ app.numberOfClients += 1;
+ server.hideMe();
+ app.globalSocket = socket;
+ socket.onmessage = function () {
+ var data, recvmsg = '', i, len, messageObj;
+ data = socket.readData();
+ len = data.length;
+ for (i = 0; i < len; i += 1) {
+ recvmsg += String.fromCharCode(data[i]);
+ }
+ messageObj = JSON.parse(recvmsg);
+ app.displayReceivedMessage(messageObj.name, messageObj.text, messageObj.ping, messageObj.bye);
+ };
+ socket.onerror = function (e) {
+ console.log('server socket error');
+ socket.close();
+ };
+ socket.onclose = function () {
+ app.globalSocket = null;
+ };
+ if (socket.peer.name !== '') {
+ peerName = socket.peer.name;
+ }
+ };
+ },
+
+ onRegisterError: function onRegisterError() {
+ "use strict";
+ console.log('Problem with server service registering');
+ },
+
+ registerServer: function registerServer() {
+ "use strict";
+ if (app.numberOfClients === 0) {
+ try {
+ app.adapter.registerRFCOMMServiceByUUID(app.serviceUUID, 'Chat service', server.onRegisterSuccess, server.onRegisterError);
+ } catch (error) {
+ console.log(error);
+ }
+ }
+ },
+
+ setServerVisible: function setServerVisible() {
+ "use strict";
+ try {
+ if (!app.adapter.visible) {
+ app.adapter.setVisible(true, server.registerServer, function (error) { console.log(error); }, 0);
+ } else {
+ server.registerServer();
+ }
+ } catch (error) {
+ console.log(error);
+ }
+ },
+
+ onUnregisterSuccess: function onUnregisterSuccess() {
+ "use strict";
+ app.chatServiceHandler = null;
+ app.numberOfClients = 0;
+ app.restartBluetooth();
+ },
+
+ onUnregisterError: function onUnregisterError() {
+ "use strict";
+ console.log('Problem with unregister server');
+ app.numberOfClients = 0;
+ app.restartBluetooth();
+ },
+
+ unRegisterChatService: function unRegisterChatService() {
+ "use strict";
+ try {
+ if (app.chatServiceHandler !== null) {
+ app.chatServiceHandler.unregister(server.onUnregisterSuccess, server.onUnregisterError);
+ } else {
+ app.showStartButtons();
+ }
+ } catch (error) {
+ server.onUnregisterError();
+ }
+ }
+};
\ No newline at end of file
--- /dev/null
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="DistributorSignature">
+<SignedInfo>
+<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
+<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></SignatureMethod>
+<Reference URI="css/style.css">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>EmD4tpoxFU380kfsRc0yFNeD4FO2icwW6oJLo/Bvt7w=</DigestValue>
+</Reference>
+<Reference URI="js/server.js">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>xD7ocCFK2JzpmiZQh3Z9ZMYG07+MQBHqLqVxRrWwlHk=</DigestValue>
+</Reference>
+<Reference URI="js/main.js">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>3IwyxwZuyxwo4dDWsDYURK6cMBhwS/YMefaQA2WJxB0=</DigestValue>
+</Reference>
+<Reference URI="js/client.js">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>j6jhBZmdsP88oZeiGRKyfhkW0LQQlBP+SpoupHePZXY=</DigestValue>
+</Reference>
+<Reference URI="icon.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>KYqit9PBLTvR4aRrcA5V+1Xg+YoNHMr5nSElG73ljco=</DigestValue>
+</Reference>
+<Reference URI="config.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>GGACLNjGuq0x4gfS67hs5J2nFiw4SNnp3lFhPccS7L0=</DigestValue>
+</Reference>
+<Reference URI="LICENSE">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>3eAKfddMvUo3Opri3yMldvBqZpQeoqxOo4o/v00KuUo=</DigestValue>
+</Reference>
+<Reference URI="index.html">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>FFiuA12RGDQVIRnszkXtmOUpu/KJXRlWRBkvkK+JM2Q=</DigestValue>
+</Reference>
+<Reference URI="#prop">
+<Transforms>
+<Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"></Transform>
+</Transforms>
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>u/jU3U4Zm5ihTMSjKGlGYbWzDfRkGphPPHx3gJIYEJ4=</DigestValue>
+</Reference>
+</SignedInfo>
+<SignatureValue>
+O8t1POwWRfRj365cqcHzV607iD5eAF90ZgJ8TsK4kQrat/JOgQIZ9YVgVec1VhroqSW+g0HaVB+W
+sWilS1ES9DRp+qIsaoEVJM5oERYjNw5JAl8Ghbn2s3nh9Xm2WMHop3tLWU977F1v57tR6wo/VUxL
+9LJoncckGNrgy0UkuTw=
+</SignatureValue>
+<KeyInfo>
+<X509Data>
+<X509Certificate>
+MIICmzCCAgQCCQDXI7WLdVZwiTANBgkqhkiG9w0BAQUFADCBjzELMAkGA1UEBhMCS1IxDjAMBgNV
+BAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6ZW4gVGVzdCBDQTEiMCAGA1UE
+CwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTEkMCIGA1UEAwwbVGl6ZW4gUHVibGljIERpc3Ry
+aWJ1dG9yIENBMB4XDTEyMTAyOTEzMDMwNFoXDTIyMTAyNzEzMDMwNFowgZMxCzAJBgNVBAYTAktS
+MQ4wDAYDVQQIDAVTdXdvbjEOMAwGA1UEBwwFU3V3b24xFjAUBgNVBAoMDVRpemVuIFRlc3QgQ0Ex
+IjAgBgNVBAsMGVRpemVuIERpc3RyaWJ1dG9yIFRlc3QgQ0ExKDAmBgNVBAMMH1RpemVuIFB1Ymxp
+YyBEaXN0cmlidXRvciBTaWduZXIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALtMvlc5hENK
+90ZdA+y66+Sy0enD1gpZDBh5T9RP0oRsptJv5jjNTseQbQi0SZOdOXb6J7iQdlBCtR343RpIEz8H
+mrBy7mSY7mgwoU4EPpp4CTSUeAuKcmvrNOngTp5Hv7Ngf02TTHOLK3hZLpGayaDviyNZB5PdqQdB
+hokKjzAzAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAvGp1gxxAIlFfhJH1efjb9BJK/rtRkbYn9+Ez
+GEbEULg1svsgnyWisFimI3uFvgI/swzr1eKVY3Sc8MQ3+Fdy3EkbDZ2+WAubhcEkorTWjzWz2fL1
+vKaYjeIsuEX6TVRUugHWudPzcEuQRLQf8ibZWjbQdBmpeQYBMg5x+xKLCJc=
+</X509Certificate>
+<X509Certificate>
+MIICtDCCAh2gAwIBAgIJAMDbehElPNKvMA0GCSqGSIb3DQEBBQUAMIGVMQswCQYDVQQGEwJLUjEO
+MAwGA1UECAwFU3V3b24xDjAMBgNVBAcMBVN1d29uMRYwFAYDVQQKDA1UaXplbiBUZXN0IENBMSMw
+IQYDVQQLDBpUVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTEpMCcGA1UEAwwgVGl6ZW4gUHVibGlj
+IERpc3RyaWJ1dG9yIFJvb3QgQ0EwHhcNMTIxMDI5MTMwMjUwWhcNMjIxMDI3MTMwMjUwWjCBjzEL
+MAkGA1UEBhMCS1IxDjAMBgNVBAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6
+ZW4gVGVzdCBDQTEiMCAGA1UECwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTEkMCIGA1UEAwwb
+VGl6ZW4gUHVibGljIERpc3RyaWJ1dG9yIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDe
+OTS/3nXvkDEmsFCJIvRlQ3RKDcxdWJJp625pFqHdmoJBdV+x6jl1raGK2Y1sp2Gdvpjc/z92yzAp
+bE/UVLPh/tRNZPeGhzU4ejDDm7kzdr2f7Ia0U98K+OoY12ucwg7TYNItj9is7Cj4blGfuMDzd2ah
+2AgnCGlwNwV/pv+uVQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBACqJ
+KO33YdoGudwanZIxMdXuxnnD9R6u72ltKk1S4zPfMJJv482CRGCI4FK6djhlsI4i0Lt1SVIJEed+
+yc3qckGm19dW+4xdlkekon7pViEBWuyHw8OWv3RXtTum1+PGHjBJ2eYY4ZKIpz73U/1NC16sTB/0
+VhfnkHwPltmrpYVe
+</X509Certificate>
+</X509Data>
+</KeyInfo>
+<Object Id="prop"><SignatureProperties xmlns:dsp="http://www.w3.org/2009/xmldsig-properties"><SignatureProperty Id="profile" Target="#DistributorSignature"><dsp:Profile URI="http://www.w3.org/ns/widgets-digsig#profile"></dsp:Profile></SignatureProperty><SignatureProperty Id="role" Target="#DistributorSignature"><dsp:Role URI="http://www.w3.org/ns/widgets-digsig#role-distributor"></dsp:Role></SignatureProperty><SignatureProperty Id="identifier" Target="#DistributorSignature"><dsp:Identifier></dsp:Identifier></SignatureProperty></SignatureProperties></Object>
+</Signature>
\ No newline at end of file