blob: e318726f664e29c7ac2040805948612ac95df7fc [file] [log] [blame]
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <string>
#include <vector>
// NOLINTNEXTLINE(cert-dcl58-cpp)
namespace google
{
namespace hoth
{
/**
* @brief Represents an interface for sending and receiving messages to and from
* a Hoth device
*/
class MessageIntf
{
public:
virtual ~MessageIntf() = default;
/** @brief Sends the entire buffer to the hoth mailbox
*
* @param[out] buf - The data we are sending to the hoth
* @param[out] seek - The position in the mailbox to write the data
* @throws Exceptions for issues sending the data.
*/
virtual void send(const uint8_t* buf, size_t size, size_t seek) = 0;
/** @brief Receives the entire buffer from the hoth mailbox
*
* @param[in] buf - The data we are reading from the hoth
* @param[out] seek - The position in the mailbox to write the data
* @throws Exceptions for issues sending the data.
*/
virtual void recv(uint8_t* buf, size_t size, size_t seek) = 0;
};
} // namespace hoth
} // namespace google