/[anoncvs]/projects/dispense2/sql-edition/servers/VendingMachine.py


UCC Code Repository

Diff of /projects/dispense2/sql-edition/servers/VendingMachine.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by zanchey, Sat Apr 9 03:29:12 2011 UTC revision 1.24 by tpg, Sat Jan 12 14:43:49 2013 UTC
# Line 116  class VendingMachine: Line 116  class VendingMachine:
116                          logging.warning('Unhandled event! (%s %s)\n'%(code,text))                          logging.warning('Unhandled event! (%s %s)\n'%(code,text))
117    
118          def authed_message(self, message):          def authed_message(self, message):
119                    print 'self.challenge = %04x' % self.challenge
120                  if self.challenge == None:                  if self.challenge == None:
121                          return message                          return message
122                  crc = do_crc('%c%c'%(self.challenge >> 8, self.challenge & 0xff))                  crc = do_crc('%c%c'%(self.challenge >> 8, self.challenge & 0xff))
123                  crc = do_crc(self.secret, crc)                  crc = do_crc(self.secret, crc)
124                  crc = do_crc(message, crc)                  crc = do_crc(message, crc)
125                    print 'output = "%s|%04x"' % (message, crc)
126                  return message+'|'+('%04x'%crc)                  return message+'|'+('%04x'%crc)
127    
128          def ping(self):          def ping(self):

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26