📄 mmsapp.c
字号:
printf ("\t %c6 - DELETE JOURNAL\n",c); printf ("\t %s - RETURN TO MAIN MENU\n",str); flush_keys (); fun_null (); funct_1 = do_jread; funct_2 = do_jwrite; funct_3 = do_jinit; funct_4 = do_jstat; funct_5 = do_jcreate; funct_6 = do_jdelete; menu_set_fun = set_jou; /* used to reset the menu */ }/************************************************************************//* do_fil_ops *//* This function executes the file operation menu *//************************************************************************/ST_VOID do_fil_ops (ST_VOID) { set_file (); menu_service (); /* Service keyboard/MMS until exit from menu */ set_main (); }/************************************************************************//* set_file *//* function to set up the file operations screen and function key table *//************************************************************************/ST_VOID set_file (ST_VOID) { CLEARSCR; print_demo (); printf ("\n\n"); printf ("\t SELECT DESIRED MMS COMMUNICATION ACTIVITY\n\n"); printf ("\t %c1 - COPY FILE\n",c); printf ("\t %c2 - OBTAIN FILE\n",c); printf ("\t %c3 - FILE OPEN\n",c); printf ("\t %c4 - FILE READ\n",c); printf ("\t %c5 - FILE CLOSE\n",c); printf ("\t %c6 - FILE RENAME\n",c); printf ("\t %c7 - FILE DELETE\n",c); printf ("\t %c8 - FILE DIRECTORY\n",c); printf ("\t %c9 - FILE MANAGEMENT MENU\n",c); printf ("\t %s - RETURN TO MAIN MENU\n",str); flush_keys (); fun_null (); funct_1 = do_fcopy; funct_2 = do_obtfile; funct_3 = do_fopen; funct_4 = do_fread; funct_5 = do_fclose; funct_6 = do_frename; funct_7 = do_fdelete; funct_8 = do_fdir; funct_9 = do_file_mgt; menu_set_fun = set_file; /* used to reset the menu */ }/************************************************************************//* do_file_mgt *//* function to execute file management menu *//************************************************************************/ST_VOID do_file_mgt (ST_VOID) { set_file_mgt (); menu_service (); /* Service keyboard/MMS until exit from menu */ set_file (); }/************************************************************************//* set_file_mgt *//* function to set up the file management screen and function key table *//************************************************************************/ST_VOID set_file_mgt (ST_VOID) { CLEARSCR; print_demo (); printf ("\n\n"); printf ("\t SELECT DESIRED MMS COMMUNICATION ACTIVITY\n\n"); printf ("\t %c1 - DISPLAY OPEN LOCAL FILES\n",c); printf ("\t %c2 - DISPLAY OPEN REMOTE FILES\n",c); printf ("\t %s - RETURN TO FILE OPERATIONS MENU\n",str); flush_keys (); fun_null (); funct_1 = do_disp_loc_files; funct_2 = do_disp_rem_files; menu_set_fun = set_file_mgt; /* used to reset the menu */ }/************************************************************************//* do_misc *//* This function executes the miscellaneous set of test features *//************************************************************************/ST_VOID do_misc (ST_VOID) { set_misc (); menu_service (); /* Service keyboard/MMS until exit from menu */ set_more (); }/************************************************************************//* set_misc *//* function to set up the miscellaneous screen and function key table *//************************************************************************/ST_VOID set_misc (ST_VOID) { CLEARSCR; print_demo (); printf ("\n\n"); printf ("\t SELECT DESIRED ACTIVITY\n\n"); printf ("\t %c1 - SETUP CONTINUOUS SEND\n",c); printf ("\t %c2 - ISSUE SYSTEM COMMAND\n",c); printf ("\t %c3 - SET MMS DEBUG LEVELS\n",c); printf ("\t %c4 - WAIT FOR MMS EVENT\n",c); printf ("\t %c5 - SUIC MENU\n",c); printf ("\t %c6 - DISPLAY MMS-EASE ERROR CODE DESCRIPTION\n",c); printf ("\t %c7 - SET MMS SERVICE MODIFIER\n",c); printf ("\t %c8 - SET COMPANION STANDARD INFO\n",c); printf ("\t %c9 - TEST MENU\n",c); printf ("\t %s - RETURN TO MAIN MENU\n",str); flush_keys (); fun_null (); funct_1 = do_set_cont; funct_2 = do_sys_com; funct_3 = do_debugset; funct_4 = do_wait_event; funct_5 = do_suic; funct_6 = do_mms_err; funct_7 = do_set_mod; funct_8 = do_set_cs; funct_9 = do_test; menu_set_fun = set_misc; /* used to reset the menu */ }/************************************************************************//* do_suic *//* execute SUIC function menu *//************************************************************************/ST_VOID do_suic (ST_VOID) { set_suic (); menu_service (); /* Service keyboard/MMS until exit from menu */ set_misc (); }/************************************************************************//* set_suic *//* function to set up the suic screen and function key table *//************************************************************************/ST_VOID set_suic (ST_VOID) { CLEARSCR; print_demo (); printf ("\n\n"); printf ("\t SELECT DESIRED SUIC COMMUNICATION ACTIVITY\n\n"); printf ("\t %c1 - ACTIVATE AR NAME\n",c); printf ("\t %c2 - DE-ACTIVATE AR NAME\n",c); printf ("\t %c3 - REGISTER AR NAME\n",c);#ifdef DEBUG_SISCO printf ("\t %c4 - DISPLAY STATUS OF COMMUNICATION SYSTEM\n",c);#endif#ifndef PSOS_SYSTEM printf ("\t %c5 - MODIFY DEBUG MESSAGE LEVEL\n",c);#endif#ifdef MAP30_LLC printf ("\t %c6 - Set Remote Alias\n",c); printf ("\t %c7 - Set Remote Address Via Alias\n",c);#endif printf ("\t %s - RETURN TO MISC. MENU\n",str); flush_keys (); fun_null (); funct_1 = do_activate; funct_2 = do_deactivate; funct_3 = do_register;#ifdef DEBUG_SISCO funct_4 = comm_stat;#endif#ifndef PSOS_SYSTEM funct_5 = debug_set;#endif#ifdef MAP30_LLC funct_6 = set_name_alias; funct_7 = set_remote_dest_addr;#endif menu_set_fun = set_suic; /* used to reset the menu */ }#if defined(UCA_SMP) /* JRB - only works with UCA TRIM-7 or Reduced Stack*/ST_VOID uca_timesync_callback (ST_LONG user_id, ST_RET result, SMP_TIME *delta_time);/************************************************************************//* do_uca_timesync *//* This function executes the UCA SMP Time Synchronization operation *//************************************************************************/ST_VOID do_uca_timesync (ST_VOID) {ST_LONG user_id = 77; /* we may want set a pointer to some info instead */#if !defined(REDUCED_STACK)ST_CHAR rem_ar_name[180]; printf (" Enter the Remote AR Name: "); if (!strget (rem_ar_name)) { (*menu_set_fun) (); return; } if (smp_time_sync_req_ar_name (user_id, rem_ar_name, uca_timesync_callback) != SD_SUCCESS) { printf ("\n Time Synchronization Request Failed. "); wait_msg ("Press any key to continue"); }#elseST_INT chan; printf ("\n Enter the connected Channel # : "); if (!intget (&chan)) { (*menu_set_fun) (); return; } if (smp_time_sync_req_chan (user_id, chan, uca_timesync_callback) != SD_SUCCESS) { printf ("\n Time Synchronization Request Failed. "); wait_msg ("Press any key to continue"); }#endif /* REDUCED_STACK */ (*menu_set_fun) (); }ST_VOID uca_timesync_callback (ST_LONG user_id, ST_RET result, SMP_TIME *delta_time) { if (result == SD_SUCCESS) { printf ("\n Time Synchronization Successfull.\n" " Delta.days= %d Delta.msec= %d Delta.usec= %d\n", delta_time->days, delta_time->msec, delta_time->usec); wait_msg ("Press any key to continue"); } else { printf ("\n Time Synchronization Failed. "); wait_msg ("Press any key to continue"); } (*menu_set_fun) (); }#endif /* UCA_SMP *//************************************************************************/#ifdef PSOS_SYSTEM /* PSOS_SYSTEM Wait any event code *//************************************************************************//* function : init_event_handling *//************************************************************************/ST_VOID init_event_handling (ST_VOID) { /* Zero Out the Flag's */ AKeyWasHit = 0; NetReadDataPresent = 0; }/************************************************************************//* function : wait_any_event *//************************************************************************/ST_VOID wait_any_event (ST_LONG TimeVal) { int RetValue = 0; while (RetValue == 0) { if ((AKeyWasHit == 0) && (NetReadDataPresent == 0)) { /* Put Me to Sleep for some time */ t_suspend (TasksInSystemID[0]); } else RetValue = 1; } }/************************************************************************/#endif /* End of PSOS_SYSTE Event handeling Code *//************************************************************************/#if ((defined (__MSDOS__) || defined (MSDOS)) && !defined (_WINDOWS))/************************************************************************//* init_event_handling *//************************************************************************/ST_VOID init_event_handling (ST_VOID) { /* Do nothing. */ }/************************************************************************//* wait_any_event *//************************************************************************/ST_VOID wait_any_event (ST_LONG max_ms_delay) { /* Do nothing. */ }/************************************************************************/#endif /* End of __MSDOS__ Event handling code *//************************************************************************/#if (defined (_WINDOWS) && !defined (_WIN32))/************************************************************************//* init_event_handling *//************************************************************************/ST_VOID init_event_handling (ST_VOID) { /* Do nothing. */ }/************************************************************************//* wait_any_event *//************************************************************************/ST_VOID wait_any_event (ST_LONG max_ms_delay) { /* Do nothing. */ }/************************************************************************/#endif /* End of _WINDOWS Event handling code *//************************************************************************/#if (SYSTEM_SEL & (OPEN_VMS)) /************************************************************************//* init_event_handling *//************************************************************************/ST_VOID init_event_handling (ST_VOID) { }/************************************************************************//* wait_any_event *//************************************************************************/ST_VOID wait_any_event (ST_LONG max_ms_delay) { wait_any_event_vms (max_ms_delay); }#endif /* SYSTEM_SEL & (OPEN_VMS) */#if (SYSTEM_SEL & SYS_5) || defined (VXWORKS)/************************************************************************//* init_event_handling *//************************************************************************/ST_VOID init_event_handling (ST_VOID) { /* Do nothing. */ }/************************************************************************//* wait_any_event *//************************************************************************/ST_VOID wait_any_event (ST_LONG max_ms_delay) {#if !defined (VXWORKS) struct timeval stTimeVal; fd_set readfds; fd_set writefds; fd_set exceptfds; int rc,nfds=0; fflush (stdout); errno = 0; /*** does not hurt to initialize the errno ***/ FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); FD_SET (0, &readfds); /* select on "stdin" */ FD_SET (mms_event_fd, &readfds ); /* select on MMS Event pipe */ max_ms_delay *= 1000; /*** Convert to micro seconds ***/ stTimeVal.tv_sec = max_ms_delay / 1000000; stTimeVal.tv_usec = max_ms_delay % 1000000; rc = select (FD_SETSIZE, &readfds, &writefds, &exceptfds, &stTimeVal);#endif /* #if !defined (VXWORKS) */ }/************************************************************************/#endif /* End of SYS_5, VXWORKS Event handling code *//************************************************************************/#if defined (__OS2__)/************************************************************************//* init_event_handling *//************************************************************************/#define KBD_EVENT_SEM_ID 0#define SUIC_EVENT_SEM_ID 1ST_VOID init_event_handling (ST_VOID) {APIRET apiret;/* For OS/2, we use the SUIC and Keyboard event semaphores in the *//* 'wait for event' function *//* The SUIC event semaphore should already be created (in strt_MMS). *//* Be sure strt_MMS is called before this function. */ if (s_read_event_sem == 0) { printf ("\n s_read_event_sem has not been set. Call strt_MMS first."); wait_msg (""); }/* The keyboard event semaphore is already created (in term_init) *//* Make up a mux wait semaphore with keyboard and SUIC event semaphores */ sems[0].hsemCur = (void *) o_kbd_event_sem; sems[0].ulUser = KBD_EVENT_SEM_ID; sems[1].hsemCur = (void *) s_read_event_sem; sems[1].ulUser = SUIC_EVENT_SEM
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -