How to change the topic_name string to PROGMEM in rosserial_arduino?
Hello,
I'm trying to save SRAM on my Arduino pro mini by going through some libraries. I've noticed that to use my Arduino as a ROS node the library stores the topic name and message type as constants.
class Publisher
{
public:
Publisher( const char * topic_name, Msg * msg, int endpoint=rosserial_msgs::TopicInfo::ID_PUBLISHER) :
topic_(topic_name),
msg_(msg),
endpoint_(endpoint) {};
int publish( const Msg * msg ) { return nh_->publish(id_, msg); };
int getEndpointType(){ return endpoint_; }
const char * topic_;
Msg *msg_;
// id_ and no_ are set by NodeHandle when we advertise
int id_;
NodeHandleBase_* nh_;
private:
int endpoint_;
};
How can I store the constants to PROGMEM? As these are pointers, I am confused. Thank you.