Esempio n. 1
0
// Gets the number of bytes waiting in the input buffer.
func (p *Port) InputWaiting() (int, error) {
	c := C.sp_input_waiting(p.p)
	if c < 0 {
		return 0, errmsg(c)
	}
	return int(c), nil
}
Esempio n. 2
0
// Waiting returns the number of bytes waiting on success or an error code.
func Waiting(port Port) (int32, error) {
	var result int32 = SP_OK
	result = C.sp_input_waiting(port)
	return result, checkResult(result)
}