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
37fb0a9c
Commit
37fb0a9c
authored
May 29, 2020
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ebf70911
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
README.md
docs/README.md
+1
-1
javademo-README.md
javademo-README.md
+5
-1
dllmain.cpp
javademo/cpp/dllmain.cpp
+1
-3
No files found.
docs/README.md
View file @
37fb0a9c
...
...
@@ -46,7 +46,7 @@
*
`Lpref`
以L开头的一段十六进制数字字符串,数字长度范围
`1~6`
,暂时仅占位,无意义。字段总长度
`2~7`
Bytes。
*
`#acct`
以
`#`
开头,后跟有限位十进制数字(SIM卡号或出厂编号)或安定宝ID,表示主机的账号(有SIM卡的主机为手机号,无SIM卡的是出厂编号,有些主机直连时使用了安定宝ID为账号)
*
`data`
格式为
`[]`
(左右中括号,无空格,定长2Byte)或
`[#acct|event gg zone]`
(有空格)。当事件类型为
`NULL/ACK/DUH`
时
`data`
段为
`[]`
;当事件类型为
`ADM-CID/HENG-BO`
时
`data`
段格式为
`[#acct|event gg zone]`
:
*
`#acct`
主机的安定宝ID,4位或6位或8位十六进制数字,
如安定宝ID
`16`
编码为6位是
`000010`
*
`#acct`
主机的安定宝ID,4位或6位或8位十六进制数字,
我司使用固定6位,如安定宝ID
`16`
编码为6位是
`000010`
*
`event`
定长4Bytes,事件代码,具体含义见后文。
*
`gg`
定长2 Bytes, 一般为00,当非00时有特殊含义,参考《安定宝协议扩展》
*
`zone`
防区号,范围
`0~999`
。
`zone`
为
`0`
表示主机自身事件,如布防、撤防、防拆等。
`1~999`
则为防区号,表示防区事件。定长3 Bytes。
...
...
javademo-README.md
View file @
37fb0a9c
...
...
@@ -21,7 +21,11 @@
3.
`java javademo.jni.SimpleServer 12345`
进行测试
## 二次开发可以参考 `SimpleServer` 引入 `AdmeocHbLibrary` 进行解包、打包。
## 二次开发
可以参考
`SimpleServer`
引入
`AdmeocHbLibrary`
进行解包、打包。
注意若使用预编译动态库,引入
`AdmeocHbLibrary`
时需整包引入,动态链接库会以包名查找
`AdmeocHbLibrary`
类,详情见
[
dllmain.cpp
](
javademo/cpp/dllmain.cpp
)
内
`Java_javademo_jni_AdemcoHbLibrary_nativeParse`
函数,包名不同则查找失败,用户自行编译动态库时需同时修改此函数内容。
## 作者对 `Java` 开发不熟悉,有任何意见、建议欢迎提 `issue` 及 `pr`
javademo/cpp/dllmain.cpp
View file @
37fb0a9c
...
...
@@ -35,9 +35,7 @@ JNIEXPORT jobject JNICALL Java_javademo_jni_AdemcoHbLibrary_nativeParse
size_t
commited
=
0
;
jboolean
iscopy
=
0
;
std
::
string
s
=
env
->
GetStringUTFChars
(
pack
,
&
iscopy
);
auto
result
=
ap
.
parse
(
s
.
data
(),
static_cast
<
size_t
>
(
pack_len
),
commited
);
//*cb_commited = static_cast<int>(commited);
//return static_cast<int>(result);
auto
result
=
ap
.
parse
(
s
.
data
(),
static_cast
<
size_t
>
(
pack_len
),
commited
);
// Attempt to find the Version class.
clazz
=
env
->
FindClass
(
"javademo/jni/AdemcoHbLibrary$ParseResult"
);
// If this class does not exist then return null.
...
...
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