If you're not sure what your receive, connect SDI (MISO) to VDD and run your program. You will receive 0xff. Then connect it to VSS and repeat. You will receive 0x00. Then connect it to SDO (MOSI). You will receive a copy of what you transmit. If that's the case, then your code receives correctly what's on the line.