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
b80c249d
Commit
b80c249d
authored
7 years ago
by
Alexandre Abadie
Browse files
Options
Downloads
Patches
Plain Diff
sys/netopt: add new enum types for LoRa
parent
acbdfe88
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
sys/include/net/netopt.h
+74
-1
74 additions, 1 deletion
sys/include/net/netopt.h
sys/net/crosslayer/netopt/netopt.c
+51
-38
51 additions, 38 deletions
sys/net/crosslayer/netopt/netopt.c
with
125 additions
and
39 deletions
sys/include/net/netopt.h
+
74
−
1
View file @
b80c249d
...
...
@@ -269,10 +269,81 @@ typedef enum {
*/
NETOPT_LAST_ED_LEVEL
,
/**
* @brief Get/Set preamble length as uint16_t in host byte order.
*/
NETOPT_PREAMBLE_LENGTH
,
/**
* @brief Enable/disable integrity check (e.g CRC).
*/
NETOPT_INTEGRITY_CHECK
,
/**
* @brief Enable/disable channel hopping.
*/
NETOPT_CHANNEL_HOP
,
/**
* @brief Get/Set channel hopping period as uint8_t.
*/
NETOPT_CHANNEL_HOP_PERIOD
,
/**
* @brief Enable/disable single packet reception.
*
* If enabled, RX is turned off upon reception of a packet
*/
NETOPT_SINGLE_RECEIVE
,
/**
* @brief Get/Set the reception timeout of a packet.
*
* Values are retrieved/passed as uint32_t in host byte order.
*/
NETOPT_RX_TIMEOUT
,
/**
* @brief Get/Set the transmission timeout of a packet.
*
* Values are retrieved/passed as uint32_t in host byte order.
*/
NETOPT_TX_TIMEOUT
,
/**
* @brief Get/Set the radio modem type as uint8_t.
*/
NETOPT_DEVICE_MODE
,
/**
* @brief Get/Set the radio modulation bandwidth as uint8_t.
*/
NETOPT_BANDWIDTH
,
/**
* @brief Get/Set the radio spreading factor as uint8_t.
*/
NETOPT_SPREADING_FACTOR
,
/**
* @brief Get/Set the radio coding rate as uint8_t.
*/
NETOPT_CODING_RATE
,
/**
* @brief Enable/disable fixed header mode.
*/
NETOPT_FIXED_HEADER
,
/**
* @brief Enable/disable IQ inverted.
*/
NETOPT_IQ_INVERT
,
/* add more options if needed */
/**
* @brief maximum number of options defined here
* @brief maximum number of options defined here
.
*
* @note Interfaces are not meant to respond to that.
*/
...
...
@@ -306,6 +377,8 @@ typedef enum {
* transmitting a packet */
NETOPT_STATE_RESET
,
/**< triggers a hardware reset. The resulting
* state of the network device is @ref NETOPT_STATE_IDLE */
NETOPT_STATE_STANDBY
,
/**< standby mode. The devices is awake but
* not listening to packets. */
/* add other states if needed */
}
netopt_state_t
;
...
...
This diff is collapsed.
Click to expand it.
sys/net/crosslayer/netopt/netopt.c
+
51
−
38
View file @
b80c249d
...
...
@@ -24,44 +24,57 @@ extern "C" {
#endif
static
const
char
*
_netopt_strmap
[]
=
{
[
NETOPT_CHANNEL
]
=
"NETOPT_CHANNEL"
,
[
NETOPT_IS_CHANNEL_CLR
]
=
"NETOPT_IS_CHANNEL_CLR"
,
[
NETOPT_ADDRESS
]
=
"NETOPT_ADDRESS"
,
[
NETOPT_ADDRESS_LONG
]
=
"NETOPT_ADDRESS_LONG"
,
[
NETOPT_ADDR_LEN
]
=
"NETOPT_ADDR_LEN"
,
[
NETOPT_SRC_LEN
]
=
"NETOPT_SRC_LEN"
,
[
NETOPT_NID
]
=
"NETOPT_NID"
,
[
NETOPT_IPV6_IID
]
=
"NETOPT_IPV6_IID"
,
[
NETOPT_TX_POWER
]
=
"NETOPT_TX_POWER"
,
[
NETOPT_MAX_PACKET_SIZE
]
=
"NETOPT_MAX_PACKET_SIZE"
,
[
NETOPT_PRELOADING
]
=
"NETOPT_PRELOADING"
,
[
NETOPT_PROMISCUOUSMODE
]
=
"NETOPT_PROMISCUOUSMODE"
,
[
NETOPT_AUTOACK
]
=
"NETOPT_AUTOACK"
,
[
NETOPT_ACK_REQ
]
=
"NETOPT_ACK_REQ"
,
[
NETOPT_RETRANS
]
=
"NETOPT_RETRANS"
,
[
NETOPT_PROTO
]
=
"NETOPT_PROTO"
,
[
NETOPT_STATE
]
=
"NETOPT_STATE"
,
[
NETOPT_RAWMODE
]
=
"NETOPT_RAWMODE"
,
[
NETOPT_RX_START_IRQ
]
=
"NETOPT_RX_START_IRQ"
,
[
NETOPT_RX_END_IRQ
]
=
"NETOPT_RX_END_IRQ"
,
[
NETOPT_TX_START_IRQ
]
=
"NETOPT_TX_START_IRQ"
,
[
NETOPT_TX_END_IRQ
]
=
"NETOPT_TX_END_IRQ"
,
[
NETOPT_AUTOCCA
]
=
"NETOPT_AUTOCCA"
,
[
NETOPT_CSMA
]
=
"NETOPT_CSMA"
,
[
NETOPT_CSMA_RETRIES
]
=
"NETOPT_CSMA_RETRIES"
,
[
NETOPT_IS_WIRED
]
=
"NETOPT_IS_WIRED"
,
[
NETOPT_DEVICE_TYPE
]
=
"NETOPT_DEVICE_TYPE"
,
[
NETOPT_CHANNEL_PAGE
]
=
"NETOPT_CHANNEL_PAGE"
,
[
NETOPT_CCA_THRESHOLD
]
=
"NETOPT_CCA_THRESHOLD"
,
[
NETOPT_CCA_MODE
]
=
"NETOPT_CCA_MODE"
,
[
NETOPT_STATS
]
=
"NETOPT_STATS"
,
[
NETOPT_ENCRYPTION
]
=
"NETOPT_ENCRYPTION"
,
[
NETOPT_ENCRYPTION_KEY
]
=
"NETOPT_ENCRYPTION_KEY"
,
[
NETOPT_RF_TESTMODE
]
=
"NETOPT_RF_TESTMODE"
,
[
NETOPT_L2FILTER
]
=
"NETOPT_L2FILTER"
,
[
NETOPT_L2FILTER_RM
]
=
"NETOPT_L2FILTER_RM"
,
[
NETOPT_LAST_ED_LEVEL
]
=
"NETOPT_LAST_ED_LEVEL"
,
[
NETOPT_NUMOF
]
=
"NETOPT_NUMOF"
,
[
NETOPT_CHANNEL
]
=
"NETOPT_CHANNEL"
,
[
NETOPT_IS_CHANNEL_CLR
]
=
"NETOPT_IS_CHANNEL_CLR"
,
[
NETOPT_ADDRESS
]
=
"NETOPT_ADDRESS"
,
[
NETOPT_ADDRESS_LONG
]
=
"NETOPT_ADDRESS_LONG"
,
[
NETOPT_ADDR_LEN
]
=
"NETOPT_ADDR_LEN"
,
[
NETOPT_SRC_LEN
]
=
"NETOPT_SRC_LEN"
,
[
NETOPT_NID
]
=
"NETOPT_NID"
,
[
NETOPT_IPV6_IID
]
=
"NETOPT_IPV6_IID"
,
[
NETOPT_TX_POWER
]
=
"NETOPT_TX_POWER"
,
[
NETOPT_MAX_PACKET_SIZE
]
=
"NETOPT_MAX_PACKET_SIZE"
,
[
NETOPT_PRELOADING
]
=
"NETOPT_PRELOADING"
,
[
NETOPT_PROMISCUOUSMODE
]
=
"NETOPT_PROMISCUOUSMODE"
,
[
NETOPT_AUTOACK
]
=
"NETOPT_AUTOACK"
,
[
NETOPT_ACK_REQ
]
=
"NETOPT_ACK_REQ"
,
[
NETOPT_RETRANS
]
=
"NETOPT_RETRANS"
,
[
NETOPT_PROTO
]
=
"NETOPT_PROTO"
,
[
NETOPT_STATE
]
=
"NETOPT_STATE"
,
[
NETOPT_RAWMODE
]
=
"NETOPT_RAWMODE"
,
[
NETOPT_RX_START_IRQ
]
=
"NETOPT_RX_START_IRQ"
,
[
NETOPT_RX_END_IRQ
]
=
"NETOPT_RX_END_IRQ"
,
[
NETOPT_TX_START_IRQ
]
=
"NETOPT_TX_START_IRQ"
,
[
NETOPT_TX_END_IRQ
]
=
"NETOPT_TX_END_IRQ"
,
[
NETOPT_AUTOCCA
]
=
"NETOPT_AUTOCCA"
,
[
NETOPT_CSMA
]
=
"NETOPT_CSMA"
,
[
NETOPT_CSMA_RETRIES
]
=
"NETOPT_CSMA_RETRIES"
,
[
NETOPT_IS_WIRED
]
=
"NETOPT_IS_WIRED"
,
[
NETOPT_DEVICE_TYPE
]
=
"NETOPT_DEVICE_TYPE"
,
[
NETOPT_CHANNEL_PAGE
]
=
"NETOPT_CHANNEL_PAGE"
,
[
NETOPT_CCA_THRESHOLD
]
=
"NETOPT_CCA_THRESHOLD"
,
[
NETOPT_CCA_MODE
]
=
"NETOPT_CCA_MODE"
,
[
NETOPT_STATS
]
=
"NETOPT_STATS"
,
[
NETOPT_ENCRYPTION
]
=
"NETOPT_ENCRYPTION"
,
[
NETOPT_ENCRYPTION_KEY
]
=
"NETOPT_ENCRYPTION_KEY"
,
[
NETOPT_RF_TESTMODE
]
=
"NETOPT_RF_TESTMODE"
,
[
NETOPT_L2FILTER
]
=
"NETOPT_L2FILTER"
,
[
NETOPT_L2FILTER_RM
]
=
"NETOPT_L2FILTER_RM"
,
[
NETOPT_LAST_ED_LEVEL
]
=
"NETOPT_LAST_ED_LEVEL"
,
[
NETOPT_DEVICE_MODE
]
=
"NETOPT_DEVICE_MODE"
,
[
NETOPT_BANDWIDTH
]
=
"NETOPT_BANDWIDTH"
,
[
NETOPT_SPREADING_FACTOR
]
=
"NETOPT_SPREADING_FACTOR"
,
[
NETOPT_CODING_RATE
]
=
"NETOPT_CODING_RATE"
,
[
NETOPT_SINGLE_RECEIVE
]
=
"NETOPT_SINGLE_RECEIVE"
,
[
NETOPT_RX_TIMEOUT
]
=
"NETOPT_RX_TIMEOUT"
,
[
NETOPT_TX_TIMEOUT
]
=
"NETOPT_TX_TIMEOUT"
,
[
NETOPT_PREAMBLE_LENGTH
]
=
"NETOPT_PREAMBLE_LENGTH"
,
[
NETOPT_INTEGRITY_CHECK
]
=
"NETOPT_INTEGRITY_CHECK"
,
[
NETOPT_CHANNEL_HOP
]
=
"NETOPT_CHANNEL_HOP"
,
[
NETOPT_CHANNEL_HOP_PERIOD
]
=
"NETOPT_CHANNEL_HOP_PERIOD"
,
[
NETOPT_FIXED_HEADER
]
=
"NETOPT_FIXED_HEADER"
,
[
NETOPT_IQ_INVERT
]
=
"NETOPT_IQ_INVERT"
,
[
NETOPT_NUMOF
]
=
"NETOPT_NUMOF"
,
};
const
char
*
netopt2str
(
netopt_t
opt
)
...
...
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