Telematics SDK - API Reference
v1.63.0
|
Data Structures | |
struct | telux::platform::diag::DiagStatus |
union | telux::platform::diag::SourceInfo |
struct | telux::platform::diag::FileMethodConfig |
Represents the config relevant to File method. Logs are saved to a file under the directory specified by platform.diag.diag_output_log_path in tel.conf file. if Key does not exist, log will be stored in default location /tmp/diag. More... | |
struct | telux::platform::diag::DiagConfig |
class | telux::platform::diag::IDiagLogManager |
IDiagLogManager is a primary interface for Diagnostics. The interface offers APIs to configure log collection method (File or Callback) and configure log mode for selected method (streaming, threshold, or circular). The interface also provides APIs to start and stop diagnostics log collection in configured method and mode. More... | |
class | telux::platform::diag::IDiagListener |
class | telux::platform::diag::DiagnosticsFactory |
DiagnosticsFactory is the central factory to create Diagnostics manager class. More... | |
Typedefs | |
using | telux::platform::diag::Devices = uint8_t |
using | telux::platform::diag::Peripherals = uint8_t |
This section contains APIs related to diagnostics services.
struct telux::platform::diag::DiagStatus |
Current diagnostic status
Data Fields | ||
---|---|---|
LogMethod | logMethod |
Current successfully configured logging method |
bool | isLoggingInProgress |
True: If logging has already started. False otherwise |
bool | isLogDrainInProgress |
True: If log drain has already started. False otherwise |
union telux::platform::diag::SourceInfo |
Configure device(s) or peripheral(s) from which logs to be collected. Logging source can be either device level or peripheral level.
Data Fields | ||
---|---|---|
Devices | device |
telux::platform::diag::Device |
Peripherals | peripheral |
telux::platform::diag::Peripheral |
struct telux::platform::diag::FileMethodConfig |
Represents the config relevant to File method. Logs are saved to a file under the directory specified by platform.diag.diag_output_log_path in tel.conf file. if Key does not exist, log will be stored in default location /tmp/diag.
struct telux::platform::diag::DiagConfig |
Data Fields | ||
---|---|---|
SourceType | srcType | |
SourceInfo | srcInfo |
telux::platform::diag::SourceInfo. Based on the source type selected in DiagConfig.srcType, the corresponding field in DiagConfig.srcInfo would be valid. |
string | mdmLogMaskFile |
Optional - Full path to file that contains the MDM mask to filter logs. It is generated using QxDM and can be either cfg or cfg2 format. Needed only if logs are generated from MDM device or MDM peripherals |
string | eapLogMaskFile |
Optional - Full path to file that contains the EAP mask to filter logs. It is generated using QxDM and can be either cfg or cfg2 format. Needed only if logs are generated from EAP device or EAP peripherals |
DiagLogMode | modeType | |
LogMethod | method | |
union MethodConfig | methodConfig |
class telux::platform::diag::IDiagLogManager |
IDiagLogManager is a primary interface for Diagnostics. The interface offers APIs to configure log collection method (File or Callback) and configure log mode for selected method (streaming, threshold, or circular). The interface also provides APIs to start and stop diagnostics log collection in configured method and mode.
Public Member Functions | |
virtual DiagStatus | getStatus ()=0 |
virtual telux::common::Status | registerListener (std::weak_ptr< IDiagListener > listener)=0 |
virtual telux::common::Status | deregisterListener (std::weak_ptr< IDiagListener > listener)=0 |
virtual telux::common::ErrorCode | setConfig (const DiagConfig config)=0 |
virtual DiagConfig | getConfig ()=0 |
virtual telux::common::ErrorCode | startDrainingLogs ()=0 |
virtual telux::common::ErrorCode | stopDrainingLogs ()=0 |
virtual telux::common::ErrorCode | startLogCollection ()=0 |
virtual telux::common::ErrorCode | stopLogCollection ()=0 |
virtual | ~IDiagLogManager () |
|
virtual |
Destructor for IDiagLogManager
|
pure virtual |
Returns the current status of logging subsystem.
|
pure virtual |
Register a listener for specific events in the Diag log Manager like availability of logs, checking for unexpected error.
[in] | listener | Pointer of IDiagListener object that processes the notification |
|
pure virtual |
Removes a previously added listener.
[in] | listener | Pointer of IDiagListener object that needs to be removed |
|
pure virtual |
Sets the logging configurations.
This API must be called when logging is not in progress. Calling this API while logging has already started will return telux::common::ErrorCode::INVALID_STATE error. If error is returned, clients need to invoke the API again with the correct parameters.
On platforms with Access control enabled, Caller needs to have TELUX_DIAG_OPS permission to invoke this API successfully.
[in] | config | telux::platform::diag::DiagConfig |
|
pure virtual |
Get current configuration settings
|
pure virtual |
Starts draining the logs from the circular buffer. Until telux::platform::diag::stopDrainingLogsLogs is called, logs will continue to be written to circular buffer, getting flushed and written to log file or provided to client via telux::platform::diag::IDiagListener::onAvailableLogs based on selected logging method telux::platform::diag::LogMethod. If this API is called while logging has not started, telux::common::ErrorCode::INVALID_STATE error is returned. Attempt to call this API while draining log is already in progress, will not affect the state of logging and will return telux::common::ErrorCode::NO_EFFECT error.
This API should be used only in circular buffering mode.
On platforms with Access control enabled, Caller needs to have TELUX_DIAG_OPS permission to invoke this API successfully.
|
pure virtual |
Stops the draining of logs and continues collecting logs in circular buffer mode. This API should be used only in circular buffering mode. If this API is called while logging has not started telux::common::ErrorCode::INVALID_STATE error is returned. Attempt to call this API while draining log is not in progress, will not affect the state of logging and will return telux::common::ErrorCode::NO_EFFECT error.
On platforms with Access control enabled, Caller needs to have TELUX_DIAG_OPS permission to invoke this API successfully.
|
pure virtual |
Start the Log collection session This API starts the log collection. It is expected the configuration to be set successfully via telux::platform::diag::IDiagLogManager::setConfig before calling this API. Calling this API after logging has already started will not affect logging state and will return telux::common::ErrorCode::NO_EFFECT error.
On platforms with Access control enabled, Caller needs to have TELUX_DIAG_OPS permission to invoke this API successfully.
|
pure virtual |
Stop the Log collection session
On platforms with Access control enabled, Caller needs to have TELUX_DIAG_OPS permission to invoke this API successfully.
class telux::platform::diag::IDiagListener |
Interface for Diag listener object. Client needs to implement this interface to get access to diag log service notifications like onAvailableLogs, onError.
The methods in listener can be invoked from multiple different threads. The implementation should be thread safe.
The notification delivery mechanism uses the same thread to deliver all the queued notifications to ensure they are delivered in order. Considering this, the thread on which the notifications are delivered should not be blocked for longer operations since this would result in delay in delivery of further notifications that are in the queue waiting to be dispatched.
Public Member Functions | |
virtual void | onAvailableLogs (uint8_t *ptr, int len) |
virtual | ~IDiagListener () |
|
virtual |
Destructor for IDiagListener
|
virtual |
Invoked when logs are available in callback method to when they are available.
[in] | ptr | Pointer to the log data |
[in] | len | Length of the data |
class telux::platform::diag::DiagnosticsFactory |
DiagnosticsFactory is the central factory to create Diagnostics manager class.
Public Member Functions | |
virtual std::shared_ptr< IDiagLogManager > | getDiagLogManager (telux::common::InitResponseCb clientCallback=nullptr)=0 |
Static Public Member Functions | |
static DiagnosticsFactory & | getInstance () |
Protected Member Functions | |
DiagnosticsFactory () | |
virtual | ~DiagnosticsFactory () |
|
protected |
|
protectedvirtual |
|
static |
Get Diagnostics Factory instance.
|
pure virtual |
Get Diagnostics Manager
using telux::platform::diag::Devices = typedef uint8_t |
using telux::platform::diag::Peripherals = typedef uint8_t |
This is a bitmask which takes the peripherals from telux::platform::diag::PeripheralType using Peripheral.
|
strong |
Specifies the mode of logging to be used (Streaming, threshold, circular buffer)
Enumerator | |
---|---|
STREAMING |
Logs are flushed immediately from the buffer when available. Logs are saved to a file (in file method) or passed to the client in real time through listener IDiagListener::onAvailableLogs() (in callback method) |
THRESHOLD |
Can be used to conserve power. Logs are flushed out when the buffer is full. This is only applicable to peripherals with its own buffer such as Modem DSP. It is not recommended to enable too many logs in logmask file passed to telux::platform::diag::setConfig API. Too many logs will cause frequent processor wake ups and consequently result in the threshold being crossed and logs being flushed frequently resembling streaming mode. |
CIRCULAR_BUFFER |
Can be used to conserve power. Logs are continuously written to a buffer until client triggers buffer drain command to collect the logs. This is only applicable to peripherals with its own buffer such as Modem DSP. Old logs are overwritten when buffer is full. Logs in the buffer will be flushed only upon client's request. |
Enables log collection from selected device(s) which includes logs from Integrated AP and all peripherals on the device. Note: If device logging is enabled, peripheral logging must be disabled.
Enables log collection from selected peripheral (if it exists) and/or application processor in the device where the client of the API is running. Note: If peripheral logging is enabled, device logging must be disabled.
|
strong |
Diagnostic logging methods. Only one logging method can be selected
Enumerator | |
---|---|
NONE |
No valid logging method |
FILE |
File logging method. Collected Logs will be saved to file located under platform.diag.diag_output_log_path key in tel.conf file or under /tmp/diag if such key does not exist |
CALLBACK |
Callback logging method. Collected logs are provided to clients via telux::platform::diag::IDiagListener::onAvailableLogs |
|
strong |
Diagnostic log source. When device level logging is selected from telux::platform::diag::Device and logs from all peripherals in such device will be collected. When peripheral logging is selected from telux::platform::diag::Peripheral, logs from selected peripherals will be collected.
Enumerator | |
---|---|
NONE |
No valid logging source |
DEVICE |
Device level logging source. |
PERIPHERAL |
Peripheral level logging source |