two Arduino boards communicating on I2C

Hi…!!!
I have connected two Arduino board with I2C and trying to communicate but it is giving some wrong answer

Code for board1

#include <Wire.h>
int mm;

void setup()
{Wire.begin(0x05);
Serial.begin(9600); 
}
void loop()
{int rtrn;
 
byte outgoingByte[12] = {0x50,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B};


//For payload camera
 Wire.beginTransmission(6);
 //for(mm=0;mm<12;mm++)
// Wire.write(outgoingByte, sizeof outgoingByte);
  Wire.write(0x1A);
 
 rtrn = Wire.endTransmission();
 delay(1000);
 Serial.println(" Returning Success on Writing to the Payload::");
Serial.println(rtrn,DEC);
//Wire.requestFrom(6, 2);    
//while(!Wire.available());    
char c = Wire.read();  

Serial.println("Payload data read:"); 
Serial.println(c,HEX);//}
delay(100);
Serial.println(' ');
Serial.println(' ');  }

Code for board2

#include <Wire.h>
int mm;
void setup()
{Wire.begin(0x06);
Serial.begin(9600); 
}
void loop()
{int rtrn;
 
byte outgoingByte[12] = {0x02,0x03,0x04,0x03,0x04,0x07,0x06,0x07,0x08,0x09,0x0A,0x0B};


//For payload camera
 Wire.beginTransmission(5);
  //Wire.write(outgoingByte, sizeof outgoingByte);
 Wire.write(0x1F);
 rtrn = Wire.endTransmission();
 delay(1000);
 Serial.println(" Returning Success on Writing to the Payload::");
Serial.println(rtrn,DEC);
//Wire.requestFrom(5, 2);    
//while(!Wire.available());    
char c = Wire.read();    
Serial.println("Payload data read:"); 
Serial.println(c,HEX);//}
delay(100);
Serial.println(' ');
Serial.println(' ');  }

Output both the sides are same

 Returning Success on Writing to the Payload::
0
Payload data read:
FFFFFFFF
 
 
 Returning Success on Writing to the Payload::
0
Payload data read:
FFFFFFFF
 
 
 Returning Success on Writing to the Payload::
0
Payload data read:
FFFFFFFF
 
 
 Returning Success on Writing to the Payload::
0
Payload data read:
FFFFFFFF
 
 
 Returning Success on Writing to the Payload::
0
Payload data read:
FFFFFFFF
 
 
 Returning Success on Writing to the Payload::
0
Payload data read:
FFFFFFFF
 
 
 Returning Success on Writing to the Payload::
0
Payload data read:
FFFFFFFF

There are a number of coding styles in general use. Some place the { at the end of the statement, like

void loop() {
if(something == somethingElse) [
while(notTimeToQuit) {

Some place the { on the next line, like

void loop()
{
if(something == somethingElse)
[
while(notTimeToQuit)
{

NONE of them call for placing ANYTHING on the line after the {. So, don't do that.

The coding styles ALL agree that the } goes on a line by itself. One } per line and NOTHING else on the line. Fix your code.

The coding styles also agree that indentation is to be consistent (and non-zero).

Now, I'm not a slave to convention, but your code is very hard to read.

Clearly, the commented out code is not part of your problem, so we don't need to see it. So, delete it.

But, it seems clear that you really don't understand I2C. There are no callbacks registered for when data is received. Using delay() and then expecting data to be present is not a good idea. Especially, since the other device is sitting on its hands doing nothing a lot, too.

Now, I'm not a slave to convention

That would explain the unconventional use of brackets, then:

if(something == somethingElse) [
if(something == somethingElse)
[

That would explain the unconventional use of brackets, then:

No, those would be explained by fat fingers. Or, really, a stupid sticky shift key. Damn thing.