deprecated conversion from string constant to 'char*'

hello

I have the following line and compiler say that PBREADY conversation to char* is deprecated
if (!switch_off) return Serial1.find("+PBREADY");

please advise how to fix?

alexblade:
hello

I have the following line and compiler say that PBREADY conversation to char* is deprecated
if (!switch_off) return Serial1.find("+PBREADY");

please advise how to fix?

You would have to fix the Stream class in the Arduino core library itself. Some bozo decided to make the Stream::find method take a char * and not a const char *.

Or just live with the warning. It doesn't hurt anything.

Or, use a cast to make the warning go away:

if (!switch_off) 
  return Serial1.find((char *)"+PBREADY");