Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
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
Service Desk
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
cm-projects
RIOT
Commits
88a978ad
Commit
88a978ad
authored
6 years ago
by
Vincent Dupont
Committed by
Kaspar Schleiser
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
tests/driver_at: improve test app
parent
0c9c00f9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/driver_at/main.c
+40
-2
40 additions, 2 deletions
tests/driver_at/main.c
with
40 additions
and
2 deletions
tests/driver_at/main.c
+
40
−
2
View file @
88a978ad
...
...
@@ -58,12 +58,48 @@ static int send(int argc, char **argv)
return
1
;
}
if
(
at_send_cmd_get_resp
(
&
at_dev
,
argv
[
1
],
resp
,
sizeof
(
resp
),
10
*
US_PER_SEC
)
<
0
)
{
ssize_t
len
;
if
((
len
=
at_send_cmd_get_resp
(
&
at_dev
,
argv
[
1
],
resp
,
sizeof
(
resp
),
10
*
US_PER_SEC
))
<
0
)
{
puts
(
"Error"
);
return
1
;
}
printf
(
"Response: %s
\n
"
,
resp
);
printf
(
"Response (len=%d): %s
\n
"
,
(
int
)
len
,
resp
);
return
0
;
}
static
int
send_ok
(
int
argc
,
char
**
argv
)
{
if
(
argc
<
2
)
{
printf
(
"Usage: %s <command>
\n
"
,
argv
[
0
]);
return
1
;
}
if
(
at_send_cmd_wait_ok
(
&
at_dev
,
argv
[
1
],
10
*
US_PER_SEC
)
<
0
)
{
puts
(
"Error"
);
return
1
;
}
puts
(
"OK"
);
return
0
;
}
static
int
send_lines
(
int
argc
,
char
**
argv
)
{
if
(
argc
<
2
)
{
printf
(
"Usage: %s <command>
\n
"
,
argv
[
0
]);
return
1
;
}
ssize_t
len
;
if
((
len
=
at_send_cmd_get_lines
(
&
at_dev
,
argv
[
1
],
resp
,
sizeof
(
resp
),
10
*
US_PER_SEC
))
<
0
)
{
puts
(
"Error"
);
return
1
;
}
printf
(
"Response (len=%d): %s
\n
"
,
(
int
)
len
,
resp
);
return
0
;
}
...
...
@@ -81,6 +117,8 @@ static int drain(int argc, char **argv)
static
const
shell_command_t
shell_commands
[]
=
{
{
"init"
,
"Initialize AT device"
,
init
},
{
"send"
,
"Send a command and wait response"
,
send
},
{
"send_ok"
,
"Send a command and wait OK"
,
send_ok
},
{
"send_lines"
,
"Send a command and wait lines"
,
send_lines
},
{
"drain"
,
"Drain AT device"
,
drain
},
{
NULL
,
NULL
,
NULL
},
};
...
...
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