Simplifying System Integration TM 73M1866B/73M1966B FXOAPI User Guide November 2, 2009 Rev. 2.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 © 2009 Teridian Semiconductor Corporation. All rights reserved. Teridian Semiconductor Corporation is a registered trademark of Teridian Semiconductor Corporation. Simplifying System Integration is a trademark of Teridian Semiconductor Corporation. Linux is a registered trademark of Linus Torvalds. All other trademarks are the property of their respective owners.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide Table of Contents 1 Introduction ......................................................................................................................................... 5 1.1 Overview ....................................................................................................................................... 6 1.2 Conventions Used in this Guide ...................................................................................................
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 2.10.5 M1x66_UpdateVoltageIET............................................................................................. 35 2.10.6 M1x66_ClearVoltageIET ................................................................................................ 35 2.11 Current/Voltage Measurement APIs ........................................................................................... 36 2.11.1 M1x66_StartMeasureCurrent ........................................
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 1 Introduction This document describes the application programming interface (API) of the Teridian M1x66 Reference Driver. The API is defined as a simplified functional interface allows an application program written in “C” ® language to communicate with the driver without going through complicate and cumbersome Linux driver IOCTL.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 1.1 Overview The FXOAPI is a user-friendly programming conduit used to access and manage the FXO device/channel via the Reference Driver. This section describes the programming flow and how the application program can be implemented using the FXOAPIs. First, the concept of device versus channel, the Teridian FXO driver supports multiple FXO channels. The application layer communicates with the driver using this channel descriptor.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 1.2 Conventions Used in this Guide This document uses the following conventions: • • Software code, IOCTL names and data types are presented in Courier font. A table with a blue header is a summary table. A table with a gray header is a detail table. 1.
73M1866B/73M1966B FXOAPI User Guide 2 UG_1x66B_046 API Descriptions This section contains the detail description of each API. Table 1 provides a summary of the APIs. Table 1: API Overview IOCTL Name Description FXO API Initialization and Termination M1x66_FxoApiInit API subsystem initialization. M1x66_FxoApiRelease API subsystem release or termination. Device/Channel Open, Close and Initialization APIs M1x66_OpenDevice Open FXO device of event reporting. Close an opened device.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide IOCTL Name Description M1x66_FAILED – Failure. M1x66_PulseDial M1x66_PulseDialCancel Terminate pulse dial session. M1x66_SetPulseDialParam Adapt to the line condition instead of default values. GPIO Management APIs M1x66_GetGpioConfig Read a GPIO configuration. Configure the GPIO. M1x66_SetGpioConfig Write data to GPIO pin. M1x66_SetGpioData Read data from GPIO pin. M1x66_GetGpioData M1x66_GpioEnable Enable the GPIO.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 IOCTL Name M1x66_GetFileDrescriptor Description Interval Event Table Management APIs M1x66_GetCurrentIET Read current IET entry. M1x66_UpdateCurrentIET Update current IET entry. M1x66_ClearCurrentIET Delete the current IET table entry. M1x66_GetVoltageIET Read the voltage IET table entry. M1x66_UpdateVoltageIET Update voltage IET entry. M1x66_ClearVoltageIET Delete the voltage IET table entry.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 2.2 FXO API Initialization and Termination 2.2.1 M1x66_FxoApiInit Description This API allocates and initializes required internal data structures; make necessary preparation before other API members can be invoked. The FXO API Initialization and Termination M1x66_FxoApiInit() must be called once during application program’s initialization, or prior to accessing other API members.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 2.3 Device/Channel Open, Close and Initialization APIs 2.3.1 M1x66_OpenDevice Description This API performs the low level opening of the device descriptor. By default, the device descriptor name is known as “/dev/ter10”; however, since this is configurable during driver installation, a different device descriptor name may be used. Refer to driver configuration and installation more detail.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide Return Values Data Type Description M1x66_HANDLE Non-ZERO value if the device is opened successfully. ZERO if the device fails to open. 2.3.2 M1x66_CloseDevice Description This API performs the low level closing of the device handle. It should be called before exiting application program to release all resource associated with the open device. Closing this device will automatically force the closing of any opened channel handles.
73M1866B/73M1966B FXOAPI User Guide 2.3.3 UG_1x66B_046 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.
UG_1x66B_046 2.3.5 73M1866B/73M1966B FXOAPI User Guide M1x66_InitChannel Description This API performs the channel initialization and prepares the FXO channel to operate in conformance with specific region where the FXO line is being deployed. Teridian FXO device supports globalcompliance parameter in countries listed in M1x66_COUNTRY_CODE.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 2.4 PCM Management and Control APIs 2.4.1 M1x66_PcmIfConfig Description This API is called to program the PCM interface configuration. It is anticipated that this PCM interface configuration should never change, thus, only need to program once during initialization for each channel.
UG_1x66B_046 2.4.3 73M1866B/73M1966B FXOAPI User Guide M1x66_PcmActivation Description This API activates the PCM timeslot configured for this channel. It enables the PCM data stream for both directions. Prototype M1x66_RET M1x66_PcmActivation ( M1x66_HANDLE channel ); Parameters Data Type Name Description M1x66_HANDLE channel Channel handle from FXO open channel. Return Values Data Type Description M1x66_RET M1x66_SUCCESS – Successfully activated the PCM timeslots. M1x66_FAILED – Failure. 2.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 2.5 Hook Switch and Pulse Dial Related APIs 2.5.1 M1x66_HookSwitch Description Perform on/off-hook on the FXO channel. Prototype M1x66_RET M1x66_HookSwitch ( M1x66_HANDLE channel, M1x66_HOOK_SWITCH hookSwitch ); Parameters Data Type Name Description M1x66_HANDLE channel Channel handle from FXO open channel. M1x66_HOOK_SWITCH hookSwitch Type of hook switch requested.
UG_1x66B_046 2.5.3 73M1866B/73M1966B FXOAPI User Guide M1x66_PulseDialCancel Description Rev. 2.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 2.6 This API terminates any active pulse dial session previously initiated by the Hook Switch and Pulse Dial Related APIs 2.6.1 M1x66_HookSwitch Description Perform on/off-hook on the FXO channel. Prototype M1x66_RET M1x66_HookSwitch ( M1x66_HANDLE channel, M1x66_HOOK_SWITCH hookSwitch ); Parameters Data Type Name Description M1x66_HANDLE channel Channel handle from FXO open channel. M1x66_HOOK_SWITCH hookSwitch Type of hook switch requested.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide M1x66_RET M1x66_SetPulseDialParam (M1x66_HANDLE chanHandle, int onHookDuration, int offHookDuration, int interDigitDuration); Parameters Data Type Name Description M1x66_HANDLE chanHandle Channel handle from FXO open channel. int onHookDuration On-hook duration. int offHookDuration Off-hook duration. int interDigitDuration Inter-digits duration. Return Values Data Type Description M1x66_RET M1x66_SUCCESS – Successful.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 2.7 GPIO Management APIs 2.7.1 M1x66_GetGpioConfig Description This is an API for reading the configuration of a GPIO. If reading is successful the driver returns the direction and the polarity of the GPIO parameter.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide Return Values Data Type Description M1x66_RET M1x66_SUCCESS – Successful. M1x66_FAILED – Failure. 2.7.3 M1x66_SetGpioData Description This API writes data to a GPIO pin. This applies only to a GPIO configured with output direction. The GPIO data signal (data) will be written to the selected GPIO pin.
73M1866B/73M1966B FXOAPI User Guide 2.7.5 UG_1x66B_046 M1x66_GpioEnable Description This is an API for enable the GPIO. After a GPIO pin is configured using M1x66_SetGpioConfig it must be enabled to start the operation. Once enabled the GPIO signal can be manipulated using M1x66_SetGpioData for those configured for output direction, or the signal can be read for those configured for input direction.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 2.8 Loopback Control APIs 2.8.1 M1x66_LoopbackGet Description This API reads the current status of the loopback. The active loopback mode will be returned to the variable pointed by the passing parameter. Prototype M1x66_RET M1x66_LoopbackGet (M1x66_HANDLE chanHandle, M1966_LOOPBACK_MODE *pLoopbackType) Parameters Data Type Name Description M1x66_HANDLE chanHandle Channel handle from FXO open channel.
73M1866B/73M1966B FXOAPI User Guide 2.8.3 UG_1x66B_046 M1x66_LoopbackClear Description This API disables the loopback. Prototype M1x66_RET M1x66_LoopbackClear (M1x66_HANDLE chanHandle) Parameters Data Type Name Description M1x66_HANDLE chanHandle Channel handle from FXO open channel. Return Values Data Type Description M1x66_RET M1x66_SUCCESS – Successful. M1x66_FAILED – Failure. 26 Rev. 2.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 2.9 Country Default Parameter and Override APIs 2.9.1 M1x66_GetCountryParam Description This API reads the default country parameter. To retrieve the country parameter set the desired country code in the field “cnum”. If the reading is successful the desired country parameter will be returned in the country structure passed in.
73M1866B/73M1966B FXOAPI User Guide 2.9.3 UG_1x66B_046 M1x66_ThresholdOverride Description Various FXO channel parameters are conveniently grouped and predefined in the default country parameter. These parameters are programmed during channel initialization API (M1x66_InitChannel). However, these parameters can be overridden at runtime to fine tune to the desired threshold for the specific installation using this threshold override API.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 2.10 Billing Tone Filter Control APIs 2.10.1 M1x66_BillingToneFilterEnable Description Large amplitude out-of-band tones can be used to measure call duration and to allow remote central office to determine the duration of the call for billing purposes. These tones can saturate or distort the input signal, thus, it is important to be able to reject them. This API provides the ability to filter out the billing tone.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 2.11 1x66 H/W Register Access and Debugging aid APIs 2.11.1 M1x66_HWRegisterRead Description Perform H/W register reading from the 73M1x66B device that carries the FXO channel. This API is not recommended for use in normal operation but only for diagnostic or testing purpose. The channel handle contains the corresponding SPI channel ID (cid) of the 73M1x66B device in the daisy chain.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide M1x66_FAILED – Failure. 2.11.3 M1x66_HWRegisterWrite Description Perform H/W register writing to the 73M1x66B device that carries the FXO channel. This API is not recommended for use in normal operation but only for diagnostic or testing purpose. The channel handle contains the corresponding SPI channel ID (cid) of the 73M1x66B device in the daisy chain. This SPI cid is passed to the driver to set the value of the specified register.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 2.11.5 M1x66_GetFileDrescriptor Description To provide full flexibility to the driver access, this API can be called by an application program to obtain the file descriptor for a given device or channel handle. With this returned file descriptor, the user has direct access to the driver via its native IOCTL as described in the 73M1866B/73M1966B Reference Driver User Guide.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 2.12 Interval Event Table Management APIs 2.12.1 M1x66_GetCurrentIET Description Read the line current IET table entry. Prototype int M1x66_GetCurrentIET ( M1x66_HANDLE channel, unsigned int ietIndex, M1966_IET_t *pIET ); Parameters Data Type Name Description M1x66_HANDLE channel Channel handle obtained from FXO open channel. unsigned int ietIndex IET entry index – row number (0 – 9). M1966_IET_t *pIET Pointer to an output structure M1966_IET_t.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 2.12.3 M1x66_ClearCurrentIET Description Delete the line current IET table entry. Prototype int M1x66_ClearCurrentIET ( M1x66_HANDLE channel, unsigned int ietIndex); Parameters Data Type Name Description M1x66_HANDLE channel Channel handle obtained from FXO open channel. unsigned int ietIndex IET entry index – row number (0 – 9). Return Values Data Type Description M1x66_RET M1x66_SUCCESS – Successfully clear the IET entry.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 2.12.5 M1x66_UpdateVoltageIET Description Perform the line voltage IET table update. Prototype int M1x66_UpdateVoltageIET ( M1x66_HANDLE channel, unsigned int ietIndex, M1966_IET_t *pIET ); Parameters Data Type Name Description M1x66_HANDLE channel Channel handle obtained from FXO open channel. unsigned int ietIndex IET entry index – row number (0 – 9). M1966_IET_t *pIET Pointer to an input structure M1966_IET_t.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 2.13 Current/Voltage Measurement APIs 2.13.1 M1x66_StartMeasureCurrent Description Start the line current measurement process. This API starts measuring the line current of the specified channel at a sampling interval time of “sampleTime” with averaging count of “averageSampleCount”.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 2.13.3 M1x66_StopMeasureCurrent Description Stop the line current measurement. Prototype int M1x66_StopMeasureCurrent ( M1x66_HANDLE channel, unsigned int sampleTime, unsigned int averageSampleCount ); Parameters Data Type Name Description M1x66_HANDLE Channel Channel handle obtained from FXO open channel. unsigned int sampleTime Time interval between two consecutive samples. unsigned int averageSampleCount Sample count for average calculation.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 2.14 Miscellaneous Channel Setting APIs 2.14.1 M1x66_SetRingCadence Description Set the ring cadence parameter for ring qualification process. The driver can be programmed to filter and qualify incoming ring by discarding spurious signals that can be caused by line noises or distortions.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 2.14.2 M1x66_SetPhoneVolume Description Set the speaker phone and microphone volume. This API sets transmit and receive dB gain of the FXO channel. Teridian FXO supports transmit gain from -26 to +12 dB, and receive gain from -24 to +10 dB. Prototype M1x66_RET M1x66_SetPhoneVolume ( M1x66_HANDLE chanHandle, int txVolumedB, int rxVolumedB ); Parameters Data Type Name Description M1x66_HANDLE chanHandle Channel handle obtains from open channel.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 2.14.4 M1x66_SelectSampleRate Description Select PCM sample rate. The 73M1x66B device can operate in one of two sample rates – 8 kHz or 16 kHz sample rate. The device defaults to 8 kHz operation upon startup and can be changed to run at 16 kHz using this API. Notes: Changing the PCM sample rate will affect the following: 1.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 3 Structure Reference This section contains the detail description of the data structure used in this API subsystem. Table 2 contains the summary of the reference structure. Table 2: Structure Overview Name Description M1x66_HANDLE_t Device or Channel handle. M1x66_CHAN_INIT_t Channel Init structure. M1x66_PCM_IF_CFG_t PCM interface config structure. M1x66_PCM_CFG_t PCM timeslot config structure.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 3.1 M1x66_HANDLE_t Description The device or channel handle is a pointer to a device or channel control data structure where information pertaining to device or channel is being kept. This control data structure is created when the device or channel is opened and is used by the API internal subsystem to indentify the device or channel until it is closed.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 3.2 M1x66_CHAN_INIT_t Description Channel initialization structure. This structure contains mainly the country code. The M1x66_InitChannel API passes the pointer to this data structure to configure the channel to operate in a specific region. Refer to M1x66_COUNTRY_CODE for the list of countries supported.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 3.3 M1x66_PCM_IF_CFG_t Description PCM interface config structure. This structure contains the PCM interface configuration parameter. These parameters are usually static and do not change from session to session. The M1x66_PcmIfConfig API passes the pointer to this structure to configure the PCM interface.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 3.4 M1x66_PCM_CFG_t Description PCM config structure. This structure contains the PCM timeslots and codec parameter. These parameters are not static and may change from session to session. The M1x66_PcmConfig API passes the pointer to this structure to configure the PCM timeslots and codec.
73M1866B/73M1966B FXOAPI User Guide 3.5 UG_1x66B_046 M1966_CNTRY_STRUCT_t Description This structure defines the country default parameters.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 4 Enumerator Reference This section contains the detail description of the enumerated data reference used in this API subsystem. Table 3 contains the summary of the enumerated data reference. Table 3: Enumerator Overview Name Description M1x66_RET Return status code from API. M1x66_EVENT_ID FXO event identification. M1x66_COUNTRY_CODE List of country code supported. M1x66_DCL_FREQUENCY DCL frequency supported. M1x66_HOOK_SWITCH On and off hook.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 4.1 M1x66_RET Description API function return code. All APIs, expect the open device and open channel, return with M1x66_RET code. For additional error information when an API returns M1x66_FAILED the application program can issue a get last error – M1x66_GetLastError.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 4.2 M1x66_EVENT_ID Description List of FXO event identification supported by the API subsystem.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 M1x66_EVENT_LINE_STATE 0x00000100 Line state event – current/voltage. M1x66_EVENT_QUALIFIED_RING 0x00000080 Qualified ring cadence detected. 50 Rev. 2.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 4.3 M1x66_COUNTRY_CODE Description List of country codes supported by the API subsystem.
73M1866B/73M1966B FXOAPI User Guide M1x66_CNTRY_CODE_NG M1x66_CNTRY_CODE_NO M1x66_CNTRY_CODE_OM M1x66_CNTRY_CODE_PK M1x66_CNTRY_CODE_PR M1x66_CNTRY_CODE_PH M1x66_CNTRY_CODE_PL M1x66_CNTRY_CODE_PT M1x66_CNTRY_CODE_RO M1x66_CNTRY_CODE_RU M1x66_CNTRY_CODE_SA M1x66_CNTRY_CODE_SG M1x66_CNTRY_CODE_SK M1x66_CNTRY_CODE_SI M1x66_CNTRY_CODE_ZA M1x66_CNTRY_CODE_KR M1x66_CNTRY_CODE_ES M1x66_CNTRY_CODE_SE M1x66_CNTRY_CODE_CH M1x66_CNTRY_CODE_SY M1x66_CNTRY_CODE_TW M1x66_CNTRY_CODE_TH M1x66_CNTRY_CODE_AE M1x66_CNTRY_CODE
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 4.4 M1x66_DCL_FREQUENCY Description Valid DCL Frequency used in M1x66_InitChannel API. Prototype /* ************************************************************************** ** DCL Frequency *************************************************************************/ typedef enum { M1x66_256KHZ = 0x01, /* 256 KHz */ M1x66_512KHZ = 0x02, /* 512 KHz */ M1x66_768KHZ = 0x03, /* 768 KHz */ M1x66_1024KHZ = 0x04, /* 1.024 MHz */ M1x66_1536KHZ = 0x05, /* 1.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 4.5 M1x66_HOOK_SWITCH Description Hook switch command for on-hook and off-hook. Prototype /* ************************************************************************** ** Hook switch *************************************************************************/ typedef enum { M1x66_ON_HOOK = 0, M1x66_OFF_HOOK = 1, } M1x66_HOOK_SWITCH; Parameters Name Value Description M1x66_ON_HOOK Ox00 On hook. M1x66_OFF_HOOK 0x01 Off hook. 54 Rev. 2.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 4.6 M1x66_REG_TYPE Description List of 1x66 device register type. Note: Register 0x00, 0x01, 0x0A, 0x0B are not available. Reading from or writing to these registers will not have any effect.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 Parameters Name Value Description M1x66_REG_0x00 Ox00 Register 0x00 M1x66_REG_0x01 0x01 Register 0x01 M1x66_REG_0x02 0x02 Register 0x02 M1x66_REG_0x03 0x03 Register 0x03 M1x66_REG_0x04 0x04 Register 0x04 M1x66_REG_0x05 0x05 Register 0x05 M1x66_REG_0x06 0x06 Register 0x06 M1x66_REG_0x07 0x07 Register 0x07 M1x66_REG_0x08 0x08 Register 0x08 M1x66_REG_0x09 0x09 Register 0x09 M1x66_REG_0x0A 0x0A Register 0x0A M1x66_REG_0x0B 0
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 4.7 M1x66_REG_ACCESS_TYPE Description Defines 73M1x66B register access types.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 4.9 M1966_GPIO_CONFIG_COMMAND Description This is the GPIO configuration command. The GPIO can be configured using the M1966_GPIO_CONFIG_SET command. Its configuration can be read using M1966_GPIO_CONFIG_GET command. The GPIO must be enabled using the M1966_GPIO_CONTROL ioctl for the new configuration to take effect.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 4.11 M1966_GPIO_DATA_COMMAND Description GPIO data access command. If the M1966_GPIO_SIGNAL_DIRECTION is set to M1966_GPIO_DIR_INPUT, perform the M1966_GPIO_DATA_GET returns the logical value of type M1966_GPIO_DATA_TYPE of the appropriate GPIO as an input. If the M1966_GPIO_SIGNAL_DIRECTION is set to M1966_GPIO_DIR_OUTPUT, the corresponding GPIO port outputs the logical value as written.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 4.13 M1966_GPIO_SIGNAL_DIRECTION Description GPIO pin signal direction. This control bit is used to designate the GPIO pin as either input or output.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide 4.15 M1x66_DEBUG_TRACE_MASK Description Defines all debug trace masks.
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 5 Sample Application This section illustrates how an FXO application can be implemented using the FXOAPIs. The sample program is a typical telephony application that automatically answers the call when a ring burst is detected. This is accomplished by simply going off-hook. Note: this sample program will definitely not compile and is not a complete application.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide /* Initialize the channel for operation in US */ if (M1x66_InitChannel (channels[i].pHandle, M1x66_CNTRY_CODE_US) != M1x66_SUCCESS) return (-1); } /* program main loop */ While (1) { /* this is the main program loop… /* . . .
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 switch (event_id) { case M1x66_EVENT_RING_START: printf("\nRING(%d)",channelId); printf("\n Frequency: %d(hz)",data1); printf("...auto answer...\n"); /* configure PCM timeslot pcmConfig.pcmResolution = pcmConfig.pcmTimeslotRX = pcmConfig.
UG_1x66B_046 73M1866B/73M1966B FXOAPI User Guide case M1x66_EVENT_DIAL_COMPLETE: printf("\n\r DIAL_COMPLETE(%d)\n\r",channelId); break; case M1x66_EVENT_DIAL_ABORTED: printf("\n\r DIAL_ABORTED(%d)\n\r",channelId); break; case M1x66_EVENT_SYNC_LOST: printf("\n\r BARRIER_SYNC_LOST(%d)\n\r",channelId); break; case M1x66_EVENT_SYNC_RECOVERED: printf("\n\r BARRIER_SYNC_RECOVERED(%d)\n\r",channelId); break; case M1x66_EVENT_GPIO_INTERRUPT: printf("\n\r %s interrupt:(%d)\n\r",GPIO_NUM_TO_STR(data1),channelId); b
73M1866B/73M1966B FXOAPI User Guide UG_1x66B_046 Revision History Revision Date Description 1.0 6/12/2009 First publication. 2.0 10/2/2009 Added Section 2.4.3 through Section 2.8.2. Added Section 2.9.6. Added Section 3.5 and Section 3.6. Added Section 4.8 through Section 4.14. 2.1 11/2/2009 Added support for PCM sample rate selection. 66 Rev. 2.