Echelon LonTal Stack User Manual

Page 113

Advertising
background image

LonTalk Stack Developer’s Guide

101

*/
volatile LonWriteableValueFile lonWriteableValueFile = {
{{'\x0', '\x0', '\x0', '\x0', '\x0', '\x0', '\x0',

'\x0', '\x0', '\x0', '\x0', '\x0', '\x0', '\x0', '\x0',

'\x0', '\x0', '\x0', '\x0', '\x0', '\x0', '\x0', '\x0',

'\x0', '\x0', '\x0', '\x0', '\x0', '\x0', '\x0', '\x0'}}

};

/*
* CP template file
*/
const char lonTemplateFile[] = \
"1.1;" \
"1,0,0\x80,17,31;";


#ifndef LON_FILEDIR_USER_DEFINED
/*
* Variable: File Directory
*/

const LonFileDirectory lonFileDirectory =
{
LON_FILE_DIRECTORY_VERSION,
LON_FILE_COUNT,
{
LON_REGISTER_FILE("template",
sizeof(lonTemplateFile), LonTemplateFileType,
LON_DMF_WINDOW_START+sizeof(lonFileDirectory)),
LON_REGISTER_FILE("rwValues",
sizeof(lonWriteableValueFile), LonValueFileType,
LON_DMF_WINDOW_START+sizeof(lonFileDirectory)
+sizeof(lonTemplateFile)),
LON_REGISTER_FILE("roValues", 0, LonValueFileType,
0)
}
};
#endif /* LON_FILEDIR_USER_DEFINED */

The LonWriteableValueFile data structure is defined in the FtxlDev.h header
file:

typedef LON_STRUCT_BEGIN(LonWriteableValueFile)
{
SCPTlocation cpLocation_1;
/* sd_string("1,0,0\x80,17,31;") */
} LON_STRUCT_END(LonWriteableValueFile);

extern volatile LonWriteableValueFile
lonWriteableValueFile;

Similarly, a LonReadOnlyValueFile type is defined and used to declare a

lonReadOnlyValueFile variable if the model file declares read-only
configuration properties.
The LonTalk Interface Developer utility generates resource definitions for

configuration properties and network variables defined with the eeprom
keyword. Your application must provide sufficient persistent storage for these

Advertising