Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: aacba8043dc1
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 31d85557ea58
Choose a head ref
  • 1 commit
  • 7 files changed
  • 1 contributor

Commits on May 25, 2020

  1. Added IsCommandBatchingSupported() to SCPITransport. Fixes #119. Fixe…

    …d signed/unsigned mismatch in SCPILXITransport.
    azonenberg committed May 25, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    makenowjust Hiroya Fujinami
    Copy the full SHA
    31d8555 View commit details
13 changes: 9 additions & 4 deletions scopehal/SCPILxiTransport.cpp
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ SCPILxiTransport::SCPILxiTransport(string args)
// I haven't been able to fetch waveforms larger than 1.4M (for reasons unknown.)
// Maybe we should reduce this number...
m_staging_buf_size = 150000000;
m_staging_buf = new char[m_staging_buf_size];
m_staging_buf = new unsigned char[m_staging_buf_size];
if (m_staging_buf == NULL)
return;
m_data_in_staging_buf = 0;
@@ -87,7 +87,7 @@ SCPILxiTransport::SCPILxiTransport(string args)

SCPILxiTransport::~SCPILxiTransport()
{
delete(m_staging_buf);
delete[] m_staging_buf;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -109,7 +109,7 @@ bool SCPILxiTransport::SendCommand(string cmd)
{
LogTrace("Sending %s\n", cmd.c_str());

int result = lxi_send(m_device, cmd.c_str(), cmd.length(), m_timeout);
int result = lxi_send(m_device, cmd.c_str(), cmd.length(), m_timeout);

m_data_in_staging_buf = 0;
m_data_offset = 0;
@@ -144,7 +144,7 @@ string SCPILxiTransport::ReadReply()
void SCPILxiTransport::SendRawData(size_t len, const unsigned char* buf)
{
// XXX: Should this reset m_data_depleted just like SendCommmand?
lxi_send(m_device, (const char *)buf, len, m_timeout);
lxi_send(m_device, (const char *)buf, len, m_timeout);
}

void SCPILxiTransport::ReadRawData(size_t len, unsigned char* buf)
@@ -187,3 +187,8 @@ void SCPILxiTransport::ReadRawData(size_t len, unsigned char* buf)
LogDebug("ReadRawData: data depleted.\n");
}
}

bool SCPILxiTransport::IsCommandBatchingSupported()
{
return false;
}
2 changes: 2 additions & 0 deletions scopehal/SCPILxiTransport.h
Original file line number Diff line number Diff line change
@@ -53,6 +53,8 @@ class SCPILxiTransport : public SCPITransport
virtual void ReadRawData(size_t len, unsigned char* buf);
virtual void SendRawData(size_t len, const unsigned char* buf);

virtual bool IsCommandBatchingSupported();

TRANSPORT_INITPROC(SCPILxiTransport)

std::string GetHostname()
5 changes: 5 additions & 0 deletions scopehal/SCPISocketTransport.cpp
Original file line number Diff line number Diff line change
@@ -124,3 +124,8 @@ void SCPISocketTransport::ReadRawData(size_t len, unsigned char* buf)
{
m_socket.RecvLooped(buf, len);
}

bool SCPISocketTransport::IsCommandBatchingSupported()
{
return true;
}
2 changes: 2 additions & 0 deletions scopehal/SCPISocketTransport.h
Original file line number Diff line number Diff line change
@@ -55,6 +55,8 @@ class SCPISocketTransport : public SCPITransport
virtual void ReadRawData(size_t len, unsigned char* buf);
virtual void SendRawData(size_t len, const unsigned char* buf);

virtual bool IsCommandBatchingSupported();

TRANSPORT_INITPROC(SCPISocketTransport)

std::string GetHostname()
2 changes: 2 additions & 0 deletions scopehal/SCPITransport.h
Original file line number Diff line number Diff line change
@@ -53,6 +53,8 @@ class SCPITransport
virtual void ReadRawData(size_t len, unsigned char* buf) =0;
virtual void SendRawData(size_t len, const unsigned char* buf) =0;

virtual bool IsCommandBatchingSupported() =0;

public:
typedef SCPITransport* (*CreateProcType)(std::string args);
static void DoAddTransportClass(std::string name, CreateProcType proc);
5 changes: 5 additions & 0 deletions scopehal/VICPSocketTransport.cpp
Original file line number Diff line number Diff line change
@@ -202,3 +202,8 @@ void VICPSocketTransport::ReadRawData(size_t len, unsigned char* buf)
{
m_socket.RecvLooped(buf, len);
}

bool VICPSocketTransport::IsCommandBatchingSupported()
{
return true;
}
2 changes: 2 additions & 0 deletions scopehal/VICPSocketTransport.h
Original file line number Diff line number Diff line change
@@ -55,6 +55,8 @@ class VICPSocketTransport : public SCPITransport
virtual void ReadRawData(size_t len, unsigned char* buf);
virtual void SendRawData(size_t len, const unsigned char* buf);

virtual bool IsCommandBatchingSupported();

//VICP constant helpers
enum HEADER_OPS
{