Skip to content

Commit

Permalink
fix: Completely fixed the sampling rate jitter issue in legacy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bclswl0827 committed Sep 8, 2024
1 parent d171a23 commit beac2d1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

Starting from v2.2.5, all notable changes to this project will be documented in this file.

## v3.2.5

### New Features

- Added more earthquake event source APIs.

### Bug Fixes

- Completely fixed the sampling rate jitter issue in legacy mode.

### Chore

- Convert device ID to hexadecimal string format.
- Replace SVG icons with Material Design Icons in the frontend.
- Send error message when server returned no earthquake event.

## v3.2.4

### CI/CD Changes
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.2.4
v3.2.5
6 changes: 3 additions & 3 deletions drivers/explorer/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type legacyPacket struct {
}

func (g *legacyPacket) length() int {
return int(unsafe.Sizeof(g.Z_Axis) + unsafe.Sizeof(g.E_Axis) + unsafe.Sizeof(g.N_Axis) + unsafe.Sizeof(g.Checksum))
return int(unsafe.Sizeof(*g))
}

func (g *legacyPacket) decode(data []byte) error {
Expand Down Expand Up @@ -147,7 +147,7 @@ func (e *ExplorerDriverImpl) handleReadLegacyPacket(deps *ExplorerDependency, fi

// Read data from the transport continuously
go func() {
buf := make([]byte, recvSize/2)
buf := make([]byte, recvSize)
for {
select {
case <-deps.CancelToken.Done():
Expand Down Expand Up @@ -238,7 +238,7 @@ func (e *ExplorerDriverImpl) handleReadMainlinePacket(deps *ExplorerDependency,

// Read data from the transport continuously
go func() {
buf := make([]byte, recvSize/2)
buf := make([]byte, recvSize)
for {
select {
case <-deps.CancelToken.Done():
Expand Down

0 comments on commit beac2d1

Please sign in to comment.