func (this ModbusRTUConnection) SetDebug(flag bool) {
	var f C.int = 0
	if flag {
		f = 1
	}
	C.modbus_set_debug(this.ctx, f)
}
Esempio n. 2
0
// The modbus_set_debug() function shall set the debug flag of the modbus_t context by using the argument flag. By default, the boolean flag is set to FALSE. When the flag value is set to TRUE, many verbose messages are displayed on stdout and stderr. For example, this flag is useful to display the bytes of the Modbus messages.
func (this *RtuConnection) Set_debug(debug bool) {
	var flag C.int = C.FALSE
	if debug {
		flag = C.TRUE
	}
	C.modbus_set_debug(this.ctx, flag)
}