1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
#include "apdefap.h"
void OnObjectChanged(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{BOOL s5;
s5= GetTagBit("ST2_S5_1"); //Return-Type: BOOL
if (s5 == 1)
{
BOOL rfid;
rfid = GetTagBit("RFID"); //Return-Type: BOOL
if (rfid == 0 )
{
}
else if ( rfid == 1)
{
#define DATA_ARRAY 129
long int s;
int i,k,A1;
char buffer[3],a[9], tmp[20];
char data[DATA_ARRAY ];
char input[DATA_ARRAY ];
char text1[] ="palette 1";
struct ANSWER {
int iStatus;
unsigned char idata[DATA_ARRAY ];
int iBytes;
}ans_data;
struct INSTRUCTION {
unsigned char iCode[DATA_ARRAY ];
int iBytes;
}ins_data;
#pragma code("RFID_VC_VB1.dll")
short int Evaluation_unit_quit(BOOL Mode,int ncom);
short int Evaluation_unit_reset(BOOL Mode,int ncom);
short int System_memory_examine(BOOL Mode,int ncom, char* status);
short int Data_medium_type_adjust(BOOL Mode,int ncom, char* data_medium);
short int Double_sided_read_letter_active(BOOL Mode,int ncom);
short int Autoread_letter_terminate(BOOL Mode,int ncom);
short int Version_message(BOOL Mode,int ncom, char* version);
int Comset(int iPort, int iBaud, int iBits, int iStop, int iParity, int iTimeout);
short int Data_medium_read(BOOL Mode,int ncom, char* head, char* status, char* data);
int ComReset(int iPort);
short int Bytes_write(BOOL Mode,int ncom, char* head, char* status, char* adresse, char* number, char* data);
short int Byte_read(BOOL Mode,int ncom, char* head, char* status, char* adresse, char* number, char* data);
short int Reset(BOOL Mode,int ncom, char* head, char* status);
void Check_total_compute(void);
BOOL Send(int ncom);
BOOL Receive(int ncom);
void ShiftLeft(unsigned char* data, int place);
void ArrayCopy(char* dest, unsigned char* source, int place);
int HexToInt(char* hex);
BOOL Receive1(int ncom);
#pragma code()
printf("\t\t\t\tProgramme d'exploitation des RFID\n\n");
printf("\t\t\t\tLECTURE PALETTE 1\n\n");
Comset(1,9600,8,1,0,20);
Evaluation_unit_quit(FALSE,1);
Evaluation_unit_reset(FALSE,1);
Data_medium_type_adjust(FALSE, 1,"4");
Byte_read(TRUE,1, "2", buffer, "00", "09", data);
for ( i = 0; i < 10; i++)
{
a[i] = data[i];
printf("%c", a[i]);
} //if (a=(s.c_str()));
printf("\n comparaison des chaines de caracters: \t%s, et ,\t%s \n",a,text1);
A1= strcmp(a,text1);
printf("A 1=%d",A1);
if (A1==0)
{
SetTagBit("ST1_entrer_Z3_P1",1); //Return-Type: BOOL
}
else
{SetTagBit("OUI",0);
}
ComReset(1);
}
}
} |
Partager