portapack-mayhem / mayhem-firmware

Custom firmware for the HackRF+PortaPack H1/H2
GNU General Public License v3.0
3.02k stars 518 forks source link

add literal str print in asyncmsg #2113

Closed zxkmm closed 2 months ago

zxkmm commented 2 months ago

Continue work of #2111 previously: asyncmsg can only handle string obj. for example

std::string xxx = "xxx";
asyncmsg(xxx);

but not

asyncmsg("xxx");

now:

std::string xxx = "xxx";
asyncmsg(xxx);

and

asyncmsg("xxx");

are both OK

i think all template should keep in header, but to satisfying this change, i have to moved all implementation into source file (to make it readable).

but since both header and source files are fake, so you need to include both of them, when using this class, which is not elegant but i don't have any other better way.

gullradriel commented 2 months ago

Well. I think it would be better to have it in only one header, it will be easier to include without modifying the Makefile That aside I'm all on for the update.

zxkmm commented 2 months ago

But in standard, the non template methods should be in cpp. but if you don’t mind the standard I think I can move them together back in header.

zxkmm commented 2 months ago

@gullradriel i edited code per your requests

zxkmm commented 2 months ago

Thanks! I will choose your way until I find a better way.