MIKAI
Library to modify content of a Mykey
srix.h
Go to the documentation of this file.
1 /*
2  * @author Lilz <https://telegram.me/Lilz73>
3  * @copyright 2020-2021 Lilz <https://telegram.me/Lilz73>
4  * @license MIKAI LICENSE
5  *
6  * This file is part of MIKAI.
7  *
8  * MIKAI is free software: you can redistribute it and/or modify
9  * it under the terms of the MIKAI License, as published by
10  * Lilz along with this program and available on "MIKAI Download" Telegram channel
11  * <https://telegram.me/mikaidownload>.
12  *
13  * MIKAI is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY.
15  *
16  * You should have received a copy of the MIKAI License along
17  * with MIKAI.
18  * If not, see <https://telegram.me/mikaidownload>.
19  */
20 
21 #ifndef MIKAI_SRIX_H
22 #define MIKAI_SRIX_H
23 
24 #include <stdint.h>
25 #include <stdlib.h>
26 #include <mikai/mikai.h>
27 #include <mikai-error.h>
28 #include "srix-flag.h"
29 
30 typedef struct Srix Srix;
31 
36 Srix *SrixNew();
37 
42 void SrixDelete(Srix *target);
43 
49 size_t NfcGetReadersCount(Srix *target);
50 
57 char *NfcGetDescription(Srix *target, int reader);
58 
65 MikaiError SrixNfcInit(Srix *target, int reader);
66 
73 void SrixMemoryInit(Srix *target, uint32_t eeprom[const static SRIX4K_BLOCKS], uint64_t uid);
74 
80 uint64_t SrixGetUid(Srix *target);
81 
88 uint32_t *SrixGetBlock(Srix *target, uint8_t blockNum);
89 
96 void SrixModifyBlock(Srix *target, uint32_t block, uint8_t blockNum);
97 
104 
105 #endif /* MIKAI_SRIX_H */
mikai.h
SrixModifyBlock
void SrixModifyBlock(Srix *target, uint32_t block, uint8_t blockNum)
Modify manually a Srix block and add flag automatically.
SrixNew
Srix * SrixNew()
Create a new Srix and set its default values.
Definition: srix.c:123
SrixDelete
void SrixDelete(Srix *target)
Delete a Srix and free its memory.
mikai-error.h
SrixNfcInit
MikaiError SrixNfcInit(Srix *target, int reader)
Initialize the Srix using Nfc.
Srix::eeprom
uint32_t eeprom[SRIX4K_BLOCKS]
Definition: srix.c:37
Srix
Generic SRIX4K tag.
Definition: srix.c:29
MikaiError
Error structure that contains a description message.
Definition: mikai-error.h:40
Srix::reader
NfcReader * reader
Definition: srix.c:41
SRIX4K_BLOCKS
#define SRIX4K_BLOCKS
Definition: mikai.h:30
NfcGetReadersCount
size_t NfcGetReadersCount(Srix *target)
Function that search for available NFC readers and return their number.
Srix::uid
uint64_t uid
Definition: srix.c:39
NfcGetDescription
char * NfcGetDescription(Srix *target, int reader)
Function that return specified nfc reader description (connection string).
Definition: srix.c:144
srix-flag.h
SrixGetBlock
uint32_t * SrixGetBlock(Srix *target, uint8_t blockNum)
Get pointer to a specified block.
SrixGetUid
uint64_t SrixGetUid(Srix *target)
Return UID of an initialized srix.
SrixWriteBlocks
MikaiError SrixWriteBlocks(Srix *target)
Write all modified blocks of target to physical SRIX4K.
SrixMemoryInit
void SrixMemoryInit(Srix *target, uint32_t eeprom[const static SRIX4K_BLOCKS], uint64_t uid)
Initialize the Srix using values in memory.