struct rfid_asic_transport_handle {
void *data; /* handle to stuff like even lower layers */
- struct rfid_asic_transport *rat;
+ const struct rfid_asic_transport *rat;
};
/* Some implementation-specific data. A reader will specify one of these for
struct iso14443b_handle iso14443b;
struct iso15693_handle iso15693;
} priv;
- struct rfid_layer2 *l2;
+ const struct rfid_layer2 *l2;
};
#endif /* __LIBRFID__ */
struct rfid_protocol_handle {
struct rfid_layer2_handle *l2h;
- struct rfid_protocol *proto;
+ const struct rfid_protocol *proto;
union {
struct tcl_handle tcl;
} priv; /* priv has to be last, since
union {
} priv;
- struct rfid_reader *reader;
+ const struct rfid_reader *reader;
};
extern struct rfid_reader_handle *
unsigned char cmd,
struct iso14443a_atqa *atqa)
{
- struct rfid_reader *rdr = handle->rh->reader;
+ const struct rfid_reader *rdr = handle->rh->reader;
return rdr->iso14443a.transceive_sf(handle->rh, cmd, atqa);
}
struct iso14443a_anticol_cmd *acf,
unsigned int *bit_of_col)
{
- struct rfid_reader *rdr = handle->rh->reader;
+ const struct rfid_reader *rdr = handle->rh->reader;
return rdr->iso14443a.transceive_acf(handle->rh, acf, bit_of_col);
}
const void *optval, unsigned int optlen)
{
int ret = -EINVAL;
- struct rfid_reader *rdr = handle->rh->reader;
+ const struct rfid_reader *rdr = handle->rh->reader;
unsigned int speed;
switch (optname) {
static int
iso15693_getopt(struct rfid_layer2_handle *handle,
- int optname, void *optval, unsigned int optlen)
+ int optname, void *optval, unsigned int *optlen)
{
switch (optname) {
case RFID_OPT_15693_MOD_DEPTH:
struct rfid_protocol_handle *
rfid_protocol_init(struct rfid_layer2_handle *l2h, unsigned int id)
{
- struct rfid_protocol *p;
+ const struct rfid_protocol *p;
struct rfid_protocol_handle *ph = NULL;
if (id >= ARRAY_SIZE(rfid_protocols))
static int openpcd_set_environment(
struct rfid_reader_handle *rh,
- const unsigned char num_bytes,
- unsigned char *buf)
+ unsigned char num_bytes,
+ const unsigned char *buf)
{
int ret;
printf("Mifare card available\n");
}
-static void inc_key(char* key, int len)
-{
- int i;
-
- if (len <= 0)
- return;
- i = len - 1;
- if (key[i] < 0xff)
- key[i]++;
- else
- key[i] = 0;
-}
-
int main(int argc, char **argv)
{
int len, rc, c, option_index = 0;