mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-23 06:30:04 +00:00
62a104f75d
* Added TERMINATE command * Help text update * Created ras_util namespace * Created protobuf_util namespace * Extracted RascsiImage from rascsi for better modularity * Fixed wrong filenames (class name differed) * No need for response handler to be a singleton * Class renaming * Renaming * Moved code * Moved code * Image folder handling optimizations * Updated device factory handling * DeviceFactory constructor should be private (singleton) * Renamed TERMINATE to SHUT_DOWN * Fixed capacity calculation for INQUIRY data * ATTACH and DETACH return the resulting device list for convenience * Interface comment update * Moved code, check fd * Use new command when returning result for ATTACH/DETACH * Updated interface comments
35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator RaSCSI (*^..^*)
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2021 Uwe Seimet
|
|
//
|
|
// Helper methods for serializing/deserializing protobuf messages
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "google/protobuf/message.h"
|
|
#include "rascsi_interface.pb.h"
|
|
#include <sstream>
|
|
#include <string>
|
|
|
|
using namespace std;
|
|
using namespace rascsi_interface;
|
|
|
|
namespace protobuf_util
|
|
{
|
|
const string GetParam(const PbCommand&, const string&);
|
|
const string GetParam(const PbDeviceDefinition&, const string&);
|
|
void AddParam(PbCommand&, const string&, const string&);
|
|
void AddParam(PbDevice&, const string&, const string&);
|
|
void AddParam(PbDeviceDefinition&, const string&, const string&);
|
|
void SerializeMessage(int, const google::protobuf::Message&);
|
|
void DeserializeMessage(int, google::protobuf::Message&);
|
|
int ReadNBytes(int, uint8_t *, int);
|
|
bool ReturnStatus(int, bool = true, const string = "");
|
|
bool ReturnStatus(int, bool, const ostringstream&);
|
|
}
|