func GpsStream(gpsData *GpsData, intflags uint) error { g := (*C.struct_gps_data_t)(gpsData) b, err := C.gps_stream(g, C.uint(intflags), nil) if b != 0 { errno := err.(syscall.Errno) return errors.New(C.GoString(C.gps_errstr(C.int(errno)))) } return nil }
func GpsUnpack(buf []byte, gpsData *GpsData) error { g := (*C.struct_gps_data_t)(gpsData) b, err := C.gps_unpack((*C.char)(unsafe.Pointer(&buf[0])), g) if b != 0 { errno := err.(syscall.Errno) return errors.New(C.GoString(C.gps_errstr(C.int(errno)))) } return nil }
func GpsOpen(host string, port string, gpsData *GpsData) error { g := (*C.struct_gps_data_t)(gpsData) h := C.CString(host) defer C.free(unsafe.Pointer(h)) p := C.CString(port) defer C.free(unsafe.Pointer(p)) b, err := C.gps_open(h, p, g) if b != 0 { errno := err.(syscall.Errno) return errors.New(C.GoString(C.gps_errstr(C.int(errno)))) } return nil }