Skip to content

Commit

Permalink
Fix advertised device name
Browse files Browse the repository at this point in the history
The advertising data was missing the
`BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME` flag, leading it to show up as a
blank device name in the Tindeq app.
  • Loading branch information
kesyog committed Oct 4, 2023
1 parent 01ee2ad commit a870b6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ble/advertising.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ fn advertising_data(name: &[u8]) -> Result<ArrayVec<u8, 27>, ()> {
(raw_sd::BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE
| raw_sd::BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED) as u8,
);
advertising_data.push(name.len() as u8);
advertising_data.push(name.len() as u8 + 1);
advertising_data.push(raw_sd::BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME as u8);
advertising_data
.try_extend_from_slice(name)
.map_err(|_| ())?;
Expand Down

0 comments on commit a870b6a

Please sign in to comment.