android/pan: Fix control state change callback parameters order

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, discard this fix if issue fixed in PanService.Java.
This commit is contained in:
Ravi kumar Veeramally 2014-01-23 15:39:25 +02:00 committed by Szymon Janc
parent c8886711d4
commit 1c23302203

View File

@ -45,9 +45,18 @@ static void handle_ctrl_state(void *buf, uint16_t len)
{
struct hal_ev_pan_ctrl_state *ev = buf;
/* FIXME: 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.
*/
if (cbs->control_state_cb)
cbs->control_state_cb(ev->state, ev->status,
ev->local_role, (char *)ev->name);
cbs->control_state_cb(ev->local_role, ev->state, ev->status,
(char *)ev->name);
}
/* handlers will be called from notification thread context,