12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //
- // Created by robin on 7/22/16.
- //
-
- #include "libnfc_cpptools/NfcDevice.h"
- #include "NfcDeviceInternal.h"
-
- namespace LibNfc
- {
- namespace Core
- {
-
- NfcDevice::NfcDevice(std::shared_ptr<NfcDeviceInternal> device)
- : _device(device)
- {
- }
-
- LibNfc::Utils::ResultBool NfcDevice::open()
- {
- if (isOpened()) {
- return LibNfc::Utils::ResultBool::error("NFC device is already opened");
- }
- return _device->open();
- }
-
- void NfcDevice::close()
- {
- if (isOpened()) {
- _device->close();
- }
- }
-
- bool NfcDevice::isOpened() const
- {
- return _device->getDevice() != 0;
- }
-
- const std::string &NfcDevice::getConnStr() const
- {
- return _device->getConnStr();
- }
-
- std::shared_ptr<NfcDeviceInternal> NfcDevice::getDevice() const
- {
- return _device;
- }
-
- }; // Core
- }; // LibNfc
|