Sending data to Master from Slave in SPI

Hi,
I have attached two Arduino using SPI protocol. I have successful in sending data from Master to Slave via SPI.

But i am not getting a way that how we can send data from Slave to Master. Please help me with some sample code.

Thanks.

Please help me with some sample code.

There is sample code that comes with the SPI library.

Usually, one registers a callback function on the slave. That function gets called when the master sends data. In the callback function, use Wire.write() to send data back to the master.