Skip to content

Commit

Permalink
WS ie library read update
Browse files Browse the repository at this point in the history
WS Header IE read API:
ws_wh_utt_read() & ws_wh_bt_read()

WS Nested Payload read API:
* ws_wp_nested_us_read()
* ws_wp_nested_bs_read()
* ws_wp_nested_pan_read()
* ws_wp_nested_pan_version_read()
* ws_wp_nested_gtkhash_read()

Change-Id: Id9c5d9922cc6e7e6b2322eb413491d8e0c20857e
  • Loading branch information
Juha Heiskanen authored and juhhei01 committed Mar 8, 2018
1 parent 7db0938 commit c553e8c
Show file tree
Hide file tree
Showing 3 changed files with 383 additions and 27 deletions.
91 changes: 91 additions & 0 deletions source/6LoWPAN/ws/ws_common_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,97 @@ typedef struct ws_hopping_schedule_s {
uint_fast24_t ch0_freq; // Default should be derived from regulatory domain
} ws_hopping_schedule_t;

/**
* @brief ws_utt_ie_t WS UTT-IE
*/
typedef struct ws_utt_ie {
uint8_t message_type;
uint_fast24_t ut;
} ws_utt_ie_t;

/**
* @brief ws_bt_ie_t WS BT-IE read
*/
typedef struct ws_bt_ie {
uint16_t broadcast_slot_number;
uint_fast24_t bsi;
} ws_bt_ie_t;


/**
* @brief ws_channel_plan_zero_t WS channel plan 0 define domain and class
*/
typedef struct ws_channel_plan_zero {
uint8_t regulator_domain;
uint8_t operation_class;
} ws_channel_plan_zero_t;

/**
* @brief ws_channel_plan_one_t WS channel plan 1 define ch0, spasing and channel count
*/
typedef struct ws_channel_plan_one {
uint_fast24_t ch0;
unsigned channel_spacing:4;
uint16_t number_of_channel;
} ws_channel_plan_one_t;

/**
* @brief ws_channel_function_zero_t WS function 0 fixed channel
*/
typedef struct ws_channel_function_zero {
uint16_t fixed_channel;
} ws_channel_function_zero_t;

/**
* @brief ws_channel_function_three_t WS function 3 vendor spesific channel hop
*/
typedef struct ws_channel_function_three {
uint8_t channel_hop_count;
uint8_t *channel_list;
} ws_channel_function_three_t;

/**
* @brief ws_us_ie_t WS US-IE read
*/
typedef struct ws_us_ie {
uint8_t dwell_interval;
uint8_t clock_drift;
uint8_t timing_accurancy;
unsigned channle_plan:3;
unsigned channle_function:3;
unsigned excluded_channel_ctrl:2;
union {
ws_channel_plan_zero_t zero;
ws_channel_plan_one_t one;
} plan;
union {
ws_channel_function_zero_t zero;
ws_channel_function_three_t three;
} function;
} ws_us_ie_t;

/**
* @brief ws_bs_ie_t WS BS-IE read
*/
typedef struct ws_bs_ie {
uint32_t broadcast_interval;
uint16_t bsi;
uint8_t dwell_interval;
uint8_t clock_drift;
uint8_t timing_accurancy;
unsigned channle_plan:3;
unsigned channle_function:3;
unsigned excluded_channel_ctrl:2;
union {
ws_channel_plan_zero_t zero;
ws_channel_plan_one_t one;
} plan;
union {
ws_channel_function_zero_t zero;
ws_channel_function_three_t three;
} function;
} ws_bs_ie_t;


#define MPX_KEY_MANAGEMENT_ENC_USER_ID 0x0001 /**< MPX Key management user ID */
#define MPX_LOWPAN_ENC_USER_ID 0xA0ED /**< MPX Lowpan User Id */
Expand Down
Loading

0 comments on commit c553e8c

Please sign in to comment.