This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UART Rx bytes keep on increasing

Hi All,

I'm using hci interface to scan the ble based beacons.

While scanning hci interface's Rx bytes keep on increasing because beacons are being scanned.

I'm using tcflush() function with TCIOFLUSH option to flush the UART.

UART flush i'm doing after every 10 sec scanning window finishes & tcflush() fun gets success also.

Still, Instead of decrease in Rx byte number it goes up continuously. So I'm doubting that whether the UART buffer is flushed or not?

This is causing beacon scanning to stop after the "Rx bytes" reaches some max value.

You can see the below snap i have taken from my terminal.

root@device-imx6ull:~# hciconfig
hci0: Type: Primary Bus: UART
BD Address: 00:00:00:00:00:00 ACL MTU: 27:7 SCO MTU: 0:0
UP RUNNING
RX bytes:579483 acl:0 sco:0 events:20484 errors:0
TX bytes:295 acl:0 sco:0 commands:40 errors:0

Q: I'm flushing the buffer in correct way or do i need to get some attr first and then flush the UART.

Thanks,

Mayank

Related