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?

RE: OBEX Server Exension - how to continue a OBEX GET by YueZengmsft

YueZengmsft
Thu Jun 21 17:58:00 CDT 2007

On Windows Mobile, continue packets need connection ID. Obviously the 3-byte
GET doesn't contain the connection id and it failed on Windows Mobile. So the
client should issue a continuous GET with a connection ID.

"syncluz" wrote:

> 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?

RE: OBEX Server Exension - how to continue a OBEX GET by syncluz

syncluz
Fri Jun 22 03:11:01 CDT 2007

Thanks a lot for this information! So I can stop searching for the problem in
my code :-)

Unfortunately, I have to communicate with an existing client I can't change,
and unfortunately sending no connection ID for the GET continuation is not a
bug in that client but explicit recommendation in the OBEX standard:

From IrOBEX 1.2, paragraph 3.1 "Request Format", page 22:

> If the operation requires multiple response packets to complete after
> the Final bit is set in the request (as in the case of a GET operation
> returning an object that is too big to fit in one response packet), the
> server will signal this with the â??Continueâ?? response code, telling the
> client that it should ask for more. The client (requestor) should send
> another request packet with the same opcode, Final bit set,
> and no headers
> ^^^^^^^^^^^^^^
> if it wishes to continue receiving the object. If the client
> does not want to continue the operation, it should send an ABORT
> packet.

BTW that's how it works with the Broadcom/Widcomm-Stack for Windows Mobile
and with a lot of other OBEX implementations I've seen so far (e.g. Symbian
and if I correctly recall, PalmOS as well).

"Yue Zeng [msft]" wrote:

> On Windows Mobile, continue packets need connection ID. Obviously the 3-byte
> GET doesn't contain the connection id and it failed on Windows Mobile. So the
> client should issue a continuous GET with a connection ID.

RE: OBEX Server Exension - how to continue a OBEX GET by matrixlnmi169

matrixlnmi169
Wed Jul 18 03:52:01 CDT 2007



"syncluz" wrote:

> Thanks a lot for this information! So I can stop searching for the problem in
> my code :-)
>
> Unfortunately, I have to communicate with an existing client I can't change,
> and unfortunately sending no connection ID for the GET continuation is not a
> bug in that client but explicit recommendation in the OBEX standard:
>
> From IrOBEX 1.2, paragraph 3.1 "Request Format", page 22:
>
> > If the operation requires multiple response packets to complete after
> > the Final bit is set in the request (as in the case of a GET operation
> > returning an object that is too big to fit in one response packet), the
> > server will signal this with the â??Continueâ?? response code, telling the
> > client that it should ask for more. The client (requestor) should send
> > another request packet with the same opcode, Final bit set,
> > and no headers
> > ^^^^^^^^^^^^^^
> > if it wishes to continue receiving the object. If the client
> > does not want to continue the operation, it should send an ABORT
> > packet.
>
> BTW that's how it works with the Broadcom/Widcomm-Stack for Windows Mobile
> and with a lot of other OBEX implementations I've seen so far (e.g. Symbian
> and if I correctly recall, PalmOS as well).
>
> "Yue Zeng [msft]" wrote:
>
> > On Windows Mobile, continue packets need connection ID. Obviously the 3-byte
> > GET doesn't contain the connection id and it failed on Windows Mobile. So the
> > client should issue a continuous GET with a connection ID.

Hai all
I too have developed obex extension server dll for syncml on
window mobile-5.0 (WS2005), for smartphone on samsung i-320 devices (testing
on this).
My major problem is registering the obex extension server dll.
What i have done i make a new registry entry with uuid of syncml server at
given below palace,
[HKEY_LOCAL_MACHINE\Software\Microsoft\Obex\Services\{00000001-0000-1000-8000-0002EE000002}]
when syncml client send this service uuid in target header my dll is not
bale to invoked. does i need platform builders to make registry entry or
some other stuff.

however when i put my customized dll in palace of in built ftp/inbox
service dll and send request over obex commander( obex client) it is
working fine.
i draw the conclusion that there is problem in service registeration.

The sony ericsson has in build syncml client and when i tested on that
device my dll is able to invoked.

It means i am lacking in making proper registry entry for service which
is not by default provided on the device .

i am following the same way as window mobile 5.0 documentation say.

Does i need wince platform builders for supporting obex service extension.

Please tell me how u make registry entry?
How u make able to invoked your's dll.?
On which device u are testings?
And any resources related to this issues.

Thanx in advances

Ashakant!!!!












RE: OBEX Server Exension - how to continue a OBEX GET by syncluz

syncluz
Wed Jul 18 04:52:07 CDT 2007

Your key is wrong - because the ID you use at the end is the BT GUID, not the
OBEX service ID. The key must be named

[HKEY_LOCAL_MACHINE\Software\Microsoft\Obex\Services\{SYNCML_SYNC}]

Then you need to create a proper SDP entry in that key (which then contains
the 00000001-0000-1000-8000-0002EE000002 GUID in the appropriate SDP
records). Refer to the BT standards on how to build SDP entries - it's not
trivial but following the standard docs it's not too complicated either.


RE: OBEX Server Exension - how to continue a OBEX GET by matrixlnmi169

matrixlnmi169
Thu Jul 19 08:14:03 CDT 2007



"syncluz" wrote:

> Your key is wrong - because the ID you use at the end is the BT GUID, not the
> OBEX service ID. The key must be named
>
> [HKEY_LOCAL_MACHINE\Software\Microsoft\Obex\Services\{SYNCML_SYNC}]
>
> Then you need to create a proper SDP entry in that key (which then contains
> the 00000001-0000-1000-8000-0002EE000002 GUID in the appropriate SDP
> records). Refer to the BT standards on how to build SDP entries - it's not
> trivial but following the standard docs it's not too complicated either.
>

Thanx alots for replying.

I am working for IRDA transport also for irda we need not
to create SDP database ,but does we need to make IAS
database entry also for "SYNCML_SYNC" service and we have to specify
port corresponding to "SYNCML_SYNC" services.

One things i also like to share with you is client request packet is not
able to reach Operating system Obex dll at all ( as OS obex first get the
packet then it
routes the packet to appropriated service dll )means it is failure
before
that or after that , i think it is not able to reach OS obex dll at all.

Suggest me plz for Irda cases also.

thanx
Ashakant.



RE: OBEX Server Exension - how to continue a OBEX GET by syncluz

syncluz
Thu Jul 19 11:12:03 CDT 2007

I have no experience with the IrDA part as I only use Bluetooth. But from the
documentation I would have guessed that there's nothing more except the
registry entry needed.

In any case, make sure you restart the Obex server service (there are IOCTLs
to do that, or simply do a warm start) after changing something in the
registry. And note that there is a registry value that must list the active
protocols as a string - make sure it includes IrDA.

RE: OBEX Server Exension - how to continue a OBEX GET by matrixlnmi169

matrixlnmi169
Tue Jul 24 07:22:04 CDT 2007



"syncluz" wrote:

> I have no experience with the IrDA part as I only use Bluetooth. But from the
> documentation I would have guessed that there's nothing more except the
> registry entry needed.
>
> In any case, make sure you restart the Obex server service (there are IOCTLs
> to do that, or simply do a warm start) after changing something in the
> registry. And note that there is a registry value that must list the active
> protocols as a string - make sure it includes IrDA.

Thanx syncluz

I follow the same step and taken precaution as u have suggested and now my
application ( exe) is able to advertise the
syncml service uuid.(00000001-0000-1000-8000-0002EE000002 )

My basic problem(queries)huddles is invoking the extension server dll is
still there .
Syncml client is not able to invoked the extensions syncml server dll .

I am agree with you major reason is improper registery entry but i have
taken all spec. and your's suggested way.

We have syncml client which send syncml connect request and it makes able
to invoked sony errissions in built syncml service which make us conclusion
that syncml client is sending request properly.

One is we have noticed that only in build services dll are able to invoked(
on samsung smartphone i-320 device)
What i feel that does u implement the syncml server using platform
builders as it creates new OS image .
I am not using platform builders.

I will be very grateful to you if u mention step by step method for
invoking the dll.

Thnaku
Ashakant








RE: OBEX Server Exension - how to continue a OBEX GET by syncluz

syncluz
Tue Jul 24 08:22:05 CDT 2007

I am not using platform builder, but plain ordinary SDKs with EVC4 and VS2005
(works with both).

> I will be very grateful to you if u mention step by step method for invoking the dll.

There's not much to mention. I built the DLL (with the entry point as in the
OBEX docs), copied it to \Windows on the device and created the registry
entry referencing my DLL and including the SDP entry. After a warm start the
service gets visible in the BT SDP, and when OBEX requests are sent to
SYNCML-SYNC service, the DLL gets called.

I'm a bit consfused about your usage of "server" and "client" terms - the
SyncML client is usually the phone, and the SyncML server is the desktop
computer. The OBEX roles are reversed, maybe that's what you were referring
to.


RE: OBEX Server Exension - how to continue a OBEX GET by matrixlnmi169

matrixlnmi169
Fri Jul 27 06:52:01 CDT 2007



"syncluz" wrote:

> I am not using platform builder, but plain ordinary SDKs with EVC4 and VS2005
> (works with both).
>
> > I will be very grateful to you if u mention step by step method for invoking the dll.
>
> There's not much to mention. I built the DLL (with the entry point as in the
> OBEX docs), copied it to \Windows on the device and created the registry
> entry referencing my DLL and including the SDP entry. After a warm start the
> service gets visible in the BT SDP, and when OBEX requests are sent to
> SYNCML-SYNC service, the DLL gets called.
>
> I'm a bit consfused about your usage of "server" and "client" terms - the
> SyncML client is usually the phone, and the SyncML server is the desktop
> computer. The OBEX roles are reversed, maybe that's what you were referring
> to.
>
Yes i have too follow the same step as u mention.
client is desktop ( which send the request over IRDA/BLUETOOTH using
socket) and server is device(samsung i-320).
I make SDP entry and it is confirmed that it is advertiging the services
only things is in registery syncml service is not visible this may be cause
of i have not enter the service name in last line of resource file.

Can you plz tell me on which device you have implemented service extenion
and is it symbians based or microsoft based ,and which client you are using?

I will be very grateful for you if u provide me your's bluetooth SDP blob(
BYTE SdpRecord[]={0x35,0x3e,..... };) that has been
registered, in WSASetService() function in
and client application too.

Thanku for your's all reply and help







RE: OBEX Server Exension - how to continue a OBEX GET by matrixlnmi169

matrixlnmi169
Thu Aug 09 07:32:00 CDT 2007



"matrixlnmi169" wrote:

>
>
> "syncluz" wrote:
>
> > I am not using platform builder, but plain ordinary SDKs with EVC4 and VS2005
> > (works with both).
> >
> > > I will be very grateful to you if u mention step by step method for invoking the dll.
> >
> > There's not much to mention. I built the DLL (with the entry point as in the
> > OBEX docs), copied it to \Windows on the device and created the registry
> > entry referencing my DLL and including the SDP entry. After a warm start the
> > service gets visible in the BT SDP, and when OBEX requests are sent to
> > SYNCML-SYNC service, the DLL gets called.
> >
> > I'm a bit consfused about your usage of "server" and "client" terms - the
> > SyncML client is usually the phone, and the SyncML server is the desktop
> > computer. The OBEX roles are reversed, maybe that's what you were referring
> > to.
> >
> Yes i have too follow the same step as u mention.
> client is desktop ( which send the request over IRDA/BLUETOOTH using
> socket) and server is device(samsung i-320).
> I make SDP entry and it is confirmed that it is advertiging the services
> only things is in registery syncml service is not visible this may be cause
> of i have not enter the service name in last line of resource file.
>
> Can you plz tell me on which device you have implemented service extenion
> and is it symbians based or microsoft based ,and which client you are using?
>
> I will be very grateful for you if u provide me your's bluetooth SDP blob(
> BYTE SdpRecord[]={0x35,0x3e,..... };) that has been
> registered, in WSASetService() function in
> and client application too.
>
> Thanku for your's all reply and help

Now i hav e proceed to implementaion ..
now my new issues is when i send the response for connect command to
client
i am sending two object one is connection id and another is WHO HEADER
object.
following are given portion of code.
ObexCommand oc;
unsigned int aPropID[4];
ObexVariant aPropVar[4];

memset(&oc, 0, sizeof(oc));
oc.fFinal = TRUE;
oc.uiOp = pOT->pObex->uiOp;

oc.uiResp =OBEX_STAT_OK;
oc.sPktData.ConnectRequestResponse.version = 0x10;
oc.sPktData.ConnectRequestResponse.maxlen =
0x0200;//pNew->uiPacketLimit;//0x0200
oc.cProp = 0;
oc.aPropID = aPropID;
oc.aPropVar = aPropVar;

aPropID[oc.cProp] = OBEX_HID_CONNECTIONID;
aPropVar[oc.cProp].ui = pOT->uiConnectionId;
++oc.cProp;


aPropID[oc.cProp]=OBEX_HID_WHO;
aPropVar[oc.cProp].caub.puc=(unsigned char
*)pOT->ObexAlloc(pNew->uiPacketLimit);

aPropVar[oc.cProp].caub.cuc=0x000E;//strlen((const char
*)pOT->pObex->aPropVar[i].caub.puc+1);

memcpy(aPropVar[oc.cProp].caub.puc,(unsigned char
*)pOT->pObex->aPropVar[i].caub.puc,strlen((const char
*)pOT->pObex->aPropVar[i].caub.puc));

What i founds that my server is able to receive only first object that is
connectionid.
Another interesting things is when i send OBEX_HID_COUNT object it is able
to get.

in obexparser.h object is defined like that.

#define OBEX_HID_COUNT (0x00 | OBEX_TYPE_DWORD)
#define OBEX_HID_TYPE (0x02 | OBEX_TYPE_BYTESEQ)

so there is problem for OBEX_TYPE_BYTESEQ only.


Please tell me why it is happens like that, for

thanku