mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
[docs] Build with JavaDoc 17 and add missing docs (#6220)
Co-authored-by: Sam Carlberg <sam.carlberg@gmail.com>
This commit is contained in:
@@ -54,14 +54,21 @@ public class MulticastServiceAnnouncer implements AutoCloseable {
|
||||
m_cleanable.clean();
|
||||
}
|
||||
|
||||
/** Starts multicast service announcer. */
|
||||
public void start() {
|
||||
WPINetJNI.startMulticastServiceAnnouncer(m_handle);
|
||||
}
|
||||
|
||||
/** Stops multicast service announcer. */
|
||||
public void stop() {
|
||||
WPINetJNI.stopMulticastServiceAnnouncer(m_handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if there's a multicast service announcer implementation.
|
||||
*
|
||||
* @return True if there's a multicast service announcer implementation.
|
||||
*/
|
||||
public boolean hasImplementation() {
|
||||
return WPINetJNI.getMulticastServiceAnnouncerHasImplementation(m_handle);
|
||||
}
|
||||
|
||||
@@ -32,22 +32,39 @@ public class MulticastServiceResolver implements AutoCloseable {
|
||||
m_cleanable.clean();
|
||||
}
|
||||
|
||||
/** Starts multicast service resolver. */
|
||||
public void start() {
|
||||
WPINetJNI.startMulticastServiceResolver(m_handle);
|
||||
}
|
||||
|
||||
/** Stops multicast service resolver. */
|
||||
public void stop() {
|
||||
WPINetJNI.stopMulticastServiceResolver(m_handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if there's a multicast service resolver implementation.
|
||||
*
|
||||
* @return True if there's a multicast service resolver implementation.
|
||||
*/
|
||||
public boolean hasImplementation() {
|
||||
return WPINetJNI.getMulticastServiceResolverHasImplementation(m_handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns event handle.
|
||||
*
|
||||
* @return Event handle.
|
||||
*/
|
||||
public int getEventHandle() {
|
||||
return WPINetJNI.getMulticastServiceResolverEventHandle(m_handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns multicast service resolver data.
|
||||
*
|
||||
* @return Multicast service resolver data.
|
||||
*/
|
||||
public ServiceData[] getData() {
|
||||
return WPINetJNI.getMulticastServiceResolverData(m_handle);
|
||||
}
|
||||
|
||||
@@ -38,22 +38,47 @@ public class ServiceData {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns service data payload.
|
||||
*
|
||||
* @return Service data payload.
|
||||
*/
|
||||
public Map<String, String> getTxt() {
|
||||
return m_txt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns host name.
|
||||
*
|
||||
* @return Host name.
|
||||
*/
|
||||
public String getHostName() {
|
||||
return m_hostName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns service name.
|
||||
*
|
||||
* @return Service name.
|
||||
*/
|
||||
public String getServiceName() {
|
||||
return m_serviceName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns port number.
|
||||
*
|
||||
* @return Port number.
|
||||
*/
|
||||
public int getPort() {
|
||||
return m_port;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns IPv4 address.
|
||||
*
|
||||
* @return IPv4 address.
|
||||
*/
|
||||
public long getIpv4Address() {
|
||||
return m_ipv4Address;
|
||||
}
|
||||
|
||||
@@ -86,29 +86,99 @@ public class WPINetJNI {
|
||||
*/
|
||||
public static native void removePortForwarder(int port);
|
||||
|
||||
/**
|
||||
* Creates a MulticastServiceAnnouncer.
|
||||
*
|
||||
* @param serviceName service name
|
||||
* @param serviceType service type
|
||||
* @param port port
|
||||
* @param keys keys
|
||||
* @param values values
|
||||
* @return MulticastServiceAnnouncer handle.
|
||||
*/
|
||||
public static native int createMulticastServiceAnnouncer(
|
||||
String serviceName, String serviceType, int port, String[] keys, String[] values);
|
||||
|
||||
/**
|
||||
* Frees a MulticastServiceAnnouncer.
|
||||
*
|
||||
* @param handle MulticastServiceAnnouncer handle.
|
||||
*/
|
||||
public static native void freeMulticastServiceAnnouncer(int handle);
|
||||
|
||||
/**
|
||||
* Starts MulticastServiceAnnouncer.
|
||||
*
|
||||
* @param handle MulticastServiceAnnouncer handle.
|
||||
*/
|
||||
public static native void startMulticastServiceAnnouncer(int handle);
|
||||
|
||||
/**
|
||||
* Stops MulticastServiceAnnouncer.
|
||||
*
|
||||
* @param handle MulticastServiceAnnouncer handle.
|
||||
*/
|
||||
public static native void stopMulticastServiceAnnouncer(int handle);
|
||||
|
||||
/**
|
||||
* Returns true if MulticastServiceAnnouncer has an implementation.
|
||||
*
|
||||
* @param handle MulticastServiceAnnouncer handle.
|
||||
* @return True if MulticastServiceAnnouncer has an implementation.
|
||||
*/
|
||||
public static native boolean getMulticastServiceAnnouncerHasImplementation(int handle);
|
||||
|
||||
/**
|
||||
* Creates a MulticastServiceResolver.
|
||||
*
|
||||
* @param serviceType Service type.
|
||||
* @return MulticastServiceResolver handle.
|
||||
*/
|
||||
public static native int createMulticastServiceResolver(String serviceType);
|
||||
|
||||
/**
|
||||
* Frees MulticastServiceResolver.
|
||||
*
|
||||
* @param handle MulticastServiceResolver handle.
|
||||
*/
|
||||
public static native void freeMulticastServiceResolver(int handle);
|
||||
|
||||
/**
|
||||
* Starts MulticastServiceResolver.
|
||||
*
|
||||
* @param handle MulticastServiceResolver handle.
|
||||
*/
|
||||
public static native void startMulticastServiceResolver(int handle);
|
||||
|
||||
/**
|
||||
* Stops MulticastServiceResolver.
|
||||
*
|
||||
* @param handle MulticastServiceResolver handle.
|
||||
*/
|
||||
public static native void stopMulticastServiceResolver(int handle);
|
||||
|
||||
/**
|
||||
* Returns true if MulticastServiceResolver has an implementation.
|
||||
*
|
||||
* @param handle MulticastServiceResolver handle.
|
||||
* @return True if MulticastServiceResolver has an implementation.
|
||||
*/
|
||||
public static native boolean getMulticastServiceResolverHasImplementation(int handle);
|
||||
|
||||
/**
|
||||
* Returns event handle for MulticastServiceResolver.
|
||||
*
|
||||
* @param handle MulticastServiceResolver handle.
|
||||
* @return Event handle for MulticastServiceResolver.
|
||||
*/
|
||||
public static native int getMulticastServiceResolverEventHandle(int handle);
|
||||
|
||||
/**
|
||||
* Returns service data for MulticastServiceResolver.
|
||||
*
|
||||
* @param handle MulticastServiceResolver handle.
|
||||
* @return Service data for MulticastServiceResolver.
|
||||
*/
|
||||
public static native ServiceData[] getMulticastServiceResolverData(int handle);
|
||||
|
||||
/** Utility class. */
|
||||
|
||||
@@ -15,17 +15,51 @@
|
||||
namespace wpi {
|
||||
class MulticastServiceAnnouncer {
|
||||
public:
|
||||
/**
|
||||
* Creates a MulticastServiceAnnouncer.
|
||||
*
|
||||
* @param serviceName service name
|
||||
* @param serviceType service type
|
||||
* @param port port
|
||||
* @param txt txt
|
||||
*/
|
||||
MulticastServiceAnnouncer(
|
||||
std::string_view serviceName, std::string_view serviceType, int port,
|
||||
std::span<const std::pair<std::string, std::string>> txt);
|
||||
/**
|
||||
* Creates a MulticastServiceAnnouncer.
|
||||
*
|
||||
* @param serviceName service name
|
||||
* @param serviceType service type
|
||||
* @param port port
|
||||
* @param txt txt
|
||||
*/
|
||||
MulticastServiceAnnouncer(
|
||||
std::string_view serviceName, std::string_view serviceType, int port,
|
||||
std::span<const std::pair<std::string_view, std::string_view>> txt);
|
||||
/**
|
||||
* Creates a MulticastServiceAnnouncer.
|
||||
*
|
||||
* @param serviceName service name
|
||||
* @param serviceType service type
|
||||
* @param port port
|
||||
*/
|
||||
MulticastServiceAnnouncer(std::string_view serviceName,
|
||||
std::string_view serviceType, int port);
|
||||
~MulticastServiceAnnouncer() noexcept;
|
||||
/**
|
||||
* Starts multicast service announcer.
|
||||
*/
|
||||
void Start();
|
||||
/**
|
||||
* Stops multicast service announcer.
|
||||
*/
|
||||
void Stop();
|
||||
/**
|
||||
* Returns true if there's a multicast service announcer implementation.
|
||||
*
|
||||
* @return True if there's a multicast service announcer implementation.
|
||||
*/
|
||||
bool HasImplementation() const;
|
||||
struct Impl;
|
||||
|
||||
|
||||
@@ -21,15 +21,36 @@ class MulticastServiceResolver {
|
||||
explicit MulticastServiceResolver(std::string_view serviceType);
|
||||
~MulticastServiceResolver() noexcept;
|
||||
struct ServiceData {
|
||||
/// IPv4 address.
|
||||
unsigned int ipv4Address;
|
||||
/// Port number.
|
||||
int port;
|
||||
/// Service name.
|
||||
std::string serviceName;
|
||||
/// Host name.
|
||||
std::string hostName;
|
||||
/// Service data payload.
|
||||
std::vector<std::pair<std::string, std::string>> txt;
|
||||
};
|
||||
/**
|
||||
* Starts multicast service resolver.
|
||||
*/
|
||||
void Start();
|
||||
/**
|
||||
* Stops multicast service resolver.
|
||||
*/
|
||||
void Stop();
|
||||
/**
|
||||
* Returns event handle.
|
||||
*
|
||||
* @return Event handle.
|
||||
*/
|
||||
WPI_EventHandle GetEventHandle() const { return event.GetHandle(); }
|
||||
/**
|
||||
* Returns multicast service resolver data.
|
||||
*
|
||||
* @return Multicast service resolver data.
|
||||
*/
|
||||
std::vector<ServiceData> GetData() {
|
||||
std::scoped_lock lock{mutex};
|
||||
event.Reset();
|
||||
@@ -40,6 +61,11 @@ class MulticastServiceResolver {
|
||||
queue.swap(ret);
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* Returns true if there's a multicast service resolver implementation.
|
||||
*
|
||||
* @return True if there's a multicast service resolver implementation.
|
||||
*/
|
||||
bool HasImplementation() const;
|
||||
struct Impl;
|
||||
|
||||
@@ -55,6 +81,9 @@ class MulticastServiceResolver {
|
||||
std::unique_ptr<Impl> pImpl;
|
||||
};
|
||||
} // namespace wpi
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user