User’s Manual
89
Locates the first active device that matches the search criteria.
PARAMETER
srch
is the 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
The peripheral card sends back the character the master sent. This function will check device information
to determine that the peripheral card is connected to a master.
PARAMETERS
handle
is an address index to device information. Use rn_device() or rn_find() to establish the
handle.
sendecho
is the character to echo back.
recdata
is a pointer to the return address of the character from the device.
RETURN VALUE
The status byte from the previous command. -1 means that device information indicates the peripheral
card is not connected to the master.
int rn_find(rn_search *srch);
int rn_echo(int handle, char sendecho,
char *recdata);