[][src]Function opensc_sys::sc_bytes2apdu

pub unsafe extern "C" fn sc_bytes2apdu(
    ctx: *mut sc_context_t,
    buf: *const u8,
    len: size_t,
    apdu: *mut sc_apdu_t
) -> c_int

Transforms an APDU from binary to its @c sc_apdu_t representation @param ctx sc_context_t object (used for logging) @param buf APDU to be encoded as an @c sc_apdu_t object @param len length of @a buf @param apdu @c sc_apdu_t object to initialize @return SC_SUCCESS on success and an error code otherwise @note On successful initialization apdu->data will point to @a buf with an appropriate offset. Only free() @a buf, when apdu->data is not needed any longer. @note On successful initialization @a apdu->resp and apdu->resplen will be 0. You should modify both if you are expecting data in the response APDU.