BSB Developer Docs
Loading...
Searching...
No Matches
discovery.h File Reference

mDNS network discovery service API. More...

#include <core/string.h>

Go to the source code of this file.

Data Structures

struct  DiscoveryServiceInfo
 Announced service information structure. More...
 

Macros

#define RECORD_DISCOVERY   "discovery"
 The string key for Discovery instance access.
 

Typedefs

typedef struct Discovery Discovery
 Discovery service opaque type.
 
typedef bool(* DiscoveryTxtCallback) (size_t index, FuriString *txt_out, void *context)
 Called to request one DNS-SD TXT record.
 

Enumerations

enum  DiscoveryTransportType { DiscoveryTransportTypeTcp , DiscoveryTransportTypeUdp }
 Enumeration of supported transport protocol types. More...
 

Functions

bool discovery_add_service (Discovery *discovery, const DiscoveryServiceInfo *info, void *context)
 Add a service to be announced to the local network.
 

Detailed Description

mDNS network discovery service API.

Typedef Documentation

◆ Discovery

typedef struct Discovery Discovery

Discovery service opaque type.

Get the instance pointer by calling furi_record_open(RECORD_DISCOVERY)

◆ DiscoveryTxtCallback

typedef bool(* DiscoveryTxtCallback) (size_t index, FuriString *txt_out, void *context)

Called to request one DNS-SD TXT record.

Parameters
[in]indexIndex of the record that this function should return
[out]txt_outpointer to the output buffer string
[in,out]contextpointer to the user-specific object (may be NULL)
Returns
true if data was given and iteration should continue, false if no data was given and iteration should stop

Enumeration Type Documentation

◆ DiscoveryTransportType

Enumeration of supported transport protocol types.

Enumerator
DiscoveryTransportTypeTcp 

TCP as transport protocol.

DiscoveryTransportTypeUdp 

UDP as transport protocol.

Function Documentation

◆ discovery_add_service()

bool discovery_add_service ( Discovery * discovery,
const DiscoveryServiceInfo * info,
void * context )

Add a service to be announced to the local network.

Warning
The data pointed to by info and context must live forever (i.e. must NOT be deleted after the call to this function).
Parameters
[in,out]discoveryDiscovery service
[in]infoService info to be announced
[in,out]contextContext for txt_callback (may be NULL)
Returns
true on success, false otherwise