diff --git a/src/sinqAxis.h b/src/sinqAxis.h index cc8fc81..9599b54 100644 --- a/src/sinqAxis.h +++ b/src/sinqAxis.h @@ -571,7 +571,7 @@ template asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName, int (C::*func)(), T *readValue, const char *callerFunctionName, int lineNumber, - TypeTag) { + size_t msgSize, TypeTag) { static_assert( sizeof(T) == 0, "no specialization of getAxisParam exists for the given type"); @@ -582,7 +582,7 @@ template asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName, int (C::*func)(), int *readValue, const char *callerFunctionName, int lineNumber, - TypeTag) { + size_t msgSize, TypeTag) { int indexValue = (controller->*func)(); asynStatus status = controller->getIntegerParam(axis->axisNo(), indexValue, readValue); @@ -597,17 +597,17 @@ template asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName, int (C::*func)(), bool *readValue, const char *callerFunctionName, int lineNumber, - TypeTag) { + size_t msgSize, TypeTag) { return getAxisParamImpl(axis, indexName, func, static_cast(readValue), callerFunctionName, - lineNumber); + lineNumber, msgSize); } template asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName, int (C::*func)(), double *readValue, const char *callerFunctionName, int lineNumber, - TypeTag) { + size_t msgSize, TypeTag) { int indexValue = (controller->*func)(); asynStatus status = controller->getDoubleParam(axis->axisNo(), indexValue, readValue); @@ -622,11 +622,11 @@ template asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName, int (C::*func)(), char *readValue, const char *callerFunctionName, int lineNumber, - TypeTag) { + size_t msgSize, TypeTag) { int indexValue = (controller->*func)(); - asynStatus status = controller->getStringParam( - axis->axisNo(), indexValue, controller->msgSize(), readValue); + asynStatus status = controller->getStringParam(axis->axisNo(), indexValue, + msgSize, readValue); if (status != asynSuccess) { return controller->paramLibAccessFailed( status, indexName, axis->axisNo(), callerFunctionName, lineNumber); @@ -638,7 +638,7 @@ template asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName, int (C::*func)(), std::string *readValue, const char *callerFunctionName, int lineNumber, - TypeTag) { + size_t msgSize, TypeTag) { int indexValue = (controller->*func)(); // Convert the pointer to a reference, since getStringParam expects the @@ -679,12 +679,13 @@ asynStatus getAxisParam(A *axis, C *controller, const char *indexName, int (C::*func)(), T *readValue, const char *callerFunctionName, int lineNumber) { return getAxisParamImpl(axis, controller, indexName, func, readValue, - callerFunctionName, lineNumber, TypeTag{}); + callerFunctionName, lineNumber, + controller->msgSize(), TypeTag{}); } /** - * @brief Helper function to get an integer / double / string parameter for an - * axis in the paramLib + * @brief Helper function to get a string parameter for an + * axis in the paramLib into a char array * * This function should not be used directly, but rather through its macro * variant `getAxisParamChecked`. It is a specialized variant of the general @@ -707,7 +708,7 @@ asynStatus getAxisParam(A *axis, C *controller, const char *indexName, const char *callerFunctionName, int lineNumber) { return getAxisParamImpl(axis, controller, indexName, func, static_cast(readValue), callerFunctionName, - lineNumber, TypeTag{}); + lineNumber, sizeof(readValue), TypeTag{}); } /**