[GitHub] ccollins476ad closed pull request #629: BLE Host - Delay sync callback after IRK restore

2017-11-03 Thread GitBox
ccollins476ad closed pull request #629: BLE Host - Delay sync callback after 
IRK restore
URL: https://github.com/apache/mynewt-core/pull/629
 
 
   

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/main.c b/apps/blecent/src/main.c
index 293d6378d..18849bee8 100755
--- a/apps/blecent/src/main.c
+++ b/apps/blecent/src/main.c
@@ -405,6 +405,11 @@ blecent_gap_event(struct ble_gap_event *event, void *arg)
 blecent_scan();
 return 0;
 
+case BLE_GAP_EVENT_DISC_COMPLETE:
+BLECENT_LOG(INFO, "discovery complete; reason=%d\n",
+event->disc_complete.reason);
+return 0;
+
 case BLE_GAP_EVENT_ENC_CHANGE:
 /* Encryption has been enabled or disabled for this connection. */
 BLECENT_LOG(INFO, "encryption change event; status=%d ",
diff --git a/apps/bleprph/src/main.c b/apps/bleprph/src/main.c
index 7e344acfc..343ca6ad9 100755
--- a/apps/bleprph/src/main.c
+++ b/apps/bleprph/src/main.c
@@ -204,6 +204,12 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
 BLEPRPH_LOG(INFO, "\n");
 return 0;
 
+case BLE_GAP_EVENT_ADV_COMPLETE:
+BLEPRPH_LOG(INFO, "advertise complete; reason=%d",
+event->adv_complete.reason);
+bleprph_advertise();
+return 0;
+
 case BLE_GAP_EVENT_ENC_CHANGE:
 /* Encryption has been enabled or disabled for this connection. */
 BLEPRPH_LOG(INFO, "encryption change event; status=%d ",
diff --git a/apps/bleprph_oic/src/main.c b/apps/bleprph_oic/src/main.c
index 2efb9067c..108a46049 100755
--- a/apps/bleprph_oic/src/main.c
+++ b/apps/bleprph_oic/src/main.c
@@ -214,6 +214,12 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
 BLEPRPH_LOG(INFO, "\n");
 return 0;
 
+case BLE_GAP_EVENT_ADV_COMPLETE:
+BLEPRPH_LOG(INFO, "advertise complete; reason=%d\n",
+event->adv_complete.reason);
+bleprph_advertise();
+return 0;
+
 case BLE_GAP_EVENT_ENC_CHANGE:
 /* Encryption has been enabled or disabled for this connection. */
 BLEPRPH_LOG(INFO, "encryption change event; status=%d ",
diff --git a/apps/blesplit/src/main.c b/apps/blesplit/src/main.c
index 56773cc43..b757c55fc 100755
--- a/apps/blesplit/src/main.c
+++ b/apps/blesplit/src/main.c
@@ -196,6 +196,13 @@ blesplit_gap_event(struct ble_gap_event *event, void *arg)
 BLESPLIT_LOG(INFO, "\n");
 return 0;
 
+
+case BLE_GAP_EVENT_ADV_COMPLETE:
+BLESPLIT_LOG(INFO, "advertise complete; reason=%d\n",
+ event->adv_complete.reason);
+blesplit_advertise();
+return 0;
+
 case BLE_GAP_EVENT_ENC_CHANGE:
 /* Encryption has been enabled or disabled for this connection. */
 BLESPLIT_LOG(INFO, "encryption change event; status=%d ",
diff --git a/apps/bletiny/src/main.c b/apps/bletiny/src/main.c
index 1e0c67122..8445ff4ff 100755
--- a/apps/bletiny/src/main.c
+++ b/apps/bletiny/src/main.c
@@ -1023,14 +1023,6 @@ bletiny_gap_event(struct ble_gap_event *event, void *arg)
 
 return 0;
 
-case BLE_GAP_EVENT_DISC_COMPLETE:
-console_printf("scanning finished\n");
-return 0;
-
-case BLE_GAP_EVENT_ADV_COMPLETE:
-console_printf("advertising complete.\n");
-return 0;
-
 case BLE_GAP_EVENT_CONN_UPDATE:
 console_printf("connection updated; status=%d ",
event->conn_update.status);
@@ -1044,7 +1036,7 @@ bletiny_gap_event(struct ble_gap_event *event, void *arg)
 *event->conn_update_req.self_params =
 *event->conn_update_req.peer_params;
 return 0;
-
+ 
 case BLE_GAP_EVENT_PASSKEY_ACTION:
 console_printf("passkey action event; action=%d",
event->passkey.params.action);
@@ -1055,6 +1047,16 @@ bletiny_gap_event(struct ble_gap_event *event, void *arg)
 console_printf("\n");
 return 0;
 
+case BLE_GAP_EVENT_DISC_COMPLETE:
+console_printf("discovery complete; reason=%d\n",
+   event->disc_complete.reason);
+return 0;
+
+case BLE_GAP_EVENT_ADV_COMPLETE:
+console_printf("advertise complete; reason=%d\n",
+   event->adv_complete.reason);
+return 0;
+
 case BLE_GAP_EVENT_ENC_CHANGE:
 console_printf("encryption change event; status=%d ",
event->enc_change.status);
diff --git a/apps/bleuart/src/main.c b/apps/bleuart/src/main.c
index d269c37c1..4f15ff4b0 100755
--- a/apps/bleuart/src/main.c
+++ b/apps/bleuart/src/main.c
@@ -160,6 +160,12 @@ bleuart_gap_event(struct ble_gap_event *event, void *arg)
 bleuart_advertise();
 return 0;
 
+
+case 

[mynewt-core] branch master updated (9844b16 -> eeacd60)

2017-11-03 Thread ccollins
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git.


from 9844b16  Merge pull request #632 from ccollins476ad/rm-conn-cancel
 add 28f4a0d  BLE Host - Delay sync callback after IRK restore
 add 3e03639  Handle ..._COMPLETE events in sample BLE apps.
 new eeacd60  Merge pull request #629 from ccollins476ad/delay-sync-cb

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/main.c   |  5 +
 apps/bleprph/src/main.c   |  6 ++
 apps/bleprph_oic/src/main.c   |  6 ++
 apps/blesplit/src/main.c  |  7 +++
 apps/bletiny/src/main.c   | 20 +++-
 apps/bleuart/src/main.c   |  6 ++
 apps/btshell/src/main.c   | 19 +++
 apps/ocf_sample/src/ocf_ble.c |  6 ++
 apps/sensors_test/src/main.c  | 12 
 apps/testbench/src/tbb.c  |  6 ++
 net/nimble/host/src/ble_hs.c  | 13 +++--
 11 files changed, 83 insertions(+), 23 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@mynewt.apache.org" '].


[mynewt-core] 01/01: Merge pull request #629 from ccollins476ad/delay-sync-cb

2017-11-03 Thread ccollins
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit eeacd6019569370383ef6377d948849a33db9b9e
Merge: 9844b16 3e03639
Author: ccollins476ad 
AuthorDate: Fri Nov 3 16:43:19 2017 -0700

Merge pull request #629 from ccollins476ad/delay-sync-cb

BLE Host - Delay sync callback after IRK restore

 apps/blecent/src/main.c   |  5 +
 apps/bleprph/src/main.c   |  6 ++
 apps/bleprph_oic/src/main.c   |  6 ++
 apps/blesplit/src/main.c  |  7 +++
 apps/bletiny/src/main.c   | 20 +++-
 apps/bleuart/src/main.c   |  6 ++
 apps/btshell/src/main.c   | 19 +++
 apps/ocf_sample/src/ocf_ble.c |  6 ++
 apps/sensors_test/src/main.c  | 12 
 apps/testbench/src/tbb.c  |  6 ++
 net/nimble/host/src/ble_hs.c  | 13 +++--
 11 files changed, 83 insertions(+), 23 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@mynewt.apache.org" .


[mynewt-core] 01/01: Merge pull request #632 from ccollins476ad/rm-conn-cancel

2017-11-03 Thread ccollins
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 9844b16d31b4079b4646f80694c2f0639b98d79c
Merge: 2de4c39 38424e2
Author: ccollins476ad 
AuthorDate: Fri Nov 3 16:38:23 2017 -0700

Merge pull request #632 from ccollins476ad/rm-conn-cancel

BLE Host - Remove BLE_GAP_EVENT_CONN_CANCEL

 apps/bletiny/src/main.c |  4 
 apps/btshell/src/main.c |  4 
 net/nimble/host/include/host/ble_gap.h  |  2 +-
 net/nimble/host/src/ble_gap.c   | 13 +
 net/nimble/host/test/src/ble_gap_test.c |  9 -
 5 files changed, 10 insertions(+), 22 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@mynewt.apache.org" .


[GitHub] ccollins476ad commented on issue #632: BLE Host - Remove BLE_GAP_EVENT_CONN_CANCEL

2017-11-03 Thread GitBox
ccollins476ad commented on issue #632: BLE Host - Remove 
BLE_GAP_EVENT_CONN_CANCEL
URL: https://github.com/apache/mynewt-core/pull/632#issuecomment-341852546
 
 
   Thanks for reviewing, Andrzej.


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 (f0307a5 -> 2de4c39)

2017-11-03 Thread vipulrahane
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 f0307a5  Merge pull request #645 from wes3/lora_mac_cmd
 add e29d7b4  MYNEWT-861 Sensor per type polling - first commit
 add 9959dbf  MYNEWT-861 Sensor per type polling fix poll rate
 add 2ee7973  MYNEWT-861 Fix bugs with bmp280 driver and cleanup
 add 42ef645  MYNEWT-861 Sensor per type poller cleanup
 new 2de4c39  Merge pull request #644 from vrahane/sensor_per_type_poll

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:
 hw/drivers/sensors/bmp280/src/bmp280.c |   4 +-
 hw/sensor/include/sensor/sensor.h  |  21 +-
 hw/sensor/src/sensor.c | 451 ++---
 hw/sensor/syscfg.yml   |   8 +-
 kernel/os/include/os/os_time.h |   7 +-
 5 files changed, 383 insertions(+), 108 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@mynewt.apache.org" '].


[GitHub] vrahane closed pull request #644: MYNEWT-861: Sensor per type polling

2017-11-03 Thread GitBox
vrahane closed pull request #644: MYNEWT-861: Sensor per type polling
URL: https://github.com/apache/mynewt-core/pull/644
 
 
   

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/hw/drivers/sensors/bmp280/src/bmp280.c 
b/hw/drivers/sensors/bmp280/src/bmp280.c
index aae1ecb78..b736e6cab 100644
--- a/hw/drivers/sensors/bmp280/src/bmp280.c
+++ b/hw/drivers/sensors/bmp280/src/bmp280.c
@@ -685,9 +685,9 @@ bmp280_i2c_readlen(struct sensor_itf *itf, uint8_t addr, 
uint8_t *buffer,
uint8_t len)
 {
 int rc;
-uint8_t payload[20] = { addr, 0, 0, 0, 0, 0, 0, 0,
+uint8_t payload[24] = { addr, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0};
+  0, 0, 0, 0, 0 ,0 ,0, 0};
 
 struct hal_i2c_master_data data_struct = {
 .address = itf->si_addr,
diff --git a/hw/sensor/include/sensor/sensor.h 
b/hw/sensor/include/sensor/sensor.h
index 6cc18fd74..4ff4da207 100644
--- a/hw/sensor/include/sensor/sensor.h
+++ b/hw/sensor/include/sensor/sensor.h
@@ -249,6 +249,15 @@ struct sensor_type_traits {
 /* field for selecting algorithm */
 uint8_t stt_algo;
 
+/* Poll rate multiple */
+uint16_t stt_poll_n;
+
+uint16_t stt_polls_left;
+
+#if MYNEWT_VAL(SENSOR_POLL_TEST_LOG)
+os_time_t prev_now;
+#endif
+
 /* function ptr for setting comparison algo */
 sensor_trigger_cmp_func_t stt_trigger_cmp_algo;
 
@@ -540,8 +549,6 @@ sensor_get_config(struct sensor *sensor, sensor_type_t type,
  * polling has been configured more frequently than this, it will
  * be triggered instead.
  */
-#define SENSOR_MGR_WAKEUP_TICKS (MYNEWT_VAL(SENSOR_MGR_WAKEUP_RATE) * \
-OS_TICKS_PER_SEC) / 1000
 
 int sensor_mgr_lock(void);
 void sensor_mgr_unlock(void);
@@ -619,6 +626,16 @@ int
 sensor_set_poll_rate_ms(char *, uint32_t);
 
 /**
+ * Set the sensor poll rate multiple based on the device name, sensor type
+ *
+ * @param The devname
+ * @param The sensor type trait
+ * @param The multiple of the poll rate
+ */
+int
+sensor_set_n_poll_rate(char *, struct sensor_type_traits *);
+
+/**
  * Transmit OIC trigger
  *
  * @param ptr to the sensor
diff --git a/hw/sensor/src/sensor.c b/hw/sensor/src/sensor.c
index e97003770..a34fd6858 100644
--- a/hw/sensor/src/sensor.c
+++ b/hw/sensor/src/sensor.c
@@ -30,7 +30,6 @@
 #include "os/os_time.h"
 #include "os/os_cputime.h"
 #include "defs/error.h"
-#include "console/console.h"
 #include "syscfg/syscfg.h"
 #include "sensor/accel.h"
 #include "sensor/mag.h"
@@ -42,6 +41,23 @@
 #include "sensor/pressure.h"
 #include "sensor/humidity.h"
 #include "sensor/gyro.h"
+#include "console/console.h"
+
+#if MYNEWT_VAL(SENSOR_POLL_TEST_LOG)
+uint32_t test_log_idx;
+uint32_t smgr_wakeup_idx;
+
+struct test_log {
+os_time_t delta;
+uint16_t polls_left;
+os_time_t now;
+os_time_t os_now;
+char name[2];
+uint32_t poll_multiple;
+}test_log[100];
+
+os_time_t smgr_wakeup[500];
+#endif
 
 struct {
 struct os_mutex mgr_lock;
@@ -103,8 +119,16 @@ sensor_mgr_insert(struct sensor *sensor)
 struct sensor *cursor, *prev;
 
 prev = cursor = NULL;
+if (!sensor->s_poll_rate) {
+SLIST_FOREACH(cursor, _mgr.mgr_sensor_list, s_next) {
+prev = cursor;
+}
+goto insert;
+}
+
+prev = cursor = NULL;
 SLIST_FOREACH(cursor, _mgr.mgr_sensor_list, s_next) {
-if (cursor->s_next_run == OS_TIMEOUT_NEVER) {
+if (!cursor->s_poll_rate) {
 break;
 }
 
@@ -115,6 +139,7 @@ sensor_mgr_insert(struct sensor *sensor)
 prev = cursor;
 }
 
+insert:
 if (prev == NULL) {
 SLIST_INSERT_HEAD(_mgr.mgr_sensor_list, sensor, s_next);
 } else {
@@ -123,7 +148,223 @@ sensor_mgr_insert(struct sensor *sensor)
 }
 
 /**
- * Set the sensor poll rate based on teh device name
+ * Remove a sensor type trait. This allows a calling application to unset
+ * sensortype trait for a given sensor object.
+ *
+ * @param The sensor object
+ * @param The sensor trait to remove from the sensor type trait list
+ *
+ * @return 0 on success, non-zero error code on failure.
+ */
+
+static int
+sensor_remove_type_trait(struct sensor *sensor,
+ struct sensor_type_traits *stt)
+{
+int rc;
+
+rc = sensor_lock(sensor);
+if (rc != 0) {
+goto err;
+}
+
+/* Remove this entry from the list */
+SLIST_REMOVE(>s_type_traits_list, stt, sensor_type_traits,
+stt_next);
+
+sensor_unlock(sensor);
+
+return (0);
+err:
+return (rc);
+}
+
+/**
+ * Insert sensor type trait sorting based on the poll rate multiple
+ *
+ * @param sensor to insert type traits in
+ * @param sensor type traits to insert
+ *
+ * 

[mynewt-core] branch master updated (0e35d62 -> f0307a5)

2017-11-03 Thread wes3
This is an automated email from the ASF dual-hosted git repository.

wes3 pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git.


from 0e35d62  Merge pull request #639 from IMGJulian/ci40
 add 6f78d46  net/lora: Fix MAC command issues
 new f0307a5  Merge pull request #645 from wes3/lora_mac_cmd

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:
 net/lora/node/include/node/mac/LoRaMac.h |   2 +
 net/lora/node/src/lora_node.c|  33 ++-
 net/lora/node/src/mac/LoRaMac.c  | 392 +++
 3 files changed, 218 insertions(+), 209 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@mynewt.apache.org" '].


[mynewt-core] 01/01: Merge pull request #645 from wes3/lora_mac_cmd

2017-11-03 Thread wes3
This is an automated email from the ASF dual-hosted git repository.

wes3 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit f0307a536b5acfd3ab3b834b31adff9311c6114b
Merge: 0e35d62 6f78d46
Author: wes3 
AuthorDate: Fri Nov 3 11:25:42 2017 -0700

Merge pull request #645 from wes3/lora_mac_cmd

net/lora: Fix MAC command issues

 net/lora/node/include/node/mac/LoRaMac.h |   2 +
 net/lora/node/src/lora_node.c|  33 ++-
 net/lora/node/src/mac/LoRaMac.c  | 392 +++
 3 files changed, 218 insertions(+), 209 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@mynewt.apache.org" .


[GitHub] IMGJulian closed pull request #639: BSP MIPS Ci40: brought in the MIPS HAL, fixes startup

2017-11-03 Thread GitBox
IMGJulian closed pull request #639: BSP MIPS Ci40: brought in the MIPS HAL, 
fixes startup
URL: https://github.com/apache/mynewt-core/pull/639
 
 
   

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/compiler/mips/compiler.yml b/compiler/mips/compiler.yml
index 6b451f9b9..0769bb013 100644
--- a/compiler/mips/compiler.yml
+++ b/compiler/mips/compiler.yml
@@ -31,6 +31,6 @@ compiler.flags.debug: [compiler.flags.base, -g3]
 
 compiler.as.flags: [-x, assembler-with-cpp]
 
-compiler.ld.flags: -Wl,-defsym,__app_start=0x8000
+compiler.ld.flags: -Wl,-defsym,__app_start=0x8000 
-Wl,-defsym,__use_excpt_boot=0 -nostartfiles
 compiler.ld.resolve_circular_deps: true
 compiler.ld.mapfile: true
diff --git a/hw/bsp/ci40/pkg.yml b/hw/bsp/ci40/pkg.yml
index 194b5f508..218a35df2 100644
--- a/hw/bsp/ci40/pkg.yml
+++ b/hw/bsp/ci40/pkg.yml
@@ -31,6 +31,10 @@ pkg.keywords:
 pkg.cflags:
 pkg.deps:
 - hw/mcu/mips/danube
+- libc/baselibc
+- hw/mips-hal
+
+pkg.arch: mips
 
 pkg.deps.UART_0:
 - hw/drivers/uart/uart_hal
diff --git a/hw/bsp/ci40/src/arch/mips/abiflags.S 
b/hw/bsp/ci40/src/arch/mips/abiflags.S
new file mode 100644
index 0..024f0fc3c
--- /dev/null
+++ b/hw/bsp/ci40/src/arch/mips/abiflags.S
@@ -0,0 +1,111 @@
+/*
+ * abiflags.S - MIPS ABI flags.
+ */
+
+/*
+* Copyright (c) Imagination Technologies Ltd.
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* 3. Neither the name of the copyright holder nor the names of its
+* contributors may be used to endorse or promote products derived from this
+* software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/* Values for the xxx_size bytes of an ABI flags structure.  */
+#define AFL_REG_NONE 0x00   /* No registers.  */
+#define AFL_REG_32   0x01   /* 32-bit registers.  */
+#define AFL_REG_64   0x02   /* 64-bit registers.  */
+#define AFL_REG_128  0x03   /* 128-bit registers.  */
+
+/* Masks for the ases word of an ABI flags structure.  */
+#define AFL_ASE_DSP  0x0001  /* DSP ASE.  */
+#define AFL_ASE_DSPR20x0002  /* DSP R2 ASE.  */
+#define AFL_ASE_EVA  0x0004  /* Enhanced VA Scheme.  */
+#define AFL_ASE_MCU  0x0008  /* MCU (MicroController) ASE.  */
+#define AFL_ASE_MDMX 0x0010  /* MDMX ASE.  */
+#define AFL_ASE_MIPS3D   0x0020  /* MIPS-3D ASE.  */
+#define AFL_ASE_MT   0x0040  /* MT ASE.  */
+#define AFL_ASE_SMARTMIPS0x0080  /* SmartMIPS ASE.  */
+#define AFL_ASE_VIRT 0x0100  /* VZ ASE.  */
+#define AFL_ASE_MSA  0x0200  /* MSA ASE.  */
+#define AFL_ASE_MIPS16   0x0400  /* MIPS16 ASE.  */
+#define AFL_ASE_MICROMIPS0x0800  /* MICROMIPS ASE.  */
+#define AFL_ASE_XPA  0x1000  /* XPA ASE.  */
+
+/* Values for the isa_ext word of an ABI flags structure.  */
+#define AFL_EXT_XLR   1  /* RMI Xlr instruction.  */
+#define AFL_EXT_OCTEON2   2  /* Cavium Networks Octeon2.  */
+#define AFL_EXT_OCTEONP   3  /* Cavium Networks OcteonP.  */
+#define AFL_EXT_LOONGSON_3A   4  /* Loongson 3A.  */
+#define AFL_EXT_OCTEON5  /* Cavium Networks Octeon.  */
+#define AFL_EXT_5900  6  /* MIPS R5900 instruction.  */
+#define AFL_EXT_4650  7  /* MIPS R4650 instruction.  */
+#define AFL_EXT_4010  8  /* LSI R4010 instruction.  */
+#define AFL_EXT_4100  9  /* NEC VR4100 instruction.  */
+#define AFL_EXT_3900 10  /* Toshiba R3900 instruction.  */

[mynewt-core] branch master updated (9a71954 -> 0e35d62)

2017-11-03 Thread julian
This is an automated email from the ASF dual-hosted git repository.

julian pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git.


from 9a71954  Merge pull request #642 from 
michal-narajowski/blemesh-health-fault
 add 6a96415  BSP MIPS Ci40: brought in the MIPS HAL, fixes startup
 new 0e35d62  Merge pull request #639 from IMGJulian/ci40

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:
 compiler/mips/compiler.yml |   2 +-
 hw/bsp/ci40/pkg.yml|   4 +
 hw/bsp/ci40/src/arch/mips/abiflags.S   | 111 ++
 hw/bsp/ci40/src/arch/mips/gcc_startup_mips.S   | 392 +++
 hw/bsp/ci40/src/hal_bsp.c  |  37 +-
 hw/bsp/ci40/src/os_bsp.c   |  57 ---
 hw/bsp/ci40/uhi32.ld   |   6 +-
 hw/mcu/mips/danube/{src => include/mcu}/gic.h  |   0
 hw/mcu/mips/danube/src/gic.c   |   4 +-
 hw/mcu/mips/danube/src/hal_os_tick.c   |   1 +
 hw/mcu/mips/danube/src/hal_uart.c  |   2 +-
 hw/{drivers/sensors/sim => mips-hal}/pkg.yml   |  11 +-
 .../mips-hal/src/arch/mips/__exit.c|  87 +
 .../mips-hal/src/arch/mips/cache.S |  96 ++---
 .../mips-hal/src/arch/mips/cache.h |  82 +---
 hw/mips-hal/src/arch/mips/cache_ops.S  | 109 ++
 .../mips-hal/src/arch/mips/link.c  |  81 +---
 hw/mips-hal/src/arch/mips/m32cache.S   | 143 +++
 hw/mips-hal/src/arch/mips/m32cache.h   | 120 ++
 hw/mips-hal/src/arch/mips/m32cache_ops.S   | 248 
 hw/mips-hal/src/arch/mips/m32tlb_ops.S | 263 +
 hw/mips-hal/src/arch/mips/m64tlb_ops.S | 424 +
 hw/mips-hal/src/arch/mips/mips_cm3_l2size.S| 113 ++
 hw/mips-hal/src/arch/mips/mips_excpt_boot.S| 372 ++
 hw/mips-hal/src/arch/mips/mips_excpt_entry.S   | 265 +
 hw/mips-hal/src/arch/mips/mips_excpt_handler.c | 308 +++
 .../mips-hal/src/arch/mips/mips_excpt_isr.S|  77 ++--
 hw/mips-hal/src/arch/mips/mips_excpt_register.S| 137 +++
 hw/mips-hal/src/arch/mips/mips_fp.S| 187 +
 hw/mips-hal/src/arch/mips/mips_l2size.S| 101 +
 hw/mips-hal/src/arch/mips/mips_msa.S   | 186 +
 .../mips-hal/src/arch/mips/mips_xpa.S  | 112 +++---
 hw/mips-hal/src/arch/mips/mxxtlb_ops.S | 304 +++
 kernel/os/src/arch/mips/os_arch_mips.c |   7 +-
 kernel/os/src/arch/mips/os_fault.c |  21 -
 35 files changed, 4015 insertions(+), 455 deletions(-)
 create mode 100644 hw/bsp/ci40/src/arch/mips/abiflags.S
 create mode 100644 hw/bsp/ci40/src/arch/mips/gcc_startup_mips.S
 delete mode 100644 hw/bsp/ci40/src/os_bsp.c
 rename hw/mcu/mips/danube/{src => include/mcu}/gic.h (100%)
 copy hw/{drivers/sensors/sim => mips-hal}/pkg.yml (81%)
 copy kernel/os/src/arch/mips/asm/excpt_isr.S => 
hw/mips-hal/src/arch/mips/__exit.c (52%)
 copy kernel/os/src/arch/mips/asm/excpt_isr.S => 
hw/mips-hal/src/arch/mips/cache.S (52%)
 copy kernel/os/src/arch/mips/asm/excpt_isr.S => 
hw/mips-hal/src/arch/mips/cache.h (54%)
 create mode 100644 hw/mips-hal/src/arch/mips/cache_ops.S
 copy kernel/os/src/arch/mips/asm/excpt_isr.S => 
hw/mips-hal/src/arch/mips/link.c (52%)
 create mode 100644 hw/mips-hal/src/arch/mips/m32cache.S
 create mode 100644 hw/mips-hal/src/arch/mips/m32cache.h
 create mode 100644 hw/mips-hal/src/arch/mips/m32cache_ops.S
 create mode 100644 hw/mips-hal/src/arch/mips/m32tlb_ops.S
 create mode 100644 hw/mips-hal/src/arch/mips/m64tlb_ops.S
 create mode 100644 hw/mips-hal/src/arch/mips/mips_cm3_l2size.S
 create mode 100644 hw/mips-hal/src/arch/mips/mips_excpt_boot.S
 create mode 100644 hw/mips-hal/src/arch/mips/mips_excpt_entry.S
 create mode 100644 hw/mips-hal/src/arch/mips/mips_excpt_handler.c
 copy kernel/os/src/arch/mips/asm/excpt_isr.S => 
hw/mips-hal/src/arch/mips/mips_excpt_isr.S (78%)
 create mode 100644 hw/mips-hal/src/arch/mips/mips_excpt_register.S
 create mode 100644 hw/mips-hal/src/arch/mips/mips_fp.S
 create mode 100644 hw/mips-hal/src/arch/mips/mips_l2size.S
 create mode 100644 hw/mips-hal/src/arch/mips/mips_msa.S
 copy kernel/os/src/arch/mips/asm/excpt_isr.S => 
hw/mips-hal/src/arch/mips/mips_xpa.S (56%)
 create mode 100644 hw/mips-hal/src/arch/mips/mxxtlb_ops.S

-- 
To stop receiving notification emails like this one, please contact
['"commits@mynewt.apache.org" '].


[mynewt-core] 01/01: Merge pull request #639 from IMGJulian/ci40

2017-11-03 Thread julian
This is an automated email from the ASF dual-hosted git repository.

julian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 0e35d625fd9b0063d7aba40d161ed1a23932a796
Merge: 9a71954 6a96415
Author: IMGJulian 
AuthorDate: Fri Nov 3 13:07:04 2017 +

Merge pull request #639 from IMGJulian/ci40

BSP MIPS Ci40: brought in the MIPS HAL, fixes startup

 compiler/mips/compiler.yml  |   2 +-
 hw/bsp/ci40/pkg.yml |   4 +
 hw/bsp/ci40/src/arch/mips/abiflags.S| 111 +++
 hw/bsp/ci40/src/arch/mips/gcc_startup_mips.S| 392 ++
 hw/bsp/ci40/src/hal_bsp.c   |  37 ++-
 hw/bsp/ci40/src/os_bsp.c|  57 
 hw/bsp/ci40/uhi32.ld|   6 +-
 hw/mcu/mips/danube/{src => include/mcu}/gic.h   |   0
 hw/mcu/mips/danube/src/gic.c|   4 +-
 hw/mcu/mips/danube/src/hal_os_tick.c|   1 +
 hw/mcu/mips/danube/src/hal_uart.c   |   2 +-
 hw/{bsp/ci40 => mips-hal}/pkg.yml   |  23 +-
 hw/mips-hal/src/arch/mips/__exit.c  |  52 +++
 hw/mips-hal/src/arch/mips/cache.S   |  63 
 hw/mips-hal/src/arch/mips/cache.h   |  49 +++
 hw/mips-hal/src/arch/mips/cache_ops.S   | 109 ++
 hw/mips-hal/src/arch/mips/link.c|  44 +++
 hw/mips-hal/src/arch/mips/m32cache.S| 143 
 hw/mips-hal/src/arch/mips/m32cache.h| 120 +++
 hw/mips-hal/src/arch/mips/m32cache_ops.S| 248 ++
 hw/mips-hal/src/arch/mips/m32tlb_ops.S  | 263 +++
 hw/mips-hal/src/arch/mips/m64tlb_ops.S  | 424 
 hw/mips-hal/src/arch/mips/mips_cm3_l2size.S | 113 +++
 hw/mips-hal/src/arch/mips/mips_excpt_boot.S | 372 +
 hw/mips-hal/src/arch/mips/mips_excpt_entry.S| 265 +++
 hw/mips-hal/src/arch/mips/mips_excpt_handler.c  | 308 +
 hw/mips-hal/src/arch/mips/mips_excpt_isr.S  | 100 ++
 hw/mips-hal/src/arch/mips/mips_excpt_register.S | 137 
 hw/mips-hal/src/arch/mips/mips_fp.S | 187 +++
 hw/mips-hal/src/arch/mips/mips_l2size.S | 101 ++
 hw/mips-hal/src/arch/mips/mips_msa.S| 186 +++
 hw/mips-hal/src/arch/mips/mips_xpa.S|  81 +
 hw/mips-hal/src/arch/mips/mxxtlb_ops.S  | 304 +
 kernel/os/src/arch/mips/os_arch_mips.c  |   7 +-
 kernel/os/src/arch/mips/os_fault.c  |  21 --
 35 files changed, 4232 insertions(+), 104 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@mynewt.apache.org" .


[GitHub] IMGJulian commented on a change in pull request #639: BSP MIPS Ci40: brought in the MIPS HAL, fixes startup

2017-11-03 Thread GitBox
IMGJulian commented on a change in pull request #639: BSP MIPS Ci40: brought in 
the MIPS HAL, fixes startup
URL: https://github.com/apache/mynewt-core/pull/639#discussion_r148756979
 
 

 ##
 File path: hw/bsp/ci40/src/arch/mips/abiflags.S
 ##
 @@ -0,0 +1,82 @@
+/*
 
 Review comment:
   Fixed to be the same as the others, thanks.


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] michal-narajowski opened a new pull request #646: mesh: Fail init on keys generation error

2017-11-03 Thread GitBox
michal-narajowski opened a new pull request #646: mesh: Fail init on keys 
generation error
URL: https://github.com/apache/mynewt-core/pull/646
 
 
   Fail on Mesh initialization if provisioning is enabled and keys were
   not generated. This make it simpler to debug misconfigured devices.
   
   Ported from Zephyr PR #4691


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] michal-narajowski commented on issue #643: [RFC] mesh: API and shell commands for PTS testing

2017-11-03 Thread GitBox
michal-narajowski commented on issue #643: [RFC] mesh: API and shell commands 
for PTS testing
URL: https://github.com/apache/mynewt-core/pull/643#issuecomment-341658274
 
 
   Rebased


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 #642 from michal-narajowski/blemesh-health-fault

2017-11-03 Thread naraj
This is an automated email from the ASF dual-hosted git repository.

naraj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 9a7195490a3ecf476513337b569c2d6f5a560e42
Merge: e4e9097 5dbd393
Author: Michał Narajowski 
AuthorDate: Fri Nov 3 10:43:02 2017 +0100

Merge pull request #642 from michal-narajowski/blemesh-health-fault

apps/blemesh: Add health fault handling and vendor model for PTS testing

 apps/blemesh/src/main.c | 90 +
 1 file changed, 90 insertions(+)

-- 
To stop receiving notification emails like this one, please contact
"commits@mynewt.apache.org" .


[mynewt-core] branch master updated (e4e9097 -> 9a71954)

2017-11-03 Thread naraj
This is an automated email from the ASF dual-hosted git repository.

naraj pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git.


from e4e9097  Merge pull request #641 from 
michal-narajowski/mesh-iv-update-fix
 add 93d1b0e  apps/blemesh: Add callbacks for mesh health fault handling
 add 4ae93db  apps/blemesh: Keep track of allowed and recent test id
 add 5dbd393  apps/blemesh: Add vendor model for PTS testing
 new 9a71954  Merge pull request #642 from 
michal-narajowski/blemesh-health-fault

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/blemesh/src/main.c | 90 +
 1 file changed, 90 insertions(+)

-- 
To stop receiving notification emails like this one, please contact
['"commits@mynewt.apache.org" '].


[GitHub] michal-narajowski closed pull request #642: apps/blemesh: Add health fault handling and vendor model for PTS testing

2017-11-03 Thread GitBox
michal-narajowski closed pull request #642: apps/blemesh: Add health fault 
handling and vendor model for PTS testing
URL: https://github.com/apache/mynewt-core/pull/642
 
 
   

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/blemesh/src/main.c b/apps/blemesh/src/main.c
index b6c2130da..0ceacff54 100755
--- a/apps/blemesh/src/main.c
+++ b/apps/blemesh/src/main.c
@@ -35,6 +35,13 @@
 
 /* Company ID*/
 #define CID_VENDOR 0x
+#define STANDARD_TEST_ID 0x00
+#define TEST_ID 0x01
+static int recent_test_id = STANDARD_TEST_ID;
+
+#define FAULT_ARR_SIZE 2
+
+static bool has_reg_fault = true;
 
 static struct bt_mesh_cfg cfg_srv = {
 .relay = BT_MESH_RELAY_DISABLED,
@@ -52,7 +59,88 @@ static struct bt_mesh_cfg cfg_srv = {
 .relay_retransmit = BT_MESH_TRANSMIT(2, 20),
 };
 
+static int
+fault_get_cur(struct bt_mesh_model *model,
+  uint8_t *test_id,
+  uint16_t *company_id,
+  uint8_t *faults,
+  uint8_t *fault_count)
+{
+uint8_t reg_faults[FAULT_ARR_SIZE] = { [0 ... FAULT_ARR_SIZE-1] = 0xff };
+
+console_printf("fault_get_cur() has_reg_fault %u\n", has_reg_fault);
+
+*test_id = recent_test_id;
+*company_id = CID_VENDOR;
+
+*fault_count = min(*fault_count, sizeof(reg_faults));
+memcpy(faults, reg_faults, *fault_count);
+
+return 0;
+}
+
+static int
+fault_get_reg(struct bt_mesh_model *model,
+  uint16_t company_id,
+  uint8_t *test_id,
+  uint8_t *faults,
+  uint8_t *fault_count)
+{
+if (company_id != CID_VENDOR) {
+return -BLE_HS_EINVAL;
+}
+
+console_printf("fault_get_reg() has_reg_fault %u\n", has_reg_fault);
+
+*test_id = recent_test_id;
+
+if (has_reg_fault) {
+uint8_t reg_faults[FAULT_ARR_SIZE] = { [0 ... FAULT_ARR_SIZE-1] = 0xff 
};
+
+*fault_count = min(*fault_count, sizeof(reg_faults));
+memcpy(faults, reg_faults, *fault_count);
+} else {
+*fault_count = 0;
+}
+
+return 0;
+}
+
+static int
+fault_clear(struct bt_mesh_model *model, uint16_t company_id)
+{
+if (company_id != CID_VENDOR) {
+return -BLE_HS_EINVAL;
+}
+
+has_reg_fault = false;
+
+return 0;
+}
+
+static int
+fault_test(struct bt_mesh_model *model, uint8_t test_id, uint16_t company_id)
+{
+if (company_id != CID_VENDOR) {
+return -BLE_HS_EINVAL;
+}
+
+if (test_id != STANDARD_TEST_ID && test_id != TEST_ID) {
+return -BLE_HS_EINVAL;
+}
+
+recent_test_id = test_id;
+has_reg_fault = true;
+bt_mesh_fault_update(model->elem);
+
+return 0;
+}
+
 static struct bt_mesh_health health_srv = {
+.fault_get_cur = _get_cur,
+.fault_get_reg = _get_reg,
+.fault_clear = _clear,
+.fault_test = _test,
 };
 
 static struct bt_mesh_model_pub gen_level_pub;
@@ -150,6 +238,8 @@ static struct bt_mesh_model root_models[] = {
 };
 
 static struct bt_mesh_model vnd_models[] = {
+BT_MESH_MODEL_VND(CID_VENDOR, BT_MESH_MODEL_ID_GEN_ONOFF_SRV, gen_onoff_op,
+  _onoff_pub, NULL),
 };
 
 static struct bt_mesh_elem elements[] = {


 


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 (19ade1f -> e4e9097)

2017-11-03 Thread naraj
This is an automated email from the ASF dual-hosted git repository.

naraj pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git.


from 19ade1f  Merge pull request #622 from 
andrzej-kaczmarek/nimble-aux-sched-fix
 add 51fbf89  mesh: Fix and clean up iv update procedure
 new e4e9097  Merge pull request #641 from 
michal-narajowski/mesh-iv-update-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:
 net/nimble/host/mesh/src/net.c | 57 ++
 1 file changed, 36 insertions(+), 21 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@mynewt.apache.org" '].


[GitHub] michal-narajowski closed pull request #641: mesh: Fix and clean up iv update procedure

2017-11-03 Thread GitBox
michal-narajowski closed pull request #641: mesh: Fix and clean up iv update 
procedure
URL: https://github.com/apache/mynewt-core/pull/641
 
 
   

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/net/nimble/host/mesh/src/net.c b/net/nimble/host/mesh/src/net.c
index 0872a8439..032abed83 100644
--- a/net/nimble/host/mesh/src/net.c
+++ b/net/nimble/host/mesh/src/net.c
@@ -556,35 +556,50 @@ void bt_mesh_iv_update(u32_t iv_index, bool iv_update)
 {
int i;
 
-   if (iv_index < bt_mesh.iv_index || iv_index > bt_mesh.iv_index + 42) {
-   BT_ERR("IV Index completely out of sync: 0x%08x != 0x%08x",
-   iv_index, bt_mesh.iv_index);
-   return;
-   }
-
-   if (iv_index > bt_mesh.iv_index + 1) {
-   BT_WARN("Performing IV Index Recovery");
-   memset(bt_mesh.rpl, 0, sizeof(bt_mesh.rpl));
-   bt_mesh.iv_index = iv_index;
-   bt_mesh.seq = 0;
-   goto do_update;
-   }
+   if (bt_mesh.iv_update) {
+   /* We're currently in IV Update mode */
 
-   if (iv_update == bt_mesh.iv_update) {
if (iv_index != bt_mesh.iv_index) {
-   BT_WARN("No update, but IV Index 0x%08x != 0x%08x",
+   BT_WARN("IV Index mismatch: 0x%08x != 0x%08x",
iv_index, bt_mesh.iv_index);
+   return;
}
-   return;
-   }
 
-   if (bt_mesh.iv_update) {
-   if (iv_index != bt_mesh.iv_index) {
-   BT_WARN("IV Index mismatch: 0x%08x != 0x%08x",
+   if (iv_update) {
+   /* Nothing to do */
+   BT_DBG("Already in IV Update in Progress state");
+   return;
+   }
+   } else  {
+   /* We're currently in Normal mode */
+
+   if (iv_index < bt_mesh.iv_index ||
+   iv_index > bt_mesh.iv_index + 42) {
+   BT_ERR("IV Index out of sync: " "0x%08x != 0x%08x",
+  iv_index, bt_mesh.iv_index);
+   return;
+   }
+
+   if (iv_index > bt_mesh.iv_index + 1) {
+   BT_WARN("Performing IV Index Recovery");
+   memset(bt_mesh.rpl, 0, sizeof(bt_mesh.rpl));
+   bt_mesh.iv_index = iv_index;
+   bt_mesh.seq = 0;
+   goto do_update;
+   }
+
+   if (iv_index == bt_mesh.iv_index + 1 && !iv_update) {
+   BT_WARN("Ignoring new index in normal mode",
iv_index, bt_mesh.iv_index);
return;
}
-   } else {
+
+   if (!iv_update) {
+   /* Nothing to do */
+   BT_DBG("Already in Normal mode");
+   return;
+   }
+
if (iv_index != bt_mesh.iv_index + 1) {
BT_WARN("Wrong new IV Index: 0x%08x != 0x%08x + 1",
iv_index, bt_mesh.iv_index);


 


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 #641 from michal-narajowski/mesh-iv-update-fix

2017-11-03 Thread naraj
This is an automated email from the ASF dual-hosted git repository.

naraj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit e4e9097ee3899be58c06cbfbcf0cf2ece61fc493
Merge: 19ade1f 51fbf89
Author: Michał Narajowski 
AuthorDate: Fri Nov 3 10:42:30 2017 +0100

Merge pull request #641 from michal-narajowski/mesh-iv-update-fix

mesh: Fix and clean up iv update procedure

 net/nimble/host/mesh/src/net.c | 57 ++
 1 file changed, 36 insertions(+), 21 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@mynewt.apache.org" .


[GitHub] michal-narajowski commented on issue #643: [RFC] mesh: API and shell commands for PTS testing

2017-11-03 Thread GitBox
michal-narajowski commented on issue #643: [RFC] mesh: API and shell commands 
for PTS testing
URL: https://github.com/apache/mynewt-core/pull/643#issuecomment-341657488
 
 
   Updated after review


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] rymanluk commented on a change in pull request #643: [RFC] mesh: API and shell commands for PTS testing

2017-11-03 Thread GitBox
rymanluk commented on a change in pull request #643: [RFC] mesh: API and shell 
commands for PTS testing
URL: https://github.com/apache/mynewt-core/pull/643#discussion_r148724730
 
 

 ##
 File path: net/nimble/host/mesh/src/pts.c
 ##
 @@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+#include "mesh/glue.h"
+#include "mesh/mesh.h"
+#include "mesh/pts.h"
+#include "os/os_mbuf.h"
+
+#include "adv.h"
+#include "mesh_priv.h"
+#include "net.h"
+#include "transport.h"
+
+#include "syscfg/syscfg.h"
+#define BT_DBG_ENABLED (MYNEWT_VAL(BLE_MESH_DEBUG))
+#include "host/ble_hs_log.h"
+
+int
+mesh_net_send_msg(u8_t ttl, u16_t app_idx, u16_t src_addr, u16_t dst_addr,
 
 Review comment:
   I would prefix those functions with pts_


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] rymanluk commented on a change in pull request #643: [RFC] mesh: API and shell commands for PTS testing

2017-11-03 Thread GitBox
rymanluk commented on a change in pull request #643: [RFC] mesh: API and shell 
commands for PTS testing
URL: https://github.com/apache/mynewt-core/pull/643#discussion_r148725208
 
 

 ##
 File path: net/nimble/host/mesh/src/pts.c
 ##
 @@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+#include "mesh/glue.h"
+#include "mesh/mesh.h"
+#include "mesh/pts.h"
+#include "os/os_mbuf.h"
+
+#include "adv.h"
+#include "mesh_priv.h"
+#include "net.h"
+#include "transport.h"
+
+#include "syscfg/syscfg.h"
+#define BT_DBG_ENABLED (MYNEWT_VAL(BLE_MESH_DEBUG))
+#include "host/ble_hs_log.h"
+
+int
 
 Review comment:
   Let's use some MYNEWT_VAL to enable this code. BLE_PTS maybe?


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] rymanluk commented on a change in pull request #643: [RFC] mesh: API and shell commands for PTS testing

2017-11-03 Thread GitBox
rymanluk commented on a change in pull request #643: [RFC] mesh: API and shell 
commands for PTS testing
URL: https://github.com/apache/mynewt-core/pull/643#discussion_r148727328
 
 

 ##
 File path: net/nimble/host/mesh/src/net.c
 ##
 @@ -592,7 +594,7 @@ void bt_mesh_iv_update(u32_t iv_index, bool iv_update)
}
}
 
-   if (!(MYNEWT_VAL(BLE_MESH_IV_UPDATE_TEST))) {
+   if (!iv_update_test_mode) {
 
 Review comment:
   maybe instead of this we could have some macro in pts.h which would take 
decision based on (MYNEWT_VAL(BLE_MESH_IV_UPDATE_TEST) and iv_update_test_mode. 
BTW iv_update_test_mode we could move to pts.c then.


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] rymanluk commented on a change in pull request #643: [RFC] mesh: API and shell commands for PTS testing

2017-11-03 Thread GitBox
rymanluk commented on a change in pull request #643: [RFC] mesh: API and shell 
commands for PTS testing
URL: https://github.com/apache/mynewt-core/pull/643#discussion_r148725407
 
 

 ##
 File path: net/nimble/host/mesh/src/pts.c
 ##
 @@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+#include "mesh/glue.h"
+#include "mesh/mesh.h"
+#include "mesh/pts.h"
+#include "os/os_mbuf.h"
+
+#include "adv.h"
+#include "mesh_priv.h"
+#include "net.h"
+#include "transport.h"
+
+#include "syscfg/syscfg.h"
+#define BT_DBG_ENABLED (MYNEWT_VAL(BLE_MESH_DEBUG))
+#include "host/ble_hs_log.h"
+
+int
+mesh_net_send_msg(u8_t ttl, u16_t app_idx, u16_t src_addr, u16_t dst_addr,
+ u8_t *buf, u16_t len)
+{
+   int rc;
+   struct bt_mesh_msg_ctx ctx = {
+   .net_idx = BT_MESH_KEY_ANY,
+   .app_idx = app_idx,
+   .addr = dst_addr,
+   .recv_ttl = 0,
+   .friend_cred = 0,
+   .send_ttl = ttl,
+   };
+
+   struct os_mbuf *msg = ble_hs_mbuf_from_flat(buf, len);
+
+   BT_DBG("net_idx 0x%04x app_idx 0x%04x src 0x%04x len %u: %s\n",
 
 Review comment:
   this is new code so let's keep MYNEWT coding style and make declarations 
first.


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] rymanluk commented on a change in pull request #643: [RFC] mesh: API and shell commands for PTS testing

2017-11-03 Thread GitBox
rymanluk commented on a change in pull request #643: [RFC] mesh: API and shell 
commands for PTS testing
URL: https://github.com/apache/mynewt-core/pull/643#discussion_r148725693
 
 

 ##
 File path: net/nimble/host/mesh/src/pts.c
 ##
 @@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+#include "mesh/glue.h"
+#include "mesh/mesh.h"
+#include "mesh/pts.h"
+#include "os/os_mbuf.h"
+
+#include "adv.h"
+#include "mesh_priv.h"
+#include "net.h"
+#include "transport.h"
+
+#include "syscfg/syscfg.h"
+#define BT_DBG_ENABLED (MYNEWT_VAL(BLE_MESH_DEBUG))
+#include "host/ble_hs_log.h"
+
+int
+mesh_net_send_msg(u8_t ttl, u16_t app_idx, u16_t src_addr, u16_t dst_addr,
+ u8_t *buf, u16_t len)
+{
+   int rc;
+   struct bt_mesh_msg_ctx ctx = {
+   .net_idx = BT_MESH_KEY_ANY,
+   .app_idx = app_idx,
+   .addr = dst_addr,
+   .recv_ttl = 0,
+   .friend_cred = 0,
+   .send_ttl = ttl,
+   };
+
+   struct os_mbuf *msg = ble_hs_mbuf_from_flat(buf, len);
+
+   BT_DBG("net_idx 0x%04x app_idx 0x%04x src 0x%04x len %u: %s\n",
+  ctx.net_idx, ctx.app_idx, ctx.addr, msg->om_len,
+  bt_hex(msg->om_data, msg->om_len));
+
+   struct bt_mesh_net_tx tx = {
+   .sub = bt_mesh_subnet_get(ctx.net_idx),
+   .ctx = ,
+   .src = src_addr,
+   };
+
+   if (msg->om_len > BT_MESH_TX_SDU_MAX - 4) {
+   BT_ERR("Too big message");
+   return -1;
 
 Review comment:
   should we free msg here before return? Asking because below no matter what 
rc is we always free msg.


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