-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CoAP Blockwise transfer #41
Comments
Hi~ You don't have to specify a Block2 option. In this case the size of blocks will be negotiated between the client and server. The lib will decide automatically whether a blockwise transfer is needed according to the size of payload. If you prefer any other size of one block, you may specify a Block2 option before sending the request: /*
* In this case, the 2nd param (num) must be 0;
* the 3rd param (szx) stands for the block size:
* block size = 1 << (szx + 4)
* 1 for 32 bytes per block
* It must between 0 and 6.
*/
request.SetOption(new BlockOption(OptionType.Block2, 0, 1, false)); You may try the CoAP.Example/CoAP.Client example to get the '/large' resource in the CoAP.Example/CoAP.Server example to see the result. |
Hi, Thanks for your reply. |
Sorry that this feature will not work without support on the server side. |
Hi, I have a question on SZX in the Block2 Option. Does the payload bytes of the response packet MUST be exactly same as the SZX chosen in Block2 Option For example, I send a Block which is NOT the last block and I choose SZX = 2 (i.e., Block size is 64 bytes). But the actual payload in the response is 75 bytes or 57 bytes not 64 bytes. Is this valid? Thanks! |
Hi,
I am new to this CoAP project and i am making using use of coap.net.
Working on blockwise transfer in order to GET payload of 100 bytes.
How do I start with this? I read the latest RFC on blockwise transfer where it says make use of blockoption 2 for GET method.
Any way to approach this / sample code / pointers would be appreciated
Best Regards,
Sachin Edwin
The text was updated successfully, but these errors were encountered: