tool/CommandDownload.cpp
changeset 1184 75cd6681eb08
parent 1166 006244d53f68
child 1254 c19d273a9e76
child 1686 e206f4485f60
--- a/tool/CommandDownload.cpp	Fri Aug 01 09:32:35 2008 +0000
+++ b/tool/CommandDownload.cpp	Fri Aug 01 10:10:55 2008 +0000
@@ -9,13 +9,12 @@
 using namespace std;
 
 #include "CommandDownload.h"
-#include "coe_datatypes.h"
 #include "byteorder.h"
 
 /*****************************************************************************/
 
 CommandDownload::CommandDownload():
-    Command("download", "Write an Sdo entry to a slave.")
+    SdoCommand("download", "Write an Sdo entry to a slave.")
 {
 }
 
@@ -66,7 +65,7 @@
     stringstream strIndex, strSubIndex, strValue, err;
     ec_ioctl_slave_sdo_download_t data;
     unsigned int number;
-    const CoEDataType *dataType = NULL;
+    const DataType *dataType = NULL;
     SlaveList slaves;
 
     if (args.size() != 3) {
@@ -207,6 +206,12 @@
 
 	try {
         m.sdoDownload(&data);
+	} catch (MasterDeviceSdoAbortException &e) {
+        delete [] data.data;
+        err << "Sdo transfer aborted with code 0x"
+            << setfill('0') << hex << setw(8) << e.abortCode
+            << ": " << abortText(e.abortCode);
+        throwCommandException(err);
 	} catch(MasterDeviceException &e) {
         delete [] data.data;
         throw e;