# Diagnostics

**Detailed Description**

This section contains APIs related to diagnostics services.

- *group* Telematics\_diagnostics

    - Defines

- MIN\_DIAG\_FILE\_SIZE\_MB

    - Minimum size of the log file.

- MAX\_DIAG\_FILE\_SIZE\_MB

    - Maximum size of the log file.

- MIN\_NUM\_DIAG\_FILES

    - Minimum number of the log files.

- MAX\_NUM\_DIAG\_FILES

    - Maximum number of the log files.

- MIN\_WATER\_MARK

    - Log flushing stops when this is reached.

- MAX\_WATER\_MARK

    - Log flushing starts when this is reached.

- DEFAULT\_LOW\_WATER\_MARK

    - Default value - flushing stops when this is reached.

- DEFAULT\_HIGH\_WATER\_MARK

    - Default value - flushing starts when this is reached.

Typedefs

- using Devices = uint8\_t

    - Bitmask taking devices from [diag::DeviceType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1ga7814783b5445a8085e7213e91f79e688.html#a00012_1ga7814783b5445a8085e7213e91f79e688). Values can be OR’ed together, for ex; (DIAG\_DEVICE\_EXTERNAL\_AP | DIAG\_DEVICE\_MDM) to specify more than one device.

- using Peripherals = uint8\_t

    - Bitmask taking peripheral from [diag::PeripheralType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1ga7ad49d9f0ed5b6cbb3c42a8b6ea34942.html#a00012_1ga7ad49d9f0ed5b6cbb3c42a8b6ea34942). Values can be OR’ed together, for ex; (DIAG\_PERIPHERAL\_MODEM\_DSP | DIAG\_PERIPHERAL\_CDSP) to specify more than one peripheral.

Enums

- enum LogMethod

    - Specifies how an application gets the collected logs.

*Values:*

- enumerator NONE

    - No valid method defined.

- enumerator FILE

    - File method - logs are saved in file(s).

By default, these files are saved in the /tmp/diag directory. Client can specify a different directory by defining platform.diag.diag\_output\_log\_path in the tel.conf file. If specified, the directory should exist before starting the log collection.

The logs files typically follow ‘diag\_log\_\*\_date\_time.qmdl’ naming convention and can be read in plain text format using Qualcomm extensible diagnostic monitor (QXDM) tool.

- enumerator CALLBACK

    - Callback method - logs are provided via [IDiagListener::onAvailableLogs](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00557_1a6936e31610937b255f619d0a723d8f56) callback whenever available, in raw format.

- enum DiagLogMode

    - Specifies when an application gets the collected logs.

*Values:*

- enumerator STREAMING

    - Logs are provided immediately whenever available.

- enumerator THRESHOLD

    - In threshold log collection mode, user specifies 2 thresholds - high watermark and low watermark. Refer to [BufferedModeConfig::highWaterMark](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00553.html#a00553_1a12daf78c8c1e343cfbc2bc0b5f7fd134) and [BufferedModeConfig::lowWaterMark](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00553.html#a00553_1a132ef9f0fcc6b0441878d298dcded268).

Logs are flushed to the client when high-watermark is reached, and flushing continues until low-watermark is reached where buffering starts again.

Client can explicitly drain the buffer using IDiagLogManager::drainPeripheralBuffer.

Whenever a peripheral wants to pass logs to the client, it raises an interrupt to the application processor. Therefore, for streaming mode, there are frequent interrupts which prevents the application processor from entering and remaining into the power collapsed state for longer duration based on the frequency and amount of logs.

Specifying this mode causes logs to be accumulated in the peripheral’s local buffer. An interrupt is raised only when the high-watermark is reached. Therefore, application processor can remain power collapsed for longer time saving power.

Applicable for only peripherals with its own buffer such as Modem DSP.

- enumerator CIRCULAR\_BUFFER

    - Logs are saved in peripheral’s local buffer until the client explicitly requests them through IDiagLogManager::drainPeripheralBuffer.

Old logs are overwritten when the buffer is full and drain is not issued.

Similar to the THRESHOLD mode, this can also be used to save power.

Applicable for only peripherals with its own buffer such as Modem DSP.

- enum DeviceType

    - Specifies the device for which logs are collected. Logs from all the peripherals on the specified device are collected.

*Values:*

- enumerator DIAG\_DEVICE\_NONE

    - No device (only peripheral logs are collected)

- enumerator DIAG\_DEVICE\_EXTERNAL\_AP

    - External application processor (EAP). Client must be running on the EAP. Unsupported.

- enumerator DIAG\_DEVICE\_MDM

    - Mobile data modem (MDM). Client can be running on either EAP or MDM. EAP is not supported.

- enum PeripheralType

    - Specifies the peripheral(s) for which logs are collected. Logs from one or more peripherals can be collected by setting corresponding bit in the [diag::Peripherals](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00012_1ga551c2f653e9b561fcefa9d82b7189372).

*Values:*

- enumerator DIAG\_PERIPHERAL\_NONE

    - No peripheral (only device logs are collected).

- enumerator DIAG\_PERIPHERAL\_INTEGRATED\_AP

    - Application processor (Apps). On platforms with hypervisor, includes all virtual machines (host and guest). The APPS logs can be collected ONLY via DiagLogMode::STREAMING mode.

- enumerator DIAG\_PERIPHERAL\_MODEM\_DSP

    - Modem digital signal processor (often referred as Q6).

- enumerator DIAG\_PERIPHERAL\_SVM

    - Guest virtual machines (also referred as secondary virtual machine SVM). Unsupported, use DIAG\_PERIPHERAL\_INTEGRATED\_AP instead.

- enumerator DIAG\_PERIPHERAL\_LPASS

    - Low power audio subsystem (LPASS). Unsupported.

- enumerator DIAG\_PERIPHERAL\_CDSP

    - Compute digital signal processor (CDSP). Unsupported.

- enum SourceType

    - Defines source of the logs; device or peripheral. Logs will be collected from this source.

Note: device and peripheral logs collection are mutually exclusive.

*Values:*

- enumerator NONE

    - Unknown source.

- enumerator DEVICE

    - Device, refer [diag::DeviceType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1ga7814783b5445a8085e7213e91f79e688.html#a00012_1ga7814783b5445a8085e7213e91f79e688) for details.

- enumerator PERIPHERAL

    - Peripheral, refer [diag::PeripheralType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1ga7ad49d9f0ed5b6cbb3c42a8b6ea34942.html#a00012_1ga7ad49d9f0ed5b6cbb3c42a8b6ea34942) for details.

- union SourceInfo

    - Defines device(s) or peripheral(s) from which logs are collected.

Public Members

- [Devices](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00012_1ga20a74498ab4fc092e4d887906df31204.html#_CPPv4N5telux8platform4diag7DevicesE) device = [DeviceType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1ga7814783b5445a8085e7213e91f79e688.html#_CPPv4N5telux8platform4diag10DeviceTypeE)::[DIAG\_DEVICE\_NONE](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1ga7814783b5445a8085e7213e91f79e688.html#_CPPv4N5telux8platform4diag10DeviceType16DIAG_DEVICE_NONEE)

    - Refer [diag::Devices](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00012_1ga20a74498ab4fc092e4d887906df31204) for details.

- [Peripherals](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00012_1ga551c2f653e9b561fcefa9d82b7189372.html#_CPPv4N5telux8platform4diag11PeripheralsE) peripheral

    - Refer [diag::Peripherals](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00012_1ga551c2f653e9b561fcefa9d82b7189372) for details.

- struct DiagStatus

    - Current status of the log collection.

Public Members

- [LogMethod](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1ga96db95dcf5e2be2e906eb3dcfced8bab.html#_CPPv4N5telux8platform4diag9LogMethodE) logMethod

    - Currently active method.

- bool isLoggingInProgress

    - True, if the collection has started, false otherwise.

- bool isLogDrainInProgress

    - Always returns false. Deprecated

- struct FileMethodConfig

    - Defines size of a log file and number of such files when collecting logs using file method.

Public Members

- uint32\_t maxSize

    - Optional, maximum file size in megabytes (MB) after which a new file will be created to save further logs every time this size is crossed.

Default value is MAX\_DIAG\_FILE\_SIZE\_MB. Valid range is MIN\_DIAG\_FILE\_SIZE\_MB &lt;= maxSize &lt;= MAX\_DIAG\_FILE\_SIZE\_MB.

- uint32\_t maxNumber

    - Optional, maximum number of the log files. Older files gets overwritten once this number is reached.

Default value is MAX\_NUM\_DIAG\_FILES. Valid range is MIN\_NUM\_DIAG\_FILES &lt;= maxNumber &lt;= MAX\_NUM\_DIAG\_FILES.

- struct BufferedModeConfig

    - Defines low and high water marks for DiagLogMode::THRESHOLD For file log collection only default watermarks are used.

Public Members

- uint8\_t highWaterMark

    - High watermark percentage - logs will be flushed from peripheral’s local buffer to the diag framework on the HLOS, when this mark is hit.

Default value is DEFAULT\_HIGH\_WATER\_MARK. Valid range is MIN\_WATER\_MARK &lt;= highWaterMark &lt;= MAX\_WATER\_MARK.

- uint8\_t lowWaterMark

    - Low watermark percentage - logs flushing will stop when this mark is hit and buffering will resume.

Default value is DEFAULT\_LOW\_WATER\_MARK. Valid range is MIN\_WATER\_MARK &lt;= lowWaterMark &lt;= MAX\_WATER\_MARK.

- struct DiagConfig

    - Specifies configuration for the diagnostics log collection process. Please refer to the below table while setting up the configuration-

| Log Mode | File Log Method | Callback Log Method | Is Draining Supported? | Are Watermarks applicable? | APPS log collection | Q6 log collection |
| --- | --- | --- | --- | --- | --- | --- |
| Streaming | 1 | 1 | 0 | 0 | 1 | 1 |
| Threshold | 1 | 1 | 1 | 1 | 0 | 1 |
| CircularBuffer | 1 | 1 | 1 | 0 | 0 | 1 |

Legends - 1: Supported 0: Not supported

Public Members

- [SourceType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1gad585b36f32b3e6ded2d1c6de24990023.html#_CPPv4N5telux8platform4diag10SourceTypeE) srcType

    - Refer [diag::SourceType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1gad585b36f32b3e6ded2d1c6de24990023.html#a00012_1gad585b36f32b3e6ded2d1c6de24990023) for details.

- [SourceInfo](https://docs.qualcomm.com/doc/80-PF458-8/topic/union_a00550.html#_CPPv4N5telux8platform4diag10SourceInfoE) srcInfo

    - Refer [diag::SourceInfo](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00550) for details. Based on the source type defined in [DiagConfig::srcType](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00554.html#a00554_1abee1d9372d734d596eff61bc049ae236), the corresponding field in [DiagConfig::srcInfo](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00554.html#a00554_1ac138f9475671ed4e11b78af6911e3436) will be used.

- std::string mdmLogMaskFile = ""

    - Optional, absolute path to the diag packet mask file to use when collecting logs from a MDM device/peripheral. It contains required information to filter logs based on the log type (for ex; event, message, response etc.). It is generated using Qualcomm extensible diagnostic monitor (QXDM) and have cfg extension.

Applicable only for MDM device/peripheral.

The DiagConfig::SourceType defines the subsystem for which logs are collected. A packet mask further narrows down them to a specific type.

- std::string eapLogMaskFile = ""

    - Optional, absolute path to the diag packet mask file when collecting logs from an EAP device or an EAP peripheral.

Applicable only for EAP device/peripheral. EAP based support is currently not supported.

- [LogMethod](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1ga96db95dcf5e2be2e906eb3dcfced8bab.html#_CPPv4N5telux8platform4diag9LogMethodE) method

    - Specifies how an application gets the collected logs. Refer [diag::LogMethod](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1ga96db95dcf5e2be2e906eb3dcfced8bab.html#a00012_1ga96db95dcf5e2be2e906eb3dcfced8bab) for details

- union telux::platform::diag::[DiagConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#_CPPv4N5telux8platform4diag10DiagConfigE)::[MethodConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/union_a00555.html#_CPPv4N5telux8platform4diag10DiagConfig12MethodConfigE) methodConfig

    - 

- [DiagLogMode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1ga456e74a9b696e39b1c1c5d314092252c.html#_CPPv4N5telux8platform4diag11DiagLogModeE) modeType = [DiagLogMode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1ga456e74a9b696e39b1c1c5d314092252c.html#_CPPv4N5telux8platform4diag11DiagLogModeE)::[STREAMING](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1ga456e74a9b696e39b1c1c5d314092252c.html#_CPPv4N5telux8platform4diag11DiagLogMode9STREAMINGE)

    - Specifies when an application gets the collected logs. Refer [diag::DiagLogMode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00012_1ga456e74a9b696e39b1c1c5d314092252c.html#a00012_1ga456e74a9b696e39b1c1c5d314092252c) for details.

- union telux::platform::diag::[DiagConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#_CPPv4N5telux8platform4diag10DiagConfigE)::[ModeConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/union_a00556.html#_CPPv4N5telux8platform4diag10DiagConfig10ModeConfigE) modeConfig

    -

- union MethodConfig

    - Configuration for the selected method.

Public Members

- [FileMethodConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#_CPPv4N5telux8platform4diag16FileMethodConfigE) fileConfig

    - Configuration specific to the file log collection method.

- union ModeConfig

    - Configuration for the selected mode.

Public Members

- [BufferedModeConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#_CPPv4N5telux8platform4diag18BufferedModeConfigE) bufferedModeConfig

    - Configuration specific to the threshold/circular buffer mode.

- class IDiagListener : public telux::common::[ISDKListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00046.html#_CPPv4N5telux6common12ISDKListenerE)

    - Receives diagnostics logs when using callback log method.

The methods in listener can be invoked from multiple different threads. The implementation should be thread safe.

Client implementing methods in this interface should not perform any long running or blocking operation from within methods in this class to ensure there is no delay in internal processing and further log passing to the application.

Public Functions

- inline virtual void onAvailableLogs(uint8\_t \*data, int length)

    - Called to pass collected diagnostics logs to the client.

On platforms with access control enabled, caller needs to have TELUX\_DIAG\_OPS permission to invoke this API successfully.

- Parameters:

    - - **data** – **[in]** Logs collected (as byte array)
- **length** – **[in]** Data length (number of bytes)

- inline virtual ~IDiagListener()

    - Destructor for [IDiagListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00557)

- class IDiagLogManager

    - [IDiagLogManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00558) provides ability to collect diagnostics logs on-device.

- Methods; two methods are provided; namely file and callback. In the file method, logs are stored in file(S). In callback method, logs are delivered to the client through a callback.

- Modes; three modes are provided; streaming, threshold and circular to let the client manage when to get the logs.

- Source; logs can be collected from the whole device or selected peripherals.

    A client running on the MDM can collect logs from the whole MDM device or from the specific MDM peripheral(s).

    Consider a fusion architecture where an EAP is connected to the MDM SoC via some interconnect (e.g. USB, PCIe or Ethernet). (a) If the client is running on the MDM, it can collect logs from the whole MDM device or from the specific MDM peripheral(s). It cannot collect logs from EAP whole device or from the peripherals on EAP. (b) If the client is running on the EAP, it can collect logs from the whole MDM device, from the whole EAP device or from the specific peripheral(s) on EAP. Currently, EAP is not supported.

- Granularity, on top of the log source, logs can be further narrowed down to be of specific type like message/event/F3 etc. using a mask file.

- Decoding: When using file method, logs are in a propriety format and can be decoded through QXDM to read them in a plain text format. For callback method, they are in raw format.

- Concurrency: Two or more processes can not collect logs from the same peripheral. A process can have only one session. A session is started with [startLogCollection()](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00558_1aa92fe330f1c0e5ad3c55fb409f6d5b79) and stopped with [stopLogCollection()](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00558_1ad402140c93b1e2d9334320b8fb85eb22). The file and callback methods are mutually exclusive.

Public Functions

- virtual [DiagStatus](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#_CPPv4N5telux8platform4diag10DiagStatusE) getStatus() = 0

    - Returns current status of the log collection.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Returns:

    - [diag::DiagStatus](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00551.html#a00551) detailing log collection status.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) registerListener(std::weak\_ptr&lt;[IDiagListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00557.html#_CPPv4N5telux8platform4diag13IDiagListenerE)&gt; listener) = 0

    - Registers the given listener to receive logs whenever they are available via [IDiagListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00557).

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Parameters:

    - **listener** – **[in]** Receives the diagnostics logs.

- Returns:

    - telux::common::Status::SUCCESS if the listener is registered, otherwise, an appropriate error code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) deregisterListener(std::weak\_ptr&lt;[IDiagListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00557.html#_CPPv4N5telux8platform4diag13IDiagListenerE)&gt; listener) = 0

    - Deregisters the given listener registered with [IDiagLogManager::registerListener()](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00558_1a406ee849f3785bea34075d291f529181).

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Parameters:

    - **listener** – **[in]** Listener to deregister.

- Returns:

    - telux::common::Status::SUCCESS if the listener is deregistered, otherwise, an appropriate error code.

- virtual telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) setConfig(const [DiagConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#_CPPv4N5telux8platform4diag10DiagConfigE) config) = 0

    - Sets the configuration for the log collection. Once set, it remains effective until new configuration is set.

Must be called before starting the log collection. Calling it again during ongoing collection will return telux::common::ErrorCode::INVALID\_STATE.

On platforms with access control enabled, caller needs to have TELUX\_DIAG\_OPS permission to invoke this API successfully.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Parameters:

    - **config** – **[in]** [diag::DiagConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00554.html#a00554) defining collection configuration

- Returns:

    - telux::common::ErrorCode::SUCCESS, if the configuration is set, telux::common::ErrorCode::INVALID\_STATE, if the log collection is in progress, telux::common::ErrorCode::MISSING\_RESOURCE when running on EAP and remote MDM device cannot be detected, otherwise an appropriate error code.

- virtual [DiagConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#_CPPv4N5telux8platform4diag10DiagConfigE) getConfig() = 0

    - Gets current log collection configuration.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Returns:

    - current configuration [telux::platform::diag::DiagConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00554.html#a00554).

- virtual telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) drainPeripheralBuffers([Peripherals](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00012_1ga551c2f653e9b561fcefa9d82b7189372.html#_CPPv4N5telux8platform4diag11PeripheralsE) peripherals) = 0

    - Draining the buffer refers to clearing of the peripheral’s local buffer.

This is applicable for DiagLogMode::THRESHOLD and DiagLogMode::CIRCULAR\_BUFFER

In the case of Threshold log collection, logs are drained until the [BufferedModeConfig::lowWaterMark](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00553.html#a00553_1a132ef9f0fcc6b0441878d298dcded268) is reached.

In the case of Circular buffer log collection, logs are drained until the buffer is empty.

This is currently applicable only for PeripheralType::DIAG\_PERIPHERAL\_MODEM\_DSP

On platforms with access control enabled, caller needs to have TELUX\_DIAG\_OPS permission to invoke this API successfully.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Parameters:

    - **peripherals** – **[in]** [diag::Peripherals](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00012_1ga551c2f653e9b561fcefa9d82b7189372) bitmask of peripherals to drain

- Returns:

    - telux::common::ErrorCode::SUCCESS if the drain is initiated, telux::common::ErrorCode::INVALID\_STATE if there is no collection in progress for given peripheral, telux::common::ErrorCode::NOT\_SUPPORTED if draining on given peripheral is not supported, an appropriate error code in all other cases.

- virtual telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) startLogCollection() = 0

    - Starts collecting the logs.

Configuration must be set at-least once using [IDiagLogManager::setConfig()](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00558_1a58cf5dd0ccf59fa76958df19017bcd38) before calling this method.

On platforms with access control enabled, caller needs to have TELUX\_DIAG\_OPS permission to invoke this API successfully.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Returns:

    - telux::common::ErrorCode::SUCCESS, if the log collection is started, telux::common::ErrorCode::NO\_EFFECT, if the log collection has already started, telux::common::ErrorCode:: INVALID\_STATE if a valid config is not set before calling this method, otherwise an appropriate error code.

- virtual telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) stopLogCollection() = 0

    - Stops collecting the logs.

On platforms with access control enabled, caller needs to have TELUX\_DIAG\_OPS permission to invoke this API successfully.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Returns:

    - telux::common::ErrorCode::SUCCESS, if the log collection is stopped, telux::common::ErrorCode::NO\_EFFECT, if the log collection has already stopped, otherwise an appropriate error code.

- virtual telux::common::[ServiceStatus](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga7063b4a1071b6581022e30b730684e4d.html#_CPPv4N5telux6common13ServiceStatusE) getServiceStatus() = 0

    - Gets the diag log manager service status.

- Returns:

    - [telux::common::ServiceStatus::SERVICE\_AVAILABLE](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00060_1ga22f72b0f4dcf2e9569df17174c8d0dfc.html#a00060_1gga22f72b0f4dcf2e9569df17174c8d0dfcafcbb111f642c075be2582dcb12622ee8) if the service is ready, [telux::common::ServiceStatus::SERVICE\_UNAVAILABLE](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00060_1ga22f72b0f4dcf2e9569df17174c8d0dfc.html#a00060_1gga22f72b0f4dcf2e9569df17174c8d0dfcabe9852895a462e44f9529379538517cc) if the service is temporarily unavailable (possibly undergoing initialization), [telux::common::ServiceStatus::SERVICE\_FAILED](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00060_1ga22f72b0f4dcf2e9569df17174c8d0dfc.html#a00060_1gga22f72b0f4dcf2e9569df17174c8d0dfca209f41c5ed23fea99ebfa03068db90ae) if the service needs re-initialization

- virtual telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) startDrainingLogs() = 0

    - Drains logs from the circular buffer.

Applicable only for the circular buffering mode.

Until [IDiagLogManager::stopDrainingLogs](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00558_1a44a35848a0e13f17a5df756577608120) is called, logs will continue to be written to the circular buffer, getting flushed and provided to the application.

On platforms with access control enabled, caller needs to have TELUX\_DIAG\_OPS permission to invoke this API successfully.

Deprecated Use IDiagLogManager::drainPeripheralBuffer() instead

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Returns:

    - telux::common::ErrorCode::SUCCESS if the draining is started, telux::common::ErrorCode::INVALID\_STATE if there is no collection in progress, telux::common::ErrorCode::NO\_EFFECT if draining is already in progress, an appropriate error code in all other cases.

- virtual telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) stopDrainingLogs() = 0

    - Stops draining the logs and continues collecting them pushing into internal buffer.

Applicable only for the circular buffering mode.

On platforms with access control enabled, caller needs to have TELUX\_DIAG\_OPS permission to invoke this API successfully.

Deprecated This is no longer used.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Returns:

    - telux::common::ErrorCode::SUCCESS if the draining is stopped, telux::common::ErrorCode::INVALID\_STATE if there is no collection in progress, telux::common::ErrorCode::NO\_EFFECT if there is no draining in progress, an appropriate error code in all other cases.

- inline virtual ~IDiagLogManager()

    - Destructor for [IDiagLogManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00558).

- class DiagnosticsFactory

    - [DiagnosticsFactory](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00559) allows creation of [IDiagLogManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00558).

Public Functions

- virtual std::shared\_ptr&lt;[IDiagLogManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00558.html#_CPPv4N5telux8platform4diag15IDiagLogManagerE)&gt; getDiagLogManager(telux::common::[InitResponseCb](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1ab92f90010203f914a62cec6bd7af0a1a.html#_CPPv4N5telux6common14InitResponseCbE) callback = nullptr) = 0

    - Provides an [IDiagLogManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00558) instance that can be used for log collection.

- Parameters:

    - **callback** – **[in]** Optional, callback to know the status of the [IDiagLogManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00558) initialization

- Returns:

    - [IDiagLogManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00558) instance

Public Static Functions

- static [DiagnosticsFactory](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00559.html#_CPPv4N5telux8platform4diag18DiagnosticsFactoryE) &getInstance()

    - Gets a [DiagnosticsFactory](https://docs.qualcomm.com/doc/80-PF458-8/topic/diag.html#a00559) instance.

Private Functions

- DiagnosticsFactory(const [DiagnosticsFactory](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00559.html#_CPPv4N5telux8platform4diag18DiagnosticsFactory18DiagnosticsFactoryERK18DiagnosticsFactory)&) = delete

    - 

- [DiagnosticsFactory](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00559.html#_CPPv4N5telux8platform4diag18DiagnosticsFactoryE) &operator=(const [DiagnosticsFactory](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00559.html#_CPPv4N5telux8platform4diag18DiagnosticsFactoryE)&) = delete

    -

Last Published: May 20, 2026

[Previous Topic
telux::tel::INetworkSelectionListener](https://docs.qualcomm.com/bundle/publicresource/80-PF458-8/topics/net.md) [Next Topic
Location](https://docs.qualcomm.com/bundle/publicresource/80-PF458-8/topics/location.md)