Skip to the content.

API Points Response Optimization Test Report

1. Test Objective

Verify that the API endpoint /api/channels/:channelId/devices/:deviceId/points dynamically filters response fields based on the channel protocol to prevent field pollution (e.g., Modbus fields appearing in BACnet responses).

2. Test Environment

3. Test Scenarios

Scenario A: Modbus TCP Device

Scenario B: BACnet IP Device

4. Test Execution

Command: go test -v ./internal/server

Output Log

=== RUN   TestGetDevicePoints_ProtocolFields
--- PASS: TestGetDevicePoints_ProtocolFields (0.01s)
PASS
ok      edge-gateway/internal/server    1.236s

5. Conclusion

The API correctly identifies the channel protocol and filters the response fields accordingly.

6. Code Reference