Skip to content

Commit

Permalink
fix(BLE,Examples): Log packet count on BLE dats speed test (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinFairchild authored Jul 7, 2023
1 parent 0116a6f commit 11240f5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Examples/MAX32655/BLE_dats/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,12 +422,19 @@ static void trimStart(void)
uint8_t datsWpWriteCback(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset,
uint16_t len, uint8_t *pValue, attsAttr_t *pAttr)
{
static uint32_t packetCount = 0;

if (len < 64) {
/* print received data if not a speed test message */
APP_TRACE_INFO0((const char *)pValue);

/* send back some data */
datsSendData(connId);
} else {
APP_TRACE_INFO1("Speed test packet Count [%d]", packetCount++);
if (packetCount >= 5000) {
packetCount = 0;
}
}
return ATT_SUCCESS;
}
Expand Down
6 changes: 6 additions & 0 deletions Examples/MAX32665/BLE_dats/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,18 @@ static void trimStart(void)
uint8_t datsWpWriteCback(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset,
uint16_t len, uint8_t *pValue, attsAttr_t *pAttr)
{
static uint32_t packetCount = 0;
if (len < 64) {
/* print received data if not a speed test message */
APP_TRACE_INFO0((const char *)pValue);

/* send back some data */
datsSendData(connId);
} else {
APP_TRACE_INFO1("Speed test packet Count [%d]", packetCount++);
if (packetCount >= 5000) {
packetCount = 0;
}
}
return ATT_SUCCESS;
}
Expand Down
7 changes: 7 additions & 0 deletions Examples/MAX32690/BLE_dats/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,12 +422,19 @@ static void trimStart(void)
uint8_t datsWpWriteCback(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset,
uint16_t len, uint8_t *pValue, attsAttr_t *pAttr)
{
static uint32_t packetCount = 0;

if (len < 64) {
/* print received data if not a speed test message */
APP_TRACE_INFO0((const char *)pValue);

/* send back some data */
datsSendData(connId);
} else {
APP_TRACE_INFO1("Speed test packet Count [%d]", packetCount++);
if (packetCount >= 5000) {
packetCount = 0;
}
}
return ATT_SUCCESS;
}
Expand Down

0 comments on commit 11240f5

Please sign in to comment.