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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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九色最新地址| 99精品久久免费看蜜臀剧情介绍 | 韩国v欧美v日本v亚洲v| 九色综合狠狠综合久久| 日韩在线一区二区| 看国产成人h片视频| 日本欧美一区二区在线观看| 天天色 色综合| 麻豆国产精品视频| 国产一区二区在线影院| 国产a久久麻豆| 色综合中文字幕国产| 91香蕉视频在线| 在线视频亚洲一区| 欧美一区二区三区免费大片| 欧美mv和日韩mv的网站| 国产日韩欧美精品综合| 综合色中文字幕| 亚洲一区二区三区四区五区中文| 午夜a成v人精品| 粗大黑人巨茎大战欧美成人| 色悠久久久久综合欧美99| 欧美日韩卡一卡二| 26uuu久久综合| 亚洲九九爱视频| 日韩电影免费在线观看网站| 丰满放荡岳乱妇91ww| 欧美亚一区二区| 国产亚洲一区字幕| 亚洲国产aⅴ成人精品无吗| 国产精品一级在线| 欧美日韩三级一区| 国产精品欧美经典| 蜜桃久久av一区| 欧美亚洲国产怡红院影院| 日本一区二区三区视频视频| 日本不卡中文字幕| 色综合天天综合网天天看片| xf在线a精品一区二区视频网站| 免费观看久久久4p| 成人av在线播放网址| 久久综合久久综合久久| 亚洲成人动漫一区| 在线视频一区二区三| 亚洲欧美一区二区视频| 成人午夜在线免费| 久久久国产综合精品女国产盗摄| 日韩电影一区二区三区四区| 欧美专区在线观看一区| 亚洲色图视频免费播放| jlzzjlzz亚洲女人18| 精品日韩一区二区三区免费视频| 日韩**一区毛片| 在线播放日韩导航| 日韩精品欧美精品| 欧美日韩国产一区| 日韩电影一二三区| 日韩欧美在线一区二区三区| 亚洲成av人片在线观看| 欧美日韩日本视频| 免费在线观看一区| 亚洲色图清纯唯美| 一本大道久久a久久精品综合| 中文字幕一区视频| 欧美性猛交xxxxxxxx| 五月婷婷综合在线| 国产亚洲一区二区三区在线观看| 国产精品一区二区免费不卡| 国产精品久久久久影院| 欧美性感一区二区三区| 免费成人在线观看| 日本一区二区三区国色天香| 99在线精品免费| 日本三级韩国三级欧美三级| 国产日韩亚洲欧美综合| 91国偷自产一区二区开放时间 | 欧美一级欧美三级| 国产99久久精品| 亚洲国产一区二区在线播放| 精品少妇一区二区三区日产乱码 | 99视频在线观看一区三区| 一区二区三区欧美亚洲| 日韩精品一区二区三区视频播放| 成人动漫av在线| 精彩视频一区二区三区| 亚洲最快最全在线视频| 欧美国产丝袜视频| 日韩欧美一级二级三级久久久| av不卡免费电影| 国产一区在线观看麻豆| 日日骚欧美日韩| 综合激情网...| 国产精品视频线看| 日韩午夜av电影| 在线观看精品一区| aaa欧美色吧激情视频| 国产一区高清在线| 东方欧美亚洲色图在线| 蜜桃久久久久久| 青青草97国产精品免费观看无弹窗版| 日韩一区在线播放| 欧美激情一区二区| 国产精品嫩草99a| 久久精品一区蜜桃臀影院| 91精品国产麻豆国产自产在线| 色综合一个色综合| 欧洲亚洲精品在线| 91极品视觉盛宴| 色综合天天综合| 91官网在线免费观看| 日本黄色一区二区| 欧美日韩久久久一区| 欧美亚日韩国产aⅴ精品中极品| 在线观看一区二区视频| 色悠悠亚洲一区二区| 欧美日韩亚洲高清一区二区| 欧美日韩国产高清一区二区三区| 欧美一区二区精品久久911| 欧美日韩中文另类| 亚洲精品在线电影| 国产精品久久久久久久久搜平片| 亚洲婷婷在线视频| 亚洲成人777| 韩国精品主播一区二区在线观看 | 色婷婷av一区二区三区之一色屋| 欧美老肥妇做.爰bbww| 精品国产一区二区精华| 一区在线播放视频| 日本欧美韩国一区三区| 韩国欧美国产1区| 欧美亚洲一区三区| 久久久精品天堂| 日韩一区欧美二区| 波波电影院一区二区三区| 91精品国产美女浴室洗澡无遮挡| 久久伊人蜜桃av一区二区| 一区二区三区**美女毛片| 免费观看一级特黄欧美大片| 99精品国产91久久久久久| 日韩视频中午一区| 亚洲在线观看免费视频| 成人丝袜视频网| 日韩一级成人av| 国产黄人亚洲片| 欧美日韩免费在线视频| 久久久.com| 经典三级一区二区| 欧美一区二区黄| 日韩va亚洲va欧美va久久| 色婷婷综合激情| 亚洲美腿欧美偷拍| av电影在线观看一区| 国产婷婷一区二区| 国产一区二区中文字幕| 精品久久久久久无| 激情综合网最新| 久久综合五月天婷婷伊人| 麻豆成人免费电影| 精品国产免费久久| 精品综合久久久久久8888| 精品理论电影在线| 国产一区欧美日韩| 国产欧美日韩久久| 99国产精品一区| 亚洲美腿欧美偷拍| 欧美久久久一区| 黄色资源网久久资源365| www日韩大片| 99免费精品在线| 一区二区三区加勒比av| 欧美日韩二区三区| 麻豆国产91在线播放| 国产精品久久毛片av大全日韩| 99re这里只有精品首页| 亚洲综合色婷婷| 日韩一区二区在线免费观看| 国产乱人伦偷精品视频免下载 | 国产精品二三区| 在线观看区一区二| 国产乱码一区二区三区| 亚洲天堂a在线| 日韩精品一区二区三区视频在线观看 | 亚洲va国产天堂va久久en| 日韩欧美中文一区|