bitutils.h
Go to the documentation of this file.00001
00024 #ifndef _LIBNFC_BITUTILS_H_
00025 #define _LIBNFC_BITUTILS_H_
00026
00027 #include <stdint.h>
00028
00029
00030
00031
00032 #ifdef _WIN32
00033
00034 #ifndef _WINDLL
00035
00036 #ifdef nfc_EXPORTS
00037 #define NFC_EXPORT __declspec(dllexport)
00038 #else
00039 #define NFC_EXPORT __declspec(dllimport)
00040 #endif
00041 #else
00042
00043 #define NFC_EXPORT
00044 #endif
00045 #else
00046 #define NFC_EXPORT
00047 #endif
00048
00049 #include <nfc/nfc-types.h>
00050
00051 byte_t oddparity(const byte_t bt);
00052 void oddparity_byte_ts(const byte_t* pbtData, const size_t szLen, byte_t* pbtPar);
00053
00054 NFC_EXPORT byte_t mirror(byte_t bt);
00055 NFC_EXPORT uint32_t mirror32(uint32_t ui32Bits);
00056 NFC_EXPORT uint64_t mirror64(uint64_t ui64Bits);
00057 NFC_EXPORT void mirror_byte_ts(byte_t *pbts, size_t szLen);
00058
00059 NFC_EXPORT uint32_t swap_endian32(const void* pui32);
00060 NFC_EXPORT uint64_t swap_endian64(const void* pui64);
00061
00062 NFC_EXPORT void append_iso14443a_crc(byte_t* pbtData, size_t szLen);
00063
00064 NFC_EXPORT void print_hex(const byte_t* pbtData, const size_t szLen);
00065 NFC_EXPORT void print_hex_bits(const byte_t* pbtData, const size_t szBits);
00066 NFC_EXPORT void print_hex_par(const byte_t* pbtData, const size_t szBits, const byte_t* pbtDataPar);
00067
00068 #endif // _LIBNFC_BITUTILS_H_
00069