Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ademco_hb
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
ademco_hb
Commits
4e780248
Commit
4e780248
authored
Dec 10, 2023
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
release 1.3.0
parent
d630422f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
11 deletions
+29
-11
CHANGELOG.md
CHANGELOG.md
+6
-0
ademco.c
ademco.c
+5
-2
ademco.h
ademco.h
+1
-0
ademco_config.h
ademco_config.h
+1
-0
ademco_version.h
ademco_version.h
+1
-1
copy_from_hb.bat
tools/copy_from_hb.bat
+0
-7
copy_from_hb.sh
tools/copy_from_hb.sh
+14
-0
mk_examples.sh
tools/mk_examples.sh
+1
-1
No files found.
CHANGELOG.md
View file @
4e780248
# Ademco Change Log
## 1.3.0
-
add
`file`
for parse error
-
fix
`struct tm not initilized`
on parse
-
fix parsing pointer on parse timestamp failed
## 1.2.0
-
add config
...
...
ademco.c
View file @
4e780248
...
...
@@ -991,6 +991,7 @@ AdemcoParseResult ademcoPacketParse(const ademco_char_t* buff, size_t len,
if
(
len
<
9
)
{
ADEMCO_FILL_PARSE_ERROR
(
err
,
0
,
"RESULT_NOT_ENOUGH"
);
return
RESULT_NOT_ENOUGH
;
}
...
...
@@ -1023,6 +1024,7 @@ AdemcoParseResult ademcoPacketParse(const ademco_char_t* buff, size_t len,
}
len_needed
=
9
+
pkt
->
len
+
1
;
if
(
len
<
len_needed
)
{
ADEMCO_FILL_PARSE_ERROR
(
err
,
p
-
buff
,
"RESULT_NOT_ENOUGH"
);
return
RESULT_NOT_ENOUGH
;
}
else
if
(
len_needed
>=
ADEMCO_PACKET_MAX_LEN
)
{
dline
;
...
...
@@ -1141,7 +1143,7 @@ AdemcoParseResult ademcoPacketParse(const ademco_char_t* buff, size_t len,
dline
;
ADEMCO_FILL_PARSE_ERROR
(
err
,
p
-
buff
,
"acct too long"
);
return
RESULT_ERROR
;
}
}
strncpy
(
pkt
->
acct
,
(
const
char
*
)
pacct
,
p
-
pacct
);
pkt
->
acct
[
p
-
pacct
]
=
'\0'
;
...
...
@@ -1200,7 +1202,7 @@ AdemcoParseResult ademcoPacketParse(const ademco_char_t* buff, size_t len,
// timestamp, _%02d:%02d:%02d,%02d-%02d-%04d
// only check lengh, if format is incorrect, use local time instead
if
(
pend
-
p
==
ADEMCO_PACKET_TIMESTAMP_LEN
)
{
struct
tm
tm
;
struct
tm
tm
=
{
0
}
;
do
{
if
(
*
p
++
!=
'_'
)
{
break
;
...
...
@@ -1247,6 +1249,7 @@ AdemcoParseResult ademcoPacketParse(const ademco_char_t* buff, size_t len,
pkt
->
timestamp
=
mktime
(
&
tm
);
if
(
pkt
->
timestamp
<=
0
)
{
// use local time instead
pkt
->
timestamp
=
time
(
NULL
);
p
=
pend
;
}
}
else
{
dline
;
...
...
ademco.h
View file @
4e780248
...
...
@@ -194,6 +194,7 @@ typedef enum AdemcoParseResult {
// 安定宝协议解析错误信息
typedef
struct
AdemcoParseError
{
const
char
*
file
;
// user do not free
int
line
;
// line number in ademco.c
size_t
offset
;
// error offset
const
char
*
msg
;
// user do not free
...
...
ademco_config.h
View file @
4e780248
...
...
@@ -37,6 +37,7 @@
#define ADEMCO_FILL_PARSE_ERROR(err, offset_, msg_) \
do
{
\
if
(
err
)
{
\
err
->
file
=
__FILE__
;
\
err
->
line
=
__LINE__
;
\
err
->
offset
=
(
offset_
);
\
err
->
msg
=
(
msg_
);
\
...
...
ademco_version.h
View file @
4e780248
...
...
@@ -7,7 +7,7 @@
*/
#define ADEMCO_VERSION_MAJOR 1
#define ADEMCO_VERSION_MINOR
2
#define ADEMCO_VERSION_MINOR
3
#define ADEMCO_VERSION_PATCH 0
#define ADEMCO_VERSION_IS_RELEASE 1
#define ADEMCO_VERSION_SUFFIX ""
...
...
tools/copy_from_hb.bat
deleted
100644 → 0
View file @
d630422f
xcopy /i /s /y G:\dev_libs\ademco\hb\ademco.h ..\
xcopy /i /s /y G:\dev_libs\ademco\hb\ademco.c ..\
xcopy /i /s /y G:\dev_libs\ademco\hb\hb_com.h ..\
xcopy /i /s /y G:\dev_libs\ademco\hb\hb_com.c ..\
xcopy /i /s /y G:\dev_libs\ademco\hb\ademco_version.h ..\
xcopy /i /s /y G:\dev_libs\ademco\hb\ademco_config.h ..\
xcopy /i /s /y G:\dev_libs\ademco\hb\CHANGELOG.md ..\
tools/copy_from_hb.sh
0 → 100644
View file @
4e780248
#!/bin/bash
set
-e
CURRENT_DIR
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
;
pwd
-P
)
cd
$CURRENT_DIR
cp
-f
/g/dev_libs/ademco/hb/ademco.h ../
cp
-f
/g/dev_libs/ademco/hb/ademco.c ../
cp
-f
/g/dev_libs/ademco/hb/hb_com.h ../
cp
-f
/g/dev_libs/ademco/hb/hb_com.c ../
cp
-f
/g/dev_libs/ademco/hb/ademco_version.h ../
cp
-f
/g/dev_libs/ademco/hb/ademco_config.h ../
cp
-f
/g/dev_libs/ademco/hb/CHANGELOG.md ../
tools/mk_examples.sh
View file @
4e780248
...
...
@@ -9,7 +9,7 @@ cd $CURRENT_DIR
./examples.bat
mkdir
-p
dist/examples/x86
cp
"/h/dev/AlarmCenterTestTools/Release/直连型主机模拟器V1.1
6
.exe"
dist/examples/x86/
cp
"/h/dev/AlarmCenterTestTools/Release/直连型主机模拟器V1.1
7
.exe"
dist/examples/x86/
cp
"/g/dev_libs/curl-7.87.0/builds/libcurl-vc14-x86-release-dll-ipv6-sspi-schannel/bin/libcurl.dll"
dist/examples/x86/
cp
../examples/Win32/Release/server_demo.exe dist/examples/x86/
cp
../examples/Release/httprelay.exe dist/examples/x86/
...
...
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