Search found 2 matches

by Projdysvit
Tue Jul 25, 2023 6:03 pm
Forum: ESP-IDF
Topic: Bluetooth classic. How to set device class?
Replies: 2
Views: 935

Re: Bluetooth classic. How to set device class?

The parameter length is set to 6 because the device class is 3 bytes long (24 bits), and we need an additional byte for the HCI OpCode. Sorry, but ChatGPT is a very bad helper in this case. 1 oct - packet type. 2 oct - OGF+OCF(op.code) 1 oct - params len. 3 oct - data len. 1 + 2 + 1 + 3 = 7. Am I n...
by Projdysvit
Fri Jul 14, 2023 3:06 pm
Forum: ESP-IDF
Topic: Bluetooth classic. How to set device class?
Replies: 2
Views: 935

Bluetooth classic. How to set device class?

Hello. I'm trying to set the device class to "Headphones". // init buf setPackSize(buf, 4 + 3); uint8ToBuf(buf, PACK_TYPE_CMD); setOpCode(buf, HCI_OGF_CONTROLLER, HCI_OCF_WRITE_DEVICE_CLASS); //data uint8ToBuf(buf, 3); uint8ToBuf(buf, 0b00100000); uint8ToBuf(buf, 0b00000100); uint8ToBuf(buf, 0b00011...