ASX Version4.10.32
Functions

CobraNet control functions

These functions implement device wide CobraNet settings. More...

Functions

ASX32_API ASX_ERROR ASX_Cobranet_EnumerateModes (ASX_HANDLE hCobranet, const int nIndex, enum asxCOBRANET_MODE *peMode, int *pnCount)
ASX32_API ASX_ERROR ASX_Cobranet_GetMode (ASX_HANDLE hCobranet, enum asxCOBRANET_MODE *peMode)
ASX32_API ASX_ERROR ASX_Cobranet_SetMode (ASX_HANDLE hCobranet, const enum asxCOBRANET_MODE eMode)
ASX32_API ASX_ERROR ASX_Cobranet_GetIPAddress (ASX_HANDLE hCobranet, unsigned int *pdwIPAddr)
 Get the current IP address of the Cobranet device.
ASX32_API ASX_ERROR ASX_Cobranet_SetIPAddress (ASX_HANDLE hCobranet, const unsigned int dwIPAddr)
 Set the current IP address of the Cobranet device.
ASX32_API ASX_ERROR ASX_Cobranet_GetStaticIPAddress (ASX_HANDLE hCobranet, unsigned int *pdwIPAddr)
 Get the static IP address of the Cobranet device.
ASX32_API ASX_ERROR ASX_Cobranet_SetStaticIPAddress (ASX_HANDLE hCobranet, const unsigned int dwIPAddr)
 Set the static IP address of the Cobranet device.
ASX32_API ASX_ERROR ASX_Cobranet_GetMACAddress (ASX_HANDLE hCobranet, unsigned int *pdwMAC_MSBs, unsigned short *pwMAC_LSBs)
 Get the current cobranet MAC address.
ASX32_API ASX_ERROR ASX_Cobranet_GetDescription (ASX_HANDLE hCobranet, char *szString, const int nLength)
 Get the device's description from the sysDescr SNMP field.
ASX32_API ASX_ERROR ASX_Cobranet_GetName (ASX_HANDLE hCobranet, char *szString, const int nLength)
 Get the device's name from the sysName SNMP field.
ASX32_API ASX_ERROR ASX_Cobranet_SetName (ASX_HANDLE hCobranet, const char *pszLongInputString)
 Set the device's name in the sysName SNMP field.
ASX32_API ASX_ERROR ASX_Cobranet_GetLocation (ASX_HANDLE hCobranet, char *szString, const int nLength)
 Get the device's location from the sysLocation SNMP field.
ASX32_API ASX_ERROR ASX_Cobranet_SetLocation (ASX_HANDLE hCobranet, const char *pszLongInputString)
 Set the device's location in the sysLocation SNMP field.
ASX32_API ASX_ERROR ASX_Cobranet_GetFirmwareRevision (ASX_HANDLE hCobranet, char *pszRevision)
 Gets a device's firmware revision.
ASX32_API ASX_ERROR ASX_Cobranet_GetErrorInfo (ASX_HANDLE hCobranet, unsigned int *pnCode, unsigned int *pnCount, unsigned int *pnDisplay)
 Gets a device's error information.
ASX32_API ASX_ERROR ASX_Cobranet_GetLatencyAndSampleRate (ASX_HANDLE hCobranet, enum asxCOBRANET_LATENCY *peLatency, enum asxSAMPLE_RATE *peRate)
 Gets a device's latency and sample reate.
ASX32_API ASX_ERROR ASX_Cobranet_SetLatencyAndSampleRate (ASX_HANDLE hCobranet, const enum asxCOBRANET_LATENCY eLatency, const enum asxSAMPLE_RATE eRate)
 Gets a device's latency and sample reate.
ASX32_API ASX_ERROR ASX_Cobranet_GetPersistence (ASX_HANDLE hCobranet, unsigned int *pnSetting)
 Gets a device's flash persistence setting.
ASX32_API ASX_ERROR ASX_Cobranet_SetPersistence (ASX_HANDLE hCobranet, const unsigned int nSetting)
 Sets a device's flash persistence state.
ASX32_API ASX_ERROR ASX_Cobranet_GetConductorPriority (ASX_HANDLE hCobranet, unsigned int *pnPriority)
 Gets a device's conductor priority.
ASX32_API ASX_ERROR ASX_Cobranet_SetConductorPriority (ASX_HANDLE hCobranet, const unsigned int nPriority)
 Sets a device's conductor priority.
ASX32_API ASX_ERROR ASX_Cobranet_GetConductorStatus (ASX_HANDLE hCobranet, unsigned int *pnState)
 Gets a device's conductor status.
ASX32_API ASX_ERROR ASX_Cobranet_SetSerialEnable (ASX_HANDLE hCobranet, const int nOnOff)
 Enable or disable a device's serial bridge.
ASX32_API ASX_ERROR ASX_Cobranet_GetSerialEnable (ASX_HANDLE hCobranet, int *pOnOff)
 Gets a device's serial bridge status.
ASX32_API ASX_ERROR ASX_Cobranet_SetSerialConfig (ASX_HANDLE hCobranet, const unsigned int nBaud, const unsigned int nPPeriod, const char pRxMAC[6], const int nAcceptUnicast, const char pTxMAC[6])
 Configures a device's serial bridge.
ASX32_API ASX_ERROR ASX_Cobranet_GetSerialConfig (ASX_HANDLE hCobranet, unsigned int *pnBaud, unsigned int *pnPPeriod, char pRxMAC[6], int *pnAcceptUnicast, char pTxMAC[6])
 Gets a device's serial bridge configuration.
ASX32_API ASX_ERROR ASX_Cobranet_GetIfStatus (ASX_HANDLE hCobranet, unsigned int *pnCurrentIf, unsigned int *pnPrimaryLinkStatus, unsigned int *pnSecondaryLinkStatus)
 Gets a device's ethernet connection status.

Detailed Description

These functions implement device wide CobraNet settings.

The reader is referred to "CobraNet Programmer's Reference",Cirrus Logic, http://www.cirrus.com , for more information.


Function Documentation

ASX32_API ASX_ERROR ASX_Cobranet_EnumerateModes ( ASX_HANDLE  hCobranet,
const int  nIndex,
enum asxCOBRANET_MODE peMode,
int *  pnCount 
)
Deprecated:
This function has been removed (it is stubbed out).
ASX32_API ASX_ERROR ASX_Cobranet_GetConductorPriority ( ASX_HANDLE  hCobranet,
unsigned int *  pnPriority 
)

Gets a device's conductor priority.

Parameters:
hCobranetA handle to an ASX cobranet control.
pnPriorityReturned Priority. 0 indcates that this device will never be the network conductor. 1 is the lowest priority and 0xFF is the highest priority.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_GetConductorStatus ( ASX_HANDLE  hCobranet,
unsigned int *  pnState 
)

Gets a device's conductor status.

Parameters:
hCobranetA handle to an ASX cobranet control.
pnStateReturned state. 1 indicates that this device is the conductor for the Cobranet network. 0 indicates that it is not the conductor.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_GetDescription ( ASX_HANDLE  hCobranet,
char *  szString,
const int  nLength 
)

Get the device's description from the sysDescr SNMP field.

This is are read-only operation.

Parameters:
hCobranetA handle to an ASX cobranet control.
szStringPointer to a string of length ASX_LONG_STRING.
nLengthDescription string length.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
cobranet/main.c.
ASX32_API ASX_ERROR ASX_Cobranet_GetErrorInfo ( ASX_HANDLE  hCobranet,
unsigned int *  pnCode,
unsigned int *  pnCount,
unsigned int *  pnDisplay 
)

Gets a device's error information.

Returns SNMP variables errorCode, errorCount and errorDisplay.

Parameters:
hCobranetA handle to an ASX cobranet control.
pnCodePointer used to return error code. See error code listing the Cobranet Programmer Manual from Cirrus Logic.
pnCountPointer used to return error count which contains the number of errors that have occurred.
pnDisplayPointer used to return error display number.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_GetFirmwareRevision ( ASX_HANDLE  hCobranet,
char *  pszRevision 
)

Gets a device's firmware revision.

This is a combination of SNMP fields firmwareProtocolVersion, firmwareMajorVersion and firmwareMinorVersion.

Parameters:
hCobranetA handle to an ASX cobranet control.
pszRevisionA pointer to a char array of length ASX_SHORT_STRING to return the revision string.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_GetIfStatus ( ASX_HANDLE  hCobranet,
unsigned int *  pnCurrentIf,
unsigned int *  pnPrimaryLinkStatus,
unsigned int *  pnSecondaryLinkStatus 
)

Gets a device's ethernet connection status.

Parameters:
hCobranetA handle to an ASX cobranet control.
pnCurrentIfReturns which ethernet connection is active (1 for primary, 2 for secondary)
pnPrimaryLinkStatusReturns primary link status. See asxCOBRANET_IFSTATUS.
pnSecondaryLinkStatusReturns secondary link status. See asxCOBRANET_IFSTATUS.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_GetIPAddress ( ASX_HANDLE  hCobranet,
unsigned int *  pdwIPAddr 
)

Get the current IP address of the Cobranet device.

Parameters:
hCobranetA handle to an ASX cobranet control.
pdwIPAddrGets the IP address.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_GetLatencyAndSampleRate ( ASX_HANDLE  hCobranet,
enum asxCOBRANET_LATENCY peLatency,
enum asxSAMPLE_RATE peRate 
)

Gets a device's latency and sample reate.

Returns information from SNMP variable modeRateControl.

Parameters:
hCobranetA handle to an ASX cobranet control.
peLatencyPointer used to return latency.
peRatePointer used to return sample rate.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_GetLocation ( ASX_HANDLE  hCobranet,
char *  szString,
const int  nLength 
)

Get the device's location from the sysLocation SNMP field.

Parameters:
hCobranetA handle to an ASX cobranet control.
szStringPointer to a string of length ASX_LONG_STRING.
nLengthName string length.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
cobranet/main.c.
ASX32_API ASX_ERROR ASX_Cobranet_GetMACAddress ( ASX_HANDLE  hCobranet,
unsigned int *  pdwMAC_MSBs,
unsigned short *  pwMAC_LSBs 
)

Get the current cobranet MAC address.

Parameters:
hCobranetA handle to an ASX cobranet control.
pdwMAC_MSBsGets the four most significant bytes of the MAC address.
pwMAC_LSBsGets the two least significant bytes of the MAC address.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_GetMode ( ASX_HANDLE  hCobranet,
enum asxCOBRANET_MODE peMode 
)
Deprecated:
This function has been removed (it is stubbed out).
ASX32_API ASX_ERROR ASX_Cobranet_GetName ( ASX_HANDLE  hCobranet,
char *  szString,
const int  nLength 
)

Get the device's name from the sysName SNMP field.

Parameters:
hCobranetA handle to an ASX cobranet control.
szStringPointer to a string of length ASX_LONG_STRING.
nLengthName string length.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
cobranet/main.c.
ASX32_API ASX_ERROR ASX_Cobranet_GetPersistence ( ASX_HANDLE  hCobranet,
unsigned int *  pnSetting 
)

Gets a device's flash persistence setting.

Returns information from SNMP variable flashPersistEnable. This should be set to maintain static IP assignments and Cobranet bundle and routing assignments through a powerdown. Conversely, clearing the persistence bit and then powering cycling the ASI2416 will set it back to factory defaults.

Parameters:
hCobranetA handle to an ASX cobranet control.
pnSetting0 indicates no persistence set. Non-zero indicates persistence enabled.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_GetSerialConfig ( ASX_HANDLE  hCobranet,
unsigned int *  pnBaud,
unsigned int *  pnPPeriod,
char  pRxMAC[6],
int *  pnAcceptUnicast,
char  pTxMAC[6] 
)

Gets a device's serial bridge configuration.

Parameters:
hCobranetA handle to an ASX cobranet control.
pnBaudReturns the baud rate for the serial bridge.
pnPPeriodReturns the time in 256ths of a millisecond before a character received at the SCI port is placed in a packet and transmitted.
pRxMACGets the multicast MAC from which SCI data will be accepted.
pnAcceptUnicastGets the state of the accept unicast flag. 1 = accept, 0 = ignore
pTxMACGets the MAC to which SCI data is sent.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_GetSerialEnable ( ASX_HANDLE  hCobranet,
int *  pOnOff 
)

Gets a device's serial bridge status.

Parameters:
hCobranetA handle to an ASX cobranet control.
pOnOffReturned state. 1 is on, 0 is off.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_GetStaticIPAddress ( ASX_HANDLE  hCobranet,
unsigned int *  pdwIPAddr 
)

Get the static IP address of the Cobranet device.

Parameters:
hCobranetA handle to an ASX cobranet control.
pdwIPAddrGets the static IP address. A value of 0 (0.0.0.0) indicates that no static IP address has been assigned to this device.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_SetConductorPriority ( ASX_HANDLE  hCobranet,
const unsigned int  nPriority 
)

Sets a device's conductor priority.

Parameters:
hCobranetA handle to an ASX cobranet control.
nPriorityPriority to set. 0 indcates that this device will never be the network conductor. 1 is the lowest priority and 0xFF is the highest priority.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_SetIPAddress ( ASX_HANDLE  hCobranet,
const unsigned int  dwIPAddr 
)

Set the current IP address of the Cobranet device.

Parameters:
hCobranetA handle to an ASX cobranet control.
dwIPAddrThe IP address to set.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_SetLatencyAndSampleRate ( ASX_HANDLE  hCobranet,
const enum asxCOBRANET_LATENCY  eLatency,
const enum asxSAMPLE_RATE  eRate 
)

Gets a device's latency and sample reate.

Returns information from SNMP variable modeRateControl.

Parameters:
hCobranetA handle to an ASX cobranet control.
eLatencyLatency to set.
eRateSample rate to set. Note that the ASI2416 only supports a sample rate of 48 kHz.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_SetLocation ( ASX_HANDLE  hCobranet,
const char *  pszLongInputString 
)

Set the device's location in the sysLocation SNMP field.

Maximum name length is 60 characters.

Parameters:
hCobranetA handle to an ASX cobranet control.
pszLongInputStringPointer to a 0 terminated string of length ASX_LONG_STRING. Only the first 60 characters of the string should be used.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_SetMode ( ASX_HANDLE  hCobranet,
const enum asxCOBRANET_MODE  eMode 
)
Deprecated:
This function has been removed (it is stubbed out).
ASX32_API ASX_ERROR ASX_Cobranet_SetName ( ASX_HANDLE  hCobranet,
const char *  pszLongInputString 
)

Set the device's name in the sysName SNMP field.

Maximum name length is 60 characters.

Parameters:
hCobranetA handle to an ASX cobranet control.
pszLongInputStringPointer to a 0 terminated string of length ASX_LONG_STRING. Only the first 60 characters of the string should be used.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_SetPersistence ( ASX_HANDLE  hCobranet,
const unsigned int  nSetting 
)

Sets a device's flash persistence state.

Writes setting to SNMP variable flashPersistEnable. This should be set to maintain static IP assignments and Cobranet bundle and routing assignments through a powerdown. Conversely, clearing the persistence bit and then powering cycling the ASI2416 will set it back to factory defaults.

Parameters:
hCobranetA handle to an ASX cobranet control.
nSetting0 indicates no persistence set. Non-zero indicates persistence enabled.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_SetSerialConfig ( ASX_HANDLE  hCobranet,
const unsigned int  nBaud,
const unsigned int  nPPeriod,
const char  pRxMAC[6],
const int  nAcceptUnicast,
const char  pTxMAC[6] 
)

Configures a device's serial bridge.

Parameters:
hCobranetA handle to an ASX cobranet control.
nBaudThe baud rate for the serial bridge.
nPPeriodTime in 256ths of a millisecond before a character received at the SCI port is placed in a packet and transmitted.
pRxMACSets the multicast MAC from which SCI data will be accepted.
nAcceptUnicastSet to accept properly unicast addressed data in addition to data addressed in accordance to pRxMAC. 1 = accept, 0 = ignore
pTxMACSets the MAC address (unicast or multicast) to which SCI data is sent.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_SetSerialEnable ( ASX_HANDLE  hCobranet,
const int  nOnOff 
)

Enable or disable a device's serial bridge.

Parameters:
hCobranetA handle to an ASX cobranet control.
nOnOff1 is on, 0 is off.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_Cobranet_SetStaticIPAddress ( ASX_HANDLE  hCobranet,
const unsigned int  dwIPAddr 
)

Set the static IP address of the Cobranet device.

Parameters:
hCobranetA handle to an ASX cobranet control.
dwIPAddrThe static IP address to set. A value of 0 resets the static IP address. The assigned static IP address will not take effect until the device is restarted.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.