* [PATCH v5 04/16] sbc: add odd member variable to sbc_encoder_state
From: Frédéric Dalleau @ 2012-12-14 15:03 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Frédéric Dalleau
In-Reply-To: <1355497417-10357-1-git-send-email-frederic.dalleau@linux.intel.com>
---
sbc/sbc_primitives.c | 2 ++
sbc/sbc_primitives.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/sbc/sbc_primitives.c b/sbc/sbc_primitives.c
index dce0ed2..0b48ddb 100644
--- a/sbc/sbc_primitives.c
+++ b/sbc/sbc_primitives.c
@@ -521,6 +521,8 @@ static int sbc_calc_scalefactors_j(
*/
void sbc_init_primitives(struct sbc_encoder_state *state)
{
+ state->odd = 1;
+
/* Default implementation for analyze functions */
state->sbc_analyze_4s = sbc_analyze_4b_4s_simd;
state->sbc_analyze_8s = sbc_analyze_4b_8s_simd;
diff --git a/sbc/sbc_primitives.h b/sbc/sbc_primitives.h
index 267c277..ffee339 100644
--- a/sbc/sbc_primitives.h
+++ b/sbc/sbc_primitives.h
@@ -40,6 +40,7 @@ struct sbc_encoder_state {
int position;
/* Number of consecutive blocks handled by the encoder */
int increment;
+ int odd;
int16_t SBC_ALIGNED X[2][SBC_X_BUFFER_SIZE];
/* Polyphase analysis filter for 4 subbands configuration,
* it handles "increment" blocks at once */
--
1.7.9.5
^ permalink raw reply related
* [PATCH v5 03/16] sbc: Rename sbc_analyze_4b_xx to sbc_analyze_xx
From: Frédéric Dalleau @ 2012-12-14 15:03 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Frédéric Dalleau
In-Reply-To: <1355497417-10357-1-git-send-email-frederic.dalleau@linux.intel.com>
---
sbc/sbc.c | 4 ++--
sbc/sbc_primitives.c | 4 ++--
sbc/sbc_primitives.h | 4 ++--
sbc/sbc_primitives_armv6.c | 4 ++--
sbc/sbc_primitives_iwmmxt.c | 4 ++--
sbc/sbc_primitives_mmx.c | 4 ++--
sbc/sbc_primitives_neon.c | 4 ++--
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/sbc/sbc.c b/sbc/sbc.c
index 4a7dd2e..ffdf05d 100644
--- a/sbc/sbc.c
+++ b/sbc/sbc.c
@@ -692,7 +692,7 @@ static int sbc_analyze_audio(struct sbc_encoder_state *state,
state->increment + frame->blocks * 4];
for (blk = 0; blk < frame->blocks;
blk += state->increment) {
- state->sbc_analyze_4b_4s(
+ state->sbc_analyze_4s(
state, x,
frame->sb_sample_f[blk][ch],
frame->sb_sample_f[blk + 1][ch] -
@@ -708,7 +708,7 @@ static int sbc_analyze_audio(struct sbc_encoder_state *state,
state->increment + frame->blocks * 8];
for (blk = 0; blk < frame->blocks;
blk += state->increment) {
- state->sbc_analyze_4b_8s(
+ state->sbc_analyze_8s(
state, x,
frame->sb_sample_f[blk][ch],
frame->sb_sample_f[blk + 1][ch] -
diff --git a/sbc/sbc_primitives.c b/sbc/sbc_primitives.c
index f8cc4b6..dce0ed2 100644
--- a/sbc/sbc_primitives.c
+++ b/sbc/sbc_primitives.c
@@ -522,8 +522,8 @@ static int sbc_calc_scalefactors_j(
void sbc_init_primitives(struct sbc_encoder_state *state)
{
/* Default implementation for analyze functions */
- state->sbc_analyze_4b_4s = sbc_analyze_4b_4s_simd;
- state->sbc_analyze_4b_8s = sbc_analyze_4b_8s_simd;
+ state->sbc_analyze_4s = sbc_analyze_4b_4s_simd;
+ state->sbc_analyze_8s = sbc_analyze_4b_8s_simd;
/* Default implementation for input reordering / deinterleaving */
state->sbc_enc_process_input_4s_le = sbc_enc_process_input_4s_le;
diff --git a/sbc/sbc_primitives.h b/sbc/sbc_primitives.h
index 2a7d4a1..267c277 100644
--- a/sbc/sbc_primitives.h
+++ b/sbc/sbc_primitives.h
@@ -43,11 +43,11 @@ struct sbc_encoder_state {
int16_t SBC_ALIGNED X[2][SBC_X_BUFFER_SIZE];
/* Polyphase analysis filter for 4 subbands configuration,
* it handles "increment" blocks at once */
- void (*sbc_analyze_4b_4s)(struct sbc_encoder_state *state,
+ void (*sbc_analyze_4s)(struct sbc_encoder_state *state,
int16_t *x, int32_t *out, int out_stride);
/* Polyphase analysis filter for 8 subbands configuration,
* it handles "increment" blocks at once */
- void (*sbc_analyze_4b_8s)(struct sbc_encoder_state *state,
+ void (*sbc_analyze_8s)(struct sbc_encoder_state *state,
int16_t *x, int32_t *out, int out_stride);
/* Process input data (deinterleave, endian conversion, reordering),
* depending on the number of subbands and input data byte order */
diff --git a/sbc/sbc_primitives_armv6.c b/sbc/sbc_primitives_armv6.c
index 6ad94c6..068648a 100644
--- a/sbc/sbc_primitives_armv6.c
+++ b/sbc/sbc_primitives_armv6.c
@@ -293,8 +293,8 @@ static void sbc_analyze_4b_8s_armv6(struct sbc_encoder_state *state,
void sbc_init_primitives_armv6(struct sbc_encoder_state *state)
{
- state->sbc_analyze_4b_4s = sbc_analyze_4b_4s_armv6;
- state->sbc_analyze_4b_8s = sbc_analyze_4b_8s_armv6;
+ state->sbc_analyze_4s = sbc_analyze_4b_4s_armv6;
+ state->sbc_analyze_8s = sbc_analyze_4b_8s_armv6;
state->implementation_info = "ARMv6 SIMD";
}
diff --git a/sbc/sbc_primitives_iwmmxt.c b/sbc/sbc_primitives_iwmmxt.c
index 39cc390..0c8f329 100644
--- a/sbc/sbc_primitives_iwmmxt.c
+++ b/sbc/sbc_primitives_iwmmxt.c
@@ -296,8 +296,8 @@ static inline void sbc_analyze_4b_8s_iwmmxt(struct sbc_encoder_state *state,
void sbc_init_primitives_iwmmxt(struct sbc_encoder_state *state)
{
- state->sbc_analyze_4b_4s = sbc_analyze_4b_4s_iwmmxt;
- state->sbc_analyze_4b_8s = sbc_analyze_4b_8s_iwmmxt;
+ state->sbc_analyze_4s = sbc_analyze_4b_4s_iwmmxt;
+ state->sbc_analyze_8s = sbc_analyze_4b_8s_iwmmxt;
state->implementation_info = "IWMMXT";
}
diff --git a/sbc/sbc_primitives_mmx.c b/sbc/sbc_primitives_mmx.c
index cbacb4e..03070f5 100644
--- a/sbc/sbc_primitives_mmx.c
+++ b/sbc/sbc_primitives_mmx.c
@@ -365,8 +365,8 @@ static int check_mmx_support(void)
void sbc_init_primitives_mmx(struct sbc_encoder_state *state)
{
if (check_mmx_support()) {
- state->sbc_analyze_4b_4s = sbc_analyze_4b_4s_mmx;
- state->sbc_analyze_4b_8s = sbc_analyze_4b_8s_mmx;
+ state->sbc_analyze_4s = sbc_analyze_4b_4s_mmx;
+ state->sbc_analyze_8s = sbc_analyze_4b_8s_mmx;
state->sbc_calc_scalefactors = sbc_calc_scalefactors_mmx;
state->implementation_info = "MMX";
}
diff --git a/sbc/sbc_primitives_neon.c b/sbc/sbc_primitives_neon.c
index aeca8df..eda4ed3 100644
--- a/sbc/sbc_primitives_neon.c
+++ b/sbc/sbc_primitives_neon.c
@@ -879,8 +879,8 @@ static int sbc_enc_process_input_8s_le_neon(int position, const uint8_t *pcm,
void sbc_init_primitives_neon(struct sbc_encoder_state *state)
{
- state->sbc_analyze_4b_4s = sbc_analyze_4b_4s_neon;
- state->sbc_analyze_4b_8s = sbc_analyze_4b_8s_neon;
+ state->sbc_analyze_4s = sbc_analyze_4b_4s_neon;
+ state->sbc_analyze_8s = sbc_analyze_4b_8s_neon;
state->sbc_calc_scalefactors = sbc_calc_scalefactors_neon;
state->sbc_calc_scalefactors_j = sbc_calc_scalefactors_j_neon;
state->sbc_enc_process_input_4s_le = sbc_enc_process_input_4s_le_neon;
--
1.7.9.5
^ permalink raw reply related
* [PATCH v5 02/16] sbc: Break 4 blocks processing to variable steps
From: Frédéric Dalleau @ 2012-12-14 15:03 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Frédéric Dalleau
In-Reply-To: <1355497417-10357-1-git-send-email-frederic.dalleau@linux.intel.com>
Until now SBC processed 4 blocks at a time. If we want to process 15 blocks,
then we need to break this processing in one block steps. 4 blocks is still
default increment.
---
sbc/sbc.c | 19 +++++++++++--------
sbc/sbc_primitives.h | 6 ++++--
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/sbc/sbc.c b/sbc/sbc.c
index e51ed57..4a7dd2e 100644
--- a/sbc/sbc.c
+++ b/sbc/sbc.c
@@ -688,30 +688,32 @@ static int sbc_analyze_audio(struct sbc_encoder_state *state,
switch (frame->subbands) {
case 4:
for (ch = 0; ch < frame->channels; ch++) {
- x = &state->X[ch][state->position - 16 +
- frame->blocks * 4];
- for (blk = 0; blk < frame->blocks; blk += 4) {
+ x = &state->X[ch][state->position - 4 *
+ state->increment + frame->blocks * 4];
+ for (blk = 0; blk < frame->blocks;
+ blk += state->increment) {
state->sbc_analyze_4b_4s(
state, x,
frame->sb_sample_f[blk][ch],
frame->sb_sample_f[blk + 1][ch] -
frame->sb_sample_f[blk][ch]);
- x -= 16;
+ x -= 4 * state->increment;
}
}
return frame->blocks * 4;
case 8:
for (ch = 0; ch < frame->channels; ch++) {
- x = &state->X[ch][state->position - 32 +
- frame->blocks * 8];
- for (blk = 0; blk < frame->blocks; blk += 4) {
+ x = &state->X[ch][state->position - 8 *
+ state->increment + frame->blocks * 8];
+ for (blk = 0; blk < frame->blocks;
+ blk += state->increment) {
state->sbc_analyze_4b_8s(
state, x,
frame->sb_sample_f[blk][ch],
frame->sb_sample_f[blk + 1][ch] -
frame->sb_sample_f[blk][ch]);
- x -= 32;
+ x -= 8 * state->increment;
}
}
return frame->blocks * 8;
@@ -906,6 +908,7 @@ static void sbc_encoder_init(struct sbc_encoder_state *state,
{
memset(&state->X, 0, sizeof(state->X));
state->position = (SBC_X_BUFFER_SIZE - frame->subbands * 9) & ~7;
+ state->increment = 4;
sbc_init_primitives(state);
}
diff --git a/sbc/sbc_primitives.h b/sbc/sbc_primitives.h
index a7bbef1..2a7d4a1 100644
--- a/sbc/sbc_primitives.h
+++ b/sbc/sbc_primitives.h
@@ -38,13 +38,15 @@
struct sbc_encoder_state {
int position;
+ /* Number of consecutive blocks handled by the encoder */
+ int increment;
int16_t SBC_ALIGNED X[2][SBC_X_BUFFER_SIZE];
/* Polyphase analysis filter for 4 subbands configuration,
- * it handles 4 blocks at once */
+ * it handles "increment" blocks at once */
void (*sbc_analyze_4b_4s)(struct sbc_encoder_state *state,
int16_t *x, int32_t *out, int out_stride);
/* Polyphase analysis filter for 8 subbands configuration,
- * it handles 4 blocks at once */
+ * it handles "increment" blocks at once */
void (*sbc_analyze_4b_8s)(struct sbc_encoder_state *state,
int16_t *x, int32_t *out, int out_stride);
/* Process input data (deinterleave, endian conversion, reordering),
--
1.7.9.5
^ permalink raw reply related
* [PATCH v5 01/16] sbc: Add encoder_state to analysis functions
From: Frédéric Dalleau @ 2012-12-14 15:03 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Frédéric Dalleau
In-Reply-To: <1355497417-10357-1-git-send-email-frederic.dalleau@linux.intel.com>
Until now, SIMD analysis used to process 4 blocks of 8 samples at a time. This
was implemented using two constant tables: odd and even. This mean we can only
process 4, 8, 12, or 16 blocks par SBC packets.
mSBC requires 15 blocks, so to be able to analyse 1 block, it will be necessary
to know if we are processing an odd or even block. This will be done with a
new member to encoder_state.
---
sbc/sbc.c | 4 ++--
sbc/sbc_primitives.c | 8 ++++----
sbc/sbc_primitives.h | 6 ++++--
sbc/sbc_primitives_armv6.c | 6 ++++--
sbc/sbc_primitives_iwmmxt.c | 8 ++++----
sbc/sbc_primitives_mmx.c | 8 ++++----
sbc/sbc_primitives_neon.c | 8 ++++----
7 files changed, 26 insertions(+), 22 deletions(-)
diff --git a/sbc/sbc.c b/sbc/sbc.c
index f0c77c7..e51ed57 100644
--- a/sbc/sbc.c
+++ b/sbc/sbc.c
@@ -692,7 +692,7 @@ static int sbc_analyze_audio(struct sbc_encoder_state *state,
frame->blocks * 4];
for (blk = 0; blk < frame->blocks; blk += 4) {
state->sbc_analyze_4b_4s(
- x,
+ state, x,
frame->sb_sample_f[blk][ch],
frame->sb_sample_f[blk + 1][ch] -
frame->sb_sample_f[blk][ch]);
@@ -707,7 +707,7 @@ static int sbc_analyze_audio(struct sbc_encoder_state *state,
frame->blocks * 8];
for (blk = 0; blk < frame->blocks; blk += 4) {
state->sbc_analyze_4b_8s(
- x,
+ state, x,
frame->sb_sample_f[blk][ch],
frame->sb_sample_f[blk + 1][ch] -
frame->sb_sample_f[blk][ch]);
diff --git a/sbc/sbc_primitives.c b/sbc/sbc_primitives.c
index ad780d0..f8cc4b6 100644
--- a/sbc/sbc_primitives.c
+++ b/sbc/sbc_primitives.c
@@ -183,8 +183,8 @@ static inline void sbc_analyze_eight_simd(const int16_t *in, int32_t *out,
(SBC_COS_TABLE_FIXED8_SCALE - SCALE_OUT_BITS);
}
-static inline void sbc_analyze_4b_4s_simd(int16_t *x,
- int32_t *out, int out_stride)
+static inline void sbc_analyze_4b_4s_simd(struct sbc_encoder_state *state,
+ int16_t *x, int32_t *out, int out_stride)
{
/* Analyze blocks */
sbc_analyze_four_simd(x + 12, out, analysis_consts_fixed4_simd_odd);
@@ -196,8 +196,8 @@ static inline void sbc_analyze_4b_4s_simd(int16_t *x,
sbc_analyze_four_simd(x + 0, out, analysis_consts_fixed4_simd_even);
}
-static inline void sbc_analyze_4b_8s_simd(int16_t *x,
- int32_t *out, int out_stride)
+static inline void sbc_analyze_4b_8s_simd(struct sbc_encoder_state *state,
+ int16_t *x, int32_t *out, int out_stride)
{
/* Analyze blocks */
sbc_analyze_eight_simd(x + 24, out, analysis_consts_fixed8_simd_odd);
diff --git a/sbc/sbc_primitives.h b/sbc/sbc_primitives.h
index 17ad4f7..a7bbef1 100644
--- a/sbc/sbc_primitives.h
+++ b/sbc/sbc_primitives.h
@@ -41,10 +41,12 @@ struct sbc_encoder_state {
int16_t SBC_ALIGNED X[2][SBC_X_BUFFER_SIZE];
/* Polyphase analysis filter for 4 subbands configuration,
* it handles 4 blocks at once */
- void (*sbc_analyze_4b_4s)(int16_t *x, int32_t *out, int out_stride);
+ void (*sbc_analyze_4b_4s)(struct sbc_encoder_state *state,
+ int16_t *x, int32_t *out, int out_stride);
/* Polyphase analysis filter for 8 subbands configuration,
* it handles 4 blocks at once */
- void (*sbc_analyze_4b_8s)(int16_t *x, int32_t *out, int out_stride);
+ void (*sbc_analyze_4b_8s)(struct sbc_encoder_state *state,
+ int16_t *x, int32_t *out, int out_stride);
/* Process input data (deinterleave, endian conversion, reordering),
* depending on the number of subbands and input data byte order */
int (*sbc_enc_process_input_4s_le)(int position,
diff --git a/sbc/sbc_primitives_armv6.c b/sbc/sbc_primitives_armv6.c
index b321272..6ad94c6 100644
--- a/sbc/sbc_primitives_armv6.c
+++ b/sbc/sbc_primitives_armv6.c
@@ -265,7 +265,8 @@ static void __attribute__((naked)) sbc_analyze_eight_armv6()
((void (*)(int16_t *, int32_t *, const FIXED_T*)) \
sbc_analyze_eight_armv6)((in), (out), (consts))
-static void sbc_analyze_4b_4s_armv6(int16_t *x, int32_t *out, int out_stride)
+static void sbc_analyze_4b_4s_armv6(struct sbc_encoder_state *state,
+ int16_t *x, int32_t *out, int out_stride)
{
/* Analyze blocks */
sbc_analyze_four(x + 12, out, analysis_consts_fixed4_simd_odd);
@@ -277,7 +278,8 @@ static void sbc_analyze_4b_4s_armv6(int16_t *x, int32_t *out, int out_stride)
sbc_analyze_four(x + 0, out, analysis_consts_fixed4_simd_even);
}
-static void sbc_analyze_4b_8s_armv6(int16_t *x, int32_t *out, int out_stride)
+static void sbc_analyze_4b_8s_armv6(struct sbc_encoder_state *state,
+ int16_t *x, int32_t *out, int out_stride)
{
/* Analyze blocks */
sbc_analyze_eight(x + 24, out, analysis_consts_fixed8_simd_odd);
diff --git a/sbc/sbc_primitives_iwmmxt.c b/sbc/sbc_primitives_iwmmxt.c
index e0bd060..39cc390 100644
--- a/sbc/sbc_primitives_iwmmxt.c
+++ b/sbc/sbc_primitives_iwmmxt.c
@@ -268,8 +268,8 @@ static inline void sbc_analyze_eight_iwmmxt(const int16_t *in, int32_t *out,
"wcgr0", "memory");
}
-static inline void sbc_analyze_4b_4s_iwmmxt(int16_t *x, int32_t *out,
- int out_stride)
+static inline void sbc_analyze_4b_4s_iwmmxt(struct sbc_encoder_state *state,
+ int16_t *x, int32_t *out, int out_stride)
{
/* Analyze blocks */
sbc_analyze_four_iwmmxt(x + 12, out, analysis_consts_fixed4_simd_odd);
@@ -281,8 +281,8 @@ static inline void sbc_analyze_4b_4s_iwmmxt(int16_t *x, int32_t *out,
sbc_analyze_four_iwmmxt(x + 0, out, analysis_consts_fixed4_simd_even);
}
-static inline void sbc_analyze_4b_8s_iwmmxt(int16_t *x, int32_t *out,
- int out_stride)
+static inline void sbc_analyze_4b_8s_iwmmxt(struct sbc_encoder_state *state,
+ int16_t *x, int32_t *out, int out_stride)
{
/* Analyze blocks */
sbc_analyze_eight_iwmmxt(x + 24, out, analysis_consts_fixed8_simd_odd);
diff --git a/sbc/sbc_primitives_mmx.c b/sbc/sbc_primitives_mmx.c
index 27e9a56..cbacb4e 100644
--- a/sbc/sbc_primitives_mmx.c
+++ b/sbc/sbc_primitives_mmx.c
@@ -246,8 +246,8 @@ static inline void sbc_analyze_eight_mmx(const int16_t *in, int32_t *out,
: "cc", "memory");
}
-static inline void sbc_analyze_4b_4s_mmx(int16_t *x, int32_t *out,
- int out_stride)
+static inline void sbc_analyze_4b_4s_mmx(struct sbc_encoder_state *state,
+ int16_t *x, int32_t *out, int out_stride)
{
/* Analyze blocks */
sbc_analyze_four_mmx(x + 12, out, analysis_consts_fixed4_simd_odd);
@@ -261,8 +261,8 @@ static inline void sbc_analyze_4b_4s_mmx(int16_t *x, int32_t *out,
__asm__ volatile ("emms\n");
}
-static inline void sbc_analyze_4b_8s_mmx(int16_t *x, int32_t *out,
- int out_stride)
+static inline void sbc_analyze_4b_8s_mmx(struct sbc_encoder_state *state,
+ int16_t *x, int32_t *out, int out_stride)
{
/* Analyze blocks */
sbc_analyze_eight_mmx(x + 24, out, analysis_consts_fixed8_simd_odd);
diff --git a/sbc/sbc_primitives_neon.c b/sbc/sbc_primitives_neon.c
index 5d4d0e3..aeca8df 100644
--- a/sbc/sbc_primitives_neon.c
+++ b/sbc/sbc_primitives_neon.c
@@ -211,8 +211,8 @@ static inline void _sbc_analyze_eight_neon(const int16_t *in, int32_t *out,
"d18", "d19");
}
-static inline void sbc_analyze_4b_4s_neon(int16_t *x,
- int32_t *out, int out_stride)
+static inline void sbc_analyze_4b_4s_neon(struct sbc_encoder_state *state,
+ int16_t *x, int32_t *out, int out_stride)
{
/* Analyze blocks */
_sbc_analyze_four_neon(x + 12, out, analysis_consts_fixed4_simd_odd);
@@ -224,8 +224,8 @@ static inline void sbc_analyze_4b_4s_neon(int16_t *x,
_sbc_analyze_four_neon(x + 0, out, analysis_consts_fixed4_simd_even);
}
-static inline void sbc_analyze_4b_8s_neon(int16_t *x,
- int32_t *out, int out_stride)
+static inline void sbc_analyze_4b_8s_neon(struct sbc_encoder_state *state,
+ int16_t *x, int32_t *out, int out_stride)
{
/* Analyze blocks */
_sbc_analyze_eight_neon(x + 24, out, analysis_consts_fixed8_simd_odd);
--
1.7.9.5
^ permalink raw reply related
* [PATCH v5 00/16] mSBC tests
From: Frédéric Dalleau @ 2012-12-14 15:03 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Frédéric Dalleau
Hi,
v5 shoudl fix the few remaining issues. I could test neon and armv6
and raised verbosity of commit messages.
However, before releasing a new version of the library, I believe we should
write some sort of automated testing and test against another implementation.
Siarhei shared a script some time ago, it could be a good start.
But where could we store some decent audio materials? Should we use generators
like sine wave, or just record ambient sound??
Regards,
Frederic
Frédéric Dalleau (16):
sbc: Add encoder_state to analysis functions
sbc: Break 4 blocks processing to variable steps
sbc: Rename sbc_analyze_4b_xx to sbc_analyze_xx
sbc: add odd member variable to sbc_encoder_state
sbc: Add mmx primitive for 1b 8s analysis
sbc: Add armv6 primitive for 1b 8s analysis
sbc: Add iwmmxt primitive for 1b 8s encoding
sbc: Add plain C primitive for 1b 8s analysis
sbc: Use plain C primitive if doing msbc on neon
sbc: Fix input reordering for 15 blocks case
sbc: Add SBC_MSBC flag to enable 15 block encoding
sbc: Add support for mSBC frame header
sbc: Update sbcdec for msbc
sbc: Update sbcenc for msbc
sbc: Update sbcinfo for msbc
sbc: Update copyrights
sbc/sbc.c | 289 +++++++++++++++++++++++++++----------------
sbc/sbc.h | 3 +
sbc/sbc_primitives.c | 97 +++++++++++++--
sbc/sbc_primitives.h | 14 ++-
sbc/sbc_primitives_armv6.c | 26 +++-
sbc/sbc_primitives_iwmmxt.c | 28 ++++-
sbc/sbc_primitives_mmx.c | 29 ++++-
sbc/sbc_primitives_neon.c | 12 +-
src/sbcdec.c | 18 ++-
src/sbcenc.c | 26 +++-
src/sbcinfo.c | 52 +++++---
11 files changed, 427 insertions(+), 167 deletions(-)
--
1.7.9.5
^ permalink raw reply
* [PATCH BlueZ 2/2] core: Remove unused emit_array_property_changed function
From: Lucas De Marchi @ 2012-12-14 14:13 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Lucas De Marchi
In-Reply-To: <1355494410-24627-1-git-send-email-lucas.demarchi@profusion.mobi>
---
src/dbus-common.c | 25 -------------------------
src/dbus-common.h | 5 -----
2 files changed, 30 deletions(-)
diff --git a/src/dbus-common.c b/src/dbus-common.c
index 42afa55..d466a8f 100644
--- a/src/dbus-common.c
+++ b/src/dbus-common.c
@@ -118,31 +118,6 @@ void dict_append_array(DBusMessageIter *dict, const char *key, int type,
dbus_message_iter_close_container(dict, &entry);
}
-dbus_bool_t emit_array_property_changed(const char *path,
- const char *interface,
- const char *name,
- int type, void *value, int num)
-{
- DBusMessage *signal;
- DBusMessageIter iter;
-
- signal = dbus_message_new_signal(path, interface, "PropertyChanged");
-
- if (!signal) {
- error("Unable to allocate new %s.PropertyChanged signal",
- interface);
- return FALSE;
- }
-
- dbus_message_iter_init_append(signal, &iter);
-
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &name);
-
- append_array_variant(&iter, type, value, num);
-
- return g_dbus_send_message(connection, signal);
-}
-
void set_dbus_connection(DBusConnection *conn)
{
connection = conn;
diff --git a/src/dbus-common.h b/src/dbus-common.h
index 825560d..e2ea365 100644
--- a/src/dbus-common.h
+++ b/src/dbus-common.h
@@ -29,11 +29,6 @@ void dict_append_entry(DBusMessageIter *dict,
void dict_append_array(DBusMessageIter *dict, const char *key, int type,
void *val, int n_elements);
-dbus_bool_t emit_array_property_changed(const char *path,
- const char *interface,
- const char *name,
- int type, void *value, int num);
-
void set_dbus_connection(DBusConnection *conn);
DBusConnection *btd_get_dbus_connection(void);
--
1.8.0.2
^ permalink raw reply related
* [PATCH BlueZ 1/2] core: Fix leftover signal for UUIDs property
From: Lucas De Marchi @ 2012-12-14 14:13 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Lucas De Marchi
---
src/device.c | 28 ++++++++--------------------
1 file changed, 8 insertions(+), 20 deletions(-)
diff --git a/src/device.c b/src/device.c
index 01c40a7..714fc72 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2442,23 +2442,6 @@ static void device_remove_profiles(struct btd_device *device, GSList *uuids)
}
}
-static void uuids_changed(struct btd_device *device)
-{
- char **uuids;
- GSList *l;
- int i;
-
- uuids = g_new0(char *, g_slist_length(device->uuids) + 1);
- for (i = 0, l = device->uuids; l; l = l->next, i++)
- uuids[i] = l->data;
-
- emit_array_property_changed(device->path,
- DEVICE_INTERFACE, "UUIDs",
- DBUS_TYPE_STRING, &uuids, i);
-
- g_free(uuids);
-}
-
static void store_sdp_record(GKeyFile *key_file, sdp_record_t *rec)
{
char handle_str[11];
@@ -2803,7 +2786,9 @@ static void search_cb(sdp_list_t *recs, int err, gpointer user_data)
device_remove_profiles(device, req->profiles_removed);
/* Propagate services changes */
- uuids_changed(req->device);
+ g_dbus_emit_property_changed(btd_get_dbus_connection(),
+ req->device->path, DEVICE_INTERFACE,
+ "UUIDs");
send_reply:
device_svc_resolved(device, err);
@@ -2966,7 +2951,8 @@ static void register_all_services(struct browse_req *req, GSList *services)
if (device->attios == NULL && device->attios_offline == NULL)
attio_cleanup(device);
- uuids_changed(device);
+ g_dbus_emit_property_changed(btd_get_dbus_connection(), device->path,
+ DEVICE_INTERFACE, "UUIDs");
device_svc_resolved(device, 0);
@@ -4057,7 +4043,9 @@ void btd_device_add_uuid(struct btd_device *device, const char *uuid)
g_slist_free(uuid_list);
store_device_info(device);
- uuids_changed(device);
+
+ g_dbus_emit_property_changed(btd_get_dbus_connection(), device->path,
+ DEVICE_INTERFACE, "UUIDs");
}
static sdp_list_t *read_device_records(struct btd_device *device)
--
1.8.0.2
^ permalink raw reply related
* Re: [PATCH] device: Fix memory leak in load_att_info()
From: Johan Hedberg @ 2012-12-14 11:20 UTC (permalink / raw)
To: Frédéric Danis; +Cc: linux-bluetooth
In-Reply-To: <1355478202-10022-1-git-send-email-frederic.danis@linux.intel.com>
Hi Frederic,
On Fri, Dec 14, 2012, Frédéric Danis wrote:
> ---
> src/device.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply
* Re: [PATCH BlueZ 01/13] network: Append version to Network and NetworkServer interfaces
From: Luiz Augusto von Dentz @ 2012-12-14 10:37 UTC (permalink / raw)
To: Santiago Carot; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <CACLukzKV27rWzLNo9BeNYqBxBgZ2jW_x6z4dRZbAMZBk3ehVPA@mail.gmail.com>
Hi,
On Fri, Dec 14, 2012 at 12:18 PM, Santiago Carot <sancane@gmail.com> wrote:
> Hi,
>
> 2012/12/14 Johan Hedberg <johan.hedberg@gmail.com>:
>> Hi Luiz,
>>
>> On Fri, Dec 14, 2012, Luiz Augusto von Dentz wrote:
>>> ---
>>> doc/network-api.txt | 4 ++--
>>> profiles/network/connection.c | 2 +-
>>> profiles/network/server.c | 2 +-
>>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>
>> All patches in this set have been applied. Thanks.
>>
>
> just a few comments, Wouldn't it have been better to add an
> API_VERSION macro and stick it besides each interface?, I haven't gone
> deept through each patch but it just looks like you are only adding
> the version number to each interface. In the future it could be
> annoying to have to go through all the source code to increment just
> the version number.
Each interface is independent, so if you break lets say
org.bluez.Network1 API you just change it not everything.
--
Luiz Augusto von Dentz
^ permalink raw reply
* Re: [PATCH BlueZ 01/13] network: Append version to Network and NetworkServer interfaces
From: Santiago Carot @ 2012-12-14 10:18 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <20121214092515.GA1521@x220>
Hi,
2012/12/14 Johan Hedberg <johan.hedberg@gmail.com>:
> Hi Luiz,
>
> On Fri, Dec 14, 2012, Luiz Augusto von Dentz wrote:
>> ---
>> doc/network-api.txt | 4 ++--
>> profiles/network/connection.c | 2 +-
>> profiles/network/server.c | 2 +-
>> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> All patches in this set have been applied. Thanks.
>
just a few comments, Wouldn't it have been better to add an
API_VERSION macro and stick it besides each interface?, I haven't gone
deept through each patch but it just looks like you are only adding
the version number to each interface. In the future it could be
annoying to have to go through all the source code to increment just
the version number.
Regards.
^ permalink raw reply
* [PATCH] device: Fix memory leak in load_att_info()
From: Frédéric Danis @ 2012-12-14 9:43 UTC (permalink / raw)
To: linux-bluetooth
---
src/device.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/device.c b/src/device.c
index 7bde970..bb0db30 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1903,15 +1903,18 @@ static void load_att_info(struct btd_device *device, const gchar *local,
groups = g_key_file_get_groups(key_file, NULL);
for (handle = groups; *handle; handle++) {
+ gboolean uuid_ok;
+
str = g_key_file_get_string(key_file, *handle, "UUID", NULL);
if (!str)
continue;
- if (!g_str_equal(str, prim_uuid))
- continue;
-
+ uuid_ok = g_str_equal(str, prim_uuid);
g_free(str);
+ if (!uuid_ok)
+ continue;
+
str = g_key_file_get_string(key_file, *handle, "Value", NULL);
if (!str)
continue;
@@ -1938,6 +1941,8 @@ static void load_att_info(struct btd_device *device, const gchar *local,
}
break;
default:
+ g_free(str);
+ g_free(prim);
continue;
}
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH BlueZ 01/13] network: Append version to Network and NetworkServer interfaces
From: Johan Hedberg @ 2012-12-14 9:25 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1355476387-2165-1-git-send-email-luiz.dentz@gmail.com>
Hi Luiz,
On Fri, Dec 14, 2012, Luiz Augusto von Dentz wrote:
> ---
> doc/network-api.txt | 4 ++--
> profiles/network/connection.c | 2 +-
> profiles/network/server.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
All patches in this set have been applied. Thanks.
Johan
^ permalink raw reply
* [PATCH BlueZ 13/13] core: Remove org.bluez.Watcher from bluetooth.conf
From: Luiz Augusto von Dentz @ 2012-12-14 9:13 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1355476387-2165-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This interface is not used anywhere
---
src/bluetooth.conf | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index e5da643..0495200 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -13,7 +13,6 @@
<allow send_interface="org.bluez.Agent1"/>
<allow send_interface="org.bluez.MediaEndpoint1"/>
<allow send_interface="org.bluez.MediaPlayer1"/>
- <allow send_interface="org.bluez.Watcher"/>
<allow send_interface="org.bluez.ThermometerWatcher1"/>
<allow send_interface="org.bluez.AlertAgent1"/>
<allow send_interface="org.bluez.Profile1"/>
--
1.7.11.7
^ permalink raw reply related
* [PATCH BlueZ 12/13] core: Remove another left over of HFP removal
From: Luiz Augusto von Dentz @ 2012-12-14 9:13 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1355476387-2165-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
src/bluetooth.conf | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 8dfdc77..e5da643 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -11,7 +11,6 @@
<allow own="org.bluez"/>
<allow send_destination="org.bluez"/>
<allow send_interface="org.bluez.Agent1"/>
- <allow send_interface="org.bluez.HandsfreeAgent"/>
<allow send_interface="org.bluez.MediaEndpoint1"/>
<allow send_interface="org.bluez.MediaPlayer1"/>
<allow send_interface="org.bluez.Watcher"/>
--
1.7.11.7
^ permalink raw reply related
* [PATCH BlueZ 11/13] sap: Append version to SimAccess interfaces
From: Luiz Augusto von Dentz @ 2012-12-14 9:13 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1355476387-2165-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
doc/sap-api.txt | 2 +-
profiles/sap/sap-dummy.c | 2 +-
profiles/sap/server.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/sap-api.txt b/doc/sap-api.txt
index 92bdd9e..6bd8034 100644
--- a/doc/sap-api.txt
+++ b/doc/sap-api.txt
@@ -8,7 +8,7 @@ Sim Access Profile hierarchy
============================
Service org.bluez
-Interface org.bluez.SimAccess
+Interface org.bluez.SimAccess1
Object path [variable prefix]/{hci0,hci1,...}
Methods void Disconnect()
diff --git a/profiles/sap/sap-dummy.c b/profiles/sap/sap-dummy.c
index 6c717dc..ffaf847 100644
--- a/profiles/sap/sap-dummy.c
+++ b/profiles/sap/sap-dummy.c
@@ -34,7 +34,7 @@
#include "log.h"
#include "sap.h"
-#define SAP_DUMMY_IFACE "org.bluez.SimAccessTest"
+#define SAP_DUMMY_IFACE "org.bluez.SimAccessTest1"
#define SAP_DUMMY_PATH "/org/bluez/test"
enum {
diff --git a/profiles/sap/server.c b/profiles/sap/server.c
index d075e40..01caa33 100644
--- a/profiles/sap/server.c
+++ b/profiles/sap/server.c
@@ -43,7 +43,7 @@
#include "sap.h"
#include "server.h"
-#define SAP_SERVER_INTERFACE "org.bluez.SimAccess"
+#define SAP_SERVER_INTERFACE "org.bluez.SimAccess1"
#define SAP_SERVER_CHANNEL 8
#define PADDING4(x) ((4 - ((x) & 0x03)) & 0x03)
--
1.7.11.7
^ permalink raw reply related
* [PATCH BlueZ 10/13] proximity: Append version to Proximity interfaces
From: Luiz Augusto von Dentz @ 2012-12-14 9:13 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1355476387-2165-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
doc/proximity-api.txt | 4 ++--
profiles/proximity/monitor.c | 2 +-
profiles/proximity/reporter.h | 2 +-
test/test-proximity | 15 +++++++++------
4 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/doc/proximity-api.txt b/doc/proximity-api.txt
index b68a4fe..4719428 100644
--- a/doc/proximity-api.txt
+++ b/doc/proximity-api.txt
@@ -8,7 +8,7 @@ Proximity Monitor hierarchy
===========================
Service org.bluez
-Interface org.bluez.ProximityMonitor
+Interface org.bluez.ProximityMonitor1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
Properties string SignalLevel [readonly]
@@ -40,7 +40,7 @@ Shared service used by Proximity Path Loss and Find Me. Allows per device
alert level handling.
Service org.bluez
-Interface org.bluez.ProximityReporter
+Interface org.bluez.ProximityReporter1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
Properties string ImmediateAlertLevel [readonly]
diff --git a/profiles/proximity/monitor.c b/profiles/proximity/monitor.c
index 023de72..d9ed3ff 100644
--- a/profiles/proximity/monitor.c
+++ b/profiles/proximity/monitor.c
@@ -50,7 +50,7 @@
#include "monitor.h"
#include "textfile.h"
-#define PROXIMITY_INTERFACE "org.bluez.ProximityMonitor"
+#define PROXIMITY_INTERFACE "org.bluez.ProximityMonitor1"
#define ALERT_LEVEL_CHR_UUID 0x2A06
#define POWER_LEVEL_CHR_UUID 0x2A07
diff --git a/profiles/proximity/reporter.h b/profiles/proximity/reporter.h
index 480c668..6a7066d 100644
--- a/profiles/proximity/reporter.h
+++ b/profiles/proximity/reporter.h
@@ -22,7 +22,7 @@
*
*/
-#define PROXIMITY_REPORTER_INTERFACE "org.bluez.ProximityReporter"
+#define PROXIMITY_REPORTER_INTERFACE "org.bluez.ProximityReporter1"
#define IMMEDIATE_ALERT_SVC_UUID 0x1802
#define LINK_LOSS_SVC_UUID 0x1803
diff --git a/test/test-proximity b/test/test-proximity
index d6862de..0cbf315 100755
--- a/test/test-proximity
+++ b/test/test-proximity
@@ -14,8 +14,11 @@ import dbus.mainloop.glib
from optparse import OptionParser, make_option
import bluezutils
+BUS_NAME = 'org.bluez'
+PROXIMITY_MONITOR_INTERFACE = 'org.bluez.ProxymityMonitor1'
+
def properties_changed(interface, changed, invalidated):
- if interface != "org.bluez.ProximityMonitor":
+ if interface != PROXIMITY_MONITOR_INTERFACE:
return
for name, value in changed.iteritems():
@@ -45,19 +48,19 @@ if __name__ == "__main__":
device = bluezutils.find_device(options.address, options.dev_id)
device_path = device.object_path
- bus.add_signal_receiver(properties_changed, bus_name="org.bluez",
+ bus.add_signal_receiver(properties_changed, bus_name=BUS_NAME,
path=device_path,
dbus_interface="org.freedesktop.DBus.Properties",
signal_name="PropertiesChanged")
- proximity = dbus.Interface(bus.get_object("org.bluez",
- device_path), "org.bluez.ProximityMonitor")
+ proximity = dbus.Interface(bus.get_object(BUS_NAME, device_path),
+ PROXIMITY_MONITOR_INTERFACE)
- device_prop = dbus.Interface(bus.get_object("org.bluez", device_path),
+ device_prop = dbus.Interface(bus.get_object(BUS_NAME, device_path),
"org.freedesktop.DBus.Properties")
print("Proximity SetProperty('%s', '%s')" % (args[0], args[1]))
- device_prop.Set("org.bluez.ProximityMonitor", args[0], args[1])
+ device_prop.Set(PROXIMITY_MONITOR_INTERFACE, args[0], args[1])
mainloop = gobject.MainLoop()
mainloop.run()
--
1.7.11.7
^ permalink raw reply related
* [PATCH BlueZ 09/13] dbusoob: Append version to OutOfBand interface
From: Luiz Augusto von Dentz @ 2012-12-14 9:13 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1355476387-2165-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
doc/oob-api.txt | 2 +-
plugins/dbusoob.c | 2 +-
test/test-oob | 11 +++++++----
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/doc/oob-api.txt b/doc/oob-api.txt
index d54f612..a196442 100644
--- a/doc/oob-api.txt
+++ b/doc/oob-api.txt
@@ -11,7 +11,7 @@ Out Of Band hierarchy
=====================
Service org.bluez
-Interface org.bluez.OutOfBand
+Interface org.bluez.OutOfBand1
Object path [variable prefix]/{hci0,hci1,...}
Methods dict ReadLocalData()
diff --git a/plugins/dbusoob.c b/plugins/dbusoob.c
index 77563f1..887a610 100644
--- a/plugins/dbusoob.c
+++ b/plugins/dbusoob.c
@@ -45,7 +45,7 @@
#include "error.h"
#include "storage.h"
-#define OOB_INTERFACE "org.bluez.OutOfBand"
+#define OOB_INTERFACE "org.bluez.OutOfBand1"
struct oob_data {
char *addr;
diff --git a/test/test-oob b/test/test-oob
index 87c558f..681540b 100755
--- a/test/test-oob
+++ b/test/test-oob
@@ -7,6 +7,9 @@ import gobject
import dbus.mainloop.glib
import bluezutils
+BUS_NAME = 'org.bluez'
+OOB_INTERFACE = 'org.bluez.OutOfBand1'
+
def create_device_reply(device):
print("Pairing succeed!")
mainloop.quit()
@@ -61,10 +64,10 @@ if __name__ == '__main__':
print()
print("Reading local Out of Band data...")
- oob_adapter0 = dbus.Interface(bus.get_object("org.bluez",
- adapter0_path), "org.bluez.OutOfBand")
- oob_adapter1 = dbus.Interface(bus.get_object("org.bluez",
- adapter1_path), "org.bluez.OutOfBand")
+ oob_adapter0 = dbus.Interface(bus.get_object(BUS_NAME,
+ adapter0_path), OOB_INTERFACE)
+ oob_adapter1 = dbus.Interface(bus.get_object(BUS_NAME,
+ adapter1_path), OOB_INTERFACE)
oob0 = oob_adapter0.ReadLocalData()
oob1 = oob_adapter1.ReadLocalData()
--
1.7.11.7
^ permalink raw reply related
* [PATCH BlueZ 08/13] health: Append version to Health interfaces
From: Luiz Augusto von Dentz @ 2012-12-14 9:13 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1355476387-2165-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
doc/health-api.txt | 6 +++---
profiles/health/hdp_types.h | 6 +++---
test/test-health | 25 +++++++++++++++----------
test/test-health-sink | 22 ++++++++++++++--------
4 files changed, 35 insertions(+), 24 deletions(-)
diff --git a/doc/health-api.txt b/doc/health-api.txt
index 7639cd2..193fbce 100644
--- a/doc/health-api.txt
+++ b/doc/health-api.txt
@@ -9,7 +9,7 @@ HealthManager hierarchy
=======================
Service org.bluez
-Interface org.bluez.HealthManager
+Interface org.bluez.HealthManager1
Object path /org/bluez/
Methods object CreateApplication(dict config)
@@ -54,7 +54,7 @@ HealthDevice hierarchy
======================
Service org.bluez
-Interface org.bluez.HealthDevice
+Interface org.bluez.HealthDevice1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
Methods boolean Echo()
@@ -112,7 +112,7 @@ HealthChannel hierarchy
=======================
Service org.bluez
-Interface org.bluez.HealthChannel
+Interface org.bluez.HealthChannel1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/chanZZZ
Only the process that created the data channel or the creator of the
diff --git a/profiles/health/hdp_types.h b/profiles/health/hdp_types.h
index 7e4d00f..aff16df 100644
--- a/profiles/health/hdp_types.h
+++ b/profiles/health/hdp_types.h
@@ -25,9 +25,9 @@
#define MANAGER_PATH "/org/bluez"
-#define HEALTH_MANAGER "org.bluez.HealthManager"
-#define HEALTH_DEVICE "org.bluez.HealthDevice"
-#define HEALTH_CHANNEL "org.bluez.HealthChannel"
+#define HEALTH_MANAGER "org.bluez.HealthManager1"
+#define HEALTH_DEVICE "org.bluez.HealthDevice1"
+#define HEALTH_CHANNEL "org.bluez.HealthChannel1"
#define HDP_VERSION 0x0100
diff --git a/test/test-health b/test/test-health
index e0f95a6..666972c 100755
--- a/test/test-health
+++ b/test/test-health
@@ -9,6 +9,12 @@ import gobject
from dbus.mainloop.glib import DBusGMainLoop
import sys
+BUS_NAME = 'org.bluez'
+PATH = '/org/bluez'
+ADAPTER_INTERFACE = 'org.bluez.Adapter1'
+HEALTH_MANAGER_INTERFACE = 'org.bluez.HealthManager1'
+HEALTH_DEVICE_INTERFACE = 'org.bluez.HealthDevice1'
+
DBusGMainLoop(set_as_default=True)
loop = gobject.MainLoop()
@@ -33,8 +39,8 @@ def sig_received(*args, **kwargs):
def enter_mainloop():
- bus.add_signal_receiver(sig_received, bus_name="org.bluez",
- dbus_interface = "org.bluez.HealthDevice",
+ bus.add_signal_receiver(sig_received, bus_name=BUS_NAME,
+ dbus_interface=HEALTH_DEVICE_INTERFACE,
path_keyword="path",
member_keyword="member",
interface_keyword="interface")
@@ -49,8 +55,8 @@ def enter_mainloop():
finally:
print("Exiting, bye")
-hdp_manager = dbus.Interface(bus.get_object("org.bluez", "/org/bluez"),
- "org.bluez.HealthManager")
+hdp_manager = dbus.Interface(bus.get_object(BUS_NAME, PATH),
+ HEALTH_MANAGER_INTERFACE)
role = None
while role == None:
@@ -131,14 +137,14 @@ if not con:
enter_mainloop()
sys.exit()
-manager = dbus.Interface(bus.get_object("org.bluez", "/"),
+manager = dbus.Interface(bus.get_object(BUS_NAME, "/"),
"org.freedesktop.DBus.ObjectManager")
objects = manager.GetManagedObjects()
adapters = []
for path, ifaces in objects.iteritems():
- if ifaces.has_key("org.bluez.Adapter1"):
+ if ifaces.has_key(ADAPTER_INTERFACE):
adapters.append(path)
i = 1
@@ -159,8 +165,7 @@ while select == None:
except KeyboardInterrupt:
sys.exit()
-adapter = dbus.Interface(bus.get_object("org.bluez", select),
- "org.bluez.Adapter1")
+adapter = dbus.Interface(bus.get_object(BUS_NAME, select), ADAPTER_INTERFACE)
devices = adapter.GetProperties()["Devices"]
@@ -186,8 +191,8 @@ while select == None:
except KeyboardInterrupt:
sys.exit()
-device = dbus.Interface(bus.get_object("org.bluez", select),
- "org.bluez.HealthDevice")
+device = dbus.Interface(bus.get_object(BUS_NAME, select),
+ HEALTH_DEVICE_INTERFACE)
echo = None
while echo == None:
diff --git a/test/test-health-sink b/test/test-health-sink
index a14f16b..32afd71 100755
--- a/test/test-health-sink
+++ b/test/test-health-sink
@@ -9,26 +9,32 @@ import gobject
from dbus.mainloop.glib import DBusGMainLoop
import sys
+BUS_NAME = 'org.bluez'
+PATH = '/org/bluez'
+ADAPTER_INTERFACE = 'org.bluez.Adapter1'
+HEALTH_MANAGER_INTERFACE = 'org.bluez.HealthManager1'
+HEALTH_DEVICE_INTERFACE = 'org.bluez.HealthDevice1'
+
DBusGMainLoop(set_as_default=True)
loop = gobject.MainLoop()
bus = dbus.SystemBus()
-hdp_manager = dbus.Interface(bus.get_object("org.bluez", "/org/bluez"),
- "org.bluez.HealthManager")
+hdp_manager = dbus.Interface(bus.get_object(BUS_NAME, PATH),
+ HEALTH_MANAGER_INTERFACE)
app_path = hdp_manager.CreateApplication({"DataType": dbus.types.UInt16(4103),
"Role": "sink"})
print(app_path)
-manager = dbus.Interface(bus.get_object("org.bluez", "/"),
+manager = dbus.Interface(bus.get_object(BUS_NAME, "/"),
"org.freedesktop.DBus.ObjectManager")
objects = manager.GetManagedObjects()
adapters = []
for path, ifaces in objects.iteritems():
- if ifaces.has_key("org.bluez.Adapter1"):
+ if ifaces.has_key(ADAPTER_INTERFACE):
adapters.append(path)
i = 1
@@ -49,8 +55,8 @@ while select == None:
except KeyboardInterrupt:
sys.exit()
-adapter = dbus.Interface(bus.get_object("org.bluez", select),
- "org.bluez.Adapter1")
+adapter = dbus.Interface(bus.get_object(BUS_NAME, select),
+ ADAPTER_INTERFACE)
devices = adapter.GetProperties()["Devices"]
@@ -77,8 +83,8 @@ while select == None:
sys.exit()
print("Connecting to %s" % (select))
-device = dbus.Interface(bus.get_object("org.bluez", select),
- "org.bluez.HealthDevice")
+device = dbus.Interface(bus.get_object(BUS_NAME, select),
+ HEALTH_DEVICE_INTERFACE)
chan = device.CreateChannel(app_path, "Any")
--
1.7.11.7
^ permalink raw reply related
* [PATCH BlueZ 07/13] core: Append version to Agent interface
From: Luiz Augusto von Dentz @ 2012-12-14 9:13 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1355476387-2165-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
doc/agent-api.txt | 2 +-
src/agent.c | 19 ++++++++++---------
src/bluetooth.conf | 2 +-
test/simple-agent | 24 ++++++++++++++----------
4 files changed, 26 insertions(+), 21 deletions(-)
diff --git a/doc/agent-api.txt b/doc/agent-api.txt
index caed7f8..a1a8969 100644
--- a/doc/agent-api.txt
+++ b/doc/agent-api.txt
@@ -9,7 +9,7 @@ Agent hierarchy
===============
Service unique name
-Interface org.bluez.Agent
+Interface org.bluez.Agent1
Object path freely definable
Methods void Release()
diff --git a/src/agent.c b/src/agent.c
index ec183c0..b36738d 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -48,6 +48,7 @@
#include "agent.h"
#define REQUEST_TIMEOUT (60 * 1000) /* 60 seconds */
+#define AGENT_INTERFACE "org.bluez.Agent1"
typedef enum {
AGENT_REQUEST_PASSKEY,
@@ -91,7 +92,7 @@ static void agent_release(struct agent *agent)
agent_cancel(agent);
message = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "Release");
+ AGENT_INTERFACE, "Release");
if (message == NULL) {
error("Couldn't allocate D-Bus message");
return;
@@ -108,7 +109,7 @@ static int send_cancel_request(struct agent_request *req)
req->agent->path);
message = dbus_message_new_method_call(req->agent->name, req->agent->path,
- "org.bluez.Agent", "Cancel");
+ AGENT_INTERFACE, "Cancel");
if (message == NULL) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
@@ -301,7 +302,7 @@ static int agent_call_authorize_service(struct agent_request *req,
struct agent *agent = req->agent;
req->msg = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "AuthorizeService");
+ AGENT_INTERFACE, "AuthorizeService");
if (!req->msg) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
@@ -413,7 +414,7 @@ static int pincode_request_new(struct agent_request *req, const char *device_pat
secure pin. */
req->msg = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "RequestPinCode");
+ AGENT_INTERFACE, "RequestPinCode");
if (req->msg == NULL) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
@@ -507,7 +508,7 @@ static int passkey_request_new(struct agent_request *req,
struct agent *agent = req->agent;
req->msg = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "RequestPasskey");
+ AGENT_INTERFACE, "RequestPasskey");
if (req->msg == NULL) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
@@ -563,7 +564,7 @@ static int confirmation_request_new(struct agent_request *req,
struct agent *agent = req->agent;
req->msg = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "RequestConfirmation");
+ AGENT_INTERFACE, "RequestConfirmation");
if (req->msg == NULL) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
@@ -621,7 +622,7 @@ static int authorization_request_new(struct agent_request *req,
struct agent *agent = req->agent;
req->msg = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "RequestAuthorization");
+ AGENT_INTERFACE, "RequestAuthorization");
if (req->msg == NULL) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
@@ -679,7 +680,7 @@ int agent_display_passkey(struct agent *agent, struct btd_device *device,
const gchar *dev_path = device_get_path(device);
message = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "DisplayPasskey");
+ AGENT_INTERFACE, "DisplayPasskey");
if (!message) {
error("Couldn't allocate D-Bus message");
return -1;
@@ -754,7 +755,7 @@ static int display_pincode_request_new(struct agent_request *req,
struct agent *agent = req->agent;
req->msg = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "DisplayPinCode");
+ AGENT_INTERFACE, "DisplayPinCode");
if (req->msg == NULL) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 0e45935..8dfdc77 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -10,7 +10,7 @@
<policy user="root">
<allow own="org.bluez"/>
<allow send_destination="org.bluez"/>
- <allow send_interface="org.bluez.Agent"/>
+ <allow send_interface="org.bluez.Agent1"/>
<allow send_interface="org.bluez.HandsfreeAgent"/>
<allow send_interface="org.bluez.MediaEndpoint1"/>
<allow send_interface="org.bluez.MediaPlayer1"/>
diff --git a/test/simple-agent b/test/simple-agent
index 15f2a32..312202a 100755
--- a/test/simple-agent
+++ b/test/simple-agent
@@ -11,6 +11,10 @@ import dbus.mainloop.glib
from optparse import OptionParser
import bluezutils
+BUS_NAME = 'org.bluez'
+AGENT_INTERFACE = 'org.bluez.Agent1'
+AGENT_PATH = "/test/agent"
+
bus = None
device_obj = None
dev_path = None
@@ -40,14 +44,14 @@ class Agent(dbus.service.Object):
def set_exit_on_release(self, exit_on_release):
self.exit_on_release = exit_on_release
- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="", out_signature="")
def Release(self):
print("Release")
if self.exit_on_release:
mainloop.quit()
- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="os", out_signature="")
def AuthorizeService(self, device, uuid):
print("AuthorizeService (%s, %s)" % (device, uuid))
@@ -56,14 +60,14 @@ class Agent(dbus.service.Object):
return
raise Rejected("Connection rejected by user")
- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="o", out_signature="s")
def RequestPinCode(self, device):
print("RequestPinCode (%s)" % (device))
set_trusted(device)
return ask("Enter PIN Code: ")
- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="o", out_signature="u")
def RequestPasskey(self, device):
print("RequestPasskey (%s)" % (device))
@@ -71,18 +75,18 @@ class Agent(dbus.service.Object):
passkey = ask("Enter passkey: ")
return dbus.UInt32(passkey)
- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="ouq", out_signature="")
def DisplayPasskey(self, device, passkey, entered):
print("DisplayPasskey (%s, %06u entered %u)" %
(device, passkey, entered))
- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="os", out_signature="")
def DisplayPinCode(self, device, pincode):
print("DisplayPinCode (%s, %s)" % (device, pincode))
- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="ou", out_signature="")
def RequestConfirmation(self, device, passkey):
print("RequestConfirmation (%s, %06d)" % (device, passkey))
@@ -92,7 +96,7 @@ class Agent(dbus.service.Object):
return
raise Rejected("Passkey doesn't match")
- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="o", out_signature="")
def RequestAuthorization(self, device):
print("RequestAuthorization (%s)" % (device))
@@ -101,7 +105,7 @@ class Agent(dbus.service.Object):
return
raise Rejected("Pairing rejected")
- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="s", out_signature="")
def ConfirmModeChange(self, mode):
print("ConfirmModeChange (%s)" % (mode))
@@ -110,7 +114,7 @@ class Agent(dbus.service.Object):
return
raise Rejected("Mode change by user")
- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="", out_signature="")
def Cancel(self):
print("Cancel")
--
1.7.11.7
^ permalink raw reply related
* [PATCH BlueZ 06/13] alert: Append version to Alert interfaces
From: Luiz Augusto von Dentz @ 2012-12-14 9:13 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1355476387-2165-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
doc/alert-api.txt | 4 ++--
profiles/alert/server.c | 4 ++--
src/bluetooth.conf | 2 +-
test/test-alert | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/doc/alert-api.txt b/doc/alert-api.txt
index bcaaaf3..65c065e 100644
--- a/doc/alert-api.txt
+++ b/doc/alert-api.txt
@@ -19,7 +19,7 @@ Alert hierarchy
===============
Service org.bluez
-Interface org.bluez.Alert
+Interface org.bluez.Alert1
Object path /org/bluez
Methods void RegisterAlert(string category, object agent)
@@ -79,7 +79,7 @@ Alert Agent hierarchy
=====================
Service org.bluez
-Interface org.bluez.AlertAgent
+Interface org.bluez.AlertAgent1
Object path freely definable
Methods void MuteOnce()
diff --git a/profiles/alert/server.c b/profiles/alert/server.c
index 20eb5fc..2e8c452 100644
--- a/profiles/alert/server.c
+++ b/profiles/alert/server.c
@@ -63,8 +63,8 @@
#define SUPP_UNREAD_ALERT_CAT_CHR_UUID 0x2A48
#define ALERT_OBJECT_PATH "/org/bluez"
-#define ALERT_INTERFACE "org.bluez.Alert"
-#define ALERT_AGENT_INTERFACE "org.bluez.AlertAgent"
+#define ALERT_INTERFACE "org.bluez.Alert1"
+#define ALERT_AGENT_INTERFACE "org.bluez.AlertAgent1"
/* Maximum length for "Text String Information" */
#define NEW_ALERT_MAX_INFO_SIZE 18
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 5750f49..0e45935 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -16,7 +16,7 @@
<allow send_interface="org.bluez.MediaPlayer1"/>
<allow send_interface="org.bluez.Watcher"/>
<allow send_interface="org.bluez.ThermometerWatcher1"/>
- <allow send_interface="org.bluez.AlertAgent"/>
+ <allow send_interface="org.bluez.AlertAgent1"/>
<allow send_interface="org.bluez.Profile1"/>
<allow send_interface="org.bluez.HeartRateWatcher1"/>
<allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
diff --git a/test/test-alert b/test/test-alert
index 1e241a3..066e537 100755
--- a/test/test-alert
+++ b/test/test-alert
@@ -9,8 +9,8 @@ import sys
import os
BUS_NAME = 'org.bluez'
-ALERT_INTERFACE = 'org.bluez.Alert'
-ALERT_AGENT_INTERFACE = 'org.bluez.AlertAgent'
+ALERT_INTERFACE = 'org.bluez.Alert1'
+ALERT_AGENT_INTERFACE = 'org.bluez.AlertAgent1'
BLUEZ_OBJECT_PATH = '/org/bluez'
TEST_OBJECT_PATH = '/org/bluez/test'
--
1.7.11.7
^ permalink raw reply related
* [PATCH BlueZ 05/13] thermometer: Append version to Thermometer interfaces
From: Luiz Augusto von Dentz @ 2012-12-14 9:12 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1355476387-2165-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
doc/thermometer-api.txt | 6 +++---
profiles/thermometer/thermometer.c | 6 +++---
src/bluetooth.conf | 2 +-
test/test-thermometer | 15 ++++++++++-----
4 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/doc/thermometer-api.txt b/doc/thermometer-api.txt
index cab115f..c7c8a5d 100644
--- a/doc/thermometer-api.txt
+++ b/doc/thermometer-api.txt
@@ -7,7 +7,7 @@ Health Thermometer Manager hierarchy
====================================
Service org.bluez
-Interface org.bluez.ThermometerManager
+Interface org.bluez.ThermometerManager1
Object path [variable prefix]/{hci0,hci1,...}
Methods RegisterWatcher(object agent)
@@ -44,7 +44,7 @@ Health Thermometer Profile hierarchy
====================================
Service org.bluez
-Interface org.bluez.Thermometer
+Interface org.bluez.Thermometer1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
@@ -77,7 +77,7 @@ Health Thermometer Watcher hierarchy
====================================
Service unique name
-Interface org.bluez.ThermometerWatcher
+Interface org.bluez.ThermometerWatcher1
Object path freely definable
Methods void MeasurementReceived(dict measurement)
diff --git a/profiles/thermometer/thermometer.c b/profiles/thermometer/thermometer.c
index 537db99..15db33e 100644
--- a/profiles/thermometer/thermometer.c
+++ b/profiles/thermometer/thermometer.c
@@ -42,9 +42,9 @@
#include "attrib/gatt.h"
#include "thermometer.h"
-#define THERMOMETER_INTERFACE "org.bluez.Thermometer"
-#define THERMOMETER_MANAGER_INTERFACE "org.bluez.ThermometerManager"
-#define THERMOMETER_WATCHER_INTERFACE "org.bluez.ThermometerWatcher"
+#define THERMOMETER_INTERFACE "org.bluez.Thermometer1"
+#define THERMOMETER_MANAGER_INTERFACE "org.bluez.ThermometerManager1"
+#define THERMOMETER_WATCHER_INTERFACE "org.bluez.ThermometerWatcher1"
/* Temperature measurement flag fields */
#define TEMP_UNITS 0x01
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 137e4e4..5750f49 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -15,7 +15,7 @@
<allow send_interface="org.bluez.MediaEndpoint1"/>
<allow send_interface="org.bluez.MediaPlayer1"/>
<allow send_interface="org.bluez.Watcher"/>
- <allow send_interface="org.bluez.ThermometerWatcher"/>
+ <allow send_interface="org.bluez.ThermometerWatcher1"/>
<allow send_interface="org.bluez.AlertAgent"/>
<allow send_interface="org.bluez.Profile1"/>
<allow send_interface="org.bluez.HeartRateWatcher1"/>
diff --git a/test/test-thermometer b/test/test-thermometer
index fdb772f..6c143be 100755
--- a/test/test-thermometer
+++ b/test/test-thermometer
@@ -15,8 +15,13 @@ import dbus.mainloop.glib
from optparse import OptionParser, make_option
import bluezutils
+BUS_NAME = 'org.bluez'
+THERMOMETER_MANAGER_INTERFACE = 'org.bluez.ThermometerManager1'
+THERMOMETER_WATCHER_INTERFACE = 'org.bluez.ThermometerWatcher1'
+THERMOMETER_INTERFACE = 'org.bluez.Thermometer1'
+
class Watcher(dbus.service.Object):
- @dbus.service.method("org.bluez.ThermometerWatcher",
+ @dbus.service.method(THERMOMETER_WATCHER_INTERFACE,
in_signature="oa{sv}", out_signature="")
def MeasurementReceived(self, device, measure):
print("%s measurement received from %s" % (measure["Measurement"], device))
@@ -31,7 +36,7 @@ class Watcher(dbus.service.Object):
print("Type: ", measure["Type"])
def properties_changed(interface, changed, invalidated):
- if interface != "org.bluez.Thermometer":
+ if interface != THERMOMETER_INTERFACE:
return
for name, value in changed.iteritems():
print("Property %s changed: %s" % (name, str(value)))
@@ -63,15 +68,15 @@ if __name__ == "__main__":
options.adapter)
adapter_path = adapter.object_path
- thermometer_manager = dbus.Interface(bus.get_object("org.bluez",
- adapter_path), "org.bluez.ThermometerManager")
+ thermometer_manager = dbus.Interface(bus.get_object(BUS_NAME,
+ adapter_path), THERMOMETER_MANAGER_INTERFACE)
device = bluezutils.find_device_in_objects(managed_objects,
options.address,
options.adapter)
device_path = device.object_path
- bus.add_signal_receiver(properties_changed, bus_name="org.bluez",
+ bus.add_signal_receiver(properties_changed, bus_name=BUS_NAME,
path=device_path,
dbus_interface="org.freedesktop.DBus.Properties",
signal_name="PropertiesChanged")
--
1.7.11.7
^ permalink raw reply related
* [PATCH BlueZ 04/13] cyclingspeed: Append version to CyclingSpeed interfaces
From: Luiz Augusto von Dentz @ 2012-12-14 9:12 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1355476387-2165-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
doc/cyclingspeed-api.txt | 6 +++---
profiles/cyclingspeed/cyclingspeed.c | 6 +++---
src/bluetooth.conf | 2 +-
test/test-cyclingspeed | 23 ++++++++++++++---------
4 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/doc/cyclingspeed-api.txt b/doc/cyclingspeed-api.txt
index 08e11c8..1a2dfee 100644
--- a/doc/cyclingspeed-api.txt
+++ b/doc/cyclingspeed-api.txt
@@ -7,7 +7,7 @@ Cycling Speed and Cadence Manager hierarchy
===========================================
Service org.bluez
-Interface org.bluez.CyclingSpeedManager
+Interface org.bluez.CyclingSpeedManager1
Object path [variable prefix]/{hci0,hci1,...}
Methods RegisterWatcher(object agent)
@@ -25,7 +25,7 @@ Cycling Speed and Cadence Profile hierarchy
===========================================
Service org.bluez
-Interface org.bluez.CyclingSpeed
+Interface org.bluez.CyclingSpeed1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
Methods SetCumulativeWheelRevolutions(uint32 value)
@@ -68,7 +68,7 @@ Cycling Speed and Cadence Watcher hierarchy
===========================================
Service unique name
-Interface org.bluez.CyclingSpeedWatcher
+Interface org.bluez.CyclingSpeedWatcher1
Object path freely definable
Methods void MeasurementReceived(object device, dict measurement)
diff --git a/profiles/cyclingspeed/cyclingspeed.c b/profiles/cyclingspeed/cyclingspeed.c
index e236ff7..e0ba4d2 100644
--- a/profiles/cyclingspeed/cyclingspeed.c
+++ b/profiles/cyclingspeed/cyclingspeed.c
@@ -47,9 +47,9 @@
#define ATT_TIMEOUT 30
-#define CYCLINGSPEED_INTERFACE "org.bluez.CyclingSpeed"
-#define CYCLINGSPEED_MANAGER_INTERFACE "org.bluez.CyclingSpeedManager"
-#define CYCLINGSPEED_WATCHER_INTERFACE "org.bluez.CyclingSpeedWatcher"
+#define CYCLINGSPEED_INTERFACE "org.bluez.CyclingSpeed1"
+#define CYCLINGSPEED_MANAGER_INTERFACE "org.bluez.CyclingSpeedManager1"
+#define CYCLINGSPEED_WATCHER_INTERFACE "org.bluez.CyclingSpeedWatcher1"
#define WHEEL_REV_SUPPORT 0x01
#define CRANK_REV_SUPPORT 0x02
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 72d4248..137e4e4 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -19,7 +19,7 @@
<allow send_interface="org.bluez.AlertAgent"/>
<allow send_interface="org.bluez.Profile1"/>
<allow send_interface="org.bluez.HeartRateWatcher1"/>
- <allow send_interface="org.bluez.CyclingSpeedWatcher"/>
+ <allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
</policy>
<policy at_console="true">
diff --git a/test/test-cyclingspeed b/test/test-cyclingspeed
index 10a16aa..533120a 100755
--- a/test/test-cyclingspeed
+++ b/test/test-cyclingspeed
@@ -14,6 +14,11 @@ import dbus.service
import dbus.mainloop.glib
from optparse import OptionParser, make_option
+BUS_NAME = 'org.bluez'
+CYCLINGSPEED_MANAGER_INTERFACE = 'org.bluez.CyclingSpeedManager1'
+CYCLINGSPEED_WATCHER_INTERFACE = 'org.bluez.CyclingSpeedWatcher1'
+CYCLINGSPEED_INTERFACE = 'org.bluez.CyclingSpeed1'
+
class MeasurementQ:
def __init__(self, wrap_v):
self._now = [None, None]
@@ -50,7 +55,7 @@ class Watcher(dbus.service.Object):
def enable_calc(self, v):
self._circumference = v
- @dbus.service.method("org.bluez.CyclingSpeedWatcher",
+ @dbus.service.method(CYCLINGSPEED_WATCHER_INTERFACE,
in_signature="oa{sv}", out_signature="")
def MeasurementReceived(self, device, measure):
print("Measurement received from %s" % device)
@@ -135,8 +140,8 @@ if __name__ == "__main__":
options.adapter)
device_path = device.object_path
- cscmanager = dbus.Interface(bus.get_object("org.bluez", adapter_path),
- "org.bluez.CyclingSpeedManager")
+ cscmanager = dbus.Interface(bus.get_object(BUS_NAME, adapter_path),
+ CYCLINGSPEED_WATCHER_INTERFACE)
watcher_path = "/test/watcher"
watcher = Watcher(bus, watcher_path)
@@ -144,18 +149,18 @@ if __name__ == "__main__":
watcher.enable_calc(options.circumference)
cscmanager.RegisterWatcher(watcher_path)
- csc = dbus.Interface(bus.get_object("org.bluez", device_path),
- "org.bluez.CyclingSpeed")
+ csc = dbus.Interface(bus.get_object(BUS_NAME, device_path),
+ CYCLINGSPEED_INTERFACE)
- bus.add_signal_receiver(properties_changed, bus_name="org.bluez",
+ bus.add_signal_receiver(properties_changed, bus_name=BUS_NAME,
path=device_path,
dbus_interface="org.freedesktop.DBus.Properties",
signal_name="PropertiesChanged")
- device_prop = dbus.Interface(bus.get_object("org.bluez", device_path),
+ device_prop = dbus.Interface(bus.get_object(BUS_NAME, device_path),
"org.freedesktop.DBus.Properties")
- properties = device_prop.GetAll("org.bluez.CyclingSpeed")
+ properties = device_prop.GetAll(CYCLINGSPEED_INTERFACE)
if "Location" in properties:
print("Sensor location: %s" % properties["Location"])
@@ -171,7 +176,7 @@ if __name__ == "__main__":
elif args[0] == "SetLocation":
if properties["MultipleSensorLocationsSupported"]:
- device_prop.Set("org.bluez.CyclingSpeed", "Location", args[1])
+ device_prop.Set(CYCLINGSPEED_INTERFACE, "Location", args[1])
else:
print("Multiple sensor locations not supported")
--
1.7.11.7
^ permalink raw reply related
* [PATCH BlueZ 03/13] heartrate: Append version to HeartRate interfaces
From: Luiz Augusto von Dentz @ 2012-12-14 9:12 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1355476387-2165-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
doc/heartrate-api.txt | 6 +++---
profiles/heartrate/heartrate.c | 6 +++---
src/bluetooth.conf | 2 +-
test/test-heartrate | 19 ++++++++++++-------
4 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/doc/heartrate-api.txt b/doc/heartrate-api.txt
index d1d5191..0f202bd 100644
--- a/doc/heartrate-api.txt
+++ b/doc/heartrate-api.txt
@@ -8,7 +8,7 @@ Heart Rate Manager hierarchy
============================
Service org.bluez
-Interface org.bluez.HeartRateManager
+Interface org.bluez.HeartRateManager1
Object path [variable prefix]/{hci0,hci1,...}
Methods RegisterWatcher(object agent)
@@ -25,7 +25,7 @@ Heart Rate Profile hierarchy
============================
Service org.bluez
-Interface org.bluez.HeartRate
+Interface org.bluez.HeartRate1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
Methods Reset()
@@ -47,7 +47,7 @@ Heart Rate Watcher hierarchy
============================
Service unique name
-Interface org.bluez.HeartRateWatcher
+Interface org.bluez.HeartRateWatcher1
Object path freely definable
Methods void MeasurementReceived(object device, dict measurement)
diff --git a/profiles/heartrate/heartrate.c b/profiles/heartrate/heartrate.c
index 155100e..f4edf09 100644
--- a/profiles/heartrate/heartrate.c
+++ b/profiles/heartrate/heartrate.c
@@ -41,9 +41,9 @@
#include "log.h"
#include "heartrate.h"
-#define HEART_RATE_INTERFACE "org.bluez.HeartRate"
-#define HEART_RATE_MANAGER_INTERFACE "org.bluez.HeartRateManager"
-#define HEART_RATE_WATCHER_INTERFACE "org.bluez.HeartRateWatcher"
+#define HEART_RATE_INTERFACE "org.bluez.HeartRate1"
+#define HEART_RATE_MANAGER_INTERFACE "org.bluez.HeartRateManager1"
+#define HEART_RATE_WATCHER_INTERFACE "org.bluez.HeartRateWatcher1"
#define HR_VALUE_FORMAT 0x01
#define SENSOR_CONTACT_DETECTED 0x02
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 6111fdb..72d4248 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -18,7 +18,7 @@
<allow send_interface="org.bluez.ThermometerWatcher"/>
<allow send_interface="org.bluez.AlertAgent"/>
<allow send_interface="org.bluez.Profile1"/>
- <allow send_interface="org.bluez.HeartRateWatcher"/>
+ <allow send_interface="org.bluez.HeartRateWatcher1"/>
<allow send_interface="org.bluez.CyclingSpeedWatcher"/>
</policy>
diff --git a/test/test-heartrate b/test/test-heartrate
index 47dd012..f26b3db 100755
--- a/test/test-heartrate
+++ b/test/test-heartrate
@@ -15,8 +15,13 @@ import dbus.mainloop.glib
from optparse import OptionParser, make_option
import bluezutils
+BUS_NAME = 'org.bluez'
+HEARTRATE_MANAGER_INTERFACE = 'org.bluez.HeartRateManager1'
+HEARTRATE_WATCHER_INTERFACE = 'org.bluez.HeartRateWatcher1'
+HEARTRATE_INTERFACE = 'org.bluez.HeartRate1'
+
class Watcher(dbus.service.Object):
- @dbus.service.method("org.bluez.HeartRateWatcher",
+ @dbus.service.method(HEARTRATE_WATCHER_INTERFACE,
in_signature="oa{sv}", out_signature="")
def MeasurementReceived(self, device, measure):
print("Measurement received from %s" % device)
@@ -59,8 +64,8 @@ if __name__ == "__main__":
options.adapter)
adapter_path = adapter.object_path
- heartrateManager = dbus.Interface(bus.get_object("org.bluez",
- adapter_path), "org.bluez.HeartRateManager")
+ heartrateManager = dbus.Interface(bus.get_object(BUS_NAME,
+ adapter_path), HEARTRATE_MANAGER_INTERFACE)
path = "/test/watcher"
heartrateManager.RegisterWatcher(path)
@@ -70,15 +75,15 @@ if __name__ == "__main__":
options.adapter)
device_path = device.object_path
- heartrate = dbus.Interface(bus.get_object("org.bluez",
- device_path), "org.bluez.HeartRate")
+ heartrate = dbus.Interface(bus.get_object(BUS_NAME, device_path),
+ HEARTRATE_INTERFACE)
watcher = Watcher(bus, path)
- dev_prop = dbus.Interface(bus.get_object("org.bluez", device_path),
+ dev_prop = dbus.Interface(bus.get_object(BUS_NAME, device_path),
"org.freedesktop.DBus.Properties")
- properties = dev_prop.GetAll("org.bluez.HeartRate")
+ properties = dev_prop.GetAll(HEARTRATE_INTERFACE)
if "Location" in properties:
print("Sensor location: %s" % properties["Location"])
--
1.7.11.7
^ permalink raw reply related
* [PATCH BlueZ 02/13] audio: Append version to Control interface
From: Luiz Augusto von Dentz @ 2012-12-14 9:12 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1355476387-2165-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
doc/control-api.txt | 2 +-
profiles/audio/control.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/control-api.txt b/doc/control-api.txt
index 55cebe8..5fc8991 100644
--- a/doc/control-api.txt
+++ b/doc/control-api.txt
@@ -9,7 +9,7 @@ Control hierarchy
=================
Service org.bluez
-Interface org.bluez.Control
+Interface org.bluez.Control1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
Methods void Play()
diff --git a/profiles/audio/control.h b/profiles/audio/control.h
index 800a151..878dd1e 100644
--- a/profiles/audio/control.h
+++ b/profiles/audio/control.h
@@ -22,7 +22,7 @@
*
*/
-#define AUDIO_CONTROL_INTERFACE "org.bluez.Control"
+#define AUDIO_CONTROL_INTERFACE "org.bluez.Control1"
struct control *control_init(struct audio_device *dev, GSList *uuids);
void control_update(struct control *control, GSList *uuids);
--
1.7.11.7
^ permalink raw reply related
* [PATCH BlueZ 01/13] network: Append version to Network and NetworkServer interfaces
From: Luiz Augusto von Dentz @ 2012-12-14 9:12 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
doc/network-api.txt | 4 ++--
profiles/network/connection.c | 2 +-
profiles/network/server.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/doc/network-api.txt b/doc/network-api.txt
index b640b9a..1c9d889 100644
--- a/doc/network-api.txt
+++ b/doc/network-api.txt
@@ -8,7 +8,7 @@ Network hierarchy
=================
Service org.bluez
-Interface org.bluez.Network
+Interface org.bluez.Network1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
Properties boolean Connected [readonly]
@@ -28,7 +28,7 @@ Network server hierarchy
========================
Service org.bluez
-Interface org.bluez.NetworkServer
+Interface org.bluez.NetworkServer1
Object path /org/bluez/{hci0,hci1,...}
Methods void Register(string uuid, string bridge)
diff --git a/profiles/network/connection.c b/profiles/network/connection.c
index 3157e31..5fa3e1b 100644
--- a/profiles/network/connection.c
+++ b/profiles/network/connection.c
@@ -49,7 +49,7 @@
#include "manager.h"
#include "connection.h"
-#define NETWORK_PEER_INTERFACE "org.bluez.Network"
+#define NETWORK_PEER_INTERFACE "org.bluez.Network1"
#define CON_SETUP_RETRIES 3
#define CON_SETUP_TO 9
diff --git a/profiles/network/server.c b/profiles/network/server.c
index e32e51d..2869c28 100644
--- a/profiles/network/server.c
+++ b/profiles/network/server.c
@@ -51,7 +51,7 @@
#include "common.h"
#include "server.h"
-#define NETWORK_SERVER_INTERFACE "org.bluez.NetworkServer"
+#define NETWORK_SERVER_INTERFACE "org.bluez.NetworkServer1"
#define SETUP_TIMEOUT 1
/* Pending Authorization */
--
1.7.11.7
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox