forked from pd0mz/go-dmr
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
889 additions
and
28,272 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.pdf filter=lfs diff=lfs merge=lfs -text |
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 |
---|---|---|
@@ -1,2 +1,32 @@ | ||
# dmr | ||
Golang Digital Mobile Radio protocols | ||
# go-dmr | ||
|
||
Golang Digital Mobile Radio protocols. | ||
|
||
## References | ||
|
||
The DMR Air Interface protocol is specified in *Electromagnetic compatibility | ||
and Radio spectrum Matters (ERM); Digital Mobile Radio (DMR) Systems; Part 1: | ||
DMR Air Interface (AI) protocol*, [ETSI TS 102 361-1][ETSI TS 102 361-1]. | ||
|
||
The Brandmeister Homebrew protocol is specified in | ||
[IPSC Protocol Specs for homebrew DMR repeater][homebrew specs] | ||
by [Hans DL5DI](mailto:[email protected]), | ||
[Jonathan Naylor (G4KLXG)](https://twitter.com/g4klx) and Torsten Schultze | ||
(DG1HT). | ||
|
||
[ETSI TS 102 361-1]: docs/ts_10236101v010405p.pdf | ||
[homebrew specs]: docs/DMRplus%20IPSC%20Protocol%20for%20HB%20repeater%20(20150726).pdf | ||
|
||
## Warning | ||
|
||
This implementation is not suitable for commercial use and is for educational | ||
purposes only. | ||
|
||
## Acknowledgements | ||
|
||
The implementation is possible because of the invaluable help from the | ||
following persons. Thanks for your patience and providing me with sample data | ||
and links to test the protocols. | ||
|
||
* Rudy Hardeman (PD0ZRY) | ||
* Artem Prilutskiy (R3ABM) |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,31 +1,39 @@ | ||
package bit | ||
package dmr | ||
|
||
import "testing" | ||
import ( | ||
"bytes" | ||
"testing" | ||
) | ||
|
||
func TestBit(t *testing.T) { | ||
var tests = []struct { | ||
Test []byte | ||
Want Bits | ||
Want []byte | ||
}{ | ||
{ | ||
[]byte{0x2a}, | ||
Bits{0, 0, 1, 0, 1, 0, 1, 0}, | ||
[]byte{0, 0, 1, 0, 1, 0, 1, 0}, | ||
}, | ||
{ | ||
[]byte{0xbe, 0xef}, | ||
Bits{1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1}, | ||
[]byte{1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1}, | ||
}, | ||
} | ||
|
||
for _, test := range tests { | ||
got := NewBits(test.Test) | ||
got := BytesToBits(test.Test) | ||
if len(got) != len(test.Want) { | ||
t.Fatalf("expected length %d, got %d [%s]", len(test.Want), len(got), got.String()) | ||
t.Fatalf("expected length %d, got %d [%s]", len(test.Want), len(got), string(got)) | ||
} | ||
for i, b := range got { | ||
if b != test.Want[i] { | ||
t.Fatalf("bit %d is off: %v != %v", i, got, test.Want) | ||
} | ||
} | ||
|
||
rev := BitsToBytes(got) | ||
if !bytes.Equal(rev, test.Test) { | ||
t.Fatalf("reverse bits to bytes failed, %v != %v", rev, test.Test) | ||
} | ||
} | ||
} |
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
Oops, something went wrong.