2015-05-13 02:06:55 +02:00
|
|
|
#include <cutter.h>
|
|
|
|
|
|
|
|
#include <freefare.h>
|
|
|
|
|
|
|
|
#include "felica_fixture.h"
|
|
|
|
|
|
|
|
void
|
2017-06-27 13:58:31 +02:00
|
|
|
test_felica_read_without_encryption(void)
|
2015-05-13 02:06:55 +02:00
|
|
|
{
|
|
|
|
uint8_t buffer[64];
|
|
|
|
|
2017-06-27 13:58:31 +02:00
|
|
|
int res = felica_read(tag, FELICA_SC_RO, 0x00, buffer, 16);
|
|
|
|
cut_assert_equal_int(16, res);
|
2015-05-13 02:06:55 +02:00
|
|
|
|
|
|
|
uint8_t blocks[] = {
|
|
|
|
0x02,
|
|
|
|
0x03,
|
|
|
|
0x04,
|
|
|
|
};
|
|
|
|
|
2017-06-27 13:58:31 +02:00
|
|
|
res = felica_read_ex(tag, FELICA_SC_RO, 3, blocks, buffer, 3 * 16);
|
|
|
|
cut_assert_equal_int(3 * 16, res);
|
2015-05-13 02:06:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2017-06-27 13:58:31 +02:00
|
|
|
test_felica_write_without_encryption(void)
|
2015-05-13 02:06:55 +02:00
|
|
|
{
|
|
|
|
uint8_t buffer[16] = {
|
|
|
|
0x00, 0x01, 0x02, 0x03,
|
|
|
|
0x03, 0x04, 0x05, 0x06,
|
|
|
|
0x07, 0x08, 0x09, 0x0a,
|
|
|
|
0x0b, 0x0c, 0x0d, 0x0e,
|
|
|
|
};
|
|
|
|
|
2017-06-27 13:58:31 +02:00
|
|
|
int res = felica_write(tag, FELICA_SC_RW, 0x0a, buffer, sizeof(buffer));
|
2015-05-13 02:06:55 +02:00
|
|
|
|
2017-06-27 13:58:31 +02:00
|
|
|
cut_assert_equal_int(0, res);
|
2015-05-13 02:06:55 +02:00
|
|
|
}
|