OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 [DartPackage="mojo_services"] | |
6 module nfc; | |
7 | |
8 struct NfcData { | |
9 array<uint8>? data; | |
10 }; | |
11 | |
12 // Represents an in-progress nfc transmission. | |
13 interface NfcTransmission { | |
14 // Cancels the nfc transmission. | |
15 Cancel(); | |
16 }; | |
17 | |
18 // NfcReceivers can be registered with Nfc to receive nfc messages. | |
19 interface NfcReceiver { | |
20 OnReceivedNfcData(NfcData nfc_data); | |
21 }; | |
22 | |
23 // Nfc allows data to be sent to and received from other MojoShells on Android. | |
24 // Received data is passed to all registered NfcReceivers. | |
25 interface Nfc { | |
26 // Puts the MojoShell in a state where it will transmit |nfc_data| to the next | |
27 // Android device to connect to this one via NFC. This transmission state | |
28 // will remain active until cancelled via |transmission| or a |success| | |
29 // response is received indicating whether the transmission was successful | |
30 // (true) or not (false). If the Android device transmitted to does not have | |
31 // MojoShell installed it will be directed to the Play Store to download | |
32 // MojoShell. | |
33 TransmitOnNextConnection(NfcData nfc_data, NfcTransmission&? transmission) | |
34 => (bool success); | |
35 | |
36 // Registers an app to receive nfc messages. Upon receiving an nfc message | |
37 // the app will be connected to. If the app exposes a NfcReceiver interface | |
38 // it will be called with the message received. | |
39 Register(); | |
40 | |
41 // Unregisters an app previously registered via |Register()|. | |
42 Unregister(); | |
43 }; | |
OLD | NEW |