Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Fix zone checks #1

Open
JanSimek opened this issue Jun 8, 2016 · 0 comments
Open

Fix zone checks #1

JanSimek opened this issue Jun 8, 2016 · 0 comments
Labels
Milestone

Comments

@JanSimek
Copy link
Owner

JanSimek commented Jun 8, 2016

Currently, we check only 128 zones for zone violation, so this works on Integra 128, but other models support varying number of zones... 32, 64, 128, so we need to check zone number based on the model type.

for ($i = 0; $i < 16; $i++) {
    for ($b = 0; $b < 8; $b++) {
        if (pow(2, $b) & hexdec(bin2hex($raw[$i+3]))) { // 0xFE 0xFE 0x00 ..
            $number = 8 * $i + $b + 1;
            // TODO: self::PARTITION, self::OUTPUT, etc.
            $violated[$number] = $this->sendCommand("EE" . self::ZONEX . sprintf("%02s", dechex($number)));
        }
    }
}
@JanSimek JanSimek added the bug label Jun 8, 2016
@JanSimek JanSimek added this to the v1.0 milestone Jun 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant