🛰️Zafer Satılmış - Aviora

CycloneTcp Stack

Source path: Application/AppZMeterGw/Services/Network/Interfaces/CycloneTcp/. This integration wraps the Cyclone TCP/IP stack for embedded targets: one module brings up the stack, separate modules manage Ethernet (for example ENC28J60 over SPI) and PPP over a UART-attached modem.

Key Source Files

Keep stack-wide logic separate from per-interface policy. The stack file exposes a single init entry point; Ethernet and PPP managers expose symmetric lifecycle APIs (start, close, reconnect, isNetworkReady) that JSON maps to macros.

FileResponsibility
AppCycloneStack.h / AppCycloneStack.cDeclares and implements appCycloneTcpIpStackInit()—call once before interfaces.
AppCycloneEthMng.h / .cEthernet: link setup, driver hooks, address configuration as required by your board.
AppCyclonePPPMng.h / .cPPP/GSM: modem control, UART, dial-up context.

How Code Generation Wires It In

When the active JSON stack is CycloneTcp (first use: true in networkStack), the generator performs a predictable sequence: it emits an include for stackInitSourcePath, defines NET_STACK_STACK_INIT_FUNCTION to the string in stackInitFunction, then for each active Ethernet row includes ethAppManagerPath and defines the four manager macros, and similarly for each GSM row with ppAppManagerPath and PPP function fields.

At runtime, networkServiceInitTCPIPStack() resolves to your Cyclone init. networkServiceStartInterfaces() then calls every ETH*_APP_MANAGER_START_FUNCTION() and every PPP*_APP_MANAGER_START_FUNCTION() that JSON enabled—nothing else is invoked automatically.

flowchart LR
  JSON["network_config.json\nCycloneTcp + use:true"]
  GEN["generate_network_service.py"]
  CUS["Cus_Network_Config.h"]
  APP["AppNetworkService"]
  JSON --> GEN --> CUS
  CUS --> APP
  CUS -.-> ETH["AppCycloneEthMng"]
  CUS -.-> PPP["AppCyclonePPPMng"]
  CUS -.-> STK["AppCycloneStack"]
              

Minimal JSON Excerpt

"name": "CycloneTcp",
"stackInitSourcePath": "Services/Network/Interfaces/CycloneTcp/AppCycloneStack.h",
"stackInitFunction": "appCycloneTcpIpStackInit",
"interfaces": {
  "ethInterfaces": [{
    "use": true,
    "ethAppManagerPath": "Services/Network/Interfaces/CycloneTcp/AppCycloneEthMng.h",
    "ethAppManagerStartFunction": "appCycloneEthMngStart",
    ...
  }],
  "gsmInterfaces": [{
    "use": true,
    "ppAppManagerPath": "Services/Network/Interfaces/CycloneTcp/AppCyclonePPPMng.h",
    "ppAppManagerStartFunction": "appCyclonePppMngStart",
    ...
  }]
}

Fill in MAC, IP, nicDriver, and modem fields according to your hardware; the generator copies literals into #define lines where applicable.