Skip to content

Commit 55309e8

Browse files
Juha Heiskanenjuhhei01
authored andcommitted
ws_llc_asynch_request() API update
Defined own structure where user can define channel list,message type and IE elemt list to header and nested payold.
1 parent 5d9a379 commit 55309e8

File tree

4 files changed

+344
-38
lines changed

4 files changed

+344
-38
lines changed

source/6LoWPAN/ws/ws_common_defines.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#ifndef WS_COMMON_DEFINES_H_
1919
#define WS_COMMON_DEFINES_H_
2020

21+
#define WH_IE_ELEMENT_HEADER_LENGTH 3
2122

2223
/* Header IE Sub elements */
2324
#define WH_IE_UTT_TYPE 1 /**< Unicast Timing and Frame type information */
@@ -29,6 +30,8 @@
2930

3031
#define WS_WP_NESTED_IE 4 /**< WS nested Payload IE element'selement could include mltiple sub payload IE */
3132

33+
#define WS_WP_SUB_IE_ELEMENT_HEADER_LENGTH 2
34+
3235
/* Payload IE sub elements in side WS_WP_NESTED_IE */
3336
#define WP_PAYLOAD_IE_US_TYPE 1 /**< Unicast Schedule information */
3437
#define WP_PAYLOAD_IE_BS_TYPE 2 /**< Broadcast Schedule information */

source/6LoWPAN/ws/ws_llc.h

Lines changed: 64 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,44 @@ struct mcps_data_ind_s;
2323
struct mcps_data_ie_list;
2424
struct channel_list_s;
2525
struct ws_pan_information_s;
26+
struct mlme_security_s;
2627

2728

29+
/**
30+
* @brief wh_ie_sub_list_t ws asynch header IE elemnt request list
31+
*/
32+
typedef struct wh_ie_sub_list_s {
33+
bool utt_ie:1; /**< Unicast Timing and Frame type information */
34+
bool bt_ie:1; /**< Broadcast timing information */
35+
bool fc_ie:1; /**< Flow Control for Extended Direct Frame Exchange */
36+
bool rsl_ie:1; /**< Received Signal Level information */
37+
bool vh_ie:1; /**< Vendor header information */
38+
} wh_ie_sub_list_t;
39+
40+
/**
41+
* @brief wp_nested_ie_sub_list_t ws asynch Nested Payload sub IE element request list
42+
*/
43+
typedef struct wp_nested_ie_sub_list_s {
44+
bool us_ie:1; /**< Unicast Schedule information */
45+
bool bs_ie:1; /**< Broadcast Schedule information */
46+
bool vp_ie:1; /**< Vendor Payload information */
47+
bool pan_ie:1; /**< PAN Information */
48+
bool net_name_ie:1; /**< Network Name information */
49+
bool pan_version_ie:1; /**< Pan configuration version */
50+
bool gtkhash_ie:1; /**< GTK Hash information */
51+
} wp_nested_ie_sub_list_t;
52+
53+
/**
54+
* @brief asynch_request_t Asynch message request parameters
55+
*/
56+
typedef struct asynch_request_s {
57+
unsigned message_type:3; /**< Asynch message type: WS_FT_PAN_ADVERT, WS_FT_PAN_ADVERT_SOL, WS_FT_PAN_CONF or WS_FT_PAN_CONF_SOL. */
58+
wh_ie_sub_list_t wh_requested_ie_list; /**< WH-IE header list to message. */
59+
wp_nested_ie_sub_list_t wp_requested_nested_ie_list; /**< WP-IE Nested IE list to message. */
60+
struct mlme_security_s security; /**< Request MAC security paramaters */
61+
struct channel_list_s channel_list; /**< Channel List. */
62+
} asynch_request_t;
63+
2864
/**
2965
* @brief ws_asynch_ind ws asynch data indication
3066
* @param interface Interface pointer
@@ -61,44 +97,60 @@ void ws_llc_reset(struct protocol_interface_info_entry *interface);
6197
/**
6298
* @brief ws_llc_asynch_request ws asynch message request to all giving channels
6399
* @param interface Interface pointer
64-
* @param asynch_message Asynch message type: WS_FT_PAN_ADVERT, WS_FT_PAN_ADVERT_SOL, WS_FT_PAN_CONF or WS_FT_PAN_CONF_SOL
65-
* @param channel_list Channel list where message is pushed
100+
* @param request Asynch message parameters: type, IE and channel list
66101
*
67102
* @return 0 Asynch message pushed to MAC
68103
* @return -1 memory allocate problem
69104
* @return -2 Parameter problem
70-
* LLC allocate message spesific IE element itself how it is configured
71105
*
72106
*/
73-
int8_t ws_llc_asynch_request(struct protocol_interface_info_entry *interface, uint8_t asynch_message, struct channel_list_s channel_list);
107+
int8_t ws_llc_asynch_request(struct protocol_interface_info_entry *interface, asynch_request_t *request);
74108

75109

76110
/**
77111
* @brief ws_llc_set_vendor_header_data Configure WS vendor Header data information (Data of WH_IE_VH_TYPE IE element)
78112
* @param interface Interface pointer
79-
* @param vendor_header_length configured vendor header length
80113
* @param vendor_header pointer to vendor header this pointer must keep alive when it is configured to LLC
114+
* @param vendor_header_length configured vendor header length
81115
*
82116
*/
83-
void ws_llc_set_vendor_header_data(struct protocol_interface_info_entry *interface, uint8_t vendor_header_length, uint8_t *vendor_header);
117+
void ws_llc_set_vendor_header_data(struct protocol_interface_info_entry *interface, uint8_t *vendor_header, uint8_t vendor_header_length);
84118

85119
/**
86120
* @brief ws_llc_set_vendor_payload_data Configure WS vendor payload data information (Data of WP_PAYLOAD_IE_VP_TYPE IE element)
87121
* @param interface Interface pointer
88-
* @param vendor_payload_length configured vendor payload length
89122
* @param vendor_payload pointer to vendor payload this pointer must keep alive when it is configured to LLC
123+
* @param vendor_payload_length configured vendor payload length
90124
*
91125
*/
92-
void ws_llc_set_vendor_payload_data(struct protocol_interface_info_entry *interface, uint8_t vendor_payload_length, uint8_t *vendor_payload);
126+
void ws_llc_set_vendor_payload_data(struct protocol_interface_info_entry *interface, uint8_t *vendor_payload, uint8_t vendor_payload_length);
93127

94128
/**
95129
* @brief ws_llc_set_network_name Configure WS Network name (Data of WP_PAYLOAD_IE_NETNAME_TYPE IE element)
96130
* @param interface Interface pointer
97131
* @param name_length configured network name length
98-
* @param net_name pointer to network name this pointer must keep alive when it is configured to LLC
132+
* @param name pointer to network name this pointer must keep alive when it is configured to LLC
99133
*
100134
*/
101-
void ws_llc_set_network_name(struct protocol_interface_info_entry *interface, uint8_t name_length, uint8_t *net_name);
135+
void ws_llc_set_network_name(struct protocol_interface_info_entry *interface, uint8_t *name, uint8_t name_length);
136+
137+
/**
138+
* @brief ws_llc_set_broadcast_secudule_info data for braodcast schedule WP_PAYLOAD_IE_BS_TYPE
139+
* @param interface Interface pointer
140+
* @param schedule_info pointer to Configured shedule data
141+
* @param length configured broadcast schedule length
142+
*
143+
*/
144+
void ws_llc_set_broadcast_schecudule_info(struct protocol_interface_info_entry *interface, uint16_t length, uint8_t *schedule_info);
145+
146+
/**
147+
* @brief @brief ws_llc_set_unitcast_secudule_info data for braodcast schedule WP_PAYLOAD_IE_US_TYPE
148+
* @param interface Interface pointer
149+
* @param schedule_info pointer to Configured shedule data
150+
* @param length configured unicast schedule length
151+
*
152+
*/
153+
void ws_llc_set_unitcast_schecudule_info(struct protocol_interface_info_entry *interface, uint8_t *schedule_info, uint16_t length);
102154

103155
/**
104156
* @brief ws_llc_set_gtkhash Configure WS GTK hash information (Data of WP_PAYLOAD_IE_GTKHASH_TYPE IE element)
@@ -117,4 +169,6 @@ void ws_llc_set_gtkhash(struct protocol_interface_info_entry *interface, uint8_
117169
void ws_llc_set_pan_information_pointer(struct protocol_interface_info_entry *interface, struct ws_pan_information_s *pan_information_pointer);
118170

119171

172+
173+
120174
#endif /* WS_LLC_H_ */

0 commit comments

Comments
 (0)