AppNearMe µNFC stack for the NXP PN532 chip License: You can use the stack free of charge to prototype with mbed; if you want to use the stack with your commercial product, get in touch!
Dependents: IOT_sensor_nfc AppNearMe_MuNFC_PN532_Test p2p_nfc_test NFCMoodLamp ... more
License
You can use the stack free of charge to prototype with mbed; if you want to use the stack with your commercial product, get in touch!
Diff: PN532/NdefCallback.cpp
- Revision:
- 3:0b949b2d3b55
- Parent:
- 0:480387549d89
diff -r 913eb8fdfd9d -r 0b949b2d3b55 PN532/NdefCallback.cpp --- a/PN532/NdefCallback.cpp Thu Jul 26 10:02:19 2012 +0000 +++ b/PN532/NdefCallback.cpp Tue Aug 07 21:55:12 2012 +0000 @@ -1,46 +1,46 @@ -/* - NdefCallback.cpp - Copyright (c) Donatien Garnier 2012 - donatien.garnier@appnearme.com - http://www.appnearme.com/ -*/ - -#include "NdefCallback.h" -#include "TLVList.h" - -NdefCallback::NdefCallback() -{ - -} - -void NdefCallback::init(void (*fn)(appnearme_ndef_callback, void*)) -{ - fn(staticCallback, this); -} - -void NdefCallback::attach(void (*fn)(TLVList*, void*), void* arg) -{ - m_inst = NULL; - m_fn = fn; - m_arg = arg; -} - -void NdefCallback::callback(tlv_list* payload) -{ - m_tlvList.wrap(payload); - if(m_inst) - { - m_caller(&m_tlvList); - } - else if(m_fn) - { - m_fn(&m_tlvList, m_arg); - } -} - -/*static*/ void NdefCallback::staticCallback(tlv_list* payload, void* param) -{ - ((NdefCallback*)(param))->callback(payload); -} - - +/* + NdefCallback.cpp + Copyright (c) Donatien Garnier 2012 + donatien.garnier@appnearme.com + http://www.appnearme.com/ +*/ + +#include "NdefCallback.h" +#include "TLVList.h" + +NdefCallback::NdefCallback() +{ + +} + +void NdefCallback::init(void (*fn)(appnearme_ndef_callback, void*)) +{ + fn(staticCallback, this); +} + +void NdefCallback::attach(void (*fn)(TLVList*, void*), void* arg) +{ + m_inst = NULL; + m_fn = fn; + m_arg = arg; +} + +void NdefCallback::callback(tlv_list* payload) +{ + m_tlvList.wrap(payload); + if(m_inst) + { + m_caller(&m_tlvList); + } + else if(m_fn) + { + m_fn(&m_tlvList, m_arg); + } +} + +/*static*/ void NdefCallback::staticCallback(tlv_list* payload, void* param) +{ + ((NdefCallback*)(param))->callback(payload); +} + +