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: 60c4eab073a2
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d09c151a2d39
Choose a head ref
  • 1 commit
  • 9 files changed
  • 1 contributor

Commits on Mar 11, 2020

  1. Copy the full SHA
    d09c151 View commit details
5 changes: 5 additions & 0 deletions scopehal/AntikernelLogicAnalyzer.cpp
Original file line number Diff line number Diff line change
@@ -93,6 +93,11 @@ AntikernelLogicAnalyzer::~AntikernelLogicAnalyzer()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Information queries

string AntikernelLogicAnalyzer::GetTransportName()
{
return m_transport->GetName();
}

string AntikernelLogicAnalyzer::GetTransportConnectionString()
{
return m_transport->GetConnectionString();
1 change: 1 addition & 0 deletions scopehal/AntikernelLogicAnalyzer.h
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@ class AntikernelLogicAnalyzer
virtual ~AntikernelLogicAnalyzer();

virtual std::string GetTransportConnectionString();
virtual std::string GetTransportName();
virtual std::string GetDriverName();

virtual std::string GetName();
4 changes: 3 additions & 1 deletion scopehal/Oscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -172,7 +172,9 @@ string Oscilloscope::SerializeConfiguration(map<void*, int>& idmap, int& nextID)
config += tmp;
snprintf(tmp, sizeof(tmp), " serial: \"%s\"\n", GetSerial().c_str());
config += tmp;
snprintf(tmp, sizeof(tmp), " transport: \"%s\"\n", GetTransportConnectionString().c_str());
snprintf(tmp, sizeof(tmp), " transport: \"%s\"\n", GetTransportName().c_str());
config += tmp;
snprintf(tmp, sizeof(tmp), " args: \"%s\"\n", GetTransportConnectionString().c_str());
config += tmp;
snprintf(tmp, sizeof(tmp), " driver: \"%s\"\n", GetDriverName().c_str());
config += tmp;
5 changes: 5 additions & 0 deletions scopehal/Oscilloscope.h
Original file line number Diff line number Diff line change
@@ -352,6 +352,11 @@ class Oscilloscope : public virtual Instrument
*/
virtual std::string GetTransportConnectionString() =0;

/**
@brief Gets the name of our transport
*/
virtual std::string GetTransportName() =0;

/**
@brief Gets the registered name of this driver
*/
7 changes: 6 additions & 1 deletion scopehal/SCPIOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2019 Andrew D. Zonenberg *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -48,6 +48,11 @@ SCPIOscilloscope::~SCPIOscilloscope()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Accessors

string SCPIOscilloscope::GetTransportName()
{
return m_transport->GetName();
}

string SCPIOscilloscope::GetTransportConnectionString()
{
return m_transport->GetConnectionString();
3 changes: 2 additions & 1 deletion scopehal/SCPIOscilloscope.h
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2019 Andrew D. Zonenberg *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -41,6 +41,7 @@ class SCPIOscilloscope : public Oscilloscope
virtual ~SCPIOscilloscope();

virtual std::string GetTransportConnectionString();
virtual std::string GetTransportName();

virtual std::string GetName();
virtual std::string GetVendor();
2 changes: 1 addition & 1 deletion scopehal/SCPISocketTransport.cpp
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ string SCPISocketTransport::GetTransportName()
string SCPISocketTransport::GetConnectionString()
{
char tmp[256];
snprintf(tmp, sizeof(tmp), "lan:%s:%u", m_hostname.c_str(), m_port);
snprintf(tmp, sizeof(tmp), "%s:%u", m_hostname.c_str(), m_port);
return string(tmp);
}

5 changes: 4 additions & 1 deletion scopehal/SCPITransport.h
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@ class SCPITransport
virtual ~SCPITransport();

virtual std::string GetConnectionString() =0;
virtual std::string GetName() =0;

virtual bool SendCommand(std::string cmd) =0;
virtual std::string ReadReply() =0;
@@ -69,7 +70,9 @@ class SCPITransport
static SCPITransport* CreateInstance(std::string args) \
{ \
return new T(args); \
}
} \
virtual std::string GetName() \
{ return GetTransportName(); }

#define AddTransportClass(T) SCPITransport::DoAddTransportClass(T::GetTransportName(), T::CreateInstance)

2 changes: 1 addition & 1 deletion scopehal/VICPSocketTransport.cpp
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ string VICPSocketTransport::GetTransportName()
string VICPSocketTransport::GetConnectionString()
{
char tmp[256];
snprintf(tmp, sizeof(tmp), "vicp:%s:%u", m_hostname.c_str(), m_port);
snprintf(tmp, sizeof(tmp), "%s:%u", m_hostname.c_str(), m_port);
return string(tmp);
}