.initial commit
[x] connect to the device [x] find service and characteristic
This commit is contained in:
		
							parent
							
								
									4b2456ee53
								
							
						
					
					
						commit
						534b300931
					
				
							
								
								
									
										11
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								src/main.rs
									
									
									
									
									
								
							@ -25,7 +25,7 @@ async fn main() -> bluer::Result<()> {
 | 
				
			|||||||
                let device = adapter.device(addr)?;
 | 
					                let device = adapter.device(addr)?;
 | 
				
			||||||
                match find_neopixel_service(&device).await {
 | 
					                match find_neopixel_service(&device).await {
 | 
				
			||||||
                    Ok(Some(char)) => {
 | 
					                    Ok(Some(char)) => {
 | 
				
			||||||
                        send seg
 | 
					                        send_seq(char)
 | 
				
			||||||
                        println!("found characteristic");
 | 
					                        println!("found characteristic");
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    Ok(None) => {
 | 
					                    Ok(None) => {
 | 
				
			||||||
@ -49,6 +49,15 @@ async fn main() -> bluer::Result<()> {
 | 
				
			|||||||
    Ok(())
 | 
					    Ok(())
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async fn send_seq(char: &Characteristic) -> {
 | 
				
			||||||
 | 
					    println!("  Characteristic flags : {:?}, ", char.flags().await?);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    let base_data = vec![0x00, 0x00, 0x01];
 | 
				
			||||||
 | 
					    for i in 0..10 {
 | 
				
			||||||
 | 
					#         base_data.
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async fn connect(device: &Device, retries: u8) -> bluer::Result<()> {
 | 
					async fn connect(device: &Device, retries: u8) -> bluer::Result<()> {
 | 
				
			||||||
    if device.is_connected().await? {
 | 
					    if device.is_connected().await? {
 | 
				
			||||||
        return Ok(())
 | 
					        return Ok(())
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user