[ContactsExchanger] updated ContactsExchanger sources
authorPiotr Dabrowski <p.dabrowski2@samsung.com>
Fri, 13 Sep 2013 06:54:17 +0000 (08:54 +0200)
committerPiotr Dabrowski <p.dabrowski2@samsung.com>
Fri, 13 Sep 2013 06:54:17 +0000 (08:54 +0200)
Change-Id: Ia20cf8c6b45c679ca1622e51b85da99ff4bf537c

index.html
js/app.nfc.js

index f44d911..e776642 100644 (file)
@@ -28,7 +28,7 @@
                <div data-role="header" id="header-start">
                        <h1>Contacts exchanger</h1>
                </div>
-               <div data-role="content" id="content-start">loading</div>
+               <div data-role="content" id="content-start"></div>
                <div id="contact-nfc-error" data-role="popup" class="center_title_1btn">
                        <div class="ui-popup-title"><h1>Warning</h1></div>
                        <div class="ui-popup-text">
index a252e61..4d86ffb 100644 (file)
                 * @returns {undefined}
                 */
                onPowerOn: function nfc_onPowerOn() {
+                       console.log('Power On succeeded.');
                        this.app.started = true;
                        this.app.ui.loadStartPage();
                },
                 */
                onPowerOnFails: function nfc_onPowerOnFails(err) {
                        console.error('Power On error: ' + err.message);
+                       this.app.ui.showPopupWarning();
                },
 
                /**
                },
 
                startNFC: function nfc_startNFC() {
-
                        try {
                                this.nfcAdapter = tizen.nfc.getDefaultAdapter();
-
                                if (this.nfcAdapter.powered) {
                                        this.nfcStateMemory = true;
                                        this.onPowerOn();
                                        return;
                                }
-
                                this.nfcStateMemory = false;
+                               console.log('Turning NFC adapter On...');
                                this.nfcAdapter.setPowered(true, this.onPowerOn.bind(this), this.onPowerOnFails.bind(this));
                        } catch (e) {
                                console.error('startNFC problem', e);
                                        this.nfcTarget.unsetReceiveNDEFListener();
                                        this.nfcTarget = null;
                                } else {
-                                       console.warn("app.nfc.nfcTarget not set");
+                                       //console.warn("app.nfc.nfcTarget not set");
                                }
                        } catch (error) {
                                console.error('error: ' + error.message);