Skip to content

acknowledgeAlarm - Wrong timestamp #174

@cdriks

Description

@cdriks

Node Version: 0.0.1-beta.14

Node BACstack Version: 18.9.0

  • Bug Report
  • Feature Request
  • Question

Current Behaviour (Bug Report)

Hi,
The acknowledgeAlarm method doesn't work properly with the timestamps. I receive an error class 5 (services) and an error code 14 (invalid-time-stamp), or an error code 7 (inconsistent-parameters).

Steps to reproduce Issue (Bug Report)

If I send following acknowledge command :

client.acknowledgeAlarm('10.10.10.10', { type: 0, instance: 18 }, 2, 'BACnet', { value: new Date("2022-09-27 14:53:25.20"), type: 2 }, { value: new Date(), type: 2 }, { invokeId: 54 }, (err, value) => {
        console.log(err)
})

I can see into Wireshark following telegramm:

Building Automation and Control Network APDU\
    0000 .... = APDU Type: Confirmed-REQ (0)
    .... 0000 = PDU Flags: 0x0
    .111 .... = Max Response Segments accepted: Greater than 64 segments (7)
    .... 0101 = Size of Maximum ADPU accepted: Up to 1476 octets (fits in an ISO 8802-3 frame) (5)
    Invoke ID: 54
    Service Choice: acknowledgeAlarm (0)
    acknowledging Process Id: (Unsigned) 81001
    ObjectIdentifier: analog-input, 18
    event State Acknowledged:  offnormal (2)
    {[3]
    {[2]
    date time: 
        Date: August 27, 2022, (Day of Week = Tuesday)
        Time: 2:53:25.20 P.M. = 14:53:25.20
    }[2]
    }[3]
    acknowledgement Source: UTF-8 'BACnet'
    {[5]
    {[2]
    acknowledgement timestamp: 
        Date: August 27, 2022, (Day of Week = Tuesday)
        Time: 3:08:02.2 P.M. = 15:08:02.2
    }[2]
    }[5]

Where the timestamps are wrong : August instead of September.

If I try to "cheat", and manually change the month, the day of week is not correct anymore.

Suggested correction

asn1.js, line 316

Increment the month :

buffer.buffer[buffer.offset++] = value.getMonth() + 1;

Thanks in advance!

Cédric

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions