-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update Go version to 1.23.0 and enhance decoder interface with…
… new methods
- Loading branch information
1 parent
67d28e9
commit 55d887e
Showing
27 changed files
with
1,116 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/truvami/decoder/pkg/decoder/tagsl/v1" | ||
) | ||
|
||
func main() { | ||
log.Println("initializing tag S / L decoder...") | ||
d := tagsl.NewTagSLv1Decoder() | ||
|
||
// decode data | ||
log.Println("decoding data...") | ||
location, _, err := d.DecodePosition("0002c420ff005ed85a12b4180719142607", 1, "") | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
log.Printf("latitude: %f, longitude: %f, altitude: %f\n", location.GetLatitude(), location.GetLongitude(), *location.GetAltitude()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package main | ||
|
||
import ( | ||
"bytes" | ||
"log" | ||
"strings" | ||
"testing" | ||
) | ||
|
||
func TestMain(t *testing.T) { | ||
// Create a buffer to capture the output | ||
var buf bytes.Buffer | ||
log.SetOutput(&buf) | ||
|
||
// Run the main function | ||
main() | ||
|
||
// Check if the expected output is present in the buffer | ||
expectedOutput := `46.407935` | ||
if !strings.Contains(buf.String(), expectedOutput) { | ||
t.Errorf("expected output %q not found", expectedOutput) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
package decoder | ||
|
||
import "github.com/truvami/decoder/pkg/common" | ||
|
||
type Decoder interface { | ||
Decode(string, int16, string) (interface{}, interface{}, error) | ||
DecodePosition(string, int16, string) (common.Position, interface{}, error) | ||
DecodeWifi(string, int16, string) (common.WifiLocation, interface{}, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.