bladox.com Forum Index bladox.com
Turbo SIM Toolkit Adapter Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to know ME/Turbo is done with buf_B?
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    bladox.com Forum Index -> Development
View previous topic :: View next topic  
Author Message
pz



Joined: 12 Mar 2004
Posts: 1161

PostPosted: Mon Jun 06, 2011 2:30 pm    Post subject: Reply with quote

And if you avoid the stk_thread() to send the 2nd sms and compare the ACTION_FILE_APDU response - is it the sms sent and is the GET_RESPONSE you prepare the same? My bet is it's badly formated.

Another try - answer with 00 00 90 00, i.e. send it without modification. To see if this one works.
Back to top
View user's profile Send private message
tkm



Joined: 18 Jan 2011
Posts: 72

PostPosted: Mon Jun 06, 2011 3:57 pm    Post subject: Reply with quote

pz wrote:
And if you avoid the stk_thread() to send the 2nd sms and compare the ACTION_FILE_APDU response - is it the sms sent and is the GET_RESPONSE you prepare the same? My bet is it's badly formated.
Another try - answer with 00 00 90 00, i.e. send it without modification. To see if this one works.


I have two sms_sent function for testing purpose. I believe the diffrence in them is not causing the problem. Here is my complete code:
Code:





I have just tested with allowing both the sms without any modification. Result is the same. The first one didn't go through wheras the second one did.

Many thanks Pavel for your patience and continuing help...

[/quote]


Last edited by tkm on Thu Jun 09, 2011 9:09 am; edited 1 time in total
Back to top
View user's profile Send private message
pz



Joined: 12 Mar 2004
Posts: 1161

PostPosted: Tue Jun 07, 2011 6:47 am    Post subject: Reply with quote

Send log when both are allowed.

Also send log when the stk_thread() is commented out, i.e. only 1st is sent.
Back to top
View user's profile Send private message
tkm



Joined: 18 Jan 2011
Posts: 72

PostPosted: Tue Jun 07, 2011 9:28 am    Post subject: Reply with quote

pz wrote:
Send log when both are allowed.

Also send log when the stk_thread() is commented out, i.e. only 1st is sent.

Hello Pavel,
This is the log when both are allowed:
Quote:

FROM ME: a0 c2 00 00 21
FROM ME: d5 1f 82 02 82 81 06 07 91 44 77 58 10 06 50 06 07 81 70 78 58 24 87 f
13 07 32 f4 51 00 c5 5b f4
Debug begins

Going Forward
0058
Debug ends
CALL RET 9f02
TO ME: 9f 02

FROM ME: a0 c0 00 00 02
sms_resp_call_len=0004CALL FILE APDU SMS
0000
0000
0090
0000

Staring stk_thread for 2nd SMS

2nd SMS starts

Coming out of APDU loop for 1st SMS
sms_resp_call_len_2=
0000TO ME: 00 00 91 22

FROM ME: a0 b2 29 04 1c
TO SIM: a0 b2 29 04 1c
FROM SIM: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff f
ff ff ff ff 90 00
TO ME: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff f
ff ff ff ff 91 22

FROM ME: a0 12 00 00 22
TO ME: d0 20 81 03 01 13 00 82 02 81 83 8b 15 01 00 0b 81 70 78 88 47 32 f9 0
f6 08 54 4d 6f 62 69 6c 65 00 90 00

FROM ME: a0 b2 2a 04 1c
TO SIM: a0 b2 2a 04 1c
FROM SIM: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff f
ff ff ff ff 90 00
TO ME: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff f
ff ff ff ff 90 00

FROM ME: a0 a4 00 00 02
FROM ME: 6f 43
TO SIM: a0 a4 00 00 02
TO SIM: 6f 43
FROM SIM: 9f 0f
TO ME: 9f 0f

FROM ME: a0 c0 00 00 0f
TO SIM: a0 c0 00 00 0f
FROM SIM: 00 00 00 02 6f 43 04 00 11 f6 ff 01 02 00 00 90 00
TO ME: 00 00 00 02 6f 43 04 00 11 f6 ff 01 02 00 00 90 00

FROM ME: a0 d6 00 00 02
FROM ME: 36 ff
TO SIM: a0 d6 00 00 02
TO SIM: 36 ff
FROM SIM: 90 00
TO ME: 90 00

FROM ME: a0 c2 00 00 21
FROM ME: d5 1f 82 02 82 81 06 07 91 44 77 58 10 06 50 06 07 81 70 78 88 47 32 f
13 07 32 f4 51 00 c5 5b f4
Debug begins

Going Forward
0088
Debug ends
CALL RET SMS29f02
TO ME: 9f 02

FROM ME: a0 c0 00 00 02
sms_resp_call_len=0000sms_resp_call_len_2=
0004CALL FILE APDU SMS2
0000
0000
0090
0000
TO ME: 00 00 90 00

FROM ME: a0 a4 00 00 02
FROM ME: 6f 3a
TO SIM: a0 a4 00 00 02
TO SIM: 6f 3a
FROM SIM: 9f 0f
TO ME: 9f 0f

FROM ME: a0 c0 00 00 0f
TO SIM: a0 c0 00 00 0f
FROM SIM: 00 00 1b 58 6f 3a 04 00 11 f6 22 01 02 01 1c 90 00
TO ME: 00 00 1b 58 6f 3a 04 00 11 f6 22 01 02 01 1c 90 00

FROM ME: a0 b2 2b 04 1c
TO SIM: a0 b2 2b 04 1c
FROM SIM: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff f
ff ff ff ff 90 00
TO ME: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff f
ff ff ff ff 90 00

And this is the log when only first sms is modified and sent out; i.e: stk_thread of 2nd sms is disabled:
Quote:

FROM ME: a0 c2 00 00 21
FROM ME: d5 1f 82 02 82 81 06 07 91 44 77 58 10 06 50 06 07 81 70 78 58 24 87 f
13 07 32 f4 51 00 c5 5b f4
Debug begins

Going Forward
0058
Debug ends
CALL RET 9f14
TO ME: 9f 14

FROM ME: a0 c0 00 00 14
sms_resp_call_len=0016CALL FILE APDU SMS
0002
0012
0006
0007
0091
0044
0077
0058
0010
0006
0050
0006
0007
0081
0070
0078
0088
0047
0032
00f9
0090
0000

Coming out of APDU loop for 1st SMS
sms_resp_call_len_2=
0000TO ME: 02 12 06 07 91 44 77 58 10 06 50 06 07 81 70 78 88 47 32 f9 90 00

FROM ME: a0 b2 bd 04 1c
TO SIM: a0 b2 bd 04 1c
FROM SIM: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff f
ff ff ff ff 90 00
TO ME: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff f
ff ff ff ff 90 00

Many thanks.
Back to top
View user's profile Send private message
pz



Joined: 12 Mar 2004
Posts: 1161

PostPosted: Tue Jun 07, 2011 12:19 pm    Post subject: Reply with quote

All seems good.

1. And in the both allowed case only the 2nd is sent/received?
Does the phone complain again about stk error or what you mentioned before?

2. And in the only the 1st sms is it sent/received?
Back to top
View user's profile Send private message
tkm



Joined: 18 Jan 2011
Posts: 72

PostPosted: Tue Jun 07, 2011 12:40 pm    Post subject: Reply with quote

pz wrote:
All seems good.

1. And in the both allowed case only the 2nd is sent/received?
Does the phone complain again about stk error or what you mentioned before?

2. And in the only the 1st sms is it sent/received?


Hi Pavel,
1. Yes, in both allowed case only the 2nd sms is sent out and received. Yes it keeps on showing the error on handset I have mentioned earlier.
2. Yes, when I sent out only the 1st sms, it surely gets sent out and received properly with or without modified header-every time.

I can mail you the code if you would like to simulate the scenerio at your end-if that helps.

And I am using TL2 L1 kernel 1.3.7 if it has anything to do with it.
Back to top
View user's profile Send private message
pz



Joined: 12 Mar 2004
Posts: 1161

PostPosted: Tue Jun 07, 2011 5:01 pm    Post subject: Reply with quote

tkm wrote:
pz wrote:
All seems good.

1. And in the both allowed case only the 2nd is sent/received?
Does the phone complain again about stk error or what you mentioned before?

2. And in the only the 1st sms is it sent/received?


Hi Pavel,
1. Yes, in both allowed case only the 2nd sms is sent out and received. Yes it keeps on showing the error on handset I have mentioned earlier.


Seems more like phone bug, maybe it's confused by the request to send sms while one sms is being sent. In stk_thread() try to insert more_time() instead of sending sms. And let's see if the 1st will be sent then, if confused by send_sms() (confilict of sms'es) or any STK activity vs. sms sending.

If more_time() would work (1st goes out) then try more_time() and then your send_sms(). Be warned more_time() damages buf_A().

Can you try e.g. Nokia instead of BB?

Quote:

2. Yes, when I sent out only the 1st sms, it surely gets sent out and received properly with or without modified header-every time.

I can mail you the code if you would like to simulate the scenerio at your end-if that helps.


Not needed.


Quote:

And I am using TL2 L1 kernel 1.3.7 if it has anything to do with it.


Not related.
Back to top
View user's profile Send private message
tkm



Joined: 18 Jan 2011
Posts: 72

PostPosted: Wed Jun 08, 2011 11:12 am    Post subject: Reply with quote

pz wrote:
tkm wrote:
pz wrote:
All seems good.

1. And in the both allowed case only the 2nd is sent/received?
Does the phone complain again about stk error or what you mentioned before?

2. And in the only the 1st sms is it sent/received?


Hi Pavel,
1. Yes, in both allowed case only the 2nd sms is sent out and received. Yes it keeps on showing the error on handset I have mentioned earlier.


Seems more like phone bug, maybe it's confused by the request to send sms while one sms is being sent. In stk_thread() try to insert more_time() instead of sending sms. And let's see if the 1st will be sent then, if confused by send_sms() (confilict of sms'es) or any STK activity vs. sms sending.

If more_time() would work (1st goes out) then try more_time() and then your send_sms(). Be warned more_time() damages buf_A().

Can you try e.g. Nokia instead of BB?

Quote:

2. Yes, when I sent out only the 1st sms, it surely gets sent out and received properly with or without modified header-every time.

I can mail you the code if you would like to simulate the scenerio at your end-if that helps.


Not needed.


Quote:

And I am using TL2 L1 kernel 1.3.7 if it has anything to do with it.


Not related.

Thanks Pavel. I have tested with more_time() as you wanted and it failed as well sending the 1st sms. However, calling stk_thread function without any activity doesn't create any issues. So, as I was saying on my very first message that any following STK command messes up sending out the first sms.

I tried testing with 2 other Nokia handsets. One failed to catch sms control whereas other failed to send any sms at all. Have to check whether it is kernel-handset mismatch issue or something else.

Nonetheless, our requirement is purely Blackberry at the moment and just somehow need to find a way to send both sms.....but it seems like we are reaching a dead-end !!!!
Back to top
View user's profile Send private message
pz



Joined: 12 Mar 2004
Posts: 1161

PostPosted: Wed Jun 08, 2011 11:38 am    Post subject: Reply with quote

So it seems that BB has an issue to do any STK command while sending the SMS. That means you cannot do stk_thread() containing send_sms() or more_time() (the more_time is pitty, it doesn't do anything and would give us delay to request send_sms() after e.g. 5 sec) in ACTION_FILE_APDU.

A workaround could be to set up poll interval to e.g. 5 sec, register ACTION_STATUS and send the 2nd sms in this action.

Can you post a log of sending just one sms? Whole log following SMS control, with all following APDU's, ME-SIM activity. Maybe there is something done with SIM after the SMS leaves the phone? Try dbg -t to show timestamps.
Back to top
View user's profile Send private message
tkm



Joined: 18 Jan 2011
Posts: 72

PostPosted: Wed Jun 08, 2011 12:41 pm    Post subject: Reply with quote

pz wrote:
So it seems that BB has an issue to do any STK command while sending the SMS. That means you cannot do stk_thread() containing send_sms() or more_time() (the more_time is pitty, it doesn't do anything and would give us delay to request send_sms() after e.g. 5 sec) in ACTION_FILE_APDU.

A workaround could be to set up poll interval to e.g. 5 sec, register ACTION_STATUS and send the 2nd sms in this action.

Can you post a log of sending just one sms? Whole log following SMS control, with all following APDU's, ME-SIM activity. Maybe there is something done with SIM after the SMS leaves the phone? Try dbg -t to show timestamps.

I wonder if POLL INTERVAL will work as that is also an stk_command, which seems highly likely to corrupt buf_B for the first sms. However, I will give a go.

I won't be able to send out any more log file soonish as I have broken our newly purchased TL2--things are just going from bad to worse for me...
Back to top
View user's profile Send private message
pz



Joined: 12 Mar 2004
Posts: 1161

PostPosted: Wed Jun 08, 2011 2:21 pm    Post subject: Reply with quote

You'll set up POLL_INTERVAL sometimes sooner, at the phone startup. And then the phone will send APDU STATUS more often so you can send 2nd sms soon after 1st. There will be no STK triggered after 1st sms_mo_control.

TL2 - we will replace Smile
Back to top
View user's profile Send private message
tkm



Joined: 18 Jan 2011
Posts: 72

PostPosted: Wed Jun 08, 2011 3:02 pm    Post subject: Reply with quote

pz wrote:
You'll set up POLL_INTERVAL sometimes sooner, at the phone startup. And then the phone will send APDU STATUS more often so you can send 2nd sms soon after 1st. There will be no STK triggered after 1st sms_mo_control.

TL2 - we will replace Smile

Thanks Pavel, for the explaination. Will work on it...I will look into your autoalarm.c file to learn/understand how poll_interval works.

Really appreciate your changing the TL2. Many thanks.
Back to top
View user's profile Send private message
tkm



Joined: 18 Jan 2011
Posts: 72

PostPosted: Mon Jun 13, 2011 8:55 am    Post subject: Reply with quote

pz wrote:
You'll set up POLL_INTERVAL sometimes sooner, at the phone startup. And then the phone will send APDU STATUS more often so you can send 2nd sms soon after 1st. There will be no STK triggered after 1st sms_mo_control.

TL2 - we will replace Smile

Hi Pavel,
I sorted double SMS problem with POLL Interval strategy, as suggested by you. Now both the SMS's are going through. Many, many thanks for all the feedback. I was really stuck when our previous approach wasn't producing the result. Keep well.
Back to top
View user's profile Send private message
tkm



Joined: 18 Jan 2011
Posts: 72

PostPosted: Mon Jun 13, 2011 3:59 pm    Post subject: Reply with quote

tkm wrote:
pz wrote:
You'll set up POLL_INTERVAL sometimes sooner, at the phone startup. And then the phone will send APDU STATUS more often so you can send 2nd sms soon after 1st. There will be no STK triggered after 1st sms_mo_control.

TL2 - we will replace Smile

Hi Pavel,
I sorted double SMS problem with POLL Interval strategy, as suggested by you. Now both the SMS's are going through. Many, many thanks for all the feedback. I was really stuck when our previous approach wasn't producing the result. Keep well.

Hi Pavel,
Just when you think it can't go wrong from here, things just fall apart. i have a situation. With Poll interval I managed to complete the cycle 3/4/5 times but after that sms sends out stops. I have the debug info for both scenerio. This is the log when everything goes fine:
Quote:
Coming out of APDU loop for 1st SMS
sms_resp_call_len_2=
0000TO ME: 02 12 06 07 91 44 77 58 10 06 50 06 07 81 70 78 88 47 32 f9 90 00

FROM ME: a0 f2 00 00 1e

Calling 2nd SMS

2nd SMS starts
TO SIM: a0 f2 00 00 1e
FROM SIM: 00 00 c6 c2 7f 10 02 00 66 6f ff 01 11 9b 02 0c 09 00 83 8a 83 8a 00 8
80 80 80 80 00 00 90 00
TO ME: 00 00 c6 c2 7f 10 02 00 66 6f ff 01 11 9b 02 0c 09 00 83 8a 83 8a 00 8
80 80 80 80 00 00 91 22

FROM ME: a0 12 00 00 22
TO ME: d0 20 81 03 01 13 00 82 02 81 83 8b 15 01 00 0b 81 70 78 88 47 32 f9 0
f6 08 54 4d 6f 62 69 6c 65 00 90 00

FROM ME: a0 d6 00 00 02
FROM ME: f6 ff
TO SIM: a0 d6 00 00 02
TO SIM: f6 ff
FROM SIM: 90 00
TO ME: 90 00

FROM ME: a0 c2 00 00 21
FROM ME: d5 1f 82 02 82 81 06 07 91 44 77 58 10 06 50 06 07 81 70 78 88 47 32 f
13 07 32 f4 51 00 c5 5b f4
Debug begins

Going Forward
0088
Debug ends
CALL RET SMS29f02
TO ME: 9f 02

FROM ME: a0 c0 00 00 02
sms_resp_call_len=0000sms_resp_call_len_2=
0004CALL FILE APDU SMS2
0000
0000
0090
0000
TO ME: 00 00 90 00

FROM ME: a0 14 00 00 0c
FROM ME: 81 03 01 13 00 02 02 82 81 83 01 00

Out of 2nd SMS function
TO ME: 90 00

FROM ME: a0 f2 00 00 1e
TO SIM: a0 f2 00 00 1e
FROM SIM: 00 00 c6 c2 7f 10 02 00 66 6f ff 01 11 9b 02 0c 09 00 83 8a 83 8a 00 8
80 80 80 80 00 00 90 00
TO ME: 00 00 c6 c2 7f 10 02 00 66 6f ff 01 11 9b 02 0c 09 00 83 8a 83 8a 00 8
80 80 80 80 00 00 90 00


This is the log when it stops working:
Quote:
Calling 2nd SMS

2nd SMS starts
TO SIM: a0 f2 00 00 1e
FROM SIM: 00 00 c9 38 7f 10 02 00 66 6f ff 01 11 9b 02 0c 09 00 83 8a 83 8a 00 80
80 80 80 80 00 00 90 00
TO ME: 00 00 c9 38 7f 10 02 00 66 6f ff 01 11 9b 02 0c 09 00 83 8a 83 8a 00 80
80 80 80 80 00 00 91 26

FROM ME: a0 12 00 00 26
TO ME: d0 24 81 03 01 13 00 82 02 81 83 8b 19 01 00 0b 81 70 78 88 47 32 f9 00
f6 0c 37 30 37 38 35 38 32 34 38 37 66 34 90 00

FROM ME: a0 14 00 00 0d
FROM ME: 81 03 01 13 00 02 02 82 81 83 02 20 00

Out of 2nd SMS function
TO ME: 90 00

FROM ME: a0 f2 00 00 1e
TO SIM: a0 f2 00 00 1e
FROM SIM: 00 00 c9 38 7f 10 02 00 66 6f ff 01 11 9b 02 0c 09 00 83 8a 83 8a 00 80
80 80 80 80 00 00 90 00
TO ME: 00 00 c9 38 7f 10 02 00 66 6f ff 01 11 9b 02 0c 09 00 83 8a 83 8a 00 80
80 80 80 80 00 00 90 00


For the record I have put poll interval to 10 seconds- well i have also tried with 5,6,7,8 seconds. i understand this is where it is all getting wrong:
Quote:
FROM ME: a0 14 00 00 0d
FROM ME: 81 03 01 13 00 02 02 82 81 83 02 20 00
well, a good amount of communication between ME and SIM seems to not take place before the above block, when it goes wrong.

Any thoughts would be greatly appreciated...
Back to top
View user's profile Send private message
pz



Joined: 12 Mar 2004
Posts: 1161

PostPosted: Tue Jun 14, 2011 6:53 pm    Post subject: Reply with quote

Eeeeh by stops working you mean what? It freezes? Phone doesn't send any sms'es?

Usually when something is ok for few times and then goes wrong it's about memory corruption, some buffer overflow and so.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    bladox.com Forum Index -> Development All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group