#include "lcm.h"
//ASC码转换成16进制表
const unsigned char char_tab[128]=
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0,
0, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
//16进制的ASC码
const unsigned char tab_char[16]=
{
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
char ASC_MSK[96*16] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*-- --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, /*-- ! --*/
0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,
0x00,0x00,0x00,0x66,0x66,0x66,0x00,0x00, /*-- " --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x36,0x36,0x7F,0x36,0x36, /*-- # --*/
0x36,0x7F,0x36,0x36,0x00,0x00,0x00,0x00,
0x00,0x18,0x18,0x3C,0x66,0x60,0x30,0x18, /*-- $ --*/
0x0C,0x06,0x66,0x3C,0x18,0x18,0x00,0x00,
0x00,0x00,0x70,0xD8,0xDA,0x76,0x0C,0x18, /*-- % --*/
0x30,0x6E,0x5B,0x1B,0x0E,0x00,0x00,0x00,
0x00,0x00,0x00,0x38,0x6C,0x6C,0x38,0x60, /*-- & --*/
0x6F,0x66,0x66,0x3B,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x18,0x18,0x00,0x00, /*-- ’ --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00, 0x02, 0x04, 0x08, 0x08, 0x10, 0x10, 0x10, /*-- ( --*/
0x10, 0x10, 0x10, 0x08, 0x08, 0x04, 0x02, 0x00,
0x00, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, /*-- ) --*/
0x08, 0x08, 0x08, 0x10, 0x10, 0x20, 0x40, 0x00,
0x00,0x00,0x00,0x00,0x00,0x36,0x1C,0x7F, /*-- * --*/
0x1C,0x36,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E, /*-- + --*/
0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*-- , --*/
0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x20, 0xc0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, /*-- - --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*-- . --*/
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,
0x00,0x00,0x00,0x06,0x06,0x0C,0x0C,0x18, /*-- / --*/
0x18,0x30,0x30,0x60,0x60,0x00,0x00,0x00,
0x00, 0x00, 0x00, 0x18, 0x24, 0x42, 0x42, 0x42, /*-- 0 --*/
0x42, 0x42, 0x42, 0x42, 0x24, 0x18, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x70, 0x10, 0x10, 0x10, /*-- 1 --*/
0x10, 0x10, 0x10, 0x10, 0x10, 0x7c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x42, 0x04, /*-- 2 --*/
0x04, 0x08, 0x10, 0x20, 0x42, 0x7e, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x04, 0x18, /*-- 3 --*/
0x04, 0x02, 0x02, 0x42, 0x44, 0x38, 0x00, 0x00,
0x00, 0x00, 0x00, 0x04, 0x0c, 0x14, 0x24, 0x24, /*-- 4 --*/
0x44, 0x44, 0x7e, 0x04, 0x04, 0x1e, 0x00, 0x00,
0x00, 0x00, 0x00, 0x7e, 0x40, 0x40, 0x40, 0x58, /*-- 5 --*/
0x64, 0x02, 0x02, 0x42, 0x44, 0x38, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1c, 0x24, 0x40, 0x40, 0x58, /*-- 6 --*/
0x64, 0x42, 0x42, 0x42, 0x24, 0x18, 0x00, 0x00,
0x00, 0x00, 0x00, 0x7e, 0x44, 0x44, 0x08, 0x08, /*-- 7 --*/
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x42, 0x24, /*-- 8 --*/
0x18, 0x24, 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x18, 0x24, 0x42, 0x42, 0x42, /*-- 9 --*/
0x26, 0x1a, 0x02, 0x02, 0x24, 0x38, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, /*-- : --*/
0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x00, /*-- ; --*/
0x00,0x00,0x1C,0x1C,0x0C,0x18,0x00,0x00,
0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60, /*-- < --*/
0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00, /*-- = --*/
0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06, /*-- > --*/
0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x3C,0x66,0x66,0x0C,0x18, /*-- ? --*/
0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7E,0xC3,0xC3,0xCF,0xDB, /*-- @ --*/
0xDB,0xCF,0xC0,0x7F,0x00,0x00,0x00,0x00,
0x00, 0x00, 0x00, 0x10, 0x10, 0x18, 0x28, 0x28, /*-- A --*/
0x24, 0x3c, 0x44, 0x42, 0x42, 0xe7, 0x00, 0x00,
0x00,0x00,0x00,0x7C,0x66,0x66,0x66,0x7C, /*-- B --*/
0x66,0x66,0x66,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x3C,0x66,0x66,0x60,0x60, /*-- C --*/
0x60,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x78,0x6C,0x66,0x66,0x66, /*-- D --*/
0x66,0x66,0x6C,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7E,0x60,0x60,0x60,0x7C, /*-- E --*/
0x60,0x60,0x60,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7E,0x60,0x60,0x60,0x7C, /*-- F --*/
0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x3C,0x66,0x66,0x60,0x60, /*-- G --*/
0x6E,0x66,0x66,0x3E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x7E, /*-- H --*/
0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
0x00, 0x00, 0x00, 0x7c, 0x10, 0x10, 0x10, 0x10, /*-- I --*/
0x10, 0x10, 0x10, 0x10, 0x10, 0x7c, 0x00, 0x00,
0x00,0x00,0x00,0x06,0x06,0x06,0x06,0x06, /*-- J --*/
0x06,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x66,0x66,0x6C,0x6C,0x78, /*-- K --*/
0x6C,0x6C,0x66,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60, /*-- L --*/
0x60,0x60,0x60,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x63,0x63,0x77,0x6B,0x6B, /*-- M --*/
0x6B,0x63,0x63,0x63,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x63,0x63,0x73,0x7B,0x6F, /*-- N --*/
0x67,0x63,0x63,0x63,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x66, /*-- O --*/
0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,
0x00, 0x00, 0x00, 0xfc, 0x42, 0x42, 0x42, 0x42, /*-- P --*/
0x7c, 0x40, 0x40, 0x40, 0x40, 0xe0, 0x00, 0x00,
0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x66, /*-- Q --*/
0x66,0x66,0x66,0x3C,0x0C,0x06,0x00,0x00,
0x00,0x00,0x00,0x7C,0x66,0x66,0x66,0x7C, /*-- R --*/
0x6C,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x3C,0x66,0x60,0x30,0x18, /*-- S --*/
0x0C,0x06,0x66,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7E,0x18,0x18,0x18,0x18, /*-- T --*/
0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66, /*-- U --*/
0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66, /*-- V --*/
0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00,
0x00, 0x00, 0x00, 0xd6, 0x92, 0x92, 0x92, 0x92, /*-- W --*/
0xaa, 0xaa, 0x6c, 0x44, 0x44, 0x44, 0x00, 0x00,
0x00,0x00,0x00,0x66,0x66,0x34,0x18,0x18, /*-- X --*/
0x2C,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x3C, /*-- Y --*/
0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7E,0x06,0x06,0x0C,0x18, /*-- Z --*/
0x30,0x60,0x60,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x3C,0x30,0x30,0x30,0x30, /*-- [ --*/
0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x3C,
0x00,0x00,0x00,0x60,0x60,0x30,0x30,0x18, /*-- \ --*/
0x18,0x0C,0x0C,0x06,0x06,0x00,0x00,0x00,
0x00,0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x