EMS Manual
Procedure Calls for Standard Events
EMS Manual—426909-005
11-41
Usage Threshold Programming Example
Usage Threshold Programming Example
This C example illustrates how the standard usage threshold event is reported:
/*
* External declarations
*/
#pragma RUNNABLE
#pragma NOXMEM
#include <stdlib.h> nolist
#include <string.h> nolist
#include <stdio.h> nolist
#include <tal.h> nolist
#include <CEXTDECS(EMS_UTCB_INIT_, EMS_USAGE_THRESHOLD_CHK_)>
nolist
#include <CEXTDECS(EMS_USAGE_THRESHOLD_EVT_BLD_, FILE_OPEN_)>
nolist
#include <CEXTDECS(SSGETTKN, WRITEREAD, EMSADDTOKENS)>
nolist
#include "$dsv.Zspidef.ZSPIC" nolist
#include "$dsv.Zspidef.ZEMSC" nolist
#include "$dsv.Zspidef.ZCOMC" nolist
#pragma PAGE "Globals and defines"
#include "MYAPC" /* Includes DDL generated from MYAPDDL
*/
#include "myerror" /* handling error messages */
/*
* Define values
*/
#define NULL 0
#define THRESHOLD_LEN 20
#define LINE_NAME_LEN 25
#define TOKEN_LENGTH 15
#pragma PAGE "main program code"
int main(void)
{
/*
* Declare ssid using the typedef from the DDL output
*/
myap_val_ssid_def myap_ssid;
/*
* Global declarations and variables
*/
short buffer[ZEMS_VAL_EVT_BUFLEN];
short buf_len = 0;
char coll_name[] = "$mycol";
short coll_num;
short usage_threshold_cb[THRESHOLD_LEN];