# mrdevanagalingam/amararaja-integrated-qtp architecture

> Architecture diagram of the GitHub repository mrdevanagalingam/amararaja-integrated-qtp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mrdevanagalingam/amararaja-integrated-qtp
- Repository: https://github.com/mrdevanagalingam/amararaja-integrated-qtp

## Overview

This is a TCP-based QTP laboratory test system: an operator selects a host-side test, the host sends a framed request to the target, and the target dispatches hardware or connectivity checks and returns results. The graph preserves the documented meter, IMD, CAN, RFID, temperature, 4G, relay, and firmware-flash capabilities. Some target wiring is supported by the SOURCE INDEX and README rather than full excerpts; uncertain implementation details are not expanded.

Main entry points: [`Amararaja_Integrated_QTP_Target/tests.py`](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/tests.py) (Test orchestration), [`Amararaja_Integrated_QTP_Host/tcp_handler.py`](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Host/tcp_handler.py) (Host TCP client), [`Amararaja_Integrated_QTP_Target/tcp_server.py`](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/tcp_server.py) (TCP server), [`Amararaja_Integrated_QTP_Target/can_controller_qtp.py`](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/can_controller_qtp.py) (CAN QTP actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["Host test console"]
  node_hostmain["Host entry point<br/>[main.py]"]
  node_menu["Interactive menu"]
  node_handler["Command and results<br/>[command_handler.py]"]
end

subgraph group_transport["QTP transport"]
  node_hosttcp["Host TCP client<br/>[tcp_handler.py]"]
  node_hostproto["Host QTP framing<br/>[qtp_protocol.py]"]
  node_targetproto["Target QTP framing<br/>[qtp_protocol.py]"]
end

subgraph group_target["Target dispatch"]
  node_targetmain["Target entry point<br/>[main.py]"]
  node_server["TCP server<br/>[tcp_server.py]"]
  node_dispatcher["Command dispatcher<br/>[dispatcher.py]"]
  node_tests["Test orchestration<br/>[tests.py]"]
end

subgraph group_hardware["Hardware tests"]
  node_selec["Selec EM4M meter<br/>[selec_EM4M.py]"]
  node_edc["EDC2150 meter<br/>[edc2150.py]"]
  node_imd["IMD readers<br/>[imd_read.py]"]
  node_rfid["RFID verification<br/>[tests.py]"]
  node_temperature["Temperature test"]
  node_network["4G verification<br/>[network_4g.py]"]
end

subgraph group_mcu["CAN and MCU"]
  node_canqtp["CAN QTP actions"]
  node_controller["CAN controller"]
  node_cansetup["CAN interface and codec<br/>[can_setup.py]"]
  node_relay["Relay control<br/>[relay_control.py]"]
  node_flash["MCU firmware images"]
end

node_operator(("Operator"))
node_target(("QTP target service"))

node_operator -->|"selects test"| node_menu
node_hostmain -->|"starts menu"| node_menu
node_hostmain -->|"creates handler"| node_handler
node_menu -->|"runs command"| node_handler
node_handler -->|"sends request"| node_hosttcp
node_hosttcp -->|"frames request"| node_hostproto
node_hosttcp -->|"connects TCP"| node_target
node_targetmain -->|"starts server"| node_server
node_server -->|"decodes frames"| node_targetproto
node_server -->|"dispatches command"| node_dispatcher
node_dispatcher -->|"routes tests"| node_tests
node_tests -->|"runs meter test"| node_selec
node_tests -->|"runs meter test"| node_edc
node_tests -->|"reads IMD"| node_imd
node_tests -->|"verifies RFID"| node_rfid
node_tests -->|"runs sensor test"| node_temperature
node_tests -->|"runs network test"| node_network
node_tests -->|"runs CAN action"| node_canqtp
node_canqtp -->|"invokes controller"| node_controller
node_canqtp -->|"configures CAN"| node_cansetup
node_controller -->|"sends CAN frames"| node_cansetup
node_tests -->|"runs relay action"| node_relay
node_tests -->|"flashes firmware"| node_flash

click node_hostmain "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Host/main.py"
click node_menu "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Host/interactive_menu.py"
click node_handler "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Host/command_handler.py"
click node_hosttcp "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Host/tcp_handler.py"
click node_hostproto "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Host/qtp_protocol.py"
click node_targetmain "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/main.py"
click node_server "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/tcp_server.py"
click node_targetproto "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/qtp_protocol.py"
click node_dispatcher "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/dispatcher.py"
click node_tests "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/tests.py"
click node_selec "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/selec_EM4M.py"
click node_edc "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/edc2150.py"
click node_imd "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/imd_read.py"
click node_rfid "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/tests.py"
click node_temperature "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/phyverso_temperature.py"
click node_network "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/network_4g.py"
click node_canqtp "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/can_controller_qtp.py"
click node_controller "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/can_controller_node.py"
click node_cansetup "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/can_setup.py"
click node_relay "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/relay_control.py"
click node_flash "https://github.com/mrdevanagalingam/amararaja-integrated-qtp/tree/main/Amararaja_Integrated_QTP_Target/MCU_binary"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_hostmain,node_menu,node_handler toneBlue
class node_hosttcp,node_hostproto,node_targetproto toneAmber
class node_targetmain,node_server,node_dispatcher,node_tests toneMint
class node_selec,node_edc,node_imd,node_rfid,node_temperature,node_network toneRose
class node_canqtp,node_controller,node_cansetup,node_relay,node_flash,node_operator,node_target toneIndigo
```

## Components

### Host test console

- [Host entry point](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Host/main.py): `Amararaja_Integrated_QTP_Host/main.py`
- [Interactive menu](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Host/interactive_menu.py): `Amararaja_Integrated_QTP_Host/interactive_menu.py`
- [Command and results](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Host/command_handler.py): `Amararaja_Integrated_QTP_Host/command_handler.py`

### QTP transport

- [Host TCP client](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Host/tcp_handler.py): `Amararaja_Integrated_QTP_Host/tcp_handler.py`
- [Host QTP framing](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Host/qtp_protocol.py): `Amararaja_Integrated_QTP_Host/qtp_protocol.py`
- [Target QTP framing](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/qtp_protocol.py): `Amararaja_Integrated_QTP_Target/qtp_protocol.py`

### Target dispatch

- [Target entry point](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/main.py): `Amararaja_Integrated_QTP_Target/main.py`
- [TCP server](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/tcp_server.py): `Amararaja_Integrated_QTP_Target/tcp_server.py`
- [Command dispatcher](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/dispatcher.py): `Amararaja_Integrated_QTP_Target/dispatcher.py`
- [Test orchestration](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/tests.py): `Amararaja_Integrated_QTP_Target/tests.py`

### Hardware tests

- [Selec EM4M meter](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/selec_EM4M.py): `Amararaja_Integrated_QTP_Target/selec_EM4M.py`
- [EDC2150 meter](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/edc2150.py): `Amararaja_Integrated_QTP_Target/edc2150.py`
- [IMD readers](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/imd_read.py): `Amararaja_Integrated_QTP_Target/imd_read.py`
- [RFID verification](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/tests.py): `Amararaja_Integrated_QTP_Target/tests.py`
- [Temperature test](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/phyverso_temperature.py): `Amararaja_Integrated_QTP_Target/phyverso_temperature.py`
- [4G verification](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/network_4g.py): `Amararaja_Integrated_QTP_Target/network_4g.py`

### CAN and MCU

- [CAN QTP actions](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/can_controller_qtp.py): `Amararaja_Integrated_QTP_Target/can_controller_qtp.py`
- [CAN controller](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/can_controller_node.py): `Amararaja_Integrated_QTP_Target/can_controller_node.py`
- [CAN interface and codec](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/can_setup.py): `Amararaja_Integrated_QTP_Target/can_setup.py`
- [Relay control](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/blob/main/Amararaja_Integrated_QTP_Target/relay_control.py): `Amararaja_Integrated_QTP_Target/relay_control.py`
- [MCU firmware images](https://github.com/mrdevanagalingam/amararaja-integrated-qtp/tree/main/Amararaja_Integrated_QTP_Target/MCU_binary): `Amararaja_Integrated_QTP_Target/MCU_binary`

### Other components

- **Operator**
- **QTP target service**

## Connections

- Operator → Interactive menu: selects test (evidence: `Amararaja_Integrated_QTP_Host/interactive_menu.py`)
- Host entry point → Interactive menu: starts menu (evidence: `Amararaja_Integrated_QTP_Host/main.py`)
- Host entry point → Command and results: creates handler (evidence: `Amararaja_Integrated_QTP_Host/main.py`)
- Interactive menu → Command and results: runs command (evidence: `Amararaja_Integrated_QTP_Host/interactive_menu.py`)
- Command and results → Host TCP client: sends request (evidence: `README.md`)
- Host TCP client → Host QTP framing: frames request (evidence: `Amararaja_Integrated_QTP_Host/tcp_handler.py`)
- Host TCP client → QTP target service: connects TCP (evidence: `README.md`)
- Target entry point → TCP server: starts server (evidence: `Amararaja_Integrated_QTP_Target/main.py`)
- TCP server → Target QTP framing: decodes frames (evidence: `Amararaja_Integrated_QTP_Target/tcp_server.py`)
- TCP server → Command dispatcher: dispatches command (evidence: `Amararaja_Integrated_QTP_Target/tcp_server.py`)
- Command dispatcher → Test orchestration: routes tests (evidence: `Amararaja_Integrated_QTP_Target/dispatcher.py`)
- Test orchestration → Selec EM4M meter: runs meter test (evidence: `Amararaja_Integrated_QTP_Target/tests.py`)
- Test orchestration → EDC2150 meter: runs meter test (evidence: `Amararaja_Integrated_QTP_Target/tests.py`)
- Test orchestration → IMD readers: reads IMD (evidence: `Amararaja_Integrated_QTP_Target/tests.py`)
- Test orchestration → RFID verification: verifies RFID (evidence: `README.md`)
- Test orchestration → Temperature test: runs sensor test (evidence: `Amararaja_Integrated_QTP_Target/tests.py`)
- Test orchestration → 4G verification: runs network test (evidence: `Amararaja_Integrated_QTP_Target/tests.py`)
- Test orchestration → CAN QTP actions: runs CAN action (evidence: `Amararaja_Integrated_QTP_Target/tests.py`)
- CAN QTP actions → CAN controller: invokes controller (evidence: `Amararaja_Integrated_QTP_Target/can_controller_qtp.py`)
- CAN QTP actions → CAN interface and codec: configures CAN (evidence: `Amararaja_Integrated_QTP_Target/can_controller_qtp.py`)
- CAN controller → CAN interface and codec: sends CAN frames (evidence: `Amararaja_Integrated_QTP_Target/can_controller_node.py`)
- Test orchestration → Relay control: runs relay action (evidence: `Amararaja_Integrated_QTP_Target/tests.py`)
- Test orchestration → MCU firmware images: flashes firmware (evidence: `README.md`)
