> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/readme/system_overview/pg_all_components/pg_sdiapi_users_guide.md).

# ADK-SDI-API Programmers Guide

ADK-SDI-CLIENT provides a C++ client for the SDI server with an easy to use interface:

* use function parameters instead of TLV buffers
* provide dedicated data types for simple use instead of using byte buffers
* provide a single error code instead of error codes distributed over several places

## Usage <a href="#sdiapi_usage" id="sdiapi_usage"></a>

### SDI Client <a href="#sdiapi_client" id="sdiapi_client"></a>

[SDIClient](https://github.com/verifoneone/verifone-git-book-adk/tree/ADK5.1_staging/classvfisdi_1_1_s_d_i_client.md) is the main class for accessing SDI server. Before commands can be invoked the connection needs to be connected using [SDIClient::connect](/s-adk-5.1-programmers-guide/readme/modules/group__sdisetup.md#gaadabac17c905f50d1379d3ba5fbdd0e6), either using a host name and port or by providing an already connected IPC link.

The connection state can be checked using [SDIClient::connected](/s-adk-5.1-programmers-guide/readme/modules/group__sdisetup.md#gaa0fd96bc25e3d509fb54028c2e4b91f6).

SDIClient supports several protocol variants, which can be switched using [SDIClient::setProtocol](/s-adk-5.1-programmers-guide/readme/modules/group__sdisetup.md#gab5e31e9de33ab7fcc6694fed46316476). [SDIClient::PROTOCOL\_B](https://github.com/verifoneone/verifone-git-book-adk/tree/ADK5.1_staging/classvfisdi_1_1_s_d_i_client.md#a2b99fb4e4914a533566284f2ed3b0186a1047589f56e6de0f5cd3dada0723fdab) is for the main SDI server access, which only one instance may used and [SDIClient::PROTOCOL\_C](https://github.com/verifoneone/verifone-git-book-adk/tree/ADK5.1_staging/classvfisdi_1_1_s_d_i_client.md#a2b99fb4e4914a533566284f2ed3b0186a6aa928c13ed99c74ac4969146cf1a92f) is for concurrent but only limited access (e.g. printing or PIN entry).

Most functions return an error code, some return an error code or status code. All [error codes](/s-adk-5.1-programmers-guide/readme/namespaces/namespacevfisdi.md#a28287671eaf7406afd604bd055ba4066) are <0, [EMV status codes](/s-adk-5.1-programmers-guide/readme/namespaces/namespacevfisdi.md#a904e5abfa09e53cda6dd4c6ba5fa5b02) are >0. No error is indicated by return of [OK](/s-adk-5.1-programmers-guide/readme/namespaces/namespacevfisdi.md#a28287671eaf7406afd604bd055ba4066a2bc49ec37d6a5715dd23e85f1ff5bb59) (0).

### Parameter data <a href="#sdiapi_tlv" id="sdiapi_tlv"></a>

On the low level, parameters are sent to SDI server using TLV data. Normally SDIClient already handles those details, so that parameters can be just passed as function parameters. In case direct access is required the class [TLV](https://github.com/verifoneone/verifone-git-book-adk/tree/ADK5.1_staging/classvfisdi_1_1_t_l_v.md) is provided to ease handling of TLV data.

In case of EMV configuration data and EMV transaction data, two classes are provided to simplify access to EMV parameter data: [EMVConf](https://github.com/verifoneone/verifone-git-book-adk/tree/ADK5.1_staging/structvfisdi_1_1_e_m_v_conf.md) and [EMVTxn](https://github.com/verifoneone/verifone-git-book-adk/tree/ADK5.1_staging/structvfisdi_1_1_e_m_v_txn.md).

For accessing BCD values, fixed sized arrays and bit masks, the helper classes [BCD](https://github.com/verifoneone/verifone-git-book-adk/tree/ADK5.1_staging/classvfisdi_1_1_b_c_d.md), [Array](https://github.com/verifoneone/verifone-git-book-adk/tree/ADK5.1_staging/structvfisdi_1_1_array.md) and [BitMask](https://github.com/verifoneone/verifone-git-book-adk/tree/ADK5.1_staging/structvfisdi_1_1_bit_mask.md) are provided.

For EMV bit masks the following classes (based on BitMask) are provided:

* [EMVAppFlowCapabilities](/s-adk-5.1-programmers-guide/readme/namespaces/namespacevfisdi.md#a44617adc8f4a66d0aed5cc243140d735)
* [EMVKernelAppFlowCapabilities](/s-adk-5.1-programmers-guide/readme/namespaces/namespacevfisdi.md#afbf44378c420013894c6d1ec2396557a)
* [EMVFlowOptions](/s-adk-5.1-programmers-guide/readme/namespaces/namespacevfisdi.md#a7aa35087a65d5c2673093eaeecd7a30f)
* [EMVChecksumOptions](/s-adk-5.1-programmers-guide/readme/namespaces/namespacevfisdi.md#af00bb692a2a174186fe3cb16326581bd)
* [EMVTransactionOptions](/s-adk-5.1-programmers-guide/readme/namespaces/namespacevfisdi.md#aa3b8e383f2f4b4a88300bbeb10f423bb)
* [EMVTransactionSteps](/s-adk-5.1-programmers-guide/readme/namespaces/namespacevfisdi.md#ab48783102ea080d5f86d54616950c195)
* [EMVDomesticOptions](/s-adk-5.1-programmers-guide/readme/namespaces/namespacevfisdi.md#a7fcca20a9f7822f498e8019bb6418bd9)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/readme/system_overview/pg_all_components/pg_sdiapi_users_guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
