Skip to content

Connecting to existing port crashes PC #119

Description

@manojbshekar

Hey I tried to open bluetooth module HC-05(com7), that has been already connected to PC.
from the code, I cannot open an already opened port. If I try to explicitly specify this COM7 (for me, at the time of development) and write to bluetooth, the bluetooth crashes. I did not dig deep in, but also the PC crashed. I am using Windows 10.

  func main() {
      c := &serial.Config{Name: "COM7", Baud: 9600, ReadTimeout: time.Millisecond * 500}
      s, err := serial.OpenPort(c)
      if err != nil {
	      log.Fatal(err)
      }
      fmt.Println("writing")
  
      n, err := s.Write([]byte("F"))
      if err != nil {
	      log.Fatal(err)
      }
      fmt.Println(n)
  }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions