RASCSI/src/raspberrypi/monitor/data_sample.cpp
akuker b52abbfdc7
Output higher-level report from scsimon (#596)
* Output JSON file for post-processing

* Debug utility for parsing the SCSI data

* Prototype app for parsing scsi captures

* correct arg parsing

* output html

* Cleanupt html output

* Add missing include

* Allow compilation on non-Linux platforms

* Refactored scsimon to be in multiple files

* Refactored away

* Restructured scsimon into smaller pieces

* Added ability to read in pre-generated .json file and re-parse it

* Delete scsiparse.cpp

* Fix argument parsing and code cleanup

* Ran vscode c++ formatting utility

* Restore the -Wno-psabi flag for Linux only

* Address compiler warnings

* Updated to use C++ style ostreams

* Cleanup conversion to c++ style ostreams

* Updated to use ofstream instead of fprintf

* Delete src/raspberrypi/scsimon directory

Co-authored-by: akuker <akuker@gmail.com>
2022-01-07 12:17:44 -06:00

39 lines
832 B
C++

//---------------------------------------------------------------------------
//
// SCSI Target Emulator RaSCSI (*^..^*) for Raspberry Pi
//
// Copyright (C) 2020-2021 akuker
//
// [ SCSI Bus Monitor ]
//
//---------------------------------------------------------------------------
#include "os.h"
#include "scsi.h"
#include "data_sample.h"
const char *GetPhaseStr(const data_capture *sample)
{
return BUS::GetPhaseStrRaw(GetPhase(sample));
}
BUS::phase_t GetPhase(const data_capture *sample)
{
// Selection Phase
if (GetSel(sample))
{
return BUS::selection;
}
// Bus busy phase
if (!GetBsy(sample))
{
return BUS::busfree;
}
// Get target phase from bus signal line
DWORD mci = GetMsg(sample) ? 0x04 : 0x00;
mci |= GetCd(sample) ? 0x02 : 0x00;
mci |= GetIo(sample) ? 0x01 : 0x00;
return BUS::GetPhase(mci);
}