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
87090072
Commit
87090072
authored
7 years ago
by
Alexandre Abadie
Browse files
Options
Downloads
Patches
Plain Diff
pkg/semtech-loramac: handle all mcps confirm cases
parent
736c757b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/semtech-loramac/contrib/semtech_loramac.c
+25
-4
25 additions, 4 deletions
pkg/semtech-loramac/contrib/semtech_loramac.c
pkg/semtech-loramac/include/semtech_loramac.h
+2
-0
2 additions, 0 deletions
pkg/semtech-loramac/include/semtech_loramac.h
with
27 additions
and
4 deletions
pkg/semtech-loramac/contrib/semtech_loramac.c
+
25
−
4
View file @
87090072
...
@@ -171,6 +171,11 @@ static void mcps_confirm(McpsConfirm_t *confirm)
...
@@ -171,6 +171,11 @@ static void mcps_confirm(McpsConfirm_t *confirm)
break
;
break
;
}
}
}
}
else
{
msg_t
msg
;
msg
.
type
=
MSG_TYPE_LORAMAC_TX_CNF_FAILED
;
msg_send
(
&
msg
,
semtech_loramac_pid
);
}
}
}
/* MCPS-Indication event function */
/* MCPS-Indication event function */
...
@@ -555,6 +560,14 @@ void *_semtech_loramac_event_loop(void *arg)
...
@@ -555,6 +560,14 @@ void *_semtech_loramac_event_loop(void *arg)
mac
->
state
=
SEMTECH_LORAMAC_STATE_IDLE
;
mac
->
state
=
SEMTECH_LORAMAC_STATE_IDLE
;
break
;
break
;
}
}
case
MSG_TYPE_LORAMAC_TX_CNF_FAILED
:
DEBUG
(
"[semtech-loramac] loramac TX failed
\n
"
);
msg_t
msg_ret
;
msg_ret
.
type
=
MSG_TYPE_LORAMAC_TX_CNF_FAILED
;
msg_send
(
&
msg_ret
,
mac
->
caller_pid
);
/* switch back to idle state now*/
mac
->
state
=
SEMTECH_LORAMAC_STATE_IDLE
;
break
;
case
MSG_TYPE_LORAMAC_RX
:
case
MSG_TYPE_LORAMAC_RX
:
{
{
msg_t
msg_ret
;
msg_t
msg_ret
;
...
@@ -678,10 +691,18 @@ uint8_t semtech_loramac_recv(semtech_loramac_t *mac)
...
@@ -678,10 +691,18 @@ uint8_t semtech_loramac_recv(semtech_loramac_t *mac)
/* Wait until the mac receive some information */
/* Wait until the mac receive some information */
msg_t
msg
;
msg_t
msg
;
msg_receive
(
&
msg
);
msg_receive
(
&
msg
);
uint8_t
ret
=
SEMTECH_LORAMAC_TX_DONE
;
uint8_t
ret
;
if
(
msg
.
type
==
MSG_TYPE_LORAMAC_RX
)
{
switch
(
msg
.
type
)
{
ret
=
SEMTECH_LORAMAC_DATA_RECEIVED
;
case
MSG_TYPE_LORAMAC_RX
:
}
ret
=
SEMTECH_LORAMAC_DATA_RECEIVED
;
break
;
case
MSG_TYPE_LORAMAC_TX_CNF_FAILED
:
ret
=
SEMTECH_LORAMAC_TX_CNF_FAILED
;
break
;
default:
ret
=
SEMTECH_LORAMAC_TX_DONE
;
break
;
}
DEBUG
(
"[semtech-loramac] MAC reply received: %d
\n
"
,
ret
);
DEBUG
(
"[semtech-loramac] MAC reply received: %d
\n
"
,
ret
);
...
...
This diff is collapsed.
Click to expand it.
pkg/semtech-loramac/include/semtech_loramac.h
+
2
−
0
View file @
87090072
...
@@ -45,6 +45,7 @@ extern "C" {
...
@@ -45,6 +45,7 @@ extern "C" {
#define MSG_TYPE_LORAMAC_TX_DONE (0x3462)
/**< MAC TX completes */
#define MSG_TYPE_LORAMAC_TX_DONE (0x3462)
/**< MAC TX completes */
#define MSG_TYPE_LORAMAC_RX (0x3463)
/**< Some data received */
#define MSG_TYPE_LORAMAC_RX (0x3463)
/**< Some data received */
#define MSG_TYPE_LORAMAC_LINK_CHECK (0x3464)
/**< Link check info received */
#define MSG_TYPE_LORAMAC_LINK_CHECK (0x3464)
/**< Link check info received */
#define MSG_TYPE_LORAMAC_TX_CNF_FAILED (0x3465)
/**< MAC TX confirmed failed */
/** @} */
/** @} */
/**
/**
...
@@ -61,6 +62,7 @@ enum {
...
@@ -61,6 +62,7 @@ enum {
SEMTECH_LORAMAC_NOT_JOINED
,
/**< MAC is not joined */
SEMTECH_LORAMAC_NOT_JOINED
,
/**< MAC is not joined */
SEMTECH_LORAMAC_TX_SCHEDULED
,
/**< TX data scheduled */
SEMTECH_LORAMAC_TX_SCHEDULED
,
/**< TX data scheduled */
SEMTECH_LORAMAC_TX_DONE
,
/**< Transmission completed */
SEMTECH_LORAMAC_TX_DONE
,
/**< Transmission completed */
SEMTECH_LORAMAC_TX_CNF_FAILED
,
/**< Confirmable transmission failed */
SEMTECH_LORAMAC_DATA_RECEIVED
,
/**< Data received */
SEMTECH_LORAMAC_DATA_RECEIVED
,
/**< Data received */
SEMTECH_LORAMAC_BUSY
/**< Internal MAC is busy */
SEMTECH_LORAMAC_BUSY
/**< Internal MAC is busy */
};
};
...
...
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