本文整理汇总了Python中pandac.PandaModules.NetDatagram.appendData方法的典型用法代码示例。如果您正苦于以下问题:Python NetDatagram.appendData方法的具体用法?Python NetDatagram.appendData怎么用?Python NetDatagram.appendData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandac.PandaModules.NetDatagram
的用法示例。
在下文中一共展示了NetDatagram.appendData方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: eVV_VP_ACK_FAILED
# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_VP_ACK_FAILED(ip, port):
packet = SocketPacket()
packet.add_int(VV_VP_ACK_FAILED)
packet.add_string(ip)
packet.add_int(port)
packet.encode_header()
datagram = NetDatagram()
datagram.appendData('' + packet.get_header() + packet.get_body())
return datagram
示例2: SendPacket
# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def SendPacket(rpc, addr):
global pq
chance = random.random()
p = rpc.CreateNewPacket(addr)
rpc.SendPacket(p, addr)
nd = NetDatagram()
nd.appendData(p.GetDatagram().getMessage())#, p.GetDatagram().getLength())
nd.setAddress(NetAddress())
if(chance < 0.8):
pq.append(nd)
return nd
示例3: eVV_ACK_OK
# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_ACK_OK(ip, port, client_id):
packet = SocketPacket()
packet.add_int(VV_ACK_OK)
packet.add_string(ip)
packet.add_int(port)
packet.add_int(client_id)
packet.encode_header()
datagram = NetDatagram()
datagram.appendData('' + packet.get_header() + packet.get_body())
return datagram
示例4: eVV_READY
# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_READY(ip, port, vv_id):
packet = SocketPacket()
packet.add_int(VV_READY)
packet.add_string(ip)
packet.add_int(port)
packet.add_int(vv_id)
packet.encode_header()
datagram = NetDatagram()
datagram.appendData('' + packet.get_header() + packet.get_body())
return datagram
示例5: eVV_REQ_SIGNATURE
# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_REQ_SIGNATURE(ip, port, object_id):
packet = SocketPacket()
packet.add_int(VV_REQ_SIGNATURE)
packet.add_string(ip)
packet.add_int(port)
packet.add_int(object_id)
packet.encode_header()
datagram = NetDatagram()
datagram.appendData('' + packet.get_header() + packet.get_body())
return datagram
示例6: eVV_VP_ACK_OK
# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_VP_ACK_OK(ip, port, cam_id):
packet = SocketPacket()
packet.add_int(VV_VP_ACK_OK)
packet.add_string(ip)
packet.add_int(port)
packet.add_int(cam_id) ## Added this
packet.encode_header()
datagram = NetDatagram()
datagram.appendData("" + packet.get_header() + packet.get_body())
return datagram
示例7: eVV_CAM_MESSAGE
# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_CAM_MESSAGE(ip, port, cam_id, message):
packet = SocketPacket()
packet.add_int(VV_CAM_MESSAGE)
packet.add_string(ip)
packet.add_int(port)
packet.add_int(cam_id)
packet.add_packet(message)
packet.encode_header()
datagram = NetDatagram()
datagram.appendData('' + packet.get_header() + packet.get_body())
return datagram
示例8: eVV_CAM_LIST
# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_CAM_LIST(ip, port, cam_list):
packet = SocketPacket()
packet.add_int(VV_CAM_LIST)
packet.add_string(ip)
packet.add_int(port)
packet.add_int(len(cam_list))
for cam in cam_list:
packet.add_int(cam)
packet.encode_header()
datagram = NetDatagram()
datagram.appendData('' + packet.get_header() + packet.get_body())
return datagram
示例9: eVV_REQ_VIDEO_ANALYSIS
# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_REQ_VIDEO_ANALYSIS(ip, port, cam_id, width, height, jpeg):
packet = SocketPacket()
packet.add_int(VV_REQ_VIDEO_ANALYSIS)
packet.add_string(ip)
packet.add_int(port)
packet.add_int(cam_id)
packet.add_int(width)
packet.add_int(height)
packet.add_int(jpeg)
packet.encode_header()
datagram = NetDatagram()
datagram.appendData('' + packet.get_header() + packet.get_body())
return datagram
示例10: eVV_TRACK_SIGNATURE
# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_TRACK_SIGNATURE(ip, port, object_id, feature_str, sig):
packet = SocketPacket()
packet.add_int(VV_TRACK_SIGNATURE)
packet.add_string(ip)
packet.add_int(port)
packet.add_int(object_id)
packet.add_string(feature_str)
packet.add_int(len(sig))
for element in sig:
packet.add_float(element)
packet.encode_header()
datagram = NetDatagram()
datagram.appendData('' + packet.get_header() + packet.get_body())
return datagram
示例11: eVV_IMG
# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_IMG(ip, port, cam_id, width, height, depth, color_code, jpeg, timestamp, image_data):
packet = SocketPacket()
packet.add_int(VV_IMG)
packet.add_string(ip)
packet.add_int(port)
packet.add_int(cam_id)
packet.add_int(width)
packet.add_int(height)
packet.add_int(depth)
packet.add_char(color_code)
packet.add_bool(jpeg)
packet.add_double(timestamp)
packet.add_string(image_data)
packet.encode_header()
datagram = NetDatagram()
datagram.appendData("" + packet.get_header() + packet.get_body())
return datagram
示例12: eVV_ADV_CAM_LIST
# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_ADV_CAM_LIST(ip, port, cam_list):
packet = SocketPacket()
packet.add_int(VV_ADV_CAM_LIST)
packet.add_string(ip)
packet.add_int(port)
packet.add_int(len(cam_list))
for camera in cam_list:
id = camera.getId()
type = camera.getType()
position = camera.getPosition()
direction = camera.getDirection()
packet.add_int(id)
packet.add_int(type)
packet.add_float(position[0])
packet.add_float(position[1])
packet.add_float(position[2])
packet.add_float(direction[0])
packet.add_float(direction[1])
packet.add_float(direction[2])
packet.encode_header()
datagram = NetDatagram()
datagram.appendData('' + packet.get_header() + packet.get_body())
return datagram