27 lines
649 B
C
27 lines
649 B
C
#ifndef CONTROLLER_DISCOVERY_H
|
|
#define CONTROLLER_DISCOVERY_H
|
|
|
|
#include <models/controller.h>
|
|
|
|
/**
|
|
* @brief Open socket for discovery
|
|
*
|
|
* Will exit program when unable to open socket.
|
|
*
|
|
* @param discovery_port Port number to listen on for discovery broadcasts
|
|
*
|
|
* @return Open socket to accept discovery broadcasts on
|
|
*/
|
|
int
|
|
discovery_socket_open(uint16_t discovery_port);
|
|
|
|
/**
|
|
* @brief Handle the discovery processing
|
|
*
|
|
* @param fd File descriptor to receive initial data from
|
|
* @param cntrlr Controller to use for answering discovery
|
|
*/
|
|
void
|
|
discovery_handle_discover(int fd, controller *cntrlr);
|
|
|
|
#endif /* CONTROLLER_DISCOVERY_H */
|