zBeeble has quit [Read error: Connection reset by peer]
starblue has joined #rust-embedded
starblue3 has quit [Ping timeout: 240 seconds]
emerent has quit [Ping timeout: 255 seconds]
emerent has joined #rust-embedded
<re_irc>
<@john_socha:matrix.org> I have a module I created that is processor independent...mostly. I had to use a generic so the caller provides type-specific I2C information:
<re_irc>
<@dirbaio:matrix.org> > Must be able to be represented in ascii due to my shitty AT based device
<re_irc>
<@dirbaio:matrix.org> 🤯... I'm not sure HTTP itself is always fully-ascii in all situations
<re_irc>
<@mathias_koch:matrix.org> Hmm..Well, if i could solve the base64 inplace decoding, i could just change my certificates from PEM to Base64(DER), and both my issues would be solved.. 😲
<re_irc>
<@dirbaio:matrix.org> some content encodings can be binary
<re_irc>
<@dirbaio:matrix.org> might be ok if you control the client but still..
<re_irc>
<@dirbaio:matrix.org> what AT device is it? 🤣
<re_irc>
<@mathias_koch:matrix.org> Ublox cellular device.. Issue is that im cutting corners, using the offloaded http client, that writes to a file on the AT device, to be read later on.. And the file read command doesn't support HEX reading, only ascii
<re_irc>
<@mathias_koch:matrix.org> But i am on a deadline :/
<re_irc>
<@dirbaio:matrix.org> oh noo :D
<re_irc>
<@dirbaio:matrix.org> inplace base64 decode should be possible, as encoded is always longer
<re_irc>
<@mathias_koch:matrix.org> You don't happen to have a base64 decoder that mutates? :p
<re_irc>
<@mathias_koch:matrix.org> exactly
<re_irc>
<@dirbaio:matrix.org> but I think it's super rare 🤣
<re_irc>
<@dirbaio:matrix.org> i'd just roll my own, it shouldn't be that hard copypasting from an existing impl and adjusting it
<re_irc>
<@mathias_koch:matrix.org> That will probably be my go-to aswell.. Hmm, off we go i guess.
<re_irc>
<@dirbaio:matrix.org> or do hex instead of base64 if oyu can afford 2x bloat? :P
<re_irc>
<@dirbaio:matrix.org> base64 is 1.33x bloat
<re_irc>
<@dirbaio:matrix.org> btw I think regular file read should work fine with binary data
<re_irc>
<@dirbaio:matrix.org> they do on simcoms at least
<re_irc>
<@mathias_koch:matrix.org> Hmm.. interesting.. How is that encoded?
<re_irc>
<@mriise:matrix.org> u would need to move a way from JSON to use binary formats
<re_irc>
<@mathias_koch:matrix.org> Yeah, i realise that. But that wouldn't be a problem if my AT device works with binary.. I can just use COBS or CBOR, or equivalent
<re_irc>
<@dirbaio:matrix.org> you ask it to read 100 bytes, it spits the 100 bytes on the uart, raw
<re_irc>
<@dirbaio:matrix.org> so you read 100 bytes
<re_irc>
<@dirbaio:matrix.org> how to distinguish the bytes from an "ERROR" response, no idea :rofl:
<re_irc>
<@mathias_koch:matrix.org> Huh.. Guess i'll give that a shot
<re_irc>
<@mathias_koch:matrix.org> :p
<re_irc>
<@dirbaio:matrix.org> but at least you can read "raw"
<re_irc>
<@dirbaio:matrix.org> but it may be different on ubloxs, dunno :S
<re_irc>
<@mathias_koch:matrix.org> Seems a little hard to error handle in the long run?
<re_irc>
<@dirbaio:matrix.org> otherwise I dunno, haven't played with serde in nostd
<re_irc>
<@dirbaio:matrix.org> I get by fine with repr(c) hehe
<re_irc>
<@dirbaio:matrix.org> I'm ok with fixed-length-ing everything etc
<re_irc>
<@dirbaio:matrix.org> though yeah extending it is inflexible
<re_irc>
<@dirbaio:matrix.org> you can append fields, just make sure to `asert!(received_len >= size_of::<Foo>())` instead of `==`
<re_irc>
<@dirbaio:matrix.org> so that old decoders ignore the extra fields.. I've been burned by this a few times..
<re_irc>
<@dirbaio:matrix.org> literally zero code size for decoding, hard to beat that :D
fabic_ has joined #rust-embedded
cr19011 has joined #rust-embedded
cr1901 has quit [Killed (NickServ (GHOST command used by cr19011!~William@2601:8d:8600:911:7c10:167b:ad8e:ebd))]
cr19011 is now known as cr1901
<re_irc>
<@richarddodd:matrix.org> I've always wondered if you can decode escape sequences in-place. OFC depends on the scheme you are using, but if you have \\, \n, \t, \u{1234}, they are all smaller when decoded.
hifi has quit [Remote host closed the connection]
hifi has joined #rust-embedded
fabic_ has quit [Ping timeout: 252 seconds]
cr19011 has joined #rust-embedded
cr1901 has quit [Read error: Connection reset by peer]
fabic_ has joined #rust-embedded
<re_irc>
<@firefrommoonlight:matrix.org> john_socha: You only need one window with Probe-run instead of 2, you don't have to mess with config files, and the print isn't lagged
<re_irc>
<@jduchniewicz:matrix.org> I need to definitely experiment with aforementioned probe-rs and cross (maybe even dig into the project itself!)
<re_irc>
<@jduchniewicz:matrix.org> did only very simple _probing_ (excuse the pun)
<re_irc>
<@jduchniewicz:matrix.org> as most of my projects are C/C++ related ATM
<re_irc>
<@jduchniewicz:matrix.org> glad to be seeing a stark rise of Rust jobs in embedded recently though
neceve has quit [Ping timeout: 268 seconds]
<re_irc>
<@almindor:matrix.org> is there any primitive "usb-stack" written for a pin-connected usb? (e.g. manual pin operation)
<re_irc>
<@grantm11235:matrix.org> almindor: I don't know of anything written in rust, but you could check out V-USB for inspiration https://www.obdev.at/products/vusb/index.html
<re_irc>
<@almindor:matrix.org> seems promising, not sure if it's worth the trouble tho. I just wanted to use a generic hid gamepad with my mcu for fun :D
<re_irc>
<@grantm11235:matrix.org> Oh, you want the MCU to be the USB host?
<re_irc>
<@almindor:matrix.org> yeah I just wanna use a basic gamepad to control it, I thought about dismantling it and directly wiring some buttons but then I thought,... why not just usb
<re_irc>
<@grantm11235:matrix.org> USB is pretty complicated, you might want to use something simpler. I believe NES/SNES controllers just use a shift register, wiimote accessories and NES mini controllers use i2c
<re_irc>
<@almindor:matrix.org> oh this is just a generic HID gamepad, some logitech thing I dug out
<re_irc>
<@almindor:matrix.org> I'm considering dismantling and just getting some of the buttons out if possible, wire them up directly
<re_irc>
<@grantm11235:matrix.org> That would be about a billion times easier than trying to figure out a bit-banged usb host stack 🤣\
<re_irc>
<@anahata:matrix.org> Probably someone just forgot to push is all
<re_irc>
<@oddstr13:matrix.org> ^ Protip; to avoid this ever happening, use GitHub Actions to build/package and publish releases
<re_irc>
<@oddstr13:matrix.org> release-drafter is also awesome
<re_irc>
<@adamgreig:matrix.org> do you give GHA permission to publish to crates.io for you?
<re_irc>
<@adamgreig:matrix.org> `cargo-release` is nice too
<re_irc>
<@therealprof:matrix.org> As much as I love GHA, I'm not terribly crazy about relying for everything on GHA, especially when it requires more upfront work to setup than to do it manually quite a few times.
<re_irc>
<@anahata:matrix.org> Not a fan of github in general myself, MS has shown they're not at all a good steward of open source (shocking, I know)