Ejemplo n.º 1
0
//-------------------DinvAddend---------------------/
func injectClock(w *bufio.Writer, goVecLogger *govec.GoLog) error {
	//dinvadded
	if _, err := w.Write(goVecLogger.PrepareSend("SendingRPC", nil)); err != nil {
		return err
	}
	var blockByte byte = 0xfe
	if err := w.WriteByte(blockByte); err != nil {
		return err
	}
	return nil
}
Ejemplo n.º 2
0
func extractClock(r *bufio.Reader, goVecLogger *govec.GoLog) error {
	buffer, buffDone := make([]byte, 0), false
	for !buffDone {
		bite, err := r.ReadByte()
		if err != nil {
			return err
		}

		//print(bite, " ")
		if bite == 0xfe {
			buffDone = true
		} else {
			buffer = append(buffer, bite)
		}
	}
	goVecLogger.UnpackReceive("Received", buffer[0:])
	return nil
}