Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
ufr-examples-angular-browser_extension
Project
Overview
Details
行为ivity
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
管道
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
行为ivity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nfc-rfid-reader-sdk
ufr-examples-angular-browser_extension
Commits
f7b11f6d
Commit
f7b11f6d
撰写
Jun 30, 2020
by
developer34
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reader auto reopen added.
家长
84815b90
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
3 deletions
+44
-3
app.component.html
src/app/app.component.html
+3
-0
app.component.ts
src/app/app.component.ts
+41
-3
No files found.
src/app/app.component.html
View file @
f7b11f6d
...
...
@@ -5,6 +5,9 @@
width=
"300"
alt=
"Angular Logo"
src=
"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="
>
id=
"openresponse"
style=
"text-align:center"
>
{{ OpenText }}
id=
"buttons"
style=
"text-align:center"
>
class=
"btn"
(
click
)="
ReaderOpen
()"
>
ReaderOpen
...
...
src/app/app.component.ts
View file @
f7b11f6d
...
...
@@ -24,14 +24,50 @@ export class AppComponent {
0
==
u
&&
response
(
resp
),
u
++
})
}
}
LoopStartedRSC
:
boolean
=
false
;
ReaderStillConnectedLoop
()
{
let
_this
=
this
;
if
(
_this
.
LoopStartedRSC
==
false
)
{
_this
.
LoopStartedRSC
=
true
;
let
loop
=
setInterval
(
function
()
{
_this
.
uFRequest
(
"ReaderStillConnected"
,
function
(
uFResponse
:
any
)
{
if
(
uFResponse
.
连接
==
"0x00"
)
{
_this
.
ReaderOpen
();
}
else
{
}
});
},
200
);
}
}
OpenText
:
string
=
'Reader closed'
;
//ReaderOpen example function
ReaderOpen
()
{
let
_this
=
this
;
this
.
uFRequest
(
"ReaderOpen"
,
function
(
uFResponse
:
any
)
{
console
.
log
(
uFResponse
);
let
responseString
=
JSON
.
stringify
(
uFResponse
);
alert
(
responseString
);
if
(
uFResponse
.
Status
==
"[0x00 (0)] UFR_OK"
)
{
_this
.
OpenText
=
"Reader opened"
;
_this
.
ReaderStillConnectedLoop
();
}
else
{
_this
.
OpenText
=
"Reader closed"
;
}
});
}
...
...
@@ -59,7 +95,7 @@ export class AppComponent {
LoopStarted
:
boolean
=
false
;
GetCardIdExLoop
()
{
let
_this
=
this
;
this
.
LoopResponseText
=
'No Card'
;
let
loop
=
setInterval
(
function
()
{
...
...
@@ -76,4 +112,5 @@ export class AppComponent {
}
}
\ No newline at end of file
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
发表评论
map