Commit 06dcba19 authored by kpetersn's avatar kpetersn
Browse files

Added a report method that can show the comms status.

parent 5634f85a
......@@ -30,8 +30,15 @@ Linkam::Linkam(const char *portName) : asynPortDriver(portName, MAX_CONTROLLERS,
printf("Comms Library Version %s\n", libraryVersion_);
// TODO: should this be moved to an init or connect method?
// Wrapped call to LinkamCommsDll.Comms.OpenComms()
OpenComms(true, 0, 0);
/*
* Wrapped call to LinkamCommsDll.Comms.OpenComms()
*
* OpenComms(
* true, bool bConnect: set to true to connect and false to disconnect
* 1, UInt32 u32Commtype: Connection protocol (0: USB, 1: Serial)
* 3); UInt32 u32CommPort: Set to the COMM port that the controller is connected to. (e.g. COMM port 3)
*/
commStatus_ = OpenComms(true, 1, 0);
// Start poller? For now just initialize the temperature
// Wrapped call to LinkamCommDll.Comms.GetValue(). Index 0 is temperature.
......@@ -43,7 +50,7 @@ Linkam::Linkam(const char *portName) : asynPortDriver(portName, MAX_CONTROLLERS,
callParamCallbacks();
// Disconnect
//OpenComms(false, 0, 0);
//commStatus_ = OpenComms(false, 1, 0);
}
asynStatus Linkam::readFloat64(asynUser *pasynUser, epicsFloat64 *value)
......@@ -90,6 +97,17 @@ asynStatus Linkam::readTemperature(epicsFloat64 *value)
return asynSuccess;
}
void Linkam::report(FILE *fp, int details)
{
asynPortDriver::report(fp, details);
fprintf(fp, "* Port: %s, commStatus=%d\n", this->portName, commStatus_);
if (details >= 1)
fprintf(fp, " interesting value = ");
fprintf(fp, "\n");
}
extern "C" int LinkamConfig(const char *portName)
{
Linkam *pLinkam = new Linkam(portName);
......
......@@ -31,7 +31,9 @@ protected:
private:
asynStatus readTemperature(epicsFloat64 *value);
void report(FILE *fp, int details);
int commStatus_;
float temperatureRbv_;
char* wrapperVersion_;
char* libraryVersion_;
......
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