Skip to content

Commit

Permalink
Add Status to genericlinux board (#2800)
Browse files Browse the repository at this point in the history
  • Loading branch information
randhid authored Aug 18, 2023
1 parent 30b2c0a commit 43f48dc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion components/board/genericlinux/board.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ func (b *Board) GPIOPinByName(pinName string) (board.GPIOPin, error) {

// Status returns the current status of the board.
func (b *Board) Status(ctx context.Context, extra map[string]interface{}) (*commonpb.BoardStatus, error) {
return &commonpb.BoardStatus{}, nil
return board.CreateStatus(ctx, b, extra)
}

// ModelAttributes returns attributes related to the model of this board.
Expand Down
10 changes: 0 additions & 10 deletions components/board/genericlinux/board_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"testing"

"github.com/edaniels/golog"
commonpb "go.viam.com/api/common/v1"
"go.viam.com/test"

"go.viam.com/rdk/components/board"
Expand Down Expand Up @@ -102,15 +101,6 @@ func TestGenericLinux(t *testing.T) {
test.That(t, gn1, test.ShouldBeNil)
})

t.Run("test genericlinux gpio pin functionality", func(t *testing.T) {
bs, err := b.Status(ctx, nil)
test.That(t, err, test.ShouldBeNil)
test.That(t, bs, test.ShouldResemble, &commonpb.BoardStatus{})

bma := b.ModelAttributes()
test.That(t, bma, test.ShouldResemble, board.ModelAttributes{})
})

t.Run("test spi functionality", func(t *testing.T) {
spi1 := b.spis["closed"]
spi2 := b.spis["open"]
Expand Down

0 comments on commit 43f48dc

Please sign in to comment.