BL4S200 User’s Manual
195
rn_find
int rn_find(rn_search *srch);
FUNCTION DESCRIPTION
Locates the first active device that matches the search criteria.
PARAMETER
srch
search criteria structure
rn_search:
unsigned int flags; // status flags see MATCH macros below
unsigned int ports; // port bitmask
char productid; // product id
char productrev; // product rev
char coderev; // code rev
long serialnum; // serial number
Use a maximum of 3 macros for the search criteria:
RN_MATCH_PORT // match port bitmask
RN_MATCH_PNA // match physical node address
RN_MATCH_HANDLE // match instance (reg 3)
RN_MATCH_PRDID // match id/version (reg 1)
RN_MATCH_PRDREV // match product revision
RN_MATCH_CODEREV // match code revision
RN_MATCH_SN // match serial number
For example:
rn_search newdev;
newdev.flags = RN_MATCH_PORT|RN_MATCH_SN;
newdev.ports = 0x03; //search ports 0 and 1
newdev.serialnum = E3446C01L;
handle = rn_find(&newdev);
RETURN VALUE
Returns the handle of the first device matching the criteria. 0 indicates no such devices
were found.
SEE ALSO
rn_device
electronic components distributor