This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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
*** This bug has been marked as a duplicate of bug 26512 ***