-
Notifications
You must be signed in to change notification settings - Fork 103
Open
Description
Node Version: 18.19.0
Node BACstack Version: 0.0.1-beta.14
- Bug Report
- Feature Request
- Question
Hi.
I am making a Bacnet server for an IoT application.
I am having problems with the return of the Objects list. The client (YABE) always responds with “Could not read the ‘Object List’ count”.
How should I respond to the OBJECT_LIST request?
Here my test code:
server.on('readProperty', (request, remoteAddress) => {
console.log('Received "readProperty" ');
console.log(request);
const objectId = request.request.objectId;
const propertyId = request.request.property.id;
// Lectura del DEVICE
//if (objectId.type==8 && propertyId==bacnet.enum.PropertyIdentifier.OBJECT_LIST)
if (propertyId === bacnet.enum.PropertyIdentifier.OBJECT_LIST)
{
console.log("Generando Lista de Objetos....");
const objectsTable = {
'0': { type: bacnet.enum.ObjectType.ANALOG_INPUT },
'1': { type: bacnet.enum.ObjectType.ANALOG_OUTPUT },
// Add more object if necessari.
};
const bac_obj_list = Object.keys(objectsTable).map(instance => ({
type: bacnet.enum.ApplicationTags.OBJECTIDENTIFIER,
value: {type: objectsTable[instance].type, instance: parseInt(instance, 10)}
}));
console.log("ObjectList: ", bac_obj_list);
// server.readPropertyResponse(request.address, request.invokeId, objectId, propertyId, [
// {value: bac_obj_list, type: bacnet.enum.ApplicationTags.OBJECTIDENTIFIER}
// ]);
server.readPropertyResponse(request.address, request.invokeId, objectId, propertyId, bac_obj_list);
}
return;
What am I doing wrong?
Thank you very much
Metadata
Metadata
Assignees
Labels
No labels