### Supported Modules Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_remote_network API to get a list of supported modules for the device. ```APIDOC ## Supported Modules ### Description Retrieves a list of all module types that are supported by this device. ### Method - **getSupportedModule** - **Description**: Get a vector of supported modules. - **Returns**: `vector` - A list of strings, where each string is the name of a supported module type. ### Request Example ```json { "method": "getSupportedModule" } ``` ### Response Example ```json { "result": ["ModuleA", "ModuleB", "ModuleC"] } ``` ``` -------------------------------- ### startServer() Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_multi_user_manager Starts the Multiuser server, specifying the port number for listening and the server password. ```APIDOC ## POST /server/start ### Description Starts the Multiuser server with the specified port number and password. ### Method POST ### Endpoint `/server/start` ### Parameters #### Request Body - **portNumber** (integer) - Required - The port number to listen on. - **password** (string) - Required - The password for the Multiuser server. ### Request Example ```json { "portNumber": 8888, "password": "your_secure_password" } ``` ### Response #### Success Response (200) - **success** (boolean) - True if the server started successfully, otherwise false. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### MCU Class Example Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_m_c_u This example demonstrates how to get a device with the name 'MCU0' from the network. It's a basic illustration of interacting with an MCU component. ```C++ #include "CMCU.pki" void main() { network().getDevice("MCU0"); } ``` -------------------------------- ### Startup File Management Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_cisco_device APIs for setting and retrieving the startup configuration file content. ```APIDOC ## setStartupFile ### Description Sets the startup file to the specified file. ### Method POST ### Endpoint /websites/tutorials_ptnetacad_net_help_default_ipcapi/setStartupFile ### Parameters #### Request Body - **filePath** (string) - Required - The path to the startup file. ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## getStartupFile ### Description Returns the contents of the current startup file. ### Method GET ### Endpoint /websites/tutorials_ptnetacad_net_help_default_ipcapi/getStartupFile ### Response #### Success Response (200) - **content** (string) - The content of the startup file. #### Response Example ```json { "content": "version 15.1\ninterface GigabitEthernet0/1\n ip address 192.168.1.1 255.255.255.0\n no shutdown" } ``` ``` -------------------------------- ### Get Digital Slots Offset Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_m_c_u The `getDigitalSlotsOffset` function returns the starting index for digital slots. This is crucial as digital and analog slots share indexing. ```C++ int MCU::getDigitalSlotsOffset() { // Function implementation to get digital slot offset return 0; // Placeholder } ``` -------------------------------- ### setStartupFile() Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_cisco_device Sets the startup configuration file for the Cisco device. ```APIDOC ## POST /device/startup-file ### Description Sets the startup file to the specified file. ### Method POST ### Endpoint /device/startup-file ### Parameters #### Request Body - **filename** (string) - Required - The filename of the configuration file. ### Request Example ```json { "filename": "startup-config.cfg" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Get Analog Slots Offset Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_m_c_u The `getAnalogSlotsOffset` function returns the starting index for analog slots. This is important because analog and digital slots share indexing. ```C++ int MCU::getAnalogSlotsOffset() { // Function implementation to get analog slot offset return 0; // Placeholder } ``` -------------------------------- ### Instruction Management Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_activity_file APIs for retrieving and navigating through activity instructions. ```APIDOC ## GET /activity/instructions/{index} ### Description Retrieves the evaluated instructions at a specific index. ### Method GET ### Endpoint `/activity/instructions/{index}` ### Parameters #### Path Parameters - **index** (int) - Required - The index of the instruction page. ### Response #### Success Response (200) - **instruction** (QString) - The evaluated instruction text. ### Response Example ```json { "instruction": "This is the evaluated instruction." } ``` ## GET /activity/instructions/source/{index} ### Description Retrieves the source code of the instruction at a specific index. ### Method GET ### Endpoint `/activity/instructions/source/{index}` ### Parameters #### Path Parameters - **index** (int) - Required - The index of the instruction page. ### Response #### Success Response (200) - **instructionSource** (QString) - The source code of the instruction. ### Response Example ```json { "instructionSource": "// Source code for the instruction." } ``` ## GET /activity/instructions/current/source ### Description Retrieves the source code of the current instruction. ### Method GET ### Endpoint `/activity/instructions/current/source` ### Response #### Success Response (200) - **currentInstructionSource** (QString) - The source code of the current instruction. ### Response Example ```json { "currentInstructionSource": "// Source code for the current instruction." } ``` ## GET /activity/instructions/current ### Description Retrieves the evaluated text of the current instruction. ### Method GET ### Endpoint `/activity/instructions/current` ### Response #### Success Response (200) - **currentInstruction** (QString) - The evaluated text of the current instruction. ### Response Example ```json { "currentInstruction": "This is the current evaluated instruction." } ``` ## GET /activity/instructions/count ### Description Returns the total number of instruction pages. ### Method GET ### Endpoint `/activity/instructions/count` ### Response #### Success Response (200) - **instructionCount** (int) - The total number of instruction pages. ### Response Example ```json { "instructionCount": 10 } ``` ## POST /activity/instructions/next ### Description Navigates to the next instruction page and returns the evaluated instruction. ### Method POST ### Endpoint `/activity/instructions/next` ### Response #### Success Response (200) - **instruction** (QString) - The evaluated instruction of the next page. ### Response Example ```json { "instruction": "Instruction for the next page." } ``` ## POST /activity/instructions/previous ### Description Navigates to the previous instruction page and returns the evaluated instruction. ### Method POST ### Endpoint `/activity/instructions/previous` ### Response #### Success Response (200) - **instruction** (QString) - The evaluated instruction of the previous page. ### Response Example ```json { "instruction": "Instruction for the previous page." } ``` ## DELETE /activity/instructions/current ### Description Removes the current instruction page and returns the evaluated instruction. ### Method DELETE ### Endpoint `/activity/instructions/current` ### Response #### Success Response (200) - **instruction** (QString) - The evaluated instruction after removal. ### Response Example ```json { "instruction": "Instruction after page removal." } ``` ## POST /activity/instructions/insert ### Description Inserts a new instruction page and returns the evaluated instruction of the current page. ### Method POST ### Endpoint `/activity/instructions/insert` ### Response #### Success Response (200) - **instruction** (QString) - The evaluated instruction of the newly inserted page. ### Response Example ```json { "instruction": "Instruction for the inserted page." } ``` ``` -------------------------------- ### Get Excluded Address Range at Index (C++) Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_dhcp_server_process This C++ function retrieves an excluded IP address range at a specified index. It returns a pair of IP addresses, where the first element is the start IP and the second is the end IP of the range. An invalid index will result in undefined behavior. ```cpp pair DhcpServerProcess::getExcludedAddressAt(int index) Returns the excluded address range at the specified index. ``` -------------------------------- ### IcmpProcess - Start Ping Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_icmp_process-members Starts an initiated ICMP ping process. ```APIDOC ## POST /icmp/startPing ### Description Initiates and starts an already created ICMP ping process. ### Method POST ### Endpoint /icmp/startPing ### Parameters #### Query Parameters - **ip** (string) - Required - The IP address to ping. - **arg1** (int) - Required - Parameter for ping process configuration. - **arg2** (int) - Required - Parameter for ping process configuration. - **arg3** (int) - Required - Parameter for ping process configuration. - **arg4** (string) - Required - Parameter for ping process configuration. ### Request Body None ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation (e.g., "started"). #### Response Example { "status": "started" } ``` -------------------------------- ### prev() Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_instruction_dlg Navigates the instruction dialog to show the previous instruction page. ```APIDOC ## prev() ### Description Shows the previous instruction page. ### Method `prev()` ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example ```json {} ``` ### Response #### Success Response (200) - None (void function) #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### IcmpProcess - Start Trace Route Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_icmp_process-members Starts an initiated ICMP trace route process. ```APIDOC ## POST /icmp/startTraceRoute ### Description Initiates and starts an already created ICMP trace route process. ### Method POST ### Endpoint /icmp/startTraceRoute ### Parameters #### Query Parameters - **ip** (string) - Required - The target IP address for the trace route. - **arg1** (int) - Required - Parameter for trace route process configuration. - **arg2** (int) - Required - Parameter for trace route process configuration. - **arg3** (int) - Required - Parameter for trace route process configuration. - **arg4** (int) - Required - Parameter for trace route process configuration. - **arg5** (int) - Required - Parameter for trace route process configuration. - **arg6** (string) - Required - Parameter for trace route process configuration. ### Request Body None ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation (e.g., "started"). #### Response Example { "status": "started" } ``` -------------------------------- ### IoeClientProcess API Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_ioe_client_process Documentation for the IoeClientProcess class, which handles IoE client processes and provides methods for API setup, state reporting, receiving input, and setting states. ```APIDOC ## IoeClientProcess Class ### Description Handles and manipulates the IoE client process for IoE devices. ### Methods #### `setupRemoteApi(QString json)` ##### Description Sets up the API call in a remote server. ##### Method `bool` ##### Parameters - **json** (QString) - The API call to the server in JSON format. ##### Returns - `bool` - `true` if successful, `false` otherwise. #### `reportStates(QString states)` ##### Description Sends the state of the IoE client to the server. ##### Method `void` ##### Parameters - **states** (QString) - The state of the IoE client. #### `inputReceived(QString)` ##### Description This event is emitted when data is coming from the IoE client. ##### Method `void` ##### Parameters - **states** (QString) - The string of the data being sent to the server. #### `stateSet(string stateName, QString value)` ##### Description This event is emitted when a new state is set in the IoE client. ##### Method `void` ##### Parameters - **stateName** (string) - The name of the state. - **value** (QString) - The value of the state. ### Inherited Methods from Process #### `getOwnerDevice()` ##### Description Returns the device for this process. ##### Method `Device` ##### Returns - `Device` - The owner device of the process. ``` -------------------------------- ### Device State and Configuration API Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_cloud APIs for managing general device state, configuration, and time settings. ```APIDOC ## Device State and Configuration API ### Description Provides functionalities for managing the device's operational state, configuration, and time. ### Methods #### Get Command Line ``` TerminalLine getCommandLine() ``` Returns the command line TerminalLine object. #### Set Time ``` void setTime(int year, int month, int day, int hour, int minute, int second) ``` Sets the time for the device. #### Get Up Time ``` long getUpTime() ``` Returns the device's uptime in seconds. #### Is Outdated ``` bool isOutdated() ``` Checks if the device's firmware or configuration is outdated. #### Restore To Default ``` bool restoreToDefault(bool preserveSettings, bool preserveUserApps) ``` Restores the device to its default settings. Options to preserve settings and user apps are available. #### Update Template Creation Time ``` void updateTemplateCreationTime() ``` Updates the creation time of the device's template. ``` -------------------------------- ### start() Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_custom_udp_process Starts the custom UDP process on a specified port number. ```APIDOC ## start() ### Description Starts the custom UDP process on the specified port number. ### Method POST ### Endpoint /custom-udp/start ### Parameters #### Request Body - **port** (integer) - Required - The port number. ### Response #### Success Response (200) - **success** (boolean) - true if successful, otherwise false. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### CustomBluetoothProcess: Check if Bluetooth Process Started Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_custom_bluetooth_process Checks if the custom Bluetooth process has been started. This function is part of the CustomBluetoothProcess class and returns a boolean. ```C++ bool CustomBluetoothProcess::isStarted() ``` -------------------------------- ### Project Execution Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_c_thing Methods for running and managing projects on the device's MCU. ```APIDOC ## POST /api/projects/run ### Description Runs a programming project on the device's MCU. ### Method POST ### Endpoint /api/projects/run ### Parameters #### Request Body - **projectName** (string) - Required - The name of the project to run. - **entryPoint** (string) - Required - The entry point function or script within the project. ### Request Example ```json { "projectName": "main_project", "entryPoint": "start_sequence" } ``` ### Response #### Success Response (200) - **success** (boolean) - True if the project started execution successfully, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## DELETE /api/projects/{projectName}/stop ### Description Stops a running programming project on the device's MCU. ### Method DELETE ### Endpoint /api/projects/{projectName}/stop ### Parameters #### Path Parameters - **projectName** (string) - Required - The name of the project to stop ``` -------------------------------- ### Example Usage of CableSignaling Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_cable_signaling Demonstrates how to access and interact with the CableSignaling process for a specific device within the network. This example requires a network object and a device with a CableSignaling process. ```cpp network().getDevice("Router0").getProcess("CableSignaling") ``` -------------------------------- ### Device addUserDesktopAppFrom() Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_device Adds a user desktop application configuration from an existing configuration object. ```APIDOC ## Device addUserDesktopAppFrom() ### Description Adds a user desktop application configuration from an existing configuration object. ### Method `Device::addUserDesktopAppFrom(UserDesktopAppConfig)` ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **Parameter**: The input parameter is a UserDesktopAppConfig object. ### Request Example ```json { "appName": "exampleApp", "version": "1.0" } ``` ### Response #### Success Response (200) - **return value** (UserDesktopAppConfig) - The configuration for the user desktop application. #### Response Example ```json { "appName": "exampleApp", "version": "1.0" } ``` ``` -------------------------------- ### CustomBluetoothProcess: Start Custom Bluetooth Process Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_custom_bluetooth_process Starts the custom Bluetooth process on the specified service UUID. This function is part of the CustomBluetoothProcess class and returns a boolean indicating success. ```C++ bool CustomBluetoothProcess::start(uuid) ``` -------------------------------- ### Help and State Checkers Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_app_window Methods for opening help files and checking various application states. ```APIDOC ## POST /appwindow/helppath ### Description Opens a help file located at the specified sub-path. ### Method POST ### Endpoint /appwindow/helppath ### Parameters #### Request Body - **subPath** (string) - Required - The sub-path to the help file within the help documentation. ### Request Example ```json { "subPath": "network_basics/introduction.html" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the outcome of the operation (e.g., "success", "error"). #### Response Example ```json { "status": "success" } ``` ## GET /appwindow/isactivitywizardopen ### Description Checks if the Activity Wizard is currently open. ### Method GET ### Endpoint /appwindow/isactivitywizardopen ### Parameters None ### Request Example None ### Response #### Success Response (200) - **bool** (boolean) - True if the Activity Wizard is open, false otherwise. #### Response Example ```json { "isActivityWizardOpen": true } ``` ## GET /appwindow/isinterfacelocked ### Description Checks if a specific interface is locked. ### Method GET ### Endpoint /appwindow/isinterfacelocked ### Parameters #### Query Parameters - **ID** (string) - Required - The ID of the interface to check. - **branchID1** (string) - Optional - Limits the search to this branch ID. - **branchID2** (string) - Optional - Limits the search to this branch ID of branchID1. ### Request Example `/appwindow/isinterfacelocked?ID=GigabitEthernet0/1&branchID1=RouterA` ### Response #### Success Response (200) - **bool** (boolean) - True if the interface is locked, false otherwise. #### Response Example ```json { "isInterfaceLocked": false } ``` ## GET /appwindow/islogicalmode ### Description Checks if the application is currently in Logical workspace mode. ### Method GET ### Endpoint /appwindow/islogicalmode ### Parameters None ### Request Example None ### Response #### Success Response (200) - **bool** (boolean) - True if in Logical mode, false otherwise. #### Response Example ```json { "isLogicalMode": true } ``` ## GET /appwindow/ismaximized ### Description Checks if the application window is maximized. ### Method GET ### Endpoint /appwindow/ismaximized ### Parameters None ### Request Example None ### Response #### Success Response (200) - **bool** (boolean) - True if the window is maximized, false otherwise. #### Response Example ```json { "isMaximized": false } ``` ## GET /appwindow/isminimized ### Description Checks if the application window is minimized. ### Method GET ### Endpoint /appwindow/isminimized ### Parameters None ### Request Example None ### Response #### Success Response (200) - **bool** (boolean) - True if the window is minimized, false otherwise. #### Response Example ```json { "isMinimized": false } ``` ## GET /appwindow/isphysicalmode ### Description Checks if the application is currently in Physical workspace mode. ### Method GET ### Endpoint /appwindow/isphysicalmode ### Parameters None ### Request Example None ### Response #### Success Response (200) - **bool** (boolean) - True if in Physical mode, false otherwise. #### Response Example ```json { "isPhysicalMode": false } ``` ## GET /appwindow/ispreventclose ### Description Checks if the application is prevented from closing. ### Method GET ### Endpoint /appwindow/ispreventclose ### Parameters None ### Request Example None ### Response #### Success Response (200) - **bool** (boolean) - True if closing is prevented, false otherwise. #### Response Example ```json { "isPreventClose": false } ``` ## GET /appwindow/isptsa ### Description Checks if the application is running in PTSA mode. ### Method GET ### Endpoint /appwindow/isptsa ### Parameters None ### Request Example None ### Response #### Success Response (200) - **bool** (boolean) - True if PTSA mode is active, false otherwise. #### Response Example ```json { "isPTSA": false } ``` ## GET /appwindow/isrealtime mode ### Description Checks if the application is currently in Realtime mode. ### Method GET ### Endpoint /appwindow/isrealtime mode ### Parameters None ### Request Example None ### Response #### Success Response (200) - **bool** (boolean) - True if in Realtime mode, false otherwise. #### Response Example ```json { "isRealtimeMode": true } ``` ## GET /appwindow/issimulationmode ### Description Checks if the application is currently in Simulation mode. ### Method GET ### Endpoint /appwindow/issimulationmode ### Parameters None ### Request Example None ### Response #### Success Response (200) - **bool** (boolean) - True if in Simulation mode, false otherwise. #### Response Example ```json { "isSimulationMode": false } ``` ``` -------------------------------- ### Device State and Configuration API Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_pc Check the device's state, restore defaults, and update template creation time. ```APIDOC ## isOutdated ### Description Checks if the device configuration is outdated. ### Method GET (or equivalent for a method call) ### Endpoint N/A (Method call on a device object) ### Parameters None ### Request Example None ### Response #### Success Response (200) - **isOutdated** (bool) - True if the device is outdated, false otherwise. #### Response Example ```json { "isOutdated": false } ``` ``` ```APIDOC ## restoreToDefault ### Description Restores the device configuration to its default settings. ### Method POST (or equivalent for a method call) ### Endpoint N/A (Method call on a device object) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **preserveSettings** (bool) - Optional - If true, preserves some settings during restoration. - **preserveNetwork** (bool) - Optional - If true, preserves network settings during restoration. ### Request Example ```json { "preserveSettings": true, "preserveNetwork": false } ``` ### Response #### Success Response (200) - **success** (bool) - True if restoration was successful, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## updateTemplateCreationTime ### Description Updates the template creation time for the device. ### Method POST (or equivalent for a method call) ### Endpoint N/A (Method call on a device object) ### Parameters None ### Request Example None ### Response #### Success Response (200) Void (No return value specified). #### Response Example None ``` -------------------------------- ### getUpTime Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_s_b_c Gets the uptime of the device. ```APIDOC ## GET getUpTime ### Description Set time to the device. ### Method GET ### Endpoint /device/uptime ### Response #### Success Response (200) - **uptime** (long) - The uptime of the device in seconds. #### Response Example { "uptime": 3600 } ``` -------------------------------- ### Link Management Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_logical_workspace Create and manage links between devices. ```APIDOC ## POST /workspace/links ### Description Creates a link from one device's port to another device's port. ### Method POST ### Endpoint /workspace/links ### Parameters #### Request Body - **sourceDeviceName** (QString) - Required - The name of the source device. - **sourcePortName** (string) - Required - The name of the source port. - **targetDeviceName** (QString) - Required - The name of the target device. - **targetPortName** (string) - Required - The name of the target port. - **connectType** (CONNECT_TYPES) - Required - The type of connection. ### Request Example { "sourceDeviceName": "DeviceA", "sourcePortName": "Port1", "targetDeviceName": "DeviceB", "targetPortName": "Port2", "connectType": "Ethernet" } ### Response #### Success Response (200) - **linkCreated** (bool) - Indicates if the link was successfully created. #### Response Example { "linkCreated": true } ## Events related to Links: ### void linkStarted (QString sourceDeviceName, string sourcePortName, CONNECT_TYPES connectType) #### Description This event is emitted when a link starts (i.e., the user connects the first end of a link). ### void linkCreated (QString sourceDeviceName, string sourcePortName, QString targetDeviceName, string targetPortName, CONNECT_TYPES connectType) #### Description This event is emitted when a link has been created. ``` -------------------------------- ### setPTSAMode() Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_app_window Gets the current PTSA Mode. ```APIDOC ## setPTSAMode() ### Description Get the current PTSA Mode. ### Method AppWindow::setPTSAMode ### Returns QString - The current PTSA Mode. ``` -------------------------------- ### Example Usage of LmiSignaling Class in Packet Tracer Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_lmi_signaling Demonstrates how to access and interact with the LmiSignaling process on a device within the Cisco Packet Tracer environment. This example shows a common pattern for retrieving process objects. ```C++ network().getDevice("Router0").getProcess("LmiSignaling") ``` -------------------------------- ### Timer and Dynamic Feedback Configuration Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_activity_file APIs for configuring and retrieving timer settings and dynamic feedback options. ```APIDOC ## POST /activity/timer/countdown ### Description Sets the countdown time for the activity. Requires an integer value representing milliseconds. ### Method POST ### Endpoint `/activity/timer/countdown` ### Parameters #### Request Body - **timeInMilliseconds** (int) - Required - The total countdown time in milliseconds. ### Request Example ```json { "timeInMilliseconds": 60000 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates successful setting of countdown time. ### Response Example ```json { "status": "Countdown time set successfully." } ``` ## GET /activity/timer/countdown ### Description Returns the total configured countdown time in milliseconds. ### Method GET ### Endpoint `/activity/timer/countdown` ### Response #### Success Response (200) - **countDownTime** (int) - The total countdown time in milliseconds. ### Response Example ```json { "countDownTime": 60000 } ``` ## GET /activity/timer/countdown/left ### Description Returns the remaining countdown time in milliseconds. ### Method GET ### Endpoint `/activity/timer/countdown/left` ### Response #### Success Response (200) - **countDownTimeLeft** (int) - The remaining countdown time in milliseconds. ### Response Example ```json { "countDownTimeLeft": 30000 } ``` ## POST /activity/timer/type ### Description Sets the type of timer to be used for the activity. ### Method POST ### Endpoint `/activity/timer/type` ### Parameters #### Request Body - **timerType** (ACTIVITYTIMERTYPE) - Required - The type of timer (e.g., COUNTDOWN, STOPWATCH). ### Request Example ```json { "timerType": "COUNTDOWN" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates successful setting of timer type. ### Response Example ```json { "status": "Timer type set successfully." } ``` ## GET /activity/timer/type ### Description Returns the current timer type configured for the activity. ### Method GET ### Endpoint `/activity/timer/type` ### Response #### Success Response (200) - **timerType** (ACTIVITYTIMERTYPE) - The current timer type. ### Response Example ```json { "timerType": "COUNTDOWN" } ``` ## GET /activity/feedback/dynamic/percentage/type ### Description Returns the type of dynamic percentage feedback. ### Method GET ### Endpoint `/activity/feedback/dynamic/percentage/type` ### Response #### Success Response (200) - **dynamicPercentageFeedbackType** (DYNAMICTYPE) - The type of dynamic feedback. ### Response Example ```json { "dynamicPercentageFeedbackType": "POINTS" } ``` ## POST /activity/feedback/dynamic/percentage ### Description Enables or disables dynamic percentage feedback. ### Method POST ### Endpoint `/activity/feedback/dynamic/percentage` ### Parameters #### Request Body - **enable** (bool) - Required - True to enable, false to disable. ### Request Example ```json { "enable": true } ``` ### Response #### Success Response (200) - **status** (string) - Indicates successful setting of dynamic feedback state. ### Response Example ```json { "status": "Dynamic feedback setting updated." } ``` ## GET /activity/feedback/dynamic/percentage/state ### Description Returns the current state (enabled or disabled) of dynamic percentage feedback. ### Method GET ### Endpoint `/activity/feedback/dynamic/percentage/state` ### Response #### Success Response (200) - **isDynamicPercentageFeedback** (bool) - True if enabled, false if disabled. ### Response Example ```json { "isDynamicPercentageFeedback": true } ``` ## GET /activity/feedback/dynamic/string ### Description Retrieves the dynamic feedback string, which can represent percentage points, score, or raw values. ### Method GET ### Endpoint `/activity/feedback/dynamic/string` ### Response #### Success Response (200) - **dyFeedbackString** (QString) - The dynamic feedback text. ### Response Example ```json { "dyFeedbackString": "85% complete" } ``` ``` -------------------------------- ### Environment and System Information Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_app_window Functions for retrieving environment details and managing system configurations. ```APIDOC ## GET /environment/dialog ### Description Returns the Environment Dialog object. ### Method GET ### Endpoint /environment/dialog ### Response #### Success Response (200) - **dialog** (object) - The Environment Dialog object. ### Response Example ```json { "dialog": { ... } } ``` ## POST /system/set_check_outdated_devices ### Description Set if devices marked as outdated should be displayed for selection. ### Method POST ### Endpoint /system/set_check_outdated_devices ### Parameters #### Request Body - **value** (boolean) - Required - `true` to display outdated devices, `false` otherwise. ### Response #### Success Response (200) - **status** (string) - Indicates the success or failure of the operation. ### Request Example ```json { "value": true } ``` ### Response Example ```json { "status": "success" } ``` ## POST /config/delete_pt_conf ### Description Deletes the PT configuration. ### Method POST ### Endpoint /config/delete_pt_conf ### Response #### Success Response (200) - **status** (string) - Indicates the success or failure of the operation. ### Response Example ```json { "status": "success" } ``` ## GET /ptsa/mode ### Description Get the current PTSA Mode. ### Method GET ### Endpoint /ptsa/mode ### Response #### Success Response (200) - **mode** (string) - The current PTSA mode. ### Response Example ```json { "mode": "active" } ``` ## POST /ptsa/set_mode ### Description Set the current PTSA Mode. ### Method POST ### Endpoint /ptsa/set_mode ### Parameters #### Request Body - **mode** (string) - Required - The PTSA mode to set. ### Response #### Success Response (200) - **status** (string) - Indicates the success or failure of the operation. ### Request Example ```json { "mode": "inactive" } ``` ### Response Example ```json { "status": "success" } ``` ## GET /ptsa/is_ptsa ### Description Returns true if PTSA is enabled, otherwise false. ### Method GET ### Endpoint /ptsa/is_ptsa ### Response #### Success Response (200) - **isPTSA** (boolean) - `true` if PTSA is enabled, `false` otherwise. ### Response Example ```json { "isPTSA": true } ``` ## POST /ptsa/set_plugin_visible ### Description Shows and hides the PT window. Called from the PTSA plugin only. Requires clearing other windows, possibly with File->New. ### Method POST ### Endpoint /ptsa/set_plugin_visible ### Parameters #### Request Body - **visible** (boolean) - Required - `true` to show the window, `false` to hide it. ### Response #### Success Response (200) - **status** (string) - Indicates the success or failure of the operation. ### Request Example ```json { "visible": true } ``` ### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### getPhysicalObject Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_s_b_c Gets the physical object associated with the device. ```APIDOC ## GET getPhysicalObject ### Description Get custom interface name on the device. ### Method GET ### Endpoint /device/physicalobject ### Response #### Success Response (200) - **PhysicalObject** (object) - The physical object associated with the device. #### Response Example { "name": "Router1", "location": "Rack 1" } ``` -------------------------------- ### runProject Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_device Executes a programming project on the device's MCU. Returns true if the project was found and started, false otherwise. ```APIDOC ## POST /Device/runProject ### Description Runs a programming project in the mcu. ### Method POST ### Endpoint /Device/runProject ### Parameters #### Request Body - **projectName** (string) - Required - The name of the project to run. Something like "Blink (JavaScript)" - **extraCode** (string) - Optional - This parameter currently does nothing. ### Response #### Success Response (200) - **bool** (boolean) - Returns true if the project existed and was started, false if not. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### getCustomInterface Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_s_b_c Gets the name of the custom interface on the device. ```APIDOC ## GET getCustomInterface ### Description Get custom interface name on the device. ### Method GET ### Endpoint /device/custominterface ### Response #### Success Response (200) - **interfaceName** (string) - The name of the custom interface. #### Response Example { "interfaceName": "MyInterface" } ``` -------------------------------- ### Cabling and Workspace Options Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_options Methods to manage cable effects, auto-cabling, and metric system usage. ```APIDOC ## POST /api/options/cabling/effects ### Description Enables or disables cable length effects. ### Method POST ### Endpoint /api/options/cabling/effects ### Parameters #### Request Body - **enableEffects** (bool) - Required - Whether to enable cable length effects. ### Request Example { "enableEffects": true } ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. ``` ```APIDOC ## POST /api/options/cabling/auto ### Description Enables or disables auto-cabling. ### Method POST ### Endpoint /api/options/cabling/auto ### Parameters #### Request Body - **disableAuto** (bool) - Required - Whether to disable auto-cabling. ### Request Example { "disableAuto": true } ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. ``` ```APIDOC ## POST /api/options/use-metric ### Description Sets whether to use the Metric System. ### Method POST ### Endpoint /api/options/use-metric ### Parameters #### Request Body - **useMetric** (bool) - Required - Whether to use the metric system. ### Request Example { "useMetric": true } ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. ``` -------------------------------- ### File - Get Size Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_file_system Retrieves the size of the file. ```APIDOC ## GET /file/size/{file_path} ### Description Returns the filesize of the file. ### Method GET ### Endpoint /file/size/{file_path} ### Parameters #### Path Parameters - **file_path** (string) - Required - The absolute path to the file. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **size** (int) - The size of the file in bytes. #### Response Example ```json { "size": 1024 } ``` ``` -------------------------------- ### File - Get Permission Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_file_system Retrieves the permissions of the file. ```APIDOC ## GET /file/permission/{file_path} ### Description Returns the permissions of the file. ### Method GET ### Endpoint /file/permission/{file_path} ### Parameters #### Path Parameters - **file_path** (string) - Required - The absolute path to the file. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **permission** (string) - The permissions of the file (e.g., "rw-r--r--"). #### Response Example ```json { "permission": "rw-r--r--" } ``` ``` -------------------------------- ### runProject Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_s_b_c Runs a programming project in the MCU. ```APIDOC ## POST runProject ### Description Runs a programming project in the mcu. ### Method POST ### Endpoint /device/project/run ### Parameters #### Request Body - **projectName** (string) - Required - The name of the project to run. - **options** (string) - Optional - Options for running the project. ### Request Example { "projectName": "Blinky", "options": "-debug" } ### Response #### Success Response (200) - **success** (boolean) - Indicates if the project started successfully. #### Response Example { "success": true } ``` -------------------------------- ### dock() Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_instruction_dlg Docks the instructions dialog to the left side of the main window. ```APIDOC ## dock() ### Description Dock the instructions dialog to the left of the main window. ### Method `dock()` ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example ```json {} ``` ### Response #### Success Response (200) - None (void function) #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### File - Get Name Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_file_system Retrieves the name of the file. ```APIDOC ## GET /file/name/{file_path} ### Description Returns the filename of the file. ### Method GET ### Endpoint /file/name/{file_path} ### Parameters #### Path Parameters - **file_path** (string) - Required - The absolute path to the file. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **file_name** (string) - The name of the file. #### Response Example ```json { "file_name": "my_document.txt" } ``` ``` -------------------------------- ### File - Get Content Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_file_system Retrieves the content of a file. ```APIDOC ## GET /file/content/{file_name} ### Description Returns the file content of the File. ### Method GET ### Endpoint /file/content/{file_name} ### Parameters #### Path Parameters - **file_name** (string) - Required - The name of the file whose content is to be retrieved. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **content** (string) - The content of the file. #### Response Example ```json { "content": "This is the file content." } ``` ``` -------------------------------- ### Device State and Configuration Source: https://tutorials.ptnetacad.net/help/default/IpcAPI/class_c_thing Methods for checking device status and restoring defaults. ```APIDOC ## GET /api/outdated ### Description Checks if the device configuration is outdated. ### Method GET ### Endpoint /api/outdated ### Parameters None ### Request Example None ### Response #### Success Response (200) - **isOutdated** (boolean) - True if the device is outdated, false otherwise. #### Response Example ```json { "isOutdated": false } ``` ``` ```APIDOC ## POST /api/restore-default ### Description Restores the device configuration to its default settings. ### Method POST ### Endpoint /api/restore-default ### Parameters #### Request Body - **preserveData** (boolean) - Optional - If true, attempts to preserve user data during restore. - **resetNetwork** (boolean) - Optional - If true, resets network configurations. ### Request Example ```json { "preserveData": true, "resetNetwork": false } ``` ### Response #### Success Response (200) - **success** (boolean) - True if the restore operation was successful, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## PUT /api/template-creation-time ### Description Updates the creation time of the device's template. ### Method PUT ### Endpoint /api/template-creation-time ### Parameters None ### Request Example None ### Response #### Success Response (200) - **success** (boolean) - True if the creation time was updated successfully, false otherwise. #### Response Example ```json { "success": true } ``` ```