This was a helpful starting point, but it only works after fixing a couple of important SPI setup problems.
- Instead of wiringPiSPISetup, it needs to use wiringPiSPISetupMode, with SPI_MODE=1
- It suffers from this WiringPi-Python bug, and needs the same workaround of creating a new string inside the call to wiringPiSPIDataRW: https://github.com/WiringPi/WiringPi-Python/issues/25
This was a helpful starting point, but it only works after fixing a couple of important SPI setup problems.