fixed spi read and write (#1499)
Build and Deploy on local RHEL9 / build (push) Successful in 2m1s
Build on RHEL9 docker image / build (push) Successful in 4m10s
Build and Deploy on local RHEL8 / build (push) Successful in 5m9s
Build on RHEL8 docker image / build (push) Successful in 5m11s
Run Simulator Tests on local RHEL9 / build (push) Successful in 20m12s
Run Simulator Tests on local RHEL8 / build (push) Failing after 9m47s

* fixed spi read and write

* use c array to send chip id etc
This commit is contained in:
2026-07-29 15:29:34 +02:00
committed by GitHub
parent 160d793f71
commit 7f200d49a0
+8 -3
View File
@@ -4020,16 +4020,21 @@ void Module::simulatingActivityinDetector(const std::string &functionType,
std::vector<uint8_t> Module::readSpi(int chip_id, int register_id,
int n_bytes) const {
auto client = createDetectorSocket();
int args[] = {chip_id, register_id, n_bytes};
return sendToDetector<std::vector<uint8_t>>(F_SPI_READ, args);
client.sendCommand(F_SPI_READ, &args, sizeof(args));
std::vector<uint8_t> retval(n_bytes);
client.readReply(retval.data(), retval.size());
return retval;
}
std::vector<uint8_t> Module::writeSpi(int chip_id, int register_id,
const std::vector<uint8_t> &data) {
int count = static_cast<int>(data.size());
int args[] = {chip_id, register_id, count};
auto client = createDetectorSocket();
client.sendCommand(F_SPI_WRITE, args, sizeof(args));
int args[] = {chip_id, register_id, count};
client.sendCommand(F_SPI_WRITE, &args, sizeof(args));
client.Send(data);
// Read the output from the SPI write. This contains the data before the
// write