diff --git a/trunk/CMakeLists.txt b/trunk/CMakeLists.txt index 1aede89145e5e7e5ab02b57fa0fab8b7379ce9e2..0dafa28f1e4c6399a2982979304bb6f9be1a78d8 100644 --- a/trunk/CMakeLists.txt +++ b/trunk/CMakeLists.txt @@ -8,7 +8,7 @@ if(COMMAND cmake_policy) endif(COMMAND cmake_policy) # The project name and the type of project -PROJECT(library_name) +PROJECT(usb-i2c-adapter) SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin) SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib) diff --git a/trunk/src/examples/CMakeLists.txt b/trunk/src/examples/CMakeLists.txt index f41d1fd0e368c594f9ee845049009860140ea395..8e52e3691ef338e9046c333b175093c4cc4274ab 100644 --- a/trunk/src/examples/CMakeLists.txt +++ b/trunk/src/examples/CMakeLists.txt @@ -4,8 +4,4 @@ ADD_EXECUTABLE(test_usb_i2c test_usb_i2c.cpp) # edit the following line to add the necessary libraries TARGET_LINK_LIBRARIES(test_usb_i2c usb_i2c_adapter ${iriutils_LIBRARY} ${comm_LIBRARY}) -# edit the following line to add the source code for the example and the name of the executable -ADD_EXECUTABLE(test_camera test_camera.cpp) -# edit the following line to add the necessary libraries -TARGET_LINK_LIBRARIES(test_camera usb_i2c_adapter ${iriutils_LIBRARY} ${comm_LIBRARY}) diff --git a/trunk/src/usb_i2c.cpp b/trunk/src/usb_i2c.cpp index 0340deaf2584c8797d6ac4f1336a8fa00fad21bd..8eef91aa1cbeb70777e1b603a9de2afd8b0ec193 100644 --- a/trunk/src/usb_i2c.cpp +++ b/trunk/src/usb_i2c.cpp @@ -300,7 +300,7 @@ int CUSBI2C::write(unsigned char dev_id, unsigned char *data, int len) unsigned char status; int written=0,read=0; - if(len>1) + if(len<1) { /* handle exceptions */ throw CUSBI2CException(_HERE_,"At least one byte must be send in a write operation"); @@ -339,7 +339,7 @@ int CUSBI2C::write(unsigned char dev_id, unsigned char *data, int len) } } } - return written; + return len; } int CUSBI2C::read(unsigned char dev_id, unsigned char *data, int len)