Fixed DCC, ARF, RD, and AWF demo applications to use address_cache if available.

This commit is contained in:
skarg
2015-05-29 01:46:54 +00:00
parent d052578777
commit 8cae75b5d2
4 changed files with 48 additions and 16 deletions
+12 -4
View File
@@ -230,7 +230,13 @@ int main(
last_seconds = time(NULL); last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries(); timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
/* try to bind with the device */ /* try to bind with the device */
Send_WhoIs(Target_Device_Object_Instance, Target_Device_Object_Instance); found =
address_bind_request(Target_Device_Object_Instance, &max_apdu,
&Target_Address);
if (!found) {
Send_WhoIs(Target_Device_Object_Instance,
Target_Device_Object_Instance);
}
/* loop forever */ /* loop forever */
for (;;) { for (;;) {
/* increment timer - exit if timed out */ /* increment timer - exit if timed out */
@@ -250,9 +256,11 @@ int main(
if (Error_Detected) if (Error_Detected)
break; break;
/* wait until the device is bound, or timeout and quit */ /* wait until the device is bound, or timeout and quit */
found = if (!found) {
address_bind_request(Target_Device_Object_Instance, &max_apdu, found =
&Target_Address); address_bind_request(Target_Device_Object_Instance, &max_apdu,
&Target_Address);
}
if (found) { if (found) {
if (invoke_id == 0) { if (invoke_id == 0) {
invoke_id = invoke_id =
+12 -4
View File
@@ -301,7 +301,13 @@ int main(
last_seconds = time(NULL); last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries(); timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
/* try to bind with the device */ /* try to bind with the device */
Send_WhoIs(Target_Device_Object_Instance, Target_Device_Object_Instance); found =
address_bind_request(Target_Device_Object_Instance, &max_apdu,
&Target_Address);
if (!found) {
Send_WhoIs(Target_Device_Object_Instance,
Target_Device_Object_Instance);
}
/* loop forever */ /* loop forever */
for (;;) { for (;;) {
/* increment timer - exit if timed out */ /* increment timer - exit if timed out */
@@ -319,9 +325,11 @@ int main(
tsm_timer_milliseconds(((current_seconds - last_seconds) * 1000)); tsm_timer_milliseconds(((current_seconds - last_seconds) * 1000));
} }
/* wait until the device is bound, or timeout and quit */ /* wait until the device is bound, or timeout and quit */
found = if (!found) {
address_bind_request(Target_Device_Object_Instance, &max_apdu, found =
&Target_Address); address_bind_request(Target_Device_Object_Instance, &max_apdu,
&Target_Address);
}
if (found) { if (found) {
/* calculate the smaller of our APDU size or theirs /* calculate the smaller of our APDU size or theirs
and remove the overhead of the APDU (about 16 octets max). and remove the overhead of the APDU (about 16 octets max).
+12 -4
View File
@@ -190,7 +190,13 @@ int main(
last_seconds = time(NULL); last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries(); timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
/* try to bind with the device */ /* try to bind with the device */
Send_WhoIs(Target_Device_Object_Instance, Target_Device_Object_Instance); found =
address_bind_request(Target_Device_Object_Instance, &max_apdu,
&Target_Address);
if (!found) {
Send_WhoIs(Target_Device_Object_Instance,
Target_Device_Object_Instance);
}
/* loop forever */ /* loop forever */
for (;;) { for (;;) {
/* increment timer - exit if timed out */ /* increment timer - exit if timed out */
@@ -209,9 +215,11 @@ int main(
if (Error_Detected) if (Error_Detected)
break; break;
/* wait until the device is bound, or timeout and quit */ /* wait until the device is bound, or timeout and quit */
found = if (!found) {
address_bind_request(Target_Device_Object_Instance, &max_apdu, found =
&Target_Address); address_bind_request(Target_Device_Object_Instance, &max_apdu,
&Target_Address);
}
if (found) { if (found) {
if (invoke_id == 0) { if (invoke_id == 0) {
invoke_id = invoke_id =
+12 -4
View File
@@ -216,7 +216,13 @@ int main(
last_seconds = time(NULL); last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries(); timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
/* try to bind with the device */ /* try to bind with the device */
Send_WhoIs(Target_Device_Object_Instance, Target_Device_Object_Instance); found =
address_bind_request(Target_Device_Object_Instance, &max_apdu,
&Target_Address);
if (!found) {
Send_WhoIs(Target_Device_Object_Instance,
Target_Device_Object_Instance);
}
/* loop forever */ /* loop forever */
for (;;) { for (;;) {
/* increment timer - exit if timed out */ /* increment timer - exit if timed out */
@@ -234,9 +240,11 @@ int main(
tsm_timer_milliseconds(((current_seconds - last_seconds) * 1000)); tsm_timer_milliseconds(((current_seconds - last_seconds) * 1000));
} }
/* wait until the device is bound, or timeout and quit */ /* wait until the device is bound, or timeout and quit */
found = if (!found) {
address_bind_request(Target_Device_Object_Instance, &max_apdu, found =
&Target_Address); address_bind_request(Target_Device_Object_Instance, &max_apdu,
&Target_Address);
}
if (found) { if (found) {
if (Target_File_Requested_Octet_Count) { if (Target_File_Requested_Octet_Count) {
requestedOctetCount = Target_File_Requested_Octet_Count; requestedOctetCount = Target_File_Requested_Octet_Count;