> 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/namespaces/namespacejs.md).

# js

[Enumerations](#enum-members) | [Functions](#func-members)

|              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enumerations |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| enum         | [JSTraceType](#ad20456843dd92e66711a2f7bf92ba403) { [JST\_HTTPGET](#ad20456843dd92e66711a2f7bf92ba403a0097858ea2de0d47f1b37c6b59c2877b), [JST\_HTTPPOST](#ad20456843dd92e66711a2f7bf92ba403a018b7c186e2e6c565ae2ef1094f11c19), [JST\_HTTPRESULT](#ad20456843dd92e66711a2f7bf92ba403a4e9e8cb17cd6cde626775e713559d61b) }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| enum         | <p><a href="#ab8a0c8e0d128f31e9b6aed5cbcc2a71c">JSLogLevel</a> {<br>  <a href="#ab8a0c8e0d128f31e9b6aed5cbcc2a71ca8bfbb012c5c86c64ad79efdb0261d147">JSL\_EMERGENCY</a> =0, <a href="#ab8a0c8e0d128f31e9b6aed5cbcc2a71cadffafab224bc4e075654d9481e252bc8">JSL\_ALERT</a> =1, <a href="#ab8a0c8e0d128f31e9b6aed5cbcc2a71cab221e9c88ce2273731b118be8d1cd3c8">JSL\_CRITICAL</a> =2, <a href="#ab8a0c8e0d128f31e9b6aed5cbcc2a71cafe102a5d724b8b7a20057d4ec0f8411e">JSL\_ERROR</a> =3,<br>  <a href="#ab8a0c8e0d128f31e9b6aed5cbcc2a71ca1a1c6e37370cae3caba81e3ab822b0a9">JSL\_WARNING</a> =4, <a href="#ab8a0c8e0d128f31e9b6aed5cbcc2a71ca8bbd28ebf2d8ab68ea4c034820b83c72">JSL\_NOTICE</a> =5, <a href="#ab8a0c8e0d128f31e9b6aed5cbcc2a71cacdfefe038aa565f330ed517e52a336ab">JSL\_INFO</a> =6, <a href="#ab8a0c8e0d128f31e9b6aed5cbcc2a71caf3f2f3a9bbfe273ade514f6a3cc4a24c">JSL\_DEBUG</a> =7<br>}</p> |

|                                                                                                                                                                                                                               |                                                                                                                                                                                                                                                                                 |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Functions                                                                                                                                                                                                                     |                                                                                                                                                                                                                                                                                 |
| [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) bool          | [jsProcessor](#aed4342f3366822c63467b5ac2cf954a6) (void \*data, const std::string \&sourcecode, std::map< std::string, std::string > \&arg, std::string \&out, std::string \&err, std::string \&exitcode)                                                                       |
| [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) bool          | [jsProcessorExt](#a079799b1c828f53a96eec5af0c7e591e) (void \*data, const std::string \&sourcecode, std::map< std::string, std::string > \&arg, std::string \&out, std::string \&err, std::string \&exitcode, vfihtml::ExtContext \*context)                                     |
| const [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) char \* | [jsProcVersion](#ad00023748fe562979f1e0d9927fa8b4c) ()                                                                                                                                                                                                                          |
| [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void          | [jsSetHttpProxy](#a93f7e226d11567703ca1af4ad05c74b8) (const char \*proxy)                                                                                                                                                                                                       |
| const [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) char \* | [jsGetHttpProxy](#aa600eb22cb9b648950a8c9b7336f25a3) ()                                                                                                                                                                                                                         |
| [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void          | [jsSetConsole](#ab0b2ef6cebca767dc473a5cbc5a3d3dc) (void(\*cb)(void \*data, const char \*text), void \*data)                                                                                                                                                                    |
| [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void          | [jsGetConsole](#a2873af29ad5c7fb7d1c52623f6c1aa69) (void(\*\&cb)(void \*, const char \*), void \*\&data)                                                                                                                                                                        |
| [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void          | [jsSetNotify](#a941985c6558b6f4f10bacf7857d5ad6e) (int(\*cb)(void \*data, const char \*to, const char \*notification\_id, const char \*json\_param, unsigned flags, const char \*from), void \*data)                                                                            |
| [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void          | [jsGetNotify](#a4693926db9182ab2551e72551c7f703e) (int(\*\&cb)(void \*data, const char \*to, const char \*notification\_id, const char \*json\_param, unsigned flags, const char \*from), void \*\&data)                                                                        |
| [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void          | [jsSetNotifyAndWait](#ab7a589551714a925a23a39e9c2f86a34) (int(\*cb)(void \*data, const char \*to, const char \*notification\_id, const char \*json\_param, unsigned flags, const char \*from, const char \*wait\_id, std::string \&result, int timeout\_msec), void \*data)     |
| [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void          | [jsGetNotifyAndWait](#a4f20de3f3605bf70b48e478b00221a2d) (int(\*\&cb)(void \*data, const char \*to, const char \*notification\_id, const char \*json\_param, unsigned flags, const char \*from, const char \*wait\_id, std::string \&result, int timeout\_msec), void \*\&data) |
| [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void          | [jsSetTrace](#a671fe746485753d6f9edcc2a4420ef91) (void(\*cb)(void \*data, [JSTraceType](#ad20456843dd92e66711a2f7bf92ba403) type, const std::string \&app\_id, std::map< std::string, std::string > \&trace), void \*data)                                                      |
| [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void          | [jsGetTrace](#acad863333bee2403c9d54b3bd117158c) (void(\*\&cb)(void \*data, [JSTraceType](#ad20456843dd92e66711a2f7bf92ba403) type, const std::string \&app\_id, std::map< std::string, std::string > \&trace), void \*\&data)                                                  |
| [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void          | [jsSetLog](#aa4e26e9d7af24ac28e26ec47d4ea095c) (void(\*cb)(void \*data, const std::string \&app\_id, [JSLogLevel](#ab8a0c8e0d128f31e9b6aed5cbcc2a71c) log\_level, const std::vector< std::string > \&msg), void \*data)                                                         |
| [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void          | [jsGetLog](#a34a81ec14c36fc4aa838773ff4b15949) (void(\*\&cb)(void \*data, const std::string \&app\_id, [JSLogLevel](#ab8a0c8e0d128f31e9b6aed5cbcc2a71c) log\_level, const std::vector< std::string > \&msg), void \*\&data)                                                     |

### EnumerationType Documentation <a href="#enumeration-type-documentation" id="enumeration-type-documentation"></a>

### JSLogLevel <a href="#ab8a0c8e0d128f31e9b6aed5cbcc2a71c" id="ab8a0c8e0d128f31e9b6aed5cbcc2a71c"></a>

enum \[JSLogLevel]\(#ab8a0c8e0d128f31e9b6aed5cbcc2a71c)

|                |   |
| -------------- | - |
| Enumerator     |   |
| JSL\_EMERGENCY |   |
| JSL\_ALERT     |   |
| JSL\_CRITICAL  |   |
| JSL\_ERROR     |   |
| JSL\_WARNING   |   |
| JSL\_NOTICE    |   |
| JSL\_INFO      |   |
| JSL\_DEBUG     |   |

### JSTraceType <a href="#ad20456843dd92e66711a2f7bf92ba403" id="ad20456843dd92e66711a2f7bf92ba403"></a>

enum \[JSTraceType]\(#ad20456843dd92e66711a2f7bf92ba403)

trace type

|                 |                                                              |
| --------------- | ------------------------------------------------------------ |
| Enumerator      |                                                              |
| JST\_HTTPGET    | trace of an HTTP GET request, data provided: "url"           |
| JST\_HTTPPOST   | trace of an HTTP POST request, data provided: "url"          |
| JST\_HTTPRESULT | <p>trace of the HTTP result, data provided: "status"<br></p> |

### FunctionDocumentation <a href="#function-documentation" id="function-documentation"></a>

### jsGetConsole() <a href="#a2873af29ad5c7fb7d1c52623f6c1aa69" id="a2873af29ad5c7fb7d1c52623f6c1aa69"></a>

[DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void js::jsGetConsole

get current setting of callback for console output

**Parameters**

\[out] **cb** callback function pointer or NULL \[out] **data** data pointer provided to callback as first parameter

### jsGetHttpProxy() <a href="#aa600eb22cb9b648950a8c9b7336f25a3" id="aa600eb22cb9b648950a8c9b7336f25a3"></a>

const [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) char\\\* js::jsGetHttpProxy

Read current proxy setting

#### Returns

proxy setting.

### jsGetLog() <a href="#a34a81ec14c36fc4aa838773ff4b15949" id="a34a81ec14c36fc4aa838773ff4b15949"></a>

[DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void js::jsGetLog

read logging callback

**Parameters**

\[out] **cb** callback function pointer or NULL \[out] **data** data pointer provided to callback as first parameter

### jsGetNotify() <a href="#a4693926db9182ab2551e72551c7f703e" id="a4693926db9182ab2551e72551c7f703e"></a>

[DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void js::jsGetNotify

get current setting of notification callback

**Parameters**

\[out] **cb** callback function pointer or NULL \[out] **data** data pointer provided to callback as first parameter

### jsGetNotifyAndWait() <a href="#a4f20de3f3605bf70b48e478b00221a2d" id="a4f20de3f3605bf70b48e478b00221a2d"></a>

[DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void js::jsGetNotifyAndWait

get current setting of notification callback

**Parameters**

\[out] **cb** callback function pointer or NULL \[out] **data** data pointer provided to callback as first parameter

### jsGetTrace() <a href="#acad863333bee2403c9d54b3bd117158c" id="acad863333bee2403c9d54b3bd117158c"></a>

[DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void js::jsGetTrace

read HTTP trace callback

**Parameters**

\[out] **cb** callback function pointer or NULL \[out] **data** data pointer provided to callback as first parameter

### jsProcessor() <a href="#aed4342f3366822c63467b5ac2cf954a6" id="aed4342f3366822c63467b5ac2cf954a6"></a>

[DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) bool js::jsProcessor

Process JavaScript script and return the data sent to stdout and stderr

**Parameters**

\[in] **data** this parameter is unused, it is just there for compatibility with the ADKGUI scripting interface \[in] **sourcecode** string containing the Js source code \[in] **arg** key value map, can be accessed as table 'ARG' from within the JavaScript script \[out] **out** data sent to stdout \[out] **err** data sent to stderr \[out] **exitcode** parameter that was passed to exit()

#### Returns

true if processing was successful, false if not

### jsProcessorExt() <a href="#a079799b1c828f53a96eec5af0c7e591e" id="a079799b1c828f53a96eec5af0c7e591e"></a>

[DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) bool js::jsProcessorExt

Process JavaScript script and return the data sent to stdout and stderr. This is the variant with ADKGUI extensions support.

**Parameters**

\[in] **data** this parameter is unused, it is just there for compatibility with the ADKGUI scripting interface \[in] **sourcecode** string containing the Js source code \[in] **arg** key value map, can be accessed as table 'ARG' from within the JavaScript script \[out] **out** data sent to stdout \[out] **err** data sent to stderr \[out] **exitcode** parameter that was passed to exit() \[in,out] **context** extended context, if NULL GUI extensions are disabled.

#### Returns

true if processing was successful, false if not

### jsProcVersion() <a href="#ad00023748fe562979f1e0d9927fa8b4c" id="ad00023748fe562979f1e0d9927fa8b4c"></a>

const [DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) char\\\* js::jsProcVersion

#### Returns

version information

### jsSetConsole() <a href="#ab0b2ef6cebca767dc473a5cbc5a3d3dc" id="ab0b2ef6cebca767dc473a5cbc5a3d3dc"></a>

[DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void js::jsSetConsole

set callback for console output

**Parameters**

\[in] **cb** callback function pointer or NULL \[in] **data** data pointer provided to callback as first parameter

The callback takes the following parameters:

**Parameters**

\[in] **data** data pointer \[in] **text** string to be sent to console

{% hint style="info" %}
The console callback is global, only one callback may be set. Setting the callback function is not thread safe, i.e. appropriate actions have to be taken to protect against race conditions.
{% endhint %}

### jsSetHttpProxy() <a href="#a93f7e226d11567703ca1af4ad05c74b8" id="a93f7e226d11567703ca1af4ad05c74b8"></a>

[DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void js::jsSetHttpProxy

Set Http-Proxy

**Parameters**

\[in] **proxy** Proxy setting, e.g. <http://localhost:8888> or NULL

### jsSetLog() <a href="#aa4e26e9d7af24ac28e26ec47d4ea095c" id="aa4e26e9d7af24ac28e26ec47d4ea095c"></a>

[DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void js::jsSetLog

install logging callback

**Parameters**

\[in] **cb** callback function pointer or NULL \[in] **data** data pointer provided to callback as first parameter

The callback takes the following parameters:

**Parameters**

\[in] **data** data pointer \[in] **log\_level** logging level 0-7 (emergency,alert,critical, \[in] **app\_id** application ID (as found in ARGV\["cp\_appId"]) \[in] **msg** log message parameters in the order they were provided to log.info()/log.debug(),log.error()

{% hint style="info" %}
The log callback is global, only one callback may be set. Setting the callback function is not thread safe, i.e. appropriate actions have to be taken to protect against race conditions.
{% endhint %}

### jsSetNotify() <a href="#a941985c6558b6f4f10bacf7857d5ad6e" id="a941985c6558b6f4f10bacf7857d5ad6e"></a>

[DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void js::jsSetNotify

set callback for sending notifications

**Parameters**

\[in] **cb** callback function pointer or NULL \[in] **data** data pointer provided to callback as first parameter

The callback takes the following parameters:

**Parameters**

\[in] **data** data pointer \[in] **to** destination address \[in] **notification\_id** notification id \[in] **json\_param** string containing the JSON encoded parameters \[in] **flags** optional flags \[in] **from** optional source address, if NULL use default source address

#### Returns

0 in case of success or negative error code

{% hint style="info" %}
The notification callback is global, only one callback may be set. Setting the callback function is not thread safe, i.e. appropriate actions have to be taken to protect against race conditions.
{% endhint %}

### jsSetNotifyAndWait() <a href="#ab7a589551714a925a23a39e9c2f86a34" id="ab7a589551714a925a23a39e9c2f86a34"></a>

[DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void js::jsSetNotifyAndWait

set callback for sending notifications

**Parameters**

\[in] **cb** callback function pointer or NULL \[in] **data** data pointer provided to callback as first parameter

The callback takes the following parameters:

**Parameters**

\[in] **data** data pointer \[in] **to** destination address \[in] **notification\_id** notification id \[in] **json\_param** string containing the JSON encoded parameters \[in] **flags** optional flags \[in] **from** optional source address, if NULL use default source address \[in] **wait\_id** wait for notification with this id \[out] **result** received notification \[in] **timeout\_msec** timeout in milliseconds

#### Returns

0 in case of success or negative error code

{% hint style="info" %}
The notification callback is global, only one callback may be set. Setting the callback function is not thread safe, i.e. appropriate actions have to be taken to protect against race conditions.
{% endhint %}

### jsSetTrace() <a href="#a671fe746485753d6f9edcc2a4420ef91" id="a671fe746485753d6f9edcc2a4420ef91"></a>

[DllSpec](/adk-5.0-programmers-guide/readme/files/dir_15b7eb99384c20f55db7776b7b1ecdad/dir_7d99a5752ef00d9a9478541a793df8d8/dir_b95d7ee73b2963b5e37f0a7269e7a4c6/sound_8h.md#ad7c2e1cb200073ed64c64285a5f37231) void js::jsSetTrace

install HTTP trace callback

**Parameters**

\[in] **cb** callback function pointer or NULL \[in] **data** data pointer provided to callback as first parameter

The callback takes the following parameters:

**Parameters**

\[in] **data** data pointer \[in] **type** trace type \[in] **app\_id** application ID (as found in ARGV\["cp\_appId"]) \[in] **trace** key value map containing trace parameters

{% hint style="info" %}
The trace callback is global, only one callback may be set. Setting the callback function is not thread safe, i.e. appropriate actions have to be taken to protect against race conditions.
{% endhint %}


---

# 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/namespaces/namespacejs.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.
