ipdbg-la: data_available(): Return gboolean.
This commit is contained in:
parent
3831eaf9f4
commit
4465837b7d
|
@ -68,7 +68,7 @@
|
||||||
/* LA subfunction command opcodes */
|
/* LA subfunction command opcodes */
|
||||||
#define CMD_LA_DELAY 0x1F
|
#define CMD_LA_DELAY 0x1F
|
||||||
|
|
||||||
SR_PRIV int data_available(struct ipdbg_la_tcp *tcp)
|
SR_PRIV gboolean data_available(struct ipdbg_la_tcp *tcp)
|
||||||
{
|
{
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
ioctlsocket(tcp->socket, FIONREAD, &bytes_available);
|
ioctlsocket(tcp->socket, FIONREAD, &bytes_available);
|
||||||
|
@ -77,10 +77,10 @@ SR_PRIV int data_available(struct ipdbg_la_tcp *tcp)
|
||||||
|
|
||||||
if (ioctl(tcp->socket, FIONREAD, &status) < 0) { // TIOCMGET
|
if (ioctl(tcp->socket, FIONREAD, &status) < 0) { // TIOCMGET
|
||||||
sr_err("FIONREAD failed: %s\n", g_strerror(errno));
|
sr_err("FIONREAD failed: %s\n", g_strerror(errno));
|
||||||
return 0;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (status < 1) ? 0 : 1;
|
return (status < 1) ? FALSE : TRUE;
|
||||||
#endif // __WIN32__
|
#endif // __WIN32__
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ struct dev_context {
|
||||||
uint8_t *raw_sample_buf;
|
uint8_t *raw_sample_buf;
|
||||||
};
|
};
|
||||||
|
|
||||||
int data_available(struct ipdbg_la_tcp *tcp);
|
SR_PRIV gboolean data_available(struct ipdbg_la_tcp *tcp);
|
||||||
|
|
||||||
SR_PRIV struct ipdbg_la_tcp *ipdbg_la_tcp_new(void);
|
SR_PRIV struct ipdbg_la_tcp *ipdbg_la_tcp_new(void);
|
||||||
SR_PRIV void ipdbg_la_tcp_free(struct ipdbg_la_tcp *tcp);
|
SR_PRIV void ipdbg_la_tcp_free(struct ipdbg_la_tcp *tcp);
|
||||||
|
|
Loading…
Reference in New Issue