Advertisement
Stiepen

netwerkprinter protocol

Sep 10th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. serialize this structure:
  2.  
  3. dataroot = {
  4. packetid:string
  5. type:int
  6. cmd:string
  7. data:various
  8. }
  9.  
  10. 1. init connection
  11. packetid: new packetid
  12. type: 1
  13. cmd: nil
  14. data: nil
  15.  
  16. 2. send printer command
  17. packetid: same you used for init
  18. type: 3
  19. cmd: printercommand to execute
  20. data: table which has the params for the command
  21.  
  22. 3. start actual printing:
  23. packedid: you guessed it, same you used for init
  24. type: 2
  25. cmd: nil
  26. data: nil
  27.  
  28. every command should return the result(type = 5: error, type=6: success)
  29. use timout for rednet.read() though
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement