AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/demo/object/gw_device.c
DEVICE_OBJECT_DATA *Get_Routed_Device_Object(
    int idx)
{
    if (idx == -1)
        return &Devices[iCurrent_Device_Idx];
    else if ((idx >= 0) && (idx < MAX_NUM_DEVICES)) {
        iCurrent_Device_Idx = idx;
        return &Devices[idx];
    } else
        return NULL;
}
/** Return the Device Object descriptive data for the indicated entry.
 * @param idx [in] Index into Devices[] array being requested.
 *                 0 is for the main, gateway Device entry.
 *                 -1 is a special case meaning "whichever iCurrent_Device_Idx
 *                 is currently set to"
 *                 If valid idx, will set iCurrent_Device_Idx with the idx
 * @return Pointer to the requested Device Object data, or NULL if the idx
 *         is for an invalid row entry (eg, after the last good Device).
 */
Return the Device Object descriptive data for the indicated entry.
@param idx [in] Index into Devices[] array being requested.
0 is for the main, gateway Device entry.
-1 is a special case meaning "whichever iCurrent_Device_Idx
is currently set to"
If valid idx, will set iCurrent_Device_Idx with the idx
@return Pointer to the requested Device Object data, or NULL if the idx
is for an invalid row entry .
Return the Device Object descriptive data for the indicated entry . @param idx [ in ] Index into Devices [] array being requested . 0 is for the main gateway Device entry . - 1 is a special case meaning " whichever iCurrent_Device_Idx is currently set to " If valid idx will set iCurrent_Device_Idx with the idx @return Pointer to the requested Device Object data or NULL if the idx is for an invalid row entry .
DEVICE_OBJECT_DATA *Get_Routed_Device_Object(
    int idx)
{
    if (idx == -1)
        return &Devices[iCurrent_Device_Idx];
    else if ((idx >= 0) && (idx < MAX_NUM_DEVICES)) {
        iCurrent_Device_Idx = idx;
        return &Devices[idx];
    } else
        return NULL;
}
DEVICE_OBJECT_DATA * Get_Routed_Device_Object ( int idx ) { if ( idx == -1 ) return & Devices [ iCurrent_Device_Idx ] ; else if ( ( idx >= 0 ) && ( idx < MAX_NUM_DEVICES ) ) { iCurrent_Device_Idx = idx ; return & Devices [ idx ] ; } else return NULL ; }
Return the Device Object descriptive data for the indicated entry.
Return the Device Object descriptive data for the indicated entry .