User callback function for handling PPS data
function dataListener(fd, data) { //user implementation }
Argument | Type | Description |
---|---|---|
fd | Integer | A file descriptor returned by ppsService.open(). Required. |
data | JSON | PPS data that comes in JSON object format. Required. |
The user implements the dataListener() callback function to handle PPS data. The function receives PPS data as the consequence of ppsService method calls to read() or watch().
The PPS data is always in JSON object format. The exact structure of the JSON object depends on whether the PPS object was opened with the native pathname open option (i.e. either ?native or ?ppsService.OPTION_NATIVE). If the native option was specified, then the format of the JSON object is {"#rawdata","pps_string"}, where pps_string is a string representation of native PPS format. Otherwise, the format is pure JSON and PPS attribute-value pairs can be accessed through the JSON key-value pairs.
None.