mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-26 03:39:58 -07:00
* CCID: Improve request and response data handling - Add iso7816_set_response function: serves a helpers to set SW1 and SW2 values - improved iso7816_read_response_apdu by correctly parsing Lc and Le values - add client script to make testing easier * lint and rename * Format * Review changes: pragma once, typedef * Move command/response data and datalen into respective structures * Remove conditional for Lc=0 * Fix comment: Le * Make PVS happy and fix spelling Co-authored-by: あく <alleteam@gmail.com>
8 lines
285 B
C
8 lines
285 B
C
#include <stdint.h>
|
|
#include "iso7816_t0_apdu.h"
|
|
#include "iso7816_response.h"
|
|
|
|
void iso7816_set_response(ISO7816_Response_APDU* responseAPDU, uint16_t responseCode) {
|
|
responseAPDU->SW1 = (responseCode >> (8 * 1)) & 0xff;
|
|
responseAPDU->SW2 = (responseCode >> (8 * 0)) & 0xff;
|
|
} |