The "msg-pvm-code" plugin type is used to add PVM code for custom parsing logic.
Click on the "+" button in the Telematics Hub -> Plugins section to create a new plugin:
Let's define a new device plugin that will remove the position parameters (as GDPR regulations require) if the private.mode parameter is set to true (boolean value).
Note, you can add the private.mode parameter to messages using the "item-fields" plugin. Set higher priority to this plugin to ensure the private.mode parameter is already in place before our "msg-pvm-code" applies.
Translation: if the message contains private.mode parameter and it is set to true, delete the following position.* parameters.
Then we need to assign this plugin to the right devices. Go to the Plugins tab for the required device and click the "+" button:
And then you should be able to see that position.* parameters are no longer present in the new device messages when the private.mode is true. Go to the Logs & Messages tab for the given device to check:
Done.
Examples
- How to parse a string parameter as JSON with a PVM plugin?
- How to split HEX string parameter into bits with a PVM code plugin?
- How to parse position information from GPGGA NMEA sentence with a PVM plugin?
Sandbox
You are welcome to use this open source pvm plugin sandbox to experiment with plugin code.
Change log
Subscribe to the PVM code plugin change log to stay in sync with any updates.
More plugin types
Find a comprehensive list of available plugins types here.