Skip to content

Add event emission for dropped GPS fixes in GTU7#30

Closed
Copilot wants to merge 4 commits intogtu7from
copilot/sub-pr-16-2bfc54bf-b96b-45b0-9545-b9d9714158a8
Closed

Add event emission for dropped GPS fixes in GTU7#30
Copilot wants to merge 4 commits intogtu7from
copilot/sub-pr-16-2bfc54bf-b96b-45b0-9545-b9d9714158a8

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 16, 2026

The GTU7 emit() method silently dropped GPS fixes when the output channel was full, making data loss invisible to applications.

Changes

  • Event emission on drop: emit() now publishes EventInfo with metadata when fixes are dropped due to full channel
  • Configurable buffer: Added GTU7Config.Buf to allow tuning channel size (default: 4)
  • Lifecycle events: Added EventOpen and EventClose to Run() for observability
  • Base integration: Embedded devices.Base in GTU7 struct to support event publishing

Pattern

Now follows VH400's approach for handling channel overflow:

func (g *GTU7) emit(f GPSFix) {
	select {
	case g.out <- f:
	default:
		g.Emit(devices.EventInfo, "gps fix dropped", nil, map[string]string{
			"reason": "output channel full",
		})
	}
}

Applications can monitor the event stream to detect slow consumer scenarios.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 16, 2026 17:46
Co-authored-by: rustyeddy <2903425+rustyeddy@users.noreply.github.com>
Co-authored-by: rustyeddy <2903425+rustyeddy@users.noreply.github.com>
Co-authored-by: rustyeddy <2903425+rustyeddy@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 16, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • go.googlesource.com
    • Triggering command: /update-job-proxy /update-job-proxy 7814570/b087/symls-files (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP e/git test -e CA.pem e/git (dns block)
  • gopkg.in
    • Triggering command: /update-job-proxy /update-job-proxy 7814570/b087/symls-files (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP e/git test -e CA.pem e/git (dns block)
  • periph.io
    • Triggering command: /update-job-proxy /update-job-proxy 7814570/b087/symls-files (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP e/git test -e CA.pem e/git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Address feedback on Gtu7 sensor and serial drivers implementation Add event emission for dropped GPS fixes in GTU7 Jan 16, 2026
Copilot AI requested a review from rustyeddy January 16, 2026 17:49
@rustyeddy rustyeddy closed this Jan 17, 2026
@rustyeddy rustyeddy deleted the copilot/sub-pr-16-2bfc54bf-b96b-45b0-9545-b9d9714158a8 branch January 17, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants