realtek: allow to query list of usb product/vendor ids

This commit is contained in:
Matthias Ringwald 2022-04-14 18:05:00 +02:00
parent 8bb555aa6b
commit 5a4c0fdaeb
2 changed files with 30 additions and 2 deletions

View File

@ -492,9 +492,23 @@ void btstack_chipset_realtek_set_config_folder_path(const char *path) {
#endif
}
void btstack_chipset_realtek_set_lmp_subversion(uint16_t version) { lmp_subversion = version; }
void btstack_chipset_realtek_set_lmp_subversion(uint16_t version) {
lmp_subversion = version;
}
void btstack_chipset_realtek_set_product_id(uint16_t id) { product_id = id; }
void btstack_chipset_realtek_set_product_id(uint16_t id) {
product_id = id;
}
uint16_t btstack_chipset_realtek_get_num_usb_controllers(void){
return (sizeof(fw_patch_table) / sizeof(patch_info)) - 1; // sentinel
}
void btstack_chipset_realtek_get_vendor_product_id(uint16_t index, uint16_t * out_vendor_id, uint16_t * out_product_id){
btstack_assert(index < ((sizeof(fw_patch_table) / sizeof(patch_info)) - 1));
*out_vendor_id = 0xbda;
*out_product_id = fw_patch_table[index].prod_id;
}
static const btstack_chipset_t btstack_chipset_realtek = {
"REALTEK", chipset_init, chipset_next_command,

View File

@ -88,6 +88,20 @@ void btstack_chipset_realtek_set_lmp_subversion(uint16_t version);
*/
void btstack_chipset_realtek_set_product_id(uint16_t id);
/**
* @brief Get num USB Controllers
* @return num controllers
*/
uint16_t btstack_chipset_realtek_get_num_usb_controllers(void);
/**
* @brief Get Vendor/Product ID for Controller with index
* @param index
* @param out_vendor_id
* @param out_product_id
*/
void btstack_chipset_realtek_get_vendor_product_id(uint16_t index, uint16_t * out_vendor_id, uint16_t * out_product_id);
/**
* Get chipset instance for REALTEK chipsets
*/