How can I control the speed and direction of dc motor at the same time (through Bluetooth
Use delimiters to separate the two values you are sending over bluetooth.

Something like

"30,5\n"


instead of

"30\n"
"5\n"


On the Arduino side, read the the incoming string into a char array and add a \0 after the last read character to make it a C string. The use strtok() to parse the C string and atoi() or atof() to convert the parsed C strings to an int or float.

See this answer for more information about parsing a string.