Skip to content

Commit

Permalink
update DS1420 for latest ibutton changes
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed May 1, 2024
1 parent 9b377e6 commit a57dbe4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/ibutton/protocols/dallas/protocol_ds1420.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ static bool dallas_ds1420_write_blank(OneWireHost*, iButtonProtocolData*);
static void dallas_ds1420_emulate(OneWireSlave*, iButtonProtocolData*);
static bool dallas_ds1420_load(FlipperFormat*, uint32_t, iButtonProtocolData*);
static bool dallas_ds1420_save(FlipperFormat*, const iButtonProtocolData*);
static void dallas_ds1420_render_uid(FuriString*, const iButtonProtocolData*);
static void dallas_ds1420_render_brief_data(FuriString*, const iButtonProtocolData*);
static void dallas_ds1420_render_error(FuriString*, const iButtonProtocolData*);
static bool dallas_ds1420_is_data_valid(const iButtonProtocolData*);
Expand All @@ -46,6 +47,7 @@ const iButtonProtocolDallasBase ibutton_protocol_ds1420 = {
.emulate = dallas_ds1420_emulate,
.save = dallas_ds1420_save,
.load = dallas_ds1420_load,
.render_uid = dallas_ds1420_render_uid,
.render_data = NULL, /* No data to render */
.render_brief_data = dallas_ds1420_render_brief_data,
.render_error = dallas_ds1420_render_error,
Expand Down Expand Up @@ -117,12 +119,20 @@ bool dallas_ds1420_load(
return dallas_common_load_rom_data(ff, format_version, &data->rom_data);
}

void dallas_ds1420_render_uid(FuriString* result, const iButtonProtocolData* protocol_data) {
const DS1420ProtocolData* data = protocol_data;

dallas_common_render_uid(result, &data->rom_data);
}

void dallas_ds1420_render_brief_data(FuriString* result, const iButtonProtocolData* protocol_data) {
const DS1420ProtocolData* data = protocol_data;

furi_string_cat_printf(result, "ID: ");
for(size_t i = 0; i < sizeof(DallasCommonRomData); ++i) {
furi_string_cat_printf(result, "%02X ", data->rom_data.bytes[i]);
}
furi_string_cat_printf(result, "\nFamily Code: %02X\n", data->rom_data.bytes[0]);
}

void dallas_ds1420_render_error(FuriString* result, const iButtonProtocolData* protocol_data) {
Expand Down

0 comments on commit a57dbe4

Please sign in to comment.