From 9da61a967c4b599efbf4b606462951b00bfa5faa Mon Sep 17 00:00:00 2001 From: Amin Saedi Date: Tue, 4 Jun 2024 01:29:36 -0400 Subject: [PATCH 1/2] fix: Added delay to make sure that device is ready --- pkg/v2/command/command.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/v2/command/command.go b/pkg/v2/command/command.go index eb6d508..3100258 100644 --- a/pkg/v2/command/command.go +++ b/pkg/v2/command/command.go @@ -51,7 +51,6 @@ type RemoteData struct { // recreate a complete protobuf message from multiple chunks // each new message is sent to handleData func (c *Command) processData(read_size int, size_to_read int, buffer *[]byte, total_data *[]byte) int { - if read_size < size_to_read { // not enough data size_to_read -= read_size @@ -154,6 +153,9 @@ func (c *Command) Connect() error { c.sendConfiguration() + // wait for the device to be ready + time.Sleep(time.Millisecond * 100) + return nil } From 6893c7fd5662ecf4855f88aa6fcfb0366c81ec04 Mon Sep 17 00:00:00 2001 From: Amin Saedi Date: Wed, 5 Jun 2024 00:26:29 -0400 Subject: [PATCH 2/2] fix: Increased delay to make sure that device is ready --- pkg/v2/command/command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/v2/command/command.go b/pkg/v2/command/command.go index 3100258..07b5f0f 100644 --- a/pkg/v2/command/command.go +++ b/pkg/v2/command/command.go @@ -154,7 +154,7 @@ func (c *Command) Connect() error { c.sendConfiguration() // wait for the device to be ready - time.Sleep(time.Millisecond * 100) + time.Sleep(time.Millisecond * 500) return nil }