I think this should have a return type of Nothing instead, as that’s what your function is returning. I don’t have MQTT set up though, so I can’t test it.
As an aside, have you considered using BinaryBuilder to create the wrapper? It should make using this a bunch easier, though the callback will probably still need some fiddling. At least you won’t have to define the ccall stuff yourself. (And you’d also make it available for install via Pkg)