[GitHub] [mynewt-newtmgr] ccollins476ad commented on a change in pull request #165: Add support for Memfault commands

2020-06-02 Thread GitBox


ccollins476ad commented on a change in pull request #165:
URL: https://github.com/apache/mynewt-newtmgr/pull/165#discussion_r434257106



##
File path: newtmgr/cli/memfault.go
##
@@ -0,0 +1,110 @@
+/**
+ * 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.
+ */
+
+package cli
+
+import (
+   "fmt"
+   "os"
+
+   "github.com/spf13/cobra"
+
+   "mynewt.apache.org/newt/util"
+   "mynewt.apache.org/newtmgr/newtmgr/nmutil"
+   "mynewt.apache.org/newtmgr/nmxact/nmp"
+   "mynewt.apache.org/newtmgr/nmxact/xact"
+)
+
+func memfaultDownloadCmd(cmd *cobra.Command, args []string) {
+   if len(args) < 1 {
+   nmUsage(cmd, nil)
+   }
+
+   tmpName := args[0] + ".tmp"
+   progressBytes := 0
+   file, err := os.OpenFile(tmpName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 
0660)

Review comment:
   `ioutil.Tempfile()` (https://golang.org/pkg/io/ioutil/#TempFile) would 
be slightly better here.  If the user quits with ctrl-C, there won't be a temp 
file in the current directory.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[mynewt-newtmgr] branch master updated: Remove illegal space

2020-06-02 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-newtmgr.git


The following commit(s) were added to refs/heads/master by this push:
 new 61395d2  Remove illegal space
61395d2 is described below

commit 61395d2a705611c376226fa5114ea81392ded671
Author: Andrew Stevenson 
AuthorDate: Sat May 16 18:39:12 2020 +0200

Remove illegal space

newtmgr (1.9.0-dev at least) doesn't allow the space between the command 
and baud.
---
 docs/command_list/newtmgr_conn.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/command_list/newtmgr_conn.rst 
b/docs/command_list/newtmgr_conn.rst
index 23c1ab9..b75cab1 100644
--- a/docs/command_list/newtmgr_conn.rst
+++ b/docs/command_list/newtmgr_conn.rst
@@ -67,7 +67,7 @@ The var-names are: ``type``, and ``connstring``. The valid 
values for each var-n
 * ``baud``: (Optional) A number that specifies the buad rate for the 
connection. Defaults to **115200** if the
   attribute is not specified.
 
-Example: ``connstring="dev=/dev/ttyUSB0, baud=9600"``
+Example: ``connstring="dev=/dev/ttyUSB0,baud=9600"``
 **Note:** The 1.0 format, which only requires a serial port name, is still 
supported. For example, ``connstring=/dev/ttyUSB0``.
 
   - **udp** and **oic_udp**: The peer ip address and port number that the 
newtmgr or oicmgr on the remote device is



[GitHub] [mynewt-newtmgr] ccollins476ad merged pull request #163: Remove illegal space

2020-06-02 Thread GitBox


ccollins476ad merged pull request #163:
URL: https://github.com/apache/mynewt-newtmgr/pull/163


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-mcumgr] utzig commented on a change in pull request #81: cmd/os_mgmt/port/zephyr: zephyr port os enhancement

2020-06-02 Thread GitBox


utzig commented on a change in pull request #81:
URL: https://github.com/apache/mynewt-mcumgr/pull/81#discussion_r434151755



##
File path: cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c
##
@@ -56,19 +56,36 @@ int
 os_mgmt_impl_task_info(int idx, struct os_mgmt_task_info *out_info)
 {
 const struct k_thread *thread;
+#if defined(CONFIG_INIT_STACKS) && defined(CONFIG_THREAD_STACK_INFO)
+size_t unused;
+#endif
 
 thread = zephyr_os_mgmt_task_at(idx);
 if (thread == NULL) {
 return MGMT_ERR_ENOENT;
 }
 
 *out_info = (struct os_mgmt_task_info){ 0 };
+
+#ifdef CONFIG_THREAD_NAME
+strncpy(out_info->oti_name, thread->name, OS_MGMT_TASK_NAME_LEN-1);
+out_info->oti_name[OS_MGMT_TASK_NAME_LEN - 1] = '\0';
+#else
 ll_to_s(thread->base.prio, sizeof out_info->oti_name, out_info->oti_name);
+#endif
+
 out_info->oti_prio = thread->base.prio;
 out_info->oti_taskid = idx;
 out_info->oti_state = thread->base.thread_state;
 #ifdef CONFIG_THREAD_STACK_INFO
 out_info->oti_stksize = thread->stack_info.size / 4;
+#ifdef CONFIG_INIT_STACKS
+if(k_thread_stack_space_get(thread, )==0){
+out_info->oti_stkusage = (thread->stack_info.size - unused)/4;
+}else{

Review comment:
   Could you fix the coding style with the missing "space" characters? eg
   
   ```
   if (k_thread_stack_space_get(thread, ) == 0) {
   out_info->oti_stkusage = (thread->stack_info.size - unused) / 4;
   } else {
   ```
   Otherwise looks good to me, ,I will merge once fixed.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-nimble] deepthits edited a comment on issue #823: Events BLE_GAP_EVENT_DISC_COMPLETE and BLE_GAP_EVENT_ADV_COMPLETE are not received

2020-06-02 Thread GitBox


deepthits edited a comment on issue #823:
URL: https://github.com/apache/mynewt-nimble/issues/823#issuecomment-637545915


   bool ble_npl_callout_is_active(struct ble_npl_callout *c)
   {
   **// TODO: seek native posix method to determine whether timer_t is 
active.
   // TODO: fix bug where one-shot timer is still active after fired.**
   return c->c_active;
   }
   
   I see the above comment, which means this is a known bug, so is there a 
solution already identified or is it being planned?
   
   In addition to the above issues wrt to Discovery and Advertising, I see 
another one which seem to be very crucial. In a particular usecase I am trying 
to connect to a device by sending ble_gap_connect(), if the device doesnt 
respond after 30s (default connection duration) it is suppose to timeout, but 
it doesnt. It tries to connect forever. This is a crucial one for us. Can 
someone help in resolving this one?



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-nimble] deepthits commented on issue #823: Events BLE_GAP_EVENT_DISC_COMPLETE and BLE_GAP_EVENT_ADV_COMPLETE are not received

2020-06-02 Thread GitBox


deepthits commented on issue #823:
URL: https://github.com/apache/mynewt-nimble/issues/823#issuecomment-637545915


   bool ble_npl_callout_is_active(struct ble_npl_callout *c)
   {
   // TODO: seek native posix method to determine whether timer_t is active.
   // TODO: fix bug where one-shot timer is still active after fired.
   return c->c_active;
   }



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[mynewt-nimble] 02/02: nimble/ll: Fix controller to host flow

2020-06-02 Thread andk
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-nimble.git

commit f8a396662d0157f268dc0fec4597352f853c56de
Author: Andrzej Kaczmarek 
AuthorDate: Mon May 25 17:05:06 2020 +0200

nimble/ll: Fix controller to host flow

We should not attempt to allocate credit for data PDU in case of CRC
error because such PDU will not be handed over to LL thus we will never
get that credit back.
---
 nimble/controller/src/ble_ll_conn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nimble/controller/src/ble_ll_conn.c 
b/nimble/controller/src/ble_ll_conn.c
index a157732..cb80250 100644
--- a/nimble/controller/src/ble_ll_conn.c
+++ b/nimble/controller/src/ble_ll_conn.c
@@ -3808,7 +3808,7 @@ ble_ll_conn_rx_isr_end(uint8_t *rxbuf, struct 
ble_mbuf_hdr *rxhdr)
  * available, we don't need to allocate buffer for this packet so LL will
  * nak it.
  */
-if (ble_ll_conn_cth_flow_is_enabled() &&
+if (alloc_rxpdu && ble_ll_conn_cth_flow_is_enabled() &&
 BLE_LL_LLID_IS_DATA(hdr_byte) && (rx_pyld_len > 0)) {
 if (ble_ll_conn_cth_flow_alloc_credit(connsm)) {
 rxhdr->rxinfo.flags |= BLE_MBUF_HDR_F_CONN_CREDIT;



[GitHub] [mynewt-nimble] andrzej-kaczmarek merged pull request #822: nimble/ll: Fix controller to host flow

2020-06-02 Thread GitBox


andrzej-kaczmarek merged pull request #822:
URL: https://github.com/apache/mynewt-nimble/pull/822


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[mynewt-nimble] 01/02: nimble/ll: Fix typo

2020-06-02 Thread andk
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-nimble.git

commit 1a4e56196dc4570959a26ba262fe8b0e7319389e
Author: Andrzej Kaczmarek 
AuthorDate: Thu May 28 12:17:01 2020 +0200

nimble/ll: Fix typo

That is actually few typos in a row ;)
---
 nimble/controller/src/ble_ll_conn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nimble/controller/src/ble_ll_conn.c 
b/nimble/controller/src/ble_ll_conn.c
index 8799ff2..a157732 100644
--- a/nimble/controller/src/ble_ll_conn.c
+++ b/nimble/controller/src/ble_ll_conn.c
@@ -2021,7 +2021,7 @@ ble_ll_conn_end(struct ble_ll_conn_sm *connsm, uint8_t 
ble_err)
 /* Remove from the active connection list */
 SLIST_REMOVE(_ble_ll_conn_active_list, connsm, ble_ll_conn_sm, act_sle);
 
-#if MYNEWT_VAL(BLE_LL_CFG_FEAT_HOST_TO_CTRL_FLOW_CONTROL)
+#if MYNEWT_VAL(BLE_LL_CFG_FEAT_CTRL_TO_HOST_FLOW_CONTROL)
 ble_ll_conn_cth_flow_free_credit(connsm, connsm->cth_flow_pending);
 #endif
 



[mynewt-nimble] branch master updated (060092a -> f8a3966)

2020-06-02 Thread andk
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-nimble.git.


from 060092a  nimble/hs: Fix flow control
 new 1a4e561  nimble/ll: Fix typo
 new f8a3966  nimble/ll: Fix controller to host flow

The 2 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:
 nimble/controller/src/ble_ll_conn.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[mynewt-nimble] branch master updated (e99e394 -> 060092a)

2020-06-02 Thread andk
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-nimble.git.


from e99e394  nimble/transport: Add 'usb' to transport choices
 add 060092a  nimble/hs: Fix flow control

No new revisions were added by this update.

Summary of changes:
 nimble/host/src/ble_hs.c   |  2 +-
 nimble/host/src/ble_hs_flow.c  | 40 ++
 nimble/host/src/ble_hs_flow_priv.h |  2 +-
 nimble/transport/emspi/src/ble_hci_emspi.c | 10 +---
 nimble/transport/uart/src/ble_hci_uart.c   |  2 --
 5 files changed, 27 insertions(+), 29 deletions(-)



[GitHub] [mynewt-nimble] andrzej-kaczmarek merged pull request #821: nimble/hs: Fix flow control

2020-06-02 Thread GitBox


andrzej-kaczmarek merged pull request #821:
URL: https://github.com/apache/mynewt-nimble/pull/821


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[mynewt-core] branch master updated (b8a9ddd -> a661241)

2020-06-02 Thread jerzy
This is an automated email from the ASF dual-hosted git repository.

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


from b8a9ddd  oic tcp4_adaptor: Don't loop if nothing to rx
 add a661241  Make OS_TICKS_PER_SEC configurable for the nRF52 family.

No new revisions were added by this update.

Summary of changes:
 hw/mcu/nordic/nrf52xxx/include/mcu/cortex_m4.h | 2 +-
 hw/mcu/nordic/nrf52xxx/syscfg.yml  | 6 ++
 2 files changed, 7 insertions(+), 1 deletion(-)



[GitHub] [mynewt-core] kasjer merged pull request #2295: Make OS_TICKS_PER_SEC configurable for the nRF52 family.

2020-06-02 Thread GitBox


kasjer merged pull request #2295:
URL: https://github.com/apache/mynewt-core/pull/2295


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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