CN101447015B - Method and device for carrying out secondary development of firmware program of a CCID device - Google Patents

Method and device for carrying out secondary development of firmware program of a CCID device Download PDF

Info

Publication number
CN101447015B
CN101447015B CN2008102475457A CN200810247545A CN101447015B CN 101447015 B CN101447015 B CN 101447015B CN 2008102475457 A CN2008102475457 A CN 2008102475457A CN 200810247545 A CN200810247545 A CN 200810247545A CN 101447015 B CN101447015 B CN 101447015B
Authority
CN
China
Prior art keywords
packet
ccid equipment
data
firmware program
secondary development
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2008102475457A
Other languages
Chinese (zh)
Other versions
CN101447015A (en
Inventor
陆舟
于华章
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN2008102475457A priority Critical patent/CN101447015B/en
Publication of CN101447015A publication Critical patent/CN101447015A/en
Application granted granted Critical
Publication of CN101447015B publication Critical patent/CN101447015B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention discloses a method and a device for carrying out the secondary development of the firmware program of a CCID device, relates to the field of firmware development and is used for providing the function expansion of the CCID device. The method for carrying out the secondary development of the firmware program of the CCID device comprises the following steps: sending an identifier to a host computer, wherein, the identifier indicates that the local computer is a CCID device; receiving a data packet sent from the host computer; analyzing whether the header of the data packet is 6BH; if so, indicating that the data packet is the data packet used for the secondary development and conducting the operation for the secondary development of the firmware program of the CCID device; and if not, conducting the operation of the standard CCID device. The method and the device for carrying out the secondary development of the firmware program of the CCID device are suitable for the function expansion of the CCID device.

Description

CCID equipment firmware program is carried out the method and the device of secondary development
Technical field
The present invention relates to the firmware development field, relate in particular to a kind of method and device that CCID equipment firmware program is carried out secondary development.
Background technology
Several international IT enterprises have been formulated CCID (Chip/Smart Card Interface Devices, chip/intelligence card interface device) interface standard jointly at the problem of application of IC cards aspect.The CCID equipment of CCID interface standard regulation is by USB (Universal Serial Bus, USB (universal serial bus)) the interface transmitting-receiving meets the data of CCID interface standard, thereby the equipment that makes is connected communication with main frame and other embedded host, simultaneously interface and the smart card communication of equipment by meeting the ISO7816 standard agreement.Because the appearance of CCID interface standard, equipment vendors can develop the equipment that meets the CCID interface standard that uses like a cork.Simultaneously, the CCID interface standard is supported PC/SC (Personal Computer/Smart Card) interface interchange, makes numerous developers can develop operation by card apparatus to smart card or artificial intelligence easily.
Host computer is meant that the people can directly send the computing machine of controlling order, generally is PC, can show on its screen that various signals change (such as hydraulic pressure, water level, temperature etc.); Slave computer is meant direct opertaing device and obtains the computing machine of equipment state, generally is PLC (Programmable Logic Controller, programmable logic controller (PLC))/single-chip microcomputer and so on.Host computer is at first given an order to slave computer, and slave computer becomes corresponding clock signal with this command interpretation again, and then directly controls relevant device; Slave computer is the status data of fetch equipment (being generally analog quantity) and convert it into digital signal and feed back to host computer every now and then.In general, slave computer has more reliable exclusive communications protocol.
With regard to present CCID equipment, when CCID equipment dispatched from the factory, its function was just fixing, that is to say which type of function CCID equipment itself possesses, and the user just can only use this function.Like this, at some special occasions, it is irrealizable basically that the user wishes to carry out some specific function.
Summary of the invention
Embodiments of the invention provide a kind of method and device that CCID equipment firmware program is carried out secondary development, to reach the purpose of CCID equipment being carried out the function expansion.
For achieving the above object, embodiments of the invention adopt following technical scheme:
A kind of method that CCID equipment firmware program is carried out secondary development comprises:
Send an identifier to host computer, this identifier represents that this machine is a CCID equipment;
Receive the packet that host computer issues;
Whether the packet header of analyzing described packet is 6BH;
If the packet header of described packet is 6BH, then described packet is the packet that is used for secondary development, carries out the operation of CCID equipment firmware program being carried out secondary development; Otherwise described packet is not the packet that is used for secondary development, the operation of operative norm CCID equipment.
A kind of device that CCID equipment firmware program is carried out secondary development comprises:
Sending module is used for sending an identifier to host computer, and this identifier represents that this machine is a CCID equipment;
Receiver module is used to receive the packet that host computer issues;
Analysis module, whether the packet header that is used to analyze described packet is 6BH;
Development module when being used for being 6BH in the packet header of described packet, is carried out the operation of CCID equipment firmware program being carried out secondary development.
Method and device that CCID equipment firmware program is carried out secondary development that the embodiment of the invention provides, receive the packet that is used for the secondary development of CCID equipment firmware program that host computer issues, and the performance data of carrying in the packet according to described secondary development is carried out secondary development to CCID equipment firmware program; Compared with prior art, method and device that CCID equipment firmware program is carried out secondary development that the embodiment of the invention provides, can realize the function of CCID equipment is further expanded, make the basic function that the user sets when the use of CCID equipment also no longer is confined to it and dispatches from the factory.
Description of drawings
The method flow diagram that CCID equipment firmware program is carried out secondary development that Fig. 1 provides for the embodiment of the invention;
Fig. 2 is the method flow diagram in the embodiment of the invention one;
Whether legal Fig. 3 be correlation parameter the method flow diagram of judging secondary development in the embodiment of the invention one;
The process flow diagram of Fig. 4 in the embodiment of the invention one CCID equipment being carried out write operation;
The process flow diagram of Fig. 5 in the embodiment of the invention two CCID equipment being carried out write operation;
The device synoptic diagram that CCID equipment firmware program is carried out secondary development that Fig. 6 provides for the embodiment of the invention;
Fig. 7 is the device synoptic diagram in the embodiment of the invention three;
Fig. 8 is the device synoptic diagram in the embodiment of the invention four.
Embodiment
Embodiments of the invention provide a kind of method and device that CCID equipment firmware program is carried out secondary development.Below in conjunction with accompanying drawing method and the device that CCID equipment firmware program is carried out secondary development that the embodiment of the invention provides is described in detail.
As shown in Figure 1, the method that CCID equipment firmware program is carried out secondary development that the embodiment of the invention provides may further comprise the steps:
Step 11, send an identifier to host computer, this identifier represents that this machine is a CCID equipment;
Step 12, receive the packet that host computer issues by the BulkOut end points;
Wherein, this BulkOut end points is a bulk transfer type end points.
Whether the packet header of step 13, the described packet of analysis is 6BH;
Step 14, when packet header of the packet that receives (being first byte) when being 6BH, then this packet is the packet that is used for secondary development, carries out the operation of CCID equipment firmware program being carried out secondary development; When the packet header of the packet that receives was other, then this packet was used for the operation of other standard CC ID equipment.
The method that CCID equipment firmware program is carried out secondary development that the embodiment of the invention provides, CCID equipment receives host computer by the BulkOut end points and issues packet, CCID equipment can be received be used for the packet that CCID equipment firmware program is carried out secondary development, and the performance data of carrying in the packet according to described secondary development is carried out secondary development to CCID equipment firmware program, can realize the function of CCID equipment is further expanded, make the basic function that the user sets when the use of CCID equipment also no longer is confined to it and dispatches from the factory.
Embodiment one:
As shown in Figure 2, be a preferred embodiment that CCID equipment firmware program is carried out the method for secondary development provided by the invention.
Before carrying out concrete steps, the proprietary protocol that will be used for CCID equipment firmware program is carried out secondary development is integrated into CCID equipment firmware program.
The method that CCID equipment firmware program is carried out secondary development that the embodiment of the invention provides specifically may further comprise the steps:
Step 21, in the CCID device power, send an identifier to host computer, this identifier represents that this machine is a CCID equipment, simultaneously, CCID equipment is divided the memory block;
Step 22, CCID equipment receive the packet that host computer issues by the BulkOut end points, and the packet that issues are stored in the memory block of CCID equipment;
In the present embodiment, the packet content that CCID equipment receives is: 6BH 0AH 00H 00H 00H00H 01H 00H 00H 00H 01H 20H 00H 00H 05H 01H 02H 03H 04H 05H.Wherein, 6BH is first data in the packet, also is the packet header of this packet; The correlation parameter that CCID equipment firmware program is carried out secondary development that 0AH 00H 00H 00H 00H 01H 00H00H 00H carries for this packet; The performance data that is used for the secondary development of CCID equipment that 01H 20H 00H 00H 05H 01H 02H 03H 04H 05H carries for this packet.
Data in step 23, the read data packet, and whether the packet header of analyzing this packet is 6BH; If the packet header in the packet is 6BH, then this packet is exactly to be used for packet that CCID equipment firmware program is carried out secondary development, and carry out step 24 this moment; Otherwise, the operation of operative norm CCID equipment;
Step 24, judge carry in the above-mentioned packet whether CCID equipment firmware program is carried out the correlation parameter of secondary development legal; If carry in the above-mentioned packet that CCID equipment firmware program is carried out the correlation parameter of secondary development is legal, then carry out step 25, otherwise, return the information of reporting an error;
Wherein, judge and above-mentioned whether legal CCID equipment firmware program carried out the correlation parameter of secondary development detailed process as shown in Figure 3, comprising:
241, judge whether the performance data length of carrying in the above-mentioned correlation parameter is consistent with the length of the actual performance data that comprises of above-mentioned packet;
In embodiments of the present invention, the performance data length of carrying in the above-mentioned correlation parameter is 0AH 00H 00H00H, wherein first byte is a least significant bit (LSB), and the actual performance data that comprises of this packet is 01H 20H00H 00H 05H 01H 02H 03H 04H 05H, length is 0AH, the performance data length that carry in the described correlation parameter this moment is consistent with the length of the actual performance data that comprises of described packet, carry out step 242; Otherwise, return the information of reporting an error;
242, whether the card slot number of judging the above-mentioned packet of reception that carries in the above-mentioned correlation parameter can receive in the card slot number scope of above-mentioned packet in CCID equipment;
Such as, the card slot number scope that can receive above-mentioned packet in the CCID equipment is 00H~03H, and in the embodiment of the invention, the card slot number of the above-mentioned packet of reception that carries in the above-mentioned correlation parameter is 00H, in CCID equipment, can receive within the card slot number scope of above-mentioned packet, at this moment, carry out step 243; Otherwise, return the information of reporting an error.
243, judge whether the command sequence that defines in the command sequence of carrying in the above-mentioned correlation parameter number and the CCID equipment firmware program is number consistent;
In the embodiment of the invention, the command sequence of carrying in the above-mentioned correlation parameter number is 01H, and this packet that need receive that writes down in the CCID equipment firmware program is the 2nd packet, promptly the command sequence of Ji Lu this packet that need receive number is 01H, the command sequence that defines in the command sequence of carrying in the above-mentioned correlation parameter this moment number and the CCID equipment firmware program is number consistent, carry out step 244; Otherwise, return the information of reporting an error.
244, judge whether the preset data of storing in the preset data of carrying in the above-mentioned correlation parameter and the CCID equipment is consistent;
In the embodiment of the invention, the preset data of carrying in the above-mentioned correlation parameter is 00H 00H 00H, and the preset data of storing in the CCID equipment is also for 00H 00H 00H, and the preset data of storing in the preset data of carrying in the above-mentioned correlation parameter and the CCID equipment is consistent; Can determine that the above-mentioned correlation parameter that is used for CCID equipment firmware program is carried out secondary development is legal this moment, carry out step 25; Otherwise, return the information of reporting an error.
Step 25, CCID equipment firmware program is carried out secondary development according to the performance data in the packet of above-mentioned secondary development.
At first read the specific data (being first data in the performance data) in the performance data in the above-mentioned packet, this specific data is the action code that CCID equipment firmware program is operated of user's appointment; In embodiments of the present invention, above-mentioned proprietary protocol specified action code range is 01H~03H, if above-mentioned specific data in described action code scope, thinks then that the performance data in the above-mentioned packet meets above-mentioned proprietary protocol regulation.
Under the situation that CCID equipment is divided the memory block in advance, if described specific data is 01H, representative writes data to designated storage area, as shown in Figure 4, need carry out following operation:
Whether S101, the start address of judging the designated storage area of carrying in the performance data in the above-mentioned packet be consistent with the default memory block start address of CCID equipment;
In the embodiment of the invention, the start address of the designated storage area of carrying in the above-mentioned functions data is 20H00H, if in the memory block start address that CCID equipment is preset address 20H 00H is arranged, then carries out step S102; Otherwise, return the information of reporting an error.
S102, judge the designated storage area of carrying in the performance data in the above-mentioned packet length whether smaller or equal to the length of the default memory block of CCID equipment;
In the embodiment of the invention, the length of the designated storage area of carrying in the above-mentioned functions data is 00H 05H, wherein first byte is a least significant bit (LSB), if in the CCID equipment with step S101 in the length of the corresponding memory block of start address be not less than 00H 05H, illustrate that then the designated storage area in the performance data in the packet of above-mentioned secondary development belongs to the memory block that CCID equipment marks off in advance, then carries out step S103; Otherwise, return the information of reporting an error.
S103, the power function code in the described performance data is write described designated storage area, and put and write the new-content-flag position.
In embodiments of the present invention, the power function code in the above-mentioned functions data is 01H 02H 03H 04H05H, and the start address that is written into described performance data appointment is that 20H 00H, length are to be not less than in the memory block of 00H05H.
S104, when needs are carried out the power function newly write, call the above-mentioned power function that newly writes the power function code correspondence of designated storage area, promptly carry out the function of the power function code correspondence that newly writes designated storage area.
If described specific data is 02H, the power function of appointment in the CCID equipment is carried out in representative, then needs to carry out following operation:
S201, judge that whether the designated storage area in the performance data in the above-mentioned packet is empty; If be not empty, then carry out step S202; Otherwise, to host computer feedback one signaling that is used to report an error.
The function of the power function code correspondence of storing in S202, the described designated storage area of execution.
If described specific data is 03H, the data content in the designated storage area is wiped in representative, then needs to carry out following operation:
S301, the content in the designated storage area in the performance data in the above-mentioned packet is changed to complete 0 or full F.
If described specific data is not among 01H, 02H or the 03H any, then return the information of reporting an error.
The method that CCID equipment firmware program is carried out secondary development that the embodiment of the invention provides, the packet that CCID equipment carries out secondary development by Bulkout end points being used for of receiving that host computer issues to CCID equipment firmware program, and the performance data of carrying in the packet according to described secondary development is carried out secondary development to CCID equipment firmware program, new power function code write the default storage space of described new power function code or carry out the function of the power function code that newly writes, thereby realize the function of CCID equipment is further expanded, not only make full use of the remaining space among the CCID equipment CPU, and made the basic function that the user sets when the use of CCID equipment also no longer is confined to it and dispatches from the factory.
Embodiment two:
The implementation of the method for described power function code division memory block except describing among the embodiment one: when powering on, the memory block is divided by CCID equipment, also has another implementation: before described power function code need being write the CPU remaining space of CCID equipment, the length of the power function code that writes according to the memory block start address of carrying in the performance data in the packet that receives and needs is divided actual memory block, and the mode of this division memory block is called dynamic division.
Compare with embodiment one, dynamically dividing under the situation of memory block, when carrying out step 21, CCID equipment no longer need be divided the memory block when powering in advance;
And above-mentionedly CCID equipment firmware program is carried out when described specific data is 01H, as shown in Figure 5, need carry out following operation in the step (step 25 among the embodiment one) of secondary development according to the performance data in the packet of secondary development:
S ' 101, mark off designated storage area according to the physical length of memory block start address of carrying in the performance data in the packet of described secondary development and described power function code;
S ' 102, the power function code in the described performance data is write in the described designated storage area, and put and write the new-content-flag position;
S ' 103, report the start address and the end address of described designated storage area to host computer;
S ' 104, when needs are carried out the power function newly write, call the above-mentioned power function that newly writes the power function code correspondence of designated storage area, promptly carry out the function of the power function code correspondence that newly writes designated storage area.
Dynamically dividing under the situation of memory block, in the process of the method that realizes CCID equipment is carried out secondary development, other steps all with embodiment one in identical, repeat no more herein.
The method that CCID equipment firmware program is carried out secondary development that the embodiment of the invention provides, CCID equipment receives that host computer issues is used for packet that CCID equipment firmware program is carried out secondary development, and the performance data of carrying in the packet according to described secondary development is carried out secondary development to CCID equipment firmware program, new power function code can be write dynamically in the storage space of described new power function code division or carry out the function of the power function code that newly writes, thereby realize the function of CCID equipment is further expanded, not only make full use of the remaining space among the CCID equipment CPU, and made the basic function that the user sets when the use of CCID equipment also no longer is confined to it and dispatches from the factory.
In order to realize the above-mentioned method that CCID equipment firmware program is carried out secondary development better, the present invention also provides a kind of device that CCID equipment firmware program is carried out secondary development.
As shown in Figure 6, the device that CCID equipment firmware program is carried out secondary development that the embodiment of the invention provides comprises sending module 61, receiver module 62, analysis module 63 and development module 64; Wherein,
Sending module 61 sends an identifier to host computer, and this identifier represents that this machine is a CCID equipment; Then, receiver module 62 receives the packet that host computer issues, and whether the packet header of the described packet of analysis module 63 analyses is 6BH then; When the packet header of described packet was 6BH, development module 64 was carried out the operation of CCID equipment firmware program being carried out secondary development.
The device that CCID equipment firmware program is carried out secondary development that the embodiment of the invention provides, the packet that CCID equipment carries out secondary development by Bulkout end points being used for of receiving that host computer issues to CCID equipment firmware program, and the performance data of carrying in the packet according to described secondary development is carried out secondary development to CCID equipment firmware program, can realize the function of CCID equipment is further expanded, make the basic function that the user sets when the use of CCID equipment firmware program also no longer is confined to it and dispatches from the factory.
Embodiment three:
As shown in Figure 7, for what the embodiment of the invention provided CCID equipment firmware program is carried out a preferred embodiment of the device of secondary development, it specifically comprises: sending module 71, receiver module 72, analysis module 73, development module 74, first judge module 75 and second judge module 76; Wherein,
When the CCID device power, sending module 71 sends an identifier to host computer, and this identifier represents that this machine is a CCID equipment; Receiver module 72 receives the packet (6BH 0AH 00H 00H00H 00H 01H 00H 00H 00H 01H 20H 00H 00H 05H 01H 02H 03H 04H 05H) that host computer issues, and whether the packet header of the described packet of analysis module 73 analyses is 6BH then; When the packet header of described packet was 6BH, whether the packet of 76 pairs of described secondary development of second judge module is legal judged; If the packet of described secondary development is legal, then first judge module 75 judges that action code in the performance data in the packet of this secondary development is whether in the scope of the proprietary protocol regulation that is used for CCID equipment firmware program is carried out secondary development; Action code in the performance data in the packet of described secondary development is in the scope of described proprietary protocol regulation the time, and development module 74 is carried out secondary development according to the performance data in the packet of this secondary development to CCID equipment firmware program.
Wherein, described second judge module 76 further comprises:
First judging unit is used for judging whether second data of described packet are consistent with the length of packet performance data;
Second judging unit is used in the described first judging unit result when being, whether the card slot number that receives described packet in the 3rd data of judging described packet and the CCID equipment is consistent;
The 3rd judging unit is used in the described second judging unit result when being, whether the command sequence that defines in the 4th data of judging described packet and the CCID equipment firmware program is number consistent;
The 4th judging unit is used in described the 3rd judging unit result when being, judges whether the 5th data of described packet are consistent with preset data:
If described the 4th judging unit result is for being that then the packet of described secondary development is legal.
Wherein, described second data are the data of the performance data length in the expression packet;
Described the 3rd data receive the data of the card slot number of described packet for expression;
Described the 4th data are the data of the command sequence number of the described packet of expression;
Described the 5th data are preset data in the described packet of expression.
Under the situation of when CCID equipment is powering on, in advance the memory block being divided, if the action code that carries in the described packet is 01H, be being operating as in CCID equipment write-in functions function code of representing of the performance data of carrying in the described packet, then described development module 74 further comprises:
The 5th judging unit 741 is used for judging whether the designated storage area in the performance data of packet of described secondary development belongs to the memory block that CCID equipment marks off in advance;
Writing unit 742 when being used for belonging in described memory block the memory block that CCID equipment marks off in advance, writing described designated storage area with the power function code in the described performance data, and puts and write the new-content-flag position.
If the action code that carries in the described packet is 02H, the function that is operating as appointment in the execution CCID equipment that the performance data of carrying in the promptly described packet is represented, then described development module 74 further comprises:
The 6th judging unit 743 is used for judging whether the designated storage area in the performance data of packet of described secondary development is empty:
Performance element 744 is used for carrying out the function of the power function code correspondence of storing in the described designated storage area when described designated storage area is not sky;
The unit 745 that reports an error is used in described designated storage area when empty, to host computer feedback one signaling that is used to report an error.
If the action code that carries in the described packet is 03H, the performance data of carrying in the promptly described packet is represented is operating as the content of wiping designated storage area in the CCID equipment, and then described development module 74 further comprises:
Erase unit 746 is used for the content in the designated storage area in the performance data of the packet of described secondary development is changed to complete 0 or full F.
Since above-mentioned CCID equipment write-in functions function code, carry out appointment in the CCID equipment function, wipe in these the three kinds of actions of content of designated storage area in the CCID equipment two kinds or three kinds and can link up and carry out, therefore described development module 74 can also comprise the functional unit of two kinds or three kinds correspondences in above-mentioned three kinds of actions simultaneously; As shown in Figure 7, be described development module 74 and comprise under the corresponding functional unit situation of above-mentioned three kinds of actions the device synoptic diagram that CCID equipment firmware program is carried out secondary development simultaneously.
The packet that CCID equipment firmware program being used for of carrying out that the device host computer of secondary development issues carried out secondary development to CCID equipment firmware program that the embodiment of the invention provides, and the performance data of carrying in the packet according to described secondary development is carried out secondary development to CCID equipment firmware program, new power function code write the default storage space of described new power function code or carry out the function of the power function code that newly writes, thereby realize the function of CCID equipment is further expanded, not only make full use of the remaining space among the CCID equipment CPU, and made the basic function that the user sets when the use of CCID equipment also no longer is confined to it and dispatches from the factory.
Embodiment four:
CCID equipment is before need writing the CPU remaining space of CCID equipment with described power function code, the length of the power function code that writes according to the memory block start address of carrying in the performance data in the packet of described secondary development and needs is divided actual memory block, promptly dynamically under the situation for the power function code division memory block that need write, if the action code that carries in the described packet is 01H, be being operating as in CCID equipment write-in functions function code of representing of the performance data of carrying in the described packet, then described development module 74 further comprises:
Division unit 747 is used for the memory block start address of carrying in the packet performance data according to described secondary development and the physical length of described power function code and marks off designated storage area;
Writing unit 748 is used for the power function code of described performance data is write in the described designated storage area, and puts and write the new-content-flag position;
Report unit 749, be used for reporting the start address and the end address of described designated storage area to host computer.
If the action code that carries in the described packet is 02H or 03H, be the performance data of carrying in the described packet represent be operating as the function of carrying out appointment in the CCID equipment or wipe the content of designated storage area in the CCID equipment time, identical among the configuration of described development module 74 and the embodiment three, repeat no more herein.
Since above-mentioned CCID equipment write-in functions function code, carry out appointment in the CCID equipment function, wipe in these the three kinds of actions of content of designated storage area in the CCID equipment two kinds or three kinds and can link up and carry out, therefore described development module 74 can also comprise the functional unit of two kinds or three kinds correspondences in above-mentioned three kinds of actions simultaneously.
As shown in Figure 8, be described development module 74 and comprise under the corresponding functional unit situation of above-mentioned three kinds of actions the device synoptic diagram that CCID equipment firmware program is carried out secondary development simultaneously; Other functional modules shown in the figure all are consistent with embodiment three, repeat no more herein.
The device that CCID equipment is carried out secondary development that the embodiment of the invention provides, the packet that is used for the secondary development of CCID equipment firmware program that host computer issues, and the performance data of carrying in the packet according to described secondary development is carried out secondary development to CCID equipment firmware program, new power function code can be write dynamically in the storage space of described new power function code division or carry out the function of the power function code that newly writes, thereby realize the function of CCID equipment is further expanded, not only make full use of the remaining space among the CCID equipment CPU, and made the basic function that the user sets when the use of CCID equipment also no longer is confined to it and dispatches from the factory.
The above; only be the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion by described protection domain with claim.

Claims (13)

1. the method that CCID equipment firmware program is carried out secondary development is characterized in that, comprising: send an identifier to host computer, this identifier represents that this machine is a CCID equipment;
Receive the packet that host computer issues;
Whether the packet header of analyzing described packet is 6BH;
If the packet header of described packet is 6BH, then described packet is the packet that is used for secondary development, if what the action code in the performance data in the described packet was represented is operating as in CCID equipment write-in functions function code, carry out the operation of CCID equipment firmware program being carried out secondary development:
Judge whether the designated storage area in the performance data in the described packet belongs to the memory block that CCID equipment marks off in advance, if described memory block belongs to the memory block that CCID equipment marks off in advance, then the power function code in the described performance data is write described designated storage area, and put and write the new-content-flag position; Otherwise, return the information of reporting an error;
Or;
Physical length according to memory block start address in the performance data in the described packet and described power function code marks off designated storage area, power function code in the described performance data is write in the described designated storage area, and put and write the new-content-flag position;
If the packet header of described packet is not 6BH, described packet is not the packet that is used for secondary development, the operation of operative norm CCID equipment;
Judge that action code in the performance data in the described packet is whether in the scope of the proprietary protocol regulation that is used for CCID equipment firmware program is carried out secondary development;
Described execution is carried out being operating as of secondary development to CCID equipment firmware program: if the action code in the performance data in the described packet is then carried out the operation of CCID equipment firmware program being carried out secondary development according to the performance data in this packet in the scope of the proprietary protocol regulation that is used for CCID equipment firmware program is carried out secondary development; Otherwise, return the information of reporting an error;
If the power function that is operating as appointment in the execution CCID equipment that described action code is represented, the operation that then described execution is carried out secondary development to CCID equipment firmware program comprises:
Judge whether the designated storage area in the performance data in the described packet is empty:
If described designated storage area is not empty, then carry out the power function of the power function code correspondence of storing in the described designated storage area; If described designated storage area is empty, then to host computer feedback one signaling that is used to report an error;
If what described action code was represented is operating as the content of wiping designated storage area in the CCID equipment, the operation that then described execution is carried out secondary development to CCID equipment firmware program comprises:
Content in the designated storage area in the performance data in the described packet is changed to complete 0 or full F.
2. the method that CCID equipment firmware program is carried out secondary development according to claim 1 is characterized in that, the packet that described reception host computer issues is specially and receives the packet that host computer issues by the Bulkout end points.
3. the method that CCID equipment firmware program is carried out secondary development according to claim 1 is characterized in that, the described proprietary protocol that is used for CCID equipment firmware program is carried out secondary development is to be integrated into described CCID equipment firmware program in advance.
4. the method that CCID equipment firmware program is carried out secondary development according to claim 1, it is characterized in that, before whether the action code in the performance data in judging described packet had been used for carrying out in the scope of proprietary protocol regulation of secondary development to CCID equipment firmware program, this method also comprised:
Judge whether described packet is legal;
Describedly judge that whether the action code in the performance data in the described packet is in the scope of the proprietary protocol regulation that is used for CCID equipment firmware program is carried out secondary development: when described packet is legal, judge that action code in the performance data in the described packet is whether in the scope of the proprietary protocol regulation that is used for CCID equipment firmware program is carried out secondary development.
5. the method that CCID equipment firmware program is carried out secondary development according to claim 4 is characterized in that, describedly judges that whether described packet is legal, is specially:
Whether the length of judging the performance data in second data and the packet in the described packet is consistent;
If the length of the performance data in second data in the described packet and the packet is consistent, judge then whether the card slot number that receives described packet in the 3rd data and the CCID equipment in the described packet is consistent; Otherwise, return the information of reporting an error;
If it is consistent to receive the card slot number of described packet in the 3rd data in the described packet and the CCID equipment, judge then whether the command sequence that defines in the 4th data and the CCID equipment firmware program in the described packet is number consistent; Otherwise, return the information of reporting an error;
If the command sequence that defines in the 4th data in the described packet and the CCID equipment firmware program is number consistent, judge then whether the 5th data in the described packet are consistent with preset data; Otherwise, return the information of reporting an error;
If the 5th data in the described packet are consistent with described preset data, then described packet is legal; Otherwise, return the information of reporting an error.
6. the method that CCID equipment firmware program is carried out secondary development according to claim 5 is characterized in that,
Described second data are the data of the performance data length in the expression packet;
Described the 3rd data receive the data of the card slot number of described packet for expression;
Described the 4th data are the data of the command sequence number of the described packet of expression;
Described the 5th data are the preset data in the described packet of expression.
7. the method that CCID equipment firmware program is carried out secondary development according to claim 1, it is characterized in that, when the physical length according to memory block start address in the performance data in the described packet and described power function code marks off designated storage area, power function code in the described performance data is write in the described designated storage area, and put write the new-content-flag position after, this method also comprises:
Report the start address and the end address of described designated storage area to host computer.
8. the device that CCID equipment firmware program is carried out secondary development is characterized in that, comprising:
Sending module is used for sending an identifier to host computer, and this identifier represents that this machine is a CCID equipment;
Receiver module is used to receive the packet that host computer issues;
Analysis module, whether the packet header that is used to analyze described packet is 6BH;
Development module when being used for being 6BH in the packet header of described packet, is carried out the operation of CCID equipment firmware program being carried out secondary development;
First judge module, be used in the result of described analysis module when being, judge that action code in the performance data in the described packet is whether in the scope of the proprietary protocol regulation that is used for CCID equipment firmware program is carried out secondary development, when being, the operation of secondary development is carried out in execution to described development module to CCID equipment firmware program in the result who judges when described first judge module;
Described development module comprises: the 5th judging unit and first writing unit perhaps comprise: the division unit and second writing unit;
Described development module further comprises: the 6th judging unit, performance element, unit and erase unit report an error;
If what described action code was represented is operating as in CCID equipment write-in functions function code, then:
Whether the designated storage area in the performance data in the described packet of described the 5th judgment unit judges belongs to the memory block that CCID equipment marks off in advance; When described first writing unit belongs to the memory block that CCID equipment marks off in advance in described memory block, the power function code in the described performance data is write described designated storage area, and put and write the new-content-flag position;
Perhaps;
Described division unit marks off designated storage area according to the physical length of memory block start address in the performance data in the described packet and described power function code; Described second writing unit writes the power function code in the described performance data in the described designated storage area, and puts and write the new-content-flag position;
If the power function that is operating as appointment in the CCID equipment that described action code is represented, then:
Whether the designated storage area in the performance data in the described packet of described the 6th judgment unit judges is empty:
When described performance element is not empty in described designated storage area, carry out the power function of the power function code correspondence of storing in the described designated storage area;
The described unit that reports an error is when described designated storage area is sky, to host computer feedback one signaling that is used to report an error;
If what described action code was represented is operating as the content of wiping designated storage area in the CCID equipment, then:
Described erase unit is changed to complete 0 or full F with the content in the designated storage area in the performance data in the described packet.
9. the device that CCID equipment firmware program is carried out secondary development according to claim 8 is characterized in that,
Described receiver module receives the packet that described host computer issues by the Bulkout end points.
10. the device that CCID equipment firmware program is carried out secondary development according to claim 8 is characterized in that, also comprises:
Second judge module is used in the result of described analysis module judging whether described packet is legal when being; And,
Described first judge module when described second judge module judges that described packet is legal, judges that action code in the performance data in this packet is whether in the scope of the proprietary protocol regulation that is used for CCID equipment firmware program is carried out secondary development.
11. the device that CCID equipment firmware program is carried out secondary development according to claim 10 is characterized in that, described second judge module further comprises:
Whether the length of the performance data in first judging unit, second data that are used for judging described packet and packet is consistent;
Second judging unit is used in the described first judging unit result when being, judges whether the card slot number that receives described packet in the 3rd data and the CCID equipment in the described packet is consistent;
The 3rd judging unit is used in the described second judging unit result when being, judges whether the command sequence that defines in the 4th data and the CCID equipment firmware program in the described packet is number consistent;
The 4th judging unit is used in described the 3rd judging unit result judging whether the 5th data in the described packet are preset data when being;
If described the 4th judging unit result is for being that then described packet is legal.
12. the device that CCID equipment firmware program is carried out secondary development according to claim 11 is characterized in that,
Described second data are the data of the performance data length in the expression packet;
Described the 3rd data receive the data of the card slot number of described packet for expression;
Described the 4th data are the data of the command sequence number of the described packet of expression;
Described the 5th data are the preset data in the described packet of expression.
13. the device that CCID equipment firmware program is carried out secondary development according to claim 8 is characterized in that described development module also comprises:
Report the unit, be used for after the said write unit writes described designated storage area with the power function code of described performance data, reporting the start address and the end address of described designated storage area to host computer.
CN2008102475457A 2008-12-30 2008-12-30 Method and device for carrying out secondary development of firmware program of a CCID device Active CN101447015B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008102475457A CN101447015B (en) 2008-12-30 2008-12-30 Method and device for carrying out secondary development of firmware program of a CCID device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008102475457A CN101447015B (en) 2008-12-30 2008-12-30 Method and device for carrying out secondary development of firmware program of a CCID device

Publications (2)

Publication Number Publication Date
CN101447015A CN101447015A (en) 2009-06-03
CN101447015B true CN101447015B (en) 2011-12-28

Family

ID=40742689

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008102475457A Active CN101447015B (en) 2008-12-30 2008-12-30 Method and device for carrying out secondary development of firmware program of a CCID device

Country Status (1)

Country Link
CN (1) CN101447015B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106030526B (en) * 2013-12-13 2019-01-18 雷蛇(亚太)私人有限公司 Device, renovator, control device method and control renovator method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100424665C (en) * 2006-12-06 2008-10-08 北京飞天诚信科技有限公司 Method and device for implementing CCID equipment
CN100424664C (en) * 2006-11-21 2008-10-08 北京飞天诚信科技有限公司 A method and device to realize CCID apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100424664C (en) * 2006-11-21 2008-10-08 北京飞天诚信科技有限公司 A method and device to realize CCID apparatus
CN100424665C (en) * 2006-12-06 2008-10-08 北京飞天诚信科技有限公司 Method and device for implementing CCID equipment

Also Published As

Publication number Publication date
CN101447015A (en) 2009-06-03

Similar Documents

Publication Publication Date Title
CN100385426C (en) Architecture for universal serial bus-based PC flash disk
CN101454746B (en) Method for communication with a multi-function memory card
CN201063161Y (en) Primary device for serial peripheral interface
CN105353989A (en) Stored data access method, related controller, device, mainframe and system
CN105259834B (en) A kind of data in mobile phone acquisition controller of firmware restructural
CN102063939B (en) Method and device for implementing electrically erasable programmable read-only memory
CN100555206C (en) A kind of device of binding computational resource and storage resources
CN102708218A (en) USB (universal serial bus) compound device integrated with U (USB) disc and data acquisition module
CN102820061A (en) Embedded remote device program programmer device and method
CN101739322B (en) Test device and method of embedded system
CN102664043B (en) Device and method for test of smart SD card realizing mobile payment
CN103678187A (en) Micro-control unit and control method thereof
CN1909032A (en) LED display screen control system
CN101447015B (en) Method and device for carrying out secondary development of firmware program of a CCID device
CN101561790B (en) Method, system and device for communication between main control computer and slave computers
CN101969524B (en) Method for writing/updating set-top box by using set-top box
CN205486066U (en) Control card based on embedded operating system
CN102568602B (en) Flash memory development system
CN100538673C (en) The update method of embedded system and interface arrangement thereof and nonvolatile memory
CN202110539U (en) Multifunctional portable copy device
CN101561760A (en) Method for upgrading firmware of interface card
CN101488119A (en) Address interpretation method, apparatus and single-board
CN101594719A (en) Offline control device
CN218630781U (en) Handheld control box and point screen device for point screen detection
CN213182880U (en) IP access control device and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant