<cr1901>
One port is used for request/response, plus a generic "could not handle request error" that's a unit struct. The intended idea is if you get a generic RequestError, then client consults port+1 to have the server consult a hashmap to get detailed error information for the client
<cr1901>
I don't use the seq_no field at all, and src ports are ephemeral so a request is uniquely identified by (src_ip, handler_key, dst_ip, dst_port) tuple (and a second request with that same tuple with overwrite detailed error info for the previous one)
ello has quit [Ping timeout: 268 seconds]
ello has joined #rust-embedded
BogdanOlar[m] has joined #rust-embedded
<BogdanOlar[m]>
Hello all! I'm thinking of writing a HAL for an EFM32 controller I have lying around. Can anyone recommend a HAL crate which implements embedded-hal 1.0?
<TimHilt[m]1>
Is 3 wire SPI implemented in embedded-hal? I’m not too deep into the ecosystem and a quick google search unfortunately didn’t yield anything useful
<JamesMunns[m]>
4 is the length of the byte slice and 5 is the length of the str
<michaeldesilva[m>
JamesMunns[m]: I'm slow hahaha
<michaeldesilva[m>
thanks
<michaeldesilva[m>
Top of my head, say you want to fetch the Nth element in the buffer it will need to read N length “indexes” right?
<michaeldesilva[m>
* “indexes” right? Or as the buffer it created, create a lookup that has index: length offset in say a HashMap.
<michaeldesilva[m>
* “indexes” right? Or as the buffer is created, create a lookup that has index: length offset in say a HashMap.
<michaeldesilva[m>
* “indexes” right? Or as the buffer is created, create a lookup that has index: length offset in say a HashMap. I haven’t had time to read the library source yet (been busy with other stuff)
<JamesMunns[m]>
Are you asking about Postcard? It doesn't give you "query-like" abilities - you do the deserialization, then it is a hashmap.
IlPalazzo-ojiisa has joined #rust-embedded
Henk[m] has quit [Quit: Idle timeout reached: 172800s]
mrtazz has quit [Quit: Leaving.]
SunClonus has quit [Read error: Connection reset by peer]
<michaeldesilva[m>
<JamesMunns[m]> "Are you asking about Postcard..." <- Ah got it.
<michaeldesilva[m>
* got it. Yeah I saw it desers like Serde back to a struct etc.
korken89[m] has quit [Quit: Idle timeout reached: 172800s]
<JamesMunns[m]>
"I don't mind this is unsafe": what you're doing is undefined behavior and the compiler is allowed to punch you and steal your lunch money at any time (including only on odd numbered days if it feels like it).
<JamesMunns[m]>
You probably want to destructure the parts of the Peripheral struct so you can hand out different pieces to different constructors.
adamgreig[m] has joined #rust-embedded
<adamgreig[m]>
yea, the best thing is to give owned/mut-ref individual items out of the peripherals struct, don't actually pass the whole struct into the function