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/01/07 20:29:04 UTC

[GitHub] [mynewt-core] utzig commented on issue #2144: OTP Tool: Support BLE Addr and HWID

utzig commented on issue #2144: OTP Tool: Support BLE Addr and HWID
URL: https://github.com/apache/mynewt-core/pull/2144#issuecomment-571757405
 
 
   I am under the impression that every function starts with:
   
   ```
       try:
           ser = serial.Serial(port=uart, baudrate=1000000, timeout=1,
                               bytesize=8, stopbits=serial.STOPBITS_ONE)
       except serial.SerialException:
           raise SystemExit("Failed to open serial port")
   
       cmd = cmd_no_payload(0xaa55aa55, Cmd.READ_HWID)
       msg = struct.pack('II', *cmd)
   
       try:
           ser.write(msg)
       except serial.SerialException:
           raise SystemExit("Failed to write to %s" % uart)
   ```
   
   where the only difference is the command used in `cmd_no_playload`, maybe a bit of refactoring for reuse?
   
   Also default baudrate of 1_000_000 looks a bit weird, but I assume you know it works! ;-)
   
   Apart from the comments, code looks fine.

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


With regards,
Apache Git Services