Skip to content

Commit 1e01fe8

Browse files
Merge pull request #3014 from kkrentz/const-pr
frame802154e.ch: Declare ies parameter as const in frame802154e_create_*
2 parents 17097ba + 1a93df5 commit 1e01fe8

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

os/net/mac/framer/frame802154e-ie.c

+8-7
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ create_mlme_long_ie_descriptor(uint8_t *buf, uint8_t sub_id, int ie_len)
137137
/* Header IE. ACK/NACK time correction. Used in enhanced ACKs */
138138
int
139139
frame80215e_create_ie_header_ack_nack_time_correction(uint8_t *buf, int len,
140-
struct ieee802154_ies *ies)
140+
const struct ieee802154_ies *ies)
141141
{
142142
int ie_len = 2;
143143
if(len >= 2 + ie_len && ies != NULL) {
@@ -203,7 +203,8 @@ frame80215e_create_ie_payload_list_termination(uint8_t *buf, int len,
203203
#if TSCH_WITH_SIXTOP
204204
/* Payload IE. 6top. Used to nest sub-IEs */
205205
int
206-
frame80215e_create_ie_ietf(uint8_t *buf, int len, struct ieee802154_ies *ies)
206+
frame80215e_create_ie_ietf(uint8_t *buf, int len,
207+
const struct ieee802154_ies *ies)
207208
{
208209
if(len >= 2 && ies != NULL) {
209210
create_payload_ie_descriptor(buf,
@@ -218,7 +219,7 @@ frame80215e_create_ie_ietf(uint8_t *buf, int len, struct ieee802154_ies *ies)
218219
/* Payload IE. MLME. Used to nest sub-IEs */
219220
int
220221
frame80215e_create_ie_mlme(uint8_t *buf, int len,
221-
struct ieee802154_ies *ies)
222+
const struct ieee802154_ies *ies)
222223
{
223224
int ie_len = 0;
224225
if(len >= 2 + ie_len && ies != NULL) {
@@ -233,7 +234,7 @@ frame80215e_create_ie_mlme(uint8_t *buf, int len,
233234
/* MLME sub-IE. TSCH synchronization. Used in EBs: ASN and join priority */
234235
int
235236
frame80215e_create_ie_tsch_synchronization(uint8_t *buf, int len,
236-
struct ieee802154_ies *ies)
237+
const struct ieee802154_ies *ies)
237238
{
238239
int ie_len = 6;
239240
if(len >= 2 + ie_len && ies != NULL) {
@@ -253,7 +254,7 @@ frame80215e_create_ie_tsch_synchronization(uint8_t *buf, int len,
253254
/* MLME sub-IE. TSCH slotframe and link. Used in EBs: initial schedule */
254255
int
255256
frame80215e_create_ie_tsch_slotframe_and_link(uint8_t *buf, int len,
256-
struct ieee802154_ies *ies)
257+
const struct ieee802154_ies *ies)
257258
{
258259
if(ies != NULL) {
259260
int i;
@@ -290,7 +291,7 @@ frame80215e_create_ie_tsch_slotframe_and_link(uint8_t *buf, int len,
290291
/* MLME sub-IE. TSCH timeslot. Used in EBs: timeslot template (timing) */
291292
int
292293
frame80215e_create_ie_tsch_timeslot(uint8_t *buf, int len,
293-
struct ieee802154_ies *ies)
294+
const struct ieee802154_ies *ies)
294295
{
295296
int ie_len;
296297
if(ies == NULL) {
@@ -316,7 +317,7 @@ frame80215e_create_ie_tsch_timeslot(uint8_t *buf, int len,
316317
/* MLME sub-IE. TSCH channel hopping sequence. Used in EBs: hopping sequence */
317318
int
318319
frame80215e_create_ie_tsch_channel_hopping_sequence(uint8_t *buf, int len,
319-
struct ieee802154_ies *ies)
320+
const struct ieee802154_ies *ies)
320321
{
321322
int ie_len;
322323
if(ies == NULL || ies->ie_hopping_sequence_len > sizeof(ies->ie_hopping_sequence_list)) {

os/net/mac/framer/frame802154e-ie.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ struct ieee802154_ies {
9595
/** Insert various Information Elements **/
9696
/* Header IE. ACK/NACK time correction. Used in enhanced ACKs */
9797
int frame80215e_create_ie_header_ack_nack_time_correction(uint8_t *buf, int len,
98-
struct ieee802154_ies *ies);
98+
const struct ieee802154_ies *ies);
9999
/* Header IE. List termination 1 (Signals the end of the Header IEs when
100100
* followed by payload IEs) */
101101
int frame80215e_create_ie_header_list_termination_1(uint8_t *buf, int len,
@@ -110,23 +110,23 @@ int frame80215e_create_ie_payload_list_termination(uint8_t *buf, int len,
110110
#if TSCH_WITH_SIXTOP
111111
/* Payload IE. 6top. Used to nest sub-IEs */
112112
int frame80215e_create_ie_ietf(uint8_t *buf, int len,
113-
struct ieee802154_ies *ies);
113+
const struct ieee802154_ies *ies);
114114
#endif /* TSCH_WITH_SIXTOP */
115115
/* Payload IE. MLME. Used to nest sub-IEs */
116116
int frame80215e_create_ie_mlme(uint8_t *buf, int len,
117-
struct ieee802154_ies *ies);
117+
const struct ieee802154_ies *ies);
118118
/* MLME sub-IE. TSCH synchronization. Used in EBs: ASN and join priority */
119119
int frame80215e_create_ie_tsch_synchronization(uint8_t *buf, int len,
120-
struct ieee802154_ies *ies);
120+
const struct ieee802154_ies *ies);
121121
/* MLME sub-IE. TSCH slotframe and link. Used in EBs: initial schedule */
122122
int frame80215e_create_ie_tsch_slotframe_and_link(uint8_t *buf, int len,
123-
struct ieee802154_ies *ies);
123+
const struct ieee802154_ies *ies);
124124
/* MLME sub-IE. TSCH timeslot. Used in EBs: timeslot template (timing) */
125125
int frame80215e_create_ie_tsch_timeslot(uint8_t *buf, int len,
126-
struct ieee802154_ies *ies);
126+
const struct ieee802154_ies *ies);
127127
/* MLME sub-IE. TSCH channel hopping sequence. Used in EBs: hopping sequence */
128128
int frame80215e_create_ie_tsch_channel_hopping_sequence(uint8_t *buf, int len,
129-
struct ieee802154_ies *ies);
129+
const struct ieee802154_ies *ies);
130130

131131
/* Parse all Information Elements of a frame */
132132
int frame802154e_parse_information_elements(const uint8_t *buf, uint8_t buf_size,

0 commit comments

Comments
 (0)