szymon-czapracki commented on code in PR #1833:
URL: https://github.com/apache/mynewt-nimble/pull/1833#discussion_r1724865638
##########
nimble/host/audio/services/bass/src/ble_audio_svc_bass.c:
##########
@@ -618,12 +618,16 @@ static int
ble_svc_audio_bass_ctrl_point_write_access(struct ble_gatt_access_ctxt *ctxt,
uint16_t conn_handle)
{
struct ble_svc_audio_bass_ctrl_point_handler *handler;
+ uint16_t mbuf_len = OS_MBUF_PKTLEN(ctxt->om);
+ uint8_t opcode;
+ uint8_t data[MYNEWT_VAL(BLE_SVC_AUDIO_BASS_METADATA_MAX_SZ)];
- uint8_t opcode = ctxt->om->om_data[0];
+ os_mbuf_copydata(ctxt->om, 0, mbuf_len, data);
Review Comment:
Previous implementation produced some problems regarding passing data into
specific handlers, as not all of the data was present - after discussing this
with @sjanc we've decided that a good solution would be to use os_mbuf for
passing the data that write access function handles.
Edit: The incorrect amount of data was a result of chained mbufs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]