def _send_ui(self, out_buff): ret = tbus.SendTo(self.__uirecognize_addr, out_buff) if ret != 0: LOG.error('TBus Send To UI Addr return code[{0}]'.format(ret)) return False return True
def SendMsg(self, msg): """ Serialize and send a msg to MC channel """ #msgBuff = msgpack.packb(msg) msgBuff = msg.SerializeToString() return tbus.SendTo(self.__mcAddr, msgBuff)
def _Send(self, outBuff): ret = tbus.SendTo(self.__gameRegAddr, outBuff) if ret != 0: LOG.error( 'TBus Send To UI Anuto Addr return code[{0}]'.format(ret)) return False return True
def _send(self, out_buff): ret = tbus.SendTo(self.__game_reg_addr, out_buff) if ret != 0: LOG.error( 'TBus Send To GameReg Addr return code[{0}]'.format(ret)) return False return True
def SendMsgToIOService(self, buff): """ Send the buff to IOService """ ret = tbus.SendTo(self.__IOAddr, buff) if ret != 0: LOG.debug('TBus Send To IOService return code[%s]', ret) return False return True
def SendTo(addr, buff): """ Send the buff to addr """ ret = tbus.SendTo(addr, buff) if ret != 0: LOG.debug('TBus Send To %s return code[%s]', addr, ret) return False return True
def SendTo(self, addr, buff): """ Send the buff to addr """ ret = tbus.SendTo(addr, buff) if ret != 0: LOG.debug('TBus Send To {0} return code[{1}]'.format(addr, ret)) return False return True
def SendToMC(self, buff): """ Send the buff to MC """ ret = tbus.SendTo(self.__MCAddr, buff) if ret != 0: LOG.debug('TBus Send To MC return code[{0}]'.format(ret)) return False return True
def SendMsg(self, msg, peerNode): """ Serialize and send a msg to MC channel """ peerNodeAddr = self._GetPeerNodeAddr(peerNode) if peerNodeAddr is None: self.__logger.error( 'Seed error: peer node {} address is None!'.format(peerNode)) return -1 msgBuff = msg.SerializeToString() return tbus.SendTo(peerNodeAddr, msgBuff)
def SendImageToTool(self, srcImgDict): msg = common_pb2.tagMessage() msg.eMsgID = common_pb2.MSG_SRC_IMAGE_INFO stSrcImageInfo = msg.stSrcImageInfo stSrcImageInfo.uFrameSeq = srcImgDict['frameSeq'] stSrcImageInfo.nWidth = srcImgDict['width'] stSrcImageInfo.nHeight = srcImgDict['height'] stSrcImageInfo.byImageData = srcImgDict['image'].tobytes() stSrcImageInfo.uDeviceIndex = srcImgDict['deviceIndex'] msgBuff = msg.SerializeToString() if msgBuff is None: LOG.error('create msg failed') return False ret = tbus.SendTo(self.__sdkToolAddr, msgBuff) if ret != 0: LOG.error('TBus Send To SDKTool Addr return code[%s]', ret) return False return True
def SendMsg(self, msg): #msgBuff = msgpack.packb(msg) msgBuff = msg.SerializeToString() return tbus.SendTo(self.__mcAddr, msgBuff)