第一步 移植boa服务器到2440,在上一篇文章已经描述过。
第二步 2440通过串口连接CC2530 ,2440一共有3个串口,dev/tts/0(1,2)其中串口0是RS232电平的,串口1,2只有TTL电平,串口0要用作终端控制,所以选择串口2作为串口输出,通过一个转换芯片把TTL连接到CC2530的RS232接口上。修改mini2440的串口程序,使程序每执行一次,则发出一个字母‘a’,mini2440 串口程序如下
# include <stdio.h>
# include <stdlib.h>
# include <termio.h>
# include <unistd.h>
# include <fcntl.h>
# include <getopt.h>
# include <time.h>
# include <errno.h>
# include <string.h>
int main(int argc, char **argv)
{
int CommFd, TtyFd;
struct termios TtyAttr;
struct termios BackupTtyAttr;
int DeviceSpeed = B115200;
int TtySpeed = B115200;
int ByteBits = CS8;
const char *DeviceName = "/dev/ttyS0";
const char *TtyName = "/dev/tty";
int OutputHex = 0;
int OutputToStdout = 0;
int UseColor = 0;
opterr = 0;
printf("Content-type: text/html\n\n");
printf("<TITLE>Mult Result</TITLE>");
printf("<H3>Mult Result</H3>");
DeviceName =