# Supported RPC Methods

## Overview

In this article we will discuss about the supported TR-069 standard RPCs.
The following tables provides a summary of all methods, and indicates the conditions under which implementation of each RPC method defined in Annex A is `REQUIRED` or `OPTIONAL`.

### Methods for CPE responding

| Method name              | CPE requirement | Supported |
| ------------------------ | --------------- | --------- |
| `GetRPCMethods`          | `REQUIRED`      | `Yes`     |
| `SetParameterValues`     | `REQUIRED`      | `Yes`     |
| `GetParameterValues`     | `REQUIRED`      | `Yes`     |
| `GetParameterNames`      | `REQUIRED`      | `Yes`     |
| `SetParameterAttributes` | `REQUIRED`      | `Yes`     |
| `GetParameterAttributes` | `REQUIRED`      | `Yes`     |
| `AddObject`              | `REQUIRED`      | `Yes`     |
| `DeleteObject`           | `REQUIRED`      | `Yes`     |
| `Reboot`                 | `REQUIRED`      | `Yes`     |
| `Download`               | `REQUIRED`      | `Yes`     |
| `ScheduleDownload`       | OPTIONAL        | `Yes`     |
| `Upload`                 | OPTIONAL        | `Yes`     |
| `FactoryReset`           | OPTIONAL        | `Yes`     |
| `GetQueuedTransfers`     | OPTIONAL        | No        |
| `GetAllQueuedTransfers`  | OPTIONAL        | No        |
| `CancelTransfer`         | OPTIONAL        | `Yes`     |
| `ScheduleInform`         | OPTIONAL        | `Yes`     |
| `ChangeDUState`          | OPTIONAL        | `Yes`     |
| `SetVouchers`            | OPTIONAL        | No        |
| `GetOptions`             | OPTIONAL        | No        |


### Methods for CPE calling

| Method name                       | CPE requirement | Supported |
| --------------------------------- | --------------- | --------- |
| `GetRPCMethods`                   | OPTIONAL        | `Yes`     |
| `Inform`                          | `REQUIRED`      | `Yes`     |
| `TransferComplete`                | `REQUIRED`      | `Yes`     |
| `AutonomousTransferComplete`      | OPTIONAL        | `Yes`     |
| `DUStateChangeComplete`           | OPTIONAL        | `Yes`     |
| `AutonomousDUStateChangeComplete` | OPTIONAL        | `Yes`     |
| `RequestDownload`                 | OPTIONAL        | No        |
| `Kicked`                          | OPTIONAL        | No        |

## Download File Types

The `Download` RPC accepts a `FileType` string that controls how the transferred file is applied.

### Standard file types

| FileType string               | Supported | Post-download action                                  |
| ----------------------------- | --------- | ----------------------------------------------------- |
| `1 Firmware Upgrade Image`    | `Yes`     | Reboot (`FirmwareUpgrade`)                            |
| `2 Web Content`               | `Yes`     | None                                                  |
| `3 Vendor Configuration File` | `Yes`     | Reboot (`VendorConfigApply`)                          |
| `4 Tone File`                 | No        | —                                                     |
| `5 Ringer File`               | No        | —                                                     |
| `6 Stored Firmware Image`     | `Yes`     | None (image written to secondary bank, no reboot)     |

> Note: With '3 Vendor Configuration File' currently an uci export file or opconf both can be pushed, icwmp auto-detect the file and handles it accordingly.
> Opconf when installed with '3 Vendor Configuration File' filetype, installed in primary persistent area, so it's gets deleted with factory reset or with upgrade via 'X GENEXIS-EU UPGRADE-WITH-NOCONF'

### Extended file types (opconf)

These file types are only available when icwmp is built with `ICWMP_ENABLE_OPCONF_SUPPORT`.

| FileType string                            | Description                                                        | Post-download action                                                   |
| ------------------------------------------ | ------------------------------------------------------------------ | ---------------------------------------------------------------------- |
| `X GENEXIS-EU UPGRADE-WITH-NOCONF`         | Firmware upgrade — factory-reset configuration on boot             | Reboot (`FirmwareUpgrade`)                                             |
| `X GENEXIS-EU UPGRADE-WITH-USERCONF`       | Firmware upgrade — preserve user-scoped configuration (`UserOnly`) | Reboot (`FirmwareUpgrade`)                                             |
| `X GENEXIS-EU UPGRADE-WITH-FULLCONF`       | Firmware upgrade — preserve all configuration (`All`)              | Reboot (`FirmwareUpgrade`)                                             |
| `X GENEXIS-EU OPERATOR-CONFIGURATION-FILE` | Install an operator configuration file via the `opconf` service    | None (operator is expected to trigger factory reset separately)        |

### Accepted file formats for `OPERATOR-CONFIGURATION-FILE`

The file format is detected by content signature, not by file extension:

| Format   | Detection                          |
| -------- | ---------------------------------- |
| JSON     | File starts with `{` or `[`        |
| TAR      | `ustar` magic at byte offset 257   |
| TAR.GZ   | `0x1f 0x8b` magic bytes at offset 0 |
