本文整理汇总了Python中scapy.config.conf.BTsocket方法的典型用法代码示例。如果您正苦于以下问题:Python conf.BTsocket方法的具体用法?Python conf.BTsocket怎么用?Python conf.BTsocket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scapy.config.conf
的用法示例。
在下文中一共展示了conf.BTsocket方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: srbt
# 需要导入模块: from scapy.config import conf [as 别名]
# 或者: from scapy.config.conf import BTsocket [as 别名]
def srbt(peer, pkts, inter=0.1, *args, **kargs):
"""send and receive using a bluetooth socket"""
s = conf.BTsocket(peer=peer)
a,b = sndrcv(s,pkts,inter=inter,*args,**kargs)
s.close()
return a,b
示例2: srbt
# 需要导入模块: from scapy.config import conf [as 别名]
# 或者: from scapy.config.conf import BTsocket [as 别名]
def srbt(bt_address, pkts, inter=0.1, *args, **kargs):
"""send and receive using a bluetooth socket"""
if "port" in kargs:
s = conf.BTsocket(bt_address=bt_address, port=kargs.pop("port"))
else:
s = conf.BTsocket(bt_address=bt_address)
a, b = sndrcv(s, pkts, inter=inter, *args, **kargs)
s.close()
return a, b