I have written an OBEX server extension DLL for Windows Mobile. It works fine
for PUT and GET, with one (show stopping) exception: I haven't found out what
to return as response for a GET when the data is not complete (continue
response) - whatever I do, it returns the first chunk ok and then aborts.
In Detail:
As a response to OBEX_OP_GET I set up a ObexCommand with:
- uiOp=OBEX_OP_GET
- uiResp=OBEX_STAT_CONTINUE
- one OBEX_HID_LENGTH header with the total length of the message (sum of
all chunks)
- one OBEX_HID_BODY with the first data chunk
I call the ServerCallback as follows:
- ServerCallback(OBEX_RESP_RESPOND, transactionId, &cmd)
It returns 1, which is either S_FALSE or (more likely) OBEX_RESP_RESPOND
The first chunk is sent, and it's sent fully ok (I can view it at the client
side).
Then, as the status was OBEX_STAT_CONTINUE, the client issues another GET (3
bytes, 0x83,0x00,0x03).
Everything correct until here.
But now instead of calling my service extension again with OBEX_OP_GET as I
would have expected, it gets called with OBEX_OP_DISCONNECT and the client is
sent a OBEX_STAT_INTERNALERROR (0xD0,0x03,0x03) message. I have no chance
continuing the GET.
I tried all sorts of alternatives for the parameters to ServerCallback,
uiResp and the return code of ServiceCallback (where I found earlier that the
documented S_OK response is not working, but OBEX_RESP_OK is).
Unfortunately, the docs are really sparse, and for non-platform-builder
developers apparently there is no sample code. It took me quite some trial
and error to get as far, but without multi-chunk GET I'm stuck.
Any ideas?