From f992ff37c3da77feccf33583db24a0021b14c4c6 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 27 Dec 2020 03:13:27 +0800 Subject: [PATCH] Fix nxstyle warning Signed-off-by: Xiang Xiao --- drivers/wireless/bluetooth/bt_uart.c | 29 +- drivers/wireless/bluetooth/bt_uart.h | 17 +- drivers/wireless/bluetooth/bt_uart_cc2564.c | 5 +- include/nuttx/wireless/bluetooth/bt_buf.h | 15 +- include/nuttx/wireless/bluetooth/bt_core.h | 15 +- include/nuttx/wireless/bluetooth/bt_driver.h | 15 +- include/nuttx/wireless/bluetooth/bt_gatt.h | 60 ++-- include/nuttx/wireless/bluetooth/bt_ioctl.h | 259 +++++++++--------- include/nuttx/wireless/bluetooth/bt_null.h | 15 +- include/nuttx/wireless/bluetooth/bt_uart.h | 19 +- .../nuttx/wireless/bluetooth/bt_uart_shim.h | 15 +- include/nuttx/wireless/bluetooth/bt_uuid.h | 15 +- 12 files changed, 249 insertions(+), 230 deletions(-) diff --git a/drivers/wireless/bluetooth/bt_uart.c b/drivers/wireless/bluetooth/bt_uart.c index 1b500278bf..dae18e603b 100644 --- a/drivers/wireless/bluetooth/bt_uart.c +++ b/drivers/wireless/bluetooth/bt_uart.c @@ -12,20 +12,21 @@ * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE @@ -105,8 +106,9 @@ static ssize_t btuart_read(FAR struct btuart_upperhalf_s *upper, return ntotal; } -static FAR struct bt_buf_s *btuart_evt_recv(FAR struct btuart_upperhalf_s *upper, - FAR unsigned int *hdrlen) +static FAR struct bt_buf_s * +btuart_evt_recv(FAR struct btuart_upperhalf_s *upper, + FAR unsigned int *hdrlen) { FAR struct bt_buf_s *buf; struct bt_hci_evt_hdr_s hdr; @@ -141,8 +143,9 @@ static FAR struct bt_buf_s *btuart_evt_recv(FAR struct btuart_upperhalf_s *upper return buf; } -static FAR struct bt_buf_s *btuart_acl_recv(FAR struct btuart_upperhalf_s *upper, - FAR unsigned int *hdrlen) +static FAR struct bt_buf_s * +btuart_acl_recv(FAR struct btuart_upperhalf_s *upper, + FAR unsigned int *hdrlen) { FAR struct bt_buf_s *buf; struct bt_hci_acl_hdr_s hdr; @@ -191,7 +194,9 @@ static void btuart_rxwork(FAR void *arg) DEBUGASSERT(upper != NULL && upper->lower != NULL); lower = upper->lower; - /* Beginning of a new packet. Read the first byte to get the packet type. */ + /* Beginning of a new packet. + * Read the first byte to get the packet type. + */ buf = NULL; hdrlen = 0; diff --git a/drivers/wireless/bluetooth/bt_uart.h b/drivers/wireless/bluetooth/bt_uart.h index 0ea6c8fa1d..9dda45ebbc 100644 --- a/drivers/wireless/bluetooth/bt_uart.h +++ b/drivers/wireless/bluetooth/bt_uart.h @@ -12,20 +12,21 @@ * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE @@ -68,7 +69,7 @@ #endif /**************************************************************************** - * Private Types + * Public Types ****************************************************************************/ /* This type defines the state data generic UART upper half driver */ diff --git a/drivers/wireless/bluetooth/bt_uart_cc2564.c b/drivers/wireless/bluetooth/bt_uart_cc2564.c index 97b04c6a05..2388784299 100644 --- a/drivers/wireless/bluetooth/bt_uart_cc2564.c +++ b/drivers/wireless/bluetooth/bt_uart_cc2564.c @@ -6,7 +6,8 @@ * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. @@ -19,7 +20,7 @@ * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE diff --git a/include/nuttx/wireless/bluetooth/bt_buf.h b/include/nuttx/wireless/bluetooth/bt_buf.h index f4d49dcc2a..79a4f6407f 100644 --- a/include/nuttx/wireless/bluetooth/bt_buf.h +++ b/include/nuttx/wireless/bluetooth/bt_buf.h @@ -12,20 +12,21 @@ * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE diff --git a/include/nuttx/wireless/bluetooth/bt_core.h b/include/nuttx/wireless/bluetooth/bt_core.h index fed32e3f9e..f4525e4567 100644 --- a/include/nuttx/wireless/bluetooth/bt_core.h +++ b/include/nuttx/wireless/bluetooth/bt_core.h @@ -12,20 +12,21 @@ * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE diff --git a/include/nuttx/wireless/bluetooth/bt_driver.h b/include/nuttx/wireless/bluetooth/bt_driver.h index db96d19067..edb4ee51c1 100644 --- a/include/nuttx/wireless/bluetooth/bt_driver.h +++ b/include/nuttx/wireless/bluetooth/bt_driver.h @@ -12,20 +12,21 @@ * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE diff --git a/include/nuttx/wireless/bluetooth/bt_gatt.h b/include/nuttx/wireless/bluetooth/bt_gatt.h index 755469eea8..e6c33d1bc9 100644 --- a/include/nuttx/wireless/bluetooth/bt_gatt.h +++ b/include/nuttx/wireless/bluetooth/bt_gatt.h @@ -12,20 +12,21 @@ * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE @@ -722,9 +723,10 @@ int bt_gatt_attr_read_service(FAR struct bt_conn_s *conn, * Name: bt_gatt_attr_read_included * * Description: - * Read include service attribute value storing the result into buffer after - * encoding it. - * NOTE: Only use this with attributes which user_data is a bt_gatt_include. + * Read include service attribute value storing the result into buffer + * after encoding it. + * NOTE: Only use this with attributes which user_data is a + * bt_gatt_include. * * Input Parameters: * conn - Connection object. @@ -765,8 +767,8 @@ int bt_gatt_attr_read_included(FAR struct bt_conn_s *conn, ****************************************************************************/ int bt_gatt_attr_read_chrc(FAR struct bt_conn_s *conn, - FAR const struct bt_gatt_attr_s *attr, FAR void *buf, - uint8_t len, uint16_t offset); + FAR const struct bt_gatt_attr_s *attr, + FAR void *buf, uint8_t len, uint16_t offset); /**************************************************************************** * Name: bt_gatt_attr_read_ccc @@ -790,8 +792,8 @@ int bt_gatt_attr_read_chrc(FAR struct bt_conn_s *conn, ****************************************************************************/ int bt_gatt_attr_read_ccc(FAR struct bt_conn_s *conn, - FAR const struct bt_gatt_attr_s *attr, FAR void *buf, - uint8_t len, uint16_t offset); + FAR const struct bt_gatt_attr_s *attr, + FAR void *buf, uint8_t len, uint16_t offset); /**************************************************************************** * Name: bt_gatt_attr_write_ccc @@ -815,7 +817,8 @@ int bt_gatt_attr_read_ccc(FAR struct bt_conn_s *conn, int bt_gatt_attr_write_ccc(FAR struct bt_conn_s *conn, FAR const struct bt_gatt_attr_s *attr, - FAR const void *buf, uint8_t len, uint16_t offset); + FAR const void *buf, uint8_t len, + uint16_t offset); /**************************************************************************** * Name: bt_gatt_attr_read_cep @@ -839,8 +842,8 @@ int bt_gatt_attr_write_ccc(FAR struct bt_conn_s *conn, ****************************************************************************/ int bt_gatt_attr_read_cep(FAR struct bt_conn_s *conn, - FAR const struct bt_gatt_attr_s *attr, FAR void *buf, - uint8_t len, uint16_t offset); + FAR const struct bt_gatt_attr_s *attr, + FAR void *buf, uint8_t len, uint16_t offset); /**************************************************************************** * Name: bt_gatt_notify @@ -900,14 +903,15 @@ void bt_gatt_disconnected(FAR struct bt_conn_s *conn); * ****************************************************************************/ -int bt_gatt_exchange_mtu(FAR struct bt_conn_s *conn, bt_gatt_rsp_func_t func); +int bt_gatt_exchange_mtu(FAR struct bt_conn_s *conn, + bt_gatt_rsp_func_t func); /**************************************************************************** * Name: bt_gatt_discover * * Description: - * This procedure is used by a client to discover a specific primary service on - * a server when only the Service UUID is known. + * This procedure is used by a client to discover a specific primary + * service on a server when only the Service UUID is known. * * For each attribute found the callback is called which can then decide * whether to continue discovering or stop. @@ -930,8 +934,8 @@ int bt_gatt_discover(FAR struct bt_conn_s *conn, * Description: * This procedure is used by a client to discover all characteristics on a * server. - * Note: In case the UUID is set in the parameter it will be matched against - * the attributes found before calling the function callback. + * Note: In case the UUID is set in the parameter it will be matched + * against the attributes found before calling the function callback. * * For each attribute found the callback is called which can then decide * whether to continue discovering or stop. @@ -946,15 +950,15 @@ int bt_gatt_discover(FAR struct bt_conn_s *conn, ****************************************************************************/ int bt_gatt_discover_characteristic(FAR struct bt_conn_s *conn, - FAR struct bt_gatt_discover_params_s *params); + FAR struct bt_gatt_discover_params_s *params); /**************************************************************************** * Name: bt_gatt_discover_descriptor * * Description: * This procedure is used by a client to discover descriptors on a server. - * Note: In case the UUID is set in the parameter it will be matched against - * the attributes found before calling the function callback. + * Note: In case the UUID is set in the parameter it will be matched + * against the attributes found before calling the function callback. * * For each attribute found the callback is called which can then decide * whether to continue discovering or stop. @@ -969,7 +973,7 @@ int bt_gatt_discover_characteristic(FAR struct bt_conn_s *conn, ****************************************************************************/ int bt_gatt_discover_descriptor(FAR struct bt_conn_s *conn, - FAR struct bt_gatt_discover_params_s *params); + FAR struct bt_gatt_discover_params_s *params); /**************************************************************************** * Name: bt_gatt_read @@ -988,8 +992,8 @@ int bt_gatt_discover_descriptor(FAR struct bt_conn_s *conn, * ****************************************************************************/ -int bt_gatt_read(FAR struct bt_conn_s *conn, uint16_t handle, uint16_t offset, - bt_gatt_read_func_t func); +int bt_gatt_read(FAR struct bt_conn_s *conn, uint16_t handle, + uint16_t offset, bt_gatt_read_func_t func); /**************************************************************************** * Name: bt_gatt_write diff --git a/include/nuttx/wireless/bluetooth/bt_ioctl.h b/include/nuttx/wireless/bluetooth/bt_ioctl.h index f8409625f1..505d165c6f 100644 --- a/include/nuttx/wireless/bluetooth/bt_ioctl.h +++ b/include/nuttx/wireless/bluetooth/bt_ioctl.h @@ -12,20 +12,21 @@ * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE @@ -195,6 +196,7 @@ #define SIOCBTDISCONNECT _WLIOC(WL_BLUETOOTHFIRST + 25) /* Definitions associated with struct btreg_s *******************************/ + /* struct btreq_s union field accessors */ #define btr_bdaddr btru.btri.btri_bdaddr @@ -320,150 +322,149 @@ struct bt_stats_s /* Common structure for Bluetooth IOCTL commands */ struct btreq_s +{ + char btr_name[IFNAMSIZ]; /* IN: Device name */ + union { - char btr_name[IFNAMSIZ]; /* IN: Device name */ - union + /* Bluetooth information used with informational query IOCTL commands */ + + struct { - /* Bluetooth information used with informational query IOCTL commands */ + bt_addr_t btri_bdaddr; /* IN/OUT: Device bdaddr */ + uint16_t btri_flags; /* OUT: flags */ + uint16_t btri_num_cmd; /* OUT: Number of free cmd buffers */ + uint16_t btri_num_acl; /* OUT: Number of free ACL buffers */ + uint16_t btri_num_sco; /* OUT: Number of free SCO buffers */ + uint16_t btri_acl_mtu; /* OUT: ACL mtu */ + uint16_t btri_sco_mtu; /* OUT: SCO mtu */ + uint16_t btri_link_policy; /* OUT: Link Policy */ + uint16_t btri_packet_type; /* OUT: Packet Type */ + uint16_t btri_max_acl; /* OUT: max ACL buffers */ + uint16_t btri_max_sco; /* OUT: max SCO buffers */ + } btri; - struct - { - bt_addr_t btri_bdaddr; /* IN/OUT: Device bdaddr */ - uint16_t btri_flags; /* OUT: flags */ - uint16_t btri_num_cmd; /* OUT: Number of free cmd buffers */ - uint16_t btri_num_acl; /* OUT: Number of free ACL buffers */ - uint16_t btri_num_sco; /* OUT: Number of free SCO buffers */ - uint16_t btri_acl_mtu; /* OUT: ACL mtu */ - uint16_t btri_sco_mtu; /* OUT: SCO mtu */ - uint16_t btri_link_policy; /* OUT: Link Policy */ - uint16_t btri_packet_type; /* OUT: Packet Type */ - uint16_t btri_max_acl; /* OUT: max ACL buffers */ - uint16_t btri_max_sco; /* OUT: max SCO buffers */ - } btri; + /* Bluetooth Features */ - /* Bluetooth Features */ + struct + { + uint8_t btrf_page0[HCI_FEATURES_SIZE]; /* OUT: Basic */ + uint8_t btrf_page1[HCI_FEATURES_SIZE]; /* OUT: Extended page 1 */ + uint8_t btrf_page2[HCI_FEATURES_SIZE]; /* OUT: Extended page 2 */ + } btrf; - struct - { - uint8_t btrf_page0[HCI_FEATURES_SIZE]; /* OUT: Basic */ - uint8_t btrf_page1[HCI_FEATURES_SIZE]; /* OUT: Extended page 1 */ - uint8_t btrf_page2[HCI_FEATURES_SIZE]; /* OUT: Extended page 2 */ - } btrf; + struct bt_stats_s btrs; /* OUT: Unit statistics */ - struct bt_stats_s btrs; /* OUT: Unit statistics */ + /* Read-only data that accompanies the SIOCBTADVSTART IOCTL command. + * Advertising types are defined in bt_hci.h. NOTE that btras_ad and + * btras_sd pointers to the beginning of a list of "Extended Inquire + * Responses". Each list is terminated with a dummy, NULL entry + * identified with a length of zero. + */ - /* Read-only data that accompanies the SIOCBTADVSTART IOCTL command. - * Advertising types are defined in bt_hci.h. NOTE that btras_ad and - * btras_sd pointers to the beginning of a list of "Extended Inquire - * Responses". Each list is terminated with a dummy, NULL entry - * identified with a length of zero. + struct + { + uint8_t btras_advtype; /* IN: Advertising type */ + FAR struct bt_eir_s *btras_advad; /* IN: Data for advertisement packets */ + FAR struct bt_eir_s *btras_advsd; /* IN: Data for scan response packets */ + } btras; + + /* NOTE: No additional data accompanies the SIOCBTADVSTOP */ + + /* The read-only data that accompanies the SIOCBTSCANSTART IOCTL + * command. + */ + + struct + { + bool btrss_dupenable; /* IN: True: enable duplicate filtering */ + } btrss; + + /* Write-able data that accompanies the SIOCBTSCANGET IOCTL command */ + + struct + { + uint8_t brtsr_nrsp; /* IN: Max number of responses + * OUT: Actual number of responses */ + + /* Reference to a beginning of an array in user memory in which to + * return the scan response data. The size of the array is + * btrsr_nrsp. */ - struct - { - uint8_t btras_advtype; /* IN: Advertising type */ - FAR struct bt_eir_s *btras_advad; /* IN: Data for advertisement packets */ - FAR struct bt_eir_s *btras_advsd; /* IN: Data for scan response packets */ - } btras; + FAR struct bt_scanresponse_s *btrsr_rsp; + } btrsr; - /* NOTE: No additional data accompanies the SIOCBTADVSTOP */ + /* NOTE: No additional data accompanies the SIOCBTSCANSTOP */ - /* The read-only data that accompanies the SIOCBTSCANSTART IOCTL - * command. - */ + /* Read-only data that accompanies the SIOCBTSECURITY IOCTL command */ - struct - { - bool btrss_dupenable; /* IN: True: enable duplicate filtering */ - } btrss; + struct + { + bt_addr_le_t btrse_secaddr; /* IN: BLE address */ + enum bt_security_e btrse_seclevel; /* IN: Security level */ + } btrse; - /* Write-able data that accompanies the SIOCBTSCANGET IOCTL command */ + /* Read-only data that accompanies SIOCBTEXCHANGE command */ - struct - { - uint8_t brtsr_nrsp; /* IN: Max number of responses - * OUT: Actual number of responses */ + struct + { + bt_addr_le_t btmx_expeer; /* IN: Peer address for MTU exchange */ + uint8_t btmx_result; /* OUT: The result of the operation */ + } btmx; - /* Reference to a beginning of an array in user memory in which to - * return the scan response data. The size of the array is - * btrsr_nrsp. - */ + /* Write-able data that accompanies SIOCBTDISCOVER command */ - FAR struct bt_scanresponse_s *btrsr_rsp; - } btrsr; + struct + { + uint8_t btrds_dtype; /* IN: Discovery type (see enum + * bt_gatt_discover_e) */ + bt_addr_le_t btrds_dpeer; /* IN: Peer address */ + uint16_t btrds_duuid16; /* IN: Discover UUID type */ + uint16_t btrds_dstart; /* IN: Discover start handle */ + uint16_t btrds_dend; /* IN: Discover end handle */ + uint8_t btrds_gnrsp; /* IN: Max number of responses + * OUT: Actual number of responses */ + FAR struct bt_discresonse_s *btrds_grsp; + int btrds_indx; /* IN: Index of first entry */ + } btrds; - /* NOTE: No additional data accompanies the SIOCBTSCANSTOP */ + /* Write-able data that accompanies the SIOCBTGATTRD command */ - /* Read-only data that accompanies the SIOCBTSECURITY IOCTL command */ + struct + { + bt_addr_le_t btgrd_rdpeer; /* IN: Peer address */ + uint8_t btgrd_rdnhandles; /* IN: Number of handles in array */ + uint16_t btgrd_rdoffset; /* IN: Offset (Only for read single) */ + uint16_t btgrd_rdhandles[HCI_GATT_MAXHANDLES]; + uint8_t btgrd_rdresult; /* OUT: Result of the read */ + uint8_t btgrd_rdsize; /* IN: Sizeof rddata[] + * OUT: Number of valid bytes */ + FAR uint8_t *btgrd_rddata; /* OUT: Values returned by read */ + } btgrd; - struct - { - bt_addr_le_t btrse_secaddr; /* IN: BLE address */ - enum bt_security_e btrse_seclevel; /* IN: Security level */ - } btrse; + /* Write-able data that accompanies the SIOCBTGATTWR command. + * NOTE: The write data provided by the caller is not buffered + * and must persist until the completion of the write. + */ - /* Read-only data that accompanies SIOCBTEXCHANGE command */ + struct + { + bt_addr_le_t btgwr_wrpeer; /* IN: Peer address */ + uint8_t btgwr_wrnbytes; /* IN: Number of bytes to write */ + uint16_t btgwr_wrhandle; /* IN: GATT handle */ + FAR uint8_t btgwr_wrdata[HCI_GATTWR_DATA]; /* IN: Data to be written */ + uint8_t btgwr_wrresult; /* OUT: The result of the operation */ + } btgwr; - struct - { - bt_addr_le_t btmx_expeer; /* IN: Peer address for MTU exchange */ - uint8_t btmx_result; /* OUT: The result of the operation */ - } btmx; + /* Read-only data that accompanies the SIOCBTCONNECT and + * SIOCBTDISCONNECT commands. + */ - /* Write-able data that accompanies SIOCBTDISCOVER command */ - - struct - { - uint8_t btrds_dtype; /* IN: Discovery type (see enum - * bt_gatt_discover_e) */ - bt_addr_le_t btrds_dpeer; /* IN: Peer address */ - uint16_t btrds_duuid16; /* IN: Discover UUID type */ - uint16_t btrds_dstart; /* IN: Discover start handle */ - uint16_t btrds_dend; /* IN: Discover end handle */ - uint8_t btrds_gnrsp; /* IN: Max number of responses - * OUT: Actual number of responses */ - FAR struct bt_discresonse_s *btrds_grsp; - int btrds_indx; /* IN: Index of first entry */ - } btrds; - - /* Write-able data that accompanies the SIOCBTGATTRD command */ - - struct - { - bt_addr_le_t btgrd_rdpeer; /* IN: Peer address */ - uint8_t btgrd_rdnhandles; /* IN: Number of handles in array */ - uint16_t btgrd_rdoffset; /* IN: Offset (Only for read single) */ - uint16_t btgrd_rdhandles[HCI_GATT_MAXHANDLES]; - uint8_t btgrd_rdresult; /* OUT: Result of the read */ - uint8_t btgrd_rdsize; /* IN: Sizeof rddata[] - * OUT: Number of valid bytes */ - FAR uint8_t *btgrd_rddata; /* OUT: Values returned by read */ - } btgrd; - - /* Write-able data that accompanies the SIOCBTGATTWR command. - * NOTE: The write data provided by the caller is not buffered - * and must persist until the completion of the write. - */ - - struct - { - bt_addr_le_t btgwr_wrpeer; /* IN: Peer address */ - uint8_t btgwr_wrnbytes; /* IN: Number of bytes to write */ - uint16_t btgwr_wrhandle; /* IN: GATT handle */ - FAR uint8_t btgwr_wrdata[HCI_GATTWR_DATA]; /* IN: Data to be written */ - uint8_t btgwr_wrresult; /* OUT: The result of the operation */ - } btgwr; - - /* Read-only data that accompanies the SIOCBTCONNECT and - * SIOCBTDISCONNECT commands. - */ - - struct - { - bt_addr_le_t btcon_peer; /* IN: Peer address */ - } btcon; - - } btru; + struct + { + bt_addr_le_t btcon_peer; /* IN: Peer address */ + } btcon; + } btru; }; /**************************************************************************** diff --git a/include/nuttx/wireless/bluetooth/bt_null.h b/include/nuttx/wireless/bluetooth/bt_null.h index 7fcffa2589..2270837608 100644 --- a/include/nuttx/wireless/bluetooth/bt_null.h +++ b/include/nuttx/wireless/bluetooth/bt_null.h @@ -6,20 +6,21 @@ * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE diff --git a/include/nuttx/wireless/bluetooth/bt_uart.h b/include/nuttx/wireless/bluetooth/bt_uart.h index 4dce3b47b6..2512826d59 100644 --- a/include/nuttx/wireless/bluetooth/bt_uart.h +++ b/include/nuttx/wireless/bluetooth/bt_uart.h @@ -12,20 +12,21 @@ * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE @@ -108,8 +109,8 @@ struct btuart_lowerhalf_s * driver to the new HCI UART BAUD. */ - CODE int (*setbaud)(FAR const struct btuart_lowerhalf_s *lower, - uint32_t baud); + CODE int (*setbaud)(FAR const struct btuart_lowerhalf_s *lower, + uint32_t baud); /* Read/write UART frames * diff --git a/include/nuttx/wireless/bluetooth/bt_uart_shim.h b/include/nuttx/wireless/bluetooth/bt_uart_shim.h index 335260018a..dcf94d2730 100644 --- a/include/nuttx/wireless/bluetooth/bt_uart_shim.h +++ b/include/nuttx/wireless/bluetooth/bt_uart_shim.h @@ -6,20 +6,21 @@ * Author: Dave Marples * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE diff --git a/include/nuttx/wireless/bluetooth/bt_uuid.h b/include/nuttx/wireless/bluetooth/bt_uuid.h index 7ae531089e..80038c55dd 100644 --- a/include/nuttx/wireless/bluetooth/bt_uuid.h +++ b/include/nuttx/wireless/bluetooth/bt_uuid.h @@ -12,20 +12,21 @@ * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE