-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Resolved a bug parsing config-supplied additional subprocess args * Additional logging of subprocess stderr * Fixed a hanging subprocess after quit
- Loading branch information
Showing
10 changed files
with
126 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Package rtlfm represents a subprocess for rtl_fm. | ||
package rtlfm | ||
|
||
import ( | ||
"os/exec" | ||
"strings" | ||
|
||
"github.com/cceremuga/ionosphere/services/config" | ||
"github.com/cceremuga/ionosphere/services/log" | ||
) | ||
|
||
// Build the Command for rtl_fm based upon config and flags. | ||
func Build(c *config.Rtl) *exec.Cmd { | ||
requiredArgs := []string{ | ||
"-f", | ||
c.Frequency, | ||
"-s", | ||
c.SampleRate, | ||
"-l", | ||
c.SquelchLevel, | ||
"-g", | ||
c.Gain, | ||
"-p", | ||
c.PpmError, | ||
} | ||
|
||
userArgs := strings.Fields(c.AdditionalFlags) | ||
args := append(requiredArgs, userArgs...) | ||
args = append(args, "-") | ||
return exec.Command(c.Path, args...) | ||
} | ||
|
||
// Start the rtl_fm subprocess. | ||
func Start(c *exec.Cmd) { | ||
c.Stderr = log.StderrLogger{} | ||
|
||
if err := c.Start(); err != nil { | ||
log.Fatalf("Error starting rtl_fm: %s", err.Error()) | ||
} | ||
|
||
log.Debug("rtl_fm initialized.") | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters