Hi Marcel, On Fri, Nov 27, 2015 at 04:25:30AM -0800, Marcel Holtmann wrote: > >>> > >>> #define BTPROTO_HCI 1 > >>> -struct sockaddr_hci { > >>> - sa_family_t hci_family; > >>> - unsigned short hci_dev; > >>> - unsigned short hci_channel; > >>> -}; > >>> #define HCI_CHANNEL_USER 1 > >> > >> please do not do this. > > > > Why? I added #include "lib/hci.h" where this structure defined, why do > > we need redefined it again? It was defined 3 times. > > we want to get rid of using libbluetooth over and over again. We need to start somewhere. And I have no idea on what you would gain from including lib/hci.h in this case. I get packet types definitions from lib/hci.h. But since this would be moved to h5.c this is not important anymore. I'll remove this chunk. > >> > >>> + > >>> +struct h5_pkt { > >>> + uint16_t len; > >>> + uint8_t data[0]; > >>> +}; > >> > >> I think using get_unaligned_le16 to get the length would be a lot simpler. > > > > Sorry, do not get this, how can we use get_unaligned_le16() ? > > len = get_unaligned_le16(buf) This is just my packet, no need for le16 here. I can use of course just uint8_t array and use first two bytes for length. Best regards Andrei Emeltchenko > data = buf + 2 > > Regards > > Marcel > -- 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