User guide
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046
14 Rev. 2.1
2.3.3 M1x66_OpenChannel
Description
This API performs the low level opening of the channel descriptor. By default, the channel descriptor is
known as “/dev/terXX”, where XX varies from 11 to 26 representing channel 0 to 15 respectively.
Calling to the open channel API is mandatory before any access to the channel can be performed, and it
must be called after the open device as this API requires the device handle to be passed in as the second
parameter. A successful open channel returns a non-zero channel handle that can be used to access
other channel related APIs.
Prototype
M1x66_RET M1x66_OpenChannel (
char *pChanName,
M1x66_HANDLE devHandle,
int chanNum);
Parameters
Data Type Name Description
char *
pChanName
FXO channel descriptor name. (Default: /dev/ter11...26).
M1x66_HANDLE
devHandle
Device handle obtained from FXO open device.
int
chanNum
FXO channel number from 0 to 15.
Return Values
Data Type Description
M1x66_HANDLE
0 – Failed to open channel.
None-zero handle – Successful.
2.3.4 M1x66_CloseChannel
Description
This API performs the low level closing of the channel handle. It should be called before exiting
application program, or when the channel is no longer needed, to release all resources associated with
the open channel.
Prototype
M1x66_RET M1x66_CloseChannel (M1x66_HANDLE chanHandle);
Parameters
Data Type Name Description
M1x66_HANDLE
chanHandle
Channel handle obtained from FXO open channel.
Return Values
Data Type Description
M1x66_RET
M1x66_SUCCESS – Successfully close the channel.
M1x66_FAILED – Failed to close the channel.