Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix month value for acknowledge #177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cdriks
Copy link

@cdriks cdriks commented Nov 3, 2022

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.

What does this Pull Request do

  • Fix the value of the encoded month

@cdriks cdriks mentioned this pull request Nov 3, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant