diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index 62874e0f8..87180a8d0 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -4020,16 +4020,23 @@ void Module::simulatingActivityinDetector(const std::string &functionType, std::vector Module::readSpi(int chip_id, int register_id, int n_bytes) const { - int args[] = {chip_id, register_id, n_bytes}; - return sendToDetector>(F_SPI_READ, args); + auto client = createDetectorSocket(); + client.sendCommand(F_SPI_READ, &chip_id, sizeof(chip_id)); + client.Send(®ister_id, sizeof(register_id)); + client.Send(&n_bytes, sizeof(n_bytes)); + + std::vector retval(n_bytes); + client.readReply(retval.data(), retval.size()); + return retval; } std::vector Module::writeSpi(int chip_id, int register_id, const std::vector &data) { int count = static_cast(data.size()); - int args[] = {chip_id, register_id, count}; auto client = createDetectorSocket(); - client.sendCommand(F_SPI_WRITE, args, sizeof(args)); + client.sendCommand(F_SPI_WRITE, &chip_id, sizeof(chip_id)); + client.Send(®ister_id, sizeof(register_id)); + client.Send(&count, sizeof(count)); client.Send(data); // Read the output from the SPI write. This contains the data before the // write