help to send comand line via bluetooth

Hello everyone, I'm new at this.

I need help with a sketch

as I spend a serial line to a command line.

ok let me explain I want to send a line
for example
sendSony, 0x000000,32

the arduino read me become a command line something like
irsend.sendSony(0xa90, 12);

here I leave to amend a sketch for testing but does not work me

#include <IRremote.h>
char myChar ;
IRsend irsend;

void setup()
{
  Serial.begin(9600);
 
}

void loop() {
  while(Serial.available() > 0){
    for (int i = 0; i < 3; i++){
    myChar = Serial.read();
    Serial.print(myChar); //echo
      delay(40);
    }
  }
}

here is an example that contains the library

IRsend irsend;

void setup()
{
  Serial.begin(9600);
}

void loop() {
  if (Serial.read() != -1) {
    for (int i = 0; i < 3; i++) {
      irsend.sendSony(0xa90, 12); // Sony TV power code
      delay(40);
    }
  }

}
void loop() {
  while(Serial.available() > 0){
    for (int i = 0; i < 3; i++){
    myChar = Serial.read();
    Serial.print(myChar); //echo
      delay(40);
    }
  }
}

for (int i = 0; i < 3; i++) what this for?

I am following the lines of the example to work with IrRemote library

  while(Serial.available() > 0){
    for (int i = 0; i < 3; i++){
    myChar = Serial.read();

When there is at least one byte to read, read all 3 of them. That will almost never work.

If you know that there are three bytes in a packet, you need to wait for three bytes to be available to read before you read anything.

However, "sendSony, 0x000000,32" is NOT three bytes. It's also unnecessarily complex. There are not that many IR protocols. Instead of "sendSony", you could send "S". Instead of sending the value in hex, send it in decimal. Then, when there is one byte to read, the protocol to use, read it, and then call Serial.parseInt() to read the 1st value, and call Serial.parseInt() again to read the 2nd value.

The parseInt() function is a blocking function. That means that it will wait for the data to arrive.

Once you have the protocol and the two values, calling the appropriate function is trivial.