[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [bluetooth-dev] ask about the hci.c



The second argument to SET_BITS denotes the start bit,
and the third argument denotes the number of bits to set.
Thus 16,16 is correct to set the length field as it
starts with bit 16, and is 16 bits wide.

//Peter

> -----Original Message-----
> From: Zhang Su Bing [mailto:sbzhang@xxxxxxx.hk] 
> Sent: Tuesday, January 22, 2002 04:05
> To: Bluetooth-dev
> Subject: [bluetooth-dev] ask about the hci.c
> 
> 
> Dear,
> 
> In the hci.c, there is a function: set_acl_hdr(...).
> set_acl_hdr(u8 *data, u32 len, u8 pb, u8 bc, u32 hci_hdl)
> {
> 	u32 tmp_hdr = 0;
> 
> 	SET_BITS(tmp_hdr, 0, 12, hci_hdl);
> 	SET_BITS(tmp_hdr, 12, 2, pb);
> 	SET_BITS(tmp_hdr, 14, 2, bc);
> 	SET_BITS(tmp_hdr, 16, 16, len);
> 
> 	data[0] = ACL_PKT;
> 	put_unaligned(cpu_to_le32(tmp_hdr), (u32*)&data[1]);
> }
> I think the SET_BITS(tmp_hdr, 16, 16, len) should be SET_BITS(tmp_hdr,
> 16, 31, len),because the total len of HCI DATA PACKET is 32 
> bits. It is right,ok?
> 
> Subing Zhang
> Department of EEE
> The University of Hong Kong
-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com