device_information_service: fix device_information_service_server_set_pnp_id

This commit is contained in:
Matthias Ringwald 2017-09-21 14:17:44 +02:00
parent 51fa0b282f
commit 3721458b9d
2 changed files with 6 additions and 4 deletions

View File

@ -101,6 +101,7 @@ static void set_string(device_information_field_id_t field_id, const char * text
}
static uint16_t device_information_service_read_callback(hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t offset, uint8_t * buffer, uint16_t buffer_size){
UNUSED(con_handle); // ok: info same for all devices
int i;
for (i=0;i<NUM_INFORMATION_FIELDS;i++){
if (device_information_fields[i].value_handle != attribute_handle) continue;
@ -223,7 +224,7 @@ void device_information_service_server_set_pnp_id(uint8_t vendor_source_id, uint
device_information_fields[PNP_ID].len = 7;
device_information_pnp_id[0] = vendor_source_id;
little_endian_store_16(device_information_pnp_id, 1, vendor_source_id);
little_endian_store_16(device_information_pnp_id, 3, vendor_id);
little_endian_store_16(device_information_pnp_id, 5, product_id);
little_endian_store_16(device_information_pnp_id, 1, vendor_id);
little_endian_store_16(device_information_pnp_id, 3, product_id);
little_endian_store_16(device_information_pnp_id, 5, product_version);
}

View File

@ -113,10 +113,11 @@ void device_information_service_server_set_system_id(uint64_t manufacturer_ident
void device_information_service_server_set_ieee_regulatory_certification(uint16_t value_a, uint16_t value_b);
/**
* @brief Set Software Revision
* @brief Set PnP ID
* @param vendor_source_id
* @param vendor_id
* @param product_id
* @Param product_versoin
*/
void device_information_service_server_set_pnp_id(uint8_t vendor_source_id, uint16_t vendor_id, uint16_t product_id, uint16_t product_version);