src.dualinventive.com/dinet/libdi-php/tests/can_send_queue.php

18 lines
433 B
PHP

<?php
/* Queue 1000 RPC message for periodic send with 100ms */
$fd = di_can_open("vcan0");
di_can_set_nodeid($fd, "00000000000000000000000000000001");
$msg = [];
$msg['msgtype'] = DI_CAN_MSGTYPE_RPC;
$msg['dtype'] = DI_RPC_TYPE_DEVICE_PING;
$msg['ttype'] = DI_CAN_TRANSFERTYPE_PUBLISH;
$msg['dst_id'] = DI_CAN_NODEID_BROADCAST;
for ($n = 0; $n < 1000; $n++)
di_can_send_queue($fd, $msg, 100);
sleep(1);
di_can_close($fd);