Skip to content

feat: remove bufferAlgorithm param from the open command #1002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
aff40ab
WIP: print to understand
dido18 Jan 10, 2025
bae632a
refactor: remove unused Bufferflow implementations and simplify buffe…
dido18 Jan 10, 2025
818f79f
refactor: simplify serial test functions by removing unused parameters
dido18 Jan 10, 2025
baf2ff4
fix(ci): update package installation command to use correct version o…
dido18 Jan 10, 2025
e63527a
fix(ci): update libwebkit2gtk version in dependency installation
dido18 Jan 10, 2025
98b6376
fix: remove unused buffer slice and simplify data reading in serial port
dido18 Jan 10, 2025
0ce39a5
small changes
dido18 Jan 10, 2025
ec5049d
fix: remove debug print statement from wsHandler function
dido18 Jan 13, 2025
2fe3c28
fix: add warning log for unexpected arguments in open command
dido18 Jan 13, 2025
1849a1c
Update hub.go
dido18 Jan 13, 2025
294de02
fix: update log message for buffer flow initialization
dido18 Jan 14, 2025
99a31e6
fix: update log message for clarity in buffer flow initialization
dido18 Jan 14, 2025
2308b5f
fix: ignore all tags in check-certificates workflow on push
dido18 Jan 14, 2025
8688ec6
fix: update macOS-13 version in publish-go-tester-task workflow
dido18 Jan 14, 2025
894c139
fix(release): add Go installation step in release workflow
dido18 Jan 14, 2025
3a34186
fix: correct JSON formatting in broadcast message for port registration
dido18 Jan 16, 2025
62e324b
Merge branch 'main' into remove-open-not-used-buffer-algorithm
dido18 Jan 17, 2025
c042f10
fix: update application identity in release workflow to use Massimo B…
dido18 Jan 20, 2025
43bd6ea
resolve conflict
dido18 Jan 21, 2025
8f5fa3b
revert application_identity
dido18 Jan 21, 2025
6684e7c
ci: remove tags-ignore from check-certificates workflow
dido18 Jan 21, 2025
fb39e25
Merge branch 'main' into remove-open-not-used-buffer-algorithm
dido18 Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/check-certificates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
push:
paths:
- ".github/workflows/check-certificates.ya?ml"
tags-ignore:
- '*'
pull_request:
paths:
- ".github/workflows/check-certificates.ya?ml"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-go-tester-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
#use the strategy instead because we still use the native build
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-12]
os: [ubuntu-20.04, windows-2019, macos-13]
arch: [-amd64]
include:
- os: windows-2019
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
prerelease: ${{ steps.prerelease.outputs.IS_PRE }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-12]
os: [ubuntu-20.04, windows-2019, macos-13]
arch: [amd64]
include:
- os: windows-2019
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
run: |
task go:build
mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_amd64
if: matrix.os == 'macos-12'
if: matrix.os == 'macos-13'

- name: Build the Agent for macos arm64
env:
Expand All @@ -128,13 +128,13 @@ jobs:
run: |
task go:build
mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_arm64
if: matrix.os == 'macos-12'
if: matrix.os == 'macos-13'

- name: Create universal macos executable
run: |
lipo -create -output ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_amd64 ${{ env.PROJECT_NAME }}_arm64
rm ${{ env.PROJECT_NAME }}_amd64 ${{ env.PROJECT_NAME }}_arm64
if: matrix.os == 'macos-12'
if: matrix.os == 'macos-13'

# this will create `public/` dir with compressed full bin (<version>/<os>-<arch>.gz) and a json file
- name: Create autoupdate files
Expand All @@ -146,7 +146,7 @@ jobs:
run: |
cp darwin-amd64.json darwin-arm64.json
cp ${TAG_VERSION}/darwin-amd64.gz ${TAG_VERSION}/darwin-arm64.gz
if: matrix.os == 'macos-12' && steps.prerelease.outputs.IS_PRE != 'true'
if: matrix.os == 'macos-13' && steps.prerelease.outputs.IS_PRE != 'true'

- name: Create autoupdate files for win32
run: go-selfupdate -platform windows-${{ matrix.arch }} ${{ env.PROJECT_NAME }}${{ matrix.ext }} ${TAG_VERSION}
Expand Down Expand Up @@ -181,7 +181,7 @@ jobs:
matrix:
arch: [amd64, arm64]

runs-on: macos-12
runs-on: macos-13
env:
EXE_PATH: "skel/ArduinoCloudAgent.app/Contents/MacOS/"

Expand All @@ -195,7 +195,7 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}-macos-12-amd64 # if we want to support darwin-arm64 in the future for real this has to change.
name: ${{ env.PROJECT_NAME }}-macos-13-amd64 # if we want to support darwin-arm64 in the future for real this has to change.
path: ${{ env.EXE_PATH }}

- name: Remove placeholder file
Expand Down Expand Up @@ -252,7 +252,7 @@ jobs:
matrix:
arch: [amd64, arm64]

runs-on: macos-12
runs-on: macos-13
env:
GON_PATH: ${{ github.workspace }}/gon
needs: [build, create-macos-bundle]
Expand Down Expand Up @@ -286,6 +286,11 @@ jobs:
-k "${{ env.KEYCHAIN_PASSWORD }}" \
"${{ env.KEYCHAIN }}"

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install gon for code signing
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -509,7 +514,7 @@ jobs:
matrix:
arch: [amd64]

runs-on: macos-12
runs-on: macos-13
steps:
- name: Checkout repo with icons/background
uses: actions/checkout@v4
Expand Down
23 changes: 0 additions & 23 deletions bufferflow.go

This file was deleted.

72 changes: 0 additions & 72 deletions bufferflow_default.go

This file was deleted.

6 changes: 3 additions & 3 deletions bufferflow_timed.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ type BufferflowTimed struct {
bufferedOutput string
}

// NewBufferflowTimed will create a new timed bufferflow
func NewBufferflowTimed(port string, output chan<- []byte) *BufferflowTimed {
// NewBufferFlowTimed will create a new timed bufferflow
func NewBufferFlowTimed(port string, output chan<- []byte) *BufferflowTimed {
return &BufferflowTimed{
port: port,
output: output,
Expand All @@ -48,7 +48,7 @@ func NewBufferflowTimed(port string, output chan<- []byte) *BufferflowTimed {

// Init will initialize the bufferflow
func (b *BufferflowTimed) Init() {
log.Println("Initting timed buffer flow (output once every 16ms)")
log.Println("Start consuming from serial port (output once every 16ms)")
go b.consumeInput()
}

Expand Down
89 changes: 0 additions & 89 deletions bufferflow_timedraw.go

This file was deleted.

14 changes: 6 additions & 8 deletions hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var h = hub{
const commands = `{
"Commands": [
"list",
"open <portName> <baud> [bufferAlgorithm: ({default}, timed, timedraw)]",
"open <portName> <baud>",
"(send, sendnobuf, sendraw) <portName> <cmd>",
"close <portName>",
"restart",
Expand Down Expand Up @@ -146,15 +146,13 @@ func checkCmd(m []byte) {
go spErr("Problem converting baud rate " + args[2])
return
}
// pass in buffer type now as string. if user does not
// ask for a buffer type pass in empty string
bufferAlgorithm := "default" // use the default buffer if none is specified

// Ignore extra "buffer type" param for backward compatibility
if len(args) > 3 {
// cool. we got a buffer type request
buftype := strings.Replace(args[3], "\n", "", -1)
bufferAlgorithm = buftype
log.Warn(fmt.Sprintf("Unexpected arguments for the open command. Ignored arguments: '%s'.", args[3:]))
}
go spHandlerOpen(args[1], baud, bufferAlgorithm)

go spHandlerOpen(args[1], baud)

} else if strings.HasPrefix(sl, "close") {

Expand Down
2 changes: 1 addition & 1 deletion serial.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var sh = serialhub{
func (sh *serialhub) Register(port *serport) {
sh.mu.Lock()
//log.Print("Registering a port: ", p.portConf.Name)
h.broadcastSys <- []byte("{\"Cmd\":\"Open\",\"Desc\":\"Got register/open on port.\",\"Port\":\"" + port.portConf.Name + "\",\"Baud\":" + strconv.Itoa(port.portConf.Baud) + ",\"BufferType\":\"" + port.BufferType + "\"}")
h.broadcastSys <- []byte("{\"Cmd\":\"Open\",\"Desc\":\"Got register/open on port.\",\"Port\":\"" + port.portConf.Name + "\",\"Baud\":" + strconv.Itoa(port.portConf.Baud) + "\"}")
sh.ports[port] = true
sh.mu.Unlock()
}
Expand Down
Loading
Loading