Hi Luiz, > -----Original Message----- > From: Luiz Augusto von Dentz [mailto:luiz.dentz@xxxxxxxxx] > Sent: Tuesday, July 17, 2012 2:15 PM > To: Vani-dineshbhai PATEL X > Cc: User Name; Lucas De Marchi; Joohi RASTOGI; Vani > Subject: Re: [PATCH BlueZ 2/5] AVRCP: Rename variables used for control > channel to improve redability > > Hi Vani, > > On Tue, Jul 10, 2012 at 12:34 PM, Vani-dineshbhai PATEL > <vani.patel@xxxxxxxxxxxxxx> wrote: > > -typedef size_t (*avctp_pdu_cb) (struct avctp *session, uint8_t > > transaction, > > +typedef size_t (*avctp_control_pdu_cb) (struct avctp *session, > > + uint8_t transaction, > > uint8_t *code, uint8_t *subunit, > > uint8_t *operands, size_t operand_count, > > void *user_data); > > Do you really need to change this, does the callback need to be different for > browsing? > I used different for browsing as browsing would not require parameters like code, subunit. But you are right, I can combine and use one. I shall make this change. > > @@ -93,7 +94,7 @@ struct avctp *avctp_connect(const bdaddr_t *src, > > const bdaddr_t *dst); struct avctp *avctp_get(const bdaddr_t *src, > > const bdaddr_t *dst); void avctp_disconnect(struct avctp *session); > > > > -unsigned int avctp_register_pdu_handler(uint8_t opcode, avctp_pdu_cb > > cb, > > +unsigned int avctp_register_pdu_handler(uint8_t opcode, > > +avctp_control_pdu_cb cb, > > void > > *user_data); > > Same here, if we can keep the callback then we just need a single function > to register, internally we can add to different list. > Yes, you are correct, we can reuse the same function. I was not using list for storing browsing handler (a list is used for control, where there are unit, subunit, passthrough and vendordep). If I reuse the same, we need to formulate an opcode for browsing. But, you are right. I shall merge two functions and avoid duplication of code. > -- > Luiz Augusto von Dentz Thanks & Regards, Vani Patel -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html