Re: [openobex-users] brach support obex over l2cap and SRM

2010-11-18 Thread hui li
Sorry, is yor patch still use obex_data_indication() and
obex_transport_read() to read socket data? It seems that your modified
custom_read() function isn`t called by the two functions. Or you use
OBEX_CustomDataFeed() to read data? Thanks.

2010/11/13, Hendrik Sattler p...@hendrik-sattler.de:
 Am Freitag 12 November 2010, 07:57:17 schrieb hui li:
 Currently when openobex calls obex_data_indication()  to read socket
 data, it first calls obex_transport_read()  to read first 3 data to
 decide message length, then calls obex_transport_read() again to read
 remaining data. But when we run obex over l2cap, you can find the
 second obex_transport_read() return zero.
 [...]
  actual = obex_transport_read(self, MAX_BUFF_SIZE);
 [...]

 Please check
 http://www.gitorious.org/openobex/mainline/commit/be1b3863d52b7daaa670245d8a88e8ccdacf7334

 Does that help you? It resizes the available buffer to have RX MTU bytes (no
 packet from the client should be larger than that) and you can fill that
 with
 your data. The RX MTU can be set by your own code.
 Still, a proper solution was always possible using OBEX_CustomDataFeed() or
 by
 buffering the data in your own 64k buffer.
 You cannot call obex_transport_read() like proposed by you when usually
 using
 blocking sockets or file descriptors.

 HS


--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2  L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
___
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users


Re: [openobex-users] brach support obex over l2cap and SRM

2010-11-18 Thread Hendrik Sattler
Zitat von hui li nami.li1...@gmail.com:

 Sorry, is yor patch still use obex_data_indication() and
 obex_transport_read() to read socket data? It seems that your modified
 custom_read() function isn`t called by the two functions. Or you use
 OBEX_CustomDataFeed() to read data? Thanks.

I reworked the patches you need to rebase if you checked out my  
for-mainline branch.
The function OBEX_HandleInput() now calls obex_work() instead of  
obex_transport_handle_input(). That does the following:

* when sending in SRM, it checks with zero timeout for input and if  
nothing is there, it calls the client/server send method.
* when not sending in SRM, it calls the usual handle input path

That handle input path is slightly modified as it now looks at how  
much data there is in the rx_msg queue and only calls handle_input if  
there is less than one _full_ packet. This gives custom transports the  
chance to call CustomDataFeed() and does not flood our rx_msg queue  
with packages so that the transport speed regulation can kick in.
It also calls the transports read() method if that data is not enough  
(for custom transports, this does nothing if not implemented).

The obex_data_indication now checks that only ABORT packets are  
consumed when you are sending in SRM.

I tested this with obexftp and it's tty custom transport in  
combination with my obexpush_atd and it works fine. That one only  
fills 500 byes per HandleInput call with a RX MTU of 1024 bytes (so  
three CustomDataFeed calls).
You can force SRM without changing other software by changing the  
initial rsp_mode value in obex.c (preferable for server and client ;))

Please try it. If you find problems, try to find out what wrong and tell me.

HS

PS: would it be possible for you to implement the L2CAP transport  
directly in OpenOBEX?


--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2  L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
___
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users


Re: [openobex-users] brach support obex over l2cap and SRM

2010-11-12 Thread Hendrik Sattler
Am Freitag 12 November 2010, 07:57:17 schrieb hui li:
 Currently when openobex calls obex_data_indication()  to read socket
 data, it first calls obex_transport_read()  to read first 3 data to
 decide message length, then calls obex_transport_read() again to read
 remaining data. But when we run obex over l2cap, you can find the
 second obex_transport_read() return zero.
[...]
   actual = obex_transport_read(self, MAX_BUFF_SIZE);
[...]

Please check
http://www.gitorious.org/openobex/mainline/commit/be1b3863d52b7daaa670245d8a88e8ccdacf7334

Does that help you? It resizes the available buffer to have RX MTU bytes (no 
packet from the client should be larger than that) and you can fill that with 
your data. The RX MTU can be set by your own code.
Still, a proper solution was always possible using OBEX_CustomDataFeed() or by 
buffering the data in your own 64k buffer.
You cannot call obex_transport_read() like proposed by you when usually using 
blocking sockets or file descriptors.

HS

--
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
___
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users


Re: [openobex-users] brach support obex over l2cap and SRM

2010-11-11 Thread Hendrik Sattler
Zitat von hui li nami.li1...@gmail.com:

 Currently when openobex calls obex_data_indication()  to read socket
 data, it first calls obex_transport_read()  to read first 3 data to
 decide message length, then calls obex_transport_read() again to read
 remaining data. But when we run obex over l2cap, you can find the
 second obex_transport_read() return zero.

Same for USB, so what? Just put your whole packet into rx_msg on the  
first read! That's exactly what USB does!

HS



--
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
___
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users


Re: [openobex-users] brach support obex over l2cap and SRM

2010-11-11 Thread Hendrik Sattler
Zitat von Hendrik Sattler p...@hendrik-sattler.de:

 Zitat von hui li nami.li1...@gmail.com:

 Currently when openobex calls obex_data_indication()  to read socket
 data, it first calls obex_transport_read()  to read first 3 data to
 decide message length, then calls obex_transport_read() again to read
 remaining data. But when we run obex over l2cap, you can find the
 second obex_transport_read() return zero.

 Same for USB, so what? Just put your whole packet into rx_msg on the
 first read! That's exactly what USB does!

Ok, if your transport is a custom transport, this may be difficult.  
Either you have to have to use OBEX_CustomDataFeed() or we have to  
resize the rx_msg buffer in the read() method of the custom transport  
hook like done for USB.

The last argument for a read() function just indicates how much bytes  
we need to go on, not how much you are allowed to put into the buffer.

HS



--
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
___
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users


Re: [openobex-users] brach support obex over l2cap and SRM

2010-11-09 Thread Hendrik Sattler
Zitat von hui li nami.li1...@gmail.com:

 Thans a lot for your mail. The obex15 spec says SRM shall be used for
 all multi-response operatons(PUT and GET) for the duration of the SRM
 mode. I don`t know why you think SRM only valid in PUT request and
 GET response in my branch. I handled both server and client side
 during SRM.
  For SRM PUT request ,client keeps sending request containing body  to
 server  without server response ,and server only responses at the
 first request, the last put request or abort request. For SRM GET
 request, server keeps sending responses containing body  to client
 without client other request ,and client only send first SRM GET
 request  or  abort request.
 My  brach simply assumes only client can request SRM enble firstly, if
 server receives SRM header, it responses SRM enable. On a put or get
 operation, server does not request SRM in its head initiatively.

 I will study your queue without threading later.

I will publish it (not done, yet). The idea is to make  
OBEX_HandleInput() not call obex_transport_handle_input() but a new  
function obex_work() instead which call one of the new function  
obex_(client|server)_work(). In those, it is easy to see in which  
state a response will not come and a packet has to be sent without it.  
Omitting more than one response(server) or additional requests(client)  
is easily done inline.
I will post a proposal patch this evening so everybody can comment. It  
will leave handling of all OBEX SRM headers to the application so it  
can decide if it trusts the transport enough to enable it.

What is that OBEX_MT_* stuff in your patch? Not SRM, that's clear.

HS


--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users


Re: [openobex-users] brach support obex over l2cap and SRM

2010-11-09 Thread Hendrik Sattler
Zitat von hui li nami.li1...@gmail.com:

 OBEX_MT_SEQPACKET and OBEX_MT_STREAM indicate different socket types
 ,corresponding to SOCK_SEQPACKET and SOCK_STREAM. If obex is over
 l2cap, we may would like to use  SOCK_SEQPACKET type and
 obex_data_indication() function may need to how to parse incoming
 data.

Actually not. The transport reads data from somewhere. How that is  
done is completely up to the transport. Note that you based that patch  
on 8 month old code and much happened since then.
Also note that the transport's read() function can return more bytes  
than requested, e.g. USB support always does that (it always reads a  
full packet) and custom transports always did. This is not a problem.

Where exactly is OBEX-over-L2CAP-without-RFCOMM specified? The  
bluetooth specs that I've seen so far always said that OBEX is bound  
to RFCOMM.

HS



--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users


Re: [openobex-users] brach support obex over l2cap and SRM

2010-11-09 Thread Luiz Augusto von Dentz
Hi,

On Tue, Nov 9, 2010 at 1:27 PM, Hendrik Sattler p...@hendrik-sattler.de wrote:
 Zitat von hui li nami.li1...@gmail.com:

 OBEX_MT_SEQPACKET and OBEX_MT_STREAM indicate different socket types
 ,corresponding to SOCK_SEQPACKET and SOCK_STREAM. If obex is over
 l2cap, we may would like to use  SOCK_SEQPACKET type and
 obex_data_indication() function may need to how to parse incoming
 data.

 Actually not. The transport reads data from somewhere. How that is
 done is completely up to the transport. Note that you based that patch
 on 8 month old code and much happened since then.
 Also note that the transport's read() function can return more bytes
 than requested, e.g. USB support always does that (it always reads a
 full packet) and custom transports always did. This is not a problem.
 Where exactly is OBEX-over-L2CAP-without-RFCOMM specified? The
 bluetooth specs that I've seen so far always said that OBEX is bound
 to RFCOMM.

There is a new spec which allow obex over l2cap.


-- 
Luiz Augusto von Dentz
Computer Engineer

--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users


Re: [openobex-users] brach support obex over l2cap and SRM

2010-11-08 Thread hui li
Thans a lot for your mail. The obex15 spec says SRM shall be used for
all multi-response operatons(PUT and GET) for the duration of the SRM
mode. I don`t know why you think SRM only valid in PUT request and
GET response in my branch. I handled both server and client side
during SRM.
 For SRM PUT request ,client keeps sending request containing body  to
server  without server response ,and server only responses at the
first request, the last put request or abort request. For SRM GET
request, server keeps sending responses containing body  to client
without client other request ,and client only send first SRM GET
request  or  abort request.
My  brach simply assumes only client can request SRM enble firstly, if
server receives SRM header, it responses SRM enable. On a put or get
operation, server does not request SRM in its head initiatively.

I will study your queue without threading later.

--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users


[openobex-users] brach support obex over l2cap and SRM

2010-11-07 Thread hui li
hi, all, since OBEX14 has released for a long time, I`d like to port
it on obex-data-server and openobex. What do you think about it?
As ods is closely related to blueman and openobex, the modification
will inevitably include blueman and openobex changes. Should I submit
patches in a branch? Please kindly give me your any suggestion.
Thanks.


I`ve created 3 repositories in github.com:
git://github.com/namili/blueman.git
git://github.com/namili/obex-data-server.git
git://github.com/namili/openobex.git

The 3 modified projects are based on some older version. They can be
built and run well.Currently support obex over l2cap and SRM.
I`ll port them on current version later.
Please kindly let me know if you have any question. Thank.

--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users


Re: [openobex-users] brach support obex over l2cap and SRM

2010-11-07 Thread Iain Hibbert
On Mon, 8 Nov 2010, hui li wrote:

 hi, all, since OBEX14 has released for a long time

Hi, do you have a reference for this specification?

Google finds nothing about OBEX14 except your mail..

regards,
iain

--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users