Commit 744e2ca3 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Changed the project name to avoid problems in the ubuntu package creation.

Solved a minor bug.
parent cf185b61
...@@ -8,7 +8,7 @@ if(COMMAND cmake_policy) ...@@ -8,7 +8,7 @@ if(COMMAND cmake_policy)
endif(COMMAND cmake_policy) endif(COMMAND cmake_policy)
# The project name and the type of project # 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(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib) SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
......
...@@ -4,8 +4,4 @@ ADD_EXECUTABLE(test_usb_i2c test_usb_i2c.cpp) ...@@ -4,8 +4,4 @@ ADD_EXECUTABLE(test_usb_i2c test_usb_i2c.cpp)
# edit the following line to add the necessary libraries # edit the following line to add the necessary libraries
TARGET_LINK_LIBRARIES(test_usb_i2c usb_i2c_adapter ${iriutils_LIBRARY} ${comm_LIBRARY}) 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})
...@@ -300,7 +300,7 @@ int CUSBI2C::write(unsigned char dev_id, unsigned char *data, int len) ...@@ -300,7 +300,7 @@ int CUSBI2C::write(unsigned char dev_id, unsigned char *data, int len)
unsigned char status; unsigned char status;
int written=0,read=0; int written=0,read=0;
if(len>1) if(len<1)
{ {
/* handle exceptions */ /* handle exceptions */
throw CUSBI2CException(_HERE_,"At least one byte must be send in a write operation"); 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) ...@@ -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) int CUSBI2C::read(unsigned char dev_id, unsigned char *data, int len)
......
Supports Markdown
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