SE050 Driver
API reference
Loading...
Searching...
No Matches
se050_session.hpp
Go to the documentation of this file.
1
10#pragma once
11
13#include "se050_types.hpp"
14
15#include <cstddef>
16#include <cstdint>
17
18namespace se050 {
19
24template <typename TransportT>
25class Session {
26public:
27 explicit Session(TransportT& transport) noexcept : transport_(transport) {}
28
30 [[nodiscard]] bool EnsureReady() noexcept { return transport_.EnsureInitialized(); }
31
36 [[nodiscard]] Error TransceiveRaw(const std::uint8_t* tx, std::size_t tx_len,
37 std::uint8_t* rx, std::size_t rx_cap,
38 std::size_t* rx_len_out,
39 std::uint32_t timeout_ms) noexcept {
40 if (rx_len_out == nullptr) {
42 }
43 if (tx_len == 0U) {
45 }
46 if (!transport_.EnsureInitialized()) {
48 }
49 return transport_.Transceive(tx, tx_len, rx, rx_cap, rx_len_out, timeout_ms);
50 }
51
53 [[nodiscard]] Error PulseReset() noexcept { return transport_.HardwareReset(); }
54
55 TransportT& Transport() noexcept { return transport_; }
56 const TransportT& Transport() const noexcept { return transport_; }
57
58private:
59 TransportT& transport_;
60};
61
62} // namespace se050
Transport-facing session (no owned buffers).
Definition se050_session.hpp:25
bool EnsureReady() noexcept
Propagates to the transport’s EnsureInitialized().
Definition se050_session.hpp:30
const TransportT & Transport() const noexcept
Definition se050_session.hpp:56
Session(TransportT &transport) noexcept
Definition se050_session.hpp:27
Error PulseReset() noexcept
Optional GPIO / power-style reset routed through the transport.
Definition se050_session.hpp:53
TransportT & Transport() noexcept
Definition se050_session.hpp:55
Error TransceiveRaw(const std::uint8_t *tx, std::size_t tx_len, std::uint8_t *rx, std::size_t rx_cap, std::size_t *rx_len_out, std::uint32_t timeout_ms) noexcept
Raw transceive used for early bring-up (not a substitute for se050::T1Session).
Definition se050_session.hpp:36
Definition se050_apdu.hpp:15
Error
Definition se050_types.hpp:14
CRTP base for an I²C-backed SE050 link (split Write / Read + optional raw transceive).
Shared types, limits, and error codes for the HF-SE050 driver.