Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion protocol/tagtinker_proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,11 @@ void tagtinker_free_image_payload(TagTinkerImagePayload* payload) {

bool tagtinker_is_barcode_valid(const char* barcode) {
if(!barcode || strlen(barcode) != 17) return false;
return true;
int cs = 0;
for(int i = 0; i < 16; i++) {
cs += (unsigned char)barcode[i];
}
return (cs % 10) == (barcode[16] - '0');
}

size_t tagtinker_make_addressed_frame(uint8_t* buf, const uint8_t plid[4], const uint8_t* payload, size_t len) {
Expand Down