Embedded SDK
Embedded SDK
Macros | Functions | Variables
nfc_ndef.h File Reference
#include "stdint.h"
#include "errors.h"
Include dependency graph for nfc_ndef.h:

Go to the source code of this file.

Macros

#define URI_ID_0x00   0x00
 
#define URI_ID_0x01   0x01
 
#define URI_ID_0x02   0x02
 
#define URI_ID_0x03   0x03
 
#define URI_ID_0x04   0x04
 
#define URI_ID_0x05   0x05
 
#define URI_ID_0x06   0x06
 
#define URI_ID_0x07   0x07
 
#define URI_ID_0x08   0x08
 
#define URI_ID_0x09   0x09
 
#define URI_ID_0x0A   0x0A
 
#define URI_ID_0x0B   0x0B
 
#define URI_ID_0x0C   0x0C
 
#define URI_ID_0x0D   0x0D
 
#define URI_ID_0x0E   0x0E
 
#define URI_ID_0x0F   0x0F
 
#define URI_ID_0x10   0x10
 
#define URI_ID_0x11   0x11
 
#define URI_ID_0x12   0x12
 
#define URI_ID_0x13   0x13
 
#define URI_ID_0x14   0x14
 
#define URI_ID_0x15   0x15
 
#define URI_ID_0x16   0x16
 
#define URI_ID_0x17   0x17
 
#define URI_ID_0x18   0x18
 
#define URI_ID_0x19   0x19
 
#define URI_ID_0x1A   0x1A
 
#define URI_ID_0x1B   0x1B
 
#define URI_ID_0x1C   0x1C
 
#define URI_ID_0x1D   0x1D
 
#define URI_ID_0x1E   0x1E
 
#define URI_ID_0x1F   0x1F
 
#define URI_ID_0x20   0x20
 
#define URI_ID_0x21   0x21
 
#define URI_ID_0x22   0x22
 
#define URI_ID_0x23   0x23
 
#define URI_RFU   0x24
 
#define URI_ID_0x01_STRING   "http://www.\0"
 
#define URI_ID_0x02_STRING   "https://www.\0"
 
#define URI_ID_0x03_STRING   "http://\0"
 
#define URI_ID_0x04_STRING   "https://\0"
 
#define URI_ID_0x05_STRING   "tel:\0"
 
#define URI_ID_0x06_STRING   "mailto:\0"
 
#define URI_ID_0x07_STRING   "ftp://anonymous:anonymous@\0"
 
#define URI_ID_0x08_STRING   "ftp://ftp.\0"
 
#define URI_ID_0x09_STRING   "ftps://\0"
 
#define URI_ID_0x0A_STRING   "sftp://\0"
 
#define URI_ID_0x0B_STRING   "smb://\0"
 
#define URI_ID_0x0C_STRING   "nfs://\0"
 
#define URI_ID_0x0D_STRING   "ftp://\0"
 
#define URI_ID_0x0E_STRING   "dav://\0"
 
#define URI_ID_0x0F_STRING   "news:\0"
 
#define URI_ID_0x10_STRING   "telnet://\0"
 
#define URI_ID_0x11_STRING   "imap:\0"
 
#define URI_ID_0x12_STRING   "rtsp://\0"
 
#define URI_ID_0x13_STRING   "urn:\0"
 
#define URI_ID_0x14_STRING   "pop:\0"
 
#define URI_ID_0x15_STRING   "sip:\0"
 
#define URI_ID_0x16_STRING   "sips:\0"
 
#define URI_ID_0x17_STRING   "tftp:\0"
 
#define URI_ID_0x18_STRING   "btspp://\0"
 
#define URI_ID_0x19_STRING   "btl2cap://\0"
 
#define URI_ID_0x1A_STRING   "btgoep://\0"
 
#define URI_ID_0x1B_STRING   "tcpobex://\0"
 
#define URI_ID_0x1C_STRING   "irdaobex://\0"
 
#define URI_ID_0x1D_STRING   "file://\0"
 
#define URI_ID_0x1E_STRING   "urn:epc:id:\0"
 
#define URI_ID_0x1F_STRING   "urn:epc:tag\0"
 
#define URI_ID_0x20_STRING   "urn:epc:pat:\0"
 
#define URI_ID_0x21_STRING   "urn:epc:raw:\0"
 
#define URI_ID_0x22_STRING   "urn:epc:\0"
 
#define URI_ID_0x23_STRING   "urn:nfc:\0"
 
#define URI_ID_STRING_MAX_LEN   27
 
#define NFC_TEXT_MAX_LEN   215
 
#define NFC_INFO_MAX_LEN   30
 
#define NFC_NDEF_MAX_SIZE   (URI_ID_STRING_MAX_LEN + NFC_TEXT_MAX_LEN + NFC_INFO_MAX_LEN + 1)
 
#define NFC_NDEF_TYPE_TEXT   0x01
 
#define NFC_NDEF_TYPE_URI   0x02
 

Functions

struct __attribute__ ((packed)) ndef_struct_s
 Structure to store an NDEF message. More...
 
uint16_t os_get_uri_header (uint8_t uri_id, char *uri_header)
 
uint8_t os_parse_ndef (uint8_t *in_buffer, ndef_struct_t *parsed)
 
uint16_t os_ndef_to_string (ndef_struct_t *ndef_message, char *out_string)
 

Variables

 ndef_struct_t
 

Macro Definition Documentation

◆ NFC_INFO_MAX_LEN

#define NFC_INFO_MAX_LEN   30

Definition at line 88 of file nfc_ndef.h.

◆ NFC_NDEF_MAX_SIZE

#define NFC_NDEF_MAX_SIZE   (URI_ID_STRING_MAX_LEN + NFC_TEXT_MAX_LEN + NFC_INFO_MAX_LEN + 1)

Definition at line 90 of file nfc_ndef.h.

◆ NFC_NDEF_TYPE_TEXT

#define NFC_NDEF_TYPE_TEXT   0x01

Definition at line 92 of file nfc_ndef.h.

◆ NFC_NDEF_TYPE_URI

#define NFC_NDEF_TYPE_URI   0x02

Definition at line 93 of file nfc_ndef.h.

◆ NFC_TEXT_MAX_LEN

#define NFC_TEXT_MAX_LEN   215

Definition at line 87 of file nfc_ndef.h.

◆ URI_ID_0x00

#define URI_ID_0x00   0x00

Definition at line 11 of file nfc_ndef.h.

◆ URI_ID_0x01

#define URI_ID_0x01   0x01

Definition at line 12 of file nfc_ndef.h.

◆ URI_ID_0x01_STRING

#define URI_ID_0x01_STRING   "http://www.\0"

Definition at line 49 of file nfc_ndef.h.

◆ URI_ID_0x02

#define URI_ID_0x02   0x02

Definition at line 13 of file nfc_ndef.h.

◆ URI_ID_0x02_STRING

#define URI_ID_0x02_STRING   "https://www.\0"

Definition at line 50 of file nfc_ndef.h.

◆ URI_ID_0x03

#define URI_ID_0x03   0x03

Definition at line 14 of file nfc_ndef.h.

◆ URI_ID_0x03_STRING

#define URI_ID_0x03_STRING   "http://\0"

Definition at line 51 of file nfc_ndef.h.

◆ URI_ID_0x04

#define URI_ID_0x04   0x04

Definition at line 15 of file nfc_ndef.h.

◆ URI_ID_0x04_STRING

#define URI_ID_0x04_STRING   "https://\0"

Definition at line 52 of file nfc_ndef.h.

◆ URI_ID_0x05

#define URI_ID_0x05   0x05

Definition at line 16 of file nfc_ndef.h.

◆ URI_ID_0x05_STRING

#define URI_ID_0x05_STRING   "tel:\0"

Definition at line 53 of file nfc_ndef.h.

◆ URI_ID_0x06

#define URI_ID_0x06   0x06

Definition at line 17 of file nfc_ndef.h.

◆ URI_ID_0x06_STRING

#define URI_ID_0x06_STRING   "mailto:\0"

Definition at line 54 of file nfc_ndef.h.

◆ URI_ID_0x07

#define URI_ID_0x07   0x07

Definition at line 18 of file nfc_ndef.h.

◆ URI_ID_0x07_STRING

#define URI_ID_0x07_STRING   "ftp://anonymous:anonymous@\0"

Definition at line 55 of file nfc_ndef.h.

◆ URI_ID_0x08

#define URI_ID_0x08   0x08

Definition at line 19 of file nfc_ndef.h.

◆ URI_ID_0x08_STRING

#define URI_ID_0x08_STRING   "ftp://ftp.\0"

Definition at line 56 of file nfc_ndef.h.

◆ URI_ID_0x09

#define URI_ID_0x09   0x09

Definition at line 20 of file nfc_ndef.h.

◆ URI_ID_0x09_STRING

#define URI_ID_0x09_STRING   "ftps://\0"

Definition at line 57 of file nfc_ndef.h.

◆ URI_ID_0x0A

#define URI_ID_0x0A   0x0A

Definition at line 21 of file nfc_ndef.h.

◆ URI_ID_0x0A_STRING

#define URI_ID_0x0A_STRING   "sftp://\0"

Definition at line 58 of file nfc_ndef.h.

◆ URI_ID_0x0B

#define URI_ID_0x0B   0x0B

Definition at line 22 of file nfc_ndef.h.

◆ URI_ID_0x0B_STRING

#define URI_ID_0x0B_STRING   "smb://\0"

Definition at line 59 of file nfc_ndef.h.

◆ URI_ID_0x0C

#define URI_ID_0x0C   0x0C

Definition at line 23 of file nfc_ndef.h.

◆ URI_ID_0x0C_STRING

#define URI_ID_0x0C_STRING   "nfs://\0"

Definition at line 60 of file nfc_ndef.h.

◆ URI_ID_0x0D

#define URI_ID_0x0D   0x0D

Definition at line 24 of file nfc_ndef.h.

◆ URI_ID_0x0D_STRING

#define URI_ID_0x0D_STRING   "ftp://\0"

Definition at line 61 of file nfc_ndef.h.

◆ URI_ID_0x0E

#define URI_ID_0x0E   0x0E

Definition at line 25 of file nfc_ndef.h.

◆ URI_ID_0x0E_STRING

#define URI_ID_0x0E_STRING   "dav://\0"

Definition at line 62 of file nfc_ndef.h.

◆ URI_ID_0x0F

#define URI_ID_0x0F   0x0F

Definition at line 26 of file nfc_ndef.h.

◆ URI_ID_0x0F_STRING

#define URI_ID_0x0F_STRING   "news:\0"

Definition at line 63 of file nfc_ndef.h.

◆ URI_ID_0x10

#define URI_ID_0x10   0x10

Definition at line 27 of file nfc_ndef.h.

◆ URI_ID_0x10_STRING

#define URI_ID_0x10_STRING   "telnet://\0"

Definition at line 64 of file nfc_ndef.h.

◆ URI_ID_0x11

#define URI_ID_0x11   0x11

Definition at line 28 of file nfc_ndef.h.

◆ URI_ID_0x11_STRING

#define URI_ID_0x11_STRING   "imap:\0"

Definition at line 65 of file nfc_ndef.h.

◆ URI_ID_0x12

#define URI_ID_0x12   0x12

Definition at line 29 of file nfc_ndef.h.

◆ URI_ID_0x12_STRING

#define URI_ID_0x12_STRING   "rtsp://\0"

Definition at line 66 of file nfc_ndef.h.

◆ URI_ID_0x13

#define URI_ID_0x13   0x13

Definition at line 30 of file nfc_ndef.h.

◆ URI_ID_0x13_STRING

#define URI_ID_0x13_STRING   "urn:\0"

Definition at line 67 of file nfc_ndef.h.

◆ URI_ID_0x14

#define URI_ID_0x14   0x14

Definition at line 31 of file nfc_ndef.h.

◆ URI_ID_0x14_STRING

#define URI_ID_0x14_STRING   "pop:\0"

Definition at line 68 of file nfc_ndef.h.

◆ URI_ID_0x15

#define URI_ID_0x15   0x15

Definition at line 32 of file nfc_ndef.h.

◆ URI_ID_0x15_STRING

#define URI_ID_0x15_STRING   "sip:\0"

Definition at line 69 of file nfc_ndef.h.

◆ URI_ID_0x16

#define URI_ID_0x16   0x16

Definition at line 33 of file nfc_ndef.h.

◆ URI_ID_0x16_STRING

#define URI_ID_0x16_STRING   "sips:\0"

Definition at line 70 of file nfc_ndef.h.

◆ URI_ID_0x17

#define URI_ID_0x17   0x17

Definition at line 34 of file nfc_ndef.h.

◆ URI_ID_0x17_STRING

#define URI_ID_0x17_STRING   "tftp:\0"

Definition at line 71 of file nfc_ndef.h.

◆ URI_ID_0x18

#define URI_ID_0x18   0x18

Definition at line 35 of file nfc_ndef.h.

◆ URI_ID_0x18_STRING

#define URI_ID_0x18_STRING   "btspp://\0"

Definition at line 72 of file nfc_ndef.h.

◆ URI_ID_0x19

#define URI_ID_0x19   0x19

Definition at line 36 of file nfc_ndef.h.

◆ URI_ID_0x19_STRING

#define URI_ID_0x19_STRING   "btl2cap://\0"

Definition at line 73 of file nfc_ndef.h.

◆ URI_ID_0x1A

#define URI_ID_0x1A   0x1A

Definition at line 37 of file nfc_ndef.h.

◆ URI_ID_0x1A_STRING

#define URI_ID_0x1A_STRING   "btgoep://\0"

Definition at line 74 of file nfc_ndef.h.

◆ URI_ID_0x1B

#define URI_ID_0x1B   0x1B

Definition at line 38 of file nfc_ndef.h.

◆ URI_ID_0x1B_STRING

#define URI_ID_0x1B_STRING   "tcpobex://\0"

Definition at line 75 of file nfc_ndef.h.

◆ URI_ID_0x1C

#define URI_ID_0x1C   0x1C

Definition at line 39 of file nfc_ndef.h.

◆ URI_ID_0x1C_STRING

#define URI_ID_0x1C_STRING   "irdaobex://\0"

Definition at line 76 of file nfc_ndef.h.

◆ URI_ID_0x1D

#define URI_ID_0x1D   0x1D

Definition at line 40 of file nfc_ndef.h.

◆ URI_ID_0x1D_STRING

#define URI_ID_0x1D_STRING   "file://\0"

Definition at line 77 of file nfc_ndef.h.

◆ URI_ID_0x1E

#define URI_ID_0x1E   0x1E

Definition at line 41 of file nfc_ndef.h.

◆ URI_ID_0x1E_STRING

#define URI_ID_0x1E_STRING   "urn:epc:id:\0"

Definition at line 78 of file nfc_ndef.h.

◆ URI_ID_0x1F

#define URI_ID_0x1F   0x1F

Definition at line 42 of file nfc_ndef.h.

◆ URI_ID_0x1F_STRING

#define URI_ID_0x1F_STRING   "urn:epc:tag\0"

Definition at line 79 of file nfc_ndef.h.

◆ URI_ID_0x20

#define URI_ID_0x20   0x20

Definition at line 43 of file nfc_ndef.h.

◆ URI_ID_0x20_STRING

#define URI_ID_0x20_STRING   "urn:epc:pat:\0"

Definition at line 80 of file nfc_ndef.h.

◆ URI_ID_0x21

#define URI_ID_0x21   0x21

Definition at line 44 of file nfc_ndef.h.

◆ URI_ID_0x21_STRING

#define URI_ID_0x21_STRING   "urn:epc:raw:\0"

Definition at line 81 of file nfc_ndef.h.

◆ URI_ID_0x22

#define URI_ID_0x22   0x22

Definition at line 45 of file nfc_ndef.h.

◆ URI_ID_0x22_STRING

#define URI_ID_0x22_STRING   "urn:epc:\0"

Definition at line 82 of file nfc_ndef.h.

◆ URI_ID_0x23

#define URI_ID_0x23   0x23

Definition at line 46 of file nfc_ndef.h.

◆ URI_ID_0x23_STRING

#define URI_ID_0x23_STRING   "urn:nfc:\0"

Definition at line 83 of file nfc_ndef.h.

◆ URI_ID_STRING_MAX_LEN

#define URI_ID_STRING_MAX_LEN   27

Definition at line 85 of file nfc_ndef.h.

◆ URI_RFU

#define URI_RFU   0x24

Definition at line 47 of file nfc_ndef.h.

Function Documentation

◆ __attribute__()

struct __attribute__ ( (packed)  )

Structure to store an NDEF message.

Definition at line 1 of file nfc_ndef.h.

◆ os_get_uri_header()

uint16_t os_get_uri_header ( uint8_t  uri_id,
char *  uri_header 
)

◆ os_ndef_to_string()

uint16_t os_ndef_to_string ( ndef_struct_t ndef_message,
char *  out_string 
)

◆ os_parse_ndef()

uint8_t os_parse_ndef ( uint8_t in_buffer,
ndef_struct_t parsed 
)

Variable Documentation

◆ ndef_struct_t

ndef_struct_t

Definition at line 107 of file nfc_ndef.h.