> 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/adk-5.0-programmers-guide/readme/annotated/class_com_config.md).

# ComConfig

[Public Types](#pub-types) | [Public Member Functions](#pub-methods) | [Static Public Member Functions](#pub-static-methods)

`#include <`[com\_config.h](/adk-5.0-programmers-guide/com__config_8h_source.md)`>`

|              |                                                                                                                                                                                                                                                                                                                                       |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Public Types |                                                                                                                                                                                                                                                                                                                                       |
| enum         | [Com1aMode](#af714a48ebd5dbbca4981e356a10e9f11) { [Com1a\_Usb](#af714a48ebd5dbbca4981e356a10e9f11a953310e434e0a3fe29ae6ff1674f7129) = 0, [Com1a\_BtClient](#af714a48ebd5dbbca4981e356a10e9f11aa89dc7579b9472e5258f23c1c1db5494) = 1, [Com1a\_BtServer](#af714a48ebd5dbbca4981e356a10e9f11a474e667cc13de1b7303d4d712bd951bd) = 2 }     |
| enum         | [MultiConnectMode](#afe439717727490cf1df729c2a6187c48) { [MCM\_Default](#afe439717727490cf1df729c2a6187c48a8af98f4003e40af199298c820b083b6b) = 0, [MCM\_Enabled](#afe439717727490cf1df729c2a6187c48a380bfbfd12b2d8a217045458e1d708b2) = 1, [MCM\_Disabled](#afe439717727490cf1df729c2a6187c48a2a70c1d5b742b22562a6353e4b4759ba) = 2 } |

|                                    |                                                                           |
| ---------------------------------- | ------------------------------------------------------------------------- |
| Public Member Functions            |                                                                           |
| void                               | [lock](#aa81aed607133209dade63a226818224d) ()                             |
| void                               | [unlock](#a9278be8203e1c42e2619179882ae4403) ()                           |
| pthread\_mutex\_t &                | [getMutex](#ae26916ef11a3f54b2530b55fcb592c16) ()                         |
| std::string &                      | [profile](#a9ca27570961b101e89318d3a3ac39d8f) ()                          |
| const std::vector< std::string > & | [whitelist](#a020b12d1010cec9f8c4b3a815f082955) ()                        |
| std::string &                      | [bt\_address](#ade9b87727d0a33bc5331f9425e051e2f) ()                      |
| std::string &                      | [bt\_device](#a180abc12542d25ee0bf2a8a73ca029c2) ()                       |
| std::string &                      | [com1a\_address](#a60e1fbb37f36e32dcebe88ef7ca2b890) ()                   |
| std::string &                      | [com1a\_device](#a6138436a34e24a76fe64a00a63fa23ce) ()                    |
| bool &                             | [com1a\_btclient\_reconnect\_idle](#acf979aafcdf34b7cde58dd58e4da42b6) () |
| unsigned &                         | [com1a\_mode](#a9bed2c8bcb1ac3c1e1c9acdb843ef06a) ()                      |
| bool &                             | [com1a\_btserver\_pairing\_idle](#a9373e79b97e460557e023229937c2f1e) ()   |
| std::string &                      | [ble\_address](#a650efc2582147b8afe73fb6864e8123e) ()                     |
| std::string &                      | [ble\_device](#a60492ca27221615d8287a7c0453d83e1) ()                      |
| const std::string &                | [bt\_own\_device\_name](#ad0c5bcfac0afdd54eadcc6d1d8b08ba5) ()            |
| std::vector< unsigned > &          | [idx\_list](#a94a140f49c60763246a9400fc2b149f4) ()                        |
| void                               | [clear](#ac8bb3912a3ce86b15842e79d0b421204) ()                            |
| void                               | [read](#a95212aa577485c0f3f2d50f1e20544ec) (bool \*storage\_needed=0)     |
| void                               | [store](#af5d1fdcbfe78592afb590a4c244acf20) ()                            |

|                                                                                       |                                                                                                                                                                                                                                            |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Static Public Member Functions                                                        |                                                                                                                                                                                                                                            |
| static [ComConfig](/adk-5.0-programmers-guide/readme/annotated/class_com_config.md) & | [getInstance](#a2305b98ede094139aa7d104ec73371fe) ()                                                                                                                                                                                       |
| static std::string                                                                    | [getCom1aModeName](#a37d50030103171103d6f08f40c05f1ce) (unsigned mode)                                                                                                                                                                     |
| static bool                                                                           | [load](#abb23423df3bfa5d6137393d5a22297ec) (const std::string \&com\_if\_file, [vfiipc::JSObject](https://github.com/verifoneone/verifone-git-book-adk/tree/ADK5.0_staging/classvfiipc_1_1_j_s_object.md) \&res, bool \*storage\_needed=0) |
| static enum [MultiConnectMode](#afe439717727490cf1df729c2a6187c48)                    | [getMultiConnectMode](#a9658e01c9bc759c0ee2197ced4c6af4f) ()                                                                                                                                                                               |

### DetailedDescription <a href="#detailed-description" id="detailed-description"></a>

class which holds settings of COM configuration file COM\_IF\_CONFIG\_FILE

### MemberEnumeration Documentation <a href="#member-enumeration-documentation" id="member-enumeration-documentation"></a>

### Com1aMode <a href="#af714a48ebd5dbbca4981e356a10e9f11" id="af714a48ebd5dbbca4981e356a10e9f11"></a>

enum \[Com1aMode]\(#af714a48ebd5dbbca4981e356a10e9f11)

|                 |   |
| --------------- | - |
| Enumerator      |   |
| Com1a\_Usb      |   |
| Com1a\_BtClient |   |
| Com1a\_BtServer |   |

### MultiConnectMode <a href="#afe439717727490cf1df729c2a6187c48" id="afe439717727490cf1df729c2a6187c48"></a>

enum \[MultiConnectMode]\(#afe439717727490cf1df729c2a6187c48)

multi connection mode

|               |                                                                 |
| ------------- | --------------------------------------------------------------- |
| Enumerator    |                                                                 |
| MCM\_Default  | Use default depending on SDI mode (no configuration available)  |
| MCM\_Enabled  | Multi-connection mode enabled, use lib\_mADK\_PP\_Prot\_ipc.so  |
| MCM\_Disabled | Multi-connection mode disabled, use lib\_mADK\_PP\_Prot\_com.so |

### MemberFunction Documentation <a href="#member-function-documentation" id="member-function-documentation"></a>

### ble\_address() <a href="#a650efc2582147b8afe73fb6864e8123e" id="a650efc2582147b8afe73fb6864e8123e"></a>

std::string& ble\_address

inline

returns address of the last paired BLE device

#### Returns

reference to m\_ble\_address

### ble\_device() <a href="#a60492ca27221615d8287a7c0453d83e1" id="a60492ca27221615d8287a7c0453d83e1"></a>

std::string& ble\_device

inline

returns reference to name of the last paired BLE device

#### Returns

reference to m\_ble\_device

### bt\_address() <a href="#ade9b87727d0a33bc5331f9425e051e2f" id="ade9b87727d0a33bc5331f9425e051e2f"></a>

std::string& bt\_address

inline

returns address of the paired BT-client device (used for BT PAN profile)

#### Returns

reference to m\_bt\_address

### bt\_device() <a href="#a180abc12542d25ee0bf2a8a73ca029c2" id="a180abc12542d25ee0bf2a8a73ca029c2"></a>

std::string& bt\_device

inline

returns name of the paired BT-client device (used for BT PAN profile)

#### Returns

reference to m\_bt\_device

### bt\_own\_device\_name() <a href="#ad0c5bcfac0afdd54eadcc6d1d8b08ba5" id="ad0c5bcfac0afdd54eadcc6d1d8b08ba5"></a>

const std::string& bt\_own\_device\_name

inline

returns reference to BT device name (of this terminal) used for BT pairing (for COM1A BT-client/server and BLE)

#### Returns

const reference to m\_bt\_own\_device\_name

### clear() <a href="#ac8bb3912a3ce86b15842e79d0b421204" id="ac8bb3912a3ce86b15842e79d0b421204"></a>

void clear

clear current configuration settings and reset to appropriate defaults.

### com1a\_address() <a href="#a60e1fbb37f36e32dcebe88ef7ca2b890" id="a60e1fbb37f36e32dcebe88ef7ca2b890"></a>

std::string& com1a\_address

inline

returns address of the paired BT-client device (used for COM1A profile BT-Client)

#### Returns

reference to m\_com1a\_address

### com1a\_btclient\_reconnect\_idle() <a href="#acf979aafcdf34b7cde58dd58e4da42b6" id="acf979aafcdf34b7cde58dd58e4da42b6"></a>

bool& com1a\_btclient\_reconnect\_idle

inline

returns flag which enables COM1A BT-client reconnect while idle

#### Returns

reference to m\_com1a\_btclient\_reconnect\_idle

### com1a\_btserver\_pairing\_idle() <a href="#a9373e79b97e460557e023229937c2f1e" id="a9373e79b97e460557e023229937c2f1e"></a>

bool& com1a\_btserver\_pairing\_idle

inline

returns flag which enables COM1A BT-server pairing while idle

#### Returns

reference to m\_com1a\_btserver\_pairing\_idle

### com1a\_device() <a href="#a6138436a34e24a76fe64a00a63fa23ce" id="a6138436a34e24a76fe64a00a63fa23ce"></a>

std::string& com1a\_device

inline

returns name of the paired BT-client device (used for COM1A profile BT-Client)

#### Returns

reference to m\_com1a\_device

### com1a\_mode() <a href="#a9bed2c8bcb1ac3c1e1c9acdb843ef06a" id="a9bed2c8bcb1ac3c1e1c9acdb843ef06a"></a>

unsigned& com1a\_mode

inline

returns mode for COM1A profile (one of enum Com1aMode)

#### Returns

reference to m\_com1a\_btclient\_reconnect\_idle

### getCom1aModeName() <a href="#a37d50030103171103d6f08f40c05f1ce" id="a37d50030103171103d6f08f40c05f1ce"></a>

string getCom1aModeName

static

returns name of operation mode for COM1A profile of enum Com1aMode

#### Returns

operation mode name

{% hint style="info" %}
Function is static and thread-safe and does not require protection with [lock()](#aa81aed607133209dade63a226818224d).
{% endhint %}

### getInstance() <a href="#a2305b98ede094139aa7d104ec73371fe" id="a2305b98ede094139aa7d104ec73371fe"></a>

[ComConfig](/adk-5.0-programmers-guide/readme/annotated/class_com_config.md) & getInstance

static

returns the [ComConfig](/adk-5.0-programmers-guide/readme/annotated/class_com_config.md) instance as singleton object

#### Returns

reference to [ComConfig](/adk-5.0-programmers-guide/readme/annotated/class_com_config.md) singleton object

### getMultiConnectMode() <a href="#a9658e01c9bc759c0ee2197ced4c6af4f" id="a9658e01c9bc759c0ee2197ced4c6af4f"></a>

enum \[ComConfig::MultiConnectMode]\(#afe439717727490cf1df729c2a6187c48) getMultiConnectMode

static

Check (for Engage/Fusion devices), if multi-connection support with [mADK\_PP\_Prot](/adk-5.0-programmers-guide/readme/annotated/classm_a_d_k___p_p___prot.md) (IPC variant) has been enabled or disabled by configuration. Since [read()](#a95212aa577485c0f3f2d50f1e20544ec) requires bitmask of supported COM interface which is provided by the protocol, we must access the COM configuration file directly (bevor the protocol is started).

#### Returns

value of enum MultiConnectMode

{% hint style="info" %}
Function is static and thread-safe and does not require protection with [lock()](#aa81aed607133209dade63a226818224d).
{% endhint %}

### getMutex() <a href="#ae26916ef11a3f54b2530b55fcb592c16" id="ae26916ef11a3f54b2530b55fcb592c16"></a>

pthread\_mutex\_t& getMutex

inline

return the reference of internal mutex to allow the use of MutexLock() instead [lock()](#aa81aed607133209dade63a226818224d)/unlock()

#### Returns

reference of internal mutex

### idx\_list() <a href="#a94a140f49c60763246a9400fc2b149f4" id="a94a140f49c60763246a9400fc2b149f4"></a>

std::vector\\& idx\_list

inline

### load() <a href="#abb23423df3bfa5d6137393d5a22297ec" id="abb23423df3bfa5d6137393d5a22297ec"></a>

bool load

static

loads COM configuration from config file and checks the file for validity. Usually, COM configuration file is stored in SDI flash folder.

**Parameters**

\[in] **com\_if\_file** file path to COM\_IF.CFG in flash folder \[out] **res** JSON object retrieving the result \[out] **storage\_needed** optional pointer to flag set to true, if the file is valid, but in old format and requires update.

#### Returns

true if file was found, is correclty formatted and contains a COM profile

{% hint style="info" %}
Function is static and thread-safe and does not require protection with [lock()](#aa81aed607133209dade63a226818224d).
{% endhint %}

### lock() <a href="#aa81aed607133209dade63a226818224d" id="aa81aed607133209dade63a226818224d"></a>

void lock

inline

locks the [ComConfig](/adk-5.0-programmers-guide/readme/annotated/class_com_config.md) object before accessing data.

{% hint style="info" %}
All member function below require protection with this function before accessing data.
{% endhint %}

### profile() <a href="#a9ca27570961b101e89318d3a3ac39d8f" id="a9ca27570961b101e89318d3a3ac39d8f"></a>

std::string& profile

inline

member function, which require protection with [lock()](#aa81aed607133209dade63a226818224d)/unlock returns active COM profile

#### Returns

reference to m\_profile

### read() <a href="#a95212aa577485c0f3f2d50f1e20544ec" id="a95212aa577485c0f3f2d50f1e20544ec"></a>

void read

reads COM configuration from config file COM\_IF\_CONFIG\_FILE from flash. Configuration is reset with [clear()](#ac8bb3912a3ce86b15842e79d0b421204) and file is read again. If the file is not found, class member variables stay empty or use appropriate defaults.

**Parameters**

\[out] **storage\_needed** optional pointer to flag set to true, if the file requires update and call of store()

### store() <a href="#af5d1fdcbfe78592afb590a4c244acf20" id="af5d1fdcbfe78592afb590a4c244acf20"></a>

void store

stores COM configuration to config file COM\_IF\_CONFIG\_FILE.

### unlock() <a href="#a9278be8203e1c42e2619179882ae4403" id="a9278be8203e1c42e2619179882ae4403"></a>

void unlock

inline

unlocks the [ComConfig](/adk-5.0-programmers-guide/readme/annotated/class_com_config.md) object after accessing data

### whitelist() <a href="#a020b12d1010cec9f8c4b3a815f082955" id="a020b12d1010cec9f8c4b3a815f082955"></a>

const std::vector\\& whitelist

inline

returns whitelist of COM profiles

#### Returns

const reference to m\_whitelist (read-only)

***

The documentation for this class was generated from the following files:

* sdi/src/[com\_config.h](/adk-5.0-programmers-guide/com__config_8h_source.md)
* sdi/src/[com\_config.cpp](/adk-5.0-programmers-guide/readme/files/dir_44d926a17fc606d3c25449ba60427c63/dir_048f823fee1bfb22502a8732b9a001aa/com__config_8cpp.md)


---

# 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/adk-5.0-programmers-guide/readme/annotated/class_com_config.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.
