Programmatically connect two Bluetooth Bee-Standalone

Hi,
I buyed two Bluetooth Bee-Standalone and I need to connect these.
I read this topic, but I need to connect its programmatically using Arduino code, not using serial monitor or any PC.
I need to put the connecting logic in Arduino code. In Bluetooth Bee-Standalone wiki i saw only slave example.
I tried to edit it:

void setupBlueToothConnection()
{
    blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
    delay(1000);
    sendBlueToothCommand("\r\n+STWMOD=1\r\n"); // set MASTER
    delay(2000);
    sendBlueToothCommand("\r\n+CONN=0,6A,8E,16,C4,EA\r\n"); // connect to my SLAVE
    delay(200);
    sendBlueToothCommand("\r\n+RTPIN=0000\r\n");  // set pin code
    delay(2000);

}

I got CONNECT:FAIL from my serial monitor.
I tried to change delay, but nothing to do.
The slave is correct because I can connect with my computer typing pin code.

What I wrong ?

Thanks

Hi,

Please refer to Bluetooth Bee Master/Slave Config. The complete set of commands for configuring the Bluetooth Bee as Master or Slave is described there. This would apply to Bluethooth Bee Standalone as well.

Thanks