ChimeraTK-DeviceAccess 03.25.00
Loading...
Searching...
No Matches
RebotProtocol0.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3#pragma once
4
6
7#include <boost/shared_ptr.hpp>
8
9#include <vector>
10
11namespace ChimeraTK {
12 namespace Rebot {
13 class Connection;
14 }
15
17 explicit RebotProtocol0(boost::shared_ptr<Rebot::Connection>& tcpCommunicator);
18 virtual ~RebotProtocol0() {};
19
20 virtual void read(uint32_t addressInBytes, int32_t* data, size_t sizeInBytes) override;
21 virtual void write(uint32_t addressInBytes, int32_t const* data, size_t sizeInBytes) override;
22 virtual void sendHeartbeat() override;
23
24 struct RegisterInfo {
26 uint32_t nWords;
27 // the constructor checks that the address and size are multiples of 4 and
28 // throws if this is not the case
29 RegisterInfo(uint32_t addressInBytes, uint32_t sizeInBytes);
30 };
31
32 // protected:
33 boost::shared_ptr<Rebot::Connection> _tcpCommunicator;
34 void fetchFromRebotServer(uint32_t wordAddress, uint32_t numberOfWords, int32_t* dataLocation) const;
35 void sendRebotReadRequest(const uint32_t wordAddress, const uint32_t wordsToRead) const;
36 static void transferVectorToDataPtr(const std::vector<uint32_t>& source, int32_t* destination);
37 };
38
39} // namespace ChimeraTK
void fetchFromRebotServer(uint32_t wordAddress, uint32_t numberOfWords, int32_t *dataLocation) const
static void transferVectorToDataPtr(const std::vector< uint32_t > &source, int32_t *destination)
virtual void sendHeartbeat() override
boost::shared_ptr< Rebot::Connection > _tcpCommunicator
void sendRebotReadRequest(const uint32_t wordAddress, const uint32_t wordsToRead) const
This is the base class of the code which implements the ReboT protocol.