PolarLoggingApi

public protocol PolarLoggingApi

Polar logging API.

Provides access to diagnostic and trace log files stored on a Polar device, as well as the device sensor data log configuration.

Requires feature PolarBleSdkFeature.feature_polar_file_transfer.

  • exportDeviceLogs(_:) Asynchronous

    Export all available diagnostic and trace log files from the device.

    The following files are attempted in order. Files that do not exist on the device are silently omitted from the result:

    • /ERRORLOG.BPB – Primary error log
    • /ERRORLO2.BPB – Secondary error log
    • /SYSLOG.TXT – System log
    • /TRC1.BIN, /TRC2.BIN, … – Device telemetry data. Files are fetched sequentially starting from index 1 until a file is not found.
    • /DBGTRC1.BIN, /DBGTRC2.BIN, … – Device debug trace data. Files are fetched sequentially starting from index 1 until a file is not found.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_polar_file_transfer

    Throws

    See PolarErrors for possible errors invoked.

    Declaration

    Swift

    func exportDeviceLogs(_ identifier: String) async throws -> [PolarDeviceLog]

    Parameters

    identifier

    Polar device ID or BT address

    Return Value

    List of PolarDeviceLog entries for all log files that exist on the device.

  • getLogConfig(_:) Asynchronous

    Get log configuration from a device (SDLOGS.BPB)

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_polar_device_control

    Throws

    See PolarErrors for possible errors invoked.

    Declaration

    Swift

    func getLogConfig(_ identifier: String) async throws -> LogConfig

    Parameters

    identifier

    Polar device ID or BT address

    Return Value

    LogConfig describing the current SD log configuration on the device.

  • Set log configuration to a device (SDLOGS.BPB)

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_polar_device_control

    Throws

    See PolarErrors for possible errors invoked.

    Declaration

    Swift

    func setLogConfig(_ identifier: String, logConfig: LogConfig) async throws

    Parameters

    identifier

    Polar device ID or BT address

    logConfig

    log configuration to write to the device.