Files
r701/r701
nicolabelluti 28186c7745
Check, format and test / build (push) Successful in 10m0s
feat(oxibadge): add month-confirmation flow and fetch records/employees
Adds the screen after onboarding: pick a month/year (ConfirmMonth), show
loading screens while the device is queried, then download that month's
records and resolve each distinct employee's name, printing both to
stdout (debug pretty-print) before landing on the placeholder "done"
screen.

- r701: RecordIterator's boxed stream is now Send, required for it to
  cross into a Tauri command's future.
- oxibadge: load_records/load_employees commands, sharing the existing
  3-retry connect_with_retries helper. load_records uses skip_while/
  take_while on the device's newest-first stream to grab only the
  target month without walking its whole history, then a single
  collect + in-place Vec::reverse() back to chronological order.
- Shared LoadingScreen/Intro components extracted so future screens
  reuse the same look without duplicating markup/CSS.

Assisted-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-07 12:47:36 +02:00
..

R701 🕰️

Rust Claude Code GNU AGPLv3.0 License Buymeacoffee
CI Badge


A reverse-engineered library to communicate with the R701 by I.P.S. Informatica, written in Rust

If you want to read about this reverse engineering attempt, check out https://nicolabelluti.me/series/attendance-reader/.

Library Usage

  1. Add the library to you project:

    cargo add r701 --git https://git.nicolabelluti.me/nicolabelluti/r701.git
    
  2. Use the library in you project:

    This library is async and built on tokio; add it to your own [dependencies] (e.g. tokio = { version = "1", features = ["rt-multi-thread", "macros"] }) to run the example below.

    use r701::R701;
    use tokio_stream::StreamExt;
    
    #[tokio::main]
    async fn main() {
        let r701 = R701::connect("127.0.0.1:5005").await.unwrap();
        let mut record_stream = r701.into_record_iter().await.unwrap();
        let mut id = 0;
    
        println!("No\tMchn\tEnNo\t\tName\t\tMode\tIOMd\tDateTime\t");
        while let Some(record) = record_stream.next().await {
            let record = record.unwrap();
            let name = match r701.get_name(record.employee_id).await.unwrap() {
                Some(Ok(name)) => name,
                Some(Err(error)) => String::from_utf8_lossy(error.as_bytes()).into_owned(),
                None => format!("user #{}", record.employee_id),
            };
    
            println!(
                "{:0>6}\t{}\t{:0>9}\t{: <10}\t{}\t{}\t{}",
                id + 1,
                1,
                record.employee_id,
                name,
                35,
                record.clock as u8,
                record.datetime.format("%Y/%m/%d  %H:%M:%S"),
            );
    
            id += 1;
        }
    }