diff --git a/src/libCom/GPIBNICom.cpp b/src/libCom/GPIBNICom.cpp index ea0a57076d4680edc10bbbf3d99c61eb8477b36d..f84484d28dc1e50bfcb174860c9d1320e4c62b4d 100644 --- a/src/libCom/GPIBNICom.cpp +++ b/src/libCom/GPIBNICom.cpp @@ -62,7 +62,7 @@ void GPIBNICom::setConfiguration(const nlohmann::json &config) { } } } -void GPIBNICom::send(char *buf, size_t length, bool critical = false) { +void GPIBNICom::send(char *buf, size_t length, bool critical) { checkInterlock(critical); if (!m_good) throw std::runtime_error( @@ -77,7 +77,7 @@ void GPIBNICom::send(char *buf, size_t length, bool critical = false) { throw std::runtime_error("GPIBNICom::send error from ibwrt"); } } -void GPIBNICom::send(const std::string &buf, bool critical = false) { +void GPIBNICom::send(const std::string &buf, bool critical) { checkInterlock(critical); char *mybuf = new char[buf.length()]; strcpy(mybuf, buf.c_str()); @@ -120,14 +120,14 @@ uint32_t GPIBNICom::receive(char *buf, size_t length) { } return retval; } -std::string GPIBNICom::sendreceive(const std::string &cmd, bool critical = false) { +std::string GPIBNICom::sendreceive(const std::string &cmd, bool critical) { ScopeLock lock(this); send(cmd, critical); return receive(); } void GPIBNICom::sendreceive(char *wbuf, size_t wlength, char *rbuf, - size_t rlength, bool critical = false) { + size_t rlength, bool critical) { ScopeLock lock(this); send(wbuf, wlength, critical); diff --git a/src/libCom/GPIBNICom.h b/src/libCom/GPIBNICom.h index 01b3be4579f4198a9dc58c624466fe520aa46298..3466f110e218ec7626f069ca80aacb0941567c4e 100644 --- a/src/libCom/GPIBNICom.h +++ b/src/libCom/GPIBNICom.h @@ -60,7 +60,7 @@ class GPIBNICom : public ICom { * \param length Number of characters in `buf` that should be sent * \param critical Interlock flag, true if interlock is monitoring the command */ - void send(char *buf, size_t length, bool critical); + void send(char *buf, size_t length, bool critical = false); /** Send data to device * @@ -69,7 +69,7 @@ class GPIBNICom : public ICom { * \param buf Data to be sent * \param critical Interlock flag, true if interlock is monitoring the command */ - void send(const std::string &buf, bool critical); + void send(const std::string &buf, bool critical = false); /** Read data from device * @@ -99,7 +99,7 @@ class GPIBNICom : public ICom { * * \return Returned data */ - std::string sendreceive(const std::string &cmd, bool critical); + std::string sendreceive(const std::string &cmd, bool critical = false); /** Send data to device and receive reply * @@ -113,7 +113,7 @@ class GPIBNICom : public ICom { * * \return Number of characters received */ - void sendreceive(char *wbuf, size_t wlength, char *rbuf, size_t rlength, bool critical); + void sendreceive(char *wbuf, size_t wlength, char *rbuf, size_t rlength, bool critical = false); protected: /** Request exlusive access to device. diff --git a/src/libCom/LXICom.cpp b/src/libCom/LXICom.cpp index 6b7caaa92e664f0a744ebb7171c171194b835e6b..da8b8f01bdf81cda9c5cd429726c9ff3637cb75f 100644 --- a/src/libCom/LXICom.cpp +++ b/src/libCom/LXICom.cpp @@ -16,8 +16,6 @@ #include <netdb.h> //hostent #include <netinet/tcp.h> // linux extension: socket options (timeout) #include <sys/socket.h> -#include <sys/file.h> -#include <sys/ioctl.h> // Register com #include "ComRegistry.h" @@ -156,13 +154,13 @@ void LXICom::init() { m_good = true; } -void LXICom::send(const std::string &buf, bool critical = false) { +void LXICom::send(const std::string &buf, bool critical) { checkInterlock(critical); logger(logDEBUG) << "LXICom::send " << buf; tcp_send(buf.c_str()); } -void LXICom::send(char *buf, size_t length, bool critical = false) { +void LXICom::send(char *buf, size_t length, bool critical) { checkInterlock(critical); send(std::string(buf, length), critical); } @@ -186,7 +184,7 @@ uint32_t LXICom::receive(char *buf, size_t length) { return (received.size() < length ? received.size() : length); } -std::string LXICom::sendreceive(const std::string &cmd, bool critical = false) { +std::string LXICom::sendreceive(const std::string &cmd, bool critical) { send(cmd, critical); std::string ret = receive(); @@ -194,7 +192,7 @@ std::string LXICom::sendreceive(const std::string &cmd, bool critical = false) { } void LXICom::sendreceive(char *wbuf, size_t wlength, char *rbuf, - size_t rlength, bool critical = false) { + size_t rlength, bool critical) { send(wbuf, wlength, critical); receive(rbuf, rlength); } diff --git a/src/libCom/LXICom.h b/src/libCom/LXICom.h index a878f3513d9bf40fd9f05bae5c1bb13ce6911415..f7b9f92117896e31361286e3bd51c1573dcc33b9 100644 --- a/src/libCom/LXICom.h +++ b/src/libCom/LXICom.h @@ -57,7 +57,7 @@ class LXICom : public ICom { * \param length Number of characters in `buf` that should be sent * \param critical Interlock flag, true if interlock is monitoring the command */ - virtual void send(char* buf, size_t length, bool critical); + virtual void send(char* buf, size_t length, bool critical = false); /** Send data to device * @@ -66,7 +66,7 @@ class LXICom : public ICom { * \param buf Data to be sent * \param critical Interlock flag, true if interlock is monitoring the command */ - virtual void send(const std::string& buf, bool critical); + virtual void send(const std::string& buf, bool critical = false); /** Read data from device * @@ -96,7 +96,7 @@ class LXICom : public ICom { * * \return Returned data */ - virtual std::string sendreceive(const std::string& cmd, bool critical); + virtual std::string sendreceive(const std::string& cmd, bool critical = false); /** Write data to device and receive reply * @@ -111,7 +111,7 @@ class LXICom : public ICom { * \return Number of characters received */ virtual void sendreceive(char* wbuf, size_t wlength, char* rbuf, - size_t rlength, bool critical); + size_t rlength, bool critical = false); /** Locking is not supported! * diff --git a/src/libPS/SCPIPs.cpp b/src/libPS/SCPIPs.cpp index 49d853458aef1536817b09ca655afa02127d0b35..8c5ce62a1cb7c53d67c3021c71fcbe733ffc303a 100644 --- a/src/libPS/SCPIPs.cpp +++ b/src/libPS/SCPIPs.cpp @@ -7,14 +7,6 @@ #include "ScopeLock.h" #include "StringUtils.h" -#include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <errno.h> -#include <sys/file.h> -#include <iostream> - // Register power supply #include "PowerSupplyRegistry.h" REGISTER_POWERSUPPLY(SCPIPs)