Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1f70dc8
Added speed test
Jan 6, 2026
b703e72
Added speed test
Jan 6, 2026
931a72e
Added scanner need to improve more
Jan 8, 2026
c1b8f07
Small fixes
Jan 8, 2026
7920567
Zew/web socket (#3)
zew-rgn Jan 8, 2026
9a32567
Added scanner need to improve more
Jan 8, 2026
64eb847
Scanner now checks if existing ap, also improve
Jan 8, 2026
1c14f76
Riverpod implmented still need to clean up used dependecy injection
Jan 9, 2026
f9836a4
ALmost finished with phase 1.
zew-rgn Oct 7, 2025
be82436
Tied riverpod with websocket improve a couple of feature such using f…
Jan 13, 2026
db642b2
Model freeze implmentation
Jan 6, 2026
11a98e1
ALmost finished with phase 1.
zew-rgn Oct 7, 2025
c9f55d8
1st Phase finished
zew-rgn Oct 7, 2025
16702cd
Development on pause while waiting for more websocket backend
zew-rgn Oct 9, 2025
24e8864
Getting upt to date.
agentz101 Jan 6, 2026
8b7a94f
Pushing implementation plan
agentz101 Jan 6, 2026
b69a0e9
Adds websocket login
agentz101 Jan 6, 2026
5bb4401
Added speed test to pms room
Jan 13, 2026
fc4392d
Added speed test
Jan 6, 2026
559ba6f
Added speed test to pms room
Jan 13, 2026
45aa4fb
Speed test added to pms need to be cross validated with speed test r…
Jan 14, 2026
2a77c8a
Resolve merge conflict
Jan 14, 2026
a146fa8
Add health notices feature with real-time WebSocket integration (#8)
zew-rgn Jan 15, 2026
afd459b
Rebased with master
Jan 15, 2026
5aee51e
Merge branch 'master' into dlp/riverpod
Dominicpham03 Jan 15, 2026
26b88db
Merge pull request #6 from rgnets/dlp/riverpod
Dominicpham03 Jan 15, 2026
3bb6d52
Fix conflicts
Jan 15, 2026
197ce58
Added speed test
Jan 6, 2026
00a185f
Added speed test to pms room
Jan 13, 2026
dde66d0
Speed test added to pms need to be cross validated with speed test r…
Jan 14, 2026
dc1c038
Added speed test
Jan 6, 2026
394d70f
1st Phase finished
zew-rgn Oct 7, 2025
7a12514
Development on pause while waiting for more websocket backend
zew-rgn Oct 9, 2025
f88a503
Getting upt to date.
agentz101 Jan 6, 2026
c990467
Pushing implementation plan
agentz101 Jan 6, 2026
96408ea
Adds websocket login
agentz101 Jan 6, 2026
6e942c5
Fix some UI bug
Jan 15, 2026
79458a5
Handle submission adhoc
Jan 16, 2026
85f6061
Merge remote branch 'origin/dlp/add_speedtest' into dlp/add_speedtest
Jan 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file removed .DS_Store
Binary file not shown.
988 changes: 988 additions & 0 deletions ImplementationPlan.txt

Large diffs are not rendered by default.

164 changes: 164 additions & 0 deletions OldAppReport.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# ATT-FE-Tool Functionality Report (Version 2)

This report breaks down the functionality of the ATT-FE-Tool application, organized by its views.

## Core Application Structure (`main_view.dart`)

- **Role:** Main container for the application's primary views post-authentication.
- **Navigation:** Manages a `LiveNavBar` to switch between `HomeView`, `ConnectionView`, `DevicesView`, `IssuesView`, and `RoomReadinessView`. The `BarcodeScanner` is also accessed from here for device provisioning.
- **Initialization:** After a successful login, this view orchestrates the application startup sequence.
- Shows an initialization overlay with progress messages.
- Fetches all initial data from the rXg via `RxgApiClient.getAllRxgData()`, populating device, room, and issue information.
- **State Management:** Handles global application state, including network connectivity. It can re-trigger data synchronization if the network connection is restored.

---

## 1. Authentication and Onboarding

The application offers two primary methods for authentication, preceded by a one-time onboarding experience for new users.

### 1a. Onboarding (`onboarding_view.dart`)

- **Role:** First-time user experience.
- **Functionality:**
- A two-page carousel that welcomes the user.
- Provides a high-level explanation of how to connect the app to an rXg instance, including an animated GIF.
- Navigates the user to the `ConnectionView` where they can choose a login method.

### 1b. Barcode Scanner (for Login) (`barcode_scanner.dart`)

- **Role:** The primary and recommended method for authentication.
- **Functionality:**
- Uses the device's camera to scan a QR code generated within the rXg web interface.
- The QR code contains the FQDN, username, and API key.
- Upon a successful scan, the credentials are automatically and securely stored, and the user is navigated to the `MainViewUnified`.

### 1c. Manual Credential Entry (`credential_entry_view.dart`)

- **Role:** An alternative, manual method for authentication.
- **Functionality:**
- Provides two methods for credential input:
1. **Manual Form:** Separate fields for FQDN, Login, and API Key.
2. **JSON Input:** A single text area to paste a JSON object containing the credentials.
- **Validation:** Uses a `ScannerValidationService` to validate the entered credentials against the rXg.
- **Navigation:** On successful validation, it saves the credentials and navigates the user to the main application. On failure, it displays an error message.

---

## 2. Barcode Scanner (for Device Provisioning) (`barcode_scanner.dart`)

- **Role:** After login, the scanner's purpose shifts to become the primary tool for registering new hardware in the field. This is a critical workflow.
- **Functionality:**
- **Hardware Scan:** The user scans the hardware barcode (MAC address or Serial Number) of a new device (AP, ONT, or Switch).
- **Registration Bottom Sheet:** Upon a successful scan, a modal bottom sheet appears, guiding the technician through the registration process.
- **Room Selection:** The user must select the room where the device is being installed.
- **Device Assignment:** The user can then either:
1. **Create a New Device:** Provision a completely new device record in the rXg.
2. **Assign to Designed Device:** Link the scanned hardware to a pre-existing "designed" (or planned) device entry in the rXg.
- **API Call:** The view calls the appropriate registration method in `RxgApiClient` (`registerAP`, `registerONT`, etc.) to complete the process.
- **Use Case (Device/Room Lookup):** The scanner can also be used to scan a barcode on an already-installed device or a room plaque to be taken directly to that item's detail view in the app.

---

## 3. Home / Dashboard (`home_view.dart`)

- **Role:** A high-level dashboard providing a "single pane of glass" overview of the system's health.
- **Functionality:**
- **Property Name:** Displays the name of the property being monitored.
- **Health Score:** A prominent gauge that displays an overall system health score.
- **Quick Stats:** A summary of total devices, online percentage, and last data refresh time.
- **Room Readiness Overview:** A card summarizing "Ready" and "Not Ready" rooms.
- **Issue Breakdown:** Shows a count of all issues, broken down by severity (Critical, Warning, Info).
- **Devices Overview:** Shows online and offline counts for each device type (Switches, APs, ONTs).
- **Speed Test Card:** A card for running `iperf3` speed tests.

---

## 4. Connection Status (`connection_view.dart`)

- **Role:** A detailed dashboard for monitoring the connection to the rXg and managing the user session.
- **Functionality:**
- **Connection Status:** Detailed breakdown of Internet, Server reachability, and Authentication status.
- **Performance Metrics:** Displays connection quality and API latency.
- **Data Sync Status:** Shows the time of the last and next data synchronization.
- **User Profile:** Displays the FQDN and Login for the current user.
- **Actions:**
- **Manual Sync:** A button to force a full refresh of all data from the rXg.
- **Disconnect:** A button to log out, which securely clears all credentials and cached data, returning the user to the login screen.
- **Technical Details:** App version, API endpoint, and raw error messages for debugging.

---

## 5. Devices List (`devices_view.dart`)

- **Role:** The primary screen for finding and navigating to specific devices.
- **Functionality:**
- **Device List:** Displays all devices (Switches, APs, ONTs) in a scrollable list.
- **Device Card:** Each card shows the device name, type, online/offline status, and an issue-count badge.
- **Search & Filter:** Search by name/MAC/SN, filter by device type, and a "Phase" filter.
- **Deletion:** Allows users to delete a device by swiping, with a confirmation dialog and offline queuing.
- **Navigation:** Tapping a device navigates to its `DeviceDetailView`.

---

## 6. Issues List (`issues_view.dart`)

- **Role:** A centralized view to see all detected problems across the entire system.
- **Functionality:**
- **Issue List:** Aggregates and lists all issues from all devices.
- **Issue Card:** Shows severity, title, description, associated device/room, and a suggested resolution.
- **Search & Filter:** Search by text, filter by device type and issue severity.
- **Sorting:** The list is sorted to show the most critical issues first.
- **Navigation:** Tapping an issue navigates to the `DeviceDetailView` for the associated device.

---

## 7. Room Readiness List (`room_readiness_view.dart`)

- **Role:** Provides a high-level overview of the installation/operational status of all rooms.
- **Functionality:**
- **Room List/Grid:** Displays all rooms in a responsive list or grid.
- **Room Card:** Summarizes room status, device counts (online vs. total), and issue counts.
- **Search & Filter:** Search by room name, filter by readiness status ("Ready", "Partial", "Down") and "Phase".
- **Navigation:** Tapping a room card navigates to the `RoomDetailView`.

---

## 8. Room Detail (`room_detail_view.dart`)

- **Role:** A detailed dashboard for a single room, showing all its devices and their statuses.
- **Functionality:**
- **Room Summary:** A header card shows the room name, device counts, online status, and total issue count.
- **Device List:** Lists all ONTs and APs within the room, including their onboarding progress.
- **Issue Accordion:** Displays all issues for all devices in the room, grouped by severity.
- **Speed Tests:** A widget to initiate or view speed tests for the room.
- **Navigation:** Tapping a device or issue navigates to the `DeviceDetailView`.

---

## 9. Device Detail (`device_detail_view.dart`)

- **Role:** A comprehensive, all-in-one view for a single network device. This is the most feature-rich screen.
- **Functionality:**
- **Device Details:** Shows extensive information (IP, MAC, S/N, model, firmware, uptime) with copy-to-clipboard actions.
- **Image Management:** View a gallery, add images from camera/gallery, and view them in an interactive viewer.
- **Technician Notes:** View, add, edit, or clear a note for the device (navigates to `NoteEditView`).
- **Issue Display:** Lists all detected issues specific to this device.
- **Auto-Refresh:** The view auto-refreshes every 5 seconds.
- **Device-Specific Features:**
- **For APs:** Remotely control the device's LED (blink, on, off) for identification. Includes an in-app LED pattern reference guide.
- **For ONTs:** Displays detailed optical/PHY data.
- **For Switches:** Displays a detailed list of all switch ports and their status.
- **Advanced Info:** An expandable section showing raw technical data for debugging.

---

## 10. Note Edit (`note_edit_view.dart`)

- **Role:** A simple, focused screen for editing a technician note.
- **Functionality:**
- Provides a multi-line text field with a 255-character limit.
- On "Save", it calls the API to update the note. Handles offline queuing.
- "Cancel" discards changes.

*This report is based on a combined static and architectural analysis of the Flutter application.*
13 changes: 13 additions & 0 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ android {
jvmTarget = JavaVersion.VERSION_17.toString()
}

// CMake configuration for native iPerf3 library
externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
version = "3.22.1"
}
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.rgnets.rgnets_fdk"
Expand All @@ -28,6 +36,11 @@ android {
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName

// NDK ABI filters for native library
ndk {
abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
}
}

buildTypes {
Expand Down
80 changes: 80 additions & 0 deletions android/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
cmake_minimum_required(VERSION 3.10)

project(iperf3_jni)

# Set C/C++ standard
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Shared native code directory
set(NATIVE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../native)

# iperf3 source directory (now in shared location)
set(IPERF3_SRC_DIR ${NATIVE_DIR}/iperf3/src)

# Build iperf3 as a static library from source
add_library(libiperf STATIC
# Core iperf3 source files - we'll add the actual iperf3 source here
${IPERF3_SRC_DIR}/cjson.c
${IPERF3_SRC_DIR}/iperf_api.c
${IPERF3_SRC_DIR}/iperf_error.c
${IPERF3_SRC_DIR}/iperf_client_api.c
${IPERF3_SRC_DIR}/iperf_server_api.c
${IPERF3_SRC_DIR}/iperf_tcp.c
${IPERF3_SRC_DIR}/iperf_udp.c
${IPERF3_SRC_DIR}/iperf_sctp.c
${IPERF3_SRC_DIR}/iperf_util.c
${IPERF3_SRC_DIR}/iperf_locale.c
${IPERF3_SRC_DIR}/iperf_time.c
${IPERF3_SRC_DIR}/dscp.c
${IPERF3_SRC_DIR}/net.c
${IPERF3_SRC_DIR}/tcp_info.c
${IPERF3_SRC_DIR}/timer.c
${IPERF3_SRC_DIR}/units.c
)

# Include directories for iperf3
target_include_directories(libiperf PUBLIC
${IPERF3_SRC_DIR}
${NATIVE_DIR}/iperf3/include
)

# Compile definitions for iperf3
target_compile_definitions(libiperf PRIVATE
HAVE_CONFIG_H
ANDROID
)

# Build shared bridge (platform-agnostic C code)
add_library(iperf3_bridge STATIC
${NATIVE_DIR}/src/iperf3_bridge.c
)

target_include_directories(iperf3_bridge PUBLIC
${NATIVE_DIR}/src
${IPERF3_SRC_DIR}
)

target_link_libraries(iperf3_bridge
libiperf
)

# Build our JNI wrapper (Android-specific)
add_library(iperf3_jni SHARED
iperf3_jni.cpp
)

# Include directories for JNI (Android NDK provides these automatically)
target_include_directories(iperf3_jni PRIVATE
${NATIVE_DIR}/src
${IPERF3_SRC_DIR}
)

# Link everything together
target_link_libraries(iperf3_jni
iperf3_bridge
libiperf
log
android
)
109 changes: 109 additions & 0 deletions android/app/src/main/cpp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# iperf3 Native Library Setup

This directory contains the JNI bridge code for integrating iperf3 into the Android app.

## Current Status

⚠️ **The native iperf3 library is NOT currently enabled in the build.**

The CMake build configuration is commented out in `android/app/build.gradle.kts` to allow the app to compile without the native library.

## To Enable iperf3 Support

### Step 1: Download and Set Up iperf3 Source

Run the setup script to download iperf3 source code:

```bash
cd /Users/dominicpham/rgnets/ATT-FE-Tool/android/app/src/main/cpp
chmod +x setup_iperf3.sh
./setup_iperf3.sh
```

This will:
- Download iperf3 v3.19 source code
- Extract it to `iperf3/` directory
- Create necessary Android configuration files

### Step 2: Create Required Directory Structure

The build expects files in a `native/` directory at the project root:

```bash
cd /Users/dominicpham/rgnets/ATT-FE-Tool
mkdir -p native/iperf3
mkdir -p native/src
```

### Step 3: Copy iperf3 Files

Copy the downloaded iperf3 source to the expected location:

```bash
cp -r android/app/src/main/cpp/iperf3/* native/iperf3/
```

### Step 4: Create Bridge Implementation

You need to create `native/src/iperf3_bridge.c` and `native/src/iperf3_bridge.h` files.

These files should contain the platform-agnostic C bridge code that wraps iperf3 functionality.

### Step 5: Uncomment Build Configuration

Edit `android/app/build.gradle.kts` and uncomment the following sections:

1. In `defaultConfig`:
```kotlin
externalNativeBuild {
cmake {
cppFlags += "-std=c++14"
arguments += listOf(
"-DANDROID_STL=c++_shared"
)
}
}

ndk {
abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
}
```

2. At the end of the `android` block:
```kotlin
externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
version = "3.22.1"
}
}
```

### Step 6: Build the App

```bash
flutter clean
flutter build apk --debug
```

## Files in This Directory

- **CMakeLists.txt** - CMake build configuration for native library
- **iperf3_jni.cpp** - JNI wrapper that connects Kotlin/Java to native iperf3
- **setup_iperf3.sh** - Script to download and configure iperf3 source
- **README.md** - This file

## Alternative: Use Without Native Library

The Flutter/Dart code is ready to use, but without the native library, calls to iperf3 will fail.

You can:
1. Use the app with the iperf3 UI disabled
2. Connect to an external iperf3 server over the network (when implemented)

## Notes

- The `native/` directory is added to `.gitignore` to avoid committing large source files
- iperf3 source code is downloaded from the official GitHub repository
- The implementation supports both TCP and UDP protocols
- Real-time progress callbacks are supported via EventChannel
Loading