{"id":46283240,"url":"https://github.com/renesas/synced","last_synced_at":"2026-03-04T06:19:00.838Z","repository":{"id":103100662,"uuid":"511713880","full_name":"renesas/synced","owner":"renesas","description":"synced is a user space Synchronous Ethernet (Sync-E) stack for the Linux operating system. synced facilitates Sync-E, according to the ITU-T G.8264 (08/2017) Amd. 1 (03/2018) and ITU-T G.781 (04/2020) Amd. 1 (11/2022) standards.","archived":false,"fork":false,"pushed_at":"2025-02-05T19:42:03.000Z","size":317,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-05T20:47:31.455Z","etag":null,"topics":["c","linux","networking","synce","synchronization","telecommunications"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/renesas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-08T00:34:46.000Z","updated_at":"2025-02-05T19:38:20.000Z","dependencies_parsed_at":"2023-07-26T04:16:07.494Z","dependency_job_id":"cbbc7917-7d2c-40ee-9aa2-a6419cc0edc2","html_url":"https://github.com/renesas/synced","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/renesas/synced","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renesas%2Fsynced","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renesas%2Fsynced/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renesas%2Fsynced/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renesas%2Fsynced/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renesas","download_url":"https://codeload.github.com/renesas/synced/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renesas%2Fsynced/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30074046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","linux","networking","synce","synchronization","telecommunications"],"created_at":"2026-03-04T06:19:00.264Z","updated_at":"2026-03-04T06:19:00.823Z","avatar_url":"https://github.com/renesas.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"@file README.md\n\u003cbr\u003e@note Copyright (C) [2021-2025] `Renesas Electronics Corporation` and/or its affiliates\n\u003cbr\u003eThis program is free software; you can redistribute it and/or modify\n\u003cbr\u003eit under the terms of the GNU General Public License version 2, as published by\n\u003cbr\u003ethe Free Software Foundation.\n\u003cbr\u003e\n\u003cbr\u003eThis program is distributed in the hope that it will be useful,\n\u003cbr\u003ebut WITHOUT ANY WARRANTY; without even the implied warranty of\n\u003cbr\u003eMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\u003cbr\u003eGNU General Public License for more details.\n\u003cbr\u003e\n\u003cbr\u003eYou should have received a copy of the GNU General Public License along\n\u003cbr\u003ewith this program; if not, write to the Free Software Foundation, Inc.,\n\u003cbr\u003e51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n***\nRelease Tag: 2-0-9\n\u003cbr\u003ePipeline ID: 450408\n\u003cbr\u003eCommit Hash: 3898adc5\n***\n\n# `synced` 2-0-9 README\n\n`synced` is a user space Synchronous Ethernet (Sync-E) stack for the Linux operating system.\n\nThis README is written in Markdown. Although most editors can be used to view it, it is best viewed\nwhen using a Markdown-compatible editor.\n\n`synced` is copyrighted by `Renesas Electronics Corporation` and is licensed under the GNU General\nPublic License. See the file COPYING for the license terms.\n\n`synced` can be downloaded from https://github.com/renesas/synced.\n\nIf you encounter any issues, have questions, or find bugs, please raise an issue through the GitHub\nIssues interface. If you have a fix or improvement, feel free to submit a pull request. All\ncontributions are welcome.\n\n---\n\n## Table of Contents\n\n- [1 Overview](#1_overview)\n- [2 Modules](#2_modules)\n- [3 Makefile](#3_makefile)\n- [4 Configuration](#4_configuration)\n- [5 Management API](#5_management_api)\n- [6 `synced_cli`](#6_synced_cli)\n- [7 `pcm4l`](#7_pcm4l)\n\n---\n\n\u003ca name=\"1_overview\"\u003e\u003c/a\u003e\n## 1. Overview\n\n`synced` facilitates Sync-E according to the ITU-T G.8264 (08/2017) Amd. 1 (03/2018) and ITU-T\nG.781 (04/2020) Amd. 1 (11/2022) standards.\n\nAccompanying `synced` is `synced_cli`, which is a command-line interface (CLI) that lets the user\ndynamically manage `synced`. `synced` interfaces with `synced_cli` via a TCP/IP socket.\n\n`synced` can also interface with `Renesas Electronics Corporation PTP Clock Manager for Linux`\n(`pcm4l`), a high-performance clock recovery solution for packet-based frequency and phase\nsynchronization, which can be downloaded from https://www.renesas.com. `synced` interfaces with\n`pcm4l` via a TCP/IP socket as well.\n\n`synced` consists of the following modules:\n\n 1. **Configuration Module**\n 2. **Control Module**\n 3. **Device Module**\n 4. **ESMC Module**\n 5. **Management Module**\n 6. **Monitor Module**\n\n`synced` defines four types of ports:\n\n 1. **Sync-E Clock Port**\n     - A **Sync-E Clock Port** is associated with an actual device input. It must be assigned\n       a clock index, a priority, and an initial quality level (QL).\n 2. **Sync-E Monitoring Port**\n     - A **Sync-E Monitoring Port**  is not associated with a device input and is only used to\n       monitor the QL of its associated Sync-E clock, i.e., it is not considered in the clock\n       selection process. It can be converted into a **Sync-E Clock Port** using the **Management\n       API**. It must be assigned a priority and an initial QL.\n 3. **External Clock Port**\n     - A **External Clock Port**  is associated with an actual device input but is not\n       Sync-E-capable, i.e., it does not transmit or receive ESMC PDUs. Its QL can be dynamically\n       set using the **Management API**. It must be assigned a clock index, a priority, and an\n       initial QL.\n 4. **Sync-E TX Only Port**\n    - A **Sync-E TX Only Port**  is not RX-capable. It is only used to advertise the current\n      QL, does not participate in the clock selection process, and has an optional TX bundle\n      number parameter. It must not be assigned any other parameters.\n\nThe **Control Module** manages the sync table and, thus, refers to a port as a sync. The number of\nsyncs is limited by the compile-time macro **MAX_NUM_OF_SYNC_ENTRIES**, defined in the\ncommon/common.h header file and is set to 64 by default. The user may change this value, but the\nnew value cannot exceed 64.\n\n**Sync-E Clock Ports**, **Sync-E Monitoring Ports**, and **Sync-E TX Only Ports** are ESMC-capable,\ni.e., they can execute the ESMC protocol and send and/or receive ESMC protocol data units (PDUs).\nAn **External Clock Port** is not ESMC-capable. The number of ESMC-capable ports is limited by the\ncompile-time macro **ESMC_MAX_NUMBER_OF_PORTS**, defined in the esmc/esmc_adaptor/esmc_adaptor.h\nheader file and set to 32 by default. The user may change this value, but it cannot exceed the\nvalue of the compile-time macro **MAX_NUM_OF_SYNC_ENTRIES**.\n\n`synced` supports a mode called **No QL Mode**. If enabled, the clock selection process is based on\npriority. However, only valid clocks participate in the selection process. For example,\nif a **Sync-E Clock Port**  has a port link down or RX timeout condition, it will be excluded from\nthe selection process regardless of its assigned priority.\n\nWhen there are no valid Sync-E clocks, the device selects the local oscillator (LO)\nas the best clock. In this case, the current will be equal to the configured LO\nQL.\n\n`synced` provides a timer called **Holdover Timer** to facilitate a gradual transition\nfrom the superior QL associated with a valid Sync-E clock to the QL of the LO when\nthe Sync-E clock becomes invalid.\n\n\u003ca name=\"2_modules\"\u003e\u003c/a\u003e\n## 2. Modules\n\n### 2.1 Configuration\nThe **Configuration Module** enables static configuration of `synced` by loading a configuration\nfile. A configuration file must be specified.\n\n### 2.2 Control\nThe **Control Module** selects the best Sync-E clock for the device through a clock selection\nalgorithm. It also manages the following TX and RX event callbacks:\n\n - TX events\n   - Port link up (E_esmc_event_type_port_link_up)\n   - Port link down (E_esmc_event_type_port_link_down)\n\n - RX events\n   - Invalid received QL (E_esmc_event_type_invalid_rx_ql)\n   - QL change (E_esmc_event_type_ql_change)\n   - RX timeout (E_esmc_event_type_rx_timeout)\n   - Port link up (E_esmc_event_type_port_link_up)\n   - Port link down (E_esmc_event_type_port_link_down)\n   - Immediate timing loop(E_esmc_event_type_immediate_timing_loop)\n   - Originator clock timing loop (E_esmc_event_type_originator_timing_loop)\n\n### 2.3 Device\nThe **Device Module** manages the timing device. By default, `synced` is built to target a generic\ndevice. However, `synced` can also be built to target a `Renesas Synchronization Management Unit`\n(RSMU) device. An RSMU device is a character device that can communicate with a variety of `Renesas\nElectronics Corporation` timing devices, such as the `Renesas Electronics Corporation ClockMatrix`\ntiming device. The RSMU driver can be downloaded from\nhttps://github.com/renesas/linux-ptp-driver-package.\n\n`synced` requires the device to support an automatic reference priority table.\n\nThe **Device Module** can support different devices by way of the device adaptor.\nThe device adaptor supports callbacks that execute device-specific routines.\n\nThe device adaptor supports the following callbacks:\n\n - Initialize device\n   - **device_adaptor_call_init_device_cb()**\n - Get the current clock index of Sync-E DPLL\n   - **device_adaptor_call_get_current_clk_idx_cb()**\n - Set Sync-E DPLL clock priorities\n   - **device_adaptor_call_set_clock_priorities_cb()**\n - Get reference monitor status of the specified clock\n   - **device_adaptor_call_get_reference_monitor_status_cb()**\n - Get Sync-E DPLL state\n   - **device_adaptor_call_get_synce_dpll_state_cb()**\n - Deinitialize device\n   - **device_adaptor_call_deinit_device_cb()**\n\nThe Sync-E DPLL can be in the following states:\n\n - Freerun (E_device_dpll_state_freerun)\n - Lock acquisition-recovery (E_device_dpll_state_lock_acquisition_recovery)\n - Locked (E_device_dpll_state_locked)\n - Holdover (E_device_dpll_state_holdover)\n\nFor systems where the received Sync-E clocks are directly connected to the clock inputs of the\ndevice, only the configuration file must be modified. However, `synced` also supports\nexternal multiplexers (muxes) that connect clocks associated with different Ethernet ports to a\nsingle clock input. To use this feature, set the compile-time macro\n**ENABLE_EXTERNAL_MUX_CONTROL** to 1 and define the mux using the **g_external_mux_table**\nstructure in the management/management.c source file. While four muxes are specified in the\nexample, the code should be changed to match the system hardware. The user must also implement\nfunctions to change the mux under the control of synced, replacing the following comments:\n\n - /* Call the function to select port 'primary_port_idx' on mux mux_idx here */\n - /* Call the function to select port 'secondary_port_idx' on mux mux_idx here */\n\n### 2.4 ESMC\nThe **ESMC Module** implements the ESMC protocol at the stack level. ESMC PDUs containing QLs are\ntransmitted and received by TX-capable and RX-capable Sync-E ports, respectively. The TX-capable\nports are used to advertise the current QL of the device, except for the current best port, which\nadvertises the QL-DNU and QL-DUS for network options 1 and 2, respectively. The **ESMC Module** can\nsupport different ESMC stacks by way of the ESMC adaptor.\n\n### 2.5 Management\nThe **Management Module** includes the **Management API**. In addition to Sync-E clocks,\n`synced` supports external clocks like GPS, which can be managed using the **Management API**.\n\n### 2.6 Monitor\nThe **Monitor Module** keeps track of the current QL, current Sync-E DPLL state,\nand current clock. It also operates the holdover timer.\n\n\u003ca name=\"3_makefile\"\u003e\u003c/a\u003e\n## 3. Makefile\n\nMakefile commands can only be executed while in the root directory.\n\n - Enter **make all** to clean the existing build artifacts and build `synced` and\n   `synced_cli`.\n - Enter **make clean** to clean the existing `synced` and `synced_cli` build artifacts.\n - Enter **make help** to display the available Makefile commands.\n - Enter **make synced** to only build the `synced` binary executable.\n - Enter **make synced_cli** to only build `synced_cli` binary executable.\n\nTo build `synced`, the user must consider the following build arguments:\n\n - **ESMC_STACK**; default: renesas\n - **PLATFORM**; default: amd64\n - **DEVICE**; default: generic\n - **SYNCED_DEBUG_MODE**; default: 0\n\nWhen building `synced` via the **make all** or **make synced** commands, the Makefile\nwill set the build arguments to their default values.\n\nTo build `synced` to target an RSMU device, set the build argument **DEVICE** to rsmu.\nThis assumes the user has already installed the RSMU driver. Below is an example of a build command\nto build `synced` to target an RSMU device.\n\n - Command to build `synced` using the  ESMC stack, targeting a platform with arm64\n   architecture, targeting an RSMU, and enabling debug mode:\n   - **make synced ESMC_STACK=renesas PLATFORM=arm64 DEVICE=rsmu SYNCED_DEBUG_MODE=1**\n\nOther things to note when running `synced` with an RSMU device:\n\n - Set the **[device_name]** parameter in the configuration file to the name of the character device\n   associated with the RSMU device\n - Load the device configuration file associated with the RSMU device prior to starting\n   `synced` using the RSMU driver\n\nAs mentioned earlier, by default, `synced` is built to target a generic device, i.e., a device of\nthe user's choosing, because the build argument **DEVICE** is set to generic by default. Below is an\nexample of a build command to build `synced` to target a generic device.\n\n - Command to build `synced` using the  ESMC stack, targeting a platform with amd64\n   architecture, targeting a generic device, and disabling debug mode:\n   - **make synced ESMC_STACK=renesas PLATFORM=amd64 DEVICE=generic SYNCED_DEBUG_MODE=0**\n\nOther things to note when running `synced` with a generic device:\n\n - Register the device adaptor callbacks (described in section 2.3) with the appropriate functions,\n   as by default, `synced` registers the device adaptor callbacks with template functions, e.g.,\n   generic_template_init_device(), generic_template_get_current_clk_idx(), etc.\n - Specify the device configuration file associated with the generic device using the\n   **[device_cfg_file]** parameter in the configuration file, as `synced` will load the specified\n   device configuration file during startup\n - Replace the function generic_config_device_helper with the appropriate device configuration file\n   loader function, as the function generic_config_device_helper() is just a dummy function\n\nThe Makefile also supports the **CROSS_COMPILE**, **USER_CFLAGS**, and **USER_LDFLAGS**\nbuild arguments. **CROSS_COMPILE** can be used to set the compiler-compiler.\n\n\u003ca name=\"4_configuration\"\u003e\u003c/a\u003e\n## 4. Configuration\n\n### 4.1 Rules\n\n`synced` will terminate if any of the following configuration rules are broken:\n\n - Configuration parameters are case-sensitive.\n - Comments can be added to the configuration file but must be placed\n   above the line containing the configuration parameter and its corresponding setting.\n - The configuration file supports two types of sections: global and port. Each port\n   needs to be configured separately and requires its own port section.\n - Port names must be unique.\n - Clock index assignments must be unique.\n - Priority assignments must be unique.\n - A TX bundle number can be assigned if the Sync-E port is TX-capable.\n - When parameters are not specified, their default values will be applied.\n\n### 4.2 Global Configuration\n\n- Global section:\n  - ESMC network option **[net_opt]**\n    - Default: 1 (network option 1)\n    - Range: 1-3\n      - 1: network option 1\n      - 2: network option 2\n      - 3: network option 3\n  - No quality level mode **[no_ql_en]**\n    - Default: 0 (disabled)\n    - Range: 0-1\n  - Sync-E port forced quality level mode enable **[synce_forced_ql_en]**\n    - Default: 0 (disabled)\n    - Range: 0-1\n    - Description:\n      - If enabled, forced QL mode support is extended to **Sync-E Clock Ports** and **Sync-E\n        Monitoring Ports**\n      - If disabled, forced QL support is limited to **External Clock Ports**\n  - Local oscillator quality level **[lo_ql]**\n    - Default: \"FAILED\" (QL-FAILED)\n    - Range:\n      - Network option 1 (highest to lowest)\n        - ePRTC\n        - PRTC\n        - ePRC\n        - PRC\n        - SSUA\n        - SSUB\n        - eSEC\n        - SEC\n        - DNU\n        - INV0\n        - INV1\n        - INV3\n        - INV5\n        - INV6\n        - INV7\n        - INV9\n        - INV10\n        - INV12\n        - INV13\n        - INV14\n        - NSUPP\n        - UNC\n        - FAILED\n      - Network option 2 (highest to lowest)\n        - ePRTC\n        - PRTC\n        - ePRC\n        - PRS\n        - STU\n        - ST2\n        - TNC\n        - ST3E\n        - eEEC\n        - ST3\n        - SMC\n        - ST4\n        - PROV\n        - DUS\n        - INV2\n        - INV3\n        - INV5\n        - INV6\n        - INV8\n        - INV9\n        - INV11\n        - NSUPP\n        - UNC\n        - FAILED\n  - Local oscillator priority **[lo_pri]**\n    - Default: 255\n    - Range: 0-255 (highest to lowest)\n  - Maximum message level **[max_msg_lvl]**\n    - Default: 7\n    - Range: 0-7 (lowest to highest)\n      - 0: LOG_EMERG\n      - 1: LOG_ALERT\n      - 2: LOG_CRIT\n      - 3: LOG_ERR\n      - 4: LOG_WARNING\n      - 5: LOG_NOTICE\n      - 6: LOG_INFO\n      - 7: LOG_DEBUG\n  - stdout enable **[stdout_en]**\n    - Default: 1 (enabled)\n    - Range: 0-1\n  - syslog enable **[syslog_en]**\n    - Default: 0 (disabled)\n    - Range: 0-1\n  - Device configuration file path **[device_cfg_file]**\n    - Description:\n      - Applicable for generic device\n  - Device name **[device_name]**\n    - Default: /dev/rsmu1\n  - Sync-E DPLL index **[synce_dpll_idx]**\n    - Default: 0\n    - Range: 0-7\n  - Holdover quality level **[holdover_ql]**\n    - Default: \"FAILED\" (QL-FAILED)\n    - Range: same as local oscillator quality level\n    - Must be equal to or better than the local oscillator quality level\n  - Holdover timer in seconds **[holdover_tmr]**\n    - Default: 300\n    - Range: 0-signed 32-bit integer maximum\n  - Hold-off timer in milliseconds **[hoff_tmr]**\n    - Default: 300\n    - Range: 0-signed 16-bit integer maximum\n  - Wait-to-restore timer in seconds **[wtr_tmr]**\n    - Default: 300\n    - Range: 0-signed 16-bit integer maximum\n  - Advanced holdover enable **[advanced_holdover_en]**\n    - Default: 0\n    - Range: 0-1\n    - Description:\n      - If enabled, the holdover timer does not expire when the Sync-E DPLL transitions to the lock\n        acquisition-recovery state.\n  - **`pcm4l` Interface** enable **[pcm4l_if_en]**\n    - Default: 0 (disabled)\n    - Range: 0-1\n    - Description:\n      - If enabled, the communication path between `synced` and `pcm4l` will\n        be set up (set **[pcm4l_if_ip_addr]** and **[pcm4l_if_port_num]** to the appropriate\n        values). This interface is used to send the physical clock category to `pcm4l`\n  - **`pcm4l` Interface** IP address **[pcm4l_if_ip_addr]**\n    - Example: 127.0.0.1\n  - **`pcm4l` Interface** port number **[pcm4l_if_port_num]**\n    - Default: 2400\n    - Range: 1024-unsigned 16-bit integer maximum\n  - **Management Interface** enable **[mng_if_en]**\n    - Default: 0 (disabled)\n    - Range: 0-1\n    - Description:\n      - If enabled, the communication path between `synced` and `synced_cli` will\n        be set up (set **[mng_if_ip_addr]** and **[mng_if_port_num]** to the appropriate\n        values)\n  - **Management Interface** IP address **[mng_if_ip_addr]**\n    - Example: 127.0.0.2\n  - **Management Interface** port number **[mng_if_port_num]**\n    - Default: 2400\n    - Range: 1024-unsigned 16-bit integer maximum\n\n### 4.3 Port Configuration\n\n- Port section (per port):\n  - Name **[name]**\n    - Maximum 16 characters in length, including the NULL character\n  - Clock index **[clk_idx]**\n    - Default: -1 (-1 indicates **Sync-E TX Only Port** or **Sync-E Monitoring Port**)\n    - Range: 0-31\n    - Description:\n      - Do not specify a clock index for **Sync-E TX Only Ports** and **Sync-E Monitoring Ports**.\n        The clock index will be set to -1 internally.\n  - Priority **[pri]**\n    - Default: 255\n    - Range: 0-255 (highest to lowest)\n  - TX enable **[tx_en]**\n    - Default: 0 (disabled)\n    - Range: 0-1\n  - RX enable **[rx_en]**\n    - Default: 0 (disabled)\n    - Range: 0-1\n  - Initial QL **[init_ql]**\n    - Default: depends on network option: 1-\"DNU\"; 2-\"DUS\"; 3-\"SEC\"\n    - Range: same as local oscillator quality level\n  - TX bundle number **[tx_bundle_num]**\n    - Default: -1 (disabled/no bundle)\n    - Range: -1-255\n    - Description:\n      - The Sync-E port must be TX-capable (set **[tx_en]** to 1) for this parameter\n        to have merit\n      - This parameter allows the grouping of TX-capable ports to avoid timing loops,\n        i.e., only the best port will advertise the QL, and the others will advertise\n        the appropriate do-not-use QL)\n\n\u003ca name=\"5_management_apis\"\u003e\u003c/a\u003e\n## 5. **Management API**\n\nThe following generic APIs are supported:\n\n - Get a sync information list of all the configured **Sync-E Clock Ports**, **Sync-E Monitoring\n   Ports**, **External Clock Ports**, and **Sync-E TX Only Ports**\n   - **management_get_sync_info_list()**\n - Get the current status (QL, selected port name, selected clock index, Sync-E DPLL\n   state and holdover remaining time)\n   - **management_get_current_status()**\n - Get the sync information for the specified **Sync-E Clock Port**, **Sync-E Monitoring Port**, or\n   **External Clock Port**\n   - **management_get_sync_info()**\n - Set the forced QL for specified **Sync-E Clock Port**, **Sync-E Monitoring Port**, or **External\n   Clock Port**\n   - **management_set_forced_ql()**\n - Clear the forced QL for the specified **Sync-E Clock Port**, **Sync-E Monitoring Port**, or\n   **External Clock Port**\n   - **management_clear_forced_ql()**\n - Clear the holdover timer\n   - **management_clear_holdover_timer()**\n - Clear the wait-to-restore timer for the specified **Sync-E Clock Port** name\n   - **management_clear_synce_clk_wtr_timer()**\n - Assign a new **Sync-E Clock Port** for the specified clock index\n   - **management_assign_new_synce_clk_port()**\n - Set the priority for the specified port name\n   - **management_set_pri()**\n - Set the max message level\n   - **management_set_max_msg_level()**\n\nThese APIs can be invoked using `synced_cli`.\n\nThe following callbacks are supported:\n\n - Notification for the current QL and selected port name\n   - **management_call_notify_current_ql_cb()**\n - Notification for the current QL of the specified **Sync-E Clock Port** or **Sync-E Monitoring\n   Port**\n   - **management_call_notify_sync_current_ql_cb()**\n - Notification for the current Sync-E DPLL state\n   - **management_call_notify_synce_dpll_current_state_cb()**\n - Notification for the current clock state of the specified **Sync-E Clock Port** or **External\n   Clock Port**\n   - **management_call_notify_sync_current_clk_state_cb()**\n - Notification for the current state of the specified **Sync-E Clock Port**, **Sync-E Monitoring\n   Port**, or **External Clock Port**\n   - **management_call_notify_sync_current_state_cb()**\n - Notification for the timing loop or invalid received QL alarm\n   - **management_call_notify_alarm_cb()**\n - Notification for the `pcm4l` connection status change\n   - **management_call_notify_pcm4l_connection_status_cb()**\n\nUnless the user registers their own callback functions, template functions will\nbe registered in their place.\n\n\u003ca name=\"6_synced_cli\"\u003e\u003c/a\u003e\n## 6. `synced_cli`\n\nAs mentioned earlier, `synced_cli` lets the user execute the generic **Management API**\ndynamically. `synced` connects to `synced_cli` via a dedicated TCP/IP socket\ninterface, whose parameters must be specified in the configuration file.\n\n### 6.1 Supported Modes\n\n`synced_cli` supports two modes of operation:\n 1. Interactive mode\n 2. Command-line mode\n\n`synced_cli` supports the following **Management API** commands:\n\n\t- [0: Get sync info list (get_sync_info_list)\n\t- [1]: Get current status (get_current_status)\n\t- [2]: Get sync info (get_sync_info)\n\t- [3]: Set forced QL (set_forced_ql)\n\t- [4]: Clear forced QL (clear_forced_ql)\n\t- [5]: Clear holdover timer (clear_holdover_timer)\n\t- [6]: Clear Sync-E clock wait-to-restore timer (clear_synce_clk_wtr_timer)\n\t- [7]: Assign new Sync-E clock port (assign_new_synce_clk_port)\n\t- [8]: Set priority (set_pri)\n\t- [9]: Set max message level (set_max_msg_lvl)\n\n- Note 1: In interactive mode, enter the code in the square brackets on the left.\n- Note 2: In command-line mode, enter the code in the square brackets on the left or the string in\n  parentheses on the right.\n\n### 6.2 Interactive Mode\n\n- `synced_cli` runs continuously until the `exit` command is entered by the user\n- `synced_cli` prints a list of the supported commands and the codes and strings associated with\n  them, when the `help` is entered by the user\n- The user must enter the appropriate **Management API** codes\n- Example: synced_cli 127.0.0.2 2400 1\n  - 127.0.0.2 specifies the IP address of the **Management Interface** of the `synced` application\n  - 2400 specifies the port number of the **Management Interface** of `synced` application,\n  - 1 specifies the print flag, which indicates whether to enable `synced_cli` messages\n\n### 6.3 Command-Line Mode\n- `synced_cli`executes the specified **Management API** commands (one or more) and then exits\n- The maximum number of **Management API** commands that can be specified by the user at once is\n  limited by the compile-time macro COMMAND_QUEUE_SIZE, defined in management/cli/synced_cli.c\n- Example 1: synced_cli 127.0.0.2 2400 1 -c get_sync_info_list -c clear_forced_ql enp0s3 -h\n  - Gets the sync info list. Clears the forced QL for port enp0s3. Prints the usage description.\n    (Commands are specified using codes.)\n- Example 2: synced_cli 127.0.0.2 2400 1 -c 0 -c 4 eth0. (Commands are specified using strings.)\n  - Gets the sync info list. Clears the forced QL for port eth0.\n\n### 6.4 Response/Error Codes\n\n`synced_cli` employs the following response/error codes:\n\n - Ok (E_management_api_response_ok)\n - Invalid (E_management_api_response_invalid)\n - Failed (E_management_api_response_failed)\n - Not supported (E_management_api_response_not_supported)\n\n\u003ca name=\"7_pcm4l\"\u003e\u003c/a\u003e\n## 7. `pcm4l`\n\nWhen a change in the current QL of the device occurs, `synced` converts this QL\ninto a physical clock category and then sends it to `pcm4l`. `synced` connects\nto `pcm4l` via a dedicated TCP/IP socket interface, whose parameters must be specified\nin the configuration file.\n\nThe **`pcm4l` Interface** supports the following mapping between the physical clock category\nand QL values:\n\n - E_physical_clock_category_1:\n   - E_esmc_ql_net_opt_1_ePRTC\n   - E_esmc_ql_net_opt_1_PRTC\n   - E_esmc_ql_net_opt_1_ePRC\n   - E_esmc_ql_net_opt_1_PRC\n   - E_esmc_ql_net_opt_2_ePRTC\n   - E_esmc_ql_net_opt_2_PRTC\n   - E_esmc_ql_net_opt_2_ePRC\n   - E_esmc_ql_net_opt_2_PRS\n\n - E_physical_clock_category_2:\n   - E_esmc_ql_net_opt_1_SSUA\n   - E_esmc_ql_net_opt_2_ST2\n\n - E_physical_clock_category_3:\n   - E_esmc_ql_net_opt_1_SSUB\n   - E_esmc_ql_net_opt_2_ST3E\n\n - E_physical_clock_category_4:\n   - E_esmc_ql_net_opt_1_eSEC\n   - E_esmc_ql_net_opt_1_SEC\n   - E_esmc_ql_net_opt_2_STU\n   - E_esmc_ql_net_opt_2_TNC\n   - E_esmc_ql_net_opt_2_eEEC\n   - E_esmc_ql_net_opt_2_ST3\n   - E_esmc_ql_net_opt_2_SMC\n   - E_esmc_ql_net_opt_2_ST4\n   - E_esmc_ql_net_opt_2_PROV\n\n - E_physical_clock_category_DNU:\n   - E_esmc_ql_net_opt_1_DNU\n   - E_esmc_ql_net_opt_2_DUS\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenesas%2Fsynced","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenesas%2Fsynced","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenesas%2Fsynced/lists"}