dataListener()

User callback function for handling PPS data

Signature

function dataListener(fd, data) { //user implementation }

Arguments

Argument Type Description
fd Integer A file descriptor returned by ppsService.open(). Required.
data JSON PPS data that comes in JSON object format. Required.

Description

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.

Returns

None.