Hi everyone,
So Im trying to modify the event handler of the ATT_MTU example file to have it so that it logs every time a byte is sent / instead of KB but for some reason when I change the defined
if (p_ctx->bytes_sent != bytecounter)
{
evt.evt_type = NRF_BLE_AMTS_EVT_TRANSFER_1B;
bytecounter = p_ctx->bytes_sent;
p_ctx->evt_handler(evt);
}- What I did was add a new Event in the events enum in amt.h
- In the amts.c I initialised an integer with a value of 0 with the name bytecounter and within static void char_notification_send(nrf_ble_amts_t * p_ctx) I added the code above
- In the main.c event handler I added the option to log on the UART interface when a byte is sent
I also tried to do the same with an event that would tell me when a complete packet is sent and so within the amts.c (after the amt.h enum declaration) I added the code
if (p_ctx->bytes_sent % 240 ==0)
{
evt.evt_type = NRF_BLE_AMTS_EVT_PACKET_TRANSFER;
p_ctx->evt_handler(evt);
}(this is assuming a packet is 240 bytes)
but somehow it only logged a packet being sent only a few times when I sent a throughput of a Megabyte
Could you please point me in the direction of figuring out what went wrong or how I could implement this functionality
Kind Regards,
Youssef