In file_read(), asynchronous reading is supported, so partial reads and the minread parameter are no longer needed.
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
In btuart_rxwork, There is no case for parsel HCI data of ISO type, but there are corresponding processes in the SIM and vendor driver code.
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
When the nread return value < 0, if the total length ntotal that has been read is > 0, the function returns ntotal; otherwise, it returns the nread error code.
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
Read as much data as possible initially, then process each packet individually. Defined the read buffer within the structure and added a rx_len variable to indicate the current read offset. After processing each complete packet, leftover data is moved to rxbuf[0] and rx_len is reduced by the length of the processed packet. The next packet process will start from rxbuf[0] after the read ends at new rxbuf[rx_len].
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
This commit resolves issue #16009, where a sync word of less than 64
bytes was printed as 0-padded hex. 0-padding is invalid for the RN2xx3
modules, so now it has been removed.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Driver now validates ACL provided buffer length agaist the size of
the data buffer which is defined by CONFIG_BLUETOOTH_UART_RXBUFSIZE.
Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
examples:
There are two threads involved: thread A with a priority of 100 and
thread B with a priority of 101. Here's how they interact:
When thread A releases a semaphore, thread B is scheduled to execute
some code and may reacquire the semaphore. If no other tasks are ready,
thread A will be scheduled to run.
This continuous process can lead to a busy loop.
Thread A: Thread B:
while (nxsem_get_value(&priv->wait, &semcount) >= 0 && <---
semcount <= 0) | 2)context switch
{ 1)contex switch |
nxsem_post(&priv->wait); -------------> run some code and nxsem_wait again
}
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
radio transceivers. This initial support includes transmit and receive
functionality and configuration and reading of radio parameters like
frequency and bandwidth.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
[Experimental]
This adds a driver for the SX126x (SX1261 and SX1262) LoRa chips.
All functions and definitions are coming directly from the DS SX1261-2 V2.1 datasheet.
Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
This commit cleans up redundant header file includes throughout the codebase.
The changes include:
- Removing duplicate #include directives that were present in the same file
- Consolidating includes that were split across multiple lines unnecessarily
- Removing unused includes that were no longer needed
- Fixing some formatting issues with includes
The changes improve code organization and maintainability by:
- Reducing unnecessary dependencies
- Making include dependencies more explicit
- Following consistent include patterns
- Removing dead code
No functional changes are made - this is purely a code cleanup commit.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Modify the kernel to use only atomic_xx and atomic64_xx interfaces,
avoiding the use of sizeof or typeof to determine the type of
atomic operations, thereby simplifying the kernel's atomic
interface operations.
Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This patch fixed userspace headers conflict. Architecture-related definition and API should not be exposed to users.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
that pr requires chip turn on CONFIG_DRIVERS_BLUETOOTH to use bluetooth,
but not all defconig enable this option, so let's map bt_driver_register
to bt_netdev_register in header file in this case, and revert the unnessary
change in the related chip and board folders.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
rootcause: in btuart_rxwork, read data in blocking mode and btuart_read do three times, maybe remote send some packets one time,so it wont read the sencond packets.
Signed-off-by: wangzhi7 <wangzhi7@xiaomi.com>
add bt_driver_register interface, which could handle
these cases:bth4 bth5 btbridge btslip and btuart_lowerhalf_s etc.
Signed-off-by: chengkai <chengkai@xiaomi.com>
add btuart_create interface, which would be more
flexible in complex cases. And extract btuart_register interface.
Signed-off-by: chengkai <chengkai@xiaomi.com>
BLUETOOTH_MAX_FRAMELEN buffer size is only for LE only mode.
then we need to increase HCI buffer size in BR/EDR and LE mode.
Signed-off-by: chengkai <chengkai@xiaomi.com>
when downloading rtk firmware with vendor hci cmd sending to
bt bridge, which would not filter that hci cmd.
Signed-off-by: chengkai <chengkai@xiaomi.com>
bt bridge filter would not match when ACL in data
head with Packet_Boundary_Flag 0b10. in that case connect handle
is the first 3 octets of the packet, which not match
BT_HCI_EVT_LE_CONN_COMPLETE hci event alloc handle.
Signed-off-by: chengkai <chengkai@xiaomi.com>
Summary:
1. Add nuttx/atomic.h in include
2. Use nuttx/atomic.h instead of stdatomic.h in the nuttx directory
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
/home/raiden00/git/RTOS/nuttx/nuttx/drivers/wireless/gs2200m.c:2071:3: note: ‘snprintf’ output between 7 and 9 bytes into a destination of size 8
2071 | snprintf(cmd, sizeof(cmd), "ATE%d\r\n", on);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~