iyus / simple-modbus

Simple Modbus Library for Arduino
9 stars 2 forks source link

cannot convert 'Serial_*' to 'HardwareSerial*' for modbus_configure #27

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi I'm using the arduino IDE 1.5.6 and arduino YUN to test it, but it give me 
this error "cannot convert 'Serial_*' to 'HardwareSerial*' for argument '1' to 
'void modbus_configure(HardwareSerial*, long int, unsigned char, unsigned int, 
unsigned int, unsigned char, unsigned char, Packet*, unsigned int)'" How to 
solve this?

Original issue reported on code.google.com by Drago9...@gmail.com on 17 Apr 2014 at 7:51

GoogleCodeExporter commented 9 years ago
Only tested on V1.05 onwards

Original comment by bester.j...@gmail.com on 5 May 2014 at 9:51

bernardocrodrigues commented 4 years ago

Try the following casts. Use "b" as the Serial port argument. I use this on a similar library.

Serial_ a = Serial;
HardwareSerial *b = (HardwareSerial*) &a;

Cheers.