![]() |
RUI3 (RAK Unified Interface 3) - RAK4631
|
Functions | |
void | init (bool wakeup, bool atMode, rak_nfc_t4t_callback callback) |
void | send (RAK_NFC_RECORD_TYPE record_type, const uint8_t *payload1, uint32_t size1, const uint8_t *payload2, uint32_t size2) |
void | close () |
void init | ( | bool | wakeup, |
bool | atMode, | ||
rak_nfc_t4t_callback | callback | ||
) |
wakeup | The bool is whether to use an interrupt to wake from sleep and passing a callback function with different states |
atMode | whether to use AT-Commnad over NFC(the tag will be changed to result of the command) |
callback | the callback funcation for nfc |
static void nfc_t4t_callback(void * p_context, RAK_NFC_T4T_EVENT event, const uint8_t * p_data, size_t data_length, uint32_t flags) { (void)p_context; } void setup() { static const uint8_t language[] = {'e', 'n'}; static const uint8_t paylaod[] = {'H', 'e', 'l', 'l', 'o', ' ', 'N', 'F','C'} api.nfc.init(true, false, nfc_t4t_callback); api.nfc_send(TXT, language, sizeof(language), paylaod, sizeof(payload)); } void loop() { api.system.sleep.all(30000); }
void send | ( | RAK_NFC_RECORD_TYPE | record_type, |
const uint8_t * | payload1, | ||
uint32_t | size1, | ||
const uint8_t * | payload2, | ||
uint32_t | size2 | ||
) |
type | the message is a TXT, URI or APP message |
language | language of TXT message (must be 2 bytes) |
language_size | size of language (must be 2) |
payload | paylaod of TXT message (1~244 bytes) |
paylaod_size | size of TXT message (1~244) |
android_package_name | android package name |
android_size | size of android of android package name |
windows_application_id | windows applicaiton id |
windows_size | size of windows application id |
RAK_NFC_URI_ID | Enum of URI ID |
url_payload | url of a URI message (1~246bytes) |
url_size | size of the url (1~246) |
static void nfc_t4t_callback(void * p_context, RAK_NFC_T4T_EVENT event, const uint8_t * p_data, size_t data_length, uint32_t flags) { (void)p_context; } void setup() { static const uint8_t language[] = {'e', 'n'}; static const uint8_t paylaod[] = {'H', 'e', 'l', 'l', 'o', ' ', 'N', 'F','C'} api.nfc.init(true, false, nfc_t4t_callback); api.nfc_send(TXT, language, sizeof(language), paylaod, sizeof(payload)); } void loop() { api.system.sleep.all(30000); }
void close | ( | ) |
static void nfc_t4t_callback(void * p_context, RAK_NFC_T4T_EVENT event, const uint8_t * p_data, size_t data_length, uint32_t flags) { (void)p_context; } void setup() { static const uint8_t language[] = {'e', 'n'}; static const uint8_t paylaod[] = {'H', 'e', 'l', 'l', 'o', ' ', 'N', 'F','C'} api.nfc.init(true, false, nfc_t4t_callback); api.nfc_send(TXT, language, sizeof(language), paylaod, sizeof(payload)); } void loop() { if(millis() > 60000) api.nfc.close(); api.system.sleep.all(30000); }