Commit 96b546b7 authored by in5's avatar in5

Changed terminators of IN5 chopper driver

parent 3db06d39
......@@ -19,6 +19,8 @@
#ifndef IN5CHOPPERCOMPUTERDEF_H
#define IN5CHOPPERCOMPUTERDEF_H
#include <string>
namespace in5 {
// Read
......@@ -34,11 +36,14 @@ static const char RATI_COMMAND[] = "RATI!";
static const char ACKN_COMMAND[] = "ACKN!";
// Terminator.
static const char TERMINATOR[] = "\r";
static const std::string TERMINATOR = "\r\n";
// Request separator.
static const char REQUEST_SEPARATOR[] = ";";
// Request terminator.
static const char REQUEST_TERMINATOR[] = "\r";
// Response separator.
static const char RESPONSE_SEPARATOR[] = ";\n\r";
......
......@@ -365,7 +365,7 @@ void RealIN5ChopperComputerState::requestChopper(int index, const std::string& c
string result = request(os.str());
ostringstream osr;
osr << "C0" << index << OK_RESPONSE << TERMINATOR;
osr << "C0" << index << OK_RESPONSE << REQUEST_TERMINATOR;
if (result != osr.str()) {
throw ResponseError(result);
......@@ -467,6 +467,8 @@ std::string RealIN5ChopperComputerState::request(const std::string& command) {
// Write the command.
owner()->write(command, TERMINATOR);
usleep(100000);
// Read come back
string result = owner()->read(TERMINATOR);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment