ST / Mbed 2 deprecated NFC01A1_Demos

Dependencies:   NDefLib X_NUCLEO_NFC01A1 mbed

Fork of X-MBED-NFC1 by Giovanni Visentini

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file       main.cpp
00004   * @date       03/12/2015
00005   ******************************************************************************
00006   *
00007   * COPYRIGHT(c) 2015 STMicroelectronics
00008   *
00009   * Redistribution and use in source and binary forms, with or without modification,
00010   * are permitted provided that the following conditions are met:
00011   *   1. Redistributions of source code must retain the above copyright notice,
00012   *      this list of conditions and the following disclaimer.
00013   *   2. Redistributions in binary form must reproduce the above copyright notice,
00014   *      this list of conditions and the following disclaimer in the documentation
00015   *      and/or other materials provided with the distribution.
00016   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00017   *      may be used to endorse or promote products derived from this software
00018   *      without specific prior written permission.
00019   *
00020   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00021   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00022   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00023   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00024   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00025   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00026   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00027   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00028   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00029   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030   *
00031   ******************************************************************************
00032   */
00033 
00034 #include "Samples/Samples.h"
00035 
00036 //choose the demo to compile
00037 //#define SAMPLE_WRITE_URL
00038 //#define SAMPLE_COUNT_CLICK
00039 #define SAMPLE_WRITE_AND_CHANGE_ALL
00040 //#define SAMPLE_LOCK_TAG_CONTENT
00041 
00042 //uncomment for the async example
00043 //#define SYNC_MODE
00044  
00045 int main(void)
00046 {
00047 #ifdef SAMPLE_WRITE_URL
00048     #ifdef SYNC_MODE
00049         sampleSync_writeUrl();
00050     #else
00051         sampleAsync_writeUrl();
00052     #endif
00053 #endif /* SAMPLE_WRITE_URL */
00054 
00055 #ifdef SAMPLE_COUNT_CLICK
00056     #ifdef SYNC_MODE
00057         sampleSync_countClick();
00058     #else
00059         sampleAsync_countClick();
00060     #endif
00061 #endif /* SAMPLE_COUNT_CLICK */
00062 
00063 #ifdef SAMPLE_WRITE_AND_CHANGE_ALL
00064     #ifdef SYNC_MODE
00065         sampleSync_writeAndChangeAll();
00066     #else
00067         sampleAsync_writeAndChangeAll();
00068     #endif
00069 #endif /* SAMPLE_WRITE_AND_CHANGE_ALL */
00070 
00071 #ifdef SAMPLE_LOCK_TAG_CONTENT
00072     #ifdef SYNC_MODE
00073         sampleSync_lockTagContent();
00074     #else
00075         sampleAsync_lockTagContent();
00076     #endif
00077 #endif /* SAMPLE_LOCK_TAG_CONTENT */
00078 }