Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hn70ap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
hn70ap
Commits
69a24d6e
Commit
69a24d6e
authored
6 years ago
by
f4grx
Browse files
Options
Downloads
Patches
Plain Diff
fix rxt to use new cb rx api
parent
bb8a9503
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/rxt/rxt_main.c
+21
-28
21 additions, 28 deletions
apps/rxt/rxt_main.c
with
21 additions
and
28 deletions
apps/rxt/rxt_main.c
+
21
−
28
View file @
69a24d6e
...
...
@@ -55,8 +55,22 @@
* Public Functions
****************************************************************************/
/****************************************************************************
* status_main
* rxt_callback
****************************************************************************/
int
rxt_callback
(
uint8_t
device
,
FAR
void
*
arg
,
FAR
uint8_t
*
data
,
int
length
)
{
int
i
;
for
(
i
=
0
;
i
<
length
;
i
++
)
{
printf
(
"%c"
,
(
data
[
i
]
<
0x20
&&
data
[
i
]
!=
0x0a
)
?
'.'
:
data
[
i
]);
}
return
0
;
}
/****************************************************************************
* rxt_main
****************************************************************************/
#ifdef CONFIG_BUILD_KERNEL
...
...
@@ -66,9 +80,7 @@ int rxt_main(int argc, char *argv[])
#endif
{
int
ret
=
OK
;
int
fd
;
int
buflen
=
1024
;
int
i
;
uint8_t
*
buf
;
...
...
@@ -84,32 +96,13 @@ int rxt_main(int argc, char *argv[])
goto
done
;
}
do
{
ret
=
hn70ap_radio_receive
(
HN70AP_RADIO_AUX
,
buf
,
buflen
);
//printf("read done, ret = %d, errno=%d\n", ret, errno);
if
(
ret
>
0
)
{
/* for(i=0; i<ret; i++)
{
printf("%02X ", buf[i]);
}
printf("\n");*/
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
printf
(
"%c"
,
(
buf
[
i
]
<
0x20
&&
buf
[
i
]
!=
0x0a
)
?
'.'
:
buf
[
i
]);
}
}
else
if
(
ret
<
0
&&
errno
==
ETIMEDOUT
)
{
printf
(
"RX timeout
\n
"
);
// ret = 1;
// continue;
}
}
while
(
ret
>
0
);
hn70ap_radio_rxfunction
(
HN70AP_RADIO_AUX
,
rxt_callback
,
NULL
,
buf
,
buflen
);
printf
(
"type return to quit
\n
"
);
getchar
();
printf
(
"Read sequence done.
\n
"
);
printf
(
"Stopping reception
\n
"
);
hn70ap_radio_rxfunction
(
HN70AP_RADIO_AUX
,
NULL
,
NULL
,
NULL
,
0
);
free
(
buf
);
done:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment