-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include <application.h> | ||
|
||
bc_led_t led; | ||
|
||
bc_tag_nfc_t tag_nfc; | ||
|
||
void application_init(void) | ||
{ | ||
bc_led_init(&led, BC_GPIO_LED, false, false); | ||
|
||
bc_log_init(BC_LOG_LEVEL_DEBUG, BC_LOG_TIMESTAMP_ABS); | ||
|
||
bc_log_info("bc_tag_nfc_init"); | ||
|
||
if (bc_tag_nfc_init(&tag_nfc, BC_I2C_I2C0, BC_TAG_NFC_I2C_ADDRESS_DEFAULT)) | ||
{ | ||
bc_log_info("ok"); | ||
} | ||
else | ||
{ | ||
bc_log_error("error"); | ||
} | ||
|
||
bc_tag_nfc_ndef_t ndef; | ||
|
||
bc_tag_nfc_ndef_init(&ndef); | ||
|
||
bc_tag_nfc_ndef_add_text(&ndef, "BigClown home page", "en"); | ||
|
||
bc_tag_nfc_ndef_add_uri(&ndef, "https://www.bigclown.com/"); | ||
|
||
bc_tag_nfc_ndef_add_text(&ndef, "Documentation", "en"); | ||
|
||
bc_tag_nfc_ndef_add_uri(&ndef, "https://doc.bigclown.com/"); | ||
|
||
bc_log_info("bc_tag_nfc_memory_write_ndef"); | ||
|
||
if (bc_tag_nfc_memory_write_ndef(&tag_nfc, &ndef)) | ||
{ | ||
bc_log_info("ok"); | ||
} | ||
else | ||
{ | ||
bc_log_error("error"); | ||
} | ||
|
||
bc_led_pulse(&led, 2000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef _APPLICATION_H | ||
#define _APPLICATION_H | ||
|
||
#ifndef VERSION | ||
#define VERSION "vdev" | ||
#endif | ||
|
||
#include <bcl.h> | ||
|
||
#endif // _APPLICATION_H |