All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] android: Add possibility to start android daemon on PC in single mode
@ 2014-05-07  0:02 Lukasz Rymanowski
  2014-05-07 14:15 ` Szymon Janc
  0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Rymanowski @ 2014-05-07  0:02 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: szymon.janc, Lukasz Rymanowski

With this patch it is possible to start android daemon on PC in
BREDR or LE or BREDR/LE mode by setting system environment variable
named BLUETOOTH_MODE to appropriate value according to README.

This is useful for testing purposes.
---
 android/cutils/properties.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/android/cutils/properties.h b/android/cutils/properties.h
index 66a4a84..b9c59a5 100644
--- a/android/cutils/properties.h
+++ b/android/cutils/properties.h
@@ -29,9 +29,22 @@
 
 #define PROPERTY_VALUE_MAX 32
 
+#define BLUETOOTH_MODE_PROPERTY_NAME "persist.sys.bluetooth.mode"
+
 static inline int property_get(const char *key, char *value,
 						const char *default_value)
 {
+	if (!strcmp(key, BLUETOOTH_MODE_PROPERTY_NAME)) {
+		char *mode;
+
+		mode = getenv("BLUETOOTH_MODE");
+		if (!mode)
+			return 0;
+
+		memcpy(value, mode, strlen(mode));
+		return 1;
+	}
+
 	return 0;
 }
 
-- 
1.8.4


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

* Re: [PATCH] android: Add possibility to start android daemon on PC in single mode
  2014-05-07  0:02 [PATCH] android: Add possibility to start android daemon on PC in single mode Lukasz Rymanowski
@ 2014-05-07 14:15 ` Szymon Janc
  0 siblings, 0 replies; 2+ messages in thread
From: Szymon Janc @ 2014-05-07 14:15 UTC (permalink / raw)
  To: Lukasz Rymanowski; +Cc: linux-bluetooth

Hi Łukasz,

On Wednesday 07 of May 2014 02:02:14 Lukasz Rymanowski wrote:
> With this patch it is possible to start android daemon on PC in
> BREDR or LE or BREDR/LE mode by setting system environment variable
> named BLUETOOTH_MODE to appropriate value according to README.
> 
> This is useful for testing purposes.
> ---
>  android/cutils/properties.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/android/cutils/properties.h b/android/cutils/properties.h
> index 66a4a84..b9c59a5 100644
> --- a/android/cutils/properties.h
> +++ b/android/cutils/properties.h
> @@ -29,9 +29,22 @@
>  
>  #define PROPERTY_VALUE_MAX 32
>  
> +#define BLUETOOTH_MODE_PROPERTY_NAME "persist.sys.bluetooth.mode"
> +
>  static inline int property_get(const char *key, char *value,
>  						const char *default_value)
>  {
> +	if (!strcmp(key, BLUETOOTH_MODE_PROPERTY_NAME)) {
> +		char *mode;
> +
> +		mode = getenv("BLUETOOTH_MODE");
> +		if (!mode)
> +			return 0;
> +
> +		memcpy(value, mode, strlen(mode));
> +		return 1;
> +	}
> +
>  	return 0;
>  }
>  
> 

Pushed with changes we discussed offline, thanks.

-- 
Best regards, 
Szymon Janc

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

end of thread, other threads:[~2014-05-07 14:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-07  0:02 [PATCH] android: Add possibility to start android daemon on PC in single mode Lukasz Rymanowski
2014-05-07 14:15 ` Szymon Janc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.