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-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 42f16d3c1c34
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c53ef0cacaf4
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 11, 2020

  1. Copy the full SHA
    c53ef0c View commit details
Showing with 10 additions and 34 deletions.
  1. +10 −34 glscopeclient/main.cpp
44 changes: 10 additions & 34 deletions glscopeclient/main.cpp
Original file line number Diff line number Diff line change
@@ -215,57 +215,33 @@ int main(int argc, char* argv[])
}


//Initialize the protocol decoder and measurement libraries
//Initialize object creation tables
TransportStaticInit();
ScopeProtocolStaticInit();
ScopeMeasurementStaticInit();

//Connect to the scope(s)
for(auto s : scopes)
{
//Scope format: name:api:host[:port]
//Scope format: name:driver:transport:args
char nick[128];
char driver[128];
char trans[128];
char host[128];
int port = 0;
if(5 != sscanf(s.c_str(), "%127[^:]:%127[^:]:%127[^:]:%127[^:]:%d", nick, driver, trans, host, &port))
char args[128];
if(4 != sscanf(s.c_str(), "%127[^:]:%127[^:]:%127[^:]:%127s", nick, driver, trans, args))
{
if(4 != sscanf(s.c_str(), "%127[^:]:%127[^:]:%127[^:]:%127[^:]", nick, driver, trans, host))
{
LogError("Invalid scope string %s\n", s.c_str());
continue;
}
}

//Special case default ports depending on protocol
string sdriver = driver;
string strans = trans;
if(port == 0)
{
if(strans == "vicp") //IANA port for SCPI over VICP
port = 1861;
else if(strans == "lan") //IANA port for SCPI over TCP
{
port = 5025;
if(sdriver == "rigol") //Rigol is weird and uses a nonstandard port
port = 5555;
}
LogError("Invalid scope string %s\n", s.c_str());
continue;
}

//Create the transport
SCPITransport* transport = NULL;
if(strans == "vicp")
transport = new VICPSocketTransport(host, port);
else if(strans == "lan")
transport = new SCPISocketTransport(host, port);
else
{
LogError("Invalid transport %s\n", trans);
SCPITransport* transport = SCPITransport::CreateTransport(trans, args);
if(transport == NULL)
continue;
}

//Create the scope
Oscilloscope* scope = NULL;
string sdriver(driver);
if(sdriver == "akila")
scope = new AntikernelLogicAnalyzer(transport);
else if(sdriver == "agilent")