sendheartbeat and sendsmallmessage rewritten to callback interface.