@@ -210,6 +210,23 @@ static PyObject* py_hako_asset_pdu_write(PyObject*, PyObject* args) {
210210 return Py_BuildValue (" O" , Py_False);
211211 }
212212}
213+ static PyObject* py_hako_asset_pdu_create (PyObject*, PyObject* args) {
214+ const char * robo_name;
215+ HakoPduChannelIdType lchannel;
216+ size_t pdu_size;
217+
218+ if (!PyArg_ParseTuple (args, " siL" , &robo_name, &lchannel, &pdu_size)) {
219+ return NULL ;
220+ }
221+
222+ int result = hako_asset_pdu_create (robo_name, lchannel, pdu_size);
223+
224+ if (result == 0 ) {
225+ Py_RETURN_TRUE;
226+ } else {
227+ Py_RETURN_FALSE;
228+ }
229+ }
213230static PyObject* py_hako_conductor_start (PyObject*, PyObject* args) {
214231 hako_time_t delta_usec, max_delay_usec;
215232
@@ -241,6 +258,7 @@ static PyObject* py_init_for_external(PyObject*, PyObject*) {
241258static PyMethodDef hako_asset_python_methods[] = {
242259 {" asset_register" , asset_register, METH_VARARGS, " Register asset" },
243260 {" init_for_external" , py_init_for_external, METH_NOARGS, " Initialize for external" },
261+ {" pdu_create" , py_hako_asset_pdu_create, METH_VARARGS, " Create PDU data for the specified robot name and channel ID." },
244262 {" start" , py_hako_asset_start, METH_VARARGS, " Start the asset." },
245263 {" simulation_time" , py_hako_asset_simulation_time, METH_NOARGS, " Get the current simulation time." },
246264 {" usleep" , py_hako_asset_usleep, METH_VARARGS, " Sleep for the specified time in microseconds." },
0 commit comments