Changeset 290 in flair-src
- Timestamp:
- Jan 8, 2019, 5:45:23 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/FrameworkManager_impl.cpp
r272 r290 226 226 227 227 // socket file_socket, doit être créé en premier, cf station sol 228 Printf("Connecting to %s:%i\n", address.c_str(), port);228 Printf("Connecting to FlairGCS on %s:%i\n", address.c_str(), port); 229 229 //file_sock = GetSocket(address, port); 230 230 com_sock = GetSocket(); -
trunk/lib/FlairSensorActuator/src/HostEthController.cpp
r243 r290 49 49 bitsPerAxis(_bitsPerAxis), dataFrameBuffer(NULL), 50 50 meaningfulDataAvailable(false) { 51 52 Thread::Info("Trying to connect to %s:%d\n", targetAddress.c_str(), targetPort); 53 51 54 tabWidget = new TabWidget(tab->NewRow(), name); 52 55 -
trunk/tools/Controller/DualShock3/src/DualShock3.cpp
r214 r290 39 39 #include <bluetooth/hci.h> 40 40 #include <bluetooth/hci_lib.h> 41 #include <sys/file.h> 41 42 42 43 #define USB_DIR_IN 0x80 … … 156 157 dev_name << "/dev/hidraw" << i; 157 158 if ((usb_fd = open(dev_name.str().c_str(), O_RDONLY)) >= 0) { 158 int res = 0; 159 int res=flock(usb_fd, LOCK_EX|LOCK_NB); 160 if(res<0) { 161 Thread::Warn("%s seems to be locked by another application\n", dev_name.str().c_str()); 162 close(usb_fd); 163 continue; 164 } 165 159 166 struct hidraw_devinfo info; 160 161 167 res = ioctl(usb_fd, HIDIOCGRAWINFO, &info); 162 168 if (res < 0) { 163 Thread::Err("ioctl error (HIDIOCGRAWINFO) on %s\n", 164 dev_name.str().c_str()); 169 Thread::Err("ioctl error (HIDIOCGRAWINFO) on %s\n",dev_name.str().c_str()); 165 170 } else { 166 171 // Printf("%x %x\n", info.vendor, info.product); … … 171 176 } 172 177 } 178 flock(usb_fd, LOCK_UN); 173 179 close(usb_fd); 174 180 } … … 193 199 DualShock3::~DualShock3() { 194 200 if (connectionType == Usb) { 201 flock(usb_fd, LOCK_UN); 195 202 close(usb_fd); 196 203 }
Note:
See TracChangeset
for help on using the changeset viewer.