UDP need to manually terminate the data transmission

development
MiniLight 2016-12-05 11:08:55 +08:00 committed by Lucas Teske
parent 0281d088b3
commit e892ab6a70
No known key found for this signature in database
GPG Key ID: 6C39C1C16A9DA7BE
2 changed files with 8 additions and 2 deletions

View File

@ -43,7 +43,8 @@ enum RTL_TCP_COMMANDS {
SET_TUNER_GAIN_BY_INDEX = 0x0D,
SET_TUNER_BANDWIDTH = 0x0E,
SET_BIAS_TEE = 0x0F,
UDP_ESTABLISH = 0x10
UDP_ESTABLISH = 0x10,
UDP_TERMINATE = 0x11
};
#ifdef __cplusplus

View File

@ -386,6 +386,11 @@ static void *command_worker(void *arg)
printf("setting bias-t to %d\n", ntohl(cmd.param));
rtlsdr_set_bias_tee(dev, ntohl(cmd.param));
break;
case UDP_TERMINATE:
printf("comm recv bye\n");
sighandler(0);
pthread_exit(NULL);
break;
default:
break;
}
@ -688,7 +693,7 @@ int main(int argc, char **argv)
printf("Use the device argument 'rtl_tcp=%s:%d' in OsmoSDR "
"(gr-osmosdr) source\n"
"to receive samples in GRC and control "
"rtl_tcp parameters (frequency, gain, ...).\n",
"rtl_udp parameters (frequency, gain, ...).\n",
addr, port);
while(1) {