Apparently the function bool send(unsigned char*, int) is not declared...but I am looking at it in the .h file. Or at least I think so...can someone point out to me what I am missing here?
Code:
#ifndef ROBOT_H
#define ROBOT_H
#include "rs232.h"
class Robot
{
public:
Robot(int, int);
virtual ~Robot();
int& getPort();
void setPort(int&);
int& getBaudRate();
void setBaudRate(int&);
SerialConnect& getConnection();
bool send(unsigned char*, int);
private:
int port;
int baudrate;
SerialConnect connection;
};
#endif // ROBOT_H
Code:
#include "Robot.h"
Robot::Robot(int portNo, int br) : port(portNo), baudrate(br) {
if(connection.OpenComport(port, baudrate))
printf("no worked\n");
else
printf("worked\n");
} //END ROBOT()
Robot::~Robot() {
connection.CloseComport(port);
} //END ~ROBOT()
SerialConnect& Robot::getConnection() {return connection;}
int& Robot::getPort() {return port;}
void Robot::setPort(int& p) {port = p;}
int& Robot::getBaudRate() {return baudrate;}
void Robot::setBaudRate(int& br) {baudrate = br;}
bool Robot::send(unsigned char* bytes, int size) {
if(connection.SendBuf(port, bytes, size) == -1)
return false;
else
return true;
} //END SEND
The error is -
Robot.cpp:24: error: no ‘bool Robot::send(unsigned char*, int)’ member function declared in class ‘Robot’
Thanks.