Name
prt_api_load_item
Purpose
Load serialized item tracking data.
Description
This PRT_API routine is used to load the answer for a PRT request for Serialized Item Tracking Data into a response buffer. The calling routine receives back a status indicating the success or failure of the request. This function can be called multiple times to load multiple responses into the response buffer. If the buffer becomes full the return status will be unsuccessful and additional error information will be found in the COR_STATUS structure. The PRT_API routine prt_api_send_resp must be called to send the response buffer to the appropriate PRT process.
Syntax
int prt_api_load_item (data_valid_flag, item_id,
reference_id, item_type_id, item_status,
ext_hold_active, group_id,
int_hold_active, int_hold_reason,
num_atts_valid, item_att_list, retstat)
COR_BOOLEAN data_valid_flag;
char item_id[PRT_ITEM_ID_LEN + 1];
char reference_id[PRT_ITEM_ID_LEN + 1];
char item_type_id[PRT_ITEM_TYPE_ID_LEN + 1];
COR_U4 item_status;
COR_BOOLEAN ext_hold_active;
char group_id[PRT_REGION_ID_LEN + 1];
COR_BOOLEAN int_hold_active;
char int_hold_reason[SC_DESCRIPTION_LEN + 1];
COR_I1 num_atts_valid;
PRT_ITEM_ATT item_att_list[PRT_NUM_ATTRIBUTES];
COR_STATUS *retstat;
Data Structures
typedef struct
{
char att_name[PRT_ATTRIBUTE_LEN + 1] - item attribute name
char att_value[PRT_ATTRIBUTE_LEN + 1] - item attribute value
} PRT_ITEM_ATT
Arguments
Argument |
Description |
Input |
|
data_valid_flag |
If TRUE, data requested is being returned (is valid). FALSE indicates the request could not be satisfied. (required) |
item_id |
Unique identifier of a Serialized Item. (optional if reference_id is specified) |
reference_id |
Secondary identifier of a Serialized Item. (optional if item_id is specified) |
item_type_id |
Item type identifier. (required) |
item_status |
Item status. (required) |
ext_hold_active |
If TRUE, Serialized item held due to external hold. (optional) |
group_id |
Identifier of the Tracking Group placing the external hold on the item. (required if ext_hold_active = TRUE) |
int_hold_active |
If TRUE, item held due to internal hold. (optional) |
int_hold_reason |
Comment specifying reason for internal hold. (optional) |
num_atts_valid |
Number of item attributes valid; this specifies the number of array elements in the item attribute list that contain valid data. If item_att_list is a NULL pointer, the function sends a zero to the Data Collector for this argument, regardless of what was actually passed. |
item_att_list |
Item Attributes pertain to Serialized Items. (required) |
Output |
|
*retstat |
Pointer to COR_STATUS structure |
Return Value
Either COR_SUCCESS, COR_FAILURE, or COR_WARNING.
If the function returns COR_WARNING or COR_FAILURE, additional error information can be found in the COR_STATUS structure. If no more item information will fit in the datagram buffer, the function returns COR_WARNING with the COR_STATUS err_code set to PRTI_DG_BUF_FULL.
Error Codes
PRTI_API_CANT_RCV |
PRT Application not initialized to receive asynch messages (Warning) |
PRTI_NON_SER_ID |
Non-serialized item has item id or reference id (Warning) |
PRTI_SER_NO_ID |
Serialized item missing both item id and reference id (Warning) |
PRTI_ITEM_TYPE_NULL |
Item type identifier NULL (Warning) |
PRTI_ITEM_TYPE_NDEF |
Item type identifier not valid (Warning) |
PRTI_GRP_ID_NULL |
Group identifier NULL (Warning) |
PRTI_GRP_ID_NDEF |
Group identifier not valid (Warning) |
PRTI_EXT_HOLD_NO_GRP |
External hold specified without Group ID (Warning) |
PRTI_INT_HOLD_NO_REASON |
Internal hold specified without reason (Warning) |
PRTI_NUM_ATTS_INVALID |
Invalid number of item attributes specified (Warning) |
PRTI_DG_BUF_FULL |
Datagram buffer full (Warning) |
PRTI_CRESEG_ERR |
Error creating segment (Failure) |
Application subroutines. |