Guys, stuck in the middle...
I have a char string, debugCommand coming from Serial as bmsping.
I need to strip out only the ping and store it to bmsCommand.
I will always get different char Strings where the first 3 char will always be bms and rest part will be something else. like bmsC01 bmsD01 bmsping etc. It is a single string, no deliminator involved. Now, I tried using strncpy()
char debugCommand = "bmsping"; char bmsCommand; strcpy(bmsCommand, debugCommand, 3);
and that's a failure of my need as this gives bms. not ping. Using strstr() is also failed as all I want is to eliminate the bms and make a substring of whatever later.