diff --git a/devices/geiger/gqgmc.go b/devices/geiger/gqgmc.go
index 94ed1b87e86ae6365e7da918f4d4ba4c56237b06..aca8f425b27863fd78f2a64d991f1ff220c1be37 100644
--- a/devices/geiger/gqgmc.go
+++ b/devices/geiger/gqgmc.go
@@ -10,6 +10,7 @@ package geiger
import (
"errors"
"fmt"
+ "strconv"
"time"
"github.com/tarm/serial"
@@ -334,6 +335,26 @@ func (gc *GQGMCCounter) GetTime() (time.Time, error) {
return t, nil
}
+// GetTemp gets the time
+func (gc *GQGMCCounter) GetTemp() (float64, error) {
+ t, err := gc.communicate(cmdGetTemp, 4)
+ if err != nil {
+ return 0, err
+ }
+
+ var temp float64
+ temp, err = strconv.ParseFloat(fmt.Sprintf("%d.%d", uint8(t[0]), uint8(t[1])), 64)
+ if err != nil {
+ return 0, err
+ }
+ if t[2] != 0 {
+ temp = -temp
+ }
+ return temp, nil
+}
+
+// cmdGetGyro = "<GETGYRO>>" // GMC-320 Re.3.01
+
// FactoryReset does a factory reset
func (gc *GQGMCCounter) FactoryReset() {
gc.sendCmd(cmdFactoryReset)