Skip to content

Commit

Permalink
add early version of avahi browser for service discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
ka9q committed Mar 16, 2024
1 parent 5bdcffd commit b2ac9a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Makefile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ LOGROTATE_FILES = aprsfeed.rotate ft8.rotate ft4.rotate wspr.rotate

BLACKLIST=airspy-blacklist.conf

CFILES = airspy.c airspyhf.c aprs.c aprsfeed.c attr.c audio.c avahi.c ax25.c bandplan.c config.c control.c cwd.c decimate.c dump.c ezusb.c fcd.c filter.c fm.c funcube.c hid-libusb.c iir.c jt-decoded.c linear.c main.c metadump.c misc.c modes.c monitor.c morse.c multicast.c opusd.c opussend.c osc.c packetd.c pcmcat.c pcmrecord.c pcmsend.c pcmspawn.c pl.c powers.c radio.c radio_status.c rdsd.c rtcp.c rtlsdr.c rx888.c setfilt.c show-pkt.c show-sig.c sig_gen.c spectrum.c status.c stereod.c tune.c wd-record.c wfm.c
CFILES = airspy.c airspyhf.c aprs.c aprsfeed.c attr.c audio.c avahi.c avahi_browse.c ax25.c bandplan.c config.c control.c cwd.c decimate.c dump.c ezusb.c fcd.c filter.c fm.c funcube.c hid-libusb.c iir.c jt-decoded.c linear.c main.c metadump.c misc.c modes.c monitor.c morse.c multicast.c opusd.c opussend.c osc.c packetd.c pcmcat.c pcmrecord.c pcmsend.c pcmspawn.c pl.c powers.c radio.c radio_status.c rdsd.c rtcp.c rtlsdr.c rx888.c setfilt.c show-pkt.c show-sig.c sig_gen.c spectrum.c status.c stereod.c tune.c wd-record.c wfm.c

HFILES = attr.h ax25.h bandplan.h conf.h config.h decimate.h ezusb.h fcd.h fcdhidcmd.h filter.h hidapi.h iir.h misc.h morse.h multicast.h osc.h radio.h rx888.h status.h

Expand Down Expand Up @@ -150,7 +150,7 @@ libfcd.a: fcd.o hid-libusb.o
ranlib $@

# subroutines useful in more than one program
libradio.a: avahi.o attr.o filter.o iir.o status.o misc.o multicast.o osc.o config.o
libradio.a: avahi.o avahi_browse.o attr.o filter.o iir.o status.o misc.o multicast.o osc.o config.o
ar rv $@ $?
ranlib $@

Expand Down
11 changes: 4 additions & 7 deletions Makefile.osx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LIBDIR=/usr/local/share/ka9q-radio
LD_FLAGS=-lpthread -lm
EXECS=aprs aprsfeed cwd jt-decoded monitor opusd opussend packetd pcmrecord pcmsend pcmcat radiod control metadump pl show-pkt show-sig stereod rdsd tune powers wd-record pcmspawn setfilt powers

CFILES = airspy.c airspyhf.c aprs.c aprsfeed.c attr.c audio.c avahi.c ax25.c bandplan.c config.c control.c cwd.c decimate.c dump.c ezusb.c fcd.c filter.c fm.c funcube.c hid-libusb.c iir.c jt-decoded.c linear.c main.c metadump.c misc.c modes.c monitor.c morse.c multicast.c opusd.c opussend.c osc.c packetd.c pcmcat.c pcmrecord.c pcmsend.c pcmspawn.c pl.c powers.c radio.c radio_status.c rdsd.c rtcp.c rtlsdr.c rx888.c setfilt.c show-pkt.c show-sig.c sig_gen.c spectrum.c status.c stereod.c tune.c wd-record.c wfm.c
CFILES = airspy.c airspyhf.c aprs.c aprsfeed.c attr.c audio.c avahi.c avahi_browse.c ax25.c bandplan.c config.c control.c cwd.c decimate.c dump.c ezusb.c fcd.c filter.c fm.c funcube.c hid-libusb.c iir.c jt-decoded.c linear.c main.c metadump.c misc.c modes.c monitor.c morse.c multicast.c opusd.c opussend.c osc.c packetd.c pcmcat.c pcmrecord.c pcmsend.c pcmspawn.c pl.c powers.c radio.c radio_status.c rdsd.c rtcp.c rtlsdr.c rx888.c setfilt.c show-pkt.c show-sig.c sig_gen.c spectrum.c status.c stereod.c tune.c wd-record.c wfm.c

HFILES = attr.h ax25.h bandplan.h conf.h config.h decimate.h ezusb.h fcd.h fcdhidcmd.h filter.h hidapi.h iir.h misc.h morse.h multicast.h osc.h radio.h rx888.h status.h

Expand Down Expand Up @@ -35,10 +35,6 @@ endif
.PHONY: clean all install

# Executables
# TEMPORARY FOR DEVELOPMENT
avahi_browse: avahi_browse.o
$(CC) -g -o $@ $^ -lavahi-client -lavahi-common -lopus -lm -lpthread

aprs: aprs.o libradio.a
$(CC) -g -o $@ $^ -lm

Expand Down Expand Up @@ -126,14 +122,13 @@ libfcd.a: fcd.o hid-libusb.o
ranlib $@

# subroutines useful in more than one program
libradio.a: avahi.o attr.o ax25.o config.o decimate.o filter.o status.o misc.o multicast.o rtcp.o osc.o iir.o
libradio.a: avahi.o avahi_browse.o attr.o ax25.o config.o decimate.o filter.o status.o misc.o multicast.o rtcp.o osc.o iir.o
ar rv $@ $?
ranlib $@

# Main programs
aprs.o: aprs.c ax25.h multicast.h misc.h
aprsfeed.o: aprsfeed.c ax25.h multicast.h misc.h
avahi.o: avahi.c misc.h
control.o: control.c osc.h misc.h filter.h bandplan.h multicast.h status.h radio.h
cwd.o: cwd.c misc.h multicast.h morse.h
hackrf.o: hackrf.c misc.h multicast.h decimate.h status.h
Expand All @@ -159,6 +154,8 @@ hid-libusb.o: hid-libusb.c hidapi.h

# components of libradio.a
attr.o: attr.c attr.h
avahi.o: avahi.c misc.h
avahi_browse.o: avahi_browse.c
ax25.o: ax25.c ax25.h
decimate.o: decimate.c decimate.h
filter.o: filter.c misc.h filter.h
Expand Down
4 changes: 2 additions & 2 deletions avahi.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static void dump_userdata(struct userdata const *u){
static int create_services(AvahiClient *c,struct userdata *userdata);
static void client_callback(AvahiClient *c, AvahiClientState state,void * userdata);
static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state,void *userdata);
void avahi_ready(struct userdata *);
static void avahi_ready(struct userdata *);
static void *avahi_register(void *p);

extern int Verbose;
Expand Down Expand Up @@ -430,7 +430,7 @@ static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state,

// Removed the wait to avoid a deadlock when the DNS A records are already asserted elsewhere on the nt
// I *think* this will cause us to wait until the other guy goes away, and then we'll assert them ourselves
void avahi_ready(struct userdata *userdata){
static void avahi_ready(struct userdata *userdata){
#if 1
if(Verbose > 1){
fprintf(stderr,"NOT waiting for %p to become ready\n",userdata);
Expand Down

0 comments on commit b2ac9a0

Please sign in to comment.