Discovering Carpool Resources

The following example creates a new carpool resource type if it does not already exist. Otherwise, it adds an instance to the SMS_R_Carpool resource class. The example discovers the minimum data required to identify each car in the carpool. The rest of the data is reported by an inventory discovery process.

DDRNew("Carpool", "Vehicle Discovery", "ABC");             // SMS_R_Carpool
DDRAddString("VIN", "9FD7821T8B14751", 15, ADDPROP_NAME);  // update key
DDRAddString("License Number", "ABC123", 8, 0);
DDRAddString("Make", "Pontiac", 15, 0);
DDRAddString("Model", "Bonneville", 15, 0);
DDRAddInteger("Model Year", 1996, 0);
DDRAddString("Color", "Green", 16, 0);
DDRAddString("SMS Unique Identifier",                      // update key
             "VIN:9FD7821T8B14751", 20,
             ADDPROP_GUID | ADDPROP_KEY);
DDRSendToSMS();

For more information on discovering new or existing resource types, see Using DDRs in Resource Discovery.