# $Header: https://oberon.oapd.inaf.it/shins/trunk/shins/src/tiptilt_ctrl/bcu/Interface/Sharknir/Bcu/Bcu.basda 3830 2022-02-18 18:47:26Z depa $

include OverallDiagnosticRecord.h
include Nice/Config.h

include Nice/Time.h

sliceinc OverallDiagnosticRecordVar.ice
slicemap Sharknir::Bcu::SeqOverallDiagnosticRecord Sharknir::Bcu::SeqOverallDiagnosticRecordVar

namespace Sharknir

interface Bcu
completion CMD

    exception BcuServiceException : Basda::ServiceException;

    # This class of functions is more or less just a wrapper for set() or get() of the local client side property tree VAR.
    function[v] std::string   .NAME name()
    function[v] bool          .REACHABLE isReachable()
    # function[v] std::string .CFG.HVC.SERIAL_NUMBER hvcSerialNumber()
    function[v] std::string   .CFG.BCU.DSP_PROGRAM_PATH BcuDspProgramPath()
    # function[v] std::string .CFG.HVC.DSP_PROGRAM_PATH hvcDspProgramPath()

    # function[v] std::string   .CFG.DIAGNOSTICS.DESTINATION_IP diagnosticsDestinationIp()
    # function[v] std::string   .CFG.DIAGNOSTICS.DESTINATION_MAC diagnosticsDestinationMac()
    # function[v] int           .CFG.DIAGNOSTICS.DESTINATION_UDP_PORT diagnosticsDestinationUdpPort()
    function[v] std::string   .BCU.SVC.CFG.DIAGNOSTICS.DESTINATION_IP diagnosticsDestinationIp()
    function[v] std::string   .BCU.SVC.CFG.DIAGNOSTICS.DESTINATION_MAC diagnosticsDestinationMac()
    function[v] int           .BCU.SVC.CFG.DIAGNOSTICS.DESTINATION_UDP_PORT diagnosticsDestinationUdpPort()

    function[v] std::string   .DIAGNOSTICS.FRAME_RATE_HZ frameRateInHz()
    function[v] std::string   .SLOPE.TIP_TILT.RECEIVING_RATE_HZ tipTiltUnitFrameRateInHz()


    function[o] void resetDevices(int FIRST_DSP, int LAST_DSP, int ADDRESS, const Nice::SeqInt & BUFFER)

    function[o] void writeDsp  (int FIRST_DSP, int LAST_DSP, int ADDRESS, const Nice::SeqInt & BUFFER)
    function[o] void writeSdram(int FIRST_DSP, int LAST_DSP, int ADDRESS, const Nice::SeqInt & BUFFER)
    function[o] void writeSram (int FIRST_DSP, int LAST_DSP, int ADDRESS, const Nice::SeqInt & BUFFER)
    function[o] void writeDMIF (int FIRST_DSP, int LAST_DSP, int ADDRESS, const Nice::SeqInt & BUFFER)
    function[o] void writeShMRam (int FIRST_DSP, int LAST_DSP, int ADDRESS, const Nice::SeqInt & BUFFER)

    function[o] Nice::SeqInt readDsp  (int DSP_INDEX, int ADDRESS, int LENGTH_IN_DWORD)
    function[o] Nice::SeqInt readSdram(int DSP_INDEX, int ADDRESS, int LENGTH_IN_DWORD)
    function[o] Nice::SeqInt readSram (int DSP_INDEX, int ADDRESS, int LENGTH_IN_DWORD)
    function[o] Nice::SeqInt readShMRam (int DSP_INDEX, int ADDRESS, int LENGTH_IN_DWORD)
    function[o] Nice::SeqInt readDiags(int DSP_INDEX, int ADDRESS, int LENGTH_IN_DWORD)

    function[o] void uploadDspCode          (int FIRST_DSP, int LAST_DSP, const std::string & DSP_PROGRAM_PATH_ON_SERVER)
    function[o] void enableMasterDiagnostics(Nice::U16 DECIMATION_FACTOR, const std::string & REMOTE_HOST_IPV4_ADDRESS, const std::string & REMOTE_HOST_MAC_ADDRESS, Nice::U16 REMOTE_HOST_UDP_PORT)

    function[o] Sharknir::Bcu::SeqOverallDiagnosticRecord getPastOverallDiagnosticRecordsInOnePass        (int N_MAX_PAST_RECORDS)
    function[o] Sharknir::Bcu::SeqOverallDiagnosticRecord getPastCcdOverallDiagnosticRecordsInOnePass     (int N_MAX_PAST_RECORDS)
    function[o] Sharknir::Bcu::SeqOverallDiagnosticRecord getPastSlopeOverallDiagnosticRecordsInOnePass   (int N_MAX_PAST_RECORDS)
    function[o] Sharknir::Bcu::SeqOverallDiagnosticRecord getFutureOverallDiagnosticRecordsInOnePass      (int N_FUTURE_RECORDS, Nice::Time TIMEOUT)
    function[o] Sharknir::Bcu::SeqOverallDiagnosticRecord getFutureCcdOverallDiagnosticRecordsInOnePass   (int N_FUTURE_RECORDS, Nice::Time TIMEOUT)
    function[o] Sharknir::Bcu::SeqOverallDiagnosticRecord getFutureSlopeOverallDiagnosticRecordsInOnePass (int N_FUTURE_RECORDS, Nice::Time TIMEOUT)

    function[o] void createPastOverallDiagnosticRecordSnapshot(const std::string & COOKIE, int N_RECORDS)
    function[o] Sharknir::Bcu::SeqOverallDiagnosticRecord getPastOverallDiagnosticRecordsFromSnapshot(const std::string & COOKIE, int INCLUDING_BEGIN, int N_RECORDS)
    function[o] void freePastOverallDiagnosticRecordSnapshot(const std::string & COOKIE)

    function[o] void createPastSlopeOverallDiagnosticRecordSnapshot(const std::string & COOKIE, int N_RECORDS)
    function[o] Sharknir::Bcu::SeqOverallDiagnosticRecord getPastSlopeOverallDiagnosticRecordsFromSnapshot(const std::string & COOKIE, int INCLUDING_BEGIN, int N_RECORDS)
    function[o] void freePastSlopeOverallDiagnosticRecordSnapshot(const std::string & COOKIE)

    function[o] void createFutureOverallDiagnosticRecordSnapshot(const std::string & COOKIE, int N_RECORDS, Nice::Time TIMEOUT)
    function[o] Sharknir::Bcu::SeqOverallDiagnosticRecord getFutureOverallDiagnosticRecordsFromSnapshot(const std::string & COOKIE, int INCLUDING_BEGIN, int N_RECORDS)
    function[o] void freeFutureOverallDiagnosticRecordSnapshot(const std::string & COOKIE)

    function[o] void createFutureSlopeOverallDiagnosticRecordSnapshot(const std::string & COOKIE, int N_RECORDS, Nice::Time TIMEOUT)
    function[o] Sharknir::Bcu::SeqOverallDiagnosticRecord getFutureSlopeOverallDiagnosticRecordsFromSnapshot(const std::string & COOKIE, int INCLUDING_BEGIN, int N_RECORDS)
    function[o] void freeFutureSlopeOverallDiagnosticRecordSnapshot(const std::string & COOKIE)
