Hardware Functions


Functions

void fwHw_clear ()
bool fwHw_createType (string pHardwareType, int pType)
bool fwHw_removeType (string pHardwareType)
void fwHw_getTypes (dyn_string &pHardwareTypesList, dyn_int &pTypesList)
bool fwHw_createRegisters (string pHardwareType, dyn_string pRegistersList, dyn_int pRegistersTypeList)
bool fwHw_removeRegisters (string pHardwareType, dyn_string pRegistersList=makeDynString())
bool fwHw_getRegisters (string pHardwareType, dyn_string &pRegistersList, dyn_int &pRegistersTypeList)
bool fwHw_insert (string pHardwareType, string pHardwareTypeInsert, string pHardware)
bool fwHw_removeInserted (string pHardwareType, string pHardware)
bool fwHw_getInsert (string pHardwareType, dyn_dyn_string &pHardwaresList)
bool fwHw_create (string pHardwareType, string pHardware, bool pDefaultSettings=false)
bool fwHw_remove (string pHardwareType, string pHardware)
bool fwHw_clone (string pHardwareOriginal, string pHardwareClone)
bool fwHw_get (string pHardwareType, dyn_string &pHardwaresList)
bool fwHw_setCommonSettings (string pHardware, dyn_anytype pSettingsList, bool pRecursiveFlag=true, bool keepOld=1)
bool fwHw_getCommonSettings (string pHardware, dyn_anytype &pSettingsList)
bool fwHw_setDefaultCommonSettings (string pHardwareType, dyn_anytype pSettingsList)
bool fwHw_getDefaultCommonSettings (string pHardwareType, dyn_anytype &pSettingsList)
bool fwHw_setSpecificSettings (string pHardware, dyn_string pRegistersList, dyn_dyn_anytype pSettingsList)
bool fwHw_getSpecificSettings (string pHardware, dyn_string pRegistersList, dyn_dyn_anytype &pSettingsList)
bool fwHw_setDefaultSpecificSettings (string pHardwareType, dyn_string pRegistersList, dyn_dyn_anytype pSettingsList)
bool fwHw_getDefaultSpecificSettings (string pHardwareType, dyn_string pRegistersList, dyn_dyn_anytype &pSettingsList)
int fwHw_applyDefaultSettings (string pHardwareType, string pHardware, string pDefHw="")
bool fwHw_subscribe (string hw)
bool fwHw_subscribeType (string hwType)
bool fwHw_unsubscribe (string hw)
bool fwHw_unsubscribeType (string hwType)
void fwHw_clearSubscriptions ()
void _fwHw_getRegisterTypes (int pType, dyn_string &pRegisterTypesList)
void _fwHw_getCommonSettingsDescription (int pType, dyn_string &pSettingsDescriptionList, dyn_bool &pSettingsHexadecimalList)
void _fwHw_getSpecificSettingsDescription (int pHardwareType, int pRegisterType, dyn_string &pSettingsDescriptionList, dyn_bool &pSettingsHexadecimalList)

Detailed Description

List of functions to define (model) and configure hardwares/registers. A hardware type can be created holding registers or other inserted hardware types. Common (e.g. CCPC name) and specific (varies from register type to register type - e.g. addresses ) settings can be defined. Also default values can be specified from which the actual values can be derived. Subscribing to a register means: The settings are sent via a DIM command to the server, where they are stored in a list. DIM commands and services are created on server and client side, thus enabling the communication between them for accessing a register. Four major groups of functions can be identified: from fwHw_createType to fwHw_getInsert functions are listed to manipulate hardware types (datapoint type). From fwHw_create to fwHw_get the functions deal with hardwares, the instances of hardware types, followed by the functions to set and get the various settings. At the end the functions to subscribe to the registers (establishing communication with the server) are listed together with some internal functions to retrieve the correct order and description of the common and specific settings.

The functions' insert parameter 'pHardwareType' (e.g. Tell1Board) does always relate to the type of a hardware whereas 'pHardware' relates to the instance of a hardware (e.g. myTell1Board).

Note: To start a monitoring service you have to use the fwCcpc framework as well as for manipulating the various registers on real hardware (read and write access). See http://lhcb-online.web.cern.ch/lhcb-online/ecs/PVSS_CCPC/default.html


Function Documentation

void _fwHw_getCommonSettingsDescription ( int  pType,
dyn_string &  pSettingsDescriptionList,
dyn_bool &  pSettingsHexadecimalList 
)

This function is intended for information only: It gives the description and correct order of the common settings.

Parameters:
[in] pType the hardware type (SPECS, CCPC) for which the common settings are demanded.
[out] pSettingsDescriptionList returned list with the common settings description.
[out] pSettingsHexadecimalList returned list of booleans to identify whether a hexadecimal number is expected. (false = no hex)
Example:

  (...)

  dyn_string DescriptionList;
  dyn_bool HexId;
  string dummy;

     _fwHw_getCommonSettingsDescription(FWHW_GENERIC, DescriptionList, HexId);   // get the list of common settings (in the right order)
     DebugTN("Available Register Types:");                                   // together with the indicators for hexadecimal numbers
     for(i = 1; i <= dynlen(Registers); i++){ 
        if(HexId[i] == true)
           dummy = "a hexadecimal number";
        else
           dummy = "not a hexadecimal number";
                             
         DebugTN(DescriptionList[i] + "is" + dummy);
      }
  (...)



void _fwHw_getRegisterTypes ( int  pType,
dyn_string &  pRegisterTypesList 
)

This function is intended for information only: It returns a list of all possible register types.

Parameters:
[in] pType the hardware type (GENERIC, SPECS, CCPC) for which the possible register types are demanded.
[out] pRegisterTypesList returned list with the allowed register types.
Example:

  (...)

  dyn_string Registers;

     _fwHw_getRegisterTypes(FWHW_GENERIC, Registers);   // get the list of available registers
     DebugTN("Available Register Types:");
     for(i = 1; i <= dynlen(Registers); i++)                             
         DebugTN(Registers[i]);
  (...)



void _fwHw_getSpecificSettingsDescription ( int  pHardwareType,
int  pRegisterType,
dyn_string &  pSettingsDescriptionList,
dyn_bool &  pSettingsHexadecimalList 
)

This function is intended for information only: It gives the description and correct order of the specific settings of a certain type of register.

Parameters:
[in] pHardwareType the hardware type (SPECS, CCPC) for which the specific settings are demanded.
[in] pRegisterType the register type (e.g. FHWH_I2C) for which the specific settings are demanded.
[out] pSettingsDescriptionList returned list with the specific settings description.
[out] pSettingsHexadecimalList returned list of booleans to identify whether a hexadecimal number is expected. (false = no hex)
Example:

  (...)

  dyn_string DescriptionList;
  dyn_bool HexId;
  string dummy;

     _fwHw_getSpecificSettingsDescription(FWHW_CCPC, FWHW_I2C, DescriptionList, HexId);   // get the list of specific settings (in the right order)
     DebugTN("Available Register Types:");                                   // together with the indicators for hexadecimal numbers
     for(i = 1; i <= dynlen(Registers); i++){ 
        if(HexId[i] == true)
           dummy = "a hexadecimal number";
        else
           dummy = "not a hexadecimal number";
                             
         DebugTN(DescriptionList[i] + "is expected to be represented as " + dummy);
      }
  (...)



int fwHw_applyDefaultSettings ( string  pHardwareType,
string  pHardware,
string  pDefHw = "" 
)

This function applies the default settings (common and specific) to a certain hardware.

Parameters:
[in] pHardwareType name of the hardware type where the default settings belong to.
[in] pHardware name of the hardware where the default settings shall be applied to.
[in] pDefHw a reference hardware can be specified from where the settings shall be taken. If left empty the settings from hardware '_defaultSettings...' (which actually stores the default settings) is taken.
Returns:
true no error found.

false error found.

Example:

  (...)

  if (fwHw_applyDefaultSettings("Tell1Board", "myTell1Board"))   // apply the default settings to 'myTell1Board'
     DebugTN("Default settings applied to hardware 'myTell1Board');
  else
     DebugTN("Error found!");

  (...)



void fwHw_clear (  ) 

This function clears the entire system (datapoints will be removed and all the DIM services & commands will be unsubscribed). This function should be used with ***EXTREME CAUTION***, since all data will be LOST!!!

Returns:
void (nothing)
Example:

  (...)
  fwHw_clear();   // clear the entire system
  DebugTN("The system is clear!");
  (...)



void fwHw_clearSubscriptions (  ) 

This function clears the entire system from any subscription.

Example:

  (...)

  fwHw_clearSubscriptions();   // unsubscribe all registers 
  DebugTN("System cleared - all registers unsubscribed!");  
                                 
  (...)



bool fwHw_clone ( string  pHardwareOriginal,
string  pHardwareClone 
)

This function will "clone" an existing hardware to another one. Note: All the settings of the "clone" will be identical to the "original".

Parameters:
[in] pHardwareOriginal name of the hardware to be "cloned".
[in] pHardwareClone name of the "clone" (hardware). Note: all the settings of the "clone" (common and specific for each register) will be the same as the "original" hardware.
Returns:
true no error found.

false error found.

Example:

  (...)
  if (fwHw_clone("myBeetle1", "myBeetle2"))   // "clone" hardware 'myBeetle1' to hardware 'myBeetle2'
     (...)
  else
     DebugTN("Error found!");
  (...)



bool fwHw_create ( string  pHardwareType,
string  pHardware,
bool  pDefaultSettings = false 
)

This function will create a new hardware of the specified hardware type. In terms of programming languages: an instance of an existing object type is created.

Parameters:
[in] pHardwareType type of the hardware to be created.
[in] pHardware name of the hardware to be created.
[in] pDefaultSettings if true, the default specific settings will be applied to the created hardware. These default specific settings will, also, be applied to the hardwares that have been "inserted". Otherwise (false) the default specific settings will be empty for the created hardware. Note: this parameter is optional (if not specified, then it will be assumed as being false).
Returns:
true no error found.

false error found.

Example:

  (...)
  if (fwHw_create("Beetle", "myBeetle1"))   // create a new hardware called 'myBeetle1' of type 'Beetle'
     (...)
  else
     DebugTN("Error found!");
  (...)



bool fwHw_createRegisters ( string  pHardwareType,
dyn_string  pRegistersList,
dyn_int  pRegistersTypeList 
)

This function populates a hardware type with registers (datapoint elements). It will create new register(s), of a certain type, belonging to the specified hardware type.

Parameters:
[in] pHardwareType name of the hardware type where to create the new register(s).
[in] pRegistersList list containing the name(s) of the register(s) to be created.
[in] pRegistersTypeList list containing the type(s) of the register(s) to be created.
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_string registers;
  dyn_int    types;

  registers = makeDynString("myReg01", "myReg02");
  types = makeDynInt(FWHW_I2C, FWHW_PBUS);

  if (fwHw_createRegisters("Beetle", registers, types))   // create two new registers called 'myReg01' (of type I2C) and
     (...)                                                // 'myReg02' (of type PBUS) into hardware type 'Beetle'
  else
     DebugTN("Error found!");
  (...)



bool fwHw_createType ( string  pHardwareType,
int  pType 
)

This function will create a new hardware type. In this state its only element is a dyn_string for holding the common settings. Registers are implemented later on with the function fwHw_createRegisters. An instance is also created for holding the default settings ("_defaultSettings").

Parameters:
[in] pHardwareType name of the hardware type to be created.
[in] pType type of the hardware (GENERIC, SPECS or CCPC). Note: these types are represented by the constants FWHW_GENERIC, FWHW_SPECS and FWHW_CCPC.
Returns:
true no error found.

false error found.

Example:

  (...)
  if (fwHw_createType("Beetle", FWHW_SPECS))   // create a new hardware type called 'Beetle' of type SPECS
     (...)
  else
     DebugTN("Error found!");
  (...)



bool fwHw_get ( string  pHardwareType,
dyn_string &  pHardwaresList 
)

This function returns a list containing all existing hardwares of the specified type.

Parameters:
[in] pHardwareType type of hardware to be returned.
[out] pHardwaresList list containing all existing hardwares of the specified type.
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_string myList;
  int        i;

  if (fwHw_get("Beetle", myList))   // get a list of existing hardwares of type 'Beetle'
  {
     DebugTN("Existing hardwares: " + dynlen(myList));   // display number of existing hardwares
     for(i = 1; i <= dynlen(myList); i++)
        DebugTN(myList[i]);
  }
  else
     DebugTN("Error found!");
  (...)



bool fwHw_getCommonSettings ( string  pHardware,
dyn_anytype &  pSettingsList 
)

This function returns the list of common settings of the specified hardware.

Parameters:
[in] pHardware name of the hardware where to get the common settings from.
[out] pSettingsList list to be returned with the common settings.
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_anytype myList;
  int         i;

  if (fwHw_getCommonSettings("myBeetle1", myList))   // get the list of common settings of hardware 'myBeetle1'
     for(i = 1; i <= dynlen(myList); i++)
        DebugTN(myList[i]);
  else
     DebugTN("Error found!");
  (...)



bool fwHw_getDefaultCommonSettings ( string  pHardwareType,
dyn_anytype &  pSettingsList 
)

This function returns the list of default common settings of the specified hardware type.

Parameters:
[in] pHardwareType name of the hardware type where to get the default common settings from.
[out] pSettingsList list to be returned with the default common settings.
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_anytype myList;
  int         i;

  if (fwHw_getDefaultCommonSettings("Beetle", myList))   // get the list of default common settings of hardware type 'Beetle'
     for(i = 1; i <= dynlen(myList); i++)
        DebugTN(myList[i]);
  else
     DebugTN("Error found!");
  (...)



bool fwHw_getDefaultSpecificSettings ( string  pHardwareType,
dyn_string  pRegistersList,
dyn_dyn_anytype &  pSettingsList 
)

This function returns the list of default specific settings of a set of registers belonging to the specified hardware type.

Parameters:
[in] pHardwareType name of the hardware type where the register(s) is/are.
[in] pRegistersList list containing the registers where to get the default specific settings from.
[out] pSettingsList returned list with the default specific settings of each register.
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_dyn_anytype mySettings;
  dyn_string      myRegisters;
  int             i;
  int             j;

  dynAppend(myRegisters, "myReg01");
  dynAppend(myRegisters, "myReg02");

  if (fwHw_getDefaultSpecificSettings("Beetle", myRegisters, mySettings))   // get the list of default specific settings of register 'myReg01'
     for(i = 1; i <= dynlen(myRegisters); i++)                              // and 'myReg02' that are in hardware type 'Beetle'
     {
        DebugTN("Register " + myRegisters[i] + " has the following default specific settings:");
        for(j = 1; j <= dynlen(mySettings[i]); j++)
           DebugTN(mySettings[i][j]);
     }
  else
     DebugTN("Error found!");
  (...)



bool fwHw_getInsert ( string  pHardwareType,
dyn_dyn_string &  pHardwaresList 
)

This function returns a list containing the "inserted" hardwares (and their respective type) of the specified hardware type.

Parameters:
[in] pHardwareType name of the hardware type where to get the list of "inserted" hardwares.
[out] pHardwaresList list containing the "inserted" hardwares (and their respective types).
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_dyn_string myList;
  int            i;

  if (fwHw_getInsert("Tell1", myList))   // get the list of "inserted" hardwares of hardware type 'Tell1'
  {
     DebugTN("Existing 'inserted' hardwares: " + dynlen(myList));   // display number of existing "inserted" hardwares
     for(i = 1; i <= dynlen(myList); i++)
        DebugTN("Hardware " + myList[i][1] + " is of type " + myList[i][2]);
  }
  else
     DebugTN("Error found!");
  (...)



bool fwHw_getRegisters ( string  pHardwareType,
dyn_string &  pRegistersList,
dyn_int &  pRegistersTypeList 
)

This function returns all registers (including their respective types) of a certain hardware type.

Parameters:
[in] pHardwareType hardware type where to get the registers from.
[out] pRegistersList list containing all existing registers of the specified hardware type.
[out] pRegistersTypeList list containing the types of the registers. Note: the type of the register will be the same as the one specified when the register was created.
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_string registers;
  dyn_int    types;
  int        i;

  if (fwHw_getRegisters("Beetle", registers, types))   // get a list of the registers (and their respective types) of hardware type 'Beetle'
  {
     DebugTN("Existing registers: " + dynlen(registers));   // display number of existing registers
     for(i = 1; i <= dynlen(registers); i++)
        switch(types[i])
        {
           case FWHW_I2C : DebugTN("Register " + registers[i] + " is of type I2C";
                           break;
           case FWHW_JTAG: DebugTN("Register " + registers[i] + " is of type JTAG";
                           break;
           case FWHW_PBUS: DebugTN("Register " + registers[i] + " is of type PBUS";
                           break;
           case FWHW_REG : DebugTN("Register " + registers[i] + " is of type REG";
                           break;
           case FWHW_DCU : DebugTN("Register " + registers[i] + " is of type DCU Register";
                           break;
           case FWHW_DCUChannel : DebugTN("Register " + registers[i] + " is of type DCU Channel";
                           break;
           case FWHW_LBUS: DebugTN("Register " + registers[i] + " is of type LBUS";
                           break;                                                                                                                                                       
           case FWHW_GBE : DebugTN("Register " + registers[i] + " is of type GBE";
                           break;                                                                                                                                                       
           default       : DebugTN("Register " + registers[i] + " is of unknown type";
        }
  }
  else
     DebugTN("Error found!");
  (...)



bool fwHw_getSpecificSettings ( string  pHardware,
dyn_string  pRegistersList,
dyn_dyn_anytype &  pSettingsList 
)

This function returns the list of specific settings of a set of registers belonging to the specified hardware.

Parameters:
[in] pHardware name of the hardware where the register(s) is/are.
[in] pRegistersList list containing the registers where to get the specific settings from.
[out] pSettingsList returned list with the specific settings of each register.
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_dyn_anytype mySettings;
  dyn_string      myRegisters;
  int             i;
  int             j;

  dynAppend(myRegisters, "myReg01");
  dynAppend(myRegisters, "myReg02");

  if (fwHw_getSpecificSettings("myBoard", myRegisters, mySettings))   // get the list of specific settings of register 'myReg01' and 'myReg02'
     for(i = 1; i <= dynlen(myRegisters); i++)                          // that are in hardware 'myBoard'
     {
        DebugTN("Register " + myRegisters[i] + " has the following settings:");
        for(j = 1; j <= dynlen(mySettings[i]); j++)
           DebugTN(mySettings[i][j]);
     }
  else
     DebugTN("Error found!");
  (...)



void fwHw_getTypes ( dyn_string &  pHardwareTypesList,
dyn_int &  pTypesList 
)

This function returns a list containing all existing hardware types.

Parameters:
[out] pHardwareTypesList list containing all existing hardware types.
[out] pTypesList list containing the type of the hardware (GENERIC, SPECS or CCPC). Note: these types are represented by the constants FWHW_GENERIC, FWHW_SPECS and FWHW_CCPC.
Returns:
void (nothing)
Example:

  (...)
  dyn_string myList0;
  dyn_int    myList1;
  int        i;

  fwHw_getTypes(myList0, myList1);   // get a list containing all existing hardware types
  DebugTN("Number of hardware types: " + dynlen(myList0));   // display the number of existing hardware types
  for(i = 1; i <= dynlen(myList0); i++)
     switch(myList1[i])
     {
        case FWHW_GENERIC: DebugTN("Hardware " + myList0[i] + " is of type GENERIC");
                           break;
        case FWHW_SPECS:   DebugTN("Hardware " + myList0[i] + " is of type SPECS");
                           break;
        case FWHW_CCPC:    DebugTN("Hardware " + myList0[i] + " is of type CCPC");
     }
  (...)



bool fwHw_insert ( string  pHardwareType,
string  pHardwareTypeInsert,
string  pHardware 
)

This function will "insert" a hardware into the specified hardware type. Like this you can create a structured hardware type. e.g. a hardware type 'channel' with various registers can be inserted several times into another hardware type to form a receiver card. This card itself can again be plugged (inserted) to another card. Deep structures (higher than three) should be avoided due to performance issues.

Parameters:
[in] pHardwareType name of the hardware type where to "insert" the hardware.
[in] pHardwareTypeInsert type of hardware to be "inserted".
[in] pHardware name of the hardware to be "inserted".
Returns:
true no error found.

false error found.

Example:

  (...)
  if (fwHw_insert("Tell1", "TTCrx", "myTTCrx1"))   // "insert" hardware 'myTTCrx1' (of type 'TTCrx') in hardware type 'Tell1'
     (...)
  else
     DebugTN("Error found!");
  (...)



bool fwHw_remove ( string  pHardwareType,
string  pHardware 
)

The usage of this function is twofold: It will remove (delete) the hardware of a specified hardware type. Also services and commands are unsubscribed (client & server side). It can, also, be used to remove a hardware that was previously "inserted".

Parameters:
[in] pHardwareType hardware type of the hardware to be removed.
[in] pHardware name of the hardware to be removed (deleted).
Returns:
true no error found.

false error found.

Example:

  (...)

  if (fwHw_remove("Beetle", "myBeetle1"))   // remove the hardware 'myBeetle1' of type 'Beetle'
     (...)
  else
     DebugTN("Error found!");
  (...)



bool fwHw_removeInserted ( string  pHardwareType,
string  pHardware 
)

This function is used to remove a hardware that was previously "inserted". Note: fwHw_remove() is wrapped inside.

Parameters:
[in] pHardwareType hardware type from where the hardware has to be removed.
[in] pHardware name of the hardware to be removed (deleted).
Returns:
true no error found.

false error found.

Example:

  (...)

  if (fwHw_removeInserted("SomeBoardType", "InsertedChannel"))   // remove the hardware 'InsertedChannel' of type 'Channel' from 'SomeBoardType'
     (...)
  else
     DebugTN("Error found!");

  (...)



bool fwHw_removeRegisters ( string  pHardwareType,
dyn_string  pRegistersList = makeDynString() 
)

This function will remove (delete) register(s) of the specified hardware type.

Parameters:
[in] pHardwareType name of the hardware type where the register(s) is/are located.
[in] pRegistersList list containing the name(s) of the register(s) to be removed (deleted). Note: this parameter is optional (if not specified, then all registers belonging to the specified hardware type will be removed).
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_string registers;

  dynAppend(registers, "myReg01");
  dynAppend(registers, "myReg02");

  if (fwHw_removeRegisters("Beetle", registers))   // remove (delete) the registers called 'myReg01' and
     (...)                                         // 'myReg02' of the hardware type 'Beetle'
  else
     DebugTN("Error found!");
  (...)



bool fwHw_removeType ( string  pHardwareType  ) 

This function will remove (delete) an existing hardware type. Note: all hardwares (instances) of this type will also be removed.

Parameters:
[in] pHardwareType name of the hardware type to be removed (deleted).
Returns:
true no error found.

false error found.

Example:

  (...)
  if (fwHw_removeType("Beetle"))   // remove (delete) the hardware type called 'Beetle'
     (...)
  else
     DebugTN("Error found!");
  (...)



bool fwHw_setCommonSettings ( string  pHardware,
dyn_anytype  pSettingsList,
bool  pRecursiveFlag = true,
bool  keepOld = 1 
)

This function applies the common settings of the specified hardware. (e.g. name of CCPC) For the SPECS system there are the following common settings: PC, Master ID, Slave address, Speed. The CCPC system has just the name of the credit card PC as common setting.

Parameters:
[in] pHardware name of the hardware where the common settings will be set.
[in] pSettingsList list with the common settings to be set for the specified hardware.
[in] pRecursiveFlag if true, the common settings will, also, be applied to the hardwares that have been "inserted" in the specified hardware, otherwise (false) the common settings will not be applied to the "inserted" hardwares. Note: this parameter is optional (if not specified, then it will be assumed as being true).
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_anytype myList;

  dynAppend(myList, "pctell07");

  if (fwHw_setCommonSettings("myTell1", myList, true))   // define the common settings of hardware 'myTell1'
     (...)
  else
     DebugTN("Error found!");
  (...)



bool fwHw_setDefaultCommonSettings ( string  pHardwareType,
dyn_anytype  pSettingsList 
)

This function defines the default common settings of the specified hardware type. When creating a hardware type an instance is automatically created to store the default values. By demand they can be retrieved and passed as actual settings. Note that in this function the insert parameter is 'hardware type'.

Parameters:
[in] pHardwareType name of the hardware type where the default common settings will be set.
[in] pSettingsList list with the default common settings to be set for the specified hardware type.
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_anytype myList;

  dynAppend(myList, "pctell07");

  if (fwHw_setDefaultCommonSettings("Tell1Board", myList))   // define the default common settings of hardware type 'Tell1Board'
     (...)
  else
     DebugTN("Error found!");
  (...)



bool fwHw_setDefaultSpecificSettings ( string  pHardwareType,
dyn_string  pRegistersList,
dyn_dyn_anytype  pSettingsList 
)

This function defines the default specific settings of a set of registers belonging to the specified hardware type.

Parameters:
[in] pHardwareType name of the hardware type where the register(s) is/are.
[in] pRegistersList list containing the registers to set the default specific settings.
[in] pSettingsList list containing the default specific settings of each register.
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_dyn_anytype mySettings;
  dyn_string      myRegisters;


  dynAppend(myRegisters, "myReg01");  //register supposed to be of type GBE
  dynAppend(myRegisters, "myReg02");  //register supposed to be of type I2C
  mySettings[1] = makeDynAnytype(600, 1, 0, 0)   //address, width, rfresh rate, on-change
  mySettings[2] = makeDynAnytype(1,50,0,14,-1,1,0,0,0);  //bus, address, sub-address, width, page size, type, NACK, refresh rate, on-change


  if (fwHw_setDefaultSpecificSettings("SomeBoardType", myRegisters, mySettings))   // define the default specific settings of register 'myReg01'
     (...)                                                                  // and 'myReg02' that are in hardware type 'SomeBoardType'
  else
     DebugTN("Error found!");
  (...)



bool fwHw_setSpecificSettings ( string  pHardware,
dyn_string  pRegistersList,
dyn_dyn_anytype  pSettingsList 
)

This function applies the specific settings of a set of registers belonging to the specified hardware. (e.g. hardware address, register width, etc.) If the order of the specific settings is not known it can be looked up with the fwHw tool by clicking the tab 'HARDWARE' and choosing the appropriate register.

Parameters:
[in] pHardware name of the hardware where the register(s) is/are.
[in] pRegistersList list containing the registers to set the specific settings.
[in] pSettingsList list containing the specific settings of each register.
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_dyn_anytype mySettings;
  dyn_string      myRegisters;

  dynAppend(myRegisters, "myReg01");  //register supposed to be of type GBE
  dynAppend(myRegisters, "myReg02");  //register supposed to be of type I2C
  mySettings[1] = makeDynAnytype(600, 1, 0, 0)   //address, width, rfresh rate, on-change
  mySettings[2] = makeDynAnytype(1,50,0,14,-1,1,0,0,0);  //bus, address, sub-address, width, page size, type, NACK, refresh rate, on-change

  if (fwHw_setSpecificSettings("myBeetle1", myRegisters, mySettings))   // define the specific settings of register 'myReg01' and 'myReg02'
     (...)                                                              // that are in hardware 'myBeetle1'
  else
     DebugTN("Error found!");
  (...)



bool fwHw_subscribe ( string  hw  ) 

This function will subscribe all registers contained by a hardware thus establishing the connection between server and client: The register settings are sent to the server where they are stored in a list and the necessary services and commands are created. On the client side the necessary fwDim functions are called which allow to make the datapoint elements of a register to receive services and send commands. (register names: operation, writings, writingsStatus, readings, readingsStatus) Note: registers can be written to or read just after subscription!

Parameters:
[in] hw name of the hardware.
Returns:
true no error found.

false error found.

Example:

  (...)

  if (fwHw_subscribe("myTell1Board"))   // subscribe all registers contained by 'myTell1Board' (including inserted hardwares)
     (...)                                                     
  else                                                         
     DebugTN("Error found!");                                  
  (...)



bool fwHw_subscribeType ( string  hwType  ) 

This function will subscribe all registers of all hardware devices of a certaing hw Type, thus establishing the connection between server and client: The register settings are sent to the server where they are stored in a list and the necessary services and commands are created. On the client side the necessary fwDim functions are called which allow to make the datapoint elements of a register to receive services and send commands. (register names: operation, writings, writingsStatus, readings, readingsStatus) Note: registers can be written to or read just after subscription!

Parameters:
[in] hwType type of the hardware devices.
Returns:
true no error found.

false error found.

Example:

  (...)

  if (fwHw_subscribeType("MyTell1Type"))   // subscribe all boards of type MyTell1Type
     (...)                                                     
  else                                                         
     DebugTN("Error found!");                                  
  (...)



bool fwHw_unsubscribe ( string  hw  ) 

This function will unsubscribe a set of registers and, also, remove all the created DIM services/commands in the server.

Parameters:
[in] hw name of the hardware.
Returns:
true no error found.

false error found.

Example:

  (...)

  if (fwHw_unsubscribe("myTell1Board"))   // unsubscribe all registers contained by 'myTell1Board'
     (...)                                                       
  else                                                           
     DebugTN("Error found!");                                    
  (...)



bool fwHw_unsubscribeType ( string  hwType  ) 

This function will unsubscribe all registers for all hw devices of a certain type and, also, remove all the created DIM services/commands in the server.

Parameters:
[in] hwType type of the hardware devices.
Returns:
true no error found.

false error found.

Example:

  (...)

  if (fwHw_unsubscribeType("MyTell1Type"))   // unsubscribe all boards of tye MyTell1Type
     (...)                                                       
  else                                                           
     DebugTN("Error found!");                                    
  (...)




Generated on Mon Jan 28 10:40:19 2008 for FwHw by  doxygen 1.4.7