Mistake on this page?
Report an issue in GitHub or email us
sch_api_ble.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Link layer scheduler interface file.
6  *
7  * Copyright (c) 2013-2019 Arm Ltd. All Rights Reserved.
8  *
9  * Copyright (c) 2019 Packetcraft, Inc.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 /*************************************************************************************************/
24 
25 #ifndef SCH_API_BLE_H
26 #define SCH_API_BLE_H
27 
28 #include "wsf_types.h"
29 #include "bb_api.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /**************************************************************************************************
36  Macros
37 **************************************************************************************************/
38 
39 /*! \brief Preferred periodicity. */
40 #define SCH_RM_PREF_PER_USEC 10000
41 
42 /*! \brief Lowest perferred periodicity (for cases where intervalMax < SCH_RM_PREF_PER_USEC). */
43 #define SCH_RM_PREF_PER_USEC_LOWEST 5000
44 
45 /*! \brief Preferred periodicity for connections. */
46 #define SCH_RM_PREF_PER_CONN_USEC (SCH_RM_PREF_PER_USEC)
47 
48 /*! \brief Preferred periodicity for periodic sync. */
49 #define SCH_RM_PREF_PER_SYNC_USEC (SCH_RM_PREF_PER_USEC * 4)
50 
51 /**************************************************************************************************
52  Constants
53 **************************************************************************************************/
54 
55 /*! \brief Resource manager preference for setting interval. */
56 enum
57 {
58  SCH_RM_PREF_PERFORMANCE, /*!< Performance is preferred, search from minimum interval. */
59  SCH_RM_PREF_CAPACITY /*!< Capacity is preferred, search from maximum interval. */
60 };
61 
62 /**************************************************************************************************
63  Data Types
64 **************************************************************************************************/
65 
66 /*! \brief Get reference time callback signature. */
67 typedef uint32_t (*GetRefTimeCb_t)(uint8_t handle, uint32_t *pDurUsec);
68 
69 /*! \brief Get topology reference time callback signature. */
70 typedef uint32_t (*GetTopRefTimeCb_t)(uint8_t handle);
71 
72 /**************************************************************************************************
73  Function Declarations
74 **************************************************************************************************/
75 
76 /* Resource manager */
77 void SchRmInit(void);
78 uint32_t SchRmCalcCommonPeriodicityUsec(uint32_t peerPerUsec);
79 bool_t SchRmAdd(uint8_t handle, uint8_t pref, uint32_t minUsec, uint32_t maxUsec, uint32_t durUsec, uint32_t *pInterUsec, GetRefTimeCb_t refTimeCb);
80 bool_t SchRmStartUpdate(uint8_t handle, uint32_t minUsec, uint32_t maxUsec, uint32_t perfPerUsec, uint32_t durUsec, uint32_t *pInterUsec);
81 void SchRmCommitUpdate(uint8_t handle);
82 void SchRmRemove(uint8_t handle);
83 uint32_t SchRmGetOffsetUsec(uint32_t maxOffsUsec, uint8_t handle, uint32_t refTime);
84 
85 /* Topology manager */
86 void SchTmInit(void);
87 void SchTmAdd(uint8_t handle, uint32_t interUsec, uint32_t durUsec, bool_t movable, GetTopRefTimeCb_t refTimeCb);
88 void SchTmRemove(uint8_t handle);
89 
90 /* BLE time utilities */
91 uint32_t SchBleCalcDataPktDurationUsec(uint8_t phy, uint16_t len);
92 uint32_t SchBleCalcAdvPktDurationUsec(uint8_t phy, uint8_t phyOptions, uint16_t len);
93 uint32_t SchBleCalcPerAdvDurationUsec(uint8_t txPhy, uint8_t fragLen, uint16_t addMafDelay, uint16_t len, bool_t worstCase, uint8_t phyOptions);
94 uint32_t SchBleCalcAuxPktDurationUsec(uint8_t phy, uint8_t phyOptions, uint16_t len);
95 void SchBleCalcAdvOpDuration(BbOpDesc_t *pBod, uint8_t fragLen);
96 bool_t SchBleGetNextMstConnDueTime(uint32_t *pDueTime);
97 uint32_t SchBleGetAlignedAuxOffsUsec(uint32_t auxOffsUsec);
98 
99 #ifdef __cplusplus
100 };
101 #endif
102 
103 #endif /* SCH_API_BLE_H */
uint32_t(* GetRefTimeCb_t)(uint8_t handle, uint32_t *pDurUsec)
Get reference time callback signature.
Definition: sch_api_ble.h:67
Platform-independent data types.
uint32_t(* GetTopRefTimeCb_t)(uint8_t handle)
Get topology reference time callback signature.
Definition: sch_api_ble.h:70
Baseband interface file.
Baseband operation descriptor (BOD).
Definition: bb_api.h:149
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.