Update to part7-bluetooth to suppress noisy data

This commit is contained in:
Adam Greenwood-Byrne 2020-07-30 21:47:18 +01:00
parent f52c4079a9
commit c299194f88

View file

@ -60,6 +60,17 @@ unsigned char *poll()
return 0; return 0;
} }
void print_bdaddr(long bd_addr)
{
unsigned char byte;
for (int c=9;c>=4;c--) {
byte = (unsigned char)((bd_addr >> ((c-4)*8) & 0xff));
uart_hex(byte);
if (c != 4) uart_writeText(":");
}
}
void bt_update() void bt_update()
{ {
unsigned char *buf; unsigned char *buf;
@ -88,11 +99,10 @@ void bt_update()
buf += 2; buf += 2;
if (ad_len > 2) { if (ad_len > 2) {
uart_writeText(" -> adtype("); uart_hex(ad_type); uart_writeText(":"); uart_hex(ad_len); uart_writeText(")");
if (ad_type == 0x09 || ad_type == 0x08) { if (ad_type == 0x09 || ad_type == 0x08) {
unsigned int d=0; unsigned int d=0;
uart_writeText(" -> adtype("); uart_hex(ad_type); uart_writeText(":"); uart_hex(ad_len); uart_writeText(")");
uart_writeText(" -> "); uart_writeText(" -> ");
while (d<ad_len - 1) { while (d<ad_len - 1) {
uart_writeByteBlockingActual(buf[d]); uart_writeByteBlockingActual(buf[d]);