Scanner Attribute APIs
Scanner Attribute APIs

Scanner Attribute APIs

Function prototype: uint8_t CST_APISend_ATTR(uint16_t attr_num, uint8_t *value, uint16_t     length, uint16_t offset, uint8_t type, bool permanent)

Description:
          Set the Scanner Attribute from the canopy board.
Parameters:
         
Uint16_t attr_num
: attribute no. of Scanner Attributes, not on the display menu [strings/arrays of length, greater than 240, are not supported].
         
Uint8_t *value
: pointer to the value of the attribute.
         
Uint16_t length
: length of the attribute.
         
Uint16_t offset
: reserved (0).
         
Uint8_t   type
: attribute type.
                          ‘B’ – Byte
                          ‘W’ – Word
                          ‘D’ -   DWord
                          ‘X’ -   Action
                           'S' - String
                           'A' - Array
          bool  permanent – Permanent – 1, Temporary – 0
         From the UI, it is always going to be permanent (1).
Return value: uint8_t status
     SCANNER_ATTR_SUCCESS                               (1)
     SCANNER_ATTR_UNSUPPORTEDTYPE           (-3L)
     SCANNER_ATTR_OTHERERR                            (-4L)
     SCANNER_ATTR_NOTENOUGHMEM                (-1L)

Function prototype: uint8_t CST_APIGet_Attr (uint16_t attr_num, uint16_t max_len, uint8_t *type, uint16_t *length, BYTE *value, BYTE *properties);

Description:
          Get the value and the details of the scanner attribute.
Parameters:
       
uint16_t attr_num
: attribute no. of Scanner Attribute (not on the display menu).
       
uint16_t max_len
: maximum length of the attribute value, the value of the attribute can hold.
       
uint8_t *type
: pointer to the type of the attribute returned from the scanner. This is returned from the scanner and could be one of the following. Arrays and Strings are not supported now.
* valuetype
Definition
‘B’
Byte – unsigned char
‘F’
Bit Flags
‘W’
WORD – short unsigned (16 bits)
‘D’
DWORD – long unsigned integer (32 bits)
‘A’
Array
‘S’
String
       
Uint16_t *length
: pointer to the length of the attribute, returned from the scanner.
       
Uint8_t *value
: pointer to the value of the attribute returned from the scanner. The value shall be defined as an array, with the array index, being max_len.
       
Uint8_t *properties
: pointer to the properties returned by the scanner.
7
6
5
4
3
2
1
0
Reserved (0)
Reserved (0)
Reserved (0)
Reserved (0)
Reserved (0)
Persistent
Write
Read
Return value: uint8_t status
          SCANNER_ATTR_SUCCESS                              (1)
          SCANNER_ATTR_NOTENOUGHMEM               (-1L)
          SCANNER_ATTR_PROCESSINGERR               (-2L)
          SCANNER_ATTR_UNSUPPORTEDTYPE          (-3L)
          SCANNER_ATTR_OTHERERR                           (-4L)

Function prototype: bool  GenericParamSetInt(uint16_t attr_num, uint32_t value, bool permanent)

Description:
          Sets the value of an Integer type Canopy AttributeNumber.
Parameters:
       
uint16_t attr_num
: attribute no. of Canopy Attribute.
       
uint32_t value
: the value the AttributeNumber is to be set to.
       bool permanent – if set to true, the value that is set will persist across reboots.
Return value: Boolean status
        
true
– When setting is success.
        
false
– When setting is failed/not allowed.

Function prototype: bool  GenericParamSetString(uint16_t attr_num, char *  str, bool permanent)

Description:
          Sets the value of a String type Canopy AttributeNumber.
Parameters:
       
uint16_t attr_num
: attribute no. of Canopy Attribute.
       
char * str
: pointer to a string – to set the AttributeNumber to.
        bool permanent – if set to true, the value that is set will persist across reboots
.
Return value: Boolean status
       
true
– When setting is success.
       
false
– When setting is failed/not allowed.

Function prototype: uint32_t  GenericParamGetInt(uint16_t attr_num)

Description:
          Returns the value of an Integer type Canopy AttributeNumber.
Parameters:
       
uint16_t attr_num
: attribute no. of Canopy Attribute.
Return value: uint32_t
   
        Value of Canopy AttributeNumber : attr_num

Function prototype: bool  GenericParamGetString(uint16_t attr_num, uint32_t * value)

Description:
          Gets  the value of a String type Canopy AttributeNumber.
Parameters:
       
uint16_t attr_num
: attribute no. of Canopy Attribute.
     
  uint32_t * value
: pointer to a memory location where the result will be stored.
Return value: Boolean status
  
       
true
– When no error
       
false
– When there is any error.

Function prototype: uint16_t  GenericGetAttributeByName(char * attrname)

Description:
          Returns the AttributeNumber of a Canopy Attribute – give the global Identifier string.
Parameters:
       
char * attrname
: pointer to a string containing the Attribute global Identifier.
Return value:
        uint16_t AttributeNumber of Canopy Attribute
                               0 – On invalid global Identifier