From a0f25abbf587788b24d7a8618c2b9c25b35431fe Mon Sep 17 00:00:00 2001 From: Romain BROUCQUART <romain.broucquart@synchrotron-soleil.fr> Date: Wed, 22 Feb 2023 11:04:49 +0100 Subject: [PATCH] fix(opcua):Fix BAR, server config * Patch the .mapt file to set BAR to 0 * Add timers to xml config * fix the device name --- .../fofb-opcua-server/files/devices.dmap | 2 +- ...generic_chimeratk_server_configuration.xml | 33 ++++++++++++++----- .../fofb-opcua-server_0.1.bb | 7 +++- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/recipes-app/fofb-opcua-server/files/devices.dmap b/recipes-app/fofb-opcua-server/files/devices.dmap index 8565738..acc4126 100644 --- a/recipes-app/fofb-opcua-server/files/devices.dmap +++ b/recipes-app/fofb-opcua-server/files/devices.dmap @@ -1 +1 @@ -CNUIO (uio:axiapp?map=/opt/fofb-opcua-server/app.mapt) +APPUIO (uio:axiapp?map=/opt/fofb-opcua-server/app.mapt) diff --git a/recipes-app/fofb-opcua-server/files/generic_chimeratk_server_configuration.xml b/recipes-app/fofb-opcua-server/files/generic_chimeratk_server_configuration.xml index 39e9e5b..0edecb6 100644 --- a/recipes-app/fofb-opcua-server/files/generic_chimeratk_server_configuration.xml +++ b/recipes-app/fofb-opcua-server/files/generic_chimeratk_server_configuration.xml @@ -1,10 +1,27 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> + <configuration> - <variable name="devices" type="string"> - <value i="0" v="APP"/> - </variable> - <module name="APP"> - <variable name="triggerPath" type="string" value="/manual/trigger" /> - <variable name="pathInDevice" type="string" value="" /> - <variable name="initScript" type="string" value="" /> - </module> + + <!-- Declare devices, aliases from .dmap file --> + <variable name="devices" type="string"> + <value i="0" v="APPUIO"/> + </variable> + + <!-- Declare timers for auto refresh --> + <variable name="periodicTimers" type="string"> + <value i="0" v="secTimer"/> + </variable> + + <!-- msTimer tick every second --> + <module name="secTimer"> + <variable name="period" type="uint32" value="1000" /> + </module> + + <!-- Configure device --> + <module name="APPUIO"> + <variable name="triggerPath" type="string" value="/manual/trigger" /> + <variable name="pathInDevice" type="string" value="" /> + <variable name="initScript" type="string" value="" /> + </module> + </configuration> diff --git a/recipes-app/fofb-opcua-server/fofb-opcua-server_0.1.bb b/recipes-app/fofb-opcua-server/fofb-opcua-server_0.1.bb index 48789d8..cbb714b 100644 --- a/recipes-app/fofb-opcua-server/fofb-opcua-server_0.1.bb +++ b/recipes-app/fofb-opcua-server/fofb-opcua-server_0.1.bb @@ -12,9 +12,14 @@ RDEPENDS_${PN}=" genericdeviceserver-opcua" FILES_${PN}+="/opt/fofb-opcua-server/*" +do_compile() { + # Replace BAR by 0 + awk 'FNR>1 {$5=0} {print}' ${WORKDIR}/app.mapt > ${WORKDIR}/app_bar0.mapt +} + do_install() { install -d ${D}/opt/fofb-opcua-server/ - install -m 0644 ${WORKDIR}/app.mapt ${D}/opt/fofb-opcua-server/app.mapt + install -m 0644 ${WORKDIR}/app_bar0.mapt ${D}/opt/fofb-opcua-server/app.mapt install -m 0644 ${WORKDIR}/devices.dmap ${D}/opt/fofb-opcua-server/devices.dmap install -m 0644 ${WORKDIR}/generic_chimeratk_server_configuration.xml ${D}/opt/fofb-opcua-server/generic_chimeratk_server_configuration.xml } -- GitLab