mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-20 04:54:45 -07:00
[FL-3857] NFC Ultralight Original write support (#3718)
* mf ultralight: rename ultralight unknown to origin * nfc app: add write to origin support for origin ultralights * mf ultralight: add orig write support on lib level * targets: bump major API version
This commit is contained in:
@@ -26,7 +26,7 @@ typedef struct {
|
||||
static const uint32_t mf_ultralight_data_format_version = 2;
|
||||
|
||||
static const MfUltralightFeatures mf_ultralight_features[MfUltralightTypeNum] = {
|
||||
[MfUltralightTypeUnknown] =
|
||||
[MfUltralightTypeOrigin] =
|
||||
{
|
||||
.device_name = "Mifare Ultralight",
|
||||
.total_pages = 16,
|
||||
@@ -215,7 +215,7 @@ static const char*
|
||||
mf_ultralight_get_device_name_by_type(MfUltralightType type, NfcDeviceNameType name_type) {
|
||||
if(name_type == NfcDeviceNameTypeShort &&
|
||||
(type == MfUltralightTypeUL11 || type == MfUltralightTypeUL21)) {
|
||||
type = MfUltralightTypeUnknown;
|
||||
type = MfUltralightTypeOrigin;
|
||||
}
|
||||
|
||||
return mf_ultralight_features[type].device_name;
|
||||
@@ -512,7 +512,7 @@ Iso14443_3aData* mf_ultralight_get_base_data(const MfUltralightData* data) {
|
||||
MfUltralightType mf_ultralight_get_type_by_version(MfUltralightVersion* version) {
|
||||
furi_check(version);
|
||||
|
||||
MfUltralightType type = MfUltralightTypeUnknown;
|
||||
MfUltralightType type = MfUltralightTypeOrigin;
|
||||
|
||||
if(version->storage_size == 0x0B || version->storage_size == 0x00) {
|
||||
type = MfUltralightTypeUL11;
|
||||
@@ -575,12 +575,14 @@ uint8_t mf_ultralight_get_write_end_page(MfUltralightType type) {
|
||||
furi_assert(
|
||||
type == MfUltralightTypeUL11 || type == MfUltralightTypeUL21 ||
|
||||
type == MfUltralightTypeNTAG213 || type == MfUltralightTypeNTAG215 ||
|
||||
type == MfUltralightTypeNTAG216);
|
||||
type == MfUltralightTypeNTAG216 || type == MfUltralightTypeOrigin);
|
||||
|
||||
uint8_t end_page = mf_ultralight_get_config_page_num(type);
|
||||
if(type == MfUltralightTypeNTAG213 || type == MfUltralightTypeNTAG215 ||
|
||||
type == MfUltralightTypeNTAG216) {
|
||||
end_page -= 1;
|
||||
} else if(type == MfUltralightTypeOrigin) {
|
||||
end_page = mf_ultralight_features[type].total_pages;
|
||||
}
|
||||
|
||||
return end_page;
|
||||
|
||||
Reference in New Issue
Block a user