Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
LoRaWAN benchmark
RIOT - IM880B
Commits
a56a4bff
Commit
a56a4bff
authored
Apr 26, 2019
by
Guillaume Gonnet
Browse files
Continue command module.
parent
21e7c6c5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
6 deletions
+66
-6
src/app/commands/bases.c
src/app/commands/bases.c
+2
-2
src/app/commands/commands.c
src/app/commands/commands.c
+2
-2
src/app/commands/commands.h
src/app/commands/commands.h
+5
-2
src/app/commands/recv.c
src/app/commands/recv.c
+55
-0
src/app/main.c
src/app/main.c
+2
-0
No files found.
src/app/commands/bases.c
View file @
a56a4bff
...
...
@@ -11,7 +11,7 @@ This project is under the MIT license
// Debug "d" command.
int
cmd
s
_debug
(
int
argc
,
char
**
argv
)
int
cmd_debug
(
int
argc
,
char
**
argv
)
{
// TODO.
...
...
@@ -21,7 +21,7 @@ int cmds_debug(int argc, char **argv)
// Reset "r" command.
int
cmd
s
_reset
(
int
argc
,
char
**
argv
)
int
cmd_reset
(
int
argc
,
char
**
argv
)
{
// TODO.
...
...
src/app/commands/commands.c
View file @
a56a4bff
...
...
@@ -14,8 +14,8 @@ This project is under the MIT license
// All command entries.
static
app_cmd_ent_t
cmd_entries
[]
=
{
{
"d"
,
cmd
s
_debug
},
{
"r"
,
cmd
s
_reset
},
{
"d"
,
cmd_debug
},
{
"r"
,
cmd_reset
},
};
// Number of entries.
...
...
src/app/commands/commands.h
View file @
a56a4bff
...
...
@@ -44,6 +44,9 @@ enum {
// Parse a command.
int
cmds_parse
(
char
*
line
);
// Initialize command module.
void
cmds_init
(
void
);
// All application commands.
int
cmd
s
_debug
(
int
argc
,
char
**
argv
);
int
cmd
s
_reset
(
int
argc
,
char
**
argv
);
int
cmd_debug
(
int
argc
,
char
**
argv
);
int
cmd_reset
(
int
argc
,
char
**
argv
);
src/app/commands/recv.c
0 → 100644
View file @
a56a4bff
/*
Received from LoRaWAN or UART RX.
Copyright (C) 2019, ENSIMAG students
This project is under the MIT license
*/
#include "commands.h"
#include "lorariot.h"
#include <thread.h>
#include <msg.h>
// Message queue of receive thread.
#define MSG_QUEUE_SIZE (4U)
static
msg_t
msg_queue
[
MSG_QUEUE_SIZE
];
// LoRaRIOT event loop.
#define RECV_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
static
char
recv_stack
[
RECV_STACKSIZE
];
// Thread that receive commands.
static
void
*
recv_thread
(
void
*
args
)
{
(
void
)
args
;
msg_init_queue
(
msg_queue
,
MSG_QUEUE_SIZE
);
while
(
true
)
{
msg_t
msg
;
msg_receive
(
&
msg
);
switch
(
msg
.
type
)
{
// TODO.
}
}
return
NULL
;
}
// Initialize command module.
void
cmds_init
(
void
)
{
kernel_pid_t
pid
=
thread_create
(
recv_stack
,
sizeof
(
recv_stack
),
THREAD_PRIORITY_MAIN
+
3
,
THREAD_CREATE_STACKTEST
,
recv_thread
,
NULL
,
"recv-thread"
);
lorariot_set_recv_thread
(
pid
);
}
src/app/main.c
View file @
a56a4bff
...
...
@@ -9,6 +9,7 @@ This project is under the MIT license
#include "lorariot.h"
#include "providers/providers.h"
#include "commands/commands.h"
#include <stdio.h>
...
...
@@ -17,6 +18,7 @@ This project is under the MIT license
int
main
(
void
)
{
lorariot_init
();
cmds_init
();
#if RESET_ON_START
// If enable, reset all providers when the application starts.
...
...
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