- Complete hardware communication protocol documentation with: * Add ping/pong health check protocol (0x01) * Add hardware control protocols (0x03 brightness, 0x04 volume) * Add mDNS service discovery specifications * Add connection state management and retry logic * Add comprehensive troubleshooting guide * Update hardware implementation examples - Reorganize project documentation: * Move device auto-refresh docs from root to docs/ directory * Rename files to follow kebab-case convention * Maintain complete technical implementation details - Fix markdown formatting issues: * Add proper language tags to code blocks * Ensure consistent documentation structure
3.0 KiB
3.0 KiB
Device Auto-Refresh Testing Guide
Test Scenarios
1. Initial Load Test
Expected Behavior: Device list loads automatically when component mounts
Steps:
- Start the application:
npm run tauri dev
- Navigate to LED Strip Test page
- Observe the device dropdown
Expected Results:
- Device dropdown shows "Searching..." if no devices found
- Device dropdown shows device count if devices are found
- First available device is automatically selected
- Status icons appear next to device names
2. Device Discovery Test
Expected Behavior: New devices appear automatically when discovered
Steps:
- Start with no devices connected
- Connect a device to the network
- Wait for device discovery (should be automatic)
Expected Results:
- Device count updates automatically
- New device appears in dropdown
- If no device was selected, new device gets selected automatically
- Status icon shows connection state
3. Device Disconnection Test
Expected Behavior: Disconnected devices are handled gracefully
Steps:
- Start with connected devices
- Select a device in the dropdown
- Disconnect the selected device from network
- Wait for connection timeout
Expected Results:
- Device status changes to disconnected (🔴)
- If device becomes unavailable, another device is selected automatically
- Device count updates
- UI remains responsive
4. Connection Status Test
Expected Behavior: Status indicators reflect actual device states
Steps:
- Observe devices in different connection states
- Check status icons and text
Expected Results:
- 🟢 "Connected" for responsive devices
- 🟡 "Connecting" for devices in retry state
- 🔴 "Disconnected" for unresponsive devices
- Status text matches icon state
5. UI Responsiveness Test
Expected Behavior: Interface remains responsive during device changes
Steps:
- Rapidly connect/disconnect devices
- Interact with other UI elements during device changes
- Switch between pages and return
Expected Results:
- No UI freezing or lag
- Event listeners are properly cleaned up
- No memory leaks
- Smooth transitions
Verification Checklist
- Device dropdown shows correct device count
- Status icons display correctly (🟢🟡🔴)
- Automatic device selection works
- Event listeners are cleaned up on component unmount
- No TypeScript errors in console
- No runtime errors in console
- Performance remains good with multiple devices
- UI updates smoothly without flickering
Common Issues to Watch For
- Memory Leaks: Event listeners not cleaned up
- Type Errors: Incorrect BoardInfo type handling
- Selection Logic: Device selection not updating correctly
- Performance: UI lag during rapid device changes
- State Consistency: UI state not matching actual device state
Debug Information
Check browser console for:
boards_changed
events- Device list updates
- Selection changes
- Any error messages
Check Tauri logs for:
- Device discovery messages
- Connection status changes
- mDNS service events