mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-22 15:30:09 +00:00
41bdcd4aed
* Update logging * Remove duplicate code * Update unit tests * Clean up includes * Merge ProtobufSerializer into protobuf_util namespace * Precompile regex * Add const * Add Split() convenience method, update log level/ID parsing * Move log.h to legacy folder * Elimininate gotos * Fixes for gcc 13 * Update compiler flags * Update default folder handling * Use references instead of pointers * Move code for better encapsulation * Move code * Remove unused method argument * Move device logger * Remove redundant to_string * Rename for consistency * Update handling of protobuf pointers * Simplify protobuf usage * Memory handling update * Add hasher
57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator PiSCSI
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2022-2023 Uwe Seimet
|
|
//
|
|
// Host Services with realtime clock and shutdown support
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "mode_page_device.h"
|
|
#include <span>
|
|
#include <vector>
|
|
#include <map>
|
|
|
|
class HostServices: public ModePageDevice
|
|
{
|
|
|
|
public:
|
|
|
|
explicit HostServices(int lun) : ModePageDevice(SCHS, lun) {}
|
|
~HostServices() override = default;
|
|
|
|
bool Init(const param_map&) override;
|
|
|
|
vector<uint8_t> InquiryInternal() const override;
|
|
void TestUnitReady() override;
|
|
|
|
protected:
|
|
|
|
void SetUpModePages(map<int, vector<byte>>&, int, bool) const override;
|
|
|
|
private:
|
|
|
|
using mode_page_datetime = struct __attribute__((packed)) {
|
|
// Major and minor version of this data structure (e.g. 1.0)
|
|
uint8_t major_version;
|
|
uint8_t minor_version;
|
|
// Current date and time, with daylight savings time adjustment applied
|
|
uint8_t year; // year - 1900
|
|
uint8_t month; // 0-11
|
|
uint8_t day; // 1-31
|
|
uint8_t hour; // 0-23
|
|
uint8_t minute; // 0-59
|
|
uint8_t second; // 0-59
|
|
};
|
|
|
|
void StartStopUnit() const;
|
|
int ModeSense6(cdb_t, vector<uint8_t>&) const override;
|
|
int ModeSense10(cdb_t, vector<uint8_t>&) const override;
|
|
|
|
void AddRealtimeClockPage(map<int, vector<byte>>&, bool) const;
|
|
};
|