Commit Graph

52 Commits

Author SHA1 Message Date
Glenn Ruben Bakke 309ae12346 nrf5: Starting process of renaming files in sdk folder to facilitate renaming of the folder and make it more logical. Transition will be from sdk to bluetooth. 2017-03-04 15:06:08 +01:00
Glenn Ruben Bakke f2a7e198d2 nrf5/sdk: Updating low frequency clock calibration from 4 seconds to 250 ms for stack enable when BLUETOOTH_LFCLK_RC is enabled. 2017-03-04 01:36:06 +01:00
Glenn Ruben Bakke e95ec1a285 nrf5/sdk: Adding support for initializing the bluetooth stack using RC oscillator instead of crystal. If BLUETOOTH_LFCLK_RC is set in CFLAGS, this variant of softdevice enable will be activated. 2017-03-03 23:20:38 +01:00
Glenn Ruben Bakke 235c0edacb nrf5/sdk: Updating ringbuffer.h to use volatile variables for start and end. 2017-03-03 00:11:42 +01:00
Glenn Ruben Bakke d057a93675 nrf5/sdk: Rename cccd_enable variable to m_cccd_enable in bluetooth le UART driver. Also made the variable volatile. 2017-03-03 00:06:51 +01:00
Glenn Ruben Bakke 22f66e274d nrf5/sdk: Updating bluetooth le driver to handle SEC PARAM REQUEST by replying that pairing is not supported. Moving initialization of adv and tx in progress state variables to stack enable function. 2017-03-02 22:48:04 +01:00
Glenn Ruben Bakke e60fa9b3e1 nrf5/sdk: Fixing unaligned access issues for nrf51 (cortex-m0) in bluetooth le driver 2017-03-02 21:25:51 +01:00
Glenn Ruben Bakke 44c9888511 nrf5/sdk: Removing SDK dependant BLE UART Service implementation
The sdk_12.1.0 nrf52_ble.c implementation was dependent on SDK components.
This has been replaced with the ble_uart.c implementation using a standalone
bluetooth driver implementation without need of SDK components.

Also, sdk.mk has been updated to not use a special linker script.
2017-03-01 00:05:04 +01:00
Glenn Ruben Bakke 58cc59cfbe nrf5/sdk: Removing ble_repl_linux.py
Script does not really work very well with blocking char read and
async ble notifications printing data when terminal stdout is blocked
by readchar. Bluetooth UART profile implemented in ble_uart.c is
now working with tralamazza's nus_console nodejs script.

Ref: https://github.com/tralamazza/nus_console
2017-02-28 23:40:46 +01:00
Glenn Ruben Bakke e8761682b7 nrf5/sdk: Add ble_uart.c to source list
ble_uart.c implements UART Bluetooth service on top of the
bluetooth stack driver api calls. Can be enabled to be compiled
in by defining MICROPY_PY_BLE_NUS = 1 in nrf5_sdk_conf.h.
2017-02-28 23:30:36 +01:00
Glenn Ruben Bakke 84313b0261 nrf5/sdk: Removing include of sdk_12.1.0's build.mk
As no sources are needed from the SDK this build makefile
can be deleted.
2017-02-28 23:28:09 +01:00
Glenn Ruben Bakke 216c97ff9a nrf5/sdk: Adding compiler guard around exchange MTU request event.
As s110 is not having this event or function call to answer on a MTU
exchange request, this is excluded for all other version than s132
for now.
2017-02-28 23:13:02 +01:00
Glenn Ruben Bakke 382f718cfc nrf5/sdk: Updating BLE UART implementation by swapping TX and RX uuid and characterisitic handling. Removed dummy write delay of 10 ms. 2017-02-27 23:47:47 +01:00
Glenn Ruben Bakke b032d765ff nrf5/sdk: Backing up progress in bluetooth le driver. Adding new gap and gatts handlers. Added handling of tx complete events when using notification, responding to MTU request, and setting of default connection parameters. 2017-02-27 23:40:39 +01:00
Glenn Ruben Bakke 64b23e1127 nrf5/sdk: Backing up progress in BLE UART driver. Adding ringbuffer in order to poll bytes from recieved data in REPL main loop. 2017-02-24 15:14:12 +01:00
Glenn Ruben Bakke 6b898d1d67 nrf5/sdk: Adding macro based ringbuffer written by Philip Thrasher. source: https://github.com/pthrasher/c-generic-ring-buffer/blob/master/ringbuffer.h. Copyright noticed copied into the file, and file reviewed by Philip. 2017-02-23 21:52:23 +01:00
Glenn Ruben Bakke f10abda60a nrf5/sdk: Updating bluetooth le driver to extract data length and pointer from the event structure upon gatts write operation. 2017-02-22 19:54:02 +01:00
Glenn Ruben Bakke 3e66898c37 nrf5/sdk: Updating bluetooth le uart implemenatation to block until cccd is written. 2017-02-21 23:37:52 +01:00
Glenn Ruben Bakke 80b2d7e4ad nrf5/sdk: Backing up ubluepy version of ble uart service for Bluetooth LE REPL. 2017-02-21 00:15:51 +01:00
Glenn Ruben Bakke 7223950864 nrf5/sdk: Remaning bluetooth driver function ble_drv_attr_notif to *_notify. 2017-02-20 21:26:19 +01:00
Glenn Ruben Bakke a973dde603 nrf5/sdk: Adding parsing of characteristic properties and attributes (extra descriptions for the characteristic, for now cccd). 2017-02-20 20:24:27 +01:00
Glenn Ruben Bakke 29b283f697 nrf5/sdk: Adding support for setting gatts handler in the bluetooth le driver. 2017-02-19 00:08:05 +01:00
Glenn Ruben Bakke 98358e4400 nrf5/sdk: Adding template functions for attribute read/write/notify in bluetooth le driver. 2017-02-18 21:11:39 +01:00
Glenn Ruben Bakke c81b606b01 nrf5/sdk: Adding support for adding 16-bit uuid's in advertisment packet. The services in paramter list can mix 16-bit and 128-bit. 2017-02-17 21:47:38 +01:00
Glenn Ruben Bakke 9befd776fa nrf5/sdk: Updating sdk_common.mk with new filename of bluetooth le driver. 2017-02-17 19:13:49 +01:00
Glenn Ruben Bakke 21f1d8c640 nrf5: Updating all includes of softdevice.h to ble_drv.h 2017-02-17 19:10:24 +01:00
Glenn Ruben Bakke 793cf991ad nrf5/sdk: renaming softdevice.* to ble_drv.* 2017-02-17 19:06:11 +01:00
Glenn Ruben Bakke 5f4c464f29 nrf5/sdk: Renaming bluetooth driver functions to have ble_drv* prefix. Updating modules using it. 2017-02-17 19:02:24 +01:00
Glenn Ruben Bakke 3ff245f667 nrf5/sdk: Enable ubluepy module if s110 bluetooth stack is enabled. 2017-02-17 18:11:22 +01:00
Glenn Ruben Bakke 86c900313c nrf5/sdk: Updating bluetooth driver to only set periph and central count if s132 bluetooth stack. These parameters does not exist in older stacks. 2017-02-17 18:09:23 +01:00
Glenn Ruben Bakke bba8221aa2 nrf5/modules: Updating bluetooth driver and ubluepy to use explicit gap event handler. Adding connection handle parameter to the gap handler from ubluepy. Resetting advertisment flag if connection event is recieved, in order to allow for subsequent advertisment if disconnected again. Example in ublupy header updated. 2017-02-17 17:32:42 +01:00
Glenn Ruben Bakke d88320b5b3 nrf5/sdk: Updating bluetooth driver to have configurable logs. 2017-02-15 23:57:23 +01:00
Glenn Ruben Bakke 832a7ffd14 nrf5/modules: updating ubluepy and bluetooth driver to support python created event handler. Added registration of callback from ubluepy against the bluetooth driver and dispatching of events to the user supplied python function. 2017-02-15 23:32:42 +01:00
Glenn Ruben Bakke 66223b4285 nrf5/sdk: Fixing debug print in bluetooth driver to not use >>> prefix. Adding one more print for connection parameter update. 2017-02-14 20:18:53 +01:00
Glenn Ruben Bakke 44f701946b nrf5/sdk: Correcting advertisment packet in bluetooth driver in order to make the device connectable. 2017-02-13 17:06:13 +01:00
Glenn Ruben Bakke a79c5ca7ab nrf5/sdk: Implementing simple event handler for bluetooth stack driver. 2017-02-13 00:18:47 +01:00
Glenn Ruben Bakke 7a43228a2d nrf5/sdk: Disable all sdk components from being included in the build while implementing ubluepy, overlap in IRQ handler symbol. 2017-02-13 00:16:45 +01:00
Glenn Ruben Bakke 0a0ab8344e nrf5/sdk: Updating advertisment function in bluetooth le driver to add 128-bit complete service UUID provided in service list to the advertisment packet. 2017-02-12 23:03:55 +01:00
Glenn Ruben Bakke 2d58fc6625 nrf5/sdk: Updating advertisment funciton in bluetooth le driver to iterate through services passed in and calculate individiual uuid sizes. 2017-02-12 15:20:41 +01:00
Glenn Ruben Bakke 90523d6ae0 nrf5/sdk: Adding static boolean for keeping track of whether advertisment is in progress in the bluetooth driver. Now, advertisment can be restarted with new data any time. 2017-02-12 14:24:15 +01:00
Glenn Ruben Bakke b65553e57f nrf5/sdk: Successful device name advertisment. Added flags to advertisment packet and enable device name byte copy into the advertisment data. 2017-02-11 18:02:22 +01:00
Glenn Ruben Bakke 1a3ae62fd1 nrf5/sdk: Updating softdevice driver with function to set advertisment data and start advertisment. Does not apply device name yet. Work in progress. 2017-02-11 17:41:16 +01:00
Glenn Ruben Bakke c9aa561aad nrf5/modules: Adding function in bluetooth le driver to add characteristic to the bluetooth le stack. 2017-02-11 16:01:50 +01:00
Glenn Ruben Bakke fad456d18f nrf5/modules: Updating ubluepy with more implementation in UUID and Service. Adding function in bluetooth le driver which adds services to the bluetooth stack. Making service take UUID object and Service type (primary/secondary) as constructor parameter in Service class. 2017-02-10 21:09:03 +01:00
Glenn Ruben Bakke b93644221e nrf5/sdk: Adding new function to the softdevice handler driver to add vendor specific uuids and return an index to the entry back by reference. 2017-02-09 23:57:30 +01:00
Glenn Ruben Bakke 323533c3d3 nrf5/sdk: Adding configuration to enable the ubluepy peripheral class when using softdevice 132 from the SDK. 2017-02-08 18:45:49 +01:00
Glenn Ruben Bakke 35a7aa1331 nrf5: Adding ubluepy module to builtins if bluetooth stack is selected. Disable NUS profile by default. Adding source for ubluepy module into makefile to be included in build. The source is only linked if MICROPY_PY_UBLUEPY is set. 2017-02-08 00:05:37 +01:00
Glenn Ruben Bakke f8a71311ed nrf5/sdk: Adding compilation config whether to include BLE NUS implementation. Config found in sdk/nrf5_sdk_conf.h. NUS enabled for s132 targets by default. 2017-02-04 16:24:50 +01:00
Glenn Ruben Bakke 918617d1eb nrf5/sdk: Adding work-in-progress script to connect to bluetooth le REPL using bluepy python module in linux. 2017-02-04 01:12:30 +01:00
Glenn Ruben Bakke a7832a203f nrf52/sdk: Correcting path to iot softdevice if SDK is enabled. 2016-12-29 16:48:47 +01:00