hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
Macros | Enumerations | Functions
ifx-record-uri.h File Reference

Model interface to create URI record types and get/set record fields. More...

#include <stddef.h>
#include <stdint.h>
#include "infineon/ifx-error.h"
#include "infineon/ifx-utils.h"
#include "infineon/ifx-ndef-record.h"

Go to the source code of this file.

Macros

#define IFX_RECORD_URI_SET   UINT8_C(0x01)
 Identifier for model set URI record ID.
 
#define IFX_RECORD_URI_GET   UINT8_C(0x02)
 Identifier for model get URI record ID.
 
#define IFX_RECORD_URI_RELEASE_MEMORY   UINT8_C(0x03)
 Identifier for model URI record release memory.
 
#define IFX_RECORD_URI_TYPE   {UINT8_C(0x55)}
 Type information for uri record 'U'.
 
#define IFX_RECORD_IDENTIFIER_CODE_MAX   UINT8_C(0x24)
 Identifier code maximum numbers in list.
 

Enumerations

enum  ifx_record_uri_identifier {
  IFX_URI_NA = 0x00 , IFX_URI_HTTP_WWW = 0x01 , IFX_URI_HTTPS_WWW = 0x02 , IFX_URI_HTTP = 0x03 ,
  IFX_URI_HTTPS = 0x04 , IFX_URI_TEL = 0x05 , IFX_URI_MAILTO = 0x06 , IFX_URI_FTP_ANONYMOUS_ANONYMOUS = 0x07 ,
  IFX_URI_FTP_FTP = 0x08 , IFX_URI_FTPS = 0x09 , IFX_URI_SFTP = 0x0A , IFX_URI_SMB = 0x0B ,
  IFX_URI_NFS = 0x0C , IFX_URI_FTP = 0x0D , IFX_URI_DAV = 0x0E , IFX_URI_NEWS = 0x0F ,
  IFX_URI_TELNET = 0x10 , IFX_URI_IMAP = 0x11 , IFX_URI_RTSP = 0x12 , IFX_URI_URN = 0x13 ,
  IFX_URI_POP = 0x14 , IFX_URI_SIP = 0x15 , IFX_URI_SIPS = 0x16 , IFX_URI_TFTP = 0x17 ,
  IFX_URI_BTSPP = 0x18 , IFX_URI_BT12CAP = 0x19 , IFX_URI_BTGOEP = 0x1A , IFX_URI_TCPOBEX = 0x1B ,
  IFX_URI_IRDAOBEX = 0x1C , IFX_URI_FILE = 0x1D , IFX_URI_URN_EPC_ID = 0x1E , IFX_URI_URN_EPC_TAG = 0x1F ,
  IFX_URI_URN_EPC_PAT = 0x20 , IFX_URI_URN_EPC_RAW = 0x21 , IFX_URI_URN_EPC = 0x22 , IFX_URI_URN_NFC = 0x23
}
 URI identifiers for URI records identifier code. More...
 

Functions

ifx_status_t ifx_record_uri_new (ifx_record_handle_t *handle)
 Creates a new URI record and handle of the created record. This handle holds the values of the record needed for encode and decode operations.
 
ifx_status_t ifx_record_uri_get_identifier (const ifx_record_handle_t *handle, ifx_blob_t *identifier)
 Gets the identifier bytes from the URI record.
 
ifx_status_t ifx_record_uri_get_identifier_code (const ifx_record_handle_t *handle, uint8_t *identifier_code)
 Gets the identifier code from the URI record details.
 
ifx_status_t ifx_record_uri_get_uri (const ifx_record_handle_t *handle, ifx_blob_t *uri)
 Gets the URI value field from the URI record.
 
ifx_status_t ifx_record_uri_get_uri_with_identifier (const ifx_record_handle_t *handle, ifx_blob_t *uri_with_identifier)
 Gets the URI value along with the identifier from the URI record.
 
ifx_status_t ifx_record_uri_set_identifier (ifx_record_handle_t *handle, const ifx_blob_t *identifier)
 Sets an identifier code value of the record handle from the identifier bytes.
 
ifx_status_t ifx_record_uri_set_identifier_code (ifx_record_handle_t *handle, uint8_t identifier_code)
 Sets the identifier code in the URI record details.
 
ifx_status_t ifx_record_uri_set_uri (ifx_record_handle_t *handle, const ifx_blob_t *uri)
 Sets the URI value in the URI record details.
 

Detailed Description

Model interface to create URI record types and get/set record fields.

For more details refer to technical specification document for URI Record Type Definition(NFCForum-TS-RTD_URI_1.0)

Definition in file ifx-record-uri.h.

Macro Definition Documentation

◆ IFX_RECORD_IDENTIFIER_CODE_MAX

#define IFX_RECORD_IDENTIFIER_CODE_MAX   UINT8_C(0x24)

Identifier code maximum numbers in list.

Definition at line 48 of file ifx-record-uri.h.

◆ IFX_RECORD_URI_GET

#define IFX_RECORD_URI_GET   UINT8_C(0x02)

Identifier for model get URI record ID.

Definition at line 34 of file ifx-record-uri.h.

◆ IFX_RECORD_URI_RELEASE_MEMORY

#define IFX_RECORD_URI_RELEASE_MEMORY   UINT8_C(0x03)

Identifier for model URI record release memory.

Definition at line 39 of file ifx-record-uri.h.

◆ IFX_RECORD_URI_SET

#define IFX_RECORD_URI_SET   UINT8_C(0x01)

Identifier for model set URI record ID.

Definition at line 29 of file ifx-record-uri.h.

◆ IFX_RECORD_URI_TYPE

#define IFX_RECORD_URI_TYPE   {UINT8_C(0x55)}

Type information for uri record 'U'.

Definition at line 43 of file ifx-record-uri.h.

Enumeration Type Documentation

◆ ifx_record_uri_identifier

URI identifiers for URI records identifier code.

User can directly use the enums to identify uri identifier code and pass identifier code value separately.

Enumerator
IFX_URI_NA 

unabridged URI

IFX_URI_HTTP_WWW 

http://www.

IFX_URI_HTTPS_WWW 

https://www.

IFX_URI_HTTP 

http://

IFX_URI_HTTPS 

https://

IFX_URI_TEL 

tel:

IFX_URI_MAILTO 

mailto:

IFX_URI_FTP_ANONYMOUS_ANONYMOUS 

ftp://anonymous:anonymous@

IFX_URI_FTP_FTP 

ftp://ftp

IFX_URI_FTPS 

ftps://

IFX_URI_SFTP 

sftp://

IFX_URI_SMB 

smb://

IFX_URI_NFS 

nfs://

IFX_URI_FTP 

ftp://

IFX_URI_DAV 

dav://

IFX_URI_NEWS 

news:

IFX_URI_TELNET 

telnet://

IFX_URI_IMAP 

imap:

IFX_URI_RTSP 

rtsp://

IFX_URI_URN 

urn:

IFX_URI_POP 

pop:

IFX_URI_SIP 

sip:

IFX_URI_SIPS 

sips::

IFX_URI_TFTP 

tftp:

IFX_URI_BTSPP 

btspp://

IFX_URI_BT12CAP 

bt12cap://

IFX_URI_BTGOEP 

btgoep://

IFX_URI_TCPOBEX 

tcpobex://

IFX_URI_IRDAOBEX 

irdaobex://

IFX_URI_FILE 

file://

IFX_URI_URN_EPC_ID 

urn:epc:id:

IFX_URI_URN_EPC_TAG 

urn:epc:tag:

IFX_URI_URN_EPC_PAT 

urn:epc:pat:

IFX_URI_URN_EPC_RAW 

urn:epc:raw:

IFX_URI_URN_EPC 

urn:epc:

IFX_URI_URN_NFC 

urn:nfc:

Definition at line 57 of file ifx-record-uri.h.

58{
59 IFX_URI_NA = 0x00,
60 IFX_URI_HTTP_WWW = 0x01,
61 IFX_URI_HTTPS_WWW = 0x02,
62 IFX_URI_HTTP = 0x03,
63 IFX_URI_HTTPS = 0x04,
64 IFX_URI_TEL = 0x05,
65 IFX_URI_MAILTO = 0x06,
67 IFX_URI_FTP_FTP = 0x08,
68 IFX_URI_FTPS = 0x09,
69 IFX_URI_SFTP = 0x0A,
70 IFX_URI_SMB = 0x0B,
71 IFX_URI_NFS = 0x0C,
72 IFX_URI_FTP = 0x0D,
73 IFX_URI_DAV = 0x0E,
74 IFX_URI_NEWS = 0x0F,
75 IFX_URI_TELNET = 0x10,
76 IFX_URI_IMAP = 0x11,
77 IFX_URI_RTSP = 0x12,
78 IFX_URI_URN = 0x13,
79 IFX_URI_POP = 0x14,
80 IFX_URI_SIP = 0x15,
81 IFX_URI_SIPS = 0x16,
82 IFX_URI_TFTP = 0x17,
83 IFX_URI_BTSPP = 0x18,
84 IFX_URI_BT12CAP = 0x19,
85 IFX_URI_BTGOEP = 0x1A,
86 IFX_URI_TCPOBEX = 0x1B,
87 IFX_URI_IRDAOBEX = 0x1C,
88 IFX_URI_FILE = 0x1D,
89 IFX_URI_URN_EPC_ID = 0x1E,
90 IFX_URI_URN_EPC_TAG = 0x1F,
91 IFX_URI_URN_EPC_PAT = 0x20,
92 IFX_URI_URN_EPC_RAW = 0x21,
93 IFX_URI_URN_EPC = 0x22,
94 IFX_URI_URN_NFC = 0x23
ifx_record_uri_identifier
URI identifiers for URI records identifier code.
@ IFX_URI_POP
@ IFX_URI_BTSPP
@ IFX_URI_FTP
@ IFX_URI_HTTP_WWW
@ IFX_URI_HTTP
@ IFX_URI_URN
@ IFX_URI_RTSP
@ IFX_URI_FTP_ANONYMOUS_ANONYMOUS
@ IFX_URI_DAV
@ IFX_URI_HTTPS
@ IFX_URI_URN_EPC
@ IFX_URI_NEWS
@ IFX_URI_TELNET
@ IFX_URI_TEL
@ IFX_URI_URN_NFC
@ IFX_URI_MAILTO
@ IFX_URI_SIPS
@ IFX_URI_BT12CAP
@ IFX_URI_IRDAOBEX
@ IFX_URI_IMAP
@ IFX_URI_URN_EPC_ID
@ IFX_URI_TCPOBEX
@ IFX_URI_FILE
@ IFX_URI_SIP
@ IFX_URI_URN_EPC_RAW
@ IFX_URI_TFTP
@ IFX_URI_FTP_FTP
@ IFX_URI_HTTPS_WWW
@ IFX_URI_NA
@ IFX_URI_SFTP
@ IFX_URI_FTPS
@ IFX_URI_BTGOEP
@ IFX_URI_SMB
@ IFX_URI_NFS
@ IFX_URI_URN_EPC_TAG
@ IFX_URI_URN_EPC_PAT

Function Documentation

◆ ifx_record_uri_get_identifier()

ifx_status_t ifx_record_uri_get_identifier ( const ifx_record_handle_t * handle,
ifx_blob_t * identifier )

Gets the identifier bytes from the URI record.

Parameters
[in]handlePointer to the record handle.
[out]identifierPointer to the BLOB type data field and length excluded NULL termination character.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the get operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid
IFX_RECORD_URI_IDENTIFIER_INVALIDCODE if identifier code does not match with existing list

◆ ifx_record_uri_get_identifier_code()

ifx_status_t ifx_record_uri_get_identifier_code ( const ifx_record_handle_t * handle,
uint8_t * identifier_code )

Gets the identifier code from the URI record details.

Parameters
[in]handlePointer to the record handle.
[out]identifier_codePointer to the URI identifier code.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the get operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_uri_get_uri()

ifx_status_t ifx_record_uri_get_uri ( const ifx_record_handle_t * handle,
ifx_blob_t * uri )

Gets the URI value field from the URI record.

Parameters
[in]handlePointer to the record handle.
[out]uriPointer to the BLOB type data, data field and length excluded NULL ('\0') termination character.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf get operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORYIf memory allocation is invalid
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_uri_get_uri_with_identifier()

ifx_status_t ifx_record_uri_get_uri_with_identifier ( const ifx_record_handle_t * handle,
ifx_blob_t * uri_with_identifier )

Gets the URI value along with the identifier from the URI record.

Parameters
[in]handlePointer to the URI record handle.
[out]uri_with_identifierPointer to the BLOB type data, if URI identifier code is not supported then return URI bytes without identifier bytes data field and length excluded NULL termination character.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf identifier code matches with existing list, populates uri_value + identifier
IFX_RECORD_URI_IDENTIFIER_INVALIDCODE If identifier code does not match, still it populates uri_value
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORYIf memory allocation is invalid
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_uri_new()

ifx_status_t ifx_record_uri_new ( ifx_record_handle_t * handle)

Creates a new URI record and handle of the created record. This handle holds the values of the record needed for encode and decode operations.

Parameters
handlePointer to the record handle.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf model new URI record operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORYIf memory allocation is invalid

◆ ifx_record_uri_set_identifier()

ifx_status_t ifx_record_uri_set_identifier ( ifx_record_handle_t * handle,
const ifx_blob_t * identifier )

Sets an identifier code value of the record handle from the identifier bytes.

Parameters
[out]handlePointer to the record type handle.
[in]identifierPointer to BLOB type identifier bytes. BLOB data field and length excluded NULL termination character
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the set operation is successful
IFX_RECORD_URI_IDENTIFIER_CODE_INVALIDIf identifier code does not match with existing list
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_URI_IDENTIFIER_INVALIDIf identifier bytes is not matching with existing list
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_uri_set_identifier_code()

ifx_status_t ifx_record_uri_set_identifier_code ( ifx_record_handle_t * handle,
uint8_t identifier_code )

Sets the identifier code in the URI record details.

Parameters
[out]handlePointer to the record handle.
[in]identifier_codeIdentifier code data
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the set operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_uri_set_uri()

ifx_status_t ifx_record_uri_set_uri ( ifx_record_handle_t * handle,
const ifx_blob_t * uri )

Sets the URI value in the URI record details.

Parameters
[out]handlePointer to the record handle.
[in]uriPointer to the BLOB type data, data field, and length excluded NULL termination character.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the set operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORYIf memory allocation is invalid
IFX_RECORD_INVALIDIf record type is invalid