Skip to content

Commit

Permalink
telev: add telev_is_empty()
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Sep 20, 2022
1 parent 493a985 commit d3ac0d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/re_telev.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ int telev_set_srate(struct telev *tel, uint32_t srate);
int telev_send(struct telev *tel, int event, bool end);
int telev_recv(struct telev *tel, struct mbuf *mb, int *event, bool *end);
int telev_poll(struct telev *tel, bool *marker, struct mbuf *mb);
bool telev_is_empty(struct telev *tel);

int telev_digit2code(int digit);
int telev_code2digit(int code);
6 changes: 6 additions & 0 deletions src/telev/telev.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@ int telev_poll(struct telev *tel, bool *marker, struct mbuf *mb)
}


bool telev_is_empty(struct telev *tel)
{
return tel->state == IDLE && !mbuf_get_left(tel->mb);
}


/**
* Convert DTMF digit to Event code
*
Expand Down

0 comments on commit d3ac0d2

Please sign in to comment.