#include <stdint.h>
#include <errno.h>
+#include <stdbool.h>
#include <string.h>
#include <sys/socket.h>
uint8_t param2,
uint8_t *cmd_data,
uint8_t cmd_data_length,
- near_bool_t le,
+ bool le,
near_recv cb,
void *in_data)
{
DBG("CLA-%02x INS-%02x P1-%02x P2-%02x",
class, instruction, param1, param2);
- if (le == FALSE) {
+ if (!le) {
if (cmd_data)
total_cmd_length = APDU_HEADER_LEN + cmd_data_length;
else
memcpy(cmd->data, cmd_data, cmd_data_length);
/* The Le byte set to 0x00 defined that any length
* of PICC response is allowed */
- if (le == TRUE)
+ if (le)
cmd->data[cmd_data_length] = 0;
}
0x00, /* P2: First or only occurrence */
filename, /* cmd_data */
fnamelen, /* uint8_t cmd_data_length*/
- FALSE,
+ false,
cb,
cookie);
}
(uint8_t) (offset & 0xFF),
0, /* no data send */
readsize, /* bytes to read */
- FALSE,
+ false,
cb,
cookie);
}
(uint8_t) (offset & 0xFF),
data, /* length of NDEF data */
nlen, /* NLEN + NDEF data */
- FALSE,
+ false,
cb,
cookie);
}
err = ISO_send_cmd(PICC_CLASS, WRITE_DATA_TO_FILE,
0x00, 0x00, cmd_data, cmd_data_length,
- TRUE, format_resp, cookie);
+ true, format_resp, cookie);
if (err < 0) {
near_error("wrtie data to ndef file req failed %d", err);
goto out_err;
err = ISO_send_cmd(PICC_CLASS, CREATE_STD_DATA_FILE,
0x00, 0x00, (uint8_t *)ndef,
sizeof(struct desfire_std_file),
- TRUE, write_data_to_ndef_file, cookie);
+ true, write_data_to_ndef_file, cookie);
if (err < 0) {
near_error("create ndef file req failed %d", err);
goto out_err;
err = ISO_send_cmd(PICC_CLASS, WRITE_DATA_TO_FILE,
0x00, 0x00, (uint8_t *)cc,
sizeof(struct desfire_cc_file),
- TRUE, create_ndef_file, cookie);
+ true, create_ndef_file, cookie);
if (err < 0) {
near_error("write data to cc file req failed %d", err);
goto out_err;
CREATE_STD_DATA_FILE,
0x00, 0x00, (uint8_t *)cc,
sizeof(struct desfire_std_file),
- TRUE, write_data_to_cc_file, cookie);
+ true, write_data_to_cc_file, cookie);
if (err < 0) {
near_error("create cc file req failed %d", err);
goto out_err;
memcpy(cmd_data, desfire_aid_1, cmd_data_length);
err = ISO_send_cmd(PICC_CLASS, SELECT_APPLICATION,
0x00, 0x00, cmd_data, cmd_data_length,
- TRUE, create_cc_file, cookie);
+ true, create_cc_file, cookie);
if (err < 0) {
near_error("select application1 req failed %d", err);
goto out_err;
err = ISO_send_cmd(PICC_CLASS, CREATE_APPLICATION,
0x00, 0x00, (uint8_t *)app,
sizeof(struct desfire_app),
- TRUE, select_application_1, cookie);
+ true, select_application_1, cookie);
if (err < 0) {
near_error("create application req failed %d", err);
goto out_err;
err = ISO_send_cmd(PICC_CLASS,
SELECT_APPLICATION,
0x00, 0x00, cmd_data, cmd_data_length,
- TRUE, create_application, cookie);
+ true, create_application, cookie);
if (err < 0) {
near_error("select application req failed %d", err);
goto out_err;
err = ISO_send_cmd(PICC_CLASS,
GET_VERSION_FRAME_RESPONSE_BYTE,
- 0x00, 0x00, NULL, 0, FALSE,
+ 0x00, 0x00, NULL, 0, false,
select_application, cookie);
if (err < 0) {
near_error("get version3 req failed %d", err);
cookie->memory_size = (1 << (resp[6] / 2));
err = ISO_send_cmd(PICC_CLASS,
GET_VERSION_FRAME_RESPONSE_BYTE,
- 0x00, 0x00, NULL, 0, FALSE,
+ 0x00, 0x00, NULL, 0, false,
get_version_frame3, cookie);
if (err < 0) {
near_error("get version2 req failed %d", err);
/* Step1 : Get Version */
err = ISO_send_cmd(PICC_CLASS, GET_VERSION,
- 0x00, 0x00, NULL, 0, FALSE,
+ 0x00, 0x00, NULL, 0, false,
get_version_frame2, cookie);
if (err < 0) {