DS Interrupt Ethernet
Edit this on GitLab
DS Interrupt Ethernet Sample Application (SSK 1.x)
Overview
The DS Interrupt Ethernet sample application demonstrates how to receive digital-to-synchro (DS) interrupt notifications over an Ethernet network using the NAI Software Support Kit (SSK 1.x) Interrupt Driven Response (IDR) mechanism. When a DS channel detects a status event — such as a BIT (Built-In Test) signal loss or reference loss — the board generates an interrupt and sends a UDP packet to a remote host containing the latched status register values. Your application runs an IDR server that listens for these packets, decodes the DS status information, and clears the latched status to re-arm the interrupt.
This sample uses shared DS utility libraries (nai_ds_int_ether.c, nai_ds_int.c, nai_ds_cfg.c) along with the common IDR framework (naiapp_interrupt_ether) to configure IDR sessions and process incoming interrupt packets. For the full ISR-based DS interrupt sample that supports local interrupt delivery, see the SD Interrupts guide. For basic DS channel configuration without interrupt delivery, see the DS BasicOps guide.
This sample supports NAI DS (digital-to-synchro) module types. The channel count is determined at runtime via naibrd_DS_GetChannelCount().
DS modules expose two latched interrupt status categories:
-
BIT Loss (
NAI_DS_STATUS_LATCH_BIT_LOST) — indicates a Built-In Test failure on one or more channels. -
Reference Loss (
NAI_DS_STATUS_LATCH_REFERENCE_LOST) — indicates that the reference signal has been lost on one or more channels.
The sample configures separate IDR IDs for each category so both status types are monitored simultaneously.
Why Ethernet IDR for DS?
Digital-to-synchro modules convert digital angle data to synchro/resolver electrical signals. Monitoring the health of these conversions is critical in avionics and simulation systems. Ethernet IDR enables remote monitoring of DS signal integrity:
-
Remote signal health monitoring — your application can monitor DS BIT and reference loss conditions from any host reachable over the network, without requiring a physical bus connection to the board.
-
Dual-status monitoring — each IDR packet reads the BIT loss and reference loss latched status registers with a single read command (using a stride of 32 to cover both registers), so both fault categories are captured atomically.
-
Shared utility framework — the sample uses the common DS interrupt utilities and the shared IDR server framework, keeping the application code concise while the shared libraries handle IDR command construction, socket management, and message parsing.
-
Flexible interrupt routing — the sample supports both onboard and offboard interrupt steering, so you can choose the routing path that matches your system architecture.
The tradeoff is that Ethernet IDR requires a Gen4 or later board, and network latency is inherently higher than a local ISR. For latency-critical applications where the host is directly attached to the board, standard ISR delivery may be more appropriate.
Prerequisites
Before running this sample, make sure you have:
-
An NAI board with a DS (digital-to-synchro) module installed.
-
A Gen4 or later board with Ethernet connectivity. Earlier board generations do not support the Ethernet IDR protocol.
-
SSK 1.x installed on your development host.
-
The sample applications built. Refer to the SSK 1.x build instructions for your platform if you have not already compiled them.
-
Network connectivity between the host running this sample and the board. The host must be reachable at the IP address configured in the IDR settings (default:
192.168.1.100).
How to Run
Launch the DS_Interrupt_Ethernet executable from your build output directory. On startup the application looks for a configuration file (default_DS_Interrupt_Ethernet.txt). On the first run, this file will not exist — the application will present an interactive board menu where you configure a board connection, card index, and module slot. You can save this configuration so that subsequent runs skip the menu and connect automatically. Once connected, the application prompts you for channel selection, IDR network settings, and interrupt routing preferences, then begins listening for IDR packets from the board.
Board Connection and Module Selection
|
Note
|
This startup sequence is common to all NAI sample applications. The board connection and module selection code shown here is not specific to DS. For details on board connection configuration, see the First Time Setup Guide. |
The main() function follows a standard SSK 1.x startup flow:
-
Initialize DS, interrupt, and IDR configuration structures with default values.
-
Call
naiapp_RunBoardMenu()to load a saved configuration file (if one exists) or present the interactive board menu. The configuration file (default_DS_Interrupt_Ethernet.txt) is not included with the SSK — it is created when the user saves their connection settings from the board menu. On the first run, the menu will always appear. -
Query the user for card index and module number.
-
Retrieve the module ID with
naibrd_GetModuleID()to verify a DS module is installed at the selected slot. -
Call
Run_DS_Interrupt_Basic_Ethernet()to execute the IDR interrupt workflow.
#if defined (__VXWORKS__)
int32_t DS_Interrupt_Basic_Ethernet(void)
#else
int32_t main(void)
#endif
{
bool_t stop = FALSE;
int32_t cardIndex;
int32_t moduleCnt;
int32_t module;
int8_t inputBuffer[80];
int32_t inputResponseCnt;
initializeDSConfigurations(0,0,0,0,0,0);
initializeInterruptConfigurations(FALSE,FALSE,FALSE,0,NAIBRD_INT_STEERING_ON_BOARD_1,-1,0);
initializeIDRConfigurations(0,0,DEF_RX_RESPONSE_PROTOCOL,DEF_RX_RESPONSE_PORT,
DEF_RX_RESPONSE_IPv4_ADDR, DEF_RX_RESPONSE_IPv4_LENGTH,COMMANDS,0,0,0);
if (naiapp_RunBoardMenu(CONFIG_FILE) == TRUE)
{
while (stop != TRUE)
{
stop = naiapp_query_CardIndex(naiapp_GetBoardCnt(), 0, &cardIndex);
inputDSConfig.cardIndex = cardIndex;
if (stop != TRUE)
{
check_status(naibrd_GetModuleCount(cardIndex, &moduleCnt));
stop = naiapp_query_ModuleNumber(moduleCnt, 1, &module);
inputDSConfig.module = module;
if (stop != TRUE)
{
inputDSConfig.modid = naibrd_GetModuleID(cardIndex, module);
if ((inputDSConfig.modid != 0))
{
Run_DS_Interrupt_Basic_Ethernet();
}
}
}
printf("\nType Q to quit or Enter key to restart application:\n");
stop = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR,
inputBuffer, &inputResponseCnt);
}
}
printf("\nType the Enter key to exit the program: ");
naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR,
inputBuffer, &inputResponseCnt);
naiapp_access_CloseAllOpenCards();
return 0;
}
The three initialization calls set up the shared configuration structures used throughout the application:
-
initializeDSConfigurations()— zeros out theDsConfigstruct that tracks card index, module, channel, and module ID. -
initializeInterruptConfigurations()— sets default interrupt parameters including steering toNAIBRD_INT_STEERING_ON_BOARD_1. -
initializeIDRConfigurations()— sets the default IDR network parameters (UDP protocol, port 52802, IP192.168.1.100).
|
Important
|
Common connection errors you may encounter at this stage:
|
Program Structure
The DS Interrupt Ethernet sample uses a multi-file architecture. The main application file (DS_Interrupt_Ethernet.c) orchestrates the workflow while delegating DS-specific interrupt and IDR logic to shared utility libraries:
-
nai_ds_cfg.c/nai_ds_cfg.h— defines theDsConfigstruct and initialization. -
nai_ds_int.c/nai_ds_int.h— providesconfigureDSToInterrupt()andenableDSInterrupts()for configuring the DS module’s interrupt registers. -
nai_ds_int_ether.c/nai_ds_int_ether.h— providessetupIDRConfiguration_DS(),InitDSIDRCommands(), andHandleDSEtherInterrupt()for IDR command construction and response handling. -
naiapp_interrupt_ether— the shared IDR server framework that manages socket creation, message reception, and UPR message dispatch.
Configuration Structures
The sample uses three shared configuration structures:
typedef struct
{
int32_t cardIndex;
int32_t module;
uint32_t modid;
int32_t channel;
int32_t maxChannel;
int32_t minChannel;
} DsConfig;
The DsConfig struct tracks the selected card, module, and channel. InterruptConfig tracks interrupt routing preferences (onboard vs. offboard, edge/level trigger, steering). IDRConfig tracks the IDR network parameters (protocol, port, IP address, command buffer).
Gen4 Ethernet Requirement Check
The first thing Run_DS_Interrupt_Basic_Ethernet() does is verify that the connected board supports Gen4 Ethernet commands:
bGen4DSIDRCommands = SupportsGen4Ether(inputDSConfig.cardIndex);
if (!bGen4DSIDRCommands)
{
printf("DS Ethernet Interrupt Support Prior to Generation 4 Ethernet commands "
"currently not supported\n");
bQuit = TRUE;
}
If the board does not support Gen4, the application prints an error and exits. There is no fallback to an older protocol — you must use a Gen4 or later board for Ethernet IDR.
In your own application, always call SupportsGen4Ether() before attempting any IDR configuration.
|
Important
|
Common Errors
|
User Configuration Prompts
After the Gen4 check passes, the sample queries the user through a series of interactive prompts:
-
Channel selection —
naiapp_query_ChannelNumber()prompts for which DS channel to monitor. Valid channels range from 1 to the maximum reported bynaibrd_DS_GetChannelCount(). -
IDR configuration —
QueryIDRConfigInformation()prompts for the IDR response IP address, port, and protocol. -
Onboard vs. offboard routing —
QueryUserForOnboardOffboardInterrupts()asks whether interrupts should be processed onboard (routed within the board’s Ethernet stack) or offboard (routed through the host bus interface). -
IDR message display —
QueryUserForEtherIDRMsgDisplay()asks whether to display raw UPR message contents for debugging.
Based on the onboard/offboard selection, the sample sets the interrupt steering and IDR interface:
if (inputInterruptConfig.bProcessOnboardInterrupts == TRUE)
{
inputIDRConfig.cardIndex = inputDSConfig.cardIndex;
inputIDRConfig.boardInterface = NAI_INTF_ONBOARD;
inputInterruptConfig.steering = NAIBRD_INT_STEERING_ON_BOARD_1;
}
else
{
inputIDRConfig.cardIndex = 0;
inputIDRConfig.boardInterface = NAI_INTF_PCI;
inputInterruptConfig.steering = NAIBRD_INT_STEERING_CPCI_APP;
}
For onboard routing, the IDR card index matches the DS card index and the interface is NAI_INTF_ONBOARD. For offboard routing, the IDR card index is 0 (the host) and the interface is NAI_INTF_PCI.
IDR Configuration
The IDR configuration for DS modules is more complex than single-status modules because two separate IDR IDs are used — one for BIT loss and one for reference loss. The shared utility function setupIDRConfiguration_DS() handles this:
void setupIDRConfiguration_DS(DsConfig inputDSConfig, IDRConfig* inputIDRConfig,
bool_t bGen4DSIDRCommands)
{
int32_t vector1 = NAI_DS_BITLOSS_INTERRUPT_VECTOR;
int32_t vector2 = NAI_DS_REFLOSS_INTERRUPT_VECTOR;
uint32_t addr = NAI_DS_GEN5_REG_BIT_LATCHED_STATUS_ADD;
InitDSIDRCommands(inputDSConfig, inputIDRConfig, bGen4DSIDRCommands, addr);
check_status(naibrd_Ether_ClearIDRConfig(cardIndex,
(uint16_t)DEF_ETHERNET_DS_BITLOSS_IDR_ID));
check_status(naibrd_Ether_SetIDRConfig(cardIndex,
(uint16_t)DEF_ETHERNET_DS_BITLOSS_IDR_ID,
protocol, ipLength, ipAddress, port, vector1,
*cmdcount, *cmdlength, commands));
check_status(naibrd_Ether_ClearIDRConfig(cardIndex,
(uint16_t)DEF_ETHERNET_DS_REFLOSS_IDR_ID));
check_status(naibrd_Ether_SetIDRConfig(cardIndex,
(uint16_t)DEF_ETHERNET_DS_REFLOSS_IDR_ID,
protocol, ipLength, ipAddress, port, vector2,
*cmdcount, *cmdlength, commands));
}
This function:
-
Calls
InitDSIDRCommands()to build the embedded Ethernet read command that reads both the BIT loss and reference loss latched status registers. -
Clears and configures IDR ID
DEF_ETHERNET_DS_BITLOSS_IDR_IDwith the BIT loss interrupt vector. -
Clears and configures IDR ID
DEF_ETHERNET_DS_REFLOSS_IDR_IDwith the reference loss interrupt vector.
Both IDR IDs share the same embedded command set and network destination but are triggered by different interrupt vectors.
Building IDR Commands
InitDSIDRCommands() constructs a single embedded Ethernet read command that reads two registers in one operation:
void MakeDSReadRegsCommand(IDRConfig* inputIDRConfig, uint32_t boardAddress,
int32_t moduleOffset, bool_t bGen4Ether, uint16_t startIndex, uint32_t addr)
{
uint16_t seqno = 0;
addr = boardAddress + moduleOffset + addr;
uint32_t count = DS_INTERRUPT_RESPONSE_REG_COUNT; /* 2 registers */
uint32_t stride = 32;
msgIndex = (uint16_t)nai_ether_MakeReadMessage(
&inputIDRConfig->commands[startIndex], seqno, NAI_ETHER_GEN4,
(nai_intf_t)inputIDRConfig->boardInterface, addr, stride, count, NAI_REG32);
}
By setting count to 2 and stride to 32, this single read command captures both the BIT loss latched status register and the reference loss latched status register (which are separated by 32 bytes in the register map). This is more efficient than issuing two separate read commands.
Starting the IDR Sessions
After configuration, both IDR sessions are started:
check_status(naibrd_Ether_StartIDR(inputIDRConfig.cardIndex,
(uint16_t)DEF_ETHERNET_DS_BITLOSS_IDR_ID));
check_status(naibrd_Ether_StartIDR(inputIDRConfig.cardIndex,
(uint16_t)DEF_ETHERNET_DS_REFLOSS_IDR_ID));
|
Important
|
Common Errors
|
Module Interrupt Configuration
After the IDR sessions are configured and started, the sample configures the DS module to generate interrupts. This is handled by the shared utility functions:
configureDSToInterrupt(inputInterruptConfig, inputDSConfig);
enableDSInterrupts(inputDSConfig, TRUE);
configureDSToInterrupt() sets the interrupt edge/level trigger mode, interrupt vector, and interrupt steering on the DS module. enableDSInterrupts() enables the interrupt generation for the selected channel’s BIT loss and reference loss status types.
In your own application, you need to configure these interrupt parameters to match your IDR setup:
-
Edge/level trigger — determines whether interrupts fire on status transitions (edge) or while a status condition persists (level). The shared utility configures this via
naibrd_DS_SetInterruptEdgeLevel(). -
Interrupt vector — must match the vector assigned to the IDR ID. The vectors
NAI_DS_BITLOSS_INTERRUPT_VECTORandNAI_DS_REFLOSS_INTERRUPT_VECTORlink the module interrupt to the correct IDR session. -
Interrupt steering — must match the onboard/offboard selection.
NAIBRD_INT_STEERING_ON_BOARD_1for onboard orNAIBRD_INT_STEERING_CPCI_APPfor offboard.
IDR Server and Response Handling
Once interrupts are enabled, the sample starts the shared IDR server:
dsEtherIntFunc = HandleDSEtherInterrupt;
bQuit = runIDRServer(inputIDRConfig);
The dsEtherIntFunc function pointer is set to HandleDSEtherInterrupt so the shared IDR server framework calls this function when it receives an IDR packet with a DS interrupt vector. runIDRServer() creates a socket (TCP or UDP depending on configuration), listens for incoming IDR packets, parses the UPR message framing, and dispatches each embedded response to the registered handler.
Decoding DS Interrupt Status
HandleDSEtherInterrupt() processes each IDR response packet:
void HandleDSEtherInterrupt(uint16_t msglen, uint8_t msg[], uint16_t tdr_idr_id)
{
offset = nai_ether_DecodeMessageHeader(msg, msglen, &seq, &tc, gen, &size);
switch (tc)
{
case NAI_ETHER_TYPECODE_RSP_COMMAND_COMPLETE_READ_4:
datacnt = (msglen - 10) / NAI_REG32;
for (i = 0; i < datacnt; i++)
{
data = msg[offset++] << 24;
data |= msg[offset++] << 16;
data |= msg[offset++] << 8;
data |= msg[offset++];
if (i < DS_INTERRUPT_RESPONSE_REG_COUNT)
dsstatus_int[i] = data;
}
break;
}
if (datacnt == DS_INTERRUPT_RESPONSE_REG_COUNT)
{
for (i = 0; i < DS_INTERRUPT_RESPONSE_REG_COUNT; i++)
{
if (dsstatus_int[i] != 0)
{
/* Display and clear the status */
check_status(naibrd_DS_ClearStatusRaw(inputDSConfig.cardIndex,
inputDSConfig.module, ds_status_type, dsstatus_int[i]));
}
}
}
}
The handler:
-
Decodes the Ethernet message header to extract the sequence number, typecode, and payload size.
-
For read-complete responses, extracts the two 32-bit status register values (BIT loss at index 0, reference loss at index 1).
-
For any non-zero status, prints the interrupt type and status value, then clears the latched status via
naibrd_DS_ClearStatusRaw()to re-arm the interrupt.
The tdr_idr_id parameter identifies which IDR ID generated the packet, allowing the handler to distinguish between BIT loss and reference loss triggers.
|
Important
|
Common Errors
|
Cleanup
When the user exits the IDR server, the sample disables module interrupts and tears down the IDR sessions:
/* Disable DS interrupts */
enableDSInterrupts(inputDSConfig, FALSE);
/* Stop and clear both IDR sessions */
check_status(naibrd_Ether_StopIDR(inputIDRConfig.cardIndex,
(uint16_t)DEF_ETHERNET_DS_REFLOSS_IDR_ID));
check_status(naibrd_Ether_ClearIDRConfig(inputIDRConfig.cardIndex,
(uint16_t)DEF_ETHERNET_DS_REFLOSS_IDR_ID));
check_status(naibrd_Ether_StopIDR(inputIDRConfig.cardIndex,
(uint16_t)DEF_ETHERNET_DS_BITLOSS_IDR_ID));
check_status(naibrd_Ether_ClearIDRConfig(inputIDRConfig.cardIndex,
(uint16_t)DEF_ETHERNET_DS_BITLOSS_IDR_ID));
Always stop and clear IDR sessions when your application exits. Leaving IDR sessions active can prevent other applications from using those IDR IDs and may generate unwanted network traffic.
Troubleshooting Reference
This section summarizes common issues. Consult your module’s manual for hardware-specific diagnostics.
| Error / Symptom | Possible Causes | Suggested Resolution |
|---|---|---|
"DS Ethernet Interrupt Support Prior to Generation 4 Ethernet commands currently not supported" |
Board does not support Gen4 Ethernet protocol. |
Use a Gen4 or later board. Check firmware version. |
No IDR packets received |
Board cannot reach response IP; IDR not started; interrupts not enabled; firewall blocking UDP. |
Verify network connectivity, confirm IDR is started with |
Status registers read all zeros |
Interrupt condition cleared before IDR read; transient event. |
Verify test setup generates a sustained fault. Check edge vs. level trigger configuration. |
IDR configuration fails |
IDR ID already in use; invalid network parameters. |
Ensure IDR IDs are unique. Verify IP address and port values. |
No board found / Connection timeout |
Board not powered; incorrect interface or address; network misconfiguration. |
Verify physical connection, check configuration file, confirm network settings. |
Interrupt fires but wrong status type reported |
Interrupt vector mismatch between module configuration and IDR setup. |
Verify that |
Full Source
Full Source — DS_Interrupt_Ethernet.c (SSK 1.x)
/**************************************************************************************************************/
/**
<summary>
The DS_Interrupt_Ethernet program demonstrates how to perform an interrupt when a single channel receives
a message. The purpose of this program is to demonstrate the method calls in the naibrd library for performing
the interrupt. More information on this process can be found in the naibrd SSK Quick Guide(Interrupts) file.
</summary>
*/
/**************************************************************************************************************/
/************************/
/* Include Declarations */
/************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
/*Common Module Specific Sample Program include files*/
#include "nai_ds_int.h"
#include "nai_ds_cfg.h"
/* Common Sample Program include files */
#include "include/naiapp_interrupt.h"
#include "include/naiapp_interrupt_ether.h"
#include "include/naiapp_boardaccess_menu.h"
#include "include/naiapp_boardaccess_query.h"
#include "include/naiapp_boardaccess_access.h"
#include "include/naiapp_boardaccess_display.h"
#include "include/naiapp_boardaccess_utils.h"
#include "nai_ds_int_ether.h"
/* naibrd include files */
#include "nai.h"
#include "naibrd.h"
/* Module Specific NAI Board Library files */
#include "functions/naibrd_ds.h"
#include "maps/nai_map_ds.h"
static uint8_t DEF_RX_RESPONSE_IPv4_ADDR[] = {192,168,1,100};
static uint8_t COMMANDS[MAX_ETHER_IDR_CMD_CNT*MAX_ETHER_BLOCK_REG_CNT];
etherIntFuncDef dsEtherIntFunc;
bool_t bDisplayEtherUPR;
IDRConfig inputIDRConfig;
/* Extern Functions or Variables*/
extern DsConfig inputDSConfig;
extern InterruptConfig inputInterruptConfig;
/*********************************************/
/* Application Name and Revision Declaration */
/*********************************************/
static const int8_t *CONFIG_FILE = (int8_t *)"default_DS_Interrupt_Ethernet.txt";
/********************************/
/* Internal Function Prototypes */
/********************************/
static bool_t Run_DS_Interrupt_Basic_Ethernet();
/**************************************************************************************************************/
/***** Main Routine *****/
/**************************************************************************************************************/
/**************************************************************************************************************/
/**
<summary>
The main routine assists in gaining access to the board.
The following routines from the nai_sys_cfg.c file are
called to assist with accessing and configuring the board.
- ConfigDevice
- DisplayDeviceCfg
- GetBoardSNModCfg
- CheckModule
</summary>
*/
/*****************************************************************************/
#if defined (__VXWORKS__)
int32_t DS_Interrupt_Basic_Ethernet(void)
#else
int32_t main(void)
#endif
{
bool_t stop = FALSE;
int32_t cardIndex;
int32_t moduleCnt;
int32_t module;
int8_t inputBuffer[80];
int32_t inputResponseCnt;
initializeDSConfigurations(0,0,0,0,0,0);
initializeInterruptConfigurations(FALSE,FALSE,FALSE,0,NAIBRD_INT_STEERING_ON_BOARD_1,-1,0);
initializeIDRConfigurations(0,0,DEF_RX_RESPONSE_PROTOCOL,DEF_RX_RESPONSE_PORT,DEF_RX_RESPONSE_IPv4_ADDR, DEF_RX_RESPONSE_IPv4_LENGTH,COMMANDS,0,0,0);
if (naiapp_RunBoardMenu(CONFIG_FILE) == TRUE)
{
while (stop != TRUE)
{
/* Query the user for the card index */
stop = naiapp_query_CardIndex(naiapp_GetBoardCnt(), 0, &cardIndex);
inputDSConfig.cardIndex = cardIndex;
if (stop != TRUE)
{
check_status(naibrd_GetModuleCount(cardIndex, &moduleCnt));
/* Query the user for the module number */
stop = naiapp_query_ModuleNumber(moduleCnt, 1, &module);
inputDSConfig.module = module;
if (stop != TRUE)
{
inputDSConfig.modid = naibrd_GetModuleID(cardIndex, module);
if ((inputDSConfig.modid != 0))
{
Run_DS_Interrupt_Basic_Ethernet();
}
}
}
printf("\nType Q to quit or Enter key to restart application:\n");
stop = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
}
}
printf("\nType the Enter key to exit the program: ");
naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
naiapp_access_CloseAllOpenCards();
return 0;
}
/**************************************************************************************************************/
/**
<summary>
This function is broken into the following major steps. These steps correspond with the steps provided
in the naibrd SSK Quick Guide(Interrupts) file.
1. Ethernet Interrupt Handling - Setup IDR to handle interrupt
API CALLS - naibrd_Ether_SetIDRConfig, naibrd_Ether_StartIDR,naibrd_Ether_ClearIDRConfig
2. Enable Module Interrupts- Configures module to interrupt when channel receives DS message.
API CALLS - naibrd_DS_SetInterruptEdgeLevel, naibrd_DS_SetIntVector, naibrd_DS_SetInterruptSteering, naibrd_DS_SetIntEnable
3. Show Interrupt Handling - The IDR server will listen on the boards ports for IDRs indicating an interrupt.
These results will be decoded and displayed to the user.
4. Clear Module Configurations
5. Clear Board Configurations
API CALLS - naibrd_Ether_StopIDR, naibrd_Ether_ClearIDRConfig
</summary>
*/
/**************************************************************************************************************/
static bool_t Run_DS_Interrupt_Basic_Ethernet()
{
bool_t bQuit = FALSE;
bool_t bGen4DSIDRCommands;
inputDSConfig.maxChannel = naibrd_DS_GetChannelCount(inputDSConfig.modid);
inputDSConfig.minChannel = 1;
/*check if DS module supports GEN 4 Ethernet*/
bGen4DSIDRCommands = SupportsGen4Ether(inputDSConfig.cardIndex);
if (!bGen4DSIDRCommands)
{
printf("DS Ethernet Interrupt Support Prior to Generation 4 Ethernet commands currently not supported\n");
bQuit = TRUE;
}
if (!bQuit)
{
bQuit = naiapp_query_ChannelNumber(inputDSConfig.maxChannel,inputDSConfig.minChannel,&inputDSConfig.channel);
}
if (!bQuit)
{
bQuit = QueryIDRConfigInformation(&inputIDRConfig);
}
if (!bQuit)
{
bQuit = QueryUserForOnboardOffboardInterrupts(&inputInterruptConfig.bProcessOnboardInterrupts);
}
if (!bQuit)
{
bQuit = QueryUserForEtherIDRMsgDisplay(&bDisplayEtherUPR);
}
if (!bQuit)
{
/****1. Setup IDR to Handle Interrupt (also contains step 6) ****/
if (inputInterruptConfig.bProcessOnboardInterrupts == TRUE)
{
inputIDRConfig.cardIndex = inputDSConfig.cardIndex;
inputIDRConfig.boardInterface = NAI_INTF_ONBOARD;
inputInterruptConfig.steering = NAIBRD_INT_STEERING_ON_BOARD_1;
}
else /*OffBoard Interrupt*/
{
inputIDRConfig.cardIndex = 0;
inputIDRConfig.boardInterface = NAI_INTF_PCI;
inputInterruptConfig.steering = NAIBRD_INT_STEERING_CPCI_APP;
}
setupIDRConfiguration_DS(inputDSConfig,&inputIDRConfig,bGen4DSIDRCommands);
check_status(naibrd_Ether_StartIDR(inputIDRConfig.cardIndex,(uint16_t)DEF_ETHERNET_DS_BITLOSS_IDR_ID));
check_status(naibrd_Ether_StartIDR(inputIDRConfig.cardIndex,(uint16_t)DEF_ETHERNET_DS_REFLOSS_IDR_ID));
/****2. configure module To Interrupt****/
configureDSToInterrupt(inputInterruptConfig,inputDSConfig);
enableDSInterrupts(inputDSConfig,TRUE);
/****3. Show Interrupt Handling****/
dsEtherIntFunc = HandleDSEtherInterrupt;
bQuit = runIDRServer(inputIDRConfig);
/*****4. Clear Module Configurations*****/
enableDSInterrupts(inputDSConfig,FALSE);
/*****5. Clear Board Configurations *****/
check_status(naibrd_Ether_StopIDR(inputIDRConfig.cardIndex, (uint16_t)DEF_ETHERNET_DS_REFLOSS_IDR_ID));
check_status(naibrd_Ether_ClearIDRConfig(inputIDRConfig.cardIndex, (uint16_t)DEF_ETHERNET_DS_REFLOSS_IDR_ID));
check_status(naibrd_Ether_StopIDR(inputIDRConfig.cardIndex, (uint16_t)DEF_ETHERNET_DS_BITLOSS_IDR_ID));
check_status(naibrd_Ether_ClearIDRConfig(inputIDRConfig.cardIndex, (uint16_t)DEF_ETHERNET_DS_BITLOSS_IDR_ID));
}
return bQuit;
}