func fetchViaSerialPort(key string) ([]byte, error) {
	config := &serial.Config{Name: SerialPort, Baud: Baud}
	connection, err := serial.OpenPort(config)
	if err != nil {
		return nil, err
	}
	query := fmt.Sprintf(requestPattern, key)
	if _, err := connection.Write([]byte(query)); err != nil {
		return nil, err
	}
	reader := bufio.NewReader(connection)
	answer, err := reader.ReadBytes(EOT)
	if err != nil {
		return nil, err
	}
	return answer[0 : len(answer)-1], nil
}
The default fetcher makes the connection to the serial port,
writes given query and reads until the EOT symbol.
package cepgo
import (
	"bufio"
	"encoding/json"
	"errors"
	"fmt"
	"runtime"
	"github.com/tarm/goserial"
)
const (
	requestPattern = "<\n%s\n>"
	EOT            = '\x04'  
)
var (
	SerialPort string = "/dev/ttyS1"
	Baud       int    = 115200
)
func init() {
	if runtime.GOOS == "windows" {
		SerialPort = "COM2"
	}
}