Skip to content

Commit

Permalink
Added more man pages
Browse files Browse the repository at this point in the history
  • Loading branch information
lundmar committed Apr 2, 2016
1 parent 98b0b93 commit ba4b988
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 1 deletion.
2 changes: 1 addition & 1 deletion man/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dist_man_MANS = lxi_init.3 lxi_connect.3 lxi_disconnect.3 lxi_send.3 lxi_receive.3
dist_man_MANS = lxi_init.3 lxi_connect.3 lxi_disconnect.3 lxi_send.3 lxi_receive.3 lxi_discover_devices.3 lxi_get_device_info.3
66 changes: 66 additions & 0 deletions man/lxi_discover_devices.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
.TH "lxi_discover_devices" "3" "28 March 2016"

.SH "NAME"
lxi_discover_devices \- search for LXI devices on network

.SH "SYNOPSIS"
.PP
.B #include <lxi.h>

.B int lxi_discover_devices(lxi_devices_t **devices, int timeout, int verbose);

.SH "DESCRIPTION"
.PP
The
.BR lxi_discover_devices()
function searches for LXI devices on the local network by automatically
broadcasting the GETPORT RPC call on the broadcast addresses of the available
network interfaces. The result is returned in a list of devices pointed to by
.I devices
which can be iterated through using the iterator function
.BR lxi_get_devince_info()

.PP
The
.I timeout
is in miliseconds.

.PP
If
.I verbose
is set true (1) the function will print broadcast information during search, or if set false (0) it will be silent.

.SH "RETURN VALUE"

Upon successful completion
.BR lxi_discover_devices()
returns
.BR LXI_OK
, or
.BR LXI_ERROR
if an error occurred.

.SH EXAMPLE
#include <lxi.h>

lxi_device_t device;
lxi_devices_t *devices;
int status;

// Search for LXI devices, timeout 1 s
status = lxi_discover_devices(&devices, 1000, false);

if ((status == LXI_OK) && (devices != NULL))
{
// Print discovered device IP addresses and IDs
while (lxi_get_device_info(devices, &device) == LXI_OK)
printf("ip: %s, id: %s)\n", device.address, device.id);
} else
printf("No devices found\n");

.SH "SEE ALSO"
.BR lxi_init (3)
.BR lxi_open (3),
.BR lxi_close (3)
.BR lxi_receive (3),
.BR lxi_disconnect (3),
39 changes: 39 additions & 0 deletions man/lxi_get_device_info.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.TH "lxi_get_device_info" "3" "28 March 2016"

.SH "NAME"
lxi_get_device_info \- get LXI device information

.SH "SYNOPSIS"
.PP
.B #include <lxi.h>

.B int lxi_get_device_info(lxi_devices_t *devices, lxi_device_t *device);

.SH "DESCRIPTION"
.PP
The
.BR lxi_get_device_info()
function is an iterator function which can be used to iterate through the list of devices returned by
.BR lxi_discover_devices()

.SH "RETURN VALUE"

Upon successful completion
.BR lxi_get_device_info()
returns
.BR LXI_OK
, or
.BR LXI_ERROR
if list is empty or end of list is reached.

.SH EXAMPLE
See
.BR lxi_discover_devices()

.SH "SEE ALSO"
.BR lxi_discover_devices (3)
.BR lxi_init (3)
.BR lxi_open (3),
.BR lxi_close (3)
.BR lxi_receive (3),
.BR lxi_disconnect (3),

0 comments on commit ba4b988

Please sign in to comment.