-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
156 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
rm -rf build | ||
mkdir -p build | ||
cd build | ||
|
||
VERBOSE_MAKEFILE=OFF | ||
|
||
cmake ../ -DCMAKE_VERBOSE_MAKEFILE=${VERBOSE_MAKEFILE} -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DXDBD_CONFIG_DEBUG_POOL=1 -DCMAKE_INSTALL_PREFIX=`pwd`/install | ||
|
||
make -j10 | ||
make install | ||
|
||
cp compile_commands.json ../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,38 @@ | ||
#include <xdbd_connection_usb.h> | ||
|
||
xdbd_usb_listening_t *xdbd_create_usb_listening(xdbd_t *xdbd) { | ||
xdbd_usb_listening_t *uls; | ||
|
||
uls = bfdev_array_push(&xdbd->usb_listening, 1); | ||
if (uls == NULL) { | ||
return uls; | ||
} | ||
|
||
uls->fd = (xdbd_socket_t) -1; | ||
|
||
return uls; | ||
} | ||
|
||
int xdbd_open_usb_listening_sockets(xdbd_t *xdbd) { | ||
xdbd_usb_listening_t *uls; | ||
int i; | ||
|
||
uls = bfdev_array_data(&xdbd->tcp_listening, 0); | ||
|
||
for (i = 0; i < bfdev_array_index(&xdbd->usb_listening); i++) { | ||
if (uls[i].fd != (xdbd_socket_t) -1) { | ||
continue; | ||
} | ||
|
||
if (xdbd_access((const char *)uls[i].name.data, F_OK) == 0) { | ||
return XDBD_ERR; | ||
} | ||
|
||
if (xdbd_access((const char *)uls[i].ctr.data, F_OK) == 0) { | ||
return XDBD_ERR; | ||
} | ||
|
||
} | ||
|
||
return XDBD_OK; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef __XDBD_CONNECTION_USB__H__ | ||
#define __XDBD_CONNECTION_USB__H__ | ||
|
||
#include <xdbd.h> | ||
#include <xdbd_string.h> | ||
struct xdbd_usb_listening_s { | ||
xdbd_str_t name; | ||
xdbd_str_t ctr; | ||
xdbd_str_t in; | ||
xdbd_str_t out; | ||
|
||
xdbd_connection_handler_pt handler; | ||
|
||
xdbd_socket_t fd; | ||
xdbd_connection_t *connection; | ||
}; | ||
|
||
xdbd_usb_listening_t *xdbd_create_usb_listening(xdbd_t *xdbd); | ||
int xdbd_open_usb_listening_sockets(xdbd_t *xdbd); | ||
#endif /*__XDBD_CONNECTION_USB__H__*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters