[GitHub] jacobrosenthal closed pull request #839: LOG_NEWTMGR sysflag path missing cborattr dependency
jacobrosenthal closed pull request #839: LOG_NEWTMGR sysflag path missing cborattr dependency URL: https://github.com/apache/mynewt-core/pull/839 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/sys/log/full/pkg.yml b/sys/log/full/pkg.yml index a79512e63..c9fb9eee9 100644 --- a/sys/log/full/pkg.yml +++ b/sys/log/full/pkg.yml @@ -36,6 +36,8 @@ pkg.deps.LOG_CLI: pkg.deps.LOG_NEWTMGR: - mgmt/mgmt +- encoding/cborattr +- encoding/tinycbor pkg.apis: - log This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-core] branch master updated: LOG_NEWTMGR sysflag path missing cborattr dependency (#839)
This is an automated email from the ASF dual-hosted git repository. jacobrosenthal pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git The following commit(s) were added to refs/heads/master by this push: new 19f8858 LOG_NEWTMGR sysflag path missing cborattr dependency (#839) 19f8858 is described below commit 19f885881778de0b9516ee71a680ddf5ded2231e Author: Jacob RosenthalAuthorDate: Thu Feb 22 21:57:03 2018 -0700 LOG_NEWTMGR sysflag path missing cborattr dependency (#839) --- sys/log/full/pkg.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/log/full/pkg.yml b/sys/log/full/pkg.yml index a79512e..c9fb9ee 100644 --- a/sys/log/full/pkg.yml +++ b/sys/log/full/pkg.yml @@ -36,6 +36,8 @@ pkg.deps.LOG_CLI: pkg.deps.LOG_NEWTMGR: - mgmt/mgmt +- encoding/cborattr +- encoding/tinycbor pkg.apis: - log -- To stop receiving notification emails like this one, please contact jacobrosent...@apache.org.
[GitHub] ccollins476ad opened a new pull request #139: Selective install
ccollins476ad opened a new pull request #139: Selective install URL: https://github.com/apache/mynewt-newt/pull/139 Allow install / update / sync of specific repos This commit allows the user to specify a list of repos with the `install`, `update`, and `sync` commands. If no repos are specified, newt operates on all repos (as before). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] ccollins476ad opened a new pull request #138: newt - Don't abort if setting is redefined.
ccollins476ad opened a new pull request #138: newt - Don't abort if setting is redefined. URL: https://github.com/apache/mynewt-newt/pull/138 Syscfg settings must have unique names. When newt detected two settings with the same name, it would terminate with this error message: ``` setting redefined ``` This commit changes two things: 1. The error is now just a warning. Newt warns the user about the issue, but ignores the second definition and proceeds with its operation. Allowing newt to proceed makes it easier to debug the syscfg issue. Now the user can use commands like `target revdep` to debug the issue. 2. The message text is now more detailed: ``` * Warning: setting redefined (pkg1= pkg2=) ``` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mlampert opened a new pull request #840: Feature/stm32f3
mlampert opened a new pull request #840: Feature/stm32f3 URL: https://github.com/apache/mynewt-core/pull/840 Adds support for the STM32F3 family of processors and two of their development boards: - nucleo-f303k8 - nucleo-f303re This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mlaz commented on a change in pull request #836: [WIP] PWM add cycle interrupt handling to pwm_nrf52 driver
mlaz commented on a change in pull request #836: [WIP] PWM add cycle interrupt handling to pwm_nrf52 driver URL: https://github.com/apache/mynewt-core/pull/836#discussion_r170148793 ## File path: hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c ## @@ -177,9 +249,10 @@ nrf52_pwm_close(struct os_dev *odev) dev = (struct pwm_dev *) odev; inst_id = dev->pwm_instance_id; +assert(instances[inst_id].in_use); Review comment: > I think probably all these asserts needs to be just return codes. Agreed, on this case it makes perfect sense to have error codes. IMHO, I'd say use error codes on recoverable situations, use assertions on unrecoverable situations (i.e. checking NULL pointers, array lengths, etc). I've seen here code produced under this practice. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mlaz commented on a change in pull request #836: [WIP] PWM add cycle interrupt handling to pwm_nrf52 driver
mlaz commented on a change in pull request #836: [WIP] PWM add cycle interrupt handling to pwm_nrf52 driver URL: https://github.com/apache/mynewt-core/pull/836#discussion_r170148793 ## File path: hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c ## @@ -177,9 +249,10 @@ nrf52_pwm_close(struct os_dev *odev) dev = (struct pwm_dev *) odev; inst_id = dev->pwm_instance_id; +assert(instances[inst_id].in_use); Review comment: > I think probably all these asserts needs to be just return codes. Agreed, on this case it makes perfect sense to have error codes. IMHO, I'd say use error codes on recoverable situations, use asserts on unrecoverable situations (i.e. checking NULL pointers, array lengths, etc). I've seen here code produced under this practice. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mlaz commented on a change in pull request #836: [WIP] PWM add cycle interrupt handling to pwm_nrf52 driver
mlaz commented on a change in pull request #836: [WIP] PWM add cycle interrupt handling to pwm_nrf52 driver URL: https://github.com/apache/mynewt-core/pull/836#discussion_r170148793 ## File path: hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c ## @@ -177,9 +249,10 @@ nrf52_pwm_close(struct os_dev *odev) dev = (struct pwm_dev *) odev; inst_id = dev->pwm_instance_id; +assert(instances[inst_id].in_use); Review comment: > I think probably all these asserts needs to be just return codes. Agreed, on this case it makes perfect sense to have error codes. IMHO, I'd say use error codes on recoverable situations, use asserts on unrecoverable situations (i.e. checking NULL pointers, array lengths, etc). I've seen here code produced under this practice, I think if everyone agrees, it would be This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-nimble] branch new-master updated: nimble: Make this proper external repository
This is an automated email from the ASF dual-hosted git repository. andk pushed a commit to branch new-master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git The following commit(s) were added to refs/heads/new-master by this push: new b886ac3 nimble: Make this proper external repository b886ac3 is described below commit b886ac3d8341d133dca1edef832d7f2d4928db08 Author: Andrzej KaczmarekAuthorDate: Wed Dec 20 14:33:54 2017 +0100 nimble: Make this proper external repository --- nimble/controller/pkg.yml | 6 +++--- nimble/controller/test/pkg.yml | 14 +++--- nimble/host/mesh/pkg.yml | 12 ++-- nimble/host/pkg.yml| 16 nimble/host/services/ans/pkg.yml | 4 ++-- nimble/host/services/bleuart/pkg.yml | 6 +++--- nimble/host/services/gap/pkg.yml | 4 ++-- nimble/host/services/gatt/pkg.yml | 4 ++-- nimble/host/services/ias/pkg.yml | 4 ++-- nimble/host/services/lls/pkg.yml | 4 ++-- nimble/host/services/tps/pkg.yml | 4 ++-- nimble/host/store/config/pkg.yml | 8 nimble/host/store/ram/pkg.yml | 4 ++-- nimble/host/test/pkg.yml | 16 nimble/host/util/pkg.yml | 4 ++-- nimble/pkg.yml | 4 ++-- nimble/transport/emspi/pkg.yml | 6 +++--- nimble/transport/ram/pkg.yml | 6 +++--- nimble/transport/socket/pkg.yml| 10 +- nimble/transport/uart/pkg.yml | 10 +- nimble/host/util/pkg.yml => repository.yml | 20 ++-- 21 files changed, 83 insertions(+), 83 deletions(-) diff --git a/nimble/controller/pkg.yml b/nimble/controller/pkg.yml index fa50118..8ccb9f8 100644 --- a/nimble/controller/pkg.yml +++ b/nimble/controller/pkg.yml @@ -17,7 +17,7 @@ # under the License. # -pkg.name: net/nimble/controller +pkg.name: nimble/controller pkg.description: Controller side of the nimble Bluetooth Smart stack. pkg.author: "Apache Mynewt " pkg.homepage: "http://mynewt.apache.org/; @@ -31,8 +31,8 @@ pkg.req_apis: - stats pkg.deps: -- kernel/os -- net/nimble +- "@apache-mynewt-core/kernel/os" +- nimble pkg.init: ble_ll_init: 250 diff --git a/nimble/controller/test/pkg.yml b/nimble/controller/test/pkg.yml index c345c13..ab1d9db 100644 --- a/nimble/controller/test/pkg.yml +++ b/nimble/controller/test/pkg.yml @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. # -pkg.name: net/nimble/controller/test +pkg.name: nimble/controller/test pkg.type: unittest pkg.description: "NimBLE controller unit tests." pkg.author: "Apache Mynewt " @@ -23,11 +23,11 @@ pkg.homepage: "http://mynewt.apache.org/; pkg.keywords: pkg.deps: -- test/testutil -- net/nimble/controller +- "@apache-mynewt-core/test/testutil" +- nimble/controller pkg.deps.SELFTEST: -- sys/console/stub -- sys/log/full -- sys/stats/stub -- net/nimble/transport/ram +- "@apache-mynewt-core/sys/console/stub" +- "@apache-mynewt-core/sys/log/full" +- "@apache-mynewt-core/sys/stats/stub" +- nimble/transport/ram diff --git a/nimble/host/mesh/pkg.yml b/nimble/host/mesh/pkg.yml index 3e1be0e..19fb91d 100644 --- a/nimble/host/mesh/pkg.yml +++ b/nimble/host/mesh/pkg.yml @@ -17,7 +17,7 @@ # under the License. # -pkg.name: net/nimble/host/mesh +pkg.name: nimble/host/mesh pkg.description: Bluetooth Mesh pkg.author: "Apache Mynewt " pkg.homepage: "http://mynewt.apache.org/; @@ -27,11 +27,11 @@ pkg.keywords: - mesh pkg.deps: -- kernel/os -- net/nimble -- util/mem -- net/nimble/host -- crypto/tinycrypt +- "@apache-mynewt-core/kernel/os" +- "@apache-mynewt-core/util/mem" +- "@apache-mynewt-core/crypto/tinycrypt" +- nimble +- nimble/host pkg.deps.BLE_MESH_SHELL: - sys/shell diff --git a/nimble/host/pkg.yml b/nimble/host/pkg.yml index 4affd38..f939b8e 100644 --- a/nimble/host/pkg.yml +++ b/nimble/host/pkg.yml @@ -17,7 +17,7 @@ # under the License. # -pkg.name: net/nimble/host +pkg.name: nimble/host pkg.description: Host side of the nimble Bluetooth Smart stack. pkg.author: "Apache Mynewt " pkg.homepage: "http://mynewt.apache.org/; @@ -26,21 +26,21 @@ pkg.keywords: - bluetooth pkg.deps: -- kernel/os -- net/nimble -- util/mem +- "@apache-mynewt-core/kernel/os" +- "@apache-mynewt-core/util/mem" +- nimble pkg.deps.BLE_SM_LEGACY: -- crypto/tinycrypt +- "@apache-mynewt-core/crypto/tinycrypt" pkg.deps.BLE_SM_SC: -- crypto/tinycrypt +- "@apache-mynewt-core/crypto/tinycrypt" pkg.deps.BLE_MONITOR_RTT: -- hw/drivers/rtt
[mynewt-nimble] branch new-master created (now c1272bd)
This is an automated email from the ASF dual-hosted git repository. andk pushed a change to branch new-master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git. at c1272bd nimble/ll: Fix BLE_LL_CONN_INIT_MIN_WIN_OFFSET This branch includes the following new commits: new 21c98b5 nimble host - Add missing "\n" at end of log lines new 928a7ce nimble host: Clarify host address and address type new 4f672f9 nimble host: Initial security manager (SM) new eec9fb7 nimble host: notify app when encryption changes. new 6ade22f MYNEWT-99: add random number genration/support for LE encryption new 785da24 Reduce blehost code size - disable SM by default. new ef0fe38 Look at nimble options before #if NIMBLE_OPT_SM ! new 2a1223d Some preliminary passkey & OOB. new 33a5f91 MYNEWT-271: fix nimble stack set advertising data HCI command bugs. new b41a347 MYNEWT-272: Fix error in octets 34 and 35 of supported commands returned from the controller new ff6ce4a MYNEWT-271: the same issue regarding set advertising data was present in set scan response data. new 4c40540 nimble host: Fix failing adv unit tests. new 9620998 ble host- fix crash upon gatt procedure timeout. new fe562fc MYNEWT-277: add commands that need to be supported for data length extension. This also fixes a bug in the code regarding fragmentation of frames. Prior code was not fragmenting frames correctly new 5e096ff No jira ticket for this commit. Renamed a BLE error code since it was very poorly named. The old name was 'unsupported feature' when it really was an error denoting 'unsupported remote feature'. This was confusing and was leading to bugs so I modified the name and also returned the proper error code in cases where we dont support a feature (as opposed to the remote) new 0f2dc89 No jira ticket: modified api to ble_ll_hci_is_event_enabled() to pass in the event as opposed to the bit position as this was confusing new 38a19f3 Add random number code back to build if LE encryption not defined new d5e2286 Fix nrf51 receive mbuf data pointer error new 3114289 ble ctlr: clear filtered advertisers on scan start new 4e5e93c ble host: support for initiating pairing. new 1d915f7 ble host: reduce code size. new bedc7ad ble host - fix bug: ensure proc inserted. new e18351c ble host: Minor change in BLE_HS_DBG_ASSERT macros new b2bdbe6 ble host: use one 1hz timer for lazy procedures. new 8541dda ble host: sm procedures time out after 30 seconds. new 09d1000 ble host: cancel sm proc when connection broken. new 21709f1 ble host - fix build when security is disabled. new 38eca8a MYNEWT-265 BLE - advertise iBeacon new 600bf87 MYNEWT-265 BLE - advertise iBeacon new 3dbd9ba MYNEWT-265 BLE - advertise iBeacon new 209e221 MYNEWT-265 BLE - advertise iBeacon new 6f2b218 Fix incorrect scan response advertising event type new f4ab7a6 Fix error in le64toh new 52b318a ble-host: Prevent warning in debug builds. new c9627b9 ble host - fix LTK generation bugs new f9363b3 ble host: fix bug in att statistics new f70bf76 ble host - fix bug for incoming ATT read-type-req. new 4125d6e ble host - Use blocking HCI tx in GAP procedures. new b6e067b Advertising receive isr start only requires pdu type new c0874f3 Remove space at end of line new 8617ac9 Finish half-completed transition to packed structs new f5871ba Add PHY statistics new 33d8c89 Move connection request txd flag to connection state machine new 356106d Add remaining command LE HCI command lengths new 3f62d5a Minor encryption/decrpytion host changes new 0413c49 MYNEWT-99: Implement LL encryption procedure. new 9c055c7 ble host - revert accidental test commit. new ca34e8c Modify write suggested default data length command in controller new 409bcca MYNEWT-99: Port encryption to nrf51 new 67225d5 ble host - major changes. new b0a19f7 Update example apps to account for blehost changes new b010875 ble host - fix security bug new cde9b15 ble host - separate blocking HCI from rx new 57b7764 ble host - fix SM bug; r1/r2 misordered on master. new 2894e98 ble host - clarify locking restrictions. new 20ed623 ble ll - don't undef feature macros. new fbd1867 ble host - rename "app task" to "parent task" new 4d16fc2 ble host - make priv header filenames consistent. new 7b24450 MYNEWT-284: fix nrf51 radio state errors new 7285268 Modify bletest for new host new ebda3af Fix bug in data length extension procedure new cc409d9 MYNEWT-99: implement encryption pause procedure new 021b470 Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-mynewt-core into develop new 99928ce MYNEWT-85: Fix BLE timing for
[GitHub] jacobrosenthal opened a new pull request #839: LOG_NEWTMGR sysflag path missing cborattr dependency
jacobrosenthal opened a new pull request #839: LOG_NEWTMGR sysflag path missing cborattr dependency URL: https://github.com/apache/mynewt-core/pull/839 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jacobrosenthal opened a new pull request #838: bsp: puckjs
jacobrosenthal opened a new pull request #838: bsp: puckjs URL: https://github.com/apache/mynewt-core/pull/838 We dont have an nrf52 with XTAL_32768_SYNTH so figured Id do it up right and PR it. Fun clean little button/led/ir/nrc design. Check out https://www.puck-js.com and https://www.adafruit.com/product/3372 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-core] branch master updated: Revert accidental sensor_test app changes
This is an automated email from the ASF dual-hosted git repository. vipulrahane pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git The following commit(s) were added to refs/heads/master by this push: new 15786c7 Revert accidental sensor_test app changes 15786c7 is described below commit 15786c71772a86541a3e6d119e3b3a5a6f7eb246 Author: Vipul RahaneAuthorDate: Thu Feb 22 13:44:15 2018 -0800 Revert accidental sensor_test app changes - Reverting accidental sensor_test app changes made by #718 --- apps/sensors_test/src/main.c | 38 -- 1 file changed, 38 deletions(-) diff --git a/apps/sensors_test/src/main.c b/apps/sensors_test/src/main.c index 6b3af90..fe4a862 100755 --- a/apps/sensors_test/src/main.c +++ b/apps/sensors_test/src/main.c @@ -36,8 +36,6 @@ #include #include #include -#include -#include #if MYNEWT_VAL(BNO055_CLI) #include @@ -82,10 +80,6 @@ static const oc_handler_t sensor_oic_handler = { /* Application-specified header. */ #include "bleprph.h" -struct sensor_type_traits stt; -struct sensor_accel_data sad_low; -struct sensor_accel_data sad_high; - #if MYNEWT_VAL(SENSOR_OIC) static int sensor_oic_gap_event(struct ble_gap_event *event, void *arg); #endif @@ -278,9 +272,6 @@ sensor_oic_gap_event(struct ble_gap_event *event, void *arg) oc_ble_coap_conn_del(event->disconnect.conn.conn_handle); -sensor_clear_low_thresh("lis2dh12_0", SENSOR_TYPE_ACCELEROMETER); -sensor_clear_high_thresh("lis2dh12_0", SENSOR_TYPE_ACCELEROMETER); - /* Connection terminated; resume advertising. */ sensor_oic_advertise(); return 0; @@ -534,35 +525,6 @@ main(int argc, char **argv) /* log reboot */ reboot_start(hal_reset_cause()); -stt = (struct sensor_type_traits) { -.stt_sensor_type = SENSOR_TYPE_ACCELEROMETER, -.stt_low_thresh.sad = _low, -.stt_high_thresh.sad = _high, -.stt_algo= SENSOR_THRESH_ALGO_WATERMARK -}; - -/* The thresholds are specified in m/s^2 */ - -sad_low = (struct sensor_accel_data) { -.sad_x = 0.6712, -.sad_x_is_valid = 1, -.sad_y = 0.6712, -.sad_y_is_valid = 1, -.sad_z = 0.6712, -.sad_z_is_valid = 1 -}; - -sad_high = (struct sensor_accel_data) { -.sad_x = 0.6712, -.sad_x_is_valid = 1, -.sad_y = 0.6712, -.sad_y_is_valid = 1, -.sad_z = 0.6712, -.sad_z_is_valid = 1 -}; - -sensor_set_thresh("lis2dh12_0", ); - /* * As the last thing, process events from default event queue. */ -- To stop receiving notification emails like this one, please contact vipulrah...@apache.org.
[mynewt-core] 01/01: Merge pull request #718 from vrahane/lis2dh12_thresholds_fix
This is an automated email from the ASF dual-hosted git repository. vipulrahane pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 4e7537bbecf15d0b47adaf52807218ceb12dbedb Merge: a46f286 5cd2eb6 Author: Vipul RahaneAuthorDate: Thu Feb 22 13:06:44 2018 -0800 Merge pull request #718 from vrahane/lis2dh12_thresholds_fix MYNEWT-881: SensorAPI: Add sensor_clear_high/low_thresh() API and LIS2DH12 set threshold cb fix apps/sensors_test/src/main.c | 38 +++ .../sensors/lis2dh12/include/lis2dh12/lis2dh12.h | 18 ++ hw/drivers/sensors/lis2dh12/src/lis2dh12.c | 273 - hw/sensor/include/sensor/sensor.h | 46 +++- hw/sensor/src/sensor.c | 108 +++- 5 files changed, 413 insertions(+), 70 deletions(-) -- To stop receiving notification emails like this one, please contact vipulrah...@apache.org.
[mynewt-core] branch master updated (a46f286 -> 4e7537b)
This is an automated email from the ASF dual-hosted git repository. vipulrahane pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. from a46f286 Merge pull request #831 from andrzej-kaczmarek/app-gatt-discovery-fix add 615e3ce MYNEWT-881 SensorAPI: LIS2DH12 set thresh cb fix add 5cd2eb6 MYNEWT-881 SensorAPI:Add sensor_clear_xx_thresh() new 4e7537b Merge pull request #718 from vrahane/lis2dh12_thresholds_fix The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: apps/sensors_test/src/main.c | 38 +++ .../sensors/lis2dh12/include/lis2dh12/lis2dh12.h | 18 ++ hw/drivers/sensors/lis2dh12/src/lis2dh12.c | 273 - hw/sensor/include/sensor/sensor.h | 46 +++- hw/sensor/src/sensor.c | 108 +++- 5 files changed, 413 insertions(+), 70 deletions(-) -- To stop receiving notification emails like this one, please contact vipulrah...@apache.org.
[GitHub] vrahane closed pull request #718: MYNEWT-881: SensorAPI: Add sensor_clear_high/low_thresh() API and LIS2DH12 set threshold cb fix
vrahane closed pull request #718: MYNEWT-881: SensorAPI: Add sensor_clear_high/low_thresh() API and LIS2DH12 set threshold cb fix URL: https://github.com/apache/mynewt-core/pull/718 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/apps/sensors_test/src/main.c b/apps/sensors_test/src/main.c index fe4a862d8..6b3af902f 100755 --- a/apps/sensors_test/src/main.c +++ b/apps/sensors_test/src/main.c @@ -36,6 +36,8 @@ #include #include #include +#include +#include #if MYNEWT_VAL(BNO055_CLI) #include @@ -80,6 +82,10 @@ static const oc_handler_t sensor_oic_handler = { /* Application-specified header. */ #include "bleprph.h" +struct sensor_type_traits stt; +struct sensor_accel_data sad_low; +struct sensor_accel_data sad_high; + #if MYNEWT_VAL(SENSOR_OIC) static int sensor_oic_gap_event(struct ble_gap_event *event, void *arg); #endif @@ -272,6 +278,9 @@ sensor_oic_gap_event(struct ble_gap_event *event, void *arg) oc_ble_coap_conn_del(event->disconnect.conn.conn_handle); +sensor_clear_low_thresh("lis2dh12_0", SENSOR_TYPE_ACCELEROMETER); +sensor_clear_high_thresh("lis2dh12_0", SENSOR_TYPE_ACCELEROMETER); + /* Connection terminated; resume advertising. */ sensor_oic_advertise(); return 0; @@ -525,6 +534,35 @@ main(int argc, char **argv) /* log reboot */ reboot_start(hal_reset_cause()); +stt = (struct sensor_type_traits) { +.stt_sensor_type = SENSOR_TYPE_ACCELEROMETER, +.stt_low_thresh.sad = _low, +.stt_high_thresh.sad = _high, +.stt_algo= SENSOR_THRESH_ALGO_WATERMARK +}; + +/* The thresholds are specified in m/s^2 */ + +sad_low = (struct sensor_accel_data) { +.sad_x = 0.6712, +.sad_x_is_valid = 1, +.sad_y = 0.6712, +.sad_y_is_valid = 1, +.sad_z = 0.6712, +.sad_z_is_valid = 1 +}; + +sad_high = (struct sensor_accel_data) { +.sad_x = 0.6712, +.sad_x_is_valid = 1, +.sad_y = 0.6712, +.sad_y_is_valid = 1, +.sad_z = 0.6712, +.sad_z_is_valid = 1 +}; + +sensor_set_thresh("lis2dh12_0", ); + /* * As the last thing, process events from default event queue. */ diff --git a/hw/drivers/sensors/lis2dh12/include/lis2dh12/lis2dh12.h b/hw/drivers/sensors/lis2dh12/include/lis2dh12/lis2dh12.h index c853484b7..08a1c7f02 100644 --- a/hw/drivers/sensors/lis2dh12/include/lis2dh12/lis2dh12.h +++ b/hw/drivers/sensors/lis2dh12/include/lis2dh12/lis2dh12.h @@ -294,6 +294,24 @@ lis2dh12_set_int1_duration(struct sensor_itf *itf, uint8_t dur); int lis2dh12_set_int2_duration(struct sensor_itf *itf, uint8_t dur); +/** + * Disable interrupt 1 + * + * @param the sensor interface + * @return 0 on success, non-zero on failure + */ +int +lis2dh12_disable_int1(struct sensor_itf *itf); + +/** + * Disable interrupt 2 + * + * @param the sensor interface + * @return 0 on success, non-zero on failure + */ +int +lis2dh12_disable_int2(struct sensor_itf *itf); + /** * Set high pass filter cfg * diff --git a/hw/drivers/sensors/lis2dh12/src/lis2dh12.c b/hw/drivers/sensors/lis2dh12/src/lis2dh12.c index e0849c838..bb2640c61 100644 --- a/hw/drivers/sensors/lis2dh12/src/lis2dh12.c +++ b/hw/drivers/sensors/lis2dh12/src/lis2dh12.c @@ -70,11 +70,19 @@ static int lis2dh12_sensor_get_config(struct sensor *, sensor_type_t, static int lis2dh12_sensor_set_trigger_thresh(struct sensor *, sensor_type_t, struct sensor_type_traits *); +static int +lis2dh12_sensor_clear_low_thresh(struct sensor *, sensor_type_t); + +static int +lis2dh12_sensor_clear_high_thresh(struct sensor *, sensor_type_t); + static const struct sensor_driver g_lis2dh12_sensor_driver = { .sd_read = lis2dh12_sensor_read, .sd_get_config = lis2dh12_sensor_get_config, /* Setting trigger threshold is optional */ -.sd_set_trigger_thresh = lis2dh12_sensor_set_trigger_thresh +.sd_set_trigger_thresh = lis2dh12_sensor_set_trigger_thresh, +.sd_clear_low_trigger_thresh = lis2dh12_sensor_clear_low_thresh, +.sd_clear_high_trigger_thresh = lis2dh12_sensor_clear_high_thresh }; /** @@ -1242,6 +1250,60 @@ lis2dh12_set_int2_pin_cfg(struct sensor_itf *itf, uint8_t cfg) return lis2dh12_writelen(itf, LIS2DH12_REG_CTRL_REG6, , 1); } +/** + * Disable interrupt 1 + * + * @param the sensor interface + * @return 0 on success, non-zero on failure + */ +int +lis2dh12_disable_int1(struct sensor_itf *itf) +{ +uint8_t reg; +int rc; + +reg = 0; + +rc = lis2dh12_clear_int1(itf); +if (rc) { +goto err; +} + +os_time_delay((OS_TICKS_PER_SEC * 20)/1000 + 1); + +rc = lis2dh12_writelen(itf,
[GitHub] mlaz commented on a change in pull request #822: Adding int/float easing library
mlaz commented on a change in pull request #822: Adding int/float easing library URL: https://github.com/apache/mynewt-core/pull/822#discussion_r170067285 ## File path: util/easing/pkg.yml ## @@ -0,0 +1,28 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +pkg.name: util/easing +pkg.description: Library containing easing functions +pkg.author: "Apache Mynewt" +pkg.homepage: "http://mynewt.apache.org/; +pkg.keywords: +- easing + +pkg.cflags: +- "-lm" Review comment: @ccollins476ad Thanks, my web browser didn't refresh this comments section so on my previous comment I wasn't aware of yours. :) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mlaz commented on a change in pull request #822: Adding int/float easing library
mlaz commented on a change in pull request #822: Adding int/float easing library URL: https://github.com/apache/mynewt-core/pull/822#discussion_r170066465 ## File path: util/easing/pkg.yml ## @@ -0,0 +1,28 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +pkg.name: util/easing +pkg.description: Library containing easing functions +pkg.author: "Apache Mynewt" +pkg.homepage: "http://mynewt.apache.org/; +pkg.keywords: +- easing + +pkg.cflags: +- "-lm" Review comment: BTW, this came out to be commited as cflags mistakenly. Already tried with lflags having the same problem. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] ccollins476ad commented on a change in pull request #822: Adding int/float easing library
ccollins476ad commented on a change in pull request #822: Adding int/float easing library URL: https://github.com/apache/mynewt-core/pull/822#discussion_r170065278 ## File path: util/easing/pkg.yml ## @@ -0,0 +1,28 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +pkg.name: util/easing +pkg.description: Library containing easing functions +pkg.author: "Apache Mynewt" +pkg.homepage: "http://mynewt.apache.org/; +pkg.keywords: +- easing + +pkg.cflags: +- "-lm" Review comment: You should add `-lm` to `pkg.lflags` (not `pkg.cflags`). However, this will only work with a fairly recent version of newt (you need this PR, merged Feb. 13: https://github.com/apache/mynewt-newt/pull/133). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] ccollins476ad commented on a change in pull request #822: Adding int/float easing library
ccollins476ad commented on a change in pull request #822: Adding int/float easing library URL: https://github.com/apache/mynewt-core/pull/822#discussion_r170065278 ## File path: util/easing/pkg.yml ## @@ -0,0 +1,28 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +pkg.name: util/easing +pkg.description: Library containing easing functions +pkg.author: "Apache Mynewt" +pkg.homepage: "http://mynewt.apache.org/; +pkg.keywords: +- easing + +pkg.cflags: +- "-lm" Review comment: You should add `-lm` to `pkg.lflags` (not `pkg.cflags`). However, this will only work with a fairly recent version of newt (you need this PR, merged Feb. 13: https://github.com/apache/mynewt-newt/pull/133#event-1472935366). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] ccollins476ad commented on a change in pull request #836: [WIP] PWM add cycle interrupt handling to pwm_nrf52 driver
ccollins476ad commented on a change in pull request #836: [WIP] PWM add cycle interrupt handling to pwm_nrf52 driver URL: https://github.com/apache/mynewt-core/pull/836#discussion_r170064494 ## File path: hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c ## @@ -177,9 +249,10 @@ nrf52_pwm_close(struct os_dev *odev) dev = (struct pwm_dev *) odev; inst_id = dev->pwm_instance_id; +assert(instances[inst_id].in_use); Review comment: I think an assert is appropriate for certain failure conditions: * software bugs (i.e., logical contradiction) * unlikely hardware failure In the case of a software bug, my view is that it is best to terminate as soon as possible. This makes it easier to identify and fix the bug, and generally there is no reasonable recovery mechanism. For "safety critical" systems, presumably there are hardware recovery mechanisms or redundancies that protect against a software crash. I am not familiar with this PWM driver, but it looks like this `assert` will only fail if there is a firmware bug. There are similar asserts that check this same condition elsewhere in this file. Anyway, I'm sure opinions vary, so that is just my take. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mlaz commented on a change in pull request #822: Adding int/float easing library
mlaz commented on a change in pull request #822: Adding int/float easing library URL: https://github.com/apache/mynewt-core/pull/822#discussion_r170061640 ## File path: util/easing/pkg.yml ## @@ -0,0 +1,28 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +pkg.name: util/easing +pkg.description: Library containing easing functions +pkg.author: "Apache Mynewt" +pkg.homepage: "http://mynewt.apache.org/; +pkg.keywords: +- easing + +pkg.cflags: +- "-lm" Review comment: @utzig it is set here. @jacobrosenthal I just noticed I am using `lflags="-lm"` on my target, when I take it out it produces the same problem. Is this a newt bug? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mlaz commented on a change in pull request #822: Adding int/float easing library
mlaz commented on a change in pull request #822: Adding int/float easing library URL: https://github.com/apache/mynewt-core/pull/822#discussion_r170061640 ## File path: util/easing/pkg.yml ## @@ -0,0 +1,28 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +pkg.name: util/easing +pkg.description: Library containing easing functions +pkg.author: "Apache Mynewt" +pkg.homepage: "http://mynewt.apache.org/; +pkg.keywords: +- easing + +pkg.cflags: +- "-lm" Review comment: @utzig it is set here. @jacobrosenthal I just noticed I am using lflags="-lm" on my target, when I take it out it produces the same problem. Is this a newt bug? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] utzig commented on issue #822: Adding int/float easing library
utzig commented on issue #822: Adding int/float easing library URL: https://github.com/apache/mynewt-core/pull/822#issuecomment-367782401 It probably needs a `-lm` somewhere. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mlaz commented on a change in pull request #836: [WIP] PWM add cycle interrupt handling to pwm_nrf52 driver
mlaz commented on a change in pull request #836: [WIP] PWM add cycle interrupt handling to pwm_nrf52 driver URL: https://github.com/apache/mynewt-core/pull/836#discussion_r170050146 ## File path: hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c ## @@ -177,9 +249,10 @@ nrf52_pwm_close(struct os_dev *odev) dev = (struct pwm_dev *) odev; inst_id = dev->pwm_instance_id; +assert(instances[inst_id].in_use); nrfx_pwm_uninit([inst_id].drv_instance); -instances[inst_id].playing = false; +cleanup_instance(inst_id); Review comment: The problem which the commit you mentioned fixes is the misuse of in_use flag. When you reported the problem, what was "breaking" execution was in fact an assert on pwm_open. Only yesterday I noticed that fix is not coherent with how the flag should be used. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jacobrosenthal commented on issue #822: Adding int/float easing library
jacobrosenthal commented on issue #822: Adding int/float easing library URL: https://github.com/apache/mynewt-core/pull/822#issuecomment-367766045 Altering pwm_test with ``` #include #define MAX_VALUE 65535 #define MAX_STEPS 255 static volatile int32_t step = 0; int32_t eased = cubic_int_out(step++, MAX_STEPS, MAX_VALUE); pwm_enable_duty_cycle(pwm, 0, eased); if(step>MAX_STEPS){ step=0; } ``` Linker can't find math library. ``` Jacobs-MacBook-Air:charm jacobrosenthal$ newt run central-nrf52840pdk 0 Compiling repos/apache-mynewt-core/apps/pwm_test/src/main.c Compiling repos/apache-mynewt-core/util/easing/src/easing.c Archiving apps_pwm_test.a Archiving util_easing.a Linking /Users/jacobrosenthal/Downloads/charm/bin/targets/central-nrf52840pdk/app/apps/pwm_test/pwm_test.elf Error: /Users/jacobrosenthal/Downloads/charm/bin/targets/central-nrf52840pdk/app/util/easing/util_easing.a(easing.o): In function `cubic_out': /Users/jacobrosenthal/Downloads/charm/repos/apache-mynewt-core/util/easing/src/easing.c:105: undefined reference to `pow' collect2: error: ld returned 1 exit status ``` Some other newt flag you're using? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jacobrosenthal commented on a change in pull request #836: PWM add cycle interrupt handling to pwm_nrf52 driver
jacobrosenthal commented on a change in pull request #836: PWM add cycle interrupt handling to pwm_nrf52 driver URL: https://github.com/apache/mynewt-core/pull/836#discussion_r170034144 ## File path: hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c ## @@ -177,9 +249,10 @@ nrf52_pwm_close(struct os_dev *odev) dev = (struct pwm_dev *) odev; inst_id = dev->pwm_instance_id; +assert(instances[inst_id].in_use); nrfx_pwm_uninit([inst_id].drv_instance); -instances[inst_id].playing = false; +cleanup_instance(inst_id); Review comment: I take it the assert is whats currently protecting us from a regressions from this recent commit? https://github.com/apache/mynewt-core/pull/821/files This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jacobrosenthal commented on a change in pull request #836: PWM add cycle interrupt handling to pwm_nrf52 driver
jacobrosenthal commented on a change in pull request #836: PWM add cycle interrupt handling to pwm_nrf52 driver URL: https://github.com/apache/mynewt-core/pull/836#discussion_r170033374 ## File path: hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c ## @@ -177,9 +249,10 @@ nrf52_pwm_close(struct os_dev *odev) dev = (struct pwm_dev *) odev; inst_id = dev->pwm_instance_id; +assert(instances[inst_id].in_use); Review comment: I think probably all these asserts needs to be just return codes. My understanding is that asserts are for system startup where theres no one to return to or no reason to keep going on failure, not runtime errors especially when the function already allows a return code This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] andrzej-kaczmarek opened a new pull request #837: nimble/ll: Fix sending HCI Number of Completed Packets event
andrzej-kaczmarek opened a new pull request #837: nimble/ll: Fix sending HCI Number of Completed Packets event URL: https://github.com/apache/mynewt-core/pull/837 The calculations for sending this HCI event periodically seem strange, probably something was mixed up in the past here. After fix I believe this does what it is supposed to do: every X ticks we'll just go through all connections and send HCI event no matter if there is something to send or not. Also added some with reference to spec section. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-core] branch master updated (dc44b2f -> a46f286)
This is an automated email from the ASF dual-hosted git repository. andk pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. from dc44b2f Merge pull request #776 from andrzej-kaczmarek/random-adv-data add 8652a42 apps/ble: Fix GATT discovery in some apps new a46f286 Merge pull request #831 from andrzej-kaczmarek/app-gatt-discovery-fix The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: apps/blecent/src/peer.c| 2 +- apps/bletiny/src/bletiny.h | 1 - apps/bletiny/src/main.c| 7 +-- apps/bletiny/src/misc.c| 2 +- apps/bsncent/src/peer.c| 2 +- apps/btshell/src/btshell.h | 2 -- apps/btshell/src/main.c| 7 +-- apps/btshell/src/misc.c| 2 +- 8 files changed, 6 insertions(+), 19 deletions(-) -- To stop receiving notification emails like this one, please contact a...@apache.org.
[mynewt-core] 01/01: Merge pull request #831 from andrzej-kaczmarek/app-gatt-discovery-fix
This is an automated email from the ASF dual-hosted git repository. andk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit a46f2867865a792728a5754f38c2b2a0dfc46a6c Merge: dc44b2f 8652a42 Author: Andrzej KaczmarekAuthorDate: Thu Feb 22 10:48:55 2018 +0100 Merge pull request #831 from andrzej-kaczmarek/app-gatt-discovery-fix apps/ble: Fix GATT discovery in some apps apps/blecent/src/peer.c| 2 +- apps/bletiny/src/bletiny.h | 1 - apps/bletiny/src/main.c| 7 +-- apps/bletiny/src/misc.c| 2 +- apps/bsncent/src/peer.c| 2 +- apps/btshell/src/btshell.h | 2 -- apps/btshell/src/main.c| 7 +-- apps/btshell/src/misc.c| 2 +- 8 files changed, 6 insertions(+), 19 deletions(-) -- To stop receiving notification emails like this one, please contact a...@apache.org.
[GitHub] andrzej-kaczmarek closed pull request #831: apps/ble: Fix GATT discovery in some apps
andrzej-kaczmarek closed pull request #831: apps/ble: Fix GATT discovery in some apps URL: https://github.com/apache/mynewt-core/pull/831 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/apps/blecent/src/peer.c b/apps/blecent/src/peer.c index 05ec8a005..f18dcbcc0 100644 --- a/apps/blecent/src/peer.c +++ b/apps/blecent/src/peer.c @@ -435,7 +435,7 @@ peer_disc_chrs(struct peer *peer) int peer_svc_is_empty(const struct peer_svc *svc) { -return svc->svc.end_handle < svc->svc.start_handle; +return svc->svc.end_handle <= svc->svc.start_handle; } static struct peer_svc * diff --git a/apps/bletiny/src/bletiny.h b/apps/bletiny/src/bletiny.h index 94000a7d2..e59779102 100644 --- a/apps/bletiny/src/bletiny.h +++ b/apps/bletiny/src/bletiny.h @@ -74,7 +74,6 @@ SLIST_HEAD(bletiny_chr_list, bletiny_chr); struct bletiny_svc { SLIST_ENTRY(bletiny_svc) next; struct ble_gatt_svc svc; -bool char_disc_sent; struct bletiny_chr_list chrs; }; diff --git a/apps/bletiny/src/main.c b/apps/bletiny/src/main.c index f1f4717f1..25a346696 100755 --- a/apps/bletiny/src/main.c +++ b/apps/bletiny/src/main.c @@ -722,12 +722,7 @@ bletiny_disc_full_chrs(uint16_t conn_handle) } SLIST_FOREACH(svc, >svcs, next) { -if (!svc_is_empty(svc) && !svc->char_disc_sent) { -/* Since it might happen that service does not have characteristics - * for some reason, lets keep track on services for which we send - * characteristic discovery - */ -svc->char_disc_sent = true; +if (!svc_is_empty(svc) && SLIST_EMPTY(>chrs)) { rc = bletiny_disc_all_chrs(conn_handle, svc->svc.start_handle, svc->svc.end_handle); if (rc != 0) { diff --git a/apps/bletiny/src/misc.c b/apps/bletiny/src/misc.c index 9914bfef7..11d72e825 100644 --- a/apps/bletiny/src/misc.c +++ b/apps/bletiny/src/misc.c @@ -76,7 +76,7 @@ print_uuid(const ble_uuid_t *uuid) int svc_is_empty(const struct bletiny_svc *svc) { -return svc->svc.end_handle < svc->svc.start_handle; +return svc->svc.end_handle <= svc->svc.start_handle; } uint16_t diff --git a/apps/bsncent/src/peer.c b/apps/bsncent/src/peer.c index 0e4f7f440..0993e050c 100644 --- a/apps/bsncent/src/peer.c +++ b/apps/bsncent/src/peer.c @@ -435,7 +435,7 @@ peer_disc_chrs(struct peer *peer) int peer_svc_is_empty(const struct peer_svc *svc) { -return svc->svc.end_handle < svc->svc.start_handle; +return svc->svc.end_handle <= svc->svc.start_handle; } static struct peer_svc * diff --git a/apps/btshell/src/btshell.h b/apps/btshell/src/btshell.h index ddbd5da53..fb8ca72cb 100644 --- a/apps/btshell/src/btshell.h +++ b/apps/btshell/src/btshell.h @@ -63,8 +63,6 @@ SLIST_HEAD(btshell_chr_list, btshell_chr); struct btshell_svc { SLIST_ENTRY(btshell_svc) next; struct ble_gatt_svc svc; - -bool char_disc_sent; struct btshell_chr_list chrs; }; diff --git a/apps/btshell/src/main.c b/apps/btshell/src/main.c index 17a66f607..06121620f 100755 --- a/apps/btshell/src/main.c +++ b/apps/btshell/src/main.c @@ -733,12 +733,7 @@ btshell_disc_full_chrs(uint16_t conn_handle) } SLIST_FOREACH(svc, >svcs, next) { -if (!svc_is_empty(svc) && !svc->char_disc_sent) { -/* Since it might happen that service does not have characteristics - * for some reason, lets keep track on services for which we send - * characteristic discovery - */ -svc->char_disc_sent = true; +if (!svc_is_empty(svc) && SLIST_EMPTY(>chrs)) { rc = btshell_disc_all_chrs(conn_handle, svc->svc.start_handle, svc->svc.end_handle); if (rc != 0) { diff --git a/apps/btshell/src/misc.c b/apps/btshell/src/misc.c index 913fb403e..9a8e43352 100644 --- a/apps/btshell/src/misc.c +++ b/apps/btshell/src/misc.c @@ -76,7 +76,7 @@ print_uuid(const ble_uuid_t *uuid) int svc_is_empty(const struct btshell_svc *svc) { -return svc->svc.end_handle < svc->svc.start_handle; +return svc->svc.end_handle <= svc->svc.start_handle; } uint16_t This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-core] 01/01: Merge pull request #776 from andrzej-kaczmarek/random-adv-data
This is an automated email from the ASF dual-hosted git repository. andk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit dc44b2fe2fe0fb2caf8d9332c80a69379cd50e0c Merge: fa50ac0 2000b5c Author: Andrzej KaczmarekAuthorDate: Thu Feb 22 10:40:47 2018 +0100 Merge pull request #776 from andrzej-kaczmarek/random-adv-data apps/btshell: Allow to append some extra data to adv/scanrsp data apps/btshell/src/cmd.c | 35 +++ 1 file changed, 35 insertions(+) -- To stop receiving notification emails like this one, please contact a...@apache.org.
[mynewt-core] branch master updated (fa50ac0 -> dc44b2f)
This is an automated email from the ASF dual-hosted git repository. andk pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. from fa50ac0 Merge pull request #833 from mlaz/fix_nrfx_glue add 2000b5c apps/btshell: Allow to append some extra data to adv/scanrsp data new dc44b2f Merge pull request #776 from andrzej-kaczmarek/random-adv-data The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: apps/btshell/src/cmd.c | 35 +++ 1 file changed, 35 insertions(+) -- To stop receiving notification emails like this one, please contact a...@apache.org.
[GitHub] andrzej-kaczmarek closed pull request #776: apps/btshell: Allow to append some extra data to adv/scanrsp data
andrzej-kaczmarek closed pull request #776: apps/btshell: Allow to append some extra data to adv/scanrsp data URL: https://github.com/apache/mynewt-core/pull/776 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/apps/btshell/src/cmd.c b/apps/btshell/src/cmd.c index f6a32dc24..86112e286 100644 --- a/apps/btshell/src/cmd.c +++ b/apps/btshell/src/cmd.c @@ -1417,6 +1417,20 @@ static const struct shell_cmd_help set_help = { #define CMD_ADV_DATA_URI_MAX_LENBLE_HS_ADV_MAX_FIELD_SZ #define CMD_ADV_DATA_MFG_DATA_MAX_LEN BLE_HS_ADV_MAX_FIELD_SZ +#if MYNEWT_VAL(BLE_EXT_ADV) +static void +update_pattern(uint8_t *buf, int counter) +{ +int i; + +for (i = 0; i < 10; i += 2) { +counter += 2; +buf[i] = (counter / 1000) << 4 | (counter / 100 % 10); +buf[i + 1] = (counter / 10 % 10) << 4 | (counter % 10); +} +} +#endif + static int cmd_set_adv_data_or_scan_rsp(int argc, char **argv, bool scan_rsp) { @@ -1454,6 +1468,9 @@ cmd_set_adv_data_or_scan_rsp(int argc, char **argv, bool scan_rsp) int rc; #if MYNEWT_VAL(BLE_EXT_ADV) uint8_t instance; +uint8_t extra_data[10]; +uint16_t counter; +uint16_t extra_data_len; struct os_mbuf *adv_data; #endif @@ -1708,6 +1725,21 @@ cmd_set_adv_data_or_scan_rsp(int argc, char **argv, bool scan_rsp) goto done; } +/* Append some extra data, if requested */ +extra_data_len = parse_arg_uint16("extra_data_len", ); +if (rc == 0) { +counter = 0; +extra_data_len = min(extra_data_len, 1650); +while (counter < extra_data_len) { +update_pattern(extra_data, counter); + +os_mbuf_append(adv_data, extra_data, + min(extra_data_len - counter, 10)); + +counter += 10; +} +} + if (scan_rsp) { rc = ble_gap_ext_adv_rsp_set_data(instance, adv_data); } else { @@ -1763,6 +1795,9 @@ static const struct shell_param set_adv_data_params[] = { {"uri", "usage: =[XX:XX...]"}, {"mfg_data", "usage: =[XX:XX...]"}, {"eddystone_url", "usage: =[string]"}, +#if MYNEWT_VAL(BLE_EXT_ADV) +{"extra_data_len", "usage: =[UINT16]"}, +#endif {NULL, NULL} }; This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services