Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Penguidom
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
domotika
Penguidom
Commits
d4ddef56
Commit
d4ddef56
authored
Jan 07, 2018
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start protocol support mapping
parent
8d2f0bff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
3 deletions
+62
-3
Paradox_37byte_protocol.txt
penguidom/plugins/paradox/Paradox_37byte_protocol.txt
+4
-1
paradox.py
penguidom/plugins/paradox/paradox.py
+2
-2
paradox37b.py
penguidom/plugins/paradox/paradox37b.py
+56
-0
No files found.
penguidom/plugins/paradox/Paradox_37byte_protocol.txt
View file @
d4ddef56
Byte Value Description
Byte Value Description
00 0xE
0
High Nibble : Command
00 0xE
X
High Nibble : Command
Low Nibble : Bit 3 - Event Report Enable (0) / Disable (1)
Low Nibble : Bit 3 - Event Report Enable (0) / Disable (1)
Bit 2 - System in alarm
Bit 1 - Winload connected
Bit 0 - NEware connected
01 0xXX Century
01 0xXX Century
02 0xXX Year
02 0xXX Year
03 0xXX Month
03 0xXX Month
...
...
penguidom/plugins/paradox/paradox.py
View file @
d4ddef56
...
@@ -37,12 +37,12 @@ PKTTIMEOUT=2 # Seconds
...
@@ -37,12 +37,12 @@ PKTTIMEOUT=2 # Seconds
def
checkSumCalc
(
message
):
def
checkSumCalc
(
message
):
checksum
=
0
checksum
=
0
return
chr
(
sum
(
map
(
ord
,
m
))
%
256
)
return
chr
(
sum
(
map
(
ord
,
m
essage
))
%
256
)
def
checkSumTest
(
message
):
def
checkSumTest
(
message
):
if
len
(
message
)
==
37
:
if
len
(
message
)
==
37
:
if
message
[
36
]
==
checkSumCalc
(
message
[:
36
])
if
message
[
36
]
==
checkSumCalc
(
message
[:
36
])
:
return
True
return
True
return
False
return
False
...
...
penguidom/plugins/paradox/paradox37b.py
0 → 100644
View file @
d4ddef56
###########################################################################
# Copyright (c) 2018- Franco (nextime) Lanza <franco@nexlab.it>
#
# Penguidom System client Daemon "penguidomd" [https://git.nexlab.net/domotika/Penguidom]
#
# This file is part of penguidom.
#
# penguidom is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import
ctypes
c_uint8
=
ctypes
.
c_uint8
class
LowNibble_bits
(
ctypes
.
LittleEndianStructure
):
_fields_
=
[
(
"evt_disable"
,
c_uint8
,
1
),
(
"alarm"
,
c_uint8
,
1
),
(
"winload"
,
c_uint8
,
1
),
(
"neware"
,
c_uint8
,
1
),
]
class
Flags
(
ctypes
.
Union
):
_anonymous_
=
(
"bit"
,)
_fields_
=
[
(
"bit"
,
LowNibble_bits
),
(
"asByte"
,
c_uint8
)
]
"""
flags = Flags()
flags.asByte = 0xe2
print( "event_disable:
%
i"
%
flags.evt_disable )
print( "alarm:
%
i"
%
flags.alarm )
print( "winload :
%
i"
%
flags.winload )
print( "neware :
%
i"
%
flags.neware )
"""
CMD_EVENT
=
0xe
def
checkCmd
(
byte
,
cmd
):
return
(
byte
>>
4
)
==
cmd
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment