Index: sources/device/DeviceGlobals.h =================================================================== diff -u -rf38edd22f7b63694c21b83d6f4b69ea618390126 -r80922f18391e9bb04eea491a2412f5c7923d32a3 --- sources/device/DeviceGlobals.h (.../DeviceGlobals.h) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) +++ sources/device/DeviceGlobals.h (.../DeviceGlobals.h) (revision 80922f18391e9bb04eea491a2412f5c7923d32a3) @@ -55,14 +55,31 @@ } \ } \ public Q_SLOTS : \ + /*! \ + * \brief VDevice::doInit \ + * \details the slot to be called to initialize the attribute. }\ + */ \ void doInit##vATTRIBUTEFLC ( ); \ Q_SIGNALS: /*! the signals for property bindings(Changed) and communications */ \ void vATTRIBUTE##Changed (const vTYPE & v##vATTRIBUTE ); \ - private : /*! the function is called once the property is set in qml as request */ \ + private : \ + /*! \ + * \brief VDevice::bluetoothPairedResetRequest \ + * \details The slot which will be called in case \ + * the attribute value has been updated in the QML. \ + * The updated value is wrapped in the corresponding model \ + * and will be used to call the assigned script eventually. \ + */ \ void vATTRIBUTE##Request (const vTYPE & v##vATTRIBUTE ); \ Q_SIGNALS : \ void didAttributeRequest (const Device##vATTRIBUTEFLC##RequestData &vData ); \ private Q_SLOTS : \ + /*! \ + * \brief VDevice::onAttributeResponse \ + * \details The slot which will be called in case the updated value for the attribute\ + * has been receive by the output of designated script. \ + * \param vData - the data model containing the values. \ + */ \ void onAttributeResponse(const Device##vATTRIBUTEFLC##ResponseData &vData ); \ private : @@ -72,20 +89,33 @@ _process##vATTRIBUTEFLC .setParent(this); #define DEVICE_DEV_DEFINITION( vATTRIBUTEFLC ) \ - QProcess _process##vATTRIBUTEFLC; \ + QProcess _process##vATTRIBUTEFLC; \ Model::MDevice##vATTRIBUTEFLC##Response _device##vATTRIBUTEFLC##Response; \ Model::MDevice##vATTRIBUTEFLC##Request _device##vATTRIBUTEFLC##Request ; \ Q_SIGNALS : void didAttributeResponse (const Device##vATTRIBUTEFLC##ResponseData &); \ - private Q_SLOTS : void onAttributeRequest (const Device##vATTRIBUTEFLC##RequestData &vData); \ - private Q_SLOTS : void onProcess##vATTRIBUTEFLC##ExitCode(int vExitCode); \ + private Q_SLOTS : \ + /*! \ + * \brief DeviceController::onAttributeRequest \ + * \details This slot will be called in case the attribute is updated in the QML, \ + * to start the corresponding process and call the script assigned to it. \ + */ \ + void onAttributeRequest (const Device##vATTRIBUTEFLC##RequestData &vData); \ + /*! \ + * \brief DeviceController::onProcessExitCode \ + * \details The slot which is being called once the started process is returning a value \ + * as an exit code, probably from within the called script \ + * \param vExitCode - the returned exit code \ + * \param vStatus - the status of the process \ + */ \ + void onProcess##vATTRIBUTEFLC##ExitCode(int vExitCode, QProcess::ExitStatus vStatus); \ private : #define DEVICE_DEV_INIT_CONNECTIONS( vATTRIBUTEFLC ) \ - /* App -> Dev */ \ + /* App -> Dev //TODO: Add the error LOG connection */ \ connect(&_ApplicationController , SIGNAL(didAttributeRequest(const Device##vATTRIBUTEFLC##RequestData &)), \ this , SLOT( onAttributeRequest(const Device##vATTRIBUTEFLC##RequestData &))); \ - connect(&_process##vATTRIBUTEFLC, SIGNAL( finished(int)), \ - this, SLOT(onProcess##vATTRIBUTEFLC##ExitCode(int))); + connect(&_process##vATTRIBUTEFLC, SIGNAL( finished(int, QProcess::ExitStatus)), \ + this, SLOT(onProcess##vATTRIBUTEFLC##ExitCode(int, QProcess::ExitStatus))); /* ---------------------------- APP */ #define DEVICE_APP_BRIDGE_DEFINITION( vATTRIBUTEFLC ) \ @@ -142,29 +172,37 @@ /* ---------------------------- DEV */ #define DEVICE_DEV_PARENT_LIST \ DEVICE_DEV_PARENT ( Brightness ) \ + DEVICE_DEV_PARENT ( BluetoothPairedReset ) \ #define DEVICE_DEV_INIT_CONNECTIONS_LIST \ DEVICE_DEV_INIT_CONNECTIONS ( Brightness ) \ + DEVICE_DEV_INIT_CONNECTIONS ( BluetoothPairedReset ) \ #define DEVICE_DEV_DEFINITION_LIST \ DEVICE_DEV_DEFINITION ( Brightness ) \ + DEVICE_DEV_DEFINITION ( BluetoothPairedReset ) \ /* ---------------------------- APP */ #define DEVICE_APP_INIT_CONNECTIONS_LIST \ DEVICE_APP_INIT_CONNECTIONS ( Brightness ) \ + DEVICE_APP_INIT_CONNECTIONS ( BluetoothPairedReset ) \ #define DEVICE_APP_BRIDGE_DEFINITION_LIST \ DEVICE_APP_BRIDGE_DEFINITION( Brightness ) \ + DEVICE_APP_BRIDGE_DEFINITION( BluetoothPairedReset ) \ /* ---------------------------- GUI */ #define DEVICE_GUI_BRIDGE_DEFINITION_LIST \ DEVICE_GUI_BRIDGE_DEFINITION( Brightness ) \ + DEVICE_GUI_BRIDGE_DEFINITION( BluetoothPairedReset ) \ #define DEVICE_GUI_INIT_CONNECTIONS_LIST \ DEVICE_GUI_INIT_CONNECTIONS ( Brightness ) \ + DEVICE_GUI_INIT_CONNECTIONS ( BluetoothPairedReset ) \ /* ---------------------------- VIEW */ #define DEVICE_VIEW_INIT_CONNECTIONS_LIST \ DEVICE_VIEW_INIT_CONNECTIONS( Brightness ) \ + DEVICE_VIEW_INIT_CONNECTIONS( BluetoothPairedReset ) \