CYCLONE-User-Manual.pdf - 第81页

User Manual For Cyclone LC Programmers 81 latest images on a server). 8.2.4.5.4 eraseCycloneImage bool eraseCycloneImage(uint32_t cycloneHandle, uint32_t imageId); This function erase the specified image that is stored o…

100%1 / 149
User Manual For Cyclone LC Programmers 80
8.2.4.5.2 compareImageInCycloneWithFile
bool compareImageInCycloneWithFile(uint32_t cycloneHandle, char *aFile, uint32_t
imageId);
This function compares an image stored on the Cyclone against a .SAP file created with the
Cyclone Image Creation Utility.
8.2.4.5.3 formatCycloneMemorySpace
bool formatCycloneMemorySpace(uint32_t cycloneHandle, uint32_t selectedMediaType);
This function erases all images stored on the selected media type. This function should not be
constantly called, as this will shorten the lifespan of the non-volatile flash memory. It is
recommended that the user make use of the “compareImageInCycloneWithFile” function first to
determine if an erase is indeed necessary. (e.g. if the images on the Cyclone do not match the
@parameter imageId
Used to select which image stored on the Cyclone to
read the description from. The valid range of this
parameter is from 1 to the total number of images in the
Cyclone with the count starting from internal memory and
then external memory.
If a Cyclone only stores one image, this parameter
should be set to 1.
@returnvalue
A pointer to a null-terminated character string which
contains the image description
@parameter cycloneHandle
The handle of the Cyclone that will have its image
compared
@parameter aFile
A pointer to a null-terminated character string which
contains the full path to the .SAP file that will be
compared
@parameter imageId
Used to select which image stored on the Cyclone to
compare against. The valid range of this parameter is
from 1 to the total number of images in the Cyclone with
the count starting from internal memory and then
external memory.
If a Cyclone only stores one image, this parameter
should be set to 1.
@returnvalue
True if the image and the .SAP file match
False otherwise
Note that a false will also be returned if an error occurred
during communications between the PC and the
Cyclone unit.
User Manual For Cyclone LC Programmers 81
latest images on a server).
8.2.4.5.4 eraseCycloneImage
bool eraseCycloneImage(uint32_t cycloneHandle, uint32_t imageId);
This function erase the specified image that is stored on the Cyclone. This function is not
supported by legacy Cyclone. It is recommended that the user make use of the
“compareImageInCycloneWithFile” function first to determine if an erase is indeed necessary. (e.g.
if the images on the Cyclone do not match the latest images on a server).
8.2.4.5.5 addCycloneImage
uint32_t addCycloneImage(uint32_t cycloneHandle, uint32_t selectedMediaType, bool
replaceImageOfSameDescription, char *aFile);
This function adds a specified stand-alone programming image into the selected media type. The
image files have a .SAP file extension and are created with the Cyclone Image Creation Utility. If
the Cyclone’s storage limits are reached, this routine will return an error.
@parameter cycloneHandle
The handle of the Cyclone that will have its images
erased
@parameter selectedMediaType
This parameter selects between Cyclone internal
Flash (selectedMediaType = 1) or external memory
(selectedMediaType =2).
@returnvalue
True if the erasure was successful
False otherwise
@parameter cycloneHandle The handle of the Cyclone that will have its image erased
@parameter imageId
Selects the image on the Cyclone to use. The valid range of this
parameter is from 1 to the total number of images in the Cyclone
with the count starting from internal memory and then external
memory.
If a Cyclone only stores one image, this parameter is 1.
@returnvalue
True if the erasure was successful
False otherwise
@parameter cycloneHandle
The handle of the Cyclone that will accept
the new image
@parameter selectedMediaType
This parameter selects between Cyclone
internal Flash (selectedMediaType = 1) or
external memory (selectedMediaType =2).
User Manual For Cyclone LC Programmers 82
8.2.4.5.6 countCycloneImages
uint32_t countCycloneImages(uint32_t cycloneHandle);
This function returns the number of stand-alone programming images currently stored in the
internal Flash and the external memory card of the Cyclone.
8.2.4.5.7 getPropertyValue
char *getPropertyValue(uint32_t cycloneHandle, uint32_t resourceOrImageId, char
*categoryName, char *propertyName);
This function reads a property value of the Cyclone or a stored SAP image. Examples of properties
are Cyclone Name, Cyclone IP Address, Image Name or Image media type. There are different
categories with different properties. Refer to the header file for a list of valid category and property
names. The function getPropertyList will return a list of valid properties for each category.
@parameter replaceImageOfSameDescription
Set to True if you want the image to
overwrite any existing images with the
same description
Set to False if you do not want the image
to overwrite any existing images with the
same description. An error will occur.
@parameter aFile
A pointer to a null-terminated character
string which contains the full path to the
.SAP file to be added.
@returnvalue
The image number of the image that was
just added. This number is used as the
“imageId” parameter for some function
calls.
A return value of “0” indicates an error has
occurred during the process.
@parameter cycloneHandle The handle of the Cyclone to query for the image count
@returnvalue
The total number of images stored in internal and external
memory.
@parameter cycloneHandle The handle of the Cyclone from which to read the property.
@parameter resourceOrImageId
The id for image properties is the image id on the Cyclone.
The id for Cyclone or Network properties is 0.
@parameter categoryName
A pointer to a null-terminated character string that contains
the category of the property that will be read.
@parameter propertyName
A pointer to a null-terminated character string that contains
the name of the property that will be read.
@returnvalue
A pointer to a null-terminated character string that contains
the value of the property.