dcsimg
sendBytes(..,..) doubt
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, December 18, 2001 05:58 AM

I have been trying to create a applet in which I echo the parameters received. I was referring the HelloWorld example in which I am not able to understand a particular section. The HelloWorld ex uses apdu.setOutgoingLength( (short) (echoOffset + 5) ); On the next line the following command is invoked apdu.sendBytes( (short)0, (short) 5); I am attaching an excerpt from the API document related to sendBytes method. =======API DOcument============== public void sendBytes(short bOff, short len) throws APDUException Sends len more bytes from APDU buffer at specified offset bOff. =======API DOcument==============   More>>

I have been trying to create a applet in which I echo the parameters received.

I was referring the HelloWorld example in which I am not able to understand a particular section.


The HelloWorld ex uses
apdu.setOutgoingLength( (short) (echoOffset + 5) );


On the next line the following command is invoked
apdu.sendBytes( (short)0, (short) 5);


I am attaching an excerpt from the API document related to sendBytes method.


=======API DOcument==============
public void sendBytes(short bOff,
short len)
throws APDUException


Sends len more bytes from APDU buffer at specified offset bOff.


=======API DOcument==============


I am not able to get a clear picture of what sendBytes is attempting to do in the example.


If it sends the bytes from an offset (0)till the given point then shouldnt the sendBytes method in HelloWorld use sendBytes(0,echoOffset + 5) instead of (0,5)???


Also, what is the purpose of adding 5 to the echoOffset??


Thanks,

Ashutosh

   <<Less

Re: sendBytes(..,..) doubt

Posted By:   Joseph_Smith  
Posted On:   Wednesday, December 19, 2001 11:31 AM

The sendBytes method is what is sent to the optional data for the R-APDU. The length must match the LE that is sent in the C-APDU.
About | Sitemap | Contact