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
a3a198e2
Commit
a3a198e2
authored
Mar 22, 2022
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 2
parent
c47c9435
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
dllmain.cpp
examples/javademo/cpp/dllmain.cpp
+3
-3
AdemcoHbLibrary.java
examples/javademo/jni/AdemcoHbLibrary.java
+1
-1
No files found.
examples/javademo/cpp/dllmain.cpp
View file @
a3a198e2
...
...
@@ -130,9 +130,9 @@ JNIEXPORT jcharArray JNICALL Java_javademo_jni_AdemcoHbLibrary_pack3
sacct
,
static_cast
<
size_t
>
(
ademco_id
),
static_cast
<
unsigned
char
>
(
gg
),
static_cast
<
ademco
::
ADEMCO_EVENT
>
(
ademco_event
),
static_cast
<
size_t
>
(
zone
),
xdata_
);
if
(
res
>
0
)
{
//
buff[res] = 0;
auto
ascii
=
ademco
::
detail
::
toString
(
buff
,
res
,
ademco
::
detail
::
ToStringOption
::
ALL_CHAR_AS_HEX
,
false
,
false
);
memcpy
(
buff
,
ascii
.
data
(),
ascii
.
size
());
buff
[
res
]
=
0
;
//
auto ascii = ademco::detail::toString(buff, res, ademco::detail::ToStringOption::ALL_CHAR_AS_HEX, false, false);
//
memcpy(buff, ascii.data(), ascii.size());
//return env->NewStringUTF(buff);
jcharArray
rarray
=
env
->
NewCharArray
(
ascii
.
size
());
//定义数据变量
...
...
examples/javademo/jni/AdemcoHbLibrary.java
View file @
a3a198e2
...
...
@@ -75,7 +75,7 @@ public class AdemcoHbLibrary
* @param[in] gg 分防区号
* @param[in] xdata xdata
* @param[in] xdata_len xdata长度
* @return
hex String,如字符串"123456" 表示为 "313233343536", 需手动转换为byte[] 进行发送,参考SimpleServerThread
* @return
char array,可直接用于网络传输。
*/
public
native
char
[]
pack3
(
int
seq
,
String
acct
,
int
ademco_id
,
int
ademco_event
,
int
zone
,
int
gg
,
char
[]
xdata
,
int
xdata_len
);
...
...
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