mirror of https://github.com/drowe67/librtlsdr.git
rtlsdr_rpc_set_agc_mode
parent
a08dd08f3c
commit
f5f543e7bc
|
@ -817,6 +817,24 @@ static int handle_query
|
|||
break ;
|
||||
}
|
||||
|
||||
case RTLSDR_RPC_OP_SET_AGC_MODE:
|
||||
{
|
||||
uint32_t did;
|
||||
uint32_t on;
|
||||
|
||||
PRINTF("set_agc_mode()\n");
|
||||
|
||||
if (rtlsdr_rpc_msg_pop_uint32(q, &did)) goto on_error;
|
||||
if (rtlsdr_rpc_msg_pop_uint32(q, &on)) goto on_error;
|
||||
|
||||
if ((rpcd->dev == NULL) || (rpcd->did != did)) goto on_error;
|
||||
|
||||
err = rtlsdr_set_agc_mode(rpcd->dev, (int)on);
|
||||
if (err) goto on_error;
|
||||
|
||||
break ;
|
||||
}
|
||||
|
||||
case RTLSDR_RPC_OP_RESET_BUFFER:
|
||||
{
|
||||
uint32_t did;
|
||||
|
|
|
@ -831,10 +831,26 @@ int rtlsdr_rpc_set_testmode(void* devp, int on)
|
|||
return err;
|
||||
}
|
||||
|
||||
int rtlsdr_rpc_set_agc_mode(void* dev, int on)
|
||||
int rtlsdr_rpc_set_agc_mode(void* devp, int on)
|
||||
{
|
||||
UNIMPL();
|
||||
return -1;
|
||||
rtlsdr_rpc_dev_t* const dev = devp;
|
||||
rtlsdr_rpc_cli_t* const cli = dev->cli;
|
||||
rtlsdr_rpc_msg_t* const q = &cli->query;
|
||||
rtlsdr_rpc_msg_t* const r = &cli->reply;
|
||||
int err = -1;
|
||||
|
||||
rtlsdr_rpc_msg_reset(q);
|
||||
rtlsdr_rpc_msg_set_op(q, RTLSDR_RPC_OP_SET_AGC_MODE);
|
||||
if (rtlsdr_rpc_msg_push_uint32(q, dev->index)) goto on_error_0;
|
||||
if (rtlsdr_rpc_msg_push_uint32(q, (uint32_t)on)) goto on_error_0;
|
||||
|
||||
if (send_recv_msg(cli, q, r)) goto on_error_0;
|
||||
|
||||
err = rtlsdr_rpc_msg_get_err(r);
|
||||
if (err) goto on_error_0;
|
||||
|
||||
on_error_0:
|
||||
return err;
|
||||
}
|
||||
|
||||
int rtlsdr_rpc_set_direct_sampling(void* dev, int on)
|
||||
|
|
Loading…
Reference in New Issue