OpenOBEX shared library programming guide | ||
---|---|---|
<<< Previous | Next >>> |
OBEX handle
OBEX object
Header identifier
Header value
Header size
See obex.h for possible values
Add a new header to an object.
If you want all headers to fit in one packet, use the flag
OBEX_FL_FIT_ONE_PACKET
on all headers you add to an object.
To stream a body add a body header with hv.bs = NULL
and set the flag
OBEX_FL_STREAM_START
. You will now get OBEX_EV_STREAMEMPTY
events as
soon as the the parser wants you to feed it with more data.
When you get an OBEX_EV_STREAMEMPTY
event give the parser some data by
adding a body-header and set the flag OBEX_EV_STREAM_DATA
. When you
have no more data to send set the flag OBEX_EV_STREAM_DATAEND
instead.
After adding a header you are free to do whatever you want with the buffer
if you are NOT streaming. If you are streaming you may not touch the
buffer until you get another OBEX_EV_STREAMEMTPY
or until the request
finishes.
The headers will be sent in the order you add them.
<<< Previous | Home | Next >>> |
OBEX_ObjectDelete | Up | OBEX_ObjectGetNextHeader |