| PMOPENDEVICE(3) | PMOPENDEVICE(3) | 
int pmOpenDevice(char *type, int argc, char **argv, pmDevice **pmdp);
| char * | type | Device type | |
| int | argc | Number of optional arguments | |
| char ** | argv | Array of optional arguments | |
| pmDevice ** | pmdp | pmDeviceobject | 
pmOpenDevice() opens a PM device specified by type
and returns a pmDevice object.
| -config | filename | Configuration file name: if device needs a configuration file | 
| -firmware | filename | Firmware file name: if device needs a firmware file | 
| -agent | agentname | Agent name: If type is PM_AGENT, this argument is required to specify an agent name. Currently only "pmaudp" which means the UDP communication agent is available as the agent name. | 
| -trunk: | filename | This option is only effective to network trunking of PM/Ethernet.Configuration file name: if device needs a configuration file. Trunk_num is set to trunk number(0,1,2...) | 
All option strings are valid only in pmOpenDevice().
int open_device(int argc, char **argv, pmDevice **pmdp);
New device object must be initialized using the INIT_DEVICE macro.
| PM_SUCCESS | Success | 
| ENODEV | No such device | 
| EINVAL | Invalid arguments | 
| EIO | Error occurs during device initialization | 
| ENOMEM | Not enough memory |