1 // Copyright 2013 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.
5 #include "base/values.h"
6 #include "chromeos/dbus/nfc_record_client.h"
8 #ifndef DEVICE_NFC_CHROMEOS_NDEF_RECORD_UTILS_CHROMEOS_H_
9 #define DEVICE_NFC_CHROMEOS_NDEF_RECORD_UTILS_CHROMEOS_H_
13 } // namespace device;
16 namespace nfc_ndef_record_utils
{
18 // Converts the NfcNdefRecord |record| to a dictionary that can be passed to
19 // NfcDeviceClient::Push and NfcTagClient::Write and stores it in |out|.
20 // Returns false, if an error occurs during conversion.
21 bool NfcNdefRecordToDBusAttributes(
22 const device::NfcNdefRecord
* record
,
23 base::DictionaryValue
* out
);
25 // Converts an NDEF record D-Bus properties structure to an NfcNdefRecord
26 // instance by populating the instance passed in |out|. |out| must not be NULL
27 // and must not be already populated. Returns false, if an error occurs during
29 bool RecordPropertiesToNfcNdefRecord(
30 const NfcRecordClient::Properties
* properties
,
31 device::NfcNdefRecord
* out
);
33 } // namespace nfc_ndef_record_utils
34 } // namespace chromeos
36 #endif // DEVICE_NFC_CHROMEOS_NDEF_RECORD_UTILS_CHROMEOS_H_