亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? preform.c

?? LP830 無線識別卡 讀寫程序demo
?? C
?? 第 1 頁 / 共 5 頁
字號:
// ****************************************************************************
//
// File Name:    preform.c
//
// Description: Preform a selected function.  Request information necessary 
// for the given command and then execute it.
//
//
//  ORIGINATOR: Escort Memory Systems
//
//  HISTORY
//    who     when     what
// -------- --------- ----------------------------------------------------
//
// ****************************************************************************

#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dos.h>
#include <time.h>      // For down count display.
#include <ctype.h>     // Lower case conversion.
#include <mem.h>
#include "typedef.h"   // General typedef and defines.
#include "handheld.h"
#include "preform.h"
#include "contread.h"
#include "hms800.h"
#include "comm.h"


#define HMS_HEX_LINES   20 // Bytes displayed on a line in Hexadecimal format.
#define HMS_DEC_LINES   15 // Bytes displayed on a line in decimal format.
#define HMS_ASCII_LNS   70 // Bytes displayed on a line in ASCII format.
#define HMS_BIN_LINES    8 // Bytes displayed on a line in Hexadecimal format.
#define DISPLAY_LINES   24 // Number of data lines to display on one screen full.
#define DISPLAY_WIDTH   80 // Maximum Number of characters on one line if display.

#define HS200_HEX_LNS   25 // Bytes displayed on a line in Hexadecimal format.
#define HS200_DEC_LNS   15 // Bytes displayed on a line in decimal format.
#define HS200_ASCII     70 // Bytes displayed on a line in ASCII format.
#define HS200_BIN_LNS    8 // Bytes displayed on a line in Hexadecimal format.

#define HS208_HEX_LNS   20 // Bytes displayed on a line in Hexadecimal format.
#define HS208_DEC_LNS   15 // Bytes displayed on a line in decimal format.
#define HS208_ASCII     70 // Bytes displayed on a line in ASCII format.
#define HS208_BIN_LNS    8 // Bytes displayed on a line in Hexadecimal format.

#define HS232_HEX_LNS   20 // Bytes displayed on a line in Hexadecimal format.
#define HS232_DEC_LNS   15 // Bytes displayed on a line in decimal format.
#define HS232_ASCII     70 // Bytes displayed on a line in ASCII format.
#define HS232_BIN_LNS    8 // Bytes displayed on a line in Hexadecimal format.

#define DOWN_DISPLAY   FALSE 
#define TAG_START        15 // Initial down count value when waiting for a tag.
#define TAG_FILLING       3 // After tag found, every tag fill command for hole tag.
#define TAG_CONTINUAL     1 // down count timeout value when in continual read.
#define MAX_HEX_DIG       2 // Maximum number of hexadecimal digits in a BYTE.
#define MAX_BIN_DIG       8 // Maximum number of binary digits in a BYTE.
#define MAX_DEC_DIGITS    5 // More then maximum number of decimal digits input.

#define TOO_MANY_ERRORS   10   // Too many read errors on this tag.

#define NUM_REGIONS        1   // One region block.
#define LAST_PROT_OFF   0x0A   // Offset value of last protected byte to hide in file.

#define HS_ID_START        1   // Tag address of first BYTE of HS tag ID.
#define HS_ID_END          2   // Seconds and last Tag ID byte address.

#define OUT_LIMIT        128  // Outut buffer array size.
#define MAX_FILENAME       8  // Number of characters in the base part of a file name.

#if TEST_MUX32
#ifdef LRP820
#define MAX_MUX_DATA      48  // Maximum data size in an LRP tag..
#else
#define MAX_MUX_DATA      55  // Maximum data size in a MUX32 data replay.
#endif  
#endif

#define CON_READ_LEN       0  // Array index of parsed COM read response length
#define CON_READ_STAT      1  // Array index of parsed COM read stats byte.
#define CON_READ_DATA      2  // Array index of parsed COM read data bytes.

#define TIME_FOR_SLOWEST_PACKET 3 // Seconds 'should' be long enough for 1200 baud.

enum data_type display_type;   // Display format chosen.
enum ant_type antenna_type = NOT_VALID; // "flag" value for antenna type selected.
WORD mem_size = LRP_MEM_SIZE;         // Size of selected antenna type tag.
BYTE max_data_pkt = HMS827_MAX_DATA;  // Maximum data bytes size for selected antanna.

static __far BYTE tag_io_buf[HMS_MEM_SIZE]; // Working IO buffer for all tag BYTEs.

static time_t last_time;            // Value returned by time() last time.
static int display_val;             // Down count  display value.
static BYTE finished;               // Local BOOLEAN Not finished with mifare command.

// Copy, hold and write an entire tag working variables.
static BYTE tag_buf[HMS_MEM_SIZE];  // Hold all BYTEs from a tag.
WORD start_adr = TOO_BIG_VAL;// Begin coping from this address.
WORD stop_adr = TOO_BIG_VAL; // Last address byte to be coping.

// Below working variables for non-contiguous I/O routines.
static BYTE *address_ptr;   // Index the output buffer to build command packet.
static WORD address_value;  // Hold the input address.
static WORD nc_read_size;   // Number of bytes in for Non-contiguous Read.

// ****************************************************************************
// Preform a getche(), but also keep looking at the COM port for a Continuous
// Block read data response.
//
// Input:        None.
// Return:       Character input from the keyboard..
// Side effects: None.
BYTE getche_cont(void)
{
   while(NOT kbhit())
      cont_read_mode();   // Handle any Contiguous Block Read data response. 
   return(getche());   
}

// ****************************************************************************
// Preform a getch(), but also keep looking at the COM port for a Continuous
// Block read data response.
//
// Input:        None.
// Return:       Character input from the keyboard..
// Side effects: None.
BYTE getch_cont(void)
{
   while(NOT kbhit())
      cont_read_mode();   // Handle any Contiguous Block Read data response. 
   return(getch());   
}

// ****************************************************************************
// Input a data byte in the current format.. 
// Input:        NONE.
// Return:       BYTE value returned or escapint status value of
//                    TOO_BIG_VAL or ENTER_ALONE
// Side effects: None.
static WORD inp_data_byte(void)
{
   WORD value;     // Value (or ESC flag) entered by user to be filled.
   BYTE status;    // Tag IO return status.

   if (display_type EQ ASCII)
   {
      value = ENTER_ALONE; // Nothing entered yet.
      printf("Enter an ASCII character: ");
      do
      {
         if ((status = getche_cont()) EQ ESC) // This echos the character.
            return(TOO_BIG_VAL);              // But ESC was entered. Exit.
         if (status EQ BACK_SPACE)
         {
            putch(' ');                  // Step back up the data entry space.
            putch(' ');                  // Erase from screen last character.
            value = ENTER_ALONE;         // Back space erased the character.
         } else if (status NE CR)
            value = status;              // Got a character input.
         putch(BACK_SPACE);              // Stay in first column, for 1 char.
      } while (status NE CR);
   } else if (display_type EQ HEX)
   {
      printf("Enter the byte in Hexadecimal: ");
      value = inp_hex(); // Enter a number in hexadecimal format.
   } else if (display_type EQ BIN)
   {
      printf("Enter the byte in Binary: ");
      value = inp_bin(); // Enter a number in hexadecimal format.
   } else
   {
      printf("Enter the byte in decimal [0..255]: ");
      value = inp_num(BYTE_VALUE);
   }
   return(value);
}

// ****************************************************************************
// Preform a Block Read command. 
// Input:        Begin reading at this start address in the tag.
//               Number of bytes to be read from tag.
//               Where to place the received data.
// Return:       Read STATUS.
// Side effects: None.
static BYTE Read_command(WORD start_add, WORD data_size, BYTE *rx_data)
{
   BYTE  status;     // Mifare tag interface status value.

   BLReadTx(start_add, data_size, MIFARE_TIME_OUT); 
   status = BLReadRx(rx_data, data_size);
   return(status);
}

// ****************************************************************************
// Preform a Block Write command. 
// Input:        Begin write at this start address in the tag.
//               Number of bytes to be read from tag.
//               Pointer to the bytes to be written.
//               BOOLEAN - TRUE, using proteced mode block writes.
//                       - FALSE, normal block write.
// Return:       Read STATUS.
// Side effects: None.
static BYTE Write_command(WORD start_add, WORD data_size, BYTE *tx_data, BYTE prt_mode)
{
   BYTE  status;     // Mifare tag interface status value.

   if (prt_mode)
   {
      pro_BLWriteTx(start_add, data_size, MIFARE_TIME_OUT, tx_data);
      status = pro_BLWriteRx();
   } else
   {
      BLWriteTx(start_add, data_size, MIF_WRITE_TI, tx_data);
      status = BLWriteRx();
   }
   return(status);
}

// ****************************************************************************
// What is the value of the decimal number in the digit string pointed to?
// That value is placed in the WORD pointed to by value parameter.
// The decimal number can be terminated with spaces (' ') or a carriage return.
// If the digits overflow a WORD, then what *value points to is set to zero (0)
// and this function returns FALSE.
//
// Input:        Pointer to where digit string is located.
//               Pointer to a WORD where the value from the string is place,
//               unless there is an overflow and FALSE is returned.
// Return:       BOOLEAN - TRUE,  Valid decimal number input, with no overflow.
//                         FALSE, digits in the string will overflow a WORD. 
// Side effects: The WORD value points to will be altered.
static BYTE dec_word_val(BYTE* digit_string, WORD *value) 
{
   unsigned long int incom_value;

   *value = incom_value = 0;
   while ((*digit_string >= '0') AND (*digit_string <= '9'))
   {
      incom_value = (incom_value * 10) + *digit_string - '0'; // Add in new value.
      if (incom_value > TOO_BIG_VAL)  // This string overflowed.
         return(FALSE);
      digit_string++;        // Count another valid digit entered.
   }
   *value = (WORD)incom_value;
   return(TRUE);
}

// ****************************************************************************
// Is the string pointed to by the passed pointer all eight digits for a 
// binary BYTE?  Assuming the string was pre-fille with '.' or ' ', those
// eight (8) characters should be replaced with 1 or 0 before this function
// is called.  This is to check if all eight (8) binary digits have been entered.
//
// Input:        Pointer to a string of binary digits.
// Return:       BOOLEAN - TRUE,  all eight (8) binary digits are in the string.
//                         FALSE, not all eight (8) binary digits.
// Side effects: None.
static WORD eight_binary_digits(BYTE *binary_string)
{
   WORD ii;       // Local loop counter.
   
   for (ii = MAX_BIN_DIG; ii; ii--)
   {
      if ((*binary_string < '0') OR (*binary_string > '1'))
         return(FALSE);     // Non-binary digit found.  Thus not all binary.
      binary_string++;      // Look at the next digt.
   }
   return(TRUE);            // Must be all binary.
}

// ****************************************************************************
// For use with the Del key when entering number on the screen.  The first
// digit in the digit string pointed to by the passed parameter is deleted.
// The remaining digits are shifted to the left none character space.
// These remaining digit are then printed on the screen and then the cursor is
// backed up over them, to leave the cursor in the same position.
//
// Input:        Pointer to the string of digits.
// Return:       None
// Side effects: String pointed to by the digit string pointer looses a digit.
static void del_digit(BYTE *dig_str)
{
   WORD num_digits;     // Number of digits after the deleted one to be shifted.
   WORD prt_count;      // Loop counter for printing the shifted digits.
   BYTE *dig_ptr;       // Used to index the digit string.
   
   num_digits = 0;      // May not shift any digits.
   dig_ptr = dig_str;
   while ((*dig_ptr >= '0') AND (*dig_ptr <= '9')) // While in the digits
   {                                               // Shift the next one down.
      *dig_ptr = *(dig_ptr + 1);
      dig_ptr++;
      num_digits = num_digits + 1;  // Another digit shifted.
   }
   dig_ptr = dig_str;
   for (prt_count = num_digits; prt_count; prt_count--)
      if (*dig_ptr NE CR)           // Last digit handled?
         putch(*dig_ptr++);         // No, echo the digit.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合天天综合色综合av| 亚洲成人福利片| 国产91清纯白嫩初高中在线观看| 日韩一级欧美一级| 久久激情综合网| 国产亚洲一区字幕| 成人综合婷婷国产精品久久蜜臀 | 国产亚洲污的网站| 懂色av一区二区在线播放| 国产精品免费久久久久| 91免费看视频| 日韩成人av影视| 久久九九全国免费| 色婷婷综合久色| 欧美aaa在线| 欧美国产一区二区| 在线观看91精品国产入口| 日韩精品欧美精品| 欧美激情中文不卡| 色噜噜狠狠成人中文综合| 日本欧洲一区二区| 国产欧美精品国产国产专区| 色综合一区二区| 日本91福利区| 国产精品欧美一区喷水| 欧美日韩一区视频| 国产乱码精品一区二区三区av| 国产精品国产成人国产三级| 欧美肥妇毛茸茸| 成人性色生活片免费看爆迷你毛片| 亚洲一区二区视频在线| 欧美精品一区二区三区久久久| 97精品国产97久久久久久久久久久久| 天堂在线一区二区| 亚洲欧洲av色图| 精品国产乱码久久久久久久| 日本韩国欧美一区| 国产精品一区二区免费不卡| 亚洲国产一区视频| 国产精品久久夜| 精品免费视频一区二区| 色av一区二区| 粉嫩av一区二区三区| 亚洲h精品动漫在线观看| 国产精品乱人伦中文| 欧美大胆一级视频| 欧美日本一区二区三区| fc2成人免费人成在线观看播放| 免费成人av在线播放| 一区二区高清免费观看影视大全 | 日韩精品一二三| 1024精品合集| 国产精品天美传媒沈樵| 欧美一个色资源| 欧美日韩成人在线| 色哟哟国产精品| 99精品久久99久久久久| 国产精品一区二区在线播放| 欧美aaaaa成人免费观看视频| 一区二区三区在线观看网站| 国产精品国产成人国产三级 | 美女视频黄久久| 亚洲永久精品国产| 亚洲男人的天堂在线aⅴ视频| 中文字幕免费不卡| 久久亚洲精精品中文字幕早川悠里 | 欧美中文字幕不卡| 99亚偷拍自图区亚洲| 成人免费毛片片v| 国产黄色91视频| 国产成人免费视频网站| 国产一区二三区好的| 久久国产视频网| 蜜桃视频在线一区| 日本免费在线视频不卡一不卡二| 亚洲v日本v欧美v久久精品| 亚洲精选免费视频| 一区二区三区精品视频在线| 亚洲人成人一区二区在线观看| 中文字幕av资源一区| 亚洲国产成人自拍| 亚洲欧美一区二区在线观看| 国产日韩欧美不卡在线| 亚洲国产精品成人久久综合一区| 中文在线一区二区| 亚洲国产精品激情在线观看| 国产丝袜在线精品| 自拍视频在线观看一区二区| 亚洲精品午夜久久久| 亚洲在线一区二区三区| 午夜影院久久久| 奇米影视7777精品一区二区| 九九久久精品视频| 粉嫩欧美一区二区三区高清影视| 99久久国产免费看| 欧美性xxxxxxxx| 精品日产卡一卡二卡麻豆| 久久无码av三级| 国产精品电影一区二区| 亚洲精品日韩综合观看成人91| 亚洲一区二区三区在线播放| 日韩精品欧美精品| 国产一区二区三区四| caoporn国产一区二区| 欧美视频在线一区二区三区 | 精品制服美女丁香| 春色校园综合激情亚洲| 欧美色涩在线第一页| 精品福利视频一区二区三区| 欧美国产成人在线| 五月综合激情婷婷六月色窝| 国产一区二区视频在线播放| 色菇凉天天综合网| 日韩女优电影在线观看| 国产精品第五页| 日本va欧美va精品| 99久久婷婷国产综合精品| 欧美久久久久免费| 欧美激情一区二区在线| 五月婷婷色综合| 99天天综合性| 精品卡一卡二卡三卡四在线| **性色生活片久久毛片| 久热成人在线视频| 一本大道久久a久久综合婷婷| 日韩精品一区二区三区视频| 亚洲人xxxx| 看电影不卡的网站| 色8久久人人97超碰香蕉987| 国产亚洲欧美激情| 亚洲v精品v日韩v欧美v专区| 成人av综合在线| 欧美va亚洲va| 香蕉乱码成人久久天堂爱免费| 韩国女主播成人在线观看| 欧美综合天天夜夜久久| 日本一区二区三区电影| 免费av成人在线| 91成人网在线| 国产精品久久久久久久蜜臀| 另类小说图片综合网| 日本高清不卡一区| 中文字幕一区二区三区视频| 久久草av在线| 欧美日韩国产另类一区| 亚洲欧美视频在线观看| 91成人看片片| 中文字幕成人网| 国产剧情一区二区三区| 欧美一区二区三区精品| 午夜精品视频一区| 欧美性生活大片视频| 一区二区三区中文在线| av电影在线观看不卡| 中文字幕不卡一区| 岛国精品在线观看| 久久久亚洲午夜电影| 精品一区二区三区久久| 欧美电影精品一区二区| 蜜桃一区二区三区在线观看| 欧美日韩高清一区二区不卡| 亚洲国产日韩精品| 91久久线看在观草草青青| 亚洲同性同志一二三专区| 盗摄精品av一区二区三区| 国产女人aaa级久久久级| 国产精品一品视频| 久久只精品国产| 黄色日韩三级电影| 26uuu色噜噜精品一区二区| 久久爱www久久做| xfplay精品久久| 国内精品久久久久影院薰衣草| 精品国内片67194| 国产剧情一区二区| 欧美韩国日本不卡| av在线一区二区三区| 亚洲人成在线观看一区二区| 色激情天天射综合网| 亚洲成av人片在线| 欧美一级日韩免费不卡| 精品一区二区在线视频| 久久色.com| 99久久国产综合色|国产精品| 夜夜精品视频一区二区| 欧美疯狂做受xxxx富婆| 黄色成人免费在线| 亚洲欧美综合在线精品| 欧美精选在线播放| 精品一区二区成人精品| 国产精品久线观看视频| 欧美日韩小视频| 久久成人羞羞网站| ...av二区三区久久精品| 欧美日韩一区在线观看| 国产精品一区二区在线播放| 亚洲免费av高清| 日韩一级大片在线| 成人av免费观看| 丝袜美腿成人在线|