Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mac_ie_lib.h Source File

mac_ie_lib.h

00001 /*
00002  * Copyright (c) 2018, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef MAC_IE_LIB_H_
00019 #define MAC_IE_LIB_H_
00020 
00021 struct mac_payload_IE_s;
00022 struct mac_payload_IE_s;
00023 
00024 /**
00025  * @brief struct mac_nested_payload_IE_t Mac Nested IE Payload information element structure for parsing or write operation
00026  */
00027 typedef struct mac_nested_payload_IE_s {
00028     uint8_t *content_ptr;   /**< Content data */
00029     uint16_t length;        /**< Element length 0- 2047 when type_long true and for short 0- 255*/
00030     unsigned id: 7;         /**< Group ID 4-bit for long and 7 bit for short type */
00031     bool type_long: 1;       /**< True when Nested IE long format and false for short */
00032 } mac_nested_payload_IE_t;
00033 
00034 /** IE header element generic header write */
00035 uint8_t *mac_ie_header_base_write(uint8_t *ptr, uint8_t type, uint16_t length);
00036 
00037 /** IE payload element generic header write */
00038 uint8_t *mac_ie_payload_base_write(uint8_t *ptr, uint8_t type, uint16_t length);
00039 
00040 /** Nested IE long header write */
00041 uint8_t *mac_ie_nested_ie_long_base_write(uint8_t *ptr, uint8_t sub_id, uint16_t length);
00042 
00043 /** Nested IE short header write */
00044 uint8_t *mac_ie_nested_ie_short_base_write(uint8_t *ptr, uint8_t sub_id, uint16_t length);
00045 
00046 /** Payload IE discover for spesific group ID */
00047 uint16_t mac_ie_payload_discover(uint8_t *payload_ptr, uint16_t length, struct mac_payload_IE_s *payload_ie);
00048 
00049 /** Nested IE element discover inside parsed payload element */
00050 uint16_t mac_ie_nested_discover(uint8_t *payload_ptr, uint16_t length, mac_nested_payload_IE_t *nested_ie);
00051 
00052 /** Header IE elemnt discover */
00053 uint8_t mac_ie_header_discover(uint8_t *header_ptr, uint16_t length, struct mac_header_IE_s *header_ie);
00054 
00055 /** Header IE elemnt discover with sub id */
00056 uint8_t mac_ie_header_sub_id_discover(uint8_t *header_ptr, uint16_t length, mac_header_IE_t *header_ie, uint8_t sub_id);
00057 
00058 #endif /* MAC_IE_LIB_H_ */