فهرست منبع

Change references of mfc-j430w to mfc-7820n

Corey Smith 4 سال پیش
والد
کامیت
544094317e
2فایلهای تغییر یافته به همراه24 افزوده شده و 46 حذف شده
  1. 23 45
      README.md
  2. 1 1
      go.mod

+ 23 - 45
README.md

@@ -1,12 +1,13 @@
-# Brother MFC-J430W WiFi scanner protocol
+# Brother MFC-7820N WiFi scanner protocol
 
 ## Reasons
 
-_Brother MFC-J430W has already scanner driver and you can download [here](https://support.brother.com/g/b/downloadtop.aspx?c=it&lang=it&prod=mfcj430w_all)_ **but that are prebuilt binary (x86/x64) and source code isn't public**. This is a problem if you want to use the scanner on ARM architecture, because if you don't have the source code of the driver you can't recompile it. Anyway this should work on every scanner that use `brscan4`, but I'm not sure.
+_Brother MFC-7820N already has a scanner driver you can download [here](https://support.brother.com/g/b/downloadtop.aspx?c=it&lang=it&prod=mfc7820n_all)_ **but that are prebuilt binary (x86/x64) and source code isn't public**. This is a problem if you want to use the scanner on ARM architecture, because if you don't have the source code of the driver you can't recompile it. Anyway this should work on every scanner that use `brscan2`, but I'm not sure.
 
 ## Scanning protocol
 
 ![protocol](./docs/protocol.png)
+![reference](https://github.com/jmesmon/brother2/blob/master/PROTO)
 
 ### Status codes
 
@@ -43,33 +44,17 @@ sendPacket(socket, request)
 
 - **GRAY64**: gray scale image
 - **CGRAY**: color image
-- **TEXT**: low resolution mode, **max output (304x434)** [not implemented]
+- **TEXT**: low resolution mode, 1 bps
 
-##### RESOLUTIONS A4
+##### RESOLUTIONS
 
 - 100x100
 - 150x150
+- 200x200
 - 300x300
 - 600x600
-- 1200x1200
-- 1200x2400
-
-##### ADF Status
-
-- 1 ADF enabled
-- 2 ADF disabled
-
-### Automatic document feeder
-
-I think this is the request to disable ADF and **scan only one page**, though It's no effective.
-
-```go
-if !adf {
-  request = []byte("\x1bD\nADF\n\x80")
-  sendPacket(socket, request)
-  readPacket(socket)
-}
-```
+- 1200x1200 **untested**
+- 1200x2400 **untested**
 
 ## Start scan
 
@@ -84,59 +69,52 @@ request = []byte(fmt.Sprintf(requestFormat, dpiX, dpiY, mode, compression, width
 ```
 
 - **R** = `X_DPI`, `Y_DPI`
-- **M** = `CGRAY` or `GRAY64`
-- **C** = `JPEG` or `RLENGTH` or `NONE`
-- **J** = MID
+- **M** = `CGRAY`, `GRAY64`, `TEXT`
+- **C** = `JPEG` or `RLENGTH` or `NONE` **JPEG/RLENGTH UNTESTED**
+- **D** = SIN
 - **B** = 50 (Brightness?)
 - **N** = 50 (Contrast?)
 - **A** = 0,0,`WIDTH`, `HEIGHT`
 
-**NOTE**: `WIDTH` and `HEIGHT` are calculated from plane dimensions because _width_ received from response in [lease phase](#lease) is different from _width calculated_
-
-```go
-func mmToPixels(mm int, dpi int) int {
-  return int(float32(mm*dpi) / scanner.mmInch)
-}
-```
-
-Documentation work in progress...
-
 ## Compile
 
 ```bash
-git clone https://github.com/v0lp3/mfc-j430w.git
-go build -o mfc-j430w mfc-j430w/src/*.go
+git clone https://github.com/corsmith/mfc-7820n.git
+go build -o mfc-7820n mfc-7820n/src/*.go
 ```
 
 ## Usage
 
 ```bash
-./mfc-j430w --help
+./mfc-7820n --help
 ```
 
 Output:
 
 ```bash
-Usage of ./mfc-j430w:
+Usage of ./mfc-7820n:
   -a string
         IP address of the Brother scanner (default "192.168.0.157")
   -c string
-        Color mode of the scan (CGRAY, GRAY64) (default "CGRAY")
+        Color mode of the scan (CGRAY, GRAY64, TEXT) (default "CGRAY")
   -m    Enable scan of all pages from feeder
   -n string
-        Name of the output file (default "scan.jpg")
+        Name of the output file (default "scan.tiff")
   -r int
         Resolution of the scan (default 300)
+  -i string
+	Name of the raw input file to parse instead of connecting to the printer
 ```
 
 ## To do
 
-- [x] Implement multi page scan for ADF
-- [ ] Improve ADF scan with multithread
-- [ ] Add flag to output compressed image
+- [ ] Implement multi page scan for ADF
+- [ ] Implement CGRAY decoding
+- [ ] Implement GRAY64 decoding
 
 ## Credits
 
+[Corey Smith](https://github.com/corsmith)
 [Andrea Maugeri](https://github.com/v0lp3)
 
 Partially thanks to [this](https://github.com/davidar/mfc7400c/)

+ 1 - 1
go.mod

@@ -1,3 +1,3 @@
-module github.com/v0lp3/mfc_j430w
+module github.com/corsmith/mfc-7820n
 
 go 1.17