-
Notifications
You must be signed in to change notification settings - Fork 3
feat slot config
Describe the per-slot configuration feature in Baloo.
In a given round, it may be that different slots would benefit from different configuration parameters. The slot configuration section (an array of type gmw_slot_config_t
) caters for such cases. In the current implementation of Baloo, the user can select on a per-slot basis
- the number of retransmissions,
- the slot time, and
- the primitive to execute.
This feature is disabled by default.
Available for all supported platforms.
Compatible with all features and communication primitives.
By default, all data slots in a Baloo round use the same configuration parameters. The user can enable the per-slot configuration feature using the following define (typically done in project-conf.h
)
#define GMW_CONF_USE_CONTROL_SLOT_CONFIG 1
Setting this define triggers the inclusion of a gmw_slot_config_t
section in the control structure.
typedef struct __attribute__((packed)) gmw_slot_config {
uint8_t n_retransmissions : 3;
uint8_t slot_time_select : 3; /* ID of desired slot time (see slot_times)*/
uint8_t primitive : 2; /* ID of the primitive to use (0 is Glossy) */
} gmw_slot_config_t;
typedef struct __attribute__((packed)) gmw_control {
/* ... */
#if GMW_CONF_USE_CONTROL_SLOT_CONFIG
gmw_slot_config_t slot_config[GMW_CONF_MAX_SLOTS];
uint8_t slot_time_list[GMW_CONTROL_SLOT_CONFIG_TIMELIST_SIZE];
#endif /* GMW_CONF_USE_CONTROL_SLOT_CONFIG */
/* ... */
} gmw_control_t;
Beware!
Adding thegmw_slot_config_t
section to the control structure does not mean that this section will be sent in the control packet sent by the host! To send this section in a control slot, theGMW_CONTROL_SET_SLOT_CONFIG(control)
instruction must be executed when preparing the control packet.
This sets a flag for the middleware to compile thegmw_slot_config_t
into the control packet.
The per-slot configuration let the user define, independently for each slot in a round:
- The number of retransmissions executed by the primitive (if relevant) (from 0 to 7).
- The desired slot time index (from 0 to 7).
- The desired primitive index (from 0 to 3).
Beware!
The settings from thegmw_slot_config_t
section overwrite those fromgmw_config_t
section. In other words, if the per-slot configuration feature is used, the desired settings for every slot must be defined in thegmw_slot_config_t
.
When the per-slot configuration feature is used, the user can select the desired number of retransmissions (from 0 to 7) for the primitive used in this slot.
Note that, when the number of retransmissions is set to zero, the behavior is (a priori) unknown. This depends on the primitives implementation and should be verified before use.
When the per-slot configuration feature is used, the user can select up to 8 different slot times. This is done using the following defines (in project-conf.h
)
#define GMW_SLOT_TIME_X 8000 /* in us, where X = {0-7} */
In the slot_config
section, the user specifies the desired slot time index (from 0 to 7). The middleware looks up the corresponding slot time and configures the slot accordingly.
Note
The general configuration of the slot times is not affected. Hence, by default slot times can be set with a 500us precision, from 0 to 127.5ms; see the time management page for more details.
When the per-slot configuration feature AND the switching between different primitives is enabled, the user can select up to 4 different primitives. See the corresponding feature page for more details.
The baloo-test-strobing
application (see \examples
) provides an example use this feature: in this example, the slot length changes on per-slot. The strobing primitive is used and the number of retransmissions is set to 4.
This example also illustrates that if the slot time is too short, the execution of the primitive is interrupted by the middleware; in this example, there is not always enough time to send 4 strobes in one slot.