linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] android/hal-pan: Update control_state callback to Android 5 API
@ 2014-11-07  7:46 Szymon Janc
  2014-11-07  9:09 ` Ravi kumar Veeramally
  2014-11-07 12:28 ` Szymon Janc
  0 siblings, 2 replies; 5+ messages in thread
From: Szymon Janc @ 2014-11-07  7:46 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Callback declaration was changed in Android 5 so parameters order must
be updated. Android Framework was also updated so we don't need
workaround for it in Android 5.
---
 android/hal-pan.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/android/hal-pan.c b/android/hal-pan.c
index d9e042a..56fd340 100644
--- a/android/hal-pan.c
+++ b/android/hal-pan.c
@@ -19,6 +19,7 @@
 #include <stddef.h>
 #include <string.h>
 
+#include "hal-utils.h"
 #include "hal-log.h"
 #include "hal.h"
 #include "hal-msg.h"
@@ -45,19 +46,25 @@ static void handle_ctrl_state(void *buf, uint16_t len, int fd)
 {
 	struct hal_ev_pan_ctrl_state *ev = buf;
 
+#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
+	if (cbs->control_state_cb)
+		cbs->control_state_cb(ev->state, ev->local_role, ev->status,
+							(char *)ev->name);
+#else
 	/*
-	 * FIXME: Callback declared in bt_pan.h is 'typedef void
+	 * Callback declared in bt_pan.h is 'typedef void
 	 * (*btpan_control_state_callback)(btpan_control_state_t state,
 	 * bt_status_t error, int local_role, const char* ifname);
 	 * But PanService.Java defined it wrong way.
 	 * private void onControlStateChanged(int local_role, int state,
 	 * int error, String ifname).
 	 * First and third parameters are misplaced, so sending data according
-	 * to PanService.Java, fix this if issue fixed in PanService.Java.
+	 * to PanService.Java.
 	 */
 	if (cbs->control_state_cb)
 		cbs->control_state_cb(ev->local_role, ev->state, ev->status,
 							(char *)ev->name);
+#endif
 }
 
 /*
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] android/hal-pan: Update control_state callback to Android 5 API
  2014-11-07  7:46 [PATCH] android/hal-pan: Update control_state callback to Android 5 API Szymon Janc
@ 2014-11-07  9:09 ` Ravi kumar Veeramally
  2014-11-07  9:17   ` Szymon Janc
  2014-11-07 12:28 ` Szymon Janc
  1 sibling, 1 reply; 5+ messages in thread
From: Ravi kumar Veeramally @ 2014-11-07  9:09 UTC (permalink / raw)
  To: Szymon Janc, linux-bluetooth

Hi Szymon,

On 11/07/2014 09:46 AM, Szymon Janc wrote:
> Callback declaration was changed in Android 5 so parameters order must
> be updated. Android Framework was also updated so we don't need
> workaround for it in Android 5.
> ---
>   android/hal-pan.c | 11 +++++++++--
>   1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/android/hal-pan.c b/android/hal-pan.c
> index d9e042a..56fd340 100644
> --- a/android/hal-pan.c
> +++ b/android/hal-pan.c
> @@ -19,6 +19,7 @@
>   #include <stddef.h>
>   #include <string.h>
>   
> +#include "hal-utils.h"
>   #include "hal-log.h"
>   #include "hal.h"
>   #include "hal-msg.h"
> @@ -45,19 +46,25 @@ static void handle_ctrl_state(void *buf, uint16_t len, int fd)
>   {
>   	struct hal_ev_pan_ctrl_state *ev = buf;
>   
> +#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
> +	if (cbs->control_state_cb)
> +		cbs->control_state_cb(ev->state, ev->local_role, ev->status,
> +							(char *)ev->name);
> +#else
>   	/*
> -	 * FIXME: Callback declared in bt_pan.h is 'typedef void
> +	 * Callback declared in bt_pan.h is 'typedef void
>   	 * (*btpan_control_state_callback)(btpan_control_state_t state,
>   	 * bt_status_t error, int local_role, const char* ifname);
>   	 * But PanService.Java defined it wrong way.
>   	 * private void onControlStateChanged(int local_role, int state,
>   	 * int error, String ifname).
>   	 * First and third parameters are misplaced, so sending data according
> -	 * to PanService.Java, fix this if issue fixed in PanService.Java.
> +	 * to PanService.Java.
>   	 */
>   	if (cbs->control_state_cb)
>   		cbs->control_state_cb(ev->local_role, ev->state, ev->status,
>   							(char *)ev->name);
> +#endif
>   }
>   
>   /*

Have you verified E2E and android-tester also after updating this. E2E 
tests might brake.

Regards,
Ravi.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] android/hal-pan: Update control_state callback to Android 5 API
  2014-11-07  9:09 ` Ravi kumar Veeramally
@ 2014-11-07  9:17   ` Szymon Janc
  2014-11-07  9:29     ` Ravi kumar Veeramally
  0 siblings, 1 reply; 5+ messages in thread
From: Szymon Janc @ 2014-11-07  9:17 UTC (permalink / raw)
  To: Ravi kumar Veeramally; +Cc: linux-bluetooth

Hi Ravi,

On Friday 07 of November 2014 11:09:54 Ravi kumar Veeramally wrote:
> Hi Szymon,
> 
> On 11/07/2014 09:46 AM, Szymon Janc wrote:
> > Callback declaration was changed in Android 5 so parameters order must
> > be updated. Android Framework was also updated so we don't need
> > workaround for it in Android 5.
> > ---
> >   android/hal-pan.c | 11 +++++++++--
> >   1 file changed, 9 insertions(+), 2 deletions(-)
> >
> > diff --git a/android/hal-pan.c b/android/hal-pan.c
> > index d9e042a..56fd340 100644
> > --- a/android/hal-pan.c
> > +++ b/android/hal-pan.c
> > @@ -19,6 +19,7 @@
> >   #include <stddef.h>
> >   #include <string.h>
> >   
> > +#include "hal-utils.h"
> >   #include "hal-log.h"
> >   #include "hal.h"
> >   #include "hal-msg.h"
> > @@ -45,19 +46,25 @@ static void handle_ctrl_state(void *buf, uint16_t len, int fd)
> >   {
> >   	struct hal_ev_pan_ctrl_state *ev = buf;
> >   
> > +#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
> > +	if (cbs->control_state_cb)
> > +		cbs->control_state_cb(ev->state, ev->local_role, ev->status,
> > +							(char *)ev->name);
> > +#else
> >   	/*
> > -	 * FIXME: Callback declared in bt_pan.h is 'typedef void
> > +	 * Callback declared in bt_pan.h is 'typedef void
> >   	 * (*btpan_control_state_callback)(btpan_control_state_t state,
> >   	 * bt_status_t error, int local_role, const char* ifname);
> >   	 * But PanService.Java defined it wrong way.
> >   	 * private void onControlStateChanged(int local_role, int state,
> >   	 * int error, String ifname).
> >   	 * First and third parameters are misplaced, so sending data according
> > -	 * to PanService.Java, fix this if issue fixed in PanService.Java.
> > +	 * to PanService.Java.
> >   	 */
> >   	if (cbs->control_state_cb)
> >   		cbs->control_state_cb(ev->local_role, ev->state, ev->status,
> >   							(char *)ev->name);
> > +#endif
> >   }
> >   
> >   /*
> 
> Have you verified E2E and android-tester also after updating this. E2E 
> tests might brake.

For KK this works as expected, once we switch to L headers E2E tester will be
updated to reflect this change.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] android/hal-pan: Update control_state callback to Android 5 API
  2014-11-07  9:17   ` Szymon Janc
@ 2014-11-07  9:29     ` Ravi kumar Veeramally
  0 siblings, 0 replies; 5+ messages in thread
From: Ravi kumar Veeramally @ 2014-11-07  9:29 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth


On 11/07/2014 11:17 AM, Szymon Janc wrote:
> Hi Ravi,
>
> On Friday 07 of November 2014 11:09:54 Ravi kumar Veeramally wrote:
>> Hi Szymon,
>>
>> On 11/07/2014 09:46 AM, Szymon Janc wrote:
>>> Callback declaration was changed in Android 5 so parameters order must
>>> be updated. Android Framework was also updated so we don't need
>>> workaround for it in Android 5.
>>> ---
>>>    android/hal-pan.c | 11 +++++++++--
>>>    1 file changed, 9 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/android/hal-pan.c b/android/hal-pan.c
>>> index d9e042a..56fd340 100644
>>> --- a/android/hal-pan.c
>>> +++ b/android/hal-pan.c
>>> @@ -19,6 +19,7 @@
>>>    #include <stddef.h>
>>>    #include <string.h>
>>>    
>>> +#include "hal-utils.h"
>>>    #include "hal-log.h"
>>>    #include "hal.h"
>>>    #include "hal-msg.h"
>>> @@ -45,19 +46,25 @@ static void handle_ctrl_state(void *buf, uint16_t len, int fd)
>>>    {
>>>    	struct hal_ev_pan_ctrl_state *ev = buf;
>>>    
>>> +#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
>>> +	if (cbs->control_state_cb)
>>> +		cbs->control_state_cb(ev->state, ev->local_role, ev->status,
>>> +							(char *)ev->name);
>>> +#else
>>>    	/*
>>> -	 * FIXME: Callback declared in bt_pan.h is 'typedef void
>>> +	 * Callback declared in bt_pan.h is 'typedef void
>>>    	 * (*btpan_control_state_callback)(btpan_control_state_t state,
>>>    	 * bt_status_t error, int local_role, const char* ifname);
>>>    	 * But PanService.Java defined it wrong way.
>>>    	 * private void onControlStateChanged(int local_role, int state,
>>>    	 * int error, String ifname).
>>>    	 * First and third parameters are misplaced, so sending data according
>>> -	 * to PanService.Java, fix this if issue fixed in PanService.Java.
>>> +	 * to PanService.Java.
>>>    	 */
>>>    	if (cbs->control_state_cb)
>>>    		cbs->control_state_cb(ev->local_role, ev->state, ev->status,
>>>    							(char *)ev->name);
>>> +#endif
>>>    }
>>>    
>>>    /*
>> Have you verified E2E and android-tester also after updating this. E2E
>> tests might brake.
> For KK this works as expected, once we switch to L headers E2E tester will be
> updated to reflect this change.
>
Ok.

Ravi.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] android/hal-pan: Update control_state callback to Android 5 API
  2014-11-07  7:46 [PATCH] android/hal-pan: Update control_state callback to Android 5 API Szymon Janc
  2014-11-07  9:09 ` Ravi kumar Veeramally
@ 2014-11-07 12:28 ` Szymon Janc
  1 sibling, 0 replies; 5+ messages in thread
From: Szymon Janc @ 2014-11-07 12:28 UTC (permalink / raw)
  To: linux-bluetooth

On Friday 07 of November 2014 08:46:20 Szymon Janc wrote:
> Callback declaration was changed in Android 5 so parameters order must
> be updated. Android Framework was also updated so we don't need
> workaround for it in Android 5.
> ---
>  android/hal-pan.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/android/hal-pan.c b/android/hal-pan.c
> index d9e042a..56fd340 100644
> --- a/android/hal-pan.c
> +++ b/android/hal-pan.c
> @@ -19,6 +19,7 @@
>  #include <stddef.h>
>  #include <string.h>
>  
> +#include "hal-utils.h"
>  #include "hal-log.h"
>  #include "hal.h"
>  #include "hal-msg.h"
> @@ -45,19 +46,25 @@ static void handle_ctrl_state(void *buf, uint16_t len, int fd)
>  {
>  	struct hal_ev_pan_ctrl_state *ev = buf;
>  
> +#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
> +	if (cbs->control_state_cb)
> +		cbs->control_state_cb(ev->state, ev->local_role, ev->status,
> +							(char *)ev->name);
> +#else
>  	/*
> -	 * FIXME: Callback declared in bt_pan.h is 'typedef void
> +	 * Callback declared in bt_pan.h is 'typedef void
>  	 * (*btpan_control_state_callback)(btpan_control_state_t state,
>  	 * bt_status_t error, int local_role, const char* ifname);
>  	 * But PanService.Java defined it wrong way.
>  	 * private void onControlStateChanged(int local_role, int state,
>  	 * int error, String ifname).
>  	 * First and third parameters are misplaced, so sending data according
> -	 * to PanService.Java, fix this if issue fixed in PanService.Java.
> +	 * to PanService.Java.
>  	 */
>  	if (cbs->control_state_cb)
>  		cbs->control_state_cb(ev->local_role, ev->state, ev->status,
>  							(char *)ev->name);
> +#endif
>  }
>  
>  /*

Pushed.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-07 12:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-07  7:46 [PATCH] android/hal-pan: Update control_state callback to Android 5 API Szymon Janc
2014-11-07  9:09 ` Ravi kumar Veeramally
2014-11-07  9:17   ` Szymon Janc
2014-11-07  9:29     ` Ravi kumar Veeramally
2014-11-07 12:28 ` Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).