dev_New()
Create a new device.
#include "device.h" LResult dev_New ( LDeviceName deviceName, LDevice * deviceOut );
deviceName | name of device in device database |
deviceOut | space for output of new device |
dev_New() retrieves the device definition from the device database and allocates memory for the device data structure and initializes it with the device definition. It does not try to open the device. Devices created with dev_New() should be disposed of by calling dev_Dispose().
If successful, dev_New() returns a non-negative value. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:
if ((result = dev_New(deviceName, &device)) < 0) { LOG("New failure", dev_ErrorMessage(result)); } else { assert(device != NULL); }