ir_sony_encode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– ir_sony_encode(9) β€” the kernel API manual, but make it cute πŸŽ€

okay so bestie, welcome to ir_sony_encode(9) ✨ this is a page from the Kernel API Manual and it's literally all about turning a scancode into a little parade of raw IR events. no cap, it's giving "translator for the infrared girlies" πŸ’…


🌸 NAME 🌸

ir_sony_encode β€” Encode a scancode as a stream of raw events πŸ¦‹

like. that's the whole vibe. one scancode in, a whole stream of events out. iconic.


✨ SYNOPSIS ✨

int ir_sony_encode (enum rc_proto protocol , u32 scancode , struct
ir_raw_event *events , unsigned int max );

that's the signature, bestie β€” copied character for character, I would never do you dirty like that 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • protocol β€” the protocol to encode πŸ’« like, which dialect of IR we're speaking rn
  • scancode β€” the scancode to encode πŸ”₯ this is the thing you're translating
  • events β€” array of raw ir events to write into 🌈 this is where the output goes, it's the canvas, it's the main character
  • max β€” maximum size of events πŸ“ the absolute limit, the boundaries, the "know your limits" moment

πŸ’€ RETURN πŸ’€

So here's what you get back, and honestly pay attention because this is the important part:

  • The number of events written. πŸŽ‰ slay, it worked, here's your count
  • -ENOBUFS if there isn't enough space in the array to fit the encoding 😭 okay so the array was too small, it's not you it's the buffer
    • and ngl, in that case all max events will have been written β€” like it fills up everything it possibly can and then tells you it ran out of room. it's doing its best, fr fr πŸ™ˆ
⚠️ bestie please check the return value. -ENOBUFS means your array got absolutely stuffed to the brim and the encoding did not fully fit. that's a real caveat, not a vibe check you can skip πŸ’…

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./drivers/media/rc/ir-sony-decoder.c 🌟
  • ir_sony_decode(9) πŸ’œ β€” the other half of the duo, the decoder to this encoder, the remix to this original

and that's the page!! go forth and encode, you absolute legend πŸ‘‘πŸ’–

this little meet-cute happened in ./drivers/media/rc, dated October 2026 β€” mwah, love u, bye πŸ’‹βœ¨

πŸ“¦ where this page comes from