Skip to content
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

Only remove elements matching the id we're throwing out #25

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

LandryNorris
Copy link
Contributor

@LandryNorris LandryNorris commented Mar 25, 2024

We shouldn't clear all frames, just the one we wanted to, when setting interval to -1

@LandryNorris
Copy link
Contributor Author

Tested with the following ts:

console.log("Starting CAN Message")
CanBridge.sendCANMessage(descriptor, 0xCBA321, [0x12, 0x34, 0x56, 0x78], 150)
await new Promise((resolve) => setTimeout(resolve, 2000));

console.log("Starting second message")
CanBridge.sendCANMessage(descriptor, 0xABC321, [0x12, 0x34, 0x56, 0x78], 100)
await new Promise((resolve) => setTimeout(resolve, 2000));

console.log("Stopping non-existent")
CanBridge.sendCANMessage(descriptor, 0x1234, [0x12, 0x34, 0x56, 0x78], -1)
await new Promise((resolve) => setTimeout(resolve, 2000));

console.log("Starting third message")
CanBridge.sendCANMessage(descriptor, 0x1234, [0x12, 0x34, 0x56, 0x78], 100)
await new Promise((resolve) => setTimeout(resolve, 2000));

console.log("Stopping existing")
CanBridge.sendCANMessage(descriptor, 0xABC321, [0x12, 0x34, 0x56, 0x78], -1)
await new Promise((resolve) => setTimeout(resolve, 2000));

@LandryNorris LandryNorris merged commit 185ba56 into main Mar 25, 2024
1 check passed
@LandryNorris LandryNorris deleted the fix/dont-clear-all-frames branch March 25, 2024 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants