rust3ds / ctru-rs

Rust wrapper for libctru
https://rust3ds.github.io/ctru-rs/
Other
116 stars 17 forks source link

Implement `ac:u` and `ac:i` services (Wi-Fi info) + example #140

Open adryzz opened 9 months ago

adryzz commented 9 months ago

Implements the ac service, both ac:u (user) and ac:i methods (intended for mset).

Did this because i needed some of these methods for an app

Methods implemented:

(screenshot didnt work) PXL_20231028_105524873

adryzz commented 9 months ago

also, will add that 2 days ago libctru 2.3.0 released, adding the 2 methods needed for this.

adryzz commented 9 months ago

fixed a few of the issues, will now investigate the bindings, as that's the main issue apart from the libctru version bump

adryzz commented 9 months ago

never mind, i got the enum issue sorted out.

All that remains now is the libctru version bump for the load_network_slot setting.

also cleaned up the history a bit, now all commits build

adryzz commented 8 months ago

will do right now!

adryzz commented 5 months ago

time to rebase this

adryzz commented 5 months ago

perfect! the unit tests failing have nothing to do with this PR afaik, so it all works now!

Jhynjhiruu commented 5 months ago

Seems like, once this and #156 get merged, all 3DS networking functionality besides Download Play is done - that'll be neat to see!

adryzz commented 5 months ago

Seems like, once this and #156 get merged, all 3DS networking functionality besides Download Play is done - that'll be neat to see!

what other parts of libctru/3ds services are missing? i may just try implementing other stuff too

Jhynjhiruu commented 5 months ago

Seems like, once this and #156 get merged, all 3DS networking functionality besides Download Play is done - that'll be neat to see!

what other parts of libctru/3ds services are missing? i may just try implementing other stuff too

I think at this point it's mostly less important stuff like boss, news, qtm etc. - though ir still needs some work, since the Circle Pad Pro code doesn't work properly on New 3DS. I don't think irrst is done, either, though that should probably be merged into hid in my opinion. Just go to the libctru repo and compare the source files with what's done on the ctru-rs side.

adryzz commented 5 months ago

uhh good news. i tested around the get_wifi_status function, and there are definitely more values.

3dbrew has very little information on this, and i was only able to confirm these:

I also was able to get in a few occasions the values 102 and 300 while turning on/off the Wi-Fi network, although i have no clue what they actually mean, and this suggests there may be even more values.

#[non_exhaustive] works i guess

adryzz commented 4 months ago

oh, i completely forgot this was still open, will update asap

adryzz commented 4 months ago

okay, one small issue: how do we deal with errors related to UTF-8 now? i checked and you can still run into those while being connected (e.g. a proxy username not being valid UTF-8, set from a homebrew app), so the wifi_status()-based error approach wouldn't work.

so do we create a custom AC error instead of propagating FromUtf8Error?

Meziu commented 4 months ago

so do we create a custom AC error instead of propagating FromUtf8Error?

Yeah, that should be a good choice.

adryzz commented 4 months ago

also, since we know the contents of the buffer are invalid text, we could still return the buffer as a Vec<u8>

and problem: the functions can return both crate::Error and ac::Error. how do we handle that? i see that crate::Error does not propagate any module-specific errors