OTA - Over-the-Air update management system for KOS devices.

The OTA model provides comprehensive management of software updates and artifacts on KOS devices, including real-time download progress tracking, installation management, and error handling. This model is essential for applications that need to manage software updates, display update status, and handle system maintenance operations.

Key Features

  • Real-Time Update Tracking - Live monitoring of download progress and installation status
  • Artifact Management - Complete visibility into available and installed software artifacts
  • Trouble Integration - Integration with KOS trouble system for error tracking and resolution
  • Status Monitoring - Comprehensive status tracking (downloading, pending, ready, error, idle)
  • Installation Control - Safe installation and reboot management for pending updates
  • Progress Reporting - Detailed download progress with size and percentage completion

Topic-Based Reactivity

The model listens to these KOS topics for real-time synchronization:

  • /kos/ota/artifacts/all - Complete artifact list updates from OTA service
  • /kos/ota/artifacts/changed - Incremental artifact status changes during downloads

Update States

  • idle - No updates in progress, system ready
  • downloading - Updates actively downloading from remote sources
  • pending - Updates downloaded and staged, ready for installation
  • ready - Updates installed and ready for use
  • error - Update process encountered errors, intervention needed

Common Use Cases

  • Update Status Dashboard - Display current update status and progress to users
  • System Maintenance - Manage scheduled updates and installations
  • Error Handling - Monitor and resolve update-related issues
  • Progress Monitoring - Track download progress for large artifacts
  • Installation Management - Control when updates are applied to minimize downtime

Example: Basic Usage

const otaModel = Ota.instance('system-updater').build();

// Access current update status and manage installations
console.log(otaModel.status); // 'idle' | 'downloading' | 'pending' | 'ready' | 'error'
if (otaModel.status === 'pending') {
otaModel.installAndReboot();
}

Use Declared Type

See

  • UpdaterOptions - Configuration options for OTA model
  • UpdaterItem - Individual update artifact interface
  • UpdaterStatus - Available update status types
  • OTAArtifactResponse - Raw artifact data from OTA service
  • TroubleContainer - Integrated trouble management system
interface OtaModel {
    id: string;
    installAndReboot(): void;
    handleAllArtifacts(artifacts): Promise<void>;
}

Methods

  • Installs pending updates and initiates system reboot. This method resolves the OTAUpdatePendingTrouble to trigger installation.

    Returns void

  • -------------------TOPIC-HANDLERS-----------------------

    Parameters

    • artifacts: OTAArtifactResponse[]

    Returns Promise<void>

Properties

id: string

Unique identifier for the model instance