下载地址
Workbench3.x-VxWorks6.x仿真测试和调试指南
下载地址
sp function,[arg1],...,[arg9]
-启动任务,最多接受9个参数,默认的优先级100、堆栈20000字节
period n,function,[arg1],...,[arg8]
-创建一个周期调用function的任务,周期为n秒,最多接受8个参数
repeat m,function,[arg1],...,[arg8]
-创建一个反复调用function的任务,调用次数为m,m=0时永久调用,最多也是8个参数
ts tidX -挂起任务
tr tidX -恢复挂起的任务
td tidX -删除任务
i tidX -显示任务基本信息,参数为0时显示全部任务
ti tidX -显示任务详细信息,包括寄存器、堆栈等
tt tidX -显示任务的函数调用关系
checkStack tidX -显示任务堆栈使用的历史统计,参数为0时显示全部任务
Signal是一种处理异常或异步改变执行流程的机制,类似于软中断。与POSIX兼容,VxWorks也定义了多种Signal(0为NULL Signal)
#define SIGHUP 1 /* hangup */ #define SIGINT 2 /* interrupt */ #define SIGQUIT 3 /* quit */ #define SIGILL 4 /* illegal instruction (not reset when caught) */ #define SIGTRAP 5 /* trace trap (not reset when caught) */ #define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ #define SIGEMT 7 /* EMT instruction */ #define SIGFPE 8 /* floating point exception */ #define SIGKILL 9 /* kill */ #define SIGBUS 10 /* bus error */ #define SIGSEGV 11 /* segmentation violation */ #define SIGFMT 12 /* STACK FORMAT ERROR (not posix) */ #define SIGPIPE 13 /* write on a pipe with no one to read it */ #define SIGALRM 14 /* alarm clock */ #define SIGTERM 15 /* software termination signal from kill */ #define SIGCNCL 16 /* pthreads cancellation signal */ #define SIGSTOP 17 /* sendable stop signal not from tty */ #define SIGTSTP 18 /* stop signal from tty */ #define SIGCONT 19 /* continue a stopped process */ #define SIGCHLD 20 /* to parent on child stop or exit */ #define SIGTTIN 21 /* to readers pgrp upon background tty read */ #define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ #define SIGRES1 23 /* reserved signal number (Not POSIX) */ #define SIGRES2 24 /* reserved signal number (Not POSIX) */ #define SIGRES3 25 /* reserved signal number (Not POSIX) */ #define SIGRES4 26 /* reserved signal number (Not POSIX) */ #define SIGRES5 27 /* reserved signal number (Not POSIX) */ #define SIGRES6 28 /* reserved signal number (Not POSIX) */ #define SIGRES7 29 /* reserved signal number (Not POSIX) */ #define SIGUSR1 30 /* user defined signal 1 */ #define SIGUSR2 31 /* user defined signal 2 */ #define SIGPOLL 32 /* pollable event */ #define SIGPROF 33 /* profiling timer expired */ #define SIGSYS 34 /* bad system call */ #define SIGURG 35 /* high bandwidth data is available at socket */ #define SIGVTALRM 36 /* virtual timer expired */ #define SIGXCPU 37 /* CPU time limit exceeded */ #define SIGXFSZ 38 /* file size time limit exceeded */ #define SIGEVTS 39 /* signal event thread send */ #define SIGEVTD 40 /* signal event thread delete */ #define SIGRTMIN 48 /* Realtime signal min */ #define SIGRTMAX 63 /* Realtime signal max */ #define _NSIGS 63
任务或ISR可以发送Signal到任务本身或其它任务;而对方可以根据Signal Mask选择接收还是忽略该Signal。如果要接收的话,需要注册Signal的处理函数
Socket网络编程的广播用的地址是255.255.255.255,广播数据不会被路由器转发,限定于局域网内,否则就是网络风暴了。
广播的代码比较简单,直接参考单播/组播的例子写一个。
Server端的流程如下:
© 2024 VxWorks Club