Skip to content

Commit 5bf8511

Browse files
author
Thomas Kopriva
committed
Merge pull request #44 in SA/ble_examples from feature/throughput-demo-ccs to develop
Squashed commit of the following: commit ff7e70ae638066b3db4d9ae702e15445a821f619 Author: Alles Rebel <[email protected]> Date: Fri May 19 13:40:03 2017 -0700 Fixed the link commit b38826e193275a90c5f5d142af44046db7f358c6 Author: Alles Rebel <[email protected]> Date: Fri May 19 13:34:27 2017 -0700 Removed Whitespaces commit 124b02dfccda82fcf5baacebf14f04667e7f61bb Author: Alles Rebel <[email protected]> Date: Fri May 19 11:20:47 2017 -0700 Fixed CCS projects and removed profile code from application folder commit 61869817695a33656c75d9b392c48bc385bd8d35 Author: Alles Rebel <[email protected]> Date: Thu May 18 10:19:59 2017 -0700 Fixed ccs warning Removed extra code - unused Reverted Profile commit f374c5b91363767f19ae2fe5f945a008adaa504e Author: Alles Rebel <[email protected]> Date: Thu May 18 10:09:26 2017 -0700 Added GUI Composer commit 5e65fad318c6777239ca972e91cea834f4dbcd8e Author: Alles Rebel <[email protected]> Date: Wed May 17 19:52:38 2017 -0700 Added newline to profile code to remove CCS Error and Added Peripehral CCS Project commit e9cb46a4d1fa7e911ef0555f972d4f15a2bc7fad Author: Alles Rebel <[email protected]> Date: Wed May 17 19:16:42 2017 -0700 Finished up the CCS project for Throughput Central commit d80a11f1e17a09d8f534e1eceacf58caaa3a9181 Author: Alles Rebel <[email protected]> Date: Mon May 15 13:48:28 2017 -0700 Added profile code to the central, just to be safe Change how throughput is communicated, it's completely done through the profile Changed profile to disable toggling of throughput, but rather be on or off, change application to account for this commit d41436744e2f38393f15997f1fb30aec761fce91 Author: Alles Rebel <[email protected]> Date: Mon May 15 08:13:30 2017 -0700 Changed TX Power and RX Sensitivity to highest possible in both configurations
1 parent 88ab32a commit 5bf8511

19 files changed

+823
-1383
lines changed

examples/rtos/CC2640R2_LAUNCHXL/ble5apps/throughput_central/src/app/profiles/throughput/throughput_service.c

Lines changed: 0 additions & 497 deletions
This file was deleted.

examples/rtos/CC2640R2_LAUNCHXL/ble5apps/throughput_central/src/app/profiles/throughput/throughput_service.h

Lines changed: 0 additions & 149 deletions
This file was deleted.

examples/rtos/CC2640R2_LAUNCHXL/ble5apps/throughput_central/src/app/throughput_central.c

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,14 @@ static uint16_t phyOptions = HCI_PHY_OPT_NONE;
364364

365365
static throughputProfileHdl_t* throughputHandles = NULL;
366366

367+
// Global Variables for GUI Composer
368+
uint16_t currentPeerTxPDUSize = 0;
369+
uint8_t currentPHY1M = 1;
370+
uint8_t currentPHY2M = 0;
371+
uint32_t instantRate = 0;
372+
uint32_t averageRate = 0;
373+
uint8_t currentMTUSize = 0;
374+
367375
/*********************************************************************
368376
* LOCAL FUNCTIONS
369377
*/
@@ -545,7 +553,13 @@ static void SimpleBLECentral_init(void)
545553

546554
// By Default Allow Central to support any and all PHYs
547555
HCI_LE_SetDefaultPhyCmd(LL_PHY_USE_ANY_PHY, LL_PHY_1_MBPS | LL_PHY_2_MBPS| HCI_PHY_CODED, LL_PHY_1_MBPS | LL_PHY_2_MBPS| HCI_PHY_CODED);
548-
556+
557+
// Set the Transmit Power of the Device to +5dBm
558+
HCI_EXT_SetTxPowerCmd(HCI_EXT_TX_POWER_5_DBM);
559+
560+
// Set the RX Gain to be highest
561+
HCI_EXT_SetRxGainCmd(HCI_EXT_RX_GAIN_HIGH);
562+
549563
// Display Default MTU Size (updated during MTU exchange)
550564
Display_print1(dispHandle, SBC_ROW_MTU, 0, "MTU Size: %dB", ATT_MTU_SIZE);
551565
}
@@ -646,8 +660,10 @@ static void SimpleBLECentral_taskFxn(UArg a0, UArg a1)
646660
// Display Throughput
647661
Display_print3(dispHandle, SBC_ROW_AVG_THROUGHPUT, 0, "Average Rate (kb/s): %d.%d over %d Samples",
648662
(bitsReceived/1000),(bitsReceived % 1000), CB_SIZE);
663+
664+
averageRate = (bitsReceived/1000);
649665
}
650-
666+
651667
// Toggle Throughput Event
652668
// Peripheral Supports Throughput - so throughput should
653669
// begin to be measured
@@ -787,7 +803,15 @@ static void SimpleBLECentral_processStackMsg(ICall_Hdr *pMsg)
787803
// update phyIndex accordingly and display the value
788804
phyIndex = temp;
789805
}
790-
806+
807+
currentPHY1M = 0;
808+
currentPHY2M = 0;
809+
810+
if(phyIndex == 0)
811+
currentPHY1M = 1;
812+
if(phyIndex == 1)
813+
currentPHY2M = 1;
814+
791815
// Tell the use which PHY we're now using
792816
Display_print1(dispHandle, SBC_ROW_PHY, 0, "Current PHY: %s", phyName[phyIndex]);
793817

@@ -797,6 +821,9 @@ static void SimpleBLECentral_processStackMsg(ICall_Hdr *pMsg)
797821
{
798822
hciEvt_BLEDataLengthChange_t *dleEvt = (hciEvt_BLEDataLengthChange_t *)pMsg;
799823
Display_print1(dispHandle, SBC_ROW_PDU, 0, "Device RX PDU Size: %dB", dleEvt->maxRxOctets);
824+
825+
// GUI Composer
826+
currentPeerTxPDUSize = dleEvt->maxRxOctets;
800827
}
801828
}
802829
break;
@@ -982,6 +1009,9 @@ static void SimpleBLECentral_processAppMsg(sbcEvt_t *pMsg)
9821009
// Display Throughput
9831010
Display_print2(dispHandle, SBC_ROW_INST_THROUGHPUT, 0, "Instant Rate (kb/s): %d.%d",
9841011
(bitsReceived/1000),(bitsReceived % 1000));
1012+
1013+
// GUI Composer
1014+
instantRate = (bitsReceived/1000);
9851015
}
9861016
break;
9871017

@@ -1262,6 +1292,9 @@ static void SimpleBLECentral_processGATTMsg(gattMsgEvent_t *pMsg)
12621292
// MTU size updated
12631293
Display_print0(dispHandle, SBC_ROW_RESULT, 0, "MTU Exchanged");
12641294
Display_print1(dispHandle, SBC_ROW_MTU, 0, "MTU Size: %dB", pMsg->msg.mtuEvt.MTU);
1295+
1296+
// GUI Composer
1297+
currentMTUSize = pMsg->msg.mtuEvt.MTU;
12651298
}
12661299
else if (discState != BLE_DISC_STATE_IDLE)
12671300
{
@@ -2081,7 +2114,7 @@ bool SimpleBLECentral_doToggleRSSI(uint8 index)
20812114
else
20822115
{
20832116
SimpleBLECentral_CancelRssi(connHandle);
2084-
Display_print0(dispHandle, SBC_ROW_RSSI, 0, "RSSI Cancelled");
2117+
Display_print0(dispHandle, SBC_ROW_RSSI, 0, "RSSI Canceled");
20852118
}
20862119

20872120
return true;

0 commit comments

Comments
 (0)