DMM API Reference
3.20.00.07
|
Dual Mode Policy Manager.
The DMMPolicy interface provides a service to for the stack applications to update the priority of the stack activities, which is then used to make scheduling decisions.
.state: the name of the application state .weight: amount of adjusted priority for stack activities specified in .appliedActivity .timingConstraint: reserved for future usage .pause: whether or not the specified stack's application is paused during the state .appliedActivity: Specified the activities of which priority is/are adjusted by .weight
To use the DMMPolicy module to set the scheduling policy, the application calls the following APIs:
An example of a policy table (define in ti_dmm_application_policy.c, which is generated by SysConfig)
#include "stdint.h"
#include <ti/drivers/rf/RF.h>
Go to the source code of this file.
Classes | |
struct | DMMPolicy_State |
Structure used to define a DMM Policy. More... | |
struct | DMMPolicy_Policy |
Structure used to decide the policy for a particular stack state. More... | |
struct | DMMPolicy_StackCmdIndexTable |
Structure used to define a stack command index table. Reserved for future usage. More... | |
struct | DMMPolicy_PolicyTable |
policy table entry More... | |
struct | StackActivity |
Stack Activity data struct. More... | |
struct | GlobalTable |
Global Priority Table data struct. More... | |
struct | DMMPolicy_CurrentInfo |
Policy Information dynamically updated. More... | |
struct | DMMPolicy_Params |
RF parameter struct DMM Scheduler parameters are used with the DMMPolicy_open() and DMMPolicy_Params_init() call. More... | |
struct | DMMPolicy_AppCbs_t |
Structure for app callbacks. More... | |
Macros | |
#define | BLE_STACK_POLICY_IDX 0 |
BLE stack is always the first policy. More... | |
#define | PRIORITY_NUM 3 |
The number of priority for stack activities. More... | |
#define | DMMPolicy_updateStackState DMMPolicy_updateApplicationState |
To maintain compatibility, define old DMMPolicy_updateStackState function as new DMMPolicy_updateApplicationState function. | |
#define | DMM_GLOBAL_PRIORITY(activity, level, weight) {(activity << 16 | level), weight} |
global priority table More... | |
DMM Policy | |
#define | DMMPOLICY_NUM_STACKS 2 |
Number of RF driver clients supported. | |
#define | DMMPOLICY_PRIORITY_LOW 0 |
Low priority used when using application states instead of GPT. | |
#define | DMMPOLICY_PRIORITY_HIGH 1 |
High priority used when using application states instead of GPT. | |
#define | DMMPOLICY_TIME_NONE_CRITICAL 0 |
Stack commands can be delayed when using application states instead of GPT. | |
#define | DMMPOLICY_TIME_CRITICAL 1 |
Stack commands cannot be delayed when using application states instead of GPT. | |
#define | DMMPOLICY_TIME_RESERVED 1 |
Stack commands allow delay settings are not overwritten. | |
#define | DMMPOLICY_NOT_PAUSED 0 |
Stack pause callback is not called for application states including this. | |
#define | DMMPOLICY_PAUSED 0x0001 |
Stack pause callback is called for application states including this. | |
#define | DMMPOLICY_SCHEDULE_BLOCKED 0x0002 |
reserve for future usage | |
#define | DMMPOLICY_BALANCED_NONE 0 |
Does not use balanced mode. | |
#define | DMMPOLICY_BALANCED_TIME_BM_1 0x80000000 |
Balanced mode is time (MSB = 1) | |
#define | DMMPOLICY_BALANCED_TIME_MODE_1(onMin, offMax) (DMMPOLICY_BALANCED_TIME_BM_1 | (onMin & 0xFFF) | ((offMax & 0xFFF) << 12)) |
macro for defining balanced mode on/off time | |
#define | DMMPOLICY_BALANCED_TIME_MODE_1_ON_MIN(RatioTime) (RatioTime & 0xFFF) |
macro for defining balanced mode on time | |
#define | DMMPOLICY_BALANCED_TIME_MODE_1_OFF_MAX(RatioTime) ((RatioTime & 0xFFF000) >> 12) |
macro for defining balanced mode off time | |
#define | DMMPOLICY_APPLIED_ACTIVITY_NONE 0 |
Activity state where there is no activity. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_ALL 0xFFFF |
Activity state to define any activity. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_BLE_CONNECTION 0x0001 |
Activity state where BLE Connection is ongoing. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_BLE_LINK_EST 0x0002 |
Activity state where BLE link is being established. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_BLE_BROADCASTING 0x0004 |
Activity state where BLE is broadcasting. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_BLE_OBSERVING 0x0008 |
Activity state where BLE is observing. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_154_DATA 0x0001 |
Activity state where 15.4 data is being sent or received. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_154_LINK_EST 0x0002 |
Activity state where 15.4 link is being established. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_154_TX_BEACON 0x0004 |
Activity state where 15.4 is transmitting a beacon. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_154_RX_BEACON 0x0008 |
Activity state where 15.4 is receiving a beacon. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_154_FH 0x0010 |
Activity state where 15.4 is ongoing frequency hopping. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_154_SCAN 0x0020 |
Activity state where 15.4 scanning. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_154_RXON 0x0040 |
Activity state where 15.4 is receiving. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_WSN_RETRANSMIT 0x0001 |
Activity state where WSN is retransmitting. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_WSN_TRANSMIT 0x0002 |
Activity state where WSN is transmitting. | |
#define | DMMPOLICY_APPLIED_ACTIVITY_WSN_RECEIVE 0x0004 |
Activity state where WSN is receiving. | |
DMM Priority | |
#define | DMM_PRIORITY_MAX_LIMIT 250 |
Maximum stack priority. | |
#define | DMM_PRIORITY_MAX_CHANGE_LIMIT 185 |
Maximum change limit of a stack priority. | |
Typedefs | |
typedef void(* | DMMPolicy_appPauseCb_t) (uint16_t pause) |
Callback function type for app pause/reseume. | |
Enumerations | |
enum | DMMPolicy_StackRole { DMMPolicy_StackRole_invalid = 0, DMMPolicy_StackRole_BlePeripheral, DMMPolicy_StackRole_WsnNode, DMMPolicy_StackRole_154Sensor, DMMPolicy_StackRole_154Collector, DMMPolicy_StackRole_ZigbeeEndDevice, DMMPolicy_StackRole_ZigbeeRouter, DMMPolicy_StackRole_ZigbeeCoordinator, DMMPolicy_StackRole_custom1, DMMPolicy_StackRole_custom2 } |
the stack roles supported More... | |
enum | PriorityDef { DMM_StackPNormal =0, DMM_StackPHigh, DMM_StackPUrgent } |
Stack Activity Priority. More... | |
enum | DMMPolicy_Status { DMMPolicy_StatusError, DMMPolicy_StatusNoPolicyError, DMMPolicy_StatusParamError, DMMPolicy_StatusSuccess } |
Status codes for various DMM Policy functions. More... | |
Functions | |
void | DMMPolicy_Params_init (DMMPolicy_Params *params) |
Function to initialize the DMMPolicy_Params struct to its defaults. More... | |
void | DMMPolicy_registerAppCbs (DMMPolicy_AppCbs_t AppCbs, DMMPolicy_StackRole StackRole) |
Register the application policy callbacks. More... | |
void | DMMPolicy_init (void) |
Function that initializes the DMMPolicy module. More... | |
DMMPolicy_Status | DMMPolicy_open (DMMPolicy_Params *params) |
Function to open the DMMPolicy module. More... | |
DMMPolicy_Status | DMMPolicy_updateApplicationState (DMMPolicy_StackRole StackRole, uint32_t newState) |
Updates the policy used to make scheduling decisions. More... | |
uint16_t | DMMPolicy_getGlobalPriority (uint32_t activity, uint32_t stackID) |
Get the global activity based on stack activity. More... | |
uint8_t | DMMPolicy_getDefaultPriority (uint32_t stackID) |
Get the default priority. More... | |
void | DMMPolicy_setStackID (uint32_t stackID, DMMPolicy_StackRole StackRole) |
Get the global activity based on stack activity. More... | |
uint16_t | DMMPolicy_getPauseValue (uint32_t stackID) |
Get the pause value from the current policy. More... | |
uint16_t | DMMPolicy_getTimeConstraintValue (uint32_t stackID) |
Get the time constraint value from the current policy. More... | |
bool | DMMPolicy_getGPTStatus (void) |
check if the global priority table is available More... | |
bool | DMMPolicy_setBlockModeOn (DMMPolicy_StackRole StackRole) |
Turn on Block mode. More... | |
bool | DMMPolicy_setBlockModeOff (DMMPolicy_StackRole StackRole) |
Turn off Block mode. More... | |
bool | DMMPolicy_getBlockModeStatus (DMMPolicy_StackRole StackRole) |
Get Block mode status. More... | |
#define BLE_STACK_POLICY_IDX 0 |
BLE stack is always the first policy.
BLE stack is always the first policy
#define DMM_GLOBAL_PRIORITY | ( | activity, | |
level, | |||
weight | |||
) | {(activity << 16 | level), weight} |
global priority table
macro for getting the global priority
#define PRIORITY_NUM 3 |
The number of priority for stack activities.
The number of priority for stack activities
enum DMMPolicy_StackRole |
the stack roles supported
enum DMMPolicy_Status |
Status codes for various DMM Policy functions.
RF_Stat is reported as return value for DMM Policy functions.
Enumerator | |
---|---|
DMMPolicy_StatusError | Error. |
DMMPolicy_StatusNoPolicyError | Error with policy table. |
DMMPolicy_StatusParamError | Parameter Error. |
DMMPolicy_StatusSuccess | Function finished with success. |
enum PriorityDef |
bool DMMPolicy_getBlockModeStatus | ( | DMMPolicy_StackRole | StackRole | ) |
Get Block mode status.
StackRole | stack role associated with Task handle |
return True: Block Mode is On, False: Block Mode is Off
uint8_t DMMPolicy_getDefaultPriority | ( | uint32_t | stackID | ) |
Get the default priority.
stackID | Stack ID (uint32_t) |
uint16_t DMMPolicy_getGlobalPriority | ( | uint32_t | activity, |
uint32_t | stackID | ||
) |
Get the global activity based on stack activity.
activity | Stack Activity |
stackID | Stack ID |
bool DMMPolicy_getGPTStatus | ( | void | ) |
check if the global priority table is available
uint16_t DMMPolicy_getPauseValue | ( | uint32_t | stackID | ) |
Get the pause value from the current policy.
stackID | Stack ID |
uint16_t DMMPolicy_getTimeConstraintValue | ( | uint32_t | stackID | ) |
Get the time constraint value from the current policy.
stackID | Stack ID |
void DMMPolicy_init | ( | void | ) |
Function that initializes the DMMPolicy module.
DMMPolicy_Status DMMPolicy_open | ( | DMMPolicy_Params * | params | ) |
Function to open the DMMPolicy module.
params | An pointer to RF_Params structure for initialization |
void DMMPolicy_Params_init | ( | DMMPolicy_Params * | params | ) |
Function to initialize the DMMPolicy_Params struct to its defaults.
params | An pointer to RF_Params structure for initialization |
void DMMPolicy_registerAppCbs | ( | DMMPolicy_AppCbs_t | AppCbs, |
DMMPolicy_StackRole | StackRole | ||
) |
Register the application policy callbacks.
AppCbs | application callback take |
StackRole | application stack role |
bool DMMPolicy_setBlockModeOff | ( | DMMPolicy_StackRole | StackRole | ) |
Turn off Block mode.
StackRole | stack role associated with Task handle |
bool DMMPolicy_setBlockModeOn | ( | DMMPolicy_StackRole | StackRole | ) |
Turn on Block mode.
StackRole | stack role associated with Task handle |
void DMMPolicy_setStackID | ( | uint32_t | stackID, |
DMMPolicy_StackRole | StackRole | ||
) |
Get the global activity based on stack activity.
stackID | Stack ID |
StackRole | DMMPolicy_StackRole |
DMMPolicy_Status DMMPolicy_updateApplicationState | ( | DMMPolicy_StackRole | StackRole, |
uint32_t | newState | ||
) |
Updates the policy used to make scheduling decisions.
StackRole | The stack role that has changed state |
newState | The state the stack has changed to |