You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/05/25 12:34:55 UTC

[GitHub] [mynewt-newtmgr] michal-narajowski opened a new pull request #165: Add support for Memfault commands

michal-narajowski opened a new pull request #165:
URL: https://github.com/apache/mynewt-newtmgr/pull/165


   https://memfault.com/
   
   Adds support for pulling coredump data, events and traces from
   the device.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [mynewt-newtmgr] ddavidebor commented on pull request #165: Add support for Memfault commands

Posted by GitBox <gi...@apache.org>.
ddavidebor commented on pull request #165:
URL: https://github.com/apache/mynewt-newtmgr/pull/165#issuecomment-1083077035


   Do you have some instructions on how to use the feature?
   
   On Wed, 30 Mar 2022 at 13:12, Michał Narajowski ***@***.***>
   wrote:
   
   > Hi @ddavidebor <https://github.com/ddavidebor>, I fixed mentioned in
   > @ccollins476ad <https://github.com/ccollins476ad> review. I can't test it
   > anymore though.
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/mynewt-newtmgr/pull/165#issuecomment-1083063081>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/ACFC37RMSG77NWDQYVZWR7LVCRAL5ANCNFSM4NJPWM3A>
   > .
   > You are receiving this because you were mentioned.Message ID:
   > ***@***.***>
   >
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-newtmgr] michal-narajowski commented on pull request #165: Add support for Memfault commands

Posted by GitBox <gi...@apache.org>.
michal-narajowski commented on pull request #165:
URL: https://github.com/apache/mynewt-newtmgr/pull/165#issuecomment-1083101451


   I've done some research and it looks like my PR with support for Memfault has been scrapped. The feature has now been added to memfault repo: https://github.com/memfault/memfault-firmware-sdk/tree/master/ports/mynewt. I'm not sure but maybe you could still use it with these commands.
   
   You would also need https://github.com/apache/mynewt-mcumgr/pull/84 since it implements the commands on the device side. Usage is rather simple (newtmgr memfault pull). Please refer to newtmgr docs: https://mynewt.apache.org/latest/os/modules/devmgmt/newtmgr.html


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-newtmgr] ddavidebor commented on pull request #165: Add support for Memfault commands

Posted by GitBox <gi...@apache.org>.
ddavidebor commented on pull request #165:
URL: https://github.com/apache/mynewt-newtmgr/pull/165#issuecomment-1082996268


   Hello @michal-narajowski , are you interested in progressing this PR?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [mynewt-newtmgr] michal-narajowski commented on pull request #165: Add support for Memfault commands

Posted by GitBox <gi...@apache.org>.
michal-narajowski commented on pull request #165:
URL: https://github.com/apache/mynewt-newtmgr/pull/165#issuecomment-1083063081


   Hi @ddavidebor, I fixed mentioned in @ccollins476ad review. I can't test it anymore though. 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org