i have code, pcRead() that handles commands thru the serial monitor interface, Serial. I have a BluetoothSerial interface, serialBt.
i’d like to pass a more generic serial argument to pcRead that can be either Serial or serialBt.
i got the following error when I tried defining pcRead with a “Stream” argument
In file included from C:\stuff\RR\ArduinoRR\Koala\Koala.ino:11:0: pcRead.h:4: error: cannot declare parameter 'serial' to be of abstract type 'Stream' int pcRead (Stream serial);
can I and if so, how can I defining an argument to pcRead that can be either Serial or serialBT?
here is pcRead.h
#ifndef PC_READ_H # define PC_READ_H int pcRead (Stream serial); #endif
Koala.ino (12.2 KB)
pcRead.cpp (6.44 KB)