NRF52840 Eval Kit User Manual
Vision: V1.0.1 Date: 2019.01.19
41
/
72
CHAPTER 8. NFC
CODES
This example is used to starting mobile APP.
The name of Android Phone APP:
static
const
uint8_t
m_android_package_name
[]
=
{
'n'
,
'o'
,
'.'
,
'n'
,
'o'
,
'r'
,
'd'
,
'i'
,
'c'
,
's'
,
'e'
,
'm'
,
'i'
,
'.'
,
'a'
,
'n'
,
'd'
,
'r'
,
'o'
,
'i'
,
'd'
,
'.'
,
'n'
,
'r'
,
'f'
,
't'
,
'o'
,
'o'
,
'l'
,
'b'
,
'o'
,
'x'
};
The name of Windows Phone APP:
static
const
uint8_t
m_windows_application_id
[]
=
{
'{'
,
'e'
,
'1'
,
'2'
,
'd'
,
'2'
,
'd'
,
'a'
,
'7'
,
'-'
,
'4'
,
'8'
,
'8'
,
'5'
,
'-'
,
'4'
,
'0'
,
'0'
,
'f'
,
'-'
,
'b'
,
'c'
,
'd'
,
'4'
,
'-'
,
'6'
,
'c'
,
'b'
,
'd'
,
'5'
,
'b'
,
'8'
,
'c'
,
'f'
,
'6'
,
'2'
,
'c'
,
'}'
};
Initializing callback function, which will be execute when NFC objects are detected to
turn on LED0.
static
void
nfc_callback
(
void
*
p_context
,
nfc_t2t_event_t event
,
const
uint8_t
*
p_data
,
size_t
data_length
)
{
(
void
)
p_context
;
switch
(
event
)
{
case
NFC_T2T_EVENT_FIELD_ON
:
bsp_board_led_on
(
BSP_BOARD_LED_0
);
break
;
case
NFC_T2T_EVENT_FIELD_OFF
:
bsp_board_led_off
(
BSP_BOARD_LED_0
);
break
;
default
:
break
;
}
}