This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26512 - // first set phone into peering mode
Summary: // first set phone into peering mode
Status: RESOLVED NEEDSINFO
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
: 26504 26505 26506 26507 26508 26509 26510 26511 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-08-03 08:13 UTC by contributor
Modified: 2014-12-02 15:41 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2014-08-03 08:13:35 UTC
Specification: http://www.w3.org/TR/webmessaging/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top
Referrer: 

Comment:
  // first set phone into peering mode
   // nfcService is the NFC service, discovered through the webinos Discovery
API, that has been selected by the user   
   nfcService.peer(success, fail);
 
 function success (channel)
 {
   console.log("successfully initiated peering mode");
 
   // to send a message to the other device
   channel.port1.postMessage('hello');
 
   // to receive a message from the other device
   // first you set a message handler
   channel.port1.onmessage = handleMessage;
 
   // you next instruct the channel to dispatch events
   // you can later close the port with the stop() method
   // your device then reverts to its normal mode
   channel.port1.start();
 }
 
 function handleMessage(event)
 {
   // message is in event.data
   // ...
 }
 
 // after a time out when peering couldn't be established
 function fail ()
 {
   console.log("failed to initiate peering mode");
 }


Posted from: 61.228.227.139
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36
Comment 1 Ian 'Hixie' Hickson 2014-08-04 17:44:54 UTC
Can you elaborate on your request? I don't understand what you are asking. What would you like changed in the spec?
Comment 2 Ian 'Hixie' Hickson 2014-08-04 17:44:57 UTC
*** Bug 26511 has been marked as a duplicate of this bug. ***
Comment 3 Ian 'Hixie' Hickson 2014-08-04 17:44:59 UTC
*** Bug 26510 has been marked as a duplicate of this bug. ***
Comment 4 Ian 'Hixie' Hickson 2014-08-04 17:45:02 UTC
*** Bug 26509 has been marked as a duplicate of this bug. ***
Comment 5 Ian 'Hixie' Hickson 2014-08-04 17:45:05 UTC
*** Bug 26508 has been marked as a duplicate of this bug. ***
Comment 6 Ian 'Hixie' Hickson 2014-08-04 17:45:08 UTC
*** Bug 26507 has been marked as a duplicate of this bug. ***
Comment 7 Ian 'Hixie' Hickson 2014-08-04 17:45:11 UTC
*** Bug 26506 has been marked as a duplicate of this bug. ***
Comment 8 Ian 'Hixie' Hickson 2014-08-04 17:45:17 UTC
*** Bug 26505 has been marked as a duplicate of this bug. ***
Comment 9 Ian 'Hixie' Hickson 2014-08-04 17:45:20 UTC
*** Bug 26504 has been marked as a duplicate of this bug. ***