On Wednesday 20 November 2019 08:44:11 Pali Rohár wrote: > I was playing with another suggestion for API: > > +#define BT_VOICE_SETUP 14 > +struct bt_voice_pkt_type { > + __u8 capability; /* 0x01 - SCO; 0x02 - eSCO */ > + __u8 retrans_effort; > + __u16 pkt_type; > + __u16 max_latency; > +}; > +struct bt_voice_setup { > + __u16 voice_setting; > + __u16 pkt_types_count; > + __u32 tx_bandwidth; > + __u32 rx_bandwidth; > + struct bt_voice_pkt_type pkt_types[]; > +}; > > So voice_setttings, pkt_types_count and badwidth would not be repeated > as it is same for every pkt_type/retrans_effors/max_latency. > > But above uses C99 flexible arrays, so I do not know if API kernel <--> > userspace API is allowed to use C99 flexible arrays. > > But getsockopt/setsockopt functions are possible to write with above > API. I played more with C99 flexible arrays and seems that gcc supports it without any problems. I'm sending another attempt of API implementation, now with more fields which are needed for Enhanced Setup Synchronous Connection command. This command is not supported by kernel yet, but should be easy to add it. So my ioctl API is prepared for it. Enhanced Setup Synchronous Connection command would be needed to use hardware mSBC codec encoder/decoder. -- Pali Rohár pali.rohar@gmail.com