Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在X次执行后修改定期发送中的消息数据_Python_Can Bus_Periodic Task_Socketcan_Python Can - Fatal编程技术网

Python 在X次执行后修改定期发送中的消息数据

Python 在X次执行后修改定期发送中的消息数据,python,can-bus,periodic-task,socketcan,python-can,Python,Can Bus,Periodic Task,Socketcan,Python Can,我使用一个树莓pi和seeedstudio的can总线屏蔽。我使用socketcan和python can。我每10毫秒向can总线发送一条消息。我想在每次将消息发送到can总线时修改can消息中的数据,我该怎么做 例如: task = bus0.send_periodic(msg, 0.01) task.start() if message has been sent: msg.data[0] = 0x99 task.modify_data(msg)

我使用一个树莓pi和seeedstudio的can总线屏蔽。我使用socketcan和python can。我每10毫秒向can总线发送一条消息。我想在每次将消息发送到can总线时修改can消息中的数据,我该怎么做

例如:

task = bus0.send_periodic(msg, 0.01)
task.start()
if message has been sent:
   msg.data[0] = 0x99
   task.modify_data(msg)