📄 db.h
字号:
** bParameter = Which event log (non-retentive, retentive, fatal)
** lLeEventNumber = Minimum event number to return
**
**---------------------------------------------------------------------------
*/
#define DB_PARAM_EVENT_FATAL 4
#define DB_PARAM_EVENT_RETENTIVE 5
#define DB_PARAM_EVENT_NON_RETENTIVE 6
typedef packet_struct DB_LeEventLogEntryType
{
LeUINT32 lLeNumber; /* Event number */
LeUINT16 iLeStatus; /* Event code (defined in gs_stat.h) */
LeUINT16 iLeEventSeverity; /* Severity code of event (defined in gs.h) */
LeUINT16 iLeParameter; /* Event specific parameters */
LeUINT32 lLeParameter;
LeUINT16 iLeMSeconds; /* Node time when event occurred */
LeUINT32 lLeSeconds;
LeUINT32 lLeTaskId; /* Task that logged event */
char achTaskName[ 10 ]; /* Task name is NULL terminated string */
LeUINT16 iLeSourceLine; /* Source line and file where event logged */
char achSourceFile[ 1 ]; /* File name is NULL terminated string */
}
GNU_PACKED DB_LeEventLogEntryType;
/*---------------------------------------------------------------------------
**
** DB_LeHeapBucketType
**
** Command response structure - Heap buckets.
**
** Response contains the number of memory allocation requests of various
** sizes since the device was power cycled of reset. The size granularity
** is 16 byte chunks. This means that bucket 0 contains the number of
** allocation requests for memory chunks of 0 to 16 bytes,
** bucket 1 = 17 to 32 byte requests, bucket 2 = 33 to 47 byte requests, etc.
** This information can be used to tune the operation of the dynamic heap.
**
** Command request: DB_GenericRequestHeaderType
** bCommand = DB_CMD_GET_HEAP_BUCKETS
** bParameter = Unused
**
**---------------------------------------------------------------------------
*/
typedef packet_struct DB_LeHeapBucketType
{
LeUINT16 iLeNumBuckets;
/* LeUINT32 lLeBucketDemand[ iLeNumBuckets ]; */
}
GNU_PACKED DB_LeHeapBucketType;
/*---------------------------------------------------------------------------
**
** DB_LeHeapInfoType
** DB_LeHeapStatusType
**
** Command response structure - Heap status.
**
** Response contains the current state of the dynamic heap managed by the OS.
**
** Command request: DB_GenericRequestHeaderType
** bCommand = DB_CMD_GET_HEAP_STATUS
** bParameter = Unused
**
**---------------------------------------------------------------------------
*/
typedef packet_struct DB_LeHeapInfoType
{
LeUINT16 iLePartitionSize;
LeUINT16 iLeTotalPopulation;
LeUINT16 iLePopulation;
LeUINT16 iLeLowWater;
}
GNU_PACKED DB_LeHeapInfoType;
typedef packet_struct DB_LeHeapStatusType
{
LeUINT16 iLeNumPartitions; /* Number of heap partitions */
/* DB_LeHeapInfoType[ iLeNumPartitions ]; */
}
GNU_PACKED DB_LeHeapStatusType;
/*---------------------------------------------------------------------------
**
** DB_LeNetLinxDPDiag1Type
**
** Command response structure - NetLinx dualport diagnostic set 1.
**
** Response contains some diagnostic counters from the NetLinx dualport.
**
** Command request: DB_GenericRequestHeaderType
** bCommand = DB_CMD_GET_NETLINX_DP_SET1
** bParameter = Unused
**
**---------------------------------------------------------------------------
*/
typedef packet_struct DB_LeNetLinxDPDiag1Type
{
LeUINT16 iLeCard2HostMsgQHiWater;
LeUINT32 lLeCard2HostMsgAreaHiWater;
LeUINT16 iLeCard2HostMbQHiWater;
LeUINT32 lLeMailboxAreaHiWater;
LeUINT32 lLeMailboxAreaUsage;
LeUINT16 iLeMsgAreaAllocFail;
LeUINT16 iLeMsgQAllocFail;
LeUINT16 iLeMbAreaAllocFail;
LeUINT16 iLeMbQAllocFail;
}
GNU_PACKED DB_LeNetLinxDPDiag1Type;
/*---------------------------------------------------------------------------
**
** DB_LeNodeTime
**
** Command response structure - Elapsed time since node startup.
**
** Response is the amount of time elapsed since the node in question
** has been power cycled or reset. Range is on the order of 130 years.
**
** Command request: DB_GenericRequestHeaderType
** bCommand = DB_CMD_GET_NODE_TIME
** bParameter = Unused
**
**---------------------------------------------------------------------------
*/
typedef packet_struct DB_LeNodeTimeType
{
LeUINT32 lLeSeconds; /* Seconds */
LeUINT16 iLeMSeconds; /* Milliseconds */
}
GNU_PACKED DB_LeNodeTimeType;
/*---------------------------------------------------------------------------
**
** DB_LeRevisionType
**
** Command response structure - Debug Object revision.
**
** Initial request to the debug object for compatibility with
** earlier/later versions.
**
** Command request: DB_GenericRequestHeaderType
** bCommand = DB_CMD_GET_REVISION
** bParameter = Unused
**
**---------------------------------------------------------------------------
*/
typedef packet_struct DB_LeRevisionType
{
LeUINT16 iLeRevision; /* Debug object revision number */
}
GNU_PACKED DB_LeRevisionType;
/*---------------------------------------------------------------------------
**
** DB_LeStaticHeapStatusType
**
** Command response structure - Static heap status.
**
** Response contains the total and available size of the static heap.
** The total amount of static heap used can be calculated from these numbers.
**
** Command request: DB_GenericRequestHeaderType
** bCommand = DB_CMD_GET_STATIC_HEAP_STATUS
** bParameter = Unused
**
**---------------------------------------------------------------------------
*/
typedef packet_struct DB_LeStaticHeapStatusType
{
LeUINT32 lLeTotalSize;
LeUINT32 lLeFree;
}
GNU_PACKED DB_LeStaticHeapStatusType;
/*---------------------------------------------------------------------------
**
** DB_LeTaskInfoType
** DB_LeTaskStatusType
**
** Command response structure - Task status details.
**
** Status is returned in groups of one or more tasks.
**
** Command request: DB_GenericRequestHeaderType
** bCommand = DB_CMD_GET_TASK_STATUS
** bParameter = First task number to get status for (0...n).
**
**---------------------------------------------------------------------------
*/
typedef packet_struct DB_LeTaskInfoType
{
UINT8 bTaskNumber; /* Sequential task number */
UINT8 bPad;
LeUINT32 lLeTaskId; /* Task identifier */
char achTaskName[ 10 ]; /* Task name is NULL terminated string */
LeUINT16 iLePriority; /* Task priority */
LeUINT16 iLeStackMargin; /* Unused stack for task (bytes) */
UINT8 bQueueHiCurrent; /* Current depth of hi priority queue */
UINT8 bQueueHiMax; /* Max depth of hi priority queue */
LeUINT32 lLeQueueHiTotal; /* Total requests on hi prio queue */
UINT8 bQueueLoCurrent; /* Ditto for lo priority queue */
UINT8 bQueueLoMax;
LeUINT32 lLeQueueLoTotal;
LeUINT16 iLeMSeconds; /* Approximate total time task has run */
LeUINT32 lLeSeconds;
}
GNU_PACKED DB_LeTaskInfoType;
typedef packet_struct DB_LeTaskStatusType
{
UINT8 bTotalTasks; /* Total number of tasks */
UINT8 bNumTasks; /* Number of tasks in this response */
LeUINT16 iLePercentCpuUsed; /* % CPU utilization in .01% units */
/* DB_LeTaskInfoType asStacks[ iLeNumTasks ] */
}
GNU_PACKED DB_LeTaskStatusType;
/*---------------------------------------------------------------------------
**
** DB_LeVersionsType
**
** Command response structure - Firmware versions.
**
** Individual version numbers are returned for the example code (CML),
** the communications ASIC firmware, and the device's application firmware.
**
** Command request: DB_GenericRequestHeaderType
** bCommand = DB_CMD_GET_VERSIONS
** bParameter = Unused
**
**---------------------------------------------------------------------------
*/
typedef packet_struct DB_LeVersionsType
{
UINT8 bExClass; /* Example code version numbers */
UINT8 bExMajor;
UINT8 bExMinor;
UINT8 bExReleaseLetter;
LeUINT16 iLeExReleaseNumber;
LeUINT16 iLeExInternal;
UINT8 bExDay;
UINT8 bExMonth;
LeUINT16 iLeExYear;
UINT8 bAsicFwClass; /* CNA10 ASIC firmware version numbers */
UINT8 bAsicFwMajor; /* All 0 if SMAC ASIC used */
UINT8 bAsicFwMinor;
UINT8 bAsicFwInternal;
UINT8 bAppFwClass; /* Application firmware version numbers*/
UINT8 bAppFwMajor;
UINT8 bAppFwMinor;
UINT8 bAppFwInternal;
}
GNU_PACKED DB_LeVersionsType;
#ifdef DEBUG_OBJECT
/****************************************************************************
*****************************************************************************
**
** Public internal object interface - Constants
**
*****************************************************************************
*****************************************************************************
*/
/* None defined */
/****************************************************************************
*****************************************************************************
**
** Public internal object interface - Enums
**
*****************************************************************************
*****************************************************************************
*/
/* None defined */
/****************************************************************************
*****************************************************************************
**
** Public internal object interface - Structures
**
*****************************************************************************
*****************************************************************************
*/
/* None defined */
/****************************************************************************
**
** Public internal object interface - Structures (including tribbles)
**
*****************************************************************************
*/
/* None defined */
/****************************************************************************
*****************************************************************************
**
** Public internal object interface - Tribbles
**
*****************************************************************************
*****************************************************************************
*/
/*---------------------------------------------------------------------------
**
** DB_TrrblType
**
** Tribble for local requests to the debug object.
** The request details are contained in a packet in the combuf as if
** it were being sent over the network. The response data will also be
** contained in the attached combuf when the tribble returns.
**
**---------------------------------------------------------------------------
*/
typedef struct DB_TrrblType
{
GS_TRRBL_HEADER; /* the standard tribble header */
CB_ComBufType *pComBuf; /* pointer to packet ComBuf */
UINT16 iPort; /* communications port number */
UINT8 bMacId; /* destination MAC ID of rq, 0=local */
}
DB_TrrblType;
/****************************************************************************
*****************************************************************************
**
** Public internal object interface - Globals
**
*****************************************************************************
*****************************************************************************
*/
/*---------------------------------------------------------------------------
**
** Debug object task request queue.
**
**---------------------------------------------------------------------------
*/
extern GS_MsgQueueType DB_xQid;
/****************************************************************************
*****************************************************************************
**
** Public internal object interface - Services
**
*****************************************************************************
*****************************************************************************
*/
/*---------------------------------------------------------------------------
**
** DB_Init()
**
** Debug object data/task creation/allocation/initialization.
**
**---------------------------------------------------------------------------
**
** Inputs:
** iOptions - Bit mask of initialization options
**
** Outputs:
** Return - Success/failure status
**
** Usage:
** eStatus = DB_Init( AB_COLD_START_RESOURCE );
**
**---------------------------------------------------------------------------
*/
EXTFUNC StatusType DB_Init( UINT16 iOptions );
#endif /* #ifdef DEBUG_OBJECT */
#endif /* inclusion lock */
/****************************************************************************
*****************************************************************************
**
** End of DB.H
**
*****************************************************************************
*****************************************************************************
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -