Closed anders closed 7 years ago
I will have a look at this. I think the biggest Problem will be to find the mapping for the A-Table.
I think the A table should be:
" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\x00\x01\x02\x03\x04\x05\x06\a\b\t\n\v\f\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e"
I generated this using (and based on http://www.adams1.com/128table.html):
func c128TableA() string {
result := []rune{}
// first part
for i := 32; i < 96; i++ {
result = append(result, rune(i))
}
// control codes
for i := 0; i < 31; i++ {
result = append(result, rune(i))
}
return string(result)
}
func main() {
log.Printf("%q", c128TableA());
}
According to http://www.adams1.com/128table.html it should even include \x1f ?!?
Would be great if you could provide some tests. But It will not be required :) Gonna fix this asap.
Yes, you're right, I initially included \x1f but seemed like an off by one (comparing the length of the table already in your code).
I'm reading some of these Datalogic codes by hand.
enter/end programming = <Start A><FNC3>$P<CR>I<STOP>
restore EU factory config = <Start B><FNC3>$P,Ae,P<Code A><CR><STOP>
If you'd like I could write some tests for these codes. I've already noticed that these don't include a checksum and there's no way to disable that atm.
Tests would be great! I've just added the A encoding table, but the encode function must be changed too. Might take some time -.-
Hope this all works as expected. If not let me know.
Thanks, didn't expect you to work on this so quickly!
I can encode
I need to encode the string FNC3+"$P\rI", but encoding \r (carriage return) requires code 128A. Further investigation reveals this library only supports 128B and 128C. Any chance you could add 128A as well?
(FNC3+"$P\rI" is a special code to begin/end programming Datalogic-brand barcode scanners)