Confusing parameters and return values descriptions
There are slightly confusing comments above functions declarations all over drivers JS code describing types of parameters and return values. For example this function doesn't return string type but iqrf.DpaRawHdpMessage object.
/* Function: iqrf.sensor.Enumerate_Request
Encodes DPA request to enumerate sensors.
Returns:
string: DPA request string.
*/
iqrf.sensor.Enumerate_Request = function ()
{
return new iqrf.DpaRawHdpMessage( iqrf.sensor.PNUM, '3e' );
};
Similarly this function doesn't expect response as string type but iqrf.DpaRawHdpMessage object.
/* Function: iqrf.sensor.Enumerate_Response
Decodes DPA response from sensor enumeration.
Parameters:
response - string: DPA response string.
Returns:
array: Array of objects describing each sensor. The object has the following fields:
* type - number: Value type of the sensor (quantity). See IQRF Sensor standard for details.
* name - string: Name of the sensor (quantity).
* shortName - string: Short name of the sensor (quantity). Typically it is a symbol used at physics.
* unit - string: Unit of the quantity. Dimensionless quantity has empty string "".
* frcs - array: Array of FRC commands supported by the sensor.
* breakdown - array: [optional] see <iqrf.sensor.ReadSensorsWithTypes_Response> for more information.
*/
iqrf.sensor.Enumerate_Response = function ( response )
{
//....
};