################################# (Re-)Configuration options ################################# TAISC offers a lot of configuration options in order to tweak settings of the physical layer and the MAC layer. This chapter will give an overview of which configuration options are open for developers, and how they can be tweaked. ********************* Configuration options ********************* **Global variables:** +-----------------------------------+-----------------------------------------------+ | Configuration option | Description | +===================================+===============================================+ | active radio config index | If there are multiple radio configurations | | | available, pass the index of the one that | | | needs to be activated | +-----------------------------------+-----------------------------------------------+ | Radio configurations | List of pointers to radio configurations | +-----------------------------------+-----------------------------------------------+ | macPANId | PAN identification (used for frame filter) | +-----------------------------------+-----------------------------------------------+ | macShortAddress | 2 byte node address (used for frame filter) | +-----------------------------------+-----------------------------------------------+ | macExtendedAddress | 8 byte node address (used for frame filter) | +-----------------------------------+-----------------------------------------------+ | phyCurrentChannel | radio phyCurrentChannel | +-----------------------------------+-----------------------------------------------+ | phyTXPower | 2 byte node address (used for frame filter) | +-----------------------------------+-----------------------------------------------+ | promiscous | Is frame filtering enabled? | +-----------------------------------+-----------------------------------------------+ | autoAck | Auto acknowledge incoming frame (if ack | | | request bit is set) | +-----------------------------------+-----------------------------------------------+ | ccaMode | Set the CCA mode to: disabled, technology | | | detection, threshold, hybrid | +-----------------------------------+-----------------------------------------------+ | ccaHyst | CCA hysterisis value | +-----------------------------------+-----------------------------------------------+ | ccaThres | CCA threshold value | +-----------------------------------+-----------------------------------------------+ | radioBandwidth | Bandwidth of the wireless signal | +-----------------------------------+-----------------------------------------------+ | radioSamplingRate | Sampling rate of the radio | +-----------------------------------+-----------------------------------------------+ ****************************************** How to perform (re)-configuration ****************************************** The configuration of MAC- and physical layer can either be passed at compile time, or at runtime At compile time =============== At compile time, TAISC loads a set of default parameters. These values can be altered freely, by altering them directly in: * lower_mac/chains/globals.h : offers a set of parameters which are shared between all radio programs; * lower_mac/chains/-chain.c : offers a set of parameters which are specific for a certain MAC protocol. At runtime =============== TAISC allows for parameters to be changed at runtime. In order to expose a parameter to the upper layers, a compile attribute should be added: .. centered:: `__attribute__((annotate("configurable")))` If this attribute is added, the parameter is automatically placed in the parameter repository of contiki. E.g.: .. code-block:: c { { TAISC_IEEE802154_macPANId , WISHFUL_UINT16 , 2 }, global_ctrl_getParameter, global_ctrl_setParameter} } The Contiki parameter repository knows the name, type and size of the parameter. Also a getter and setter function are passed, in order to control the parameter. By using these getters and setters, it becomes straightfoward to control the parameters without knowledge about the internals of TAISC. .. code-block:: c static void* global_ctrl_getParameter(param_t* parameter){ ... } error_t set_global_parameter(uint16_t parameter_id, void* new_value, uint16_t length){ ... } All these exposed parameters are automatically made available to wishful (see wishful documentation).