flipperzero icon indicating copy to clipboard operation
flipperzero copied to clipboard

Initial SubGhz development

Open QuantumEF opened this issue 1 year ago • 5 comments

Initial work, opening draft pull request to solicit feedback and comments.

This is not yet finished as I have not yet implemented the builder for the CustomSubGhzPreset to allow for custom presets.

QuantumEF avatar Oct 08 '24 03:10 QuantumEF

With this latest commit, the following basic app does work and does not crash.

//! Template project for Flipper Zero.
//! This app prints "Hello, Rust!" to the console then exits.

#![no_main]
#![no_std]

// Required for panic handler
// use flipperzero_rt;

extern crate flipperzero_alloc;

use core::ffi::CStr;

use flipperzero::dialogs::alert;
use flipperzero::println;
use flipperzero::subghz;
use flipperzero_rt::{entry, manifest};

// Define the FAP Manifest for this application
manifest!(
    name = "Flipper Zero Rust",
    app_version = 1,
    has_icon = true,
    // See https://github.com/flipperzero-rs/flipperzero/blob/v0.11.0/docs/icons.md for icon format
    icon = "rustacean-10x10.icon",
);

// Define the entry function
entry!(main);

// Entry point
fn main(_args: Option<&CStr>) -> i32 {
    alert("Hello Erik");

    let dev_name = c"cc1101_int";

    let x = subghz::SubGhz::subghz_devices_get_by_name(dev_name);

    match x {
        Some(_) => alert("YEA"),
        None => alert("Boooo"),
    }

    0
}

QuantumEF avatar Oct 12 '24 02:10 QuantumEF

@dcoles Do you have time to give feedback on what I have done so far? ie: just how I have started going about doing things. As mentioned in my previous comment, I have only tested just opening device. I am continuing testing to validate the functionality of other things.

QuantumEF avatar Oct 12 '24 02:10 QuantumEF

The first iteration of the changes

They maybe nitpicky, but I wish that they will be helpful

Thank you so much for your feedback and help! As you see I have gone through most of your suggestions and added them. The ones I have not marked as resolved yet are because I did want to think on them and possible discuss them more.

In my error, I lost some of the comments on the changes I marked as resolved because I assumed the "Marked as resolved" button did something similar to the "Comment and mark as resolved" button I have seen elsewhere; Oops, most of those comments were just referencing the commit I changed things in.

QuantumEF avatar Oct 13 '24 19:10 QuantumEF

Thank you so much for your feedback and help!

You are welcome! Thank you for working on this feature!

As you see I have gone through most of your suggestions and added them. The ones I have not marked as resolved yet are because I did want to think on them and possible discuss them more.

For sure! I understand that this is a draft, so my review should be considered as more of the recommendations by now :)

In my error, I lost some of the comments on the changes I marked as resolved because I assumed the "Marked as resolved" button did something similar to the "Comment and mark as resolved" button I have seen elsewhere; Oops, most of those comments were just referencing the commit I changed things in.

No problems, GitHub is a bit weird with PR review threads anyway

JarvisCraft avatar Oct 13 '24 23:10 JarvisCraft

It may take me some time to continue the review (I will be at the conference for a few days) thus feel free to leave some questions unresolved as-is since eventually the will be reviewed

JarvisCraft avatar Oct 13 '24 23:10 JarvisCraft