Kenji Arai / TYBLE16_mbedlized_os5_several_examples_1st

Dependencies:   nRF51_Vdd TextLCD BME280

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers NFCRemoteEndpoint.cpp Source File

NFCRemoteEndpoint.cpp

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2018 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #include "NFCRemoteEndpoint.h"
00018 #include "NFCController.h"
00019 
00020 #include "acore/ac_buffer.h"
00021 #include "acore/ac_buffer_reader.h"
00022 #include "acore/ac_buffer_builder.h"
00023 
00024 #include "stack/transceiver/transceiver.h"
00025 
00026 using namespace mbed;
00027 using namespace mbed::nfc;
00028 
00029 NFCRemoteEndpoint::NFCRemoteEndpoint(NFCController *controller) : _controller(controller)
00030 {
00031 
00032 }
00033 
00034 NFCRemoteEndpoint::~NFCRemoteEndpoint()
00035 {
00036 
00037 }
00038 
00039 nfc_rf_protocols_bitmask_t NFCRemoteEndpoint::rf_protocols()
00040 {
00041     nfc_rf_protocols_bitmask_t rf_protocols = {0};
00042     nfc_tech_t active_tech = transceiver_get_active_techs(_controller->transceiver());
00043     if (!transceiver_is_initiator_mode(_controller->transceiver())) {
00044         // Note: We only support ISO-DEP for now
00045         rf_protocols.target_iso_dep = active_tech.nfc_iso_dep_a || active_tech.nfc_iso_dep_b;
00046     }
00047 
00048     return rf_protocols;
00049 }
00050 
00051 NFCController *NFCRemoteEndpoint::nfc_controller()
00052 {
00053     return _controller;
00054 }
00055 
00056 const NFCController *NFCRemoteEndpoint::nfc_controller() const
00057 {
00058     return _controller;
00059 }
00060