Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
496 commits
Select commit Hold shift + click to select a range
ac89eb2
Tests: USB: Use the serial number to find device
Sep 3, 2018
2b186f4
Tests: USB: Add Serial test for line coding change
Sep 5, 2018
fb926e5
Tests: USB: Wait before closing host's port
Sep 20, 2018
a5cc1d9
Tests: USB: Wait before transmitting data to host
Sep 20, 2018
d6f051f
Tests: USB: Correct reconnect delay
Oct 11, 2018
c8d078d
Tests: USB: Use SN generated by the host machine
Oct 16, 2018
f456525
Tests: USB: Update code comments
Oct 17, 2018
4d4af33
Tests: USB: Fix Windows USB SN handling
Oct 17, 2018
482935d
Tests: USB: Increas the size of RX CDC test data
Oct 18, 2018
7f59788
Tests: USB: Use DTR to make Serial tests reliable
c1728p9 Oct 26, 2018
26ab6bb
Tests: USB: Remove TX_DELAY_MS from serial test
c1728p9 Oct 26, 2018
a7c2d94
Tests: USB: Increase serial open retries
c1728p9 Oct 26, 2018
90232e4
Remove USB disconnect delay from Serial test
c1728p9 Oct 26, 2018
3c73e87
Tests: USB: DTR fix for Linux hosts
Nov 2, 2018
cbfb9ea
STM32F4 USB: add patch in CubeF4 hal driver
bcostm Oct 30, 2018
0fccce3
STM32F4 USB: remove useless macro
bcostm Oct 30, 2018
8517dee
STM32F4 USB: enable USB Device in targets.json
bcostm Oct 30, 2018
1e81d21
Non-working custom feeder. Modified nordic driver to disable automati…
AGlass0fMilk Dec 5, 2018
f6bf31a
Added in triggers to synchronize control transfer stages with what th…
AGlass0fMilk Dec 6, 2018
7db9fbf
Merge branch 'feature-hal-spec-usb-device' of https://github.com/ARMm…
AGlass0fMilk Dec 6, 2018
b86c192
Added EP0 stalls to setup event handler
AGlass0fMilk Dec 23, 2018
ceb2bc0
Removed disable from disconnect to see if it affects the success of t…
AGlass0fMilk Dec 27, 2018
6405d8f
Reviewing functions. Added critical sections to some functions that a…
AGlass0fMilk Jan 10, 2019
b57a4ec
Added a few comments to make some process flow more apparent
AGlass0fMilk Jan 15, 2019
41874b1
Fixed bug causing usb_control_stall_test to fail intermittently. Prep…
AGlass0fMilk Jan 15, 2019
39d7e56
Add USBPhy, USB HAL and Utility class
c1728p9 Feb 7, 2018
bf55426
Copy USBDevice from unsupported
c1728p9 Feb 7, 2018
fecddeb
Update USB licenses and format code
c1728p9 Feb 26, 2018
2137890
Update USBDevice and configure to use a USBPhy
c1728p9 Feb 27, 2018
4bcf674
Add USBDevice test code
c1728p9 Feb 7, 2018
5942030
Add USBPhy for the LPC17xx
c1728p9 Feb 7, 2018
87d93b5
Remove mbed 2 USB tests from Travis
c1728p9 Feb 15, 2018
c5579c8
Add Kinetis USB files
c1728p9 Feb 13, 2018
fdab1f1
Update Kinetis USB to match the USBPhy API
c1728p9 Feb 14, 2018
e499396
Add and assert USB callback completion
c1728p9 Mar 8, 2018
ff902b9
Change USBDevice read handling
c1728p9 Mar 14, 2018
a733986
Update USBTester for simplified read handling
c1728p9 Mar 14, 2018
05b4189
Fix USB init problems
c1728p9 Mar 15, 2018
b67ef8f
Update stall state on set and clear feature
c1728p9 Mar 16, 2018
60a8974
Move USBDevice processing out of user callbacks
c1728p9 Mar 17, 2018
35dc641
Allow transfer to start when configuring USB
c1728p9 Mar 17, 2018
304e400
Explicitly return when endpoint 0 is stalled
c1728p9 Mar 17, 2018
2a8efdc
Call disconnect when uninitializing USB
c1728p9 Mar 18, 2018
195e160
Update USBPhy to allow zero copy transfers
c1728p9 Mar 19, 2018
3ced159
Update USBDevice to reflect the updated USBPhy
c1728p9 Mar 17, 2018
d37bd68
Add abort API to USBDevice
c1728p9 Mar 17, 2018
514b509
Update USBTester for the new USB API
c1728p9 Mar 18, 2018
c61550c
Update the LPC17XX driver to the new API
c1728p9 Mar 11, 2018
7a1fb18
Update the Kinetis USB driver to the new API
c1728p9 Mar 19, 2018
077ba93
Update USBPhy doxygen
c1728p9 Mar 19, 2018
4740a51
Add USB utility classes
c1728p9 Mar 2, 2018
57c6f1c
Update USBCDC and USBSerial
c1728p9 Mar 17, 2018
69e30a9
Remove the USB directory from mbed 2 travis
c1728p9 Mar 20, 2018
ad7ab8f
Fix Kinetis endpoint initialization
c1728p9 Mar 19, 2018
ec2259e
Correct Kinetis 256 byte ctrl transfers
c1728p9 Mar 20, 2018
47b9634
Limit USB control transfer size
c1728p9 Mar 20, 2018
ca40505
Disable endpoints when disconnecting on Kinetis
c1728p9 Mar 20, 2018
e3d3de6
Improve LPC1768 USB stability
c1728p9 Mar 21, 2018
437e2b9
USB generic tests
maciejbocianski Mar 13, 2018
45a02be
Move USBPhy and related files to USB directory
c1728p9 Mar 20, 2018
9fe0f40
Add USBPhy template
c1728p9 Mar 24, 2018
c36d609
Add pyusb to requirements
c1728p9 Mar 24, 2018
dc08830
Update USBTester product name
c1728p9 Mar 23, 2018
09a0359
Fix for USB set_clear_feature_test for OSX
maciejbocianski Mar 26, 2018
6f94452
Skip USB reset tests on OSX
c1728p9 Mar 24, 2018
4f6be16
Fix USB tests
c1728p9 Mar 27, 2018
08227df
target: arch_pro enable USBDEVICE support
maciejbocianski Apr 17, 2018
7f9b659
USB reset test fix
maciejbocianski Apr 17, 2018
847d8f7
USBDevice - add support for deconfiguration
maciejbocianski Apr 16, 2018
6e340dd
USBDevice - add multiconfiguration support
maciejbocianski Apr 16, 2018
70793d8
code formatting fixes
maciejbocianski Apr 16, 2018
564a331
Add endpoint_remove_all helper function
c1728p9 Apr 19, 2018
2cae132
USBDevice: endpoint_add/read_start functions return value fix
maciejbocianski Apr 23, 2018
71b72e4
Prevent Kinetis USB setup packets at wrong time
c1728p9 Apr 23, 2018
9f79e88
Fix Kinetis USB disconnect
c1728p9 Apr 23, 2018
ccf3f45
Make USB disconnect + connect time explicit
c1728p9 Apr 23, 2018
b90f1f1
Explicitly specify USBPhy used for testing
c1728p9 Apr 23, 2018
02c441e
Extend USB test class configuration
maciejbocianski Apr 25, 2018
56f3845
pyusb_basic test formatting fixes
maciejbocianski Apr 26, 2018
89f4bc7
pyusb_basic test add helper functions
maciejbocianski Apr 26, 2018
2aa05b6
pyusb_basic test update
maciejbocianski Apr 26, 2018
26a4fa1
Remove blocking option from USB connect
c1728p9 Apr 30, 2018
4208eb0
Remove extra USBDevice constructor
c1728p9 Apr 30, 2018
5351eac
Add USBDevice destructor
c1728p9 May 1, 2018
4cfca01
Cleanup USBSerial
c1728p9 May 1, 2018
757d119
Fix typo in USBTester.h
c1728p9 May 2, 2018
40d157c
Update the USBHID classes
c1728p9 Mar 24, 2018
ea5e557
Update usb test to connect and block itself
maciejbocianski May 3, 2018
9a1498c
NUCLEO_F103RB: replace CLOCK_SOURCE_USB by DEVICE_USBDEVICE
jeromecoutant Apr 30, 2018
b794008
STM32F4: replace CLOCK_SOURCE_USB by DEVICE_USBDEVICE
jeromecoutant Apr 30, 2018
435fdbd
USB basic test update
maciejbocianski May 10, 2018
2ac8cd0
USB basic test documentation update
maciejbocianski May 10, 2018
84770f2
Refactor AsyncOp class
c1728p9 May 7, 2018
b4baff7
Update USBHID and USBCDC for new AsyncOp
c1728p9 May 7, 2018
b67d423
Require USB classes to implement descriptor
c1728p9 May 11, 2018
eaab2d1
Update the USBMIDI class
c1728p9 May 11, 2018
f6a21c6
Add default values to USBCDC constructor
c1728p9 May 27, 2018
f474010
Fix LPC1768 test failures
c1728p9 May 15, 2018
7a2be82
Implement LPC1768 USB abort function
c1728p9 May 16, 2018
601868b
Update the STM32 USB driver to the new API
c1728p9 Mar 28, 2018
bb8df4d
Remove ep0_write from set_address
c1728p9 Apr 25, 2018
db29703
Remove unnecessary USB receive buffer
c1728p9 May 3, 2018
9f5b3a5
Create HAL_PCD_EP_Abort
jamike Apr 25, 2018
e4a1d33
Fix return code check in endpoint abort
c1728p9 May 3, 2018
5e4b542
Only build in USBPhy_STM32 for supported devices
c1728p9 May 3, 2018
4c7cd68
Fix USB on Kinetis devices
c1728p9 Jun 8, 2018
5643c9a
Fix isochronous endpoints on LPC1768
c1728p9 Jun 6, 2018
beb92db
Fix Kinetis bug causing USB to get stuck sending
c1728p9 Jun 14, 2018
f9f272e
Add circular byte buffer using dynamic memory
c1728p9 Jun 4, 2018
bc2e820
Update USBAudio
c1728p9 May 4, 2018
8a5bd12
Fix various USB warnings
c1728p9 Jun 15, 2018
60219c6
Fix unbalanced USBDevice unlock
c1728p9 May 25, 2018
07d2e54
Update USBDevice endpoint checks to fix asserts
c1728p9 May 25, 2018
164ed21
Add the TaskQueue abstract interface and friends
c1728p9 May 23, 2018
c396e7d
Add the PolledQueue implementation of TaskQueue
c1728p9 May 23, 2018
f79cba5
Update USBMSD
c1728p9 May 24, 2018
85c6211
USBMSD fixes
c1728p9 Jun 18, 2018
8865851
Remove endpoint parameter from USB callbacks
c1728p9 Jun 19, 2018
957cd7e
Tests: USB: Add device config files for Zadig
fkjagodzinski May 28, 2018
bbd2fc8
Update USBMSD to be more consistent with others
c1728p9 Jun 20, 2018
33bbce6
Revert "Fix Kinetis bug causing USB to get stuck"
c1728p9 Jun 21, 2018
0811908
Alternate Kinetis USB stuck sending bug fix
c1728p9 Jun 14, 2018
f5e7b4f
Abort the current USB transfer when stalling
c1728p9 Jun 21, 2018
aa1bef0
Reset data toggle on Kinetis when unstalling
c1728p9 Jun 21, 2018
5599978
Revert "Create HAL_PCD_EP_Abort"
c1728p9 Jun 24, 2018
8312d52
Alternate implementation of HAL_PCD_EP_Abort
c1728p9 Jun 25, 2018
1db75b8
Implement endpoint_abort for STM32
c1728p9 Jun 25, 2018
bfaf780
Fix ST test failures due to endpoint reconfiguration
c1728p9 Jun 25, 2018
ba5631a
Remove OR from ST endpoint activation
c1728p9 Jun 25, 2018
77e2dae
USB: EndpointResolver: Add a generic method to get a free endpoint
fkjagodzinski Mar 19, 2018
0e228eb
Tests: USB: Generic: Add basic endpoint tests
fkjagodzinski Mar 28, 2018
ca04ca2
Tests: USB: Generic: Update documentation
fkjagodzinski May 14, 2018
42f1c24
Tests: USB: Update endpoint tests
fkjagodzinski May 17, 2018
c8c033c
Tests: USB: Add data toggle test
fkjagodzinski Jun 7, 2018
6c3a6f1
Tests: USB: Update ep callbacks
fkjagodzinski Jun 21, 2018
9c86ad4
Update test to restart reads after unstall
c1728p9 Jun 21, 2018
a496502
Tests: USB: Decrease the max data size for iso ep
Jun 28, 2018
0882063
Tests: USB: Update endpoint halt test
Jun 28, 2018
3f044cc
Tests: USB: Check ep buffer is released by abort
Jun 29, 2018
fa6e452
Remove HAL_GetTick from ST USBPhy
c1728p9 Jul 31, 2018
287504f
Fix USB traceback during testing when wrong size
c1728p9 Oct 30, 2018
3971530
Ignore disabled Kinetis USB endpoint interrupts
c1728p9 Oct 26, 2018
5d12466
Tests: USB: Add tests for CDC class.
Aug 9, 2018
7d8b590
Tests: USB: Add tests for Serial class.
Aug 9, 2018
6eeabf0
Tests: USB: Fix USB reconnect tests for Win hosts
Aug 10, 2018
a900ac0
Tests: USB: Use the serial number to find device
Sep 3, 2018
645e750
Tests: USB: Add Serial test for line coding change
Sep 5, 2018
dfa85f8
Tests: USB: Wait before closing host's port
Sep 20, 2018
b7eb996
Tests: USB: Wait before transmitting data to host
Sep 20, 2018
4bfbe9d
Tests: USB: Correct reconnect delay
Oct 11, 2018
2011c34
Tests: USB: Use SN generated by the host machine
Oct 16, 2018
3c2fe35
Tests: USB: Update code comments
Oct 17, 2018
a0e9f11
Tests: USB: Fix Windows USB SN handling
Oct 17, 2018
db6b91b
Tests: USB: Increas the size of RX CDC test data
Oct 18, 2018
bb141e7
Tests: USB: Use DTR to make Serial tests reliable
c1728p9 Oct 26, 2018
5e77800
Tests: USB: Remove TX_DELAY_MS from serial test
c1728p9 Oct 26, 2018
7f80173
Tests: USB: Increase serial open retries
c1728p9 Oct 26, 2018
1469c61
Remove USB disconnect delay from Serial test
c1728p9 Oct 26, 2018
6abdbec
Tests: USB: DTR fix for Linux hosts
Nov 2, 2018
dba30da
STM32F4 USB: add patch in CubeF4 hal driver
bcostm Oct 30, 2018
058a0cf
STM32F4 USB: remove useless macro
bcostm Oct 30, 2018
b31f989
STM32F4 USB: enable USB Device in targets.json
bcostm Oct 30, 2018
817e339
Tests: USB: Add a README for Linux users
Dec 14, 2018
15f9389
Renesas : Implement USB Device feature
TomoYamanaka Dec 20, 2018
e37ee0f
STM32F7 USB: add patch in CubeF7 hal driver
bcostm Nov 8, 2018
5f8a230
STM32F7 USB: change VBUS pin for DISCO_F746NG FS
bcostm Nov 8, 2018
6030dc7
STM32F7 USB: add NUCLEO_F756ZG in pins definition
bcostm Nov 20, 2018
ce6834f
STM32F7 USB: enable USBDEVICE in targets.json
bcostm Nov 30, 2018
84f9e53
Tests: USB: Fix 'endpoint halt' test
Jan 14, 2019
36eb2c7
Tests: USB: Use astyle to format the test class
Jan 18, 2019
161156f
Removed 0 max packet size assert for ISO endpoints. Ensured usbd_ep_a…
AGlass0fMilk Jan 19, 2019
7de7301
Removed function call for SOF event -- frame counter is already inclu…
AGlass0fMilk Jan 19, 2019
2e8ca4a
Added code to ignore ZLP packets on the ISOOUT endpoint... not fixing…
AGlass0fMilk Jan 19, 2019
ab4f5e3
Merge pull request #8688 from bcostm/F7_feature-hal-spec-usb-device
0xc0170 Jan 21, 2019
e978ba8
Merge pull request #9373 from fkjagodzinski/test_update-usb-basic
0xc0170 Jan 21, 2019
88b3d73
Changed a little formatting
AGlass0fMilk Jan 22, 2019
d365aca
Merge remote-tracking branch 'origin/feature-hal-spec-usb-device' int…
AGlass0fMilk Jan 22, 2019
ffc15be
Added data toggle clearing to removing endpoints. Reworked aborting e…
AGlass0fMilk Jan 30, 2019
15aff47
Implemented USBPhyHw::unconfigure() as it was causing configuration c…
AGlass0fMilk Feb 2, 2019
f22ecd1
Added setup status enum and removed some old commented out code
AGlass0fMilk Feb 3, 2019
be41352
Removed a commented out code change
AGlass0fMilk Feb 3, 2019
57b1e43
Trying virtual status stage and generated interrupt
AGlass0fMilk Feb 9, 2019
429427a
Added simulated status stage interrupt
AGlass0fMilk Feb 22, 2019
9589165
Added a return from the virtual status transfer software-triggered in…
AGlass0fMilk Feb 22, 2019
6d6324d
Ignore events that happen when an endpoint is stalled/halted
AGlass0fMilk Feb 22, 2019
828d459
Added workaround in for Errata 199
AGlass0fMilk Feb 25, 2019
e36c97e
Added in flag for preventing double IRQ triggering and added asserts …
AGlass0fMilk Feb 25, 2019
c4220c9
-- Added fixes for errata 171, 187, 199, and 200 from SDK15.3
AGlass0fMilk Feb 28, 2019
890551a
Baseline legacy build using 14.2 drivers.
TacoGrandeTX Jun 26, 2018
a21e4e4
Mods for baseline 15.0 support
TacoGrandeTX Jun 26, 2018
ed4799c
Bringing in Softdevice but excluding BLE feature and improvements in …
TacoGrandeTX Jul 9, 2018
365add4
First porting effort covered by JIRA IOTDEV-1572:
TacoGrandeTX Jul 26, 2018
b0f5f06
Ported analogin and pwm_out for IOTDEV-1573.
TacoGrandeTX Aug 8, 2018
3b7432b
Updates to PWM for IOTDEV-1573
TacoGrandeTX Aug 23, 2018
8633087
serial_api: Fixes to compile with SDK15.0
Aug 19, 2018
5643d71
serial_api: add changes to port from Softdevice 14.2 to 15.0
Aug 16, 2018
cce4399
Nordic sdk_config: Configure UART instances
Aug 24, 2018
18d307d
serial_api: Fix the interrupt registration for Nordic Serial Device
Aug 24, 2018
5ebe9c9
Updates for IOTDEV-1575 and nRF52_DK builds
TacoGrandeTX Sep 21, 2018
e0a2a27
Updates for IOTDEV-1576 (only TRNG API)
TacoGrandeTX Oct 5, 2018
4a7027b
NRF52: spi_api: port from Softdevice 14.2 to 15.0
Aug 14, 2018
6752ae7
NRF52: i2c_api: port from Softdevice 14.2 to 15.0
Aug 13, 2018
44ac5db
NRF: enable PRS (Peripheral Resource Sharing) for NRF52832 and NRF52840
Sep 28, 2018
8313a2d
NRF52832: enable UART
Sep 27, 2018
d613667
nRF52832 needs NRFX_RNG_ENABLED to use the legacy driver
TacoGrandeTX Oct 8, 2018
6579b56
nRF52_DK: Use mbed_lib.json to set app_offset (MBED_APP_START)
TacoGrandeTX Oct 16, 2018
1987142
NRF52: Fix vector table
Sep 26, 2018
2cffbd2
Updates after rebase with Mbed master (circa OS v5.10.1)
TacoGrandeTX Oct 16, 2018
6dae896
Fix build for nRF51 (fewer common files with nRF52)
TacoGrandeTX Oct 22, 2018
31be9c3
Remove dead #define PORT_SHIFT
TacoGrandeTX Oct 22, 2018
30308eb
Add missing SoftDevice build support (MBR, NONE, OTA)
Oct 29, 2018
2f730cf
Revert "NRF52: Fix vector table"
TacoGrandeTX Nov 14, 2018
4e911bd
Cleanup for feature release
TacoGrandeTX Nov 15, 2018
b017717
Enabling NRFX_PPI_ENABLED for serial_api updates
TacoGrandeTX Dec 6, 2018
cf680ba
Changes required for rebase:
TacoGrandeTX Dec 6, 2018
4638d8c
Set the PWM clock prescaler back to default (1MHz clock)
TacoGrandeTX Dec 6, 2018
75847c4
NRF52: serial: fix build warnings
Dec 7, 2018
439ec68
NRF52: Cleanup unused code
Dec 7, 2018
3cfc2ef
Fix timer1 irq configuration
desmond-blue Dec 13, 2018
036bbd9
Update BLE SoftDevice from SDK14 to SDK15
desmond-blue Dec 9, 2018
e381832
Fix SoftDevice configuration on NRF52_DK
desmond-blue Dec 14, 2018
22a425e
Remove duplicate file
TacoGrandeTX Dec 18, 2018
d457c7b
Remove RTC from nRF52840_DK and DELTA_DFCM_NNN50 (was testing)
TacoGrandeTX Dec 18, 2018
d953760
Update file header at TARGET_NRF52 level
TacoGrandeTX Dec 19, 2018
8125d96
Add BLE feature to mbed_lib.json of SoftDevice
desmond-blue Dec 19, 2018
0a55865
NRF52: reloc_vector_table: check the RTS pin settings in code
Jan 12, 2019
4f36cd6
Fix nrf section iter macro check
desmond-blue Jan 24, 2019
9811f54
Rebase to master in preparation for v5.12.0
TacoGrandeTX Mar 4, 2019
b6804a9
Update QSPI in the SDK to support long frame mode
TacoGrandeTX Mar 5, 2019
7a6a612
Fix SOFTDEVICE_NONE builds and clean up
TacoGrandeTX Mar 5, 2019
3fa7686
Fix preprocessor conditionals for AC6 build
TacoGrandeTX Mar 6, 2019
dce14f3
Created round-robin style dma scheduling algorithm to ensure all endp…
AGlass0fMilk Mar 7, 2019
778feec
Fix dangling #endif from rebase
TacoGrandeTX Mar 7, 2019
37d904d
Removed unnecessary logic and changed round robin DMA scheduling
AGlass0fMilk Mar 12, 2019
c700610
Added workaround for "unloading" IN endpoints after unstalling. Disab…
AGlass0fMilk Mar 14, 2019
797921c
Removed redundant virtual status transfer notifications.
AGlass0fMilk Mar 14, 2019
9612d98
Merge branch 'round-robin-scheduler' into nrf52840-usb-hal
AGlass0fMilk Mar 14, 2019
0d1d53c
Merge remote-tracking branch 'forked/nrf52840-usb-hal' into denmark
AGlass0fMilk Mar 14, 2019
ba374a1
Added in power driver and moved usbd driver out of subdirectory
AGlass0fMilk Mar 14, 2019
833ed63
Remove redundant legacy files and definition of PACKED
TacoGrandeTX Mar 14, 2019
b752f51
Fixing compatibilities with new nrfx drivers
AGlass0fMilk Mar 15, 2019
f8435ef
Merge branch 'denmark' of github.com:TacoGrandeTX/mbed-os into nrf528…
AGlass0fMilk Mar 15, 2019
b748793
Finished compatibility changes for nrfx renaming
AGlass0fMilk Mar 15, 2019
75ebaee
Fixed IRQ_ENABLE call to IRQ_DISABLE (oops).
AGlass0fMilk Mar 15, 2019
9ca4603
Fixed some comments
AGlass0fMilk Mar 15, 2019
20a3151
Reverting some changes that shouldn't make it into master
AGlass0fMilk Mar 15, 2019
1127b17
Autoformatted with astyle
AGlass0fMilk Mar 15, 2019
77bc8d3
Lock sleep when USB is initialized
AGlass0fMilk Mar 15, 2019
a42f62a
Added in code to fix deepsleep underflow. Nullify event handler membe…
AGlass0fMilk Mar 16, 2019
83ead94
Fixed failure on endpoint test data toggle reset (under Windows): "Da…
AGlass0fMilk Mar 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ void btle_handler(const ble_evt_t *p_ble_evt)


#if (NRF_SD_BLE_API_VERSION >= 5)
#ifndef S140
// Handle PHY upgrade request
case BLE_GAP_EVT_PHY_UPDATE_REQUEST: {
gap.on_phy_update_request(
Expand Down Expand Up @@ -428,7 +427,7 @@ void btle_handler(const ble_evt_t *p_ble_evt)
}
break;
}
#endif

case BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST: {
Gap::Handle_t connection = p_ble_evt->evt.gap_evt.conn_handle;
const ble_gap_evt_conn_param_update_request_t *update_request =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ nRF5xGap::nRF5xGap() :
_connections_role()
{
m_connectionHandle = BLE_CONN_HANDLE_INVALID;
#if (NRF_SD_BLE_API_VERSION >= 6)
m_advHandle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;
#endif
}
/**************************************************************************/
/*!
Expand Down Expand Up @@ -236,13 +239,37 @@ ble_error_t nRF5xGap::setAdvertisingData_(const GapAdvertisingData &advData, con
// }
//}

#if (NRF_SD_BLE_API_VERSION >= 6)
/* sd_ble_gap_adv_data_set has been decprecated */
if (m_advHandle != BLE_GAP_ADV_SET_HANDLE_NOT_SET) {
/* This is for updating advdata*/
ble_gap_adv_data_t adv_data = {0};
adv_data.adv_data.p_data = const_cast<uint8_t*>(advData.getPayload());
adv_data.adv_data.len = advData.getPayloadLen();
adv_data.scan_rsp_data.p_data = const_cast<uint8_t*>(scanResponse.getPayload());
adv_data.scan_rsp_data.len = scanResponse.getPayloadLen();

ASSERT_TRUE(ERROR_NONE ==
sd_ble_gap_adv_stop(m_advHandle),
BLE_ERROR_PARAM_OUT_OF_RANGE);

ASSERT_TRUE(ERROR_NONE ==
sd_ble_gap_adv_set_configure(&m_advHandle, &adv_data, NULL),
BLE_ERROR_PARAM_OUT_OF_RANGE);

ASSERT_TRUE(ERROR_NONE ==
sd_ble_gap_adv_start(m_advHandle, NRF_CONNECTION_TAG),
BLE_ERROR_PARAM_OUT_OF_RANGE);
}
#else
/* Send advertising data! */
ASSERT_TRUE(ERROR_NONE ==
sd_ble_gap_adv_data_set(advData.getPayload(),
advData.getPayloadLen(),
scanResponse.getPayload(),
scanResponse.getPayloadLen()),
BLE_ERROR_PARAM_OUT_OF_RANGE);
#endif

/* Make sure the GAP Service appearance value is aligned with the
*appearance from GapAdvertisingData */
Expand Down Expand Up @@ -373,14 +400,56 @@ ble_error_t nRF5xGap::startAdvertising_(const GapAdvertisingParams &params)

/* Start Advertising */

#if (NRF_SD_BLE_API_VERSION >= 6)

/* FIXME: Must be chanaged if extended paramters added into GapAdvertisingParams */
switch (params.getAdvertisingType()) {
case GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED:
adv_para.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED;
break;

case GapAdvertisingParams::ADV_CONNECTABLE_DIRECTED:
adv_para.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED;
break;

case GapAdvertisingParams::ADV_SCANNABLE_UNDIRECTED:
adv_para.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED;
break;

case GapAdvertisingParams::ADV_NON_CONNECTABLE_UNDIRECTED:
adv_para.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
break;

default:
return BLE_ERROR_PARAM_OUT_OF_RANGE;
break;
}

adv_para.interval = params.getIntervalInADVUnits(); // advertising interval (in units of 0.625 ms)
adv_para.duration = params.getTimeout() * 100; // units have been changed from seconds to 10ms units.
memset(adv_para.channel_mask, 0, sizeof(adv_para.channel_mask));
adv_para.filter_policy = advertisingPolicyMode; // BLE_GAP_ADV_FP_ANY
adv_para.primary_phy = BLE_GAP_PHY_1MBPS; /* Use _preferred_tx_phys if validated */
adv_para.p_peer_addr = NULL;

m_adv_data.adv_data.p_data = const_cast<uint8_t*>(_advPayload.getPayload());
m_adv_data.adv_data.len = _advPayload.getPayloadLen();
m_adv_data.scan_rsp_data.p_data = const_cast<uint8_t*>(_scanResponse.getPayload());
m_adv_data.scan_rsp_data.len = _scanResponse.getPayloadLen();
#else
adv_para.type = params.getAdvertisingType();
adv_para.p_peer_addr = NULL; // Undirected advertisement
adv_para.fp = advertisingPolicyMode;
adv_para.interval = params.getIntervalInADVUnits(); // advertising interval (in units of 0.625 ms)
adv_para.timeout = params.getTimeout();
#endif

#if (NRF_SD_BLE_API_VERSION >= 5)

#if (NRF_SD_BLE_API_VERSION >= 6)
if ((err = sd_ble_gap_adv_set_configure(&m_advHandle, &m_adv_data, &adv_para) == ERROR_NONE)) {
err = sd_ble_gap_adv_start(m_advHandle, NRF_CONNECTION_TAG);
}
#elif (NRF_SD_BLE_API_VERSION == 5)
err = sd_ble_gap_adv_start(&adv_para, NRF_CONNECTION_TAG);
#else
err = sd_ble_gap_adv_start(&adv_para);
Expand Down Expand Up @@ -427,15 +496,29 @@ ble_error_t nRF5xGap::startRadioScan_(const GapScanningParams &scanningParams)
#else
/* For NRF_SD_BLE_API_VERSION >= 3 nRF5xGap::setWhitelist setups the whitelist. */

#if (NRF_SD_BLE_API_VERSION >= 6)
scanParams.filter_policy = scanningPolicyMode;
#else
scanParams.use_whitelist = scanningPolicyMode;
scanParams.adv_dir_report = 0;
#endif
#endif

#if (NRF_SD_BLE_API_VERSION >= 6)
scanParams.extended = 0;
memset(scanParams.channel_mask, 0, sizeof(scanParams.channel_mask));
scanParams.scan_phys = BLE_GAP_PHY_1MBPS; /* Use _preferred_rx_phys if validated */

scanParams.interval = scanningParams.getInterval(); /**< Scan interval between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */
scanParams.window = scanningParams.getWindow(); /**< Scan window between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */
scanParams.timeout = scanningParams.getTimeout()*100; /**< Scan timeout between 0x0001 and 0xFFFF in 10 ms units, 0x0000 disables timeout. */
#else
scanParams.active = scanningParams.getActiveScanning(); /**< If 1, perform active scanning (scan requests). */

scanParams.interval = scanningParams.getInterval(); /**< Scan interval between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */
scanParams.window = scanningParams.getWindow(); /**< Scan window between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */
scanParams.timeout = scanningParams.getTimeout(); /**< Scan timeout between 0x0001 and 0xFFFF in seconds, 0x0000 disables timeout. */
#endif

if (_privacy_enabled) {
bool enable_resolution =
Expand All @@ -450,9 +533,20 @@ ble_error_t nRF5xGap::startRadioScan_(const GapScanningParams &scanningParams)
}
}

#if (NRF_SD_BLE_API_VERSION >= 6)
m_scan_buffer.p_data = m_raw_scan_buffer;
m_scan_buffer.len = sizeof(m_raw_scan_buffer);
m_resume_scanning = true;
//if (sd_ble_gap_scan_start(&scanParams, &m_scan_buffer) != NRF_SUCCESS) {
uint32_t res = sd_ble_gap_scan_start(&scanParams, &m_scan_buffer);
if (res != NRF_SUCCESS) {
return BLE_ERROR_PARAM_OUT_OF_RANGE;
}
#else
if (sd_ble_gap_scan_start(&scanParams) != NRF_SUCCESS) {
return BLE_ERROR_PARAM_OUT_OF_RANGE;
}
#endif

return BLE_ERROR_NONE;
}
Expand Down Expand Up @@ -485,7 +579,11 @@ ble_error_t nRF5xGap::stopScan_(void) {
ble_error_t nRF5xGap::stopAdvertising_(void)
{
/* Stop Advertising */
#if (NRF_SD_BLE_API_VERSION >= 6)
ASSERT_TRUE(ERROR_NONE == sd_ble_gap_adv_stop(m_advHandle), BLE_ERROR_PARAM_OUT_OF_RANGE);
#else
ASSERT_TRUE(ERROR_NONE == sd_ble_gap_adv_stop(), BLE_ERROR_PARAM_OUT_OF_RANGE);
#endif

state.advertising = 0;

Expand Down Expand Up @@ -631,8 +729,11 @@ ble_error_t nRF5xGap::connect(
}
#else
/* For NRF_SD_BLE_API_VERSION >= 3 nRF5xGap::setWhitelist setups the whitelist. */

#if (NRF_SD_BLE_API_VERSION >= 6)
scanParams.filter_policy |= (whitelistAddressesSize) ? 1 : 0;
#else
scanParams.use_whitelist = (whitelistAddressesSize) ? 1 : 0;
#endif

if (_privacy_enabled) {
bool enable_resolution =
Expand Down Expand Up @@ -661,6 +762,10 @@ ble_error_t nRF5xGap::connect(
scanParams.timeout = _scanningParams.getTimeout(); /**< Scan timeout between 0x0001 and 0xFFFF in seconds, 0x0000 disables timeout. */
}

#if NRF_SD_BLE_API_VERSION >= 6
m_resume_scanning = false;
#endif

#if NRF_SD_BLE_API_VERSION >= 5
uint32_t rc = sd_ble_gap_connect(addr_ptr, &scanParams, &connParams, NRF_CONNECTION_TAG);
#else
Expand Down Expand Up @@ -706,6 +811,9 @@ ble_error_t nRF5xGap::setPreferredPhys_(
uint8_t preferred_rx_phys = rxPhys? rxPhys->value() : 0;

#ifdef S140
#if (NRF_SD_BLE_API_VERSION) >= 6
/* Set _preferred_tx_phys and _preferred_rx_phys here, used when start advertising or scanning */
#else
ble_opt_t opt = { 0 };
opt.gap_opt.preferred_phys.tx_phys = preferred_tx_phys;
opt.gap_opt.preferred_phys.rx_phys = preferred_rx_phys;
Expand All @@ -726,7 +834,7 @@ ble_error_t nRF5xGap::setPreferredPhys_(
default:
return BLE_ERROR_UNSPECIFIED;
}

#endif
#endif

_preferred_tx_phys = preferred_tx_phys;
Expand All @@ -741,7 +849,7 @@ ble_error_t nRF5xGap::setPhy_(
const ble::phy_set_t* rxPhys,
CodedSymbolPerBit_t codedSymbol
) {
#ifdef S140
#if defined(S140) && ((NRF_SD_BLE_API_VERSION) < 6)
return BLE_ERROR_NOT_IMPLEMENTED;
#else
// TODO handle coded symbol once supported by the softdevice.
Expand Down Expand Up @@ -851,6 +959,9 @@ ble_error_t nRF5xGap::reset_(void)

/* Clear derived class members */
m_connectionHandle = BLE_CONN_HANDLE_INVALID;
#if (NRF_SD_BLE_API_VERSION >= 6)
m_advHandle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;
#endif

/* Set the whitelist policy filter modes to IGNORE_WHITELIST */
advertisingPolicyMode = ADV_POLICY_IGNORE_WHITELIST;
Expand Down Expand Up @@ -1019,7 +1130,25 @@ ble_error_t nRF5xGap::getAppearance_(GapAdvertisingData::Appearance *appearanceP
ble_error_t nRF5xGap::setTxPower_(int8_t txPower)
{
unsigned rc;
#if (NRF_SD_BLE_API_VERSION >= 6)
/* FIXME: This has to change API for specified paramter */
uint16_t handle = 0;
rc = NRF_SUCCESS;
if ((handle = getConnectionHandle()) != BLE_CONN_HANDLE_INVALID) {
rc = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_CONN, handle, txPower);
}
if ((rc == NRF_SUCCESS) && (m_advHandle != BLE_GAP_ADV_SET_HANDLE_NOT_SET)) {
handle = (uint16_t)m_advHandle;
rc = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, handle, txPower);
}
if (rc == NRF_SUCCESS) {
rc = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_SCAN_INIT, 0 /* This is ingored for ROLE_SCAN_INIT*/, txPower);
}

if (rc != NRF_SUCCESS) {
#else
if ((rc = sd_ble_gap_tx_power_set(txPower)) != NRF_SUCCESS) {
#endif
switch (rc) {
case NRF_ERROR_BUSY:
return BLE_STACK_BUSY;
Expand Down Expand Up @@ -1564,6 +1693,34 @@ void nRF5xGap::on_advertising_packet(const ble_gap_evt_adv_report_t &evt) {
);
const uint8_t* peer_address = evt.peer_addr.addr;

#if (NRF_SD_BLE_API_VERSION >= 6)
GapAdvertisingParams::AdvertisingType_t type;
if (evt.type.connectable && !evt.type.directed) {
type = GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED;
} else if (evt.type.connectable && evt.type.directed) {
type = GapAdvertisingParams::ADV_CONNECTABLE_DIRECTED;
} else if (evt.type.scannable && !evt.type.directed) {
type = GapAdvertisingParams::ADV_SCANNABLE_UNDIRECTED;
} else if (!evt.type.connectable && !evt.type.directed) {
type = GapAdvertisingParams::ADV_NON_CONNECTABLE_UNDIRECTED;
} else {
// wrong condition
}
processAdvertisementReport(
peer_address,
evt.rssi,
(evt.type.scan_response? 1 : 0),
type,
evt.data.len,
evt.data.p_data,
peer_addr_type
);

/* If no action for connecting, must call sd_ble_gap_scan_start() aging for resuming scanning */
if (m_resume_scanning) {
sd_ble_gap_scan_start(NULL, &m_scan_buffer);
}
#else
processAdvertisementReport(
peer_address,
evt.rssi,
Expand All @@ -1573,6 +1730,7 @@ void nRF5xGap::on_advertising_packet(const ble_gap_evt_adv_report_t &evt) {
evt.data,
peer_addr_type
);
#endif
}

ble_error_t nRF5xGap::get_role(ble::connection_handle_t connection, Role_t& role) {
Expand Down Expand Up @@ -1656,7 +1814,6 @@ void nRF5xGap::on_phy_update(
);
}

#ifndef S140
void nRF5xGap::on_phy_update_request(
Handle_t connection,
const ble_gap_evt_phy_update_request_t& evt
Expand All @@ -1676,7 +1833,6 @@ void nRF5xGap::on_phy_update_request(

sd_ble_gap_phy_update(connection, &phys);
}
#endif



Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,18 @@ class nRF5xGap :
void release_all_connections_role();

void on_phy_update(Handle_t connection, const ble_gap_evt_phy_update_t& evt);
// FIXME: remove guard when S140 updated
#ifndef S140
void on_phy_update_request(Handle_t connection, const ble_gap_evt_phy_update_request_t& evt);

#if (NRF_SD_BLE_API_VERSION) >= 6
uint8_t m_advHandle;
/*
Note: The advertising data must be kept alive in memory until advertising is terminated. Not doing so will lead to undefined behavior.
Note: Updating advertising data while advertising can only be done by providing new advertising data buffers.
*/
ble_gap_adv_data_t m_adv_data;
uint8_t m_raw_scan_buffer[BLE_GAP_SCAN_BUFFER_MIN];
ble_data_t m_scan_buffer;
bool m_resume_scanning; /* When the application receives a ble_gap_adv_report_t, it must now resume scanning by calling sd_ble_gap_scan_start() */
#endif

uint16_t m_connectionHandle;
Expand Down
Loading