117 lines
2.6 KiB
Python
117 lines
2.6 KiB
Python
'''
|
|
Created on 27 set 2019
|
|
|
|
@author: Emanuele Trabattoni
|
|
'''
|
|
|
|
DEFprefix = {
|
|
'begin': '\x1b', #ESC
|
|
'end': '\r'
|
|
}
|
|
|
|
MKPcommands = {
|
|
'handshake': {
|
|
'defPrefix': True,
|
|
'command': '*',
|
|
'success': 'Ok\r',
|
|
'error': None
|
|
},
|
|
'reset': {
|
|
'defPrefix': True,
|
|
'command': 'RST',
|
|
'success': 'Ok\r',
|
|
'error': None,
|
|
},
|
|
'deleteMemory': {
|
|
'defPrefix': True,
|
|
'command': 'C',
|
|
'success': None,
|
|
'error': None
|
|
},
|
|
'printPause': {
|
|
'defPrefix': True,
|
|
'command': 'C0',
|
|
'success': 'Ok\r',
|
|
'error': None,
|
|
},
|
|
'printStart': {
|
|
'defPrefix': True,
|
|
'command': 'C1',
|
|
'success': 'Ok\r',
|
|
'error': None,
|
|
},
|
|
'callPrintImage': {
|
|
'defPrefix': False,
|
|
'begin': '\x02', #STX
|
|
'end': '\x03', #ETX
|
|
'command': 'TZ',
|
|
'success': '\x06\x02([0-9])OK\x03',
|
|
'error': '([0-9])E([0-9])',
|
|
'args': ['imageName', 'printMode']
|
|
},
|
|
'sendImage': {
|
|
'defPrefix': True,
|
|
'command': 'EW----;',
|
|
'success': None,
|
|
'error': None,
|
|
'args': ['imageName']
|
|
},
|
|
'sendImageEnd': {
|
|
'defPrefix': True,
|
|
'command': 'EX----;',
|
|
'success': 'OK\r',
|
|
'error': None,
|
|
},
|
|
'receiveImage': {
|
|
'defPrefix': True,
|
|
'command': 'EL----;',
|
|
'success': True,
|
|
'error': None
|
|
},
|
|
'receiveDir': {
|
|
'defPrefix': True,
|
|
'command': 'ED----;',
|
|
'success': True,
|
|
'error': None
|
|
},
|
|
'deleteImage': {
|
|
'defPrefix': True,
|
|
'command': 'EQ----;',
|
|
'success': 'OK\r',
|
|
'error': 'Err\r',
|
|
'args': ['imageName']
|
|
},
|
|
'sendDate': {
|
|
'defPrefix': True,
|
|
'command': '*STD',
|
|
'success': 'Ok\r',
|
|
'error': 'Err\r',
|
|
'args': ['dateTime','offset']
|
|
},
|
|
'receiveDate': {
|
|
'defPrefix': True,
|
|
'command': '*GSTD',
|
|
'success': True,
|
|
'error': None,
|
|
'args': ['dateTime']
|
|
},
|
|
'status': {
|
|
'defPrefix': True,
|
|
'command': 'SV',
|
|
'success': True,
|
|
'error': None
|
|
},
|
|
'status1': {
|
|
'defPrefix': True,
|
|
'command': 'S1',
|
|
'success': True,
|
|
'error': None
|
|
},
|
|
'status2': {
|
|
'defPrefix': True,
|
|
'command': 'S2',
|
|
'success': True,
|
|
'error': None
|
|
},
|
|
}
|