[FL-1062] Add cli commands for IrDA (#409)
* irda: add ir_tx command * api-hal-vcp: add receive with timeout * cli: add command termination check function * irda: add cli_rx command * cli: reduce timeout for Ctrl+C command check * irda: fix ir_rx command * irda: add ir_tx cli command hints Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
		@@ -23,6 +23,16 @@ void api_hal_vcp_init();
 | 
			
		||||
 */
 | 
			
		||||
size_t api_hal_vcp_rx(uint8_t* buffer, size_t size);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Recieve data from VCP with timeout
 | 
			
		||||
 * Waits till some data arrives during timeout
 | 
			
		||||
 * @param buffer - pointer to buffer
 | 
			
		||||
 * @param size - buffer size
 | 
			
		||||
 * @param timeout - rx timeout in ms
 | 
			
		||||
 * @return items copied in buffer, 0 if channel closed or timeout occurs
 | 
			
		||||
 */
 | 
			
		||||
size_t api_hal_vcp_rx_with_timeout(uint8_t* buffer, size_t size, uint32_t timeout);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Transmit data to VCP
 | 
			
		||||
 * @param buffer - pointer to buffer
 | 
			
		||||
 
 | 
			
		||||
@@ -74,6 +74,11 @@ size_t api_hal_vcp_rx(uint8_t* buffer, size_t size) {
 | 
			
		||||
    return xStreamBufferReceive(api_hal_vcp->rx_stream, buffer, size, portMAX_DELAY);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
size_t api_hal_vcp_rx_with_timeout(uint8_t* buffer, size_t size, uint32_t timeout) {
 | 
			
		||||
    furi_assert(api_hal_vcp);
 | 
			
		||||
    return xStreamBufferReceive(api_hal_vcp->rx_stream, buffer, size, timeout);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void api_hal_vcp_tx(const uint8_t* buffer, size_t size) {
 | 
			
		||||
    furi_assert(api_hal_vcp);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -74,6 +74,11 @@ size_t api_hal_vcp_rx(uint8_t* buffer, size_t size) {
 | 
			
		||||
    return xStreamBufferReceive(api_hal_vcp->rx_stream, buffer, size, portMAX_DELAY);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
size_t api_hal_vcp_rx_with_timeout(uint8_t* buffer, size_t size, uint32_t timeout) {
 | 
			
		||||
    furi_assert(api_hal_vcp);
 | 
			
		||||
    return xStreamBufferReceive(api_hal_vcp->rx_stream, buffer, size, timeout);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void api_hal_vcp_tx(const uint8_t* buffer, size_t size) {
 | 
			
		||||
    furi_assert(api_hal_vcp);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user