function decode_discovery(dgram) {
	if (dgram.stream === StreamType.discovery) {
		const discovery_payload = new TextDecoder().decode(dgram.payload);
		const clean_payload = discovery_payload.replace(/[^\x20-\x7E]/g, '');
		// Append fake status header so we can use the same parser for the data.
		const radio = flexParser.parse(`S0|${clean_payload}`);
		if (radio && radio.payload) {
			return radio.payload;
		}
	}

	return {};
}
// decode_discovery() -- decode FlexRadio discovery datagrams sent as UDP broadcast messages
- decode FlexRadio discovery datagrams sent as UDP broadcast messages
- decode FlexRadio discovery datagrams sent as UDP broadcast messages
function decode_discovery(dgram) {
	if (dgram.stream === StreamType.discovery) {
		const discovery_payload = new TextDecoder().decode(dgram.payload);
		const clean_payload = discovery_payload.replace(/[^\x20-\x7E]/g, '');
		const radio = flexParser.parse(`S0|${clean_payload}`);
		if (radio && radio.payload) {
			return radio.payload;
		}
	}
	return {};
}
function decode_discovery ( dgram ) { if ( dgram . stream === StreamType . discovery ) { const discovery_payload = new TextDecoder ( ) . decode ( dgram . payload ) ; const clean_payload = discovery_payload . replace ( / [^\x20-\x7E] / g , '' ) ; const radio = flexParser . parse ( ` ${ clean_payload } ` ) ; if ( radio && radio . payload ) { return radio . payload ; } } return { } ; }
decode_discovery() -- decode FlexRadio discovery datagrams sent as UDP broadcast messages
decode_discovery () -- decode FlexRadio discovery datagrams sent as UDP broadcast messages
// Append fake status header so we can use the same parser for the data.