summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/lib/bluetooth/hal-bt-data.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/lib/bluetooth/hal-bt-data.c b/plugins/lib/bluetooth/hal-bt-data.c
index a548039..cfcb57d 100644
--- a/plugins/lib/bluetooth/hal-bt-data.c
+++ b/plugins/lib/bluetooth/hal-bt-data.c
@@ -96,7 +96,7 @@ struct HalBtDeviceData *HalBtDataAddBtDeviceToBtDeviceList(struct HalBtDeviceDat
// TODO JAI : get hci device of bt device here
if(wrap_json_unpack(currentSingleBtDeviceDataJ,
- "{s:s s:s s:o}",
+ "{s:s s:s}",
"Name", &currentBtDeviceName,
"Address", &currentBtDeviceAddress)) {
HalBtDataRemoveSelectedBtDeviceFromList(firstBtDeviceData, currentBtDeviceData);
@@ -171,7 +171,7 @@ int HalBtDataHandleReceivedSingleBtDeviceData(struct HalBtPluginData *halBtPlugi
unsigned int idx = 0, currentBtDeviceIsConnected, currentBtDeviceIsA2DP;
- char *currentBtDeviceAddress, *currentBtDeviceIsConnectedString;
+ char *currentBtDeviceAddress, *currentBtDeviceIsConnectedString, *currentBtDeviceIsAVPConnectedString;
json_object *currentBtAllProfilesJ, *currentBtCurrentProfileJ;
@@ -180,9 +180,10 @@ int HalBtDataHandleReceivedSingleBtDeviceData(struct HalBtPluginData *halBtPlugi
return -1;
if(wrap_json_unpack(currentSingleBtDeviceDataJ,
- "{s:s s:s s:s}",
+ "{s:s s:s s:s s:o}",
"Address", &currentBtDeviceAddress,
"Connected", &currentBtDeviceIsConnectedString,
+ "AVPConnected", &currentBtDeviceIsAVPConnectedString,
"UUIDs", &currentBtAllProfilesJ)) {
return -2;
}
@@ -210,7 +211,8 @@ int HalBtDataHandleReceivedSingleBtDeviceData(struct HalBtPluginData *halBtPlugi
if(! currentBtDeviceIsA2DP)
return 0;
- currentBtDeviceIsConnected = ! strncmp(currentBtDeviceIsConnectedString, "True", strlen(currentBtDeviceIsConnectedString));
+ currentBtDeviceIsConnected = ((! strncmp(currentBtDeviceIsConnectedString, "True", strlen(currentBtDeviceIsConnectedString))) &&
+ (! strncmp(currentBtDeviceIsAVPConnectedString, "True", strlen(currentBtDeviceIsAVPConnectedString))));
currentBtDevice = HalBtDataSearchBtDeviceByAddress(&halBtPluginData->first, currentBtDeviceAddress);