Index: device/nfc/nfc.mojom |
diff --git a/device/nfc/nfc.mojom b/device/nfc/nfc.mojom |
index 1caea1b4f5220d7f9d6076d200b9f4bec173a253..58270f221edbc0ce0c34a7855763ed99e729f59b 100644 |
--- a/device/nfc/nfc.mojom |
+++ b/device/nfc/nfc.mojom |
@@ -25,13 +25,20 @@ enum NFCRecordType { |
}; |
enum NFCPushTarget { |
+ // The target of a push operation must be the NFC tag. |
TAG, |
+ // The target of a push operation must be the NFC peer (device to device). |
PEER, |
+ // The target of a push operation must be either NFC tag or peer. |
ANY |
}; |
enum NFCWatchMode { |
+ // Restricts scope of the watch operation. Only Web NFC messages must be |
+ // used by matching algorithm. |
WEBNFC_ONLY, |
+ // Allows performing watch operation for all NFC messages. For example, NFC |
+ // tags with valid NDEF messages. |
ANY |
}; |
@@ -40,19 +47,35 @@ struct NFCError { |
}; |
struct NFCRecord { |
+ // The type of NFCRecord. |
NFCRecordType recordType; |
+ |
+ // Represents the IANA media type of the NFCRecord data field. |
string? mediaType; |
+ |
+ // Payload of the NFCRecord. |
array<uint8> data; |
}; |
struct NFCMessage { |
+ // The body of the NFCMessage is a collection of NFCRecord objects. |
array<NFCRecord> data; |
+ |
+ // The |url| field is an ASCII serialized origin, optionally followed by a URL |
+ // path. It represents Web NFC id, that can be used for matching Web NFC |
+ // content with the filter specified by |url| field in NFCWatchOptions. |
string? url; |
}; |
struct NFCPushOptions { |
+ // The target of the push operation. |
NFCPushTarget target; |
+ |
+ // The timeout for the push operation, in milliseconds. |
double timeout; |
+ |
+ // If the property is true, the push operation will suspend active watchers |
+ // until it's completion. |
dcheng
2016/08/17 17:18:47
Nit: its.
|
bool ignoreRead; |
}; |
@@ -61,9 +84,16 @@ struct NFCRecordTypeFilter { |
}; |
struct NFCWatchOptions { |
+ // Defines filtering constraint for NFC messages with specified |url|. |
string? url; |
+ |
+ // Defines filtering constraint for NFC records with specified record type. |
NFCRecordTypeFilter? recordFilter; |
+ |
+ // Defines media type filtering constraint. |
string? mediaType; |
+ |
+ // Defines mode of watch operation. |
NFCWatchMode mode; |
}; |
@@ -82,7 +112,7 @@ interface NFC { |
CancelPush(NFCPushTarget target) => (NFCError? error); |
// Starts watching for nearby NFC devices with data that matches |
- // NFCWatchOptions filtering criteria. On success, watch ID is returned. |
+ // NFCWatchOptions filtering criteria. On success, watch id is returned. |
Watch(NFCWatchOptions options) => (uint32 id, NFCError? error); |
// Cancels watch operation with provided id. |