def _post( self, msg ):
if msg.type != 'sysex':
syslog.syslog( "Err: Saw msg type: " + msg.type )
self.receive_cond.acquire()
curr_addr = msg.data[7:11]
self.addr.append( curr_addr )
curr_data = msg.data[11:-1]
self.data.append( curr_data )
# Signal the consumer if we've reached the expected number of messages.
self.chunk_count += 1
if self.chunk_count == self.target_count:
self.chunk_count = 0
self.receive_cond.notify()
self.receive_cond.release()
# Concatenate caller's prefix and message, add checksum and send
# as sysex message. Handles both store and query commands.
评论列表
文章目录