Fix nxstyle warning

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2020-12-27 03:13:27 +08:00
committed by Alin Jerpelea
parent d75895586a
commit f992ff37c3
12 changed files with 249 additions and 230 deletions
+17 -12
View File
@@ -12,20 +12,21 @@
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * 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, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* 3. Neither the name of the copyright holder nor the names of its * 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 * contributors may be used to endorse or promote products derived from
* software without specific prior written permission. * 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 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * 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; return ntotal;
} }
static FAR struct bt_buf_s *btuart_evt_recv(FAR struct btuart_upperhalf_s *upper, static FAR struct bt_buf_s *
FAR unsigned int *hdrlen) btuart_evt_recv(FAR struct btuart_upperhalf_s *upper,
FAR unsigned int *hdrlen)
{ {
FAR struct bt_buf_s *buf; FAR struct bt_buf_s *buf;
struct bt_hci_evt_hdr_s hdr; 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; return buf;
} }
static FAR struct bt_buf_s *btuart_acl_recv(FAR struct btuart_upperhalf_s *upper, static FAR struct bt_buf_s *
FAR unsigned int *hdrlen) btuart_acl_recv(FAR struct btuart_upperhalf_s *upper,
FAR unsigned int *hdrlen)
{ {
FAR struct bt_buf_s *buf; FAR struct bt_buf_s *buf;
struct bt_hci_acl_hdr_s hdr; struct bt_hci_acl_hdr_s hdr;
@@ -191,7 +194,9 @@ static void btuart_rxwork(FAR void *arg)
DEBUGASSERT(upper != NULL && upper->lower != NULL); DEBUGASSERT(upper != NULL && upper->lower != NULL);
lower = upper->lower; 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; buf = NULL;
hdrlen = 0; hdrlen = 0;
+9 -8
View File
@@ -12,20 +12,21 @@
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * 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, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* 3. Neither the name of the copyright holder nor the names of its * 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 * contributors may be used to endorse or promote products derived from
* software without specific prior written permission. * 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 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
@@ -68,7 +69,7 @@
#endif #endif
/**************************************************************************** /****************************************************************************
* Private Types * Public Types
****************************************************************************/ ****************************************************************************/
/* This type defines the state data generic UART upper half driver */ /* This type defines the state data generic UART upper half driver */
+3 -2
View File
@@ -6,7 +6,8 @@
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * 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, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
@@ -19,7 +20,7 @@
* contributors may be used to endorse or promote products derived from * contributors may be used to endorse or promote products derived from
* this software without specific prior written permission. * 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 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+8 -7
View File
@@ -12,20 +12,21 @@
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * 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, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* 3. Neither the name of the copyright holder nor the names of its * 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 * contributors may be used to endorse or promote products derived from
* software without specific prior written permission. * 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 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+8 -7
View File
@@ -12,20 +12,21 @@
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * 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, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* 3. Neither the name of the copyright holder nor the names of its * 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 * contributors may be used to endorse or promote products derived from
* software without specific prior written permission. * 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 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+8 -7
View File
@@ -12,20 +12,21 @@
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * 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, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* 3. Neither the name of the copyright holder nor the names of its * 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 * contributors may be used to endorse or promote products derived from
* software without specific prior written permission. * 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 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+32 -28
View File
@@ -12,20 +12,21 @@
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * 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, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* 3. Neither the name of the copyright holder nor the names of its * 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 * contributors may be used to endorse or promote products derived from
* software without specific prior written permission. * 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 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * 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 * Name: bt_gatt_attr_read_included
* *
* Description: * Description:
* Read include service attribute value storing the result into buffer after * Read include service attribute value storing the result into buffer
* encoding it. * after encoding it.
* NOTE: Only use this with attributes which user_data is a bt_gatt_include. * NOTE: Only use this with attributes which user_data is a
* bt_gatt_include.
* *
* Input Parameters: * Input Parameters:
* conn - Connection object. * 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, int bt_gatt_attr_read_chrc(FAR struct bt_conn_s *conn,
FAR const struct bt_gatt_attr_s *attr, FAR void *buf, FAR const struct bt_gatt_attr_s *attr,
uint8_t len, uint16_t offset); FAR void *buf, uint8_t len, uint16_t offset);
/**************************************************************************** /****************************************************************************
* Name: bt_gatt_attr_read_ccc * 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, int bt_gatt_attr_read_ccc(FAR struct bt_conn_s *conn,
FAR const struct bt_gatt_attr_s *attr, FAR void *buf, FAR const struct bt_gatt_attr_s *attr,
uint8_t len, uint16_t offset); FAR void *buf, uint8_t len, uint16_t offset);
/**************************************************************************** /****************************************************************************
* Name: bt_gatt_attr_write_ccc * 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, int bt_gatt_attr_write_ccc(FAR struct bt_conn_s *conn,
FAR const struct bt_gatt_attr_s *attr, 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 * 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, int bt_gatt_attr_read_cep(FAR struct bt_conn_s *conn,
FAR const struct bt_gatt_attr_s *attr, FAR void *buf, FAR const struct bt_gatt_attr_s *attr,
uint8_t len, uint16_t offset); FAR void *buf, uint8_t len, uint16_t offset);
/**************************************************************************** /****************************************************************************
* Name: bt_gatt_notify * 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 * Name: bt_gatt_discover
* *
* Description: * Description:
* This procedure is used by a client to discover a specific primary service on * This procedure is used by a client to discover a specific primary
* a server when only the Service UUID is known. * service on a server when only the Service UUID is known.
* *
* For each attribute found the callback is called which can then decide * For each attribute found the callback is called which can then decide
* whether to continue discovering or stop. * whether to continue discovering or stop.
@@ -930,8 +934,8 @@ int bt_gatt_discover(FAR struct bt_conn_s *conn,
* Description: * Description:
* This procedure is used by a client to discover all characteristics on a * This procedure is used by a client to discover all characteristics on a
* server. * server.
* Note: In case the UUID is set in the parameter it will be matched against * Note: In case the UUID is set in the parameter it will be matched
* the attributes found before calling the function callback. * against the attributes found before calling the function callback.
* *
* For each attribute found the callback is called which can then decide * For each attribute found the callback is called which can then decide
* whether to continue discovering or stop. * 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, 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 * Name: bt_gatt_discover_descriptor
* *
* Description: * Description:
* This procedure is used by a client to discover descriptors on a server. * 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 * Note: In case the UUID is set in the parameter it will be matched
* the attributes found before calling the function callback. * against the attributes found before calling the function callback.
* *
* For each attribute found the callback is called which can then decide * For each attribute found the callback is called which can then decide
* whether to continue discovering or stop. * 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, 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 * 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, int bt_gatt_read(FAR struct bt_conn_s *conn, uint16_t handle,
bt_gatt_read_func_t func); uint16_t offset, bt_gatt_read_func_t func);
/**************************************************************************** /****************************************************************************
* Name: bt_gatt_write * Name: bt_gatt_write
+130 -129
View File
@@ -12,20 +12,21 @@
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * 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, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* 3. Neither the name of the copyright holder nor the names of its * 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 * contributors may be used to endorse or promote products derived from
* software without specific prior written permission. * 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 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
@@ -195,6 +196,7 @@
#define SIOCBTDISCONNECT _WLIOC(WL_BLUETOOTHFIRST + 25) #define SIOCBTDISCONNECT _WLIOC(WL_BLUETOOTHFIRST + 25)
/* Definitions associated with struct btreg_s *******************************/ /* Definitions associated with struct btreg_s *******************************/
/* struct btreq_s union field accessors */ /* struct btreq_s union field accessors */
#define btr_bdaddr btru.btri.btri_bdaddr #define btr_bdaddr btru.btri.btri_bdaddr
@@ -320,150 +322,149 @@ struct bt_stats_s
/* Common structure for Bluetooth IOCTL commands */ /* Common structure for Bluetooth IOCTL commands */
struct btreq_s struct btreq_s
{
char btr_name[IFNAMSIZ]; /* IN: Device name */
union
{ {
char btr_name[IFNAMSIZ]; /* IN: Device name */ /* Bluetooth information used with informational query IOCTL commands */
union
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 /* Bluetooth Features */
{
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 */ 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 struct bt_stats_s btrs; /* OUT: Unit statistics */
{
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 */ /* 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. struct
* 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 uint8_t btras_advtype; /* IN: Advertising type */
* Responses". Each list is terminated with a dummy, NULL entry FAR struct bt_eir_s *btras_advad; /* IN: Data for advertisement packets */
* identified with a length of zero. 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 FAR struct bt_scanresponse_s *btrsr_rsp;
{ } btrsr;
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 */ /* NOTE: No additional data accompanies the SIOCBTSCANSTOP */
/* The read-only data that accompanies the SIOCBTSCANSTART IOCTL /* Read-only data that accompanies the SIOCBTSECURITY IOCTL command */
* command.
*/
struct struct
{ {
bool btrss_dupenable; /* IN: True: enable duplicate filtering */ bt_addr_le_t btrse_secaddr; /* IN: BLE address */
} btrss; 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 struct
{ {
uint8_t brtsr_nrsp; /* IN: Max number of responses bt_addr_le_t btmx_expeer; /* IN: Peer address for MTU exchange */
* OUT: Actual number of responses */ uint8_t btmx_result; /* OUT: The result of the operation */
} btmx;
/* Reference to a beginning of an array in user memory in which to /* Write-able data that accompanies SIOCBTDISCOVER command */
* return the scan response data. The size of the array is
* btrsr_nrsp.
*/
FAR struct bt_scanresponse_s *btrsr_rsp; struct
} btrsr; {
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 /* Write-able data that accompanies the SIOCBTGATTWR command.
{ * NOTE: The write data provided by the caller is not buffered
bt_addr_le_t btrse_secaddr; /* IN: BLE address */ * and must persist until the completion of the write.
enum bt_security_e btrse_seclevel; /* IN: Security level */ */
} btrse;
/* 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 /* Read-only data that accompanies the SIOCBTCONNECT and
{ * SIOCBTDISCONNECT commands.
bt_addr_le_t btmx_expeer; /* IN: Peer address for MTU exchange */ */
uint8_t btmx_result; /* OUT: The result of the operation */
} btmx;
/* Write-able data that accompanies SIOCBTDISCOVER command */ struct
{
struct bt_addr_le_t btcon_peer; /* IN: Peer address */
{ } btcon;
uint8_t btrds_dtype; /* IN: Discovery type (see enum } btru;
* 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;
}; };
/**************************************************************************** /****************************************************************************
+8 -7
View File
@@ -6,20 +6,21 @@
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * 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, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* 3. Neither the name of the copyright holder nor the names of its * 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 * contributors may be used to endorse or promote products derived from
* software without specific prior written permission. * 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 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+10 -9
View File
@@ -12,20 +12,21 @@
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * 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, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* 3. Neither the name of the copyright holder nor the names of its * 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 * contributors may be used to endorse or promote products derived from
* software without specific prior written permission. * 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 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * 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. * driver to the new HCI UART BAUD.
*/ */
CODE int (*setbaud)(FAR const struct btuart_lowerhalf_s *lower, CODE int (*setbaud)(FAR const struct btuart_lowerhalf_s *lower,
uint32_t baud); uint32_t baud);
/* Read/write UART frames /* Read/write UART frames
* *
@@ -6,20 +6,21 @@
* Author: Dave Marples <dave@marples.net> * Author: Dave Marples <dave@marples.net>
* *
* Redistribution and use in source and binary forms, with or without * 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, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* 3. Neither the name of the copyright holder nor the names of its * 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 * contributors may be used to endorse or promote products derived from
* software without specific prior written permission. * 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 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+8 -7
View File
@@ -12,20 +12,21 @@
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * 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, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* 3. Neither the name of the copyright holder nor the names of its * 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 * contributors may be used to endorse or promote products derived from
* software without specific prior written permission. * 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 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE