Skip to content

Commit

Permalink
Merge branch 'main' into neo_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
solosky committed Aug 26, 2024
2 parents d02e5e2 + 266ead3 commit b4bfc64
Show file tree
Hide file tree
Showing 65 changed files with 1,809 additions and 1,433 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"nrf_log.h": "c",
"string.h": "c",
"math.h": "c",
"mlib_common.h": "c"
"mlib_common.h": "c",
"ios": "c",
"limits": "c",
"algorithm": "c"
}
}
5 changes: 4 additions & 1 deletion docs/en/02-Flash-Firmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ First make sure your device is in off state, then press key sequences bellow to
- Any key to wake up the device
- LEFT
- MIDDLE
- LEFT X 4
- LEFT X N
- MIDDLE

If the firmware version before 2.11.x, press LEFT x 4
If the firmware version after 2.11.x, press LEFT x 5

Now you device is on DFU mode, use any of the [nRF Connect APP](#nRF-Connect-APP) or [Directly to the Firmware Update Page](#directly-to-the-firmware-update-page) methods to upgrade the fimware.

58 changes: 31 additions & 27 deletions docs/en/04-Using-Firmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ You can browse folders and files using the thumbwheel slide dial switch, pushing
Once you select a .BIN file his data is used like the current amiibo, the screen shows current amiibo details like amiibo current UUID, filename and amiibo name.

## Amiibo details screen
You can use side buttons to change the current amiibo with the next or previous one on the current folder. Pressing the middle button you can change the behavior of the current amiibo, on the sub menu:
You can use side buttons to change the current amiibo with the next or previous one on the current folder.
If the amiibo file is marked as read-only, an info icon will be displayed in front of the amiiboe file name line.

## Amiibo detail menu
Pressing the middle button you can change the behavior of the current amiibo, on the sub menu:

| |
| ------------ |
Expand All @@ -58,6 +62,8 @@ You can use side buttons to change the current amiibo with the next or previous
Changes the current UUID presented to game to current amiibo. The new UUID stays in place until you change the current amiibo or select this option again.
### Auto Rand. (Automatic Random)
Turning ON this feature, will generate a new random UUID for the current amiibo each time a game read it. Allowing to use the same amiibo multiple times on games with restrictions.
### Read-only
Turning on this feature, any write operation to this tag will be denied.
### Delete Tag
Delete the file associated to current amiibo.
### Back to Tag Details
Expand Down Expand Up @@ -90,32 +96,6 @@ Returns to the file list of current folder.
### Back to Main Menu
Exit the amiibo emulator application.

If you have **highlighted a storage** the properties sub menu is different:

| |
| ------------ |
| Storage Status<BR>Total Space<BR>Free Space<BR>Format…<BR>Back List<BR>Back to Main Menu |
| |

### Storage Status
Shows the current status and type of the storage, by example:
```
=====Not Mounted=====
===Mounted[LFS]===
===Mounted[FFS]===
```

### Total Space
Shows total space of the mounted storage on KB.
### Free Space
Shows the actual free space of the mounted storage on KB.
### Format…
Ask confirmation for formatting the current storage, WARNING ALL DATA WILL BE LOST!
### Back to File List
Returns to the file list of current folder.
### Back to Main Menu
Exit the amiibo emulator application.

----
# Amiibo Database
This application allows the emulation of amiibo from the list of well know ones, using legally available information like the model info, then when you select one, a new virtual amiibo is created on memory using a random UUID. In order to use this application you must to provide your «key_retail.bin» file.
Expand Down Expand Up @@ -193,6 +173,8 @@ List the configured slots, you can browse the slots using side buttons, select o

If you press and hold middle button a sub menu with the option of reset the slot is shown allowing to empty the slot.

If you turn on the Read-only feature, the current amiibo slot will denied write operation to this slot. An info icon will be displayed in front of the amiibo name if read-only feature is enabled.

## Settings…
The settings menu show you the Keys status and number of slot set up.

Expand Down Expand Up @@ -276,9 +258,15 @@ Mifare cards are commonly used for access control cards, and the device can full

NTAG series cards are commonly used for device identification. Supported NTAG card types include:

* NTAG 210
* NTAG 212
* NTAG 213
* NTAG 215
* NTAG 216
* Mifire Ultralight C
* Mifire Ultralight C
* Mifire Ultralight EV1(640 bits)
* Mifire Ultralight EV1(1312 bits)

Currently, a total of 8 cards are supported, with the option for customizing the number of cards in the future.

Expand Down Expand Up @@ -317,9 +305,17 @@ Abbreviations for card types:
| MF 1k | Mifare 1K | 1024 |
| MF 2k | Mifare 2K | 2048 |
| MF 4k | Mifare 4K | 4096 |
| N210 | NTAG 210 | 80 |
| N212 | NTAG 212 | 164 |
| N213 | NTAG 213 | 180 |
| N215 | NTAG 215 | 540 |
| N216 | NTAG 216 | 924 |
| MFUL | Mifare Ultralight | 64 |
| MFULC | Mifare Ultralight C | 144 |
| MFEV11 | Mifare Ultralight EV1(640 bits) | 80 |
| MFEV21 | Mifare Ultralight EV1(1312 bits) | 164 |

* It will display a fav icon if the card is default card. The default card is the card that is automatically activated when the device is wakeup by NFC field presents.

# Main Menu

Expand All @@ -342,6 +338,7 @@ Pressing the middle button allows you to enter the main menu. As follows:
* Nick: The current name of the card. Pressing the middle button can enter the card name setting interface.
* ID: Displays the current card ID.
* Type: Displays the current card type.
* Default Card: if enabled, the card will be automatically activated when the device is wakeup by NFC field presents.
* Data: Pressing the middle button can manage card data.
* Advanced: Pressing the middle button can enter advanced card settings.
* Slot Settings: Pressing the middle button enters the slot management interface, where you can enable or disable card slots.
Expand All @@ -350,6 +347,7 @@ Pressing the middle button allows you to enter the main menu. As follows:

> **Special Note:**:<br/>
> Some modifications need to be saved to storage when exiting to the tag details. If you have modified some configurations, be sure to enter the tag details page to save them.
> The default card feature is conflict with Fast Resume. If the default card feature is enabled, the device will active the card emulator of the default card instead of the amiibo Fast Resume feature.
## Nick Update

Expand Down Expand Up @@ -510,3 +508,9 @@ This option put the device in the DFU mode, allowing OTA firmware update, you ca
You can go to the URL [https://thegecko.github.io/web-bluetooth-dfu/](https://thegecko.github.io/web-bluetooth-dfu/) to upload the firmware, this page also can be open through the official site [https://pixl.amiibo.xyz/](https://pixl.amiibo.xyz/)
## System Reboot
Allows you to reboot the device and get back to the state after you remove and put the battery.

## Reset Default Settings
Reset all settings to default values.

## About Device
Show Pixl.js project information, include source code repository, license.
5 changes: 4 additions & 1 deletion docs/zh/02-Flash-Firmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ openocd -f interface/cmsis-dap.cfg -c "transport select swd" -f target/nrf52.cfg
任意键唤醒设备
左 x 4
左 x N

如果固件版本小于 2.11.x, 按左 x 4。
如果固件版本大于 2.11.x, 按左 x 5。

现在您的设备已经进入了DFU模式,请使用任何 [nRF Connect APP](#nRF-Connect-APP)[直接进入固件页面更新](#directly-to-the-firmware-update-page) 的方法来升级固件。


Expand Down
17 changes: 16 additions & 1 deletion docs/zh/04-Using-Firmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,15 @@ Mifare卡片常见用于门禁卡,设备可以支持完整模拟Mifare类型

NTAG系列卡片常用于设备识别。支持的NTAG卡片类型有:

* NTAG 210
* NTAG 212
* NTAG 213
* NTAG 215
* NTAG 216
* Mifire Ultralight C
* Mifire Ultralight C
* Mifire Ultralight EV1(640 bits)
* Mifire Ultralight EV1(1312 bits)

目前总共支持存储8张卡片,后续开放自定义卡片数量。

Expand Down Expand Up @@ -186,17 +192,23 @@ NTAG系列的模拟功能还是测试中,功能还不太完善,未完全模
界面说明如下:
* 第一行:`01` 是卡片序号,`de:ad:be:ef`是卡号。
* 第二行:`卡槽 01`是当前卡的名字,可以自由设置
* 第三行:`MF 1K` 显示了卡类型,类型简写见下表,`08`是卡的SAK,`04 00`是卡的ATQA 最后一个符号是写入模式,如果是存储类型标记,则允许写入,否则不允许写入
* 第三行:`MF 1K` 显示了卡类型,类型简写见下表,`08`是卡的SAK,`04 00`是卡的ATQA 最后一个符号是写入模式,如果是存储类型标记,则允许写入,否则不允许写入。如果当前卡片设置了默认卡片,设备会展示一个收藏图标作为提示。

| 显示 | 类型 | 数据文件大小 |
| ---- | --- | --- |
| MF mini | Mifare Mini | 320 |
| MF 1k | Mifare 1K | 1024 |
| MF 2k | Mifare 2K | 2048 |
| MF 4k | Mifare 4K | 4096 |
| N210 | NTAG 210 | 80 |
| N212 | NTAG 212 | 164 |
| N213 | NTAG 213 | 180 |
| N215 | NTAG 215 | 540 |
| N216 | NTAG 216 | 924 |
| MFUL | Mifare Ultralight | 64 |
| MFULC | Mifare Ultralight C | 144 |
| MFEV11 | Mifare Ultralight EV1(640 bits) | 80 |
| MFEV21 | Mifare Ultralight EV1(1312 bits) | 164 |

# 主菜单

Expand All @@ -207,6 +219,7 @@ NTAG系列的模拟功能还是测试中,功能还不太完善,未完全模
|  卡名 [卡槽 01]|
|  ID [de:ad:be:ef]|
|  卡类型 [MiFare 1K] |
|  默认卡片 []
|  卡数据.. |
|  卡高级设置.. |
|  卡槽管理.. |
Expand All @@ -218,6 +231,7 @@ NTAG系列的模拟功能还是测试中,功能还不太完善,未完全模
* 卡名:卡当前的名字,按中键可以进入设置卡名界面
* ID:显示了当前卡ID
* 卡类型:显示了当前卡类型
* 默认卡片:如果开启默认卡片,当设备从NFC场唤醒时,默认模拟这张卡。
* 卡数据:按中键可以进行卡数据管理
* 卡高级设置:按中键可以进入卡高级设置
* 卡槽管理:按中键进入卡槽管理界面,可以开启关闭卡槽
Expand All @@ -226,6 +240,7 @@ NTAG系列的模拟功能还是测试中,功能还不太完善,未完全模

> **特别注意**:<br/>
> 部分的修改需要在退出到标签详情才会保存到存储,如果修改了部分配置,请务必进入到标签详情页面保存下。
> 如果开启的默认卡片功能,当设备从NFC场唤醒时,会调用卡模拟器应用,默认模拟这张卡。此功能和快速唤醒功能冲突,如果设置了默认卡,快速唤醒功能不再生效。
## 卡名修改

Expand Down
4 changes: 3 additions & 1 deletion fw/application/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ SRC_FILES += \
$(PROJ_DIR)/app/settings/scene/settings_scene_oled_contrast.c \
$(PROJ_DIR)/app/settings/scene/settings_scene_language.c \
$(PROJ_DIR)/app/settings/scene/settings_scene_storage.c \
$(PROJ_DIR)/app/settings/scene/settings_scene_about.c \
$(PROJ_DIR)/i18n/en_US.c \
$(PROJ_DIR)/i18n/zh_Hans.c \
$(PROJ_DIR)/i18n/zh_TW.c \
Expand Down Expand Up @@ -367,7 +368,7 @@ SRC_FILES += \
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/crypto1_helper.c \
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/nfc_14a.c \
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/nfc_mf1.c \
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/nfc_ntag.c \
$(CHAMELEON_ROOT)/application/src/rfid/nfctag/hf/nfc_mf0_ntag.c \
$(CHAMELEON_ROOT)/application/src/rfid/crc_utils.c \
$(CHAMELEON_ROOT)/application/src/rfid/hex_utils.c \
$(CHAMELEON_ROOT)/application/src/rfid/mf1_crapto1.c \
Expand Down Expand Up @@ -855,6 +856,7 @@ full: settingsgen
gen:
python3 ../scripts/amiibo_db_gen.py
python3 ../scripts/i18n_gen.py
python3 ../scripts/font_data_gen.py
python3 ../scripts/resource_gen.py

flash_ocd: default
Expand Down
25 changes: 16 additions & 9 deletions fw/application/src/app/amiibo/scene/amiibo_scene_amiibo_detail.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#include "amiibo_helper.h"
#include "amiibo_scene.h"
#include "app_amiibo.h"
#include "app_timer.h"
#include "cwalk2.h"
#include "db_header.h"
#include "i18n/language.h"
#include "mui_list_view.h"
#include "nrf_log.h"
#include "ntag_emu.h"
#include "vfs.h"
#include "vfs_meta.h"
#include "amiibo_helper.h"
#include "ntag_store.h"
#include "settings.h"
#include "i18n/language.h"
#include "db_header.h"
#include "vfs.h"
#include "vfs_meta.h"

#define NRF_ERR_NOT_AMIIBO -1000
#define NRF_ERR_READ_ERROR -1001
Expand Down Expand Up @@ -70,10 +70,15 @@ static int32_t ntag_read(vfs_driver_t *p_vfs_driver, const char *path, ntag_t *n
vfs_meta_t meta;
memset(&meta, 0, sizeof(vfs_meta_t));
vfs_meta_decode(obj.meta, sizeof(obj.meta), &meta);
if(meta.has_notes){
if (meta.has_notes) {
memcpy(ntag->notes, meta.notes, strlen(meta.notes));
}

NRF_LOG_INFO("has_flag:%d flag:%d", meta.has_flags, meta.flags);
if (meta.has_flags && (meta.flags & VFS_OBJ_FLAG_READONLY)) {
ntag->read_only = true;
}

res = p_vfs_driver->read_file_data(path, ntag->data, 540);
if (res != 540 && res != 532) {
return NRF_ERR_READ_ERROR;
Expand All @@ -83,7 +88,7 @@ static int32_t ntag_read(vfs_driver_t *p_vfs_driver, const char *path, ntag_t *n

static void ntag_gen(void *p_context) {
ret_code_t err_code;
app_amiibo_t * app = p_context;
app_amiibo_t *app = p_context;
ntag_t *ntag_current = &app->ntag;

err_code = amiibo_helper_rand_amiibo_uuid(ntag_current);
Expand Down Expand Up @@ -136,7 +141,7 @@ static void ntag_update_cb(ntag_event_type_t type, void *context, ntag_t *p_ntag
if (type == NTAG_EVENT_TYPE_WRITTEN) {
ntag_update(app, p_ntag);
} else if (type == NTAG_EVENT_TYPE_READ) {
settings_data_t* p_settings = settings_get_data();
settings_data_t *p_settings = settings_get_data();
if (p_settings->auto_gen_amiibo) {
app_timer_stop(m_amiibo_gen_delay_timer);
app_timer_start(m_amiibo_gen_delay_timer, APP_TIMER_TICKS(1000), app);
Expand Down Expand Up @@ -187,7 +192,9 @@ static void amiibo_scene_amiibo_detail_reload_files(app_amiibo_t *app) {
vfs_meta_t meta;
memset(&meta, 0, sizeof(vfs_meta_t));
vfs_meta_decode(obj.meta, sizeof(obj.meta), &meta);
if (obj.type == VFS_TYPE_REG && (obj.size == NTAG_DATA_SIZE || obj.size == NTAG_TAGMO_DATA_SIZE || obj.size == NTAG_THENAYA_DATA_SIZE) &&
if (obj.type == VFS_TYPE_REG &&
(obj.size == NTAG_DATA_SIZE || obj.size == NTAG_TAGMO_DATA_SIZE ||
obj.size == NTAG_THENAYA_DATA_SIZE) &&
(!meta.has_flags || !(meta.flags & VFS_OBJ_FLAG_HIDDEN))) {
string_set_str(file_name, obj.name);
string_array_push_back(app->amiibo_files, file_name);
Expand Down
Loading

0 comments on commit b4bfc64

Please sign in to comment.